Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adding graphmap section #154

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 52 additions & 0 deletions spec/docs/graphmap.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# Assigning Triples to Named Graphs

Each triple generated from an [=RML mapping=]() is placed into one or more graphs of the [=output dataset=](). Possible target graphs are the unnamed [=default graph=](), the [=IRI=]()-named [=named graphs=](), and [=blank node=]() named [=named graphs=]()

Any [=subject map=]() or [=predicate-object=]() map MAY have one or more associated graph maps. They are specified in one of two ways:

1. using the rml:graphMap property, whose value MUST be a [=graph map=](),
2. using the [=constant shortcut property=]() rml:graph.

Graph maps are themselves [=term maps=](). When [=RDF triples are generated=](), the set of target graphs is determined by taking into account any graph maps associated with the subject map or predicate-object map.

If a [=graph map=]() generates the special IRI rml:defaultGraph, then the target graph is the [=default graph=]() of the [=output dataset=]().

In the following [=subject map=]() example, all generated RDF triples will be stored in the named graph ex:DepartmentGraph.

```turtle
[] rml:subjectMap [
rml:template "http://data.example.com/department/{DEPTNO}";
rml:graphMap [ rml:constant ex:DepartmentGraph ];
].
```
This is equivalent to the following example, which uses a [=constant shortcut property=]():

```turtle
[] rml:subjectMap [
rml:template "http://data.example.com/department/{DEPTNO}";
rml:graph ex:DepartmentGraph;
].
```
In the following example, RDF triples are placed into [=IRI=]()-named [=named graphs=]() according to the job title of employees:
```turtle
[] rml:subjectMap [
rml:template "http://data.example.com/employee/{EMPNO}";
rml:graphMap [ rml:template "http://data.example.com/jobgraph/{JOB}" ];
].
```

However, in this example, RDF triples of the [=predicate-object=]() `ex:name` are placed into a [=blank node=]() named [=named graphs=]() according to the job title of employees:
```turtle
[] rml:subjectMap [
rml:template "http://data.example.com/employee/{EMPNO}";
];
rml:predicateObjectMap [
rml:predicate ex:name;
rml:objectMap [ rml:reference "name"; ];
rml:graphMap [
rml:reference "JOB"
rml:termType rr:IRI
];
].
```

2 changes: 2 additions & 0 deletions spec/docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,8 @@

<section id="joins" data-include="joinconditions.md" data-include-format="markdown"></section>

<section id="graphmaps" data-include="graphmaps.md" data-include-format="markdown"></section>

<section id="datatype-conversion" data-include="datatypeConversion.md" data-include-format="markdown"></section>

<section id="definitions" data-include="definitions.md" data-include-format="markdown"></section>
Expand Down
Loading