Skip to content

Commit

Permalink
mapping templates
Browse files Browse the repository at this point in the history
  • Loading branch information
dachafra committed Oct 5, 2020
1 parent 0bbd081 commit d198527
Show file tree
Hide file tree
Showing 2 changed files with 91 additions and 0 deletions.
58 changes: 58 additions & 0 deletions mapping-templates/template-rml.ttl
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
@prefix rr: <http://www.w3.org/ns/r2rml#>.
@prefix rml: <http://semweb.mmlab.be/ns/rml#>.
@prefix ql: <http://semweb.mmlab.be/ns/ql#>.
@prefix transit: <http://vocab.org/transit/terms/>.
@prefix xsd: <http://www.w3.org/2001/XMLSchema#>.
@prefix wgs84_pos: <http://www.w3.org/2003/01/geo/wgs84_pos#>.
@prefix vocab: <http://example.org#> .
@base <http://example.com/ns#>.

<#TriplesMap1>
rml:logicalSource [
rml:source "PathToData.csv" ;
rml:referenceFormulation ql:CSV
];
rr:subjectMap [
rr:template "http://subjectUri/{columnReference}";
rr:class vocab:MyClass
];

rr:predicateObjectMap [
rr:predicate vocab:property1;
rr:objectMap [
rml:reference "column"
]
];

rr:predicateObjectMap [
rr:predicate vocab:property2;
rr:objectMap [
rml:reference "uri-colum";
rr:termType rr:IRI.
]
];

rr:predicateObjectMap [
rr:predicate vocab:property3;
rr:objectMap [
rml:reference "integer-column";
rr:datatype <http://www.w3.org/2001/XMLSchema#integer>
]
];

rr:predicateObjectMap [
rr:predicate vocab:relation;
rr:objectMap [
rr:parentTriplesMap <#TriplesMap2>
]
] .

<#TriplesMap2>
rml:logicalSource [
rml:source "PathToData.csv" ;
rml:referenceFormulation ql:CSV
];
rr:subjectMap [
rml:reference "columnReference";
rr:class vocab:MyClass2
].
33 changes: 33 additions & 0 deletions mapping-templates/template-yarrrml.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
prefixes:
rr: http://www.w3.org/ns/r2rml#
foaf: http://xmlns.com/foaf/0.1/
xsd: http://www.w3.org/2001/XMLSchema#
rdfs: http://www.w3.org/2000/01/rdf-schema#
rev: http://purl.org/stuff/rev#
schema: http://schema.org/
dct: http://purl.org/dc/terms/
rml: http://semweb.mmlab.be/ns/rml#
ql: http://semweb.mmlab.be/ns/ql#
rdf: http://www.w3.org/1999/02/22-rdf-syntax-ns#
vocab: http://example.org#

mappings:
triplesmap1:
sources:
- [pathToData.csv~csv]
s: http://subjectUri/$(columnReference)
po:
- [a, vocab:MyClass]
- [vocab:property1,$(column)]
- [vocab:property2,$(uri-column)~iri]
- [vocab:property3,$(integer-column),xsd:integer]
- p: vocab:relation
o:
mapping: triplesmap2

triplesmap2:
sources:
- [pathToData.csv~csv]
s: $(uri-column)
po:
- [a, vocab:MyClass2]

0 comments on commit d198527

Please sign in to comment.