示例#1
0
        private void MapMagazines(FluentR2RML rml)
        {
            this.magazineMap = rml.CreateTriplesMapFromR2RMLView("select * from [Sources].[Magazine]");
            this.magazineMap.SubjectMap.IsTemplateValued(this.config.BaseResourceNamespace + "magazine/{Name}");
            this.magazineMap.SubjectMap.AddClass(new Uri(Schema.Periodical));
            this.magazineMap.SubjectMap.AddClass(new Uri(Wbo.Magazine));
            this.magazineMap.SubjectMap.CreateGraphMap().IsTemplateValued(MagazineGraphTemplate);

            this.MapMagazineTitle(this.magazineMap);
        }
示例#2
0
        private FluentR2RML CreateMappings()
        {
            var rml = new FluentR2RML();

            this.MapBooksAndBrochures(rml);
            this.MapMagazines(rml);
            this.MapMagazineIssues(rml);
            this.MapMetadata(rml);

            return(rml);
        }
示例#3
0
        private void MapMagazineIssues(FluentR2RML rml)
        {
            var template = this.config.BaseResourceNamespace + "magazine/{Magazine}/issue/{MagIssueNumber}";

            this.magIssueMap = rml.CreateTriplesMapFromR2RMLView(SelectMagIssues);
            this.magIssueMap.SubjectMap.IsTemplateValued(template);
            this.magIssueMap.SubjectMap.AddClass(new Uri(Schema.PublicationIssue));
            this.magIssueMap.SubjectMap.CreateGraphMap().IsTemplateValued(SourceGraphTemplate);

            this.MapLanguages(this.magIssueMap);
            this.MapDate(this.magIssueMap);
            this.MapImage(this.magIssueMap);
            this.MapIssueParent(this.magIssueMap);
            this.MapPagesCount(this.magIssueMap);

            this.magIssueMap.MapColumn("MagIssueNumber", Schema.issueNumber, new Uri(Xsd.@string));
        }
示例#4
0
        private void MapBooksAndBrochures(FluentR2RML rml)
        {
            this.sourceMap = rml.CreateTriplesMapFromR2RMLView(SelectBrochureAndBook);
            var template = this.config.BaseResourceNamespace + "{TypeLower}/{Id}";

            this.sourceMap.SubjectMap.IsTemplateValued(template);
            this.sourceMap.SubjectMap.CreateGraphMap().IsTemplateValued(SourceGraphTemplate);

            this.MapFolderName(this.sourceMap);
            this.MapType(this.sourceMap);
            this.MapLanguages(this.sourceMap);
            this.MapPagesCount(this.sourceMap);
            this.MapFolderCode(this.sourceMap);
            this.MapDate(this.sourceMap);
            this.MapBookAuthor(this.sourceMap);
            this.MapBookISBN(this.sourceMap);
            this.MapImage(this.sourceMap);
        }
示例#5
0
        private void MapMetadata(FluentR2RML rml)
        {
            var metadataMapping = rml.CreateTriplesMapFromR2RMLView("select Id from [Sources].[Magazine]");

            metadataMapping.SubjectMap.IsTemplateValued(MagazineGraphTemplate);

            var magazineMeta = metadataMapping.CreatePropertyObjectMap();

            magazineMeta.CreateRefObjectMap(this.magazineMap).AddJoinCondition("Id", "Id");
            magazineMeta.CreatePredicateMap().IsConstantValued(new Uri(Foaf.primaryTopic));

            metadataMapping = rml.CreateTriplesMapFromR2RMLView("select [Id], [SourceType] from [Sources].[Source]");
            metadataMapping.SubjectMap.IsTemplateValued(SourceGraphTemplate);

            var issueMeta = metadataMapping.CreatePropertyObjectMap();

            issueMeta.CreateRefObjectMap(this.magIssueMap).AddJoinCondition("Id", "Id");
            issueMeta.CreatePredicateMap().IsConstantValued(new Uri(Foaf.primaryTopic));

            var sourceMeta = metadataMapping.CreatePropertyObjectMap();

            sourceMeta.CreateRefObjectMap(this.sourceMap).AddJoinCondition("Id", "Id");
            sourceMeta.CreatePredicateMap().IsConstantValued(new Uri(Foaf.primaryTopic));
        }