-- R2RML Mapping in RDF-Turtle that describes -- How to Map the N-Tuple Relation (Table) "partei"."lobbywatch_public"."lobbywatch" -- To the 3-Tuple Relation <#Party> -- Load R2RML to a Named Graph SPARQL PREFIX rdf: PREFIX skos: PREFIX owl: PREFIX schema: PREFIX virtcxml: PREFIX rdfs: PREFIX ldp: PREFIX rr: PREFIX dbpedia-owl: PREFIX xsd: PREFIX : <#> INSERT { GRAPH { :Party a rr:TriplesMap ; rdfs:comment """R2RML Mapping in RDF-Turtle that describes How to Map the N-Tuple Relation (Table) "partei"."lobbywatch_public"."lobbywatch" To the 3-Tuple Relation <#Party> . """@en ; rr:logicalTable [ rr:tableName "partei" ; rr:tableOwner "lobbywatch_public" ; rr:tableSchema "lobbywatch" ] ; rr:subjectMap [ rr:class schema:Organization , dbpedia-owl:PoliticalParty ; rr:template "https://lod.lobbywatch.ch/party/{abkuerzung}" ; ## Added this Named Graph assignment for RDF View to be generated from ## Quad Maps defined below, since it was missing from the original R2RML rr:graph ] ; rr:predicateObjectMap [ rr:predicate schema:foundingDate ; rr:objectMap [ rr:column "gruendung" ; rr:datatype xsd:date ] ; ] , [ rr:predicate schema:name ; rr:objectMap [ rr:column "name" ; rr:language "de" ] ; ] , [ rr:predicate schema:name ; rr:objectMap [ rr:column "name_fr" ; rr:language "fr" ] ; ] , [ rr:predicate skos:altLabel ; rr:objectMap [ rr:column "abkuerzung" ; rr:language "de" ] ; ] , [ rr:predicate skos:altLabel ; rr:objectMap [ rr:column "abkuerzung_fr" ; rr:language "fr" ] ; ] , [ rr:predicate schema:url ; rr:objectMap [ rr:column "homepage" ] ; ] . } } ; SELECT DB.DBA.R2RML_TEST ('urn:r2rml:table:mapping:partei'); DB.DBA.OVL_VALIDATE ('urn:r2rml:table:mapping:partei', 'http://www.w3.org/ns/r2rml#OVL'); -- Running the validation in order to find error in name of R2RML description graph DB.DBA.OVL_VALIDATE ('urn:r2rml:table:mapping:partei-nosuch', 'http://www.w3.org/ns/r2rml#OVL'); -- Running the validation in order to find error in name of R2RML metadata graph DB.DBA.OVL_VALIDATE ('urn:r2rml:table:mapping:partei', 'http://www.w3.org/ns/r2rml#OVL-nosuch'); -- Double check syntactic correctness of R2RML -- SELECT DB.DBA.R2RML_EXECUTE ('urn:r2rml:table:mapping:partei'); -- Generate Quad Maps from R2RML EXEC ('SPARQL ' || DB.DBA.R2RML_MAKE_QM_FROM_G ('urn:r2rml:table:mapping:partei')); -- Test RDF Views generaated from Quad Map SPARQL SELECT * FROM WHERE { ?s ?p ?o . } ;