Closed mchlrch closed 2 years ago
The following snippets show how graphmaps can be described in XRM and how it looks in generated R2RML
Sample XRM:
output r2rml
map ThingIntoGraphmapsMapping from ThingIntoGraphmapsSource {
subject template "http://example.org/thing/{0}" with id;
graphs
constant "http://example.org/graph/omnigraph"; // constant IRI as string
template "http://example.org/graph/thing-{0}" with id; // templated IRI with variable(s)
constant thing.Thing; // IRI from Class
constant thing.color; // IRI from Property
constant employee.myDatatype; // IRI from Datatype
}
logical-source ThingIntoGraphmapsSource {
type rdb
source "THINGS"
referenceables
id
}
Generated R2RML:
PREFIX rr: <http://www.w3.org/ns/r2rml#>
<#ThingIntoGraphmapsMapping> a rr:TriplesMap ;
rr:logicalTable [ rr:tableName "THINGS" ];
rr:subjectMap [
rr:template "http://example.org/thing/{id}" ;
rr:graphMap [
rr:constant <http://example.org/graph/omnigraph>;
]
;
rr:graphMap [
rr:template "http://example.org/graph/thing-{id}" ;
]
;
rr:graphMap [
rr:constant thing:Thing;
]
;
rr:graphMap [
rr:constant thing:color;
]
;
rr:graphMap [
rr:constant employee:myDatatype;
]
;
]
.
Updated documentation with https://github.com/zazuko/expressive-rdf-mapper/commit/9c1e9f8235941e1682abd1dd797038311a1827a4
(this is a clone of https://github.com/zazuko/xrm/issues/135):
Sample XRM:
Declaring
graphs
is only supported for R2RML, RML and CARMLoutput
. It's not supported for CSVW output.Generally allowing to use
RdfClass|RdfProperty|Datatype
as constant is useful and makes sense as well IMO.