<img src="https://dataio.goatcounter.com/count?p=/test-noscript">

Target in RML

Unofficial Draft

Latest editor's draft:
https://rml.io/specs/rml-target
Editors:
(Ghent University – imec – IDLab)
(Ghent University – imec – IDLab)
This Version
https://rml.io/specs/rml-target/20210518/
Previous Version
https://rml.io/specs/rml-target/20210518/
Website
https://rml.io/

Abstract

This document describes a formal representation to align the RDF Mapping Language [RML] with Target [DataIO] to describe in RML mapping rules how a generated Knowledge Graph should be directed and exported. The current document describes how Target is integrated with RML through definitions and examples.

The version of this document is v1.0.0.

Status of This Document

This document is a draft of a potential specification. It has no official standing of any kind and does not represent the support or consensus of any standards organization.

This is an early draft, yet efforts are made to keep things stable.

1. Conformance

As well as sections marked as non-normative, all authoring guidelines, diagrams, examples, and notes in this specification are non-normative. Everything else in this specification is normative.

The key word MAY in this document is to be interpreted as described in BCP 14 [RFC2119] [RFC8174] when, and only when, they appear in all capitals, as shown here.

2. Overview

This section is non-normative.

This document describes the alignment of Target specification with RML to define how a generated RDF knowledge graph must be exported in the RML mapping rules. Target and RML are self-standing specifications which are aligned through this specification.

In this document, examples assume the following namespace prefix bindings unless otherwise stated:

Prefix Namespace
rml http://semweb.mmlab.be/ns/rml#
rmlt http://semweb.mmlab.be/ns/rml-target#
comp http://semweb.mmlab.be/ns/rml-compression#
rr http://www.w3.org/ns/r2rml#
formats https://www.w3.org/ns/formats/
comp http://semweb.mmlab.be/ns/rml-compression#
csvw http://www.w3.org/ns/csvw#
foaf http://xmlns.com/foaf/0.1/
fnml http://semweb.mmlab.be/ns/fnml#
idlab-fn http://example.com/idlab/function/
void http://rdfs.org/ns/void#
ex http://example.org/ns#
schema http://schema.org/

Examples are divided in several boxes, each box has its own color. Blue boxes contain the input RDF data of the example:

# This box contains the example's input RDF data.

The Target description is contained in a pink box:

# This box contains the example's Target description.

The data access description is contained in a grey box:

# This box contains the data access description of the example.

The RML mapping is contained in a yellow box:

# This box contains the example's RML mapping.

The generated output RDF is contained in a green box:

# This box contains the example's generated output RDF.

3. Target in RML

RML does not specify where generated triples are exported to, each RML processor has its own way to describe this information through configuration files or command line parameters. To incorporate this information in the RML mapping rules, RML is aligned with the Target vocabulary which describes how the generated triples are exported. RML is aligned with the Target vocabulary by extending rr:TermMap with the rml:logicalTarget property to describe on Term Map [RML] level where each triple must be directed to. A Term Map is a function that generates an RDF term from a logical reference [RML]. The result of that function is known as the term map's generated RDF term [RDF-Concepts] such as subjects, predicates, objects, named graphs and language tags.

A Term Map MAY also contain zero or more rml:logicalTarget properties to export all triples containing the generated term to different targets. The same Term Map can have multiple targets by specifying multiple rml:logicalTarget properties in the Term Map.

Multiple Targets MAY be combined by specifying multiple Targets in the same Term Map or multiple Term Maps of the same RDF triple (Section § 5. Combining multiple Targets). Targets MAY be overriden by using a separate Triples Map or conditions [FnO] (Section § 6. Overriding Targets).

If the mapping document contains no Targets, the processor falls back to the default target, as it is specified through the processor's specific configuration file or command line parameters. If a mapping document contains at least one Target, the processor will export the triples to these Targets, triples which do not have one or more Target(s) assigned, are exported to the default target of the processor.

Property Domain Range
rml:logicalTarget rr:TermMap rmlt:LogicalTarget

In the example below, a CSV file is transformed into a knowledge graph. The CSV file is accessed using the [CSVW] vocabulary, transformed into a knowledge graph using [RML] mappings, and exported to two Targets, which are accessed through the [VoID] vocabulary. The knowledge graph is exported as N-Quads to the first Target, and as Turtle to the second Target. The Turtle file of the second Target is also compressed using the Zip compression algorithm.

id;name;nickname
0;Nathan Ford;Mastermind
1;Sophie Devereaux;Grifter
2;Eliot Spender;Hitter
3;Parker;Thief
4;Alec Hardison;Hacker
<#CSVSourceAccess> a csvw:Table;
  csvw:url "https://rml.io/specs/rml-target/Leverage.csv";
  csvw:dialect [ a csvw:Dialect;
    csvw:delimiter ";";
    csvw:encoding "UTF-8";
    csvw:header "1"^^xsd:boolean;
  ];
.
@base <http://example.com/ns#> .

<#TriplesMap> a rr:TriplesMap;
  rml:logicalSource [ a rml:LogicalSource;
    rml:source <#CSVSourceAccess>;
  ];
  rr:subjectMap [ a rr:SubjectMap;
    rr:template "http://example.com/{id}";
    rml:logicalTarget <#TargetDump1>;
    rr:class foaf:Person;
  ];
  rr:predicateObjectMap [ a rr:PredicateObjectMap;
    rr:predicateMap [ a rr:PredicateMap;
      rr:constant foaf:name;
      rml:logicalTarget <#TargetDump2>;
    ];
    rr:objectMap [ a rr:ObjectMap;
      rml:reference "name";
    ];
  ];
  rr:predicateObjectMap [ a rr:PredicateObjectMap;
    rr:predicateMap [ a rr:PredicateMap;
      rr:constant foaf:nickname;
    ];
    rr:objectMap [ a rr:ObjectMap;
      rml:reference "nickname";
    ];
  ];
.
<#TargetDump1> a rmlt:LogicalTarget;
  rmlt:target <#VoIDDump1>;
  rmlt:serialization formats:N-Triples;
.

<#TargetDump2> a rmlt:LogicalTarget;
  rmlt:target <#VoIDDump2>;
  rmlt:serialization formats:Turtle;
  rmlt:compression comp:zip;
.
<#VoIDDump1> a void:Dataset;
    void:dataDump <file:///data/dump1.nt>;
.

<#VoIDDump2> a void:Dataset;
    void:dataDump <file:///data/dump2.ttl.zip>;
.
# file:///data/dump1.nq
<http://example.org/0> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> _b0 .
<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Nathan Ford" _b0 .
<http://example.org/0> <http://xmlns.com/foaf/0.1/nickname> "Mastermind" _b0 .
<http://example.org/1> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> _b0 .
<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Sophie Devereaux" _b0 .
<http://example.org/1> <http://xmlns.com/foaf/0.1/nickname> "Grifter" _b0 .
<http://example.org/2> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> _b0 .
<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Eliot Spencer" _b0 .
<http://example.org/2> <http://xmlns.com/foaf/0.1/nickname> "Hitter" _b0 .
<http://example.org/3> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> _b0 .
<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Parker" _b0 .
<http://example.org/3> <http://xmlns.com/foaf/0.1/nickname> "Thief" _b0 .
<http://example.org/4> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> _b0 .
<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Alec Hardison" _b0 .
<http://example.org/4> <http://xmlns.com/foaf/0.1/nickname> "Hacker" _b0 .

# file:///data/dump2.ttl.zip
@prefix foaf: <http://xmlns.com/foaf/0.1/> .

<http://example.org/0>
  foaf:name "Nathan Ford";
.
<http://example.org/1>
  foaf:name "Sophie Devereaux";
.
<http://example.org/2>
  foaf:name "Eliot Spencer";
.
<http://example.org/3>
  foaf:name "Parker";
.
<http://example.org/4>
  foaf:name "Alec Hardison";
.

4. Single targets

In the following examples, the RDF triples are exported to a single Target. In some examples, not all RDF triples have a dedicated Target assigned, therefore, they will be exported to the default Target of the processor.

4.1 Subject Map

All triples containing the generated subject are exported to the specified targets in the Subject Map [RML].

The following example exports all triples containing the generated subject http://example.org/{id} to an RDF dump with N-Quads as serialization format and GZip compression:

[
  { 
    "id": 0,
    "name": "Monica Geller",
    "age": 33
  },
  { 
    "id": 1,
    "name": "Rachel Green",
    "age": 34
  },
  { 
    "id": 2,
    "name": "Joey Tribbiani",
    "age": 35
  },
  { 
    "id": 3,
    "name": "Chandler Bing",
    "age": 36
  },
  { 
    "id": 4,
    "name": "Ross Geller",
    "age": 37
  }
]
<#DCATSourceAccess> a dcat:Dataset;
  dcat:distribution [ a dcat:Distribution;
    dcat:downloadURL "https://rml.io/specs/rml-target/Friends.json";
  ];
.
<#TriplesMap> a rr:TriplesMap;
  rml:logicalSource [ a rml:LogicalSource;
    rml:source <#DCATSourceAccess>;
    rml:referenceFormulation ql:JSONPath;
    rml:iterator "$.[*]";
  ];
  rr:subjectMap [ a rr:SubjectMap;
    rr:template "http://example.org/{id}";
    rml:logicalTarget <#TargetDump1>;
  ];
  rr:predicateObjectMap [ a rr:PredicateObjectMap;
    rr:predicateMap [ a rr:PredicateMap;
      rr:constant foaf:name;
    ];
    rr:objectMap [ a rr:ObjectMap;
      rml:reference "name";
    ];
  ];
  rr:predicateObjectMap [ a rr:PredicateObjectMap;
    rr:predicateMap [ a rr:PredicateMap;
      rr:constant foaf:age;
    ];
    rr:objectMap [ a rr:ObjectMap;
      rml:reference "age";
    ];
  ];
.
<#TargetDump1> a rmlt:LogicalTarget;
  rmlt:target <#VoIDDump1>;
  rmlt:serialization formats:N-Quads;
  rmlt:compression comp:gzip;
.
<#VoIDDump1> a void:Dataset ;
  void:dataDump <file:///data/dump1.nq.gz>;
.
<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .

4.2 Predicate Map

All triples containing the generated predicate are exported to the specified targets in the Predicate Map [RML].

The following example exports all triples containing the generated predicate foaf:name to an RDF dump with Turtle as serialization format and Zip compression:

[
  { 
    "id": 0,
    "name": "Monica Geller",
    "age": 33
  },
  { 
    "id": 1,
    "name": "Rachel Green",
    "age": 34
  },
  { 
    "id": 2,
    "name": "Joey Tribbiani",
    "age": 35
  },
  { 
    "id": 3,
    "name": "Chandler Bing",
    "age": 36
  },
  { 
    "id": 4,
    "name": "Ross Geller",
    "age": 37
  }
]
<#DCATSourceAccess> a dcat:Dataset;
  dcat:distribution [ a dcat:Distribution;
    dcat:downloadURL "https://rml.io/specs/rml-target/Friends.json";
  ];
.
<#TriplesMap> a rr:TriplesMap;
  rml:logicalSource [ a rml:LogicalSource;
    rml:source <#DCATSourceAccess>;
    rml:referenceFormulation ql:JSONPath;
    rml:iterator "$.[*]";
  ];
  rr:subjectMap [ a rr:SubjectMap;
    rr:template "http://example.org/{id}";
  ];
  rr:predicateObjectMap [ a rr:PredicateObjectMap;
    rr:predicateMap [ a rr:PredicateMap;
      rr:constant foaf:name;
      rml:logicalTarget <#TargetDump1>;
    ];
    rr:objectMap [ a rr:ObjectMap;
      rml:reference "name";
    ];
  ];
  rr:predicateObjectMap [ a rr:PredicateObjectMap;
    rr:predicateMap [ a rr:PredicateMap;
      rr:constant foaf:age;
    ];
    rr:objectMap [ a rr:ObjectMap;
      rml:reference "age";
    ];
  ];
.
<#TargetDump1> a rmlt:LogicalTarget;
  rmlt:target <#VoIDDump1>;
  rmlt:serialization formats:Turtle;
  rmlt:compression comp:zip;
.
<#VoIDDump1> a void:Dataset ;
  void:dataDump <file:///data/dump1.ttl.zip>;
.
# file:///data/dump1.ttl.zip
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@base <http://example.com/ns#> .

<http://example.org/0>
  foaf:name "Monica Geller";
.
<http://example.org/1>
  foaf:name "Rachel Green";
.
<http://example.org/2>
  foaf:name "Joey Tribbiani";
.
<http://example.org/3>
  foaf:name "Chandler Bing";
.
<http://example.org/4>
  foaf:name "Ross Geller";
.

# default target of the processor
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .

4.3 Object Map

All triples containing the generated object are exported to the specified targets in the Object Map [RML].

The following example exports all triples containing the generated object from the reference name to an RDF dump with N-Triples as serialization format:

[
  { 
    "id": 0,
    "name": "Monica Geller",
    "age": 33
  },
  { 
    "id": 1,
    "name": "Rachel Green",
    "age": 34
  },
  { 
    "id": 2,
    "name": "Joey Tribbiani",
    "age": 35
  },
  { 
    "id": 3,
    "name": "Chandler Bing",
    "age": 36
  },
  { 
    "id": 4,
    "name": "Ross Geller",
    "age": 37
  }
]
<#DCATSourceAccess> a dcat:Dataset;
  dcat:distribution [ a dcat:Distribution;
    dcat:downloadURL "https://rml.io/specs/rml-target/Friends.json";
  ];
.
<#TriplesMap> a rr:TriplesMap;
  rml:logicalSource [ a rml:LogicalSource;
    rml:source <#DCATSourceAccess>;
    rml:referenceFormulation ql:JSONPath;
    rml:iterator "$.[*]";
  ];
  rr:subjectMap [ a rr:SubjectMap;
    rr:template "http://example.org/{id}";
  ];
  rr:predicateObjectMap [ a rr:PredicateObjectMap;
    rr:predicateMap [ a rr:PredicateMap;
      rr:constant foaf:name;
    ];
    rr:objectMap [ a rr:ObjectMap;
      rml:reference "name";
      rml:logicalTarget <#TargetDump1>;
    ];
  ];
  rr:predicateObjectMap [ a rr:PredicateObjectMap;
    rr:predicateMap [ a rr:PredicateMap;
      rr:constant foaf:age;
    ];
    rr:objectMap [ a rr:ObjectMap;
      rml:reference "age";
    ];
  ];
.
<#TargetDump1> a rmlt:LogicalTarget;
  rmlt:target <#VoIDDump1>;
  rmlt:serialization formats:N-Triples;
.
<#VoIDDump1> a void:Dataset ;
  void:dataDump <file:///data/dump1.nt>;
.
# file:///data/dump1.nt
<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .

# default target of the processor
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .

4.4 Graph Map

All triples within a named graph are exported to the specified targets in the Graph Map [RML]. The named graph influences to where the named graph's triples may be exported to as the Target's serialization format must support named graphs such as N-Quads, JSON-LD or TriG. When a Target contains a serialization format which does not support named graphs and a Graph Map is used, the mapping is considered invalid. If a named graph is spread over multiple targets, all targets must be combined to access the complete named graph. In case RDF triples are not within a specific named graph, they are added to the default graph as specified by the [R2RML] specification.

The following example exports all triples in the named graph ex:Friends to an RDF dump with N-Quads as serialization format:

[
  { 
    "id": 0,
    "name": "Monica Geller",
    "age": 33
  },
  { 
    "id": 1,
    "name": "Rachel Green",
    "age": 34
  },
  { 
    "id": 2,
    "name": "Joey Tribbiani",
    "age": 35
  },
  { 
    "id": 3,
    "name": "Chandler Bing",
    "age": 36
  },
  { 
    "id": 4,
    "name": "Ross Geller",
    "age": 37
  }
]
<#DCATSourceAccess> a dcat:Dataset;
  dcat:distribution [ a dcat:Distribution;
    dcat:downloadURL "https://rml.io/specs/rml-target/Friends.json";
  ];
.
<#TriplesMap> a rr:TriplesMap;
  rml:logicalSource [ a rml:LogicalSource;
    rml:source <#DCATSourceAccess>;
    rml:referenceFormulation ql:JSONPath;
    rml:iterator "$.[*]";
  ];
  rr:subjectMap [ a rr:SubjectMap;
    rr:template "http://example.org/{id}";
    rr:graphMap [
      rml:logicalTarget <#TargetDump1>;
      rr:constant ex:Friends;
    ];
   ];
  rr:predicateObjectMap [ a rr:PredicateObjectMap;
    rr:predicateMap [ a rr:PredicateMap;
      rr:constant foaf:name;
    ];
    rr:objectMap [ a rr:ObjectMap;
      rml:reference "name";
    ];
  ];
  rr:predicateObjectMap [ a rr:PredicateObjectMap;
    rr:predicateMap [ a rr:PredicateMap;
      rr:constant foaf:age;
    ];
    rr:objectMap [ a rr:ObjectMap;
      rml:reference "age";
    ];
  ];
.
<#TargetDump1> a rmlt:LogicalTarget;
  rmlt:target <#VoIDDump1>;
.
<#VoIDDump1> a void:Dataset ;
  void:dataDump <file:///data/dump1.nq>;
.
# file:///data/dump1.nq
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" <http://example.org/Friends> .
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" <http://example.org/Friends> .
<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" <http://example.org/Friends> .
<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" <http://example.org/Friends> .
<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" <http://example.org/Friends> .
<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" <http://example.org/Friends> .
<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" <http://example.org/Friends> .
<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" <http://example.org/Friends> .
<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" <http://example.org/Friends> .
<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" <http://example.org/Friends> .

4.5 Language Map

All triples with a language tag are exported to the specified targets in the Language Map [RML].

The following examples export all triples with a language tag to a RDF dump with N-Triples as serialization format:

[
  { 
    "id": 0,
    "name": "Monica Geller",
    "age": 33
  },
  { 
    "id": 1,
    "name": "Rachel Green",
    "age": 34
  },
  { 
    "id": 2,
    "name": "Joey Tribbiani",
    "age": 35
  },
  { 
    "id": 3,
    "name": "Chandler Bing",
    "age": 36
  },
  { 
    "id": 4,
    "name": "Ross Geller",
    "age": 37
  }
]
<#DCATSourceAccess> a dcat:Dataset;
  dcat:distribution [ a dcat:Distribution;
    dcat:downloadURL "https://rml.io/specs/rml-target/Friends.json";
  ];
.
<#TriplesMap> a rr:TriplesMap;
  rml:logicalSource [ a rml:LogicalSource;
    rml:source <#DCATSourceAccess>;
    rml:referenceFormulation ql:JSONPath;
    rml:iterator "$.[*]";
  ];
  rr:subjectMap [ a rr:SubjectMap;
    rr:template "http://example.org/{id}";
   ];
  rr:predicateObjectMap [ a rr:PredicateObjectMap;
    rr:predicateMap [ a rr:PredicateMap;
      rr:constant foaf:name;
    ];
    rr:objectMap [ a rr:ObjectMap;
      rml:reference "name";
      rml:languageMap [
        rml:logicalTarget <#TargetDump1>;
        rr:constant "en";
      ];
    ];
  ];
  rr:predicateObjectMap [ a rr:PredicateObjectMap;
    rr:predicateMap [ a rr:PredicateMap;
      rr:constant foaf:age;
    ];
    rr:objectMap [ a rr:ObjectMap;
      rml:reference "age";
    ];
  ];
.
<#TargetDump1> a rmlt:LogicalTarget;
  rmlt:target <#VoIDDump1>;
  rmlt:serialization formats:N-Triples;
.
<#VoIDDump1> a void:Dataset ;
  void:dataDump <file:///data/dump1.nt>;
.
# file:///data/dump1.nt
<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller"@en .
<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green"@en .
<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani"@en .
<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing"@en .
<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller"@en .

# default target of the processor
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .

5. Combining multiple Targets

Multiple Targets MAY be specified for the same triple in the same or multiple Term Maps. If multiple Targets are defined in the same Term Map, all triples containing the generated Term are exported to all the specified Targets. In case multiple Term Maps of the same RDF triple contain more than one Target, the generated triples are exported to all the specified Targets. If multiple Term Maps of an RDF triple refer multiple times to the same Target, the RDF triple is written only once to the target to avoid duplicates.

5.1 Multiple Targets in the same Term Map

All triples are exported to all Targets, if the Term Map contains multiple Targets. In the example a Subject Map has three specified Targets, all triples with the subject http://example.org/{@id} are exported to the three specified Targets:

<Supergirl>
  <Character id="0">
    <name>Kara Danvers</name>
    <nickname>Supergirl</nickname>
  </Character>
  <Character id="1">
    <name>Alex Danvers</name>
    <nickname>Sentinel</nickname>
  </Character>
  <Character id="2">
    <name>J'onn J'onzz</name>
    <nickname>Martian Manhunter</nickname>
  </Character>
  <Character id="3">
    <name>Nia Nal</name>
    <nickname>Dreamer</nickname>
  </Character> 
</Supergirl>
<#DCATSourceAccess> a dcat:Dataset;
  dcat:distribution [ a dcat:Distribution;
    dcat:downloadURL "https://rml.io/specs/rml-target/Supergirl.xml";
  ];
.
<#TriplesMap> a rr:TriplesMap;
  rml:logicalSource [ a rml:LogicalSource;
    rml:source <#DCATSourceAccess>;
    rml:referenceFormulation ql:JSONPath;
    rml:iterator "$.[*]";
  ];
  rr:subjectMap [ a rr:SubjectMap;
    rr:template "http://example.org/{@id}";
    rml:logicalTarget <#TargetDump1>;
    rml:logicalTarget <#TargetDump2>;
    rml:logicalTarget <#TargetDump3>;
  ];
  rr:predicateObjectMap [ a rr:PredicateObjectMap;
    rr:predicateMap [ a rr:PredicateMap;
      rr:constant foaf:name;
    ];
    rr:objectMap [ a rr:ObjectMap;
      rml:reference "name/text()";
    ];
  ];
.
<#TargetDump1> a rmlt:LogicalTarget;
  rmlt:target <#VoIDDump1>;
  rmlt:serialization formats:N-Triples;
  rmlt:compression comp:zip;
.
<#TargetDump2> a rmlt:LogicalTarget;
  rmlt:target <#VoIDDump1>;
  rmlt:serialization formats:JSON-LD;
  rmlt:compression comp:tarxz;
.
<#TargetDump3> a rmlt:LogicalTarget;
  rmlt:target <#VoIDDump1>;
  rmlt:serialization formats:RDF_XML;
  rmlt:compression comp:targzip;
.
<#VoIDDump1> a void:Dataset ;
  void:dataDump <file:///data/dump1.nt.zip>;
.
<#VoIDDump2> a void:Dataset ;
  void:dataDump <file:///data/dump2.jsonld.tar.xz>;
.
<#VoIDDump3> a void:Dataset ;
  void:dataDump <file:///data/dump3.rdf.tar.gz>;
.
# file:///data/dump1.nt.zip
<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Kara Danvers" .
<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Alex Danvers" .
<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "J'onn J'onzz" .
<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Nia Nal" .

# file:///data/dump2.jsonld.tar.xz
[
  {
    "@id": "http://example.org/0",
    "http://xmlns.com/foaf/0.1/name": [
      {
        "@value": "Kara Danvers"
      }
    ]
  },
  {
    "@id": "http://example.org/1",
    "http://xmlns.com/foaf/0.1/name": [
      {
        "@value": "Alex Danvers"
      }
    ]
  },
  {
    "@id": "http://example.org/2",
    "http://xmlns.com/foaf/0.1/name": [
      {
        "@value": "J'onn J'onzz"
      }
    ]
  },
  {
    "@id": "http://example.org/3",
    "http://xmlns.com/foaf/0.1/name": [
      {
        "@value": "Nia Nal"
      }
    ]
  }
]

# file:///data/dump3.rdf.tar.gz
<?xml version="1.0" encoding="utf-8" ?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:foaf="http://xmlns.com/foaf/0.1/">
  <rdf:Description rdf:about="http://example.org/0">
    <foaf:name>Kara Danvers</foaf:name>
  </rdf:Description>
  <rdf:Description rdf:about="http://example.org/1">
    <foaf:name>Alex Danvers</foaf:name>
  </rdf:Description>
  <rdf:Description rdf:about="http://example.org/2">
    <foaf:name>J'onn J'onzz</foaf:name>
  </rdf:Description>
  <rdf:Description rdf:about="http://example.org/3">
    <foaf:name>Nia Nal</foaf:name>
  </rdf:Description>
</rdf:RDF>

5.2 Subject Map and Predicate Map

All triples containing the subject http://example.org/{id} are exported to TargetDump1 and all triples containing the predicate foaf:name are exported to TargetDump2.

<Supergirl>
  <Character id="0">
    <name>Kara Danvers</name>
    <nickname>Supergirl</nickname>
  </Character>
  <Character id="1">
    <name>Alex Danvers</name>
    <nickname>Sentinel</nickname>
  </Character>
  <Character id="2">
    <name>J'onn J'onzz</name>
    <nickname>Martian Manhunter</nickname>
  </Character>
  <Character id="3">
    <name>Nia Nal</name>
    <nickname>Dreamer</nickname>
  </Character> 
</Supergirl>
<#DCATSourceAccess> a dcat:Dataset;
  dcat:distribution [ a dcat:Distribution;
    dcat:downloadURL "https://rml.io/specs/rml-target/Supergirl.xml";
  ];
.
<#TriplesMap> a rr:TriplesMap;
  rml:logicalSource [ a rml:LogicalSource;
    rml:source <#DCATSourceAccess>;
    rml:referenceFormulation ql:JSONPath;
    rml:iterator "$.[*]";
  ];
  rr:subjectMap [ a rr:SubjectMap;
    rr:template "http://example.org/{@id}";
    rml:logicalTarget <#TargetDump1>;
  ];
  rr:predicateObjectMap [ a rr:PredicateObjectMap;
    rr:predicateMap [ a rr:PredicateMap;
      rr:constant foaf:name;
      rml:logicalTarget <#TargetDump2>;
    ];
    rr:objectMap [ a rr:ObjectMap;
      rml:reference "name/text()";
    ];
  ];
  rr:predicateObjectMap [ a rr:PredicateObjectMap;
    rr:predicateMap [ a rr:PredicateMap;
      rr:constant foaf:nickname;
    ];
    rr:objectMap [ a rr:ObjectMap;
      rml:reference "nickname/text()";
    ];
  ];
.
<#TargetDump1> a rmlt:LogicalTarget;
  rmlt:target <#VoIDDump1>;
  rmlt:serialization formats:N-Triples;
.
<#TargetDump2> a rmlt:LogicalTarget;
  rmlt:target <#VoIDDump1>;
  rmlt:serialization formats:N-Triples;
.
<#VoIDDump1> a void:Dataset ;
  void:dataDump <file:///data/dump1.nt>;
.
<#VoIDDump2> a void:Dataset ;
  void:dataDump <file:///data/dump2.nt>;
.
# file:///data/dump1.nt
<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Kara Danvers" .
<http://example.org/0> <http://xmlns.com/foaf/0.1/nickname> "Supergirl" .
<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Alex Danvers" .
<http://example.org/1> <http://xmlns.com/foaf/0.1/nickname> "Sentinel" .
<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "J'onn J'onzz" .
<http://example.org/2> <http://xmlns.com/foaf/0.1/nickname> "Martian Manhunter" .
<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Nia Nal" .
<http://example.org/3> <http://xmlns.com/foaf/0.1/nickname> "Dreamer" .

# file:///data/dump2.nt
<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Kara Danvers" .
<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Alex Danvers" .
<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "J'onn J'onzz" .
<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Nia Nal" .

5.3 Subject Map and Object Map

All triples containing the subject http://example.org/{id} are exported to TargetDump1 and all triples containing the object reference name/text() are exported to TargetDump2.

<Supergirl>
  <Character id="0">
    <name>Kara Danvers</name>
    <nickname>Supergirl</nickname>
  </Character>
  <Character id="1">
    <name>Alex Danvers</name>
    <nickname>Sentinel</nickname>
  </Character>
  <Character id="2">
    <name>J'onn J'onzz</name>
    <nickname>Martian Manhunter</nickname>
  </Character>
  <Character id="3">
    <name>Nia Nal</name>
    <nickname>Dreamer</nickname>
  </Character> 
</Supergirl>
<#DCATSourceAccess> a dcat:Dataset;
  dcat:distribution [ a dcat:Distribution;
    dcat:downloadURL "https://rml.io/specs/rml-target/Supergirl.xml";
  ];
.
<#TriplesMap> a rr:TriplesMap;
  rml:logicalSource [ a rml:LogicalSource;
    rml:source <#DCATSourceAccess>;
    rml:referenceFormulation ql:JSONPath;
    rml:iterator "$.[*]";
  ];
  rr:subjectMap [ a rr:SubjectMap;
    rr:template "http://example.org/{@id}";
    rml:logicalTarget <#TargetDump1>;
  ];
  rr:predicateObjectMap [ a rr:PredicateObjectMap;
    rr:predicateMap [ a rr:PredicateMap;
      rr:constant foaf:name;
    ];
    rr:objectMap [ a rr:ObjectMap;
      rml:reference "name/text()";
      rml:logicalTarget <#TargetDump2>;
    ];
  ];
  rr:predicateObjectMap [ a rr:PredicateObjectMap;
    rr:predicateMap [ a rr:PredicateMap;
      rr:constant foaf:nickname;
    ];
    rr:objectMap [ a rr:ObjectMap;
      rml:reference "nickname/text()";
    ];
  ];
.
<#TargetDump1> a rmlt:LogicalTarget;
  rmlt:target <#VoIDDump1>;
  rmlt:serialization formats:N-Triples;
.
<#TargetDump2> a rmlt:LogicalTarget;
  rmlt:target <#VoIDDump1>;
  rmlt:serialization formats:N-Triples;
.
<#VoIDDump1> a void:Dataset ;
  void:dataDump <file:///data/dump1.nt>;
.
<#VoIDDump2> a void:Dataset ;
  void:dataDump <file:///data/dump2.nt>;
.
# file:///data/dump1.nt
<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Kara Danvers" .
<http://example.org/0> <http://xmlns.com/foaf/0.1/nickname> "Supergirl" .
<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Alex Danvers" .
<http://example.org/1> <http://xmlns.com/foaf/0.1/nickname> "Sentinel" .
<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "J'onn J'onzz" .
<http://example.org/2> <http://xmlns.com/foaf/0.1/nickname> "Martian Manhunter" .
<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Nia Nal" .
<http://example.org/3> <http://xmlns.com/foaf/0.1/nickname> "Dreamer" .

# file:///data/dump2.nt
<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Kara Danvers" .
<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Alex Danvers" .
<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "J'onn J'onzz" .
<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Nia Nal" .

5.4 Predicate Map and Object Map

All triples containing the predicate foaf:name are exported to TargetDump1 and all triples containing the object reference nickname/text() are exported to TargetDump2.

<Supergirl>
  <Character id="0">
    <name>Kara Danvers</name>
    <nickname>Supergirl</nickname>
  </Character>
  <Character id="1">
    <name>Alex Danvers</name>
    <nickname>Sentinel</nickname>
  </Character>
  <Character id="2">
    <name>J'onn J'onzz</name>
    <nickname>Martian Manhunter</nickname>
  </Character>
  <Character id="3">
    <name>Nia Nal</name>
    <nickname>Dreamer</nickname>
  </Character> 
</Supergirl>
<#DCATSourceAccess> a dcat:Dataset;
  dcat:distribution [ a dcat:Distribution;
    dcat:downloadURL "https://rml.io/specs/rml-target/Supergirl.xml";
  ];
.
<#TriplesMap> a rr:TriplesMap;
  rml:logicalSource [ a rml:LogicalSource;
    rml:source <#DCATSourceAccess>;
    rml:referenceFormulation ql:JSONPath;
    rml:iterator "$.[*]";
  ];
  rr:subjectMap [ a rr:SubjectMap;
    rr:template "http://example.org/{@id}";
  ];
  rr:predicateObjectMap [ a rr:PredicateObjectMap;
    rr:predicateMap [ a rr:PredicateMap;
      rr:constant foaf:name;
      rml:logicalTarget <#TargetDump1>;
    ];
    rr:objectMap [ a rr:ObjectMap;
      rml:reference "name/text()";
    ];
  ];
  rr:predicateObjectMap [ a rr:PredicateObjectMap;
    rr:predicateMap [ a rr:PredicateMap;
      rr:constant foaf:nickname;
    ];
    rr:objectMap [ a rr:ObjectMap;
      rml:reference "nickname/text()";
      rml:logicalTarget <#TargetDump2>;
    ];
  ];
.
<#TargetDump1> a rmlt:LogicalTarget;
  rmlt:target <#VoIDDump1>;
  rmlt:serialization formats:N-Triples;
.
<#TargetDump2> a rmlt:LogicalTarget;
  rmlt:target <#VoIDDump1>;
  rmlt:serialization formats:N-Triples;
.
<#VoIDDump1> a void:Dataset ;
  void:dataDump <file:///data/dump1.nt>;
.
<#VoIDDump2> a void:Dataset ;
  void:dataDump <file:///data/dump2.nt>;
.
# file:///data/dump1.nt
<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Kara Danvers" .
<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Alex Danvers" .
<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "J'onn J'onzz" .
<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Nia Nal" .

# file:///data/dump2.nt
<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Kara Danvers" .
<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Alex Danvers" .
<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "J'onn J'onzz" .
<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Nia Nal" .

5.5 Subject Map, Predicate Map and Object Map

All triples containing the subject http://example.org/{@id} are exported to TargetDump1 and all triples containing the object reference nickname/text() or predicate foaf:nickname are exported to TargetDump2.

<Supergirl>
  <Character id="0">
    <name>Kara Danvers</name>
    <nickname>Supergirl</nickname>
  </Character>
  <Character id="1">
    <name>Alex Danvers</name>
    <nickname>Sentinel</nickname>
  </Character>
  <Character id="2">
    <name>J'onn J'onzz</name>
    <nickname>Martian Manhunter</nickname>
  </Character>
  <Character id="3">
    <name>Nia Nal</name>
    <nickname>Dreamer</nickname>
  </Character> 
</Supergirl>
<#DCATSourceAccess> a dcat:Dataset;
  dcat:distribution [ a dcat:Distribution;
    dcat:downloadURL "https://rml.io/specs/rml-target/Supergirl.xml";
  ];
.
<#TriplesMap> a rr:TriplesMap;
  rml:logicalSource [ a rml:LogicalSource;
    rml:source <#DCATSourceAccess>;
    rml:referenceFormulation ql:JSONPath;
    rml:iterator "$.[*]";
  ];
  rr:subjectMap [ a rr:SubjectMap;
    rr:template "http://example.org/{@id}";
    rml:logicalTarget <#TargetDump1>;
  ];
  rr:predicateObjectMap [ a rr:PredicateObjectMap;
    rr:predicateMap [ a rr:PredicateMap;
      rr:constant foaf:name;
    ];
    rr:objectMap [ a rr:ObjectMap;
      rml:reference "name/text()";
    ];
  ];
  rr:predicateObjectMap [ a rr:PredicateObjectMap;
    rr:predicateMap [ a rr:PredicateMap;
      rr:constant foaf:nickname;
      rml:logicalTarget <#TargetDump2>;
    ];
    rr:objectMap [ a rr:ObjectMap;
      rml:reference "nickname/text()";
      rml:logicalTarget <#TargetDump2>;
    ];
  ];
.
<#TargetDump1> a rmlt:LogicalTarget;
  rmlt:target <#VoIDDump1>;
  rmlt:serialization formats:N-Triples;
.
<#TargetDump2> a rmlt:LogicalTarget;
  rmlt:target <#VoIDDump1>;
  rmlt:serialization formats:N-Triples;
.
<#VoIDDump1> a void:Dataset ;
  void:dataDump <file:///data/dump1.nt>;
.
<#VoIDDump2> a void:Dataset ;
  void:dataDump <file:///data/dump2.nt>;
.
# file:///data/dump1.nt
<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Kara Danvers" .
<http://example.org/0> <http://xmlns.com/foaf/0.1/nickname> "Supergirl" .
<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Alex Danvers" .
<http://example.org/1> <http://xmlns.com/foaf/0.1/nickname> "Sentinel" .
<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "J'onn J'onzz" .
<http://example.org/2> <http://xmlns.com/foaf/0.1/nickname> "Martian Manhunter" .
<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Nia Nal" .
<http://example.org/3> <http://xmlns.com/foaf/0.1/nickname> "Dreamer" .

# file:///data/dump2.nt
<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Kara Danvers" .
<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Alex Danvers" .
<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "J'onn J'onzz" .
<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Nia Nal" .

5.6 Subject Map and Graph Map

All triples containing the subject http://example.org/{@id} are exported to TargetDump1 and all triples within the named graph ex:Characters are exported to TargetDump2.

<Supergirl>
  <Character id="0">
    <name>Kara Danvers</name>
    <nickname>Supergirl</nickname>
  </Character>
  <Character id="1">
    <name>Alex Danvers</name>
    <nickname>Sentinel</nickname>
  </Character>
  <Character id="2">
    <name>J'onn J'onzz</name>
    <nickname>Martian Manhunter</nickname>
  </Character>
  <Character id="3">
    <name>Nia Nal</name>
    <nickname>Dreamer</nickname>
  </Character> 
</Supergirl>
<#DCATSourceAccess> a dcat:Dataset;
  dcat:distribution [ a dcat:Distribution;
    dcat:downloadURL "https://rml.io/specs/rml-target/Supergirl.xml";
  ];
.
<#TriplesMap> a rr:TriplesMap;
  rml:logicalSource [ a rml:LogicalSource;
    rml:source <#DCATSourceAccess>;
    rml:referenceFormulation ql:JSONPath;
    rml:iterator "$.[*]";
  ];
  rr:subjectMap [ a rr:SubjectMap;
    rr:template "http://example.org/{@id}";
    rml:logicalTarget <#TargetDump1>;
  ];
  rr:predicateObjectMap [ a rr:PredicateObjectMap;
    rr:graphMap [ a rr:GraphMap;
      rml:logicalTarget <#TargetDump2>;
      rr:constant ex:Characters;
    ];
    rr:predicateMap [ a rr:PredicateMap;
      rr:constant foaf:name;
    ];
    rr:objectMap [ a rr:ObjectMap;
      rml:reference "name/text()";
    ];
  ];
  rr:predicateObjectMap [ a rr:PredicateObjectMap;
    rr:predicateMap [ a rr:PredicateMap;
      rr:constant foaf:nickname;
    ];
    rr:objectMap [ a rr:ObjectMap;
      rml:reference "nickname/text()";
    ];
  ];
.
<#TargetDump1> a rmlt:LogicalTarget;
  rmlt:target <#VoIDDump1>;
  rmlt:serialization formats:N-Triples;
.
<#TargetDump2> a rmlt:LogicalTarget;
  rmlt:target <#VoIDDump1>;
  rmlt:serialization formats:N-Triples;
.
<#VoIDDump1> a void:Dataset ;
  void:dataDump <file:///data/dump1.nq>;
.
<#VoIDDump2> a void:Dataset ;
  void:dataDump <file:///data/dump2.nq>;
.
# file:///data/dump1.nq
<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Kara Danvers" <http://example.org/Characters> .
<http://example.org/0> <http://xmlns.com/foaf/0.1/nickname> "Supergirl" _b0 .
<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Alex Danvers" <http://example.org/Characters> .
<http://example.org/1> <http://xmlns.com/foaf/0.1/nickname> "Sentinel" _b0 .
<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "J'onn J'onzz" <http://example.org/Characters> .
<http://example.org/2> <http://xmlns.com/foaf/0.1/nickname> "Martian Manhunter" _b0 .
<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Nia Nal" <http://example.org/Characters> .
<http://example.org/3> <http://xmlns.com/foaf/0.1/nickname> "Dreamer" _b0 .

# file:///data/dump2.nq
<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Kara Danvers" <http://example.org/Characters> .
<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Alex Danvers" <http://example.org/Characters> .
<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "J'onn J'onzz" <http://example.org/Characters> .
<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Nia Nal" <http://example.org/Characters> .

5.7 Predicate Map and Graph Map

All triples containing the predicate foaf:nickname are exported to TargetDump1 and all triples within the named graph ex:Characters are exported to TargetDump2.

<Supergirl>
  <Character id="0">
    <name>Kara Danvers</name>
    <nickname>Supergirl</nickname>
  </Character>
  <Character id="1">
    <name>Alex Danvers</name>
    <nickname>Sentinel</nickname>
  </Character>
  <Character id="2">
    <name>J'onn J'onzz</name>
    <nickname>Martian Manhunter</nickname>
  </Character>
  <Character id="3">
    <name>Nia Nal</name>
    <nickname>Dreamer</nickname>
  </Character> 
</Supergirl>
<#DCATSourceAccess> a dcat:Dataset;
  dcat:distribution [ a dcat:Distribution;
    dcat:downloadURL "https://rml.io/specs/rml-target/Supergirl.xml";
  ];
.
<#TriplesMap> a rr:TriplesMap;
  rml:logicalSource [ a rml:LogicalSource;
    rml:source <#DCATSourceAccess>;
    rml:referenceFormulation ql:JSONPath;
    rml:iterator "$.[*]";
  ];
  rr:subjectMap [ a rr:SubjectMap;
    rr:template "http://example.org/{@id}";
  ];
  rr:predicateObjectMap [ a rr:PredicateObjectMap;
    rr:graphMap [ a rr:GraphMap;
      rml:logicalTarget <#TargetDump2>;
      rr:constant ex:Characters;
    ];
    rr:predicateMap [ a rr:PredicateMap;
      rr:constant foaf:name;
    ];
    rr:objectMap [ a rr:ObjectMap;
      rml:reference "name/text()";
    ];
  ];
  rr:predicateObjectMap [ a rr:PredicateObjectMap;
    rr:predicateMap [ a rr:PredicateMap;
      rr:constant foaf:nickname;
      rml:logicalTarget <#TargetDump1>;
    ];
    rr:objectMap [ a rr:ObjectMap;
      rml:reference "nickname/text()";
    ];
  ];
.
<#TargetDump1> a rmlt:LogicalTarget;
  rmlt:target <#VoIDDump1>;
  rmlt:serialization formats:N-Triples;
.
<#TargetDump2> a rmlt:LogicalTarget;
  rmlt:target <#VoIDDump1>;
  rmlt:serialization formats:N-Triples;
.
<#VoIDDump1> a void:Dataset ;
  void:dataDump <file:///data/dump1.nq>;
.
<#VoIDDump2> a void:Dataset ;
  void:dataDump <file:///data/dump2.nq>;
.
# file:///data/dump1.nq
<http://example.org/0> <http://xmlns.com/foaf/0.1/nickname> "Supergirl" _b0 .
<http://example.org/1> <http://xmlns.com/foaf/0.1/nickname> "Sentinel" _b0 .
<http://example.org/2> <http://xmlns.com/foaf/0.1/nickname> "Martian Manhunter" _b0 .
<http://example.org/3> <http://xmlns.com/foaf/0.1/nickname> "Dreamer" _b0 .

# file:///data/dump2.nq
<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Kara Danvers" <http://example.org/Characters> .
<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Alex Danvers" <http://example.org/Characters> .
<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "J'onn J'onzz" <http://example.org/Characters> .
<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Nia Nal" <http://example.org/Characters> .

5.8 Object Map and Graph Map

All triples containing the object reference nickname/text() are exported to TargetDump1 and all triples within the named graph ex:Characters are exported to TargetDump2.

<Supergirl>
  <Character id="0">
    <name>Kara Danvers</name>
    <nickname>Supergirl</nickname>
  </Character>
  <Character id="1">
    <name>Alex Danvers</name>
    <nickname>Sentinel</nickname>
  </Character>
  <Character id="2">
    <name>J'onn J'onzz</name>
    <nickname>Martian Manhunter</nickname>
  </Character>
  <Character id="3">
    <name>Nia Nal</name>
    <nickname>Dreamer</nickname>
  </Character> 
</Supergirl>
<#DCATSourceAccess> a dcat:Dataset;
  dcat:distribution [ a dcat:Distribution;
    dcat:downloadURL "https://rml.io/specs/rml-target/Supergirl.xml";
  ];
.
<#TriplesMap> a rr:TriplesMap;
  rml:logicalSource [ a rml:LogicalSource;
    rml:source <#DCATSourceAccess>;
    rml:referenceFormulation ql:JSONPath;
    rml:iterator "$.[*]";
  ];
  rr:subjectMap [ a rr:SubjectMap;
    rr:template "http://example.org/{@id}";
  ];
  rr:predicateObjectMap [ a rr:PredicateObjectMap;
    rr:graphMap [ a rr:GraphMap;
      rml:logicalTarget <#TargetDump2>;
      rr:constant ex:Characters;
    ];
    rr:predicateMap [ a rr:PredicateMap;
      rr:constant foaf:name;
    ];
    rr:objectMap [ a rr:ObjectMap;
      rml:reference "name/text()";
    ];
  ];
  rr:predicateObjectMap [ a rr:PredicateObjectMap;
    rr:predicateMap [ a rr:PredicateMap;
      rr:constant foaf:nickname;
    ];
    rr:objectMap [ a rr:ObjectMap;
      rml:reference "nickname/text()";
      rml:logicalTarget <#TargetDump1>;
    ];
  ];
.
<#TargetDump1> a rmlt:LogicalTarget;
  rmlt:target <#VoIDDump1>;
  rmlt:serialization formats:N-Triples;
.
<#TargetDump2> a rmlt:LogicalTarget;
  rmlt:target <#VoIDDump1>;
  rmlt:serialization formats:N-Triples;
.
<#VoIDDump1> a void:Dataset ;
  void:dataDump <file:///data/dump1.nq>;
.
<#VoIDDump2> a void:Dataset ;
  void:dataDump <file:///data/dump2.nq>;
.
# file:///data/dump1.nq
<http://example.org/0> <http://xmlns.com/foaf/0.1/nickname> "Supergirl" _b0 .
<http://example.org/1> <http://xmlns.com/foaf/0.1/nickname> "Sentinel" _b0 .
<http://example.org/2> <http://xmlns.com/foaf/0.1/nickname> "Martian Manhunter" _b0 .
<http://example.org/3> <http://xmlns.com/foaf/0.1/nickname> "Dreamer" _b0 .

# file:///data/dump2.nq
<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Kara Danvers" <http://example.org/Characters> .
<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Alex Danvers" <http://example.org/Characters> .
<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "J'onn J'onzz" <http://example.org/Characters> .
<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Nia Nal" <http://example.org/Characters> .

5.9 Language Map and Graph Map

All triples containing the language tag en are exported to TargetDump1 and all triples within the named graph ex:Characters are exported to TargetDump2. The other triples are exported to the default target of the processor as there is no dedicated Target assigned to triples containing foaf:nickname as predicate.

<Supergirl>
  <Character id="0">
    <name>Kara Danvers</name>
    <nickname>Supergirl</nickname>
  </Character>
  <Character id="1">
    <name>Alex Danvers</name>
    <nickname>Sentinel</nickname>
  </Character>
  <Character id="2">
    <name>J'onn J'onzz</name>
    <nickname>Martian Manhunter</nickname>
  </Character>
  <Character id="3">
    <name>Nia Nal</name>
    <nickname>Dreamer</nickname>
  </Character> 
</Supergirl>
<#DCATSourceAccess> a dcat:Dataset;
  dcat:distribution [ a dcat:Distribution;
    dcat:downloadURL "https://rml.io/specs/rml-target/Supergirl.xml";
  ];
.
<#TriplesMap> a rr:TriplesMap;
  rml:logicalSource [ a rml:LogicalSource;
    rml:source <#DCATSourceAccess>;
    rml:referenceFormulation ql:JSONPath;
    rml:iterator "$.[*]";
  ];
  rr:subjectMap [ a rr:SubjectMap;
    rr:template "http://example.org/{@id}";
  ];
  rr:predicateObjectMap [ a rr:PredicateObjectMap;
    rr:graphMap [ a rr:GraphMap;
      rml:logicalTarget <#TargetDump2>;
      rr:constant ex:Characters;
    ];
    rr:predicateMap [ a rr:PredicateMap;
      rr:constant foaf:name;
    ];
    rr:objectMap [ a rr:ObjectMap;
      rml:reference "name/text()";
      rml:languageMap [
        rml:logicalTarget <#TargetDump1>;
        rr:constant "en";
      ];
    ];
  ];
  rr:predicateObjectMap [ a rr:PredicateObjectMap;
    rr:predicateMap [ a rr:PredicateMap;
      rr:constant foaf:nickname;
    ];
    rr:objectMap [ a rr:ObjectMap;
      rml:reference "nickname/text()";
      rml:logicalTarget <#TargetDump2>;
    ];
  ];
.
<#TargetDump1> a rmlt:LogicalTarget;
  rmlt:target <#VoIDDump1>;
  rmlt:serialization formats:N-Triples;
.
<#TargetDump2> a rmlt:LogicalTarget;
  rmlt:target <#VoIDDump1>;
  rmlt:serialization formats:N-Triples;
.
<#VoIDDump1> a void:Dataset ;
  void:dataDump <file:///data/dump1.nt>;
.
<#VoIDDump2> a void:Dataset ;
  void:dataDump <file:///data/dump2.nt>;
.
# file:///data/dump1.nt
<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Kara Danvers"@en <http://example.org/Characters> .
<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Alex Danvers"@en <http://example.org/Characters> .
<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "J'onn J'onzz"@en <http://example.org/Characters> .
<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Nia Nal"@en <http://example.org/Characters> .

# file:///data/dump2.nt
<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Kara Danvers"@en <http://example.org/Characters> .
<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Alex Danvers"@en <http://example.org/Characters> .
<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "J'onn J'onzz"@en <http://example.org/Characters> .
<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Nia Nal"@en <http://example.org/Characters> .

# default target of processor
<http://example.org/0> <http://xmlns.com/foaf/0.1/nickname> "Supergirl" _b0 .
<http://example.org/1> <http://xmlns.com/foaf/0.1/nickname> "Sentinel" _b0 .
<http://example.org/2> <http://xmlns.com/foaf/0.1/nickname> "Martian Manhunter" _b0 .
<http://example.org/3> <http://xmlns.com/foaf/0.1/nickname> "Dreamer" _b0 .

5.10 Language Map and Object Map

All triples containing the language tag en are exported to TargetDump1 and all triples containing the object reference nickname/text() are exported to TargetDump2.

<Supergirl>
  <Character id="0">
    <name>Kara Danvers</name>
    <nickname>Supergirl</nickname>
  </Character>
  <Character id="1">
    <name>Alex Danvers</name>
    <nickname>Sentinel</nickname>
  </Character>
  <Character id="2">
    <name>J'onn J'onzz</name>
    <nickname>Martian Manhunter</nickname>
  </Character>
  <Character id="3">
    <name>Nia Nal</name>
    <nickname>Dreamer</nickname>
  </Character> 
</Supergirl>
<#DCATSourceAccess> a dcat:Dataset;
  dcat:distribution [ a dcat:Distribution;
    dcat:downloadURL "https://rml.io/specs/rml-target/Supergirl.xml";
  ];
.
<#TriplesMap> a rr:TriplesMap;
  rml:logicalSource [ a rml:LogicalSource;
    rml:source <#DCATSourceAccess>;
    rml:referenceFormulation ql:JSONPath;
    rml:iterator "$.[*]";
  ];
  rr:subjectMap [ a rr:SubjectMap;
    rr:template "http://example.org/{@id}";
  ];
  rr:predicateObjectMap [ a rr:PredicateObjectMap;
    rr:predicateMap [ a rr:PredicateMap;
      rr:constant foaf:name;
    ];
    rr:objectMap [ a rr:ObjectMap;
      rml:reference "name/text()";
      rml:languageMap [
        rml:logicalTarget <#TargetDump1>;
        rr:constant "en";
      ];
    ];
  ];
  rr:predicateObjectMap [ a rr:PredicateObjectMap;
    rr:predicateMap [ a rr:PredicateMap;
      rr:constant foaf:nickname;
    ];
    rr:objectMap [ a rr:ObjectMap;
      rml:reference "nickname/text()";
      rml:logicalTarget <#TargetDump2>;
    ];
  ];
.
<#TargetDump1> a rmlt:LogicalTarget;
  rmlt:target <#VoIDDump1>;
  rmlt:serialization formats:N-Triples;
.
<#TargetDump2> a rmlt:LogicalTarget;
  rmlt:target <#VoIDDump1>;
  rmlt:serialization formats:N-Triples;
.
<#VoIDDump1> a void:Dataset ;
  void:dataDump <file:///data/dump1.nt>;
.
<#VoIDDump2> a void:Dataset ;
  void:dataDump <file:///data/dump2.nt>;
.
# file:///data/dump1.nt
<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Kara Danvers"@en .
<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Alex Danvers"@en .
<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "J'onn J'onzz"@en .
<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Nia Nal"@en .

# file:///data/dump2.nt
<http://example.org/0> <http://xmlns.com/foaf/0.1/nickname> "Supergirl" .
<http://example.org/1> <http://xmlns.com/foaf/0.1/nickname> "Sentinel" .
<http://example.org/2> <http://xmlns.com/foaf/0.1/nickname> "Martian Manhunter" .
<http://example.org/3> <http://xmlns.com/foaf/0.1/nickname> "Dreamer" .

5.11 Multiple Predicate Maps

All triples containing the predicate foaf:name are exported to TargetDump1 and all triples containing the predicate foaf:nickname are exported to TargetDump2.

<Supergirl>
  <Character id="0">
    <name>Kara Danvers</name>
    <nickname>Supergirl</nickname>
  </Character>
  <Character id="1">
    <name>Alex Danvers</name>
    <nickname>Sentinel</nickname>
  </Character>
  <Character id="2">
    <name>J'onn J'onzz</name>
    <nickname>Martian Manhunter</nickname>
  </Character>
  <Character id="3">
    <name>Nia Nal</name>
    <nickname>Dreamer</nickname>
  </Character> 
</Supergirl>
<#DCATSourceAccess> a dcat:Dataset;
  dcat:distribution [ a dcat:Distribution;
    dcat:downloadURL "https://rml.io/specs/rml-target/Supergirl.xml";
  ];
.
<#TriplesMap> a rr:TriplesMap;
  rml:logicalSource [ a rml:LogicalSource;
    rml:source <#DCATSourceAccess>;
    rml:referenceFormulation ql:JSONPath;
    rml:iterator "$.[*]";
  ];
  rr:subjectMap [ a rr:SubjectMap;
    rr:template "http://example.org/{@id}";
  ];
  rr:predicateObjectMap [ a rr:PredicateObjectMap;
    rr:predicateMap [ a rr:PredicateMap;
      rr:constant foaf:name;
      rml:logicalTarget <#TargetDump1>;
    ];
    rr:objectMap [ a rr:ObjectMap;
      rml:reference "name/text()";
    ];
  ];
  rr:predicateObjectMap [ a rr:PredicateObjectMap;
    rr:predicateMap [ a rr:PredicateMap;
      rr:constant foaf:nickname;
      rml:logicalTarget <#TargetDump2>;
    ];
    rr:objectMap [ a rr:ObjectMap;
      rml:reference "nickname/text()";
    ];
  ];
.
<#TargetDump1> a rmlt:LogicalTarget;
  rmlt:target <#VoIDDump1>;
  rmlt:serialization formats:N-Triples;
.
<#TargetDump2> a rmlt:LogicalTarget;
  rmlt:target <#VoIDDump1>;
  rmlt:serialization formats:N-Triples;
.
<#VoIDDump1> a void:Dataset ;
  void:dataDump <file:///data/dump1.nt>;
.
<#VoIDDump2> a void:Dataset ;
  void:dataDump <file:///data/dump2.nt>;
.
# file:///data/dump1.nt
<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Kara Danvers" .
<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Alex Danvers" .
<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "J'onn J'onzz" .
<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Nia Nal" .

# file:///data/dump2.nt
<http://example.org/0> <http://xmlns.com/foaf/0.1/nickname> "Supergirl" .
<http://example.org/1> <http://xmlns.com/foaf/0.1/nickname> "Sentinel" .
<http://example.org/2> <http://xmlns.com/foaf/0.1/nickname> "Martian Manhunter" .
<http://example.org/3> <http://xmlns.com/foaf/0.1/nickname> "Dreamer" .

5.12 Multiple Object Maps

All triples containing the object reference name/text() are exported to TargetDump1 and all triples containing the object reference nickname/text() are exported to TargetDump2.

<Supergirl>
  <Character id="0">
    <name>Kara Danvers</name>
    <nickname>Supergirl</nickname>
  </Character>
  <Character id="1">
    <name>Alex Danvers</name>
    <nickname>Sentinel</nickname>
  </Character>
  <Character id="2">
    <name>J'onn J'onzz</name>
    <nickname>Martian Manhunter</nickname>
  </Character>
  <Character id="3">
    <name>Nia Nal</name>
    <nickname>Dreamer</nickname>
  </Character> 
</Supergirl>
<#DCATSourceAccess> a dcat:Dataset;
  dcat:distribution [ a dcat:Distribution;
    dcat:downloadURL "https://rml.io/specs/rml-target/Supergirl.xml";
  ];
.
<#TriplesMap> a rr:TriplesMap;
  rml:logicalSource [ a rml:LogicalSource;
    rml:source <#DCATSourceAccess>;
    rml:referenceFormulation ql:JSONPath;
    rml:iterator "$.[*]";
  ];
  rr:subjectMap [ a rr:SubjectMap;
    rr:template "http://example.org/{@id}";
  ];
  rr:predicateObjectMap [ a rr:PredicateObjectMap;
    rr:predicateMap [ a rr:PredicateMap;
      rr:constant foaf:name;
    ];
    rr:objectMap [ a rr:ObjectMap;
      rml:reference "name/text()";
      rml:logicalTarget <#TargetDump1>;
    ];
  ];
  rr:predicateObjectMap [ a rr:PredicateObjectMap;
    rr:predicateMap [ a rr:PredicateMap;
      rr:constant foaf:nickname;
    ];
    rr:objectMap [ a rr:ObjectMap;
      rml:reference "nickname/text()";
      rml:logicalTarget <#TargetDump2>;
    ];
  ];
.
<#TargetDump1> a rmlt:LogicalTarget;
  rmlt:target <#VoIDDump1>;
  rmlt:serialization formats:N-Triples;
.
<#TargetDump2> a rmlt:LogicalTarget;
  rmlt:target <#VoIDDump1>;
  rmlt:serialization formats:N-Triples;
.
<#VoIDDump1> a void:Dataset ;
  void:dataDump <file:///data/dump1.nt>;
.
<#VoIDDump2> a void:Dataset ;
  void:dataDump <file:///data/dump2.nt>;
.
# file:///data/dump1.nt
<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Kara Danvers" .
<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Alex Danvers" .
<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "J'onn J'onzz" .
<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Nia Nal" .

# file:///data/dump2.nt
<http://example.org/0> <http://xmlns.com/foaf/0.1/nickname> "Supergirl" .
<http://example.org/1> <http://xmlns.com/foaf/0.1/nickname> "Sentinel" .
<http://example.org/2> <http://xmlns.com/foaf/0.1/nickname> "Martian Manhunter" .
<http://example.org/3> <http://xmlns.com/foaf/0.1/nickname> "Dreamer" .

5.13 Multiple Graph Maps

All triples within the named graph ex:Characters are exported to TargetDump1 and all triples within the named graph ex:NickNames are exported to TargetDump2.

<Supergirl>
  <Character id="0">
    <name>Kara Danvers</name>
    <nickname>Supergirl</nickname>
  </Character>
  <Character id="1">
    <name>Alex Danvers</name>
    <nickname>Sentinel</nickname>
  </Character>
  <Character id="2">
    <name>J'onn J'onzz</name>
    <nickname>Martian Manhunter</nickname>
  </Character>
  <Character id="3">
    <name>Nia Nal</name>
    <nickname>Dreamer</nickname>
  </Character> 
</Supergirl>
<#DCATSourceAccess> a dcat:Dataset;
  dcat:distribution [ a dcat:Distribution;
    dcat:downloadURL "https://rml.io/specs/rml-target/Supergirl.xml";
  ];
.
<#TriplesMap> a rr:TriplesMap;
  rml:logicalSource [ a rml:LogicalSource;
    rml:source <#DCATSourceAccess>;
    rml:referenceFormulation ql:JSONPath;
    rml:iterator "$.[*]";
  ];
  rr:subjectMap [ a rr:SubjectMap;
    rr:template "http://example.org/{@id}";
  ];
  rr:predicateObjectMap [ a rr:PredicateObjectMap;
    rr:graphMap [ a rr:GraphMap;
      rml:logicalTarget <#TargetDump1>;
      rr:constant ex:Characters;
    ];
    rr:predicateMap [ a rr:PredicateMap;
      rr:constant foaf:name;
    ];
    rr:objectMap [ a rr:ObjectMap;
      rml:reference "name/text()";
    ];
  ];
  rr:predicateObjectMap [ a rr:PredicateObjectMap;
    rr:graphMap [ a rr:GraphMap;
      rml:logicalTarget <#TargetDump2>;
      rr:constant ex:NickNames;
    ];
    rr:predicateMap [ a rr:PredicateMap;
      rr:constant foaf:nickname;
    ];
    rr:objectMap [ a rr:ObjectMap;
      rml:reference "nickname/text()";
    ];
  ];
.
<#TargetDump1> a rmlt:LogicalTarget;
  rmlt:target <#VoIDDump1>;
  rmlt:serialization formats:N-Triples;
.
<#TargetDump2> a rmlt:LogicalTarget;
  rmlt:target <#VoIDDump1>;
  rmlt:serialization formats:N-Triples;
.
<#VoIDDump1> a void:Dataset ;
  void:dataDump <file:///data/dump1.nq>;
.
<#VoIDDump2> a void:Dataset ;
  void:dataDump <file:///data/dump2.nq>;
.
# file:///data/dump1.nq
<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Kara Danvers" <http://example.org/Characters> .
<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Alex Danvers" <http://example.org/Characters> .
<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "J'onn J'onzz" <http://example.org/Characters> .
<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Nia Nal" <http://example.org/Characters> .

# file:///data/dump2.nq
<http://example.org/0> <http://xmlns.com/foaf/0.1/nickname> "Supergirl" <http://example.org/Nicknames> .
<http://example.org/1> <http://xmlns.com/foaf/0.1/nickname> "Sentinel" <http://example.org/Nicknames> .
<http://example.org/2> <http://xmlns.com/foaf/0.1/nickname> "Martian Manhunter" <http://example.org/Nicknames> .
<http://example.org/3> <http://xmlns.com/foaf/0.1/nickname> "Dreamer" <http://example.org/Nicknames> .

6. Overriding Targets

In some cases exporting all triples to a target is not desired, therefore Targets can be overridden when needed by either using a separate Triples Map which isolates certain triples or by using FnO functions [FnO] as conditions.

6.1 Separate Triples Map

Triples can be exported to a specific Target while not to other Targets by isolating these triples in a separate Triples Map.

In this example, the same subject and object are used in both Triples Maps, but with a diffent predicate. The triples with the first predicate foaf:name are exported to the first Target and the triples with the second predicate schema:name to the second Target.

# Results of DBPedia SPARQL query
actor,name,nickname
http://dbpedia.org/resource/Kevin_Sussman,Kevin Sussman
http://dbpedia.org/resource/Jim_Parsons,Jim Parsons
http://dbpedia.org/resource/Kaley_Cuoco,Kaley Cuoco
http://dbpedia.org/resource/Sara_Gilbert,Sara Gilbert
http://dbpedia.org/resource/Kunal_Nayyar,Kunal Nayyar
http://dbpedia.org/resource/Laura_Spencer_(actress),Laura Spencer
http://dbpedia.org/resource/Simon_Helberg,Simon Helberg
http://dbpedia.org/resource/Johnny_Galecki,Johnny Galecki
http://dbpedia.org/resource/Mayim_Bialik,Mayim Bialik
http://dbpedia.org/resource/Melissa_Rauch,Melissa Rauch
<#SDSourceAccess> a sd:Service;
  sd:endpoint ;
  sd:supportedLanguage sd:SPARQL11Query;
  sd:resultFormat formats:SPARQL_Results_CSV;
.
<#TriplesMap1> a rr:TriplesMap;
  rml:logicalSource [ a rml:LogicalSource;
    rml:source <#SDSourceAccess>;
    rml:query """
      PREFIX dbo: 
      PREFIX rdf: 
      PREFIX rdfs: 
      SELECT DISTINCT ?actor ?name WHERE {
        ?tvshow rdf:type dbo:TelevisionShow .
        ?tvshow rdfs:label "The Big Bang Theory"@en .
        ?tvshow dbo:starring ?actor .
        ?actor foaf:name ?name .
      }
    """;
  ];
  rr:subjectMap [ a rr:SubjectMap;
    rml:reference "actor";
    rr:termType rr:IRI;
    rmlt:logicalTarget <TargetDump1>;
  ];
  rr:predicateObjectMap [ a rr:PredicateObjectMap;
    rr:predicateMap [ a rr:PredicateMap;
      rr:constant foaf:name;
    ];
    rr:objectMap [ a rr:ObjectMap;
      rml:reference "name";
    ];
  ];

<#TriplesMap2> a rr:TriplesMap;
  rml:logicalSource [ a rml:LogicalSource;
    rml:source <#SDSourceAccess>;
    rml:query """
      PREFIX dbo: 
      PREFIX rdf: 
      PREFIX rdfs: 
      SELECT DISTINCT ?actor ?name WHERE {
        ?tvshow rdf:type dbo:TelevisionShow .
        ?tvshow rdfs:label "The Big Bang Theory"@en .
        ?tvshow dbo:starring ?actor .
        ?actor foaf:name ?name .
      }
    """;
  ];
  rr:subjectMap [ a rr:SubjectMap;
    rml:reference "actor";
    rr:termType rr:IRI;
    rmlt:logicalTarget <TargetDump2>;
  ];
  rr:predicateObjectMap [ a rr:PredicateObjectMap;
    rr:predicateMap [ a rr:PredicateMap;
      rr:constant schema:name;
    ];
    rr:objectMap [ a rr:ObjectMap;
      rml:reference "name";
    ];
  ];
.
<#TargetDump1> a rmlt:LogicalTarget;
  rmlt:target <#VoIDDump1>;
  rmlt:serialization formats:N-Triples;
.
<#TargetDump2> a rmlt:LogicalTarget;
  rmlt:target <#VoIDDump2>;
  rmlt:serialization formats:N-Triples;
.
<#VoIDDump1> a void:Dataset ;
  void:dataDump <file:///data/dump1.nt>;
.
<#VoIDDump2> a void:Dataset ;
  void:dataDump <file:///data/dump2.nq>;
.
# file:///data/dump1.nt
<http://dbpedia.org/resource/Kevin_Sussman> <http://xmlns.com/foaf/0.1/name> "Kevin Sussman" .
<http://dbpedia.org/resource/Jim_Parsons> <http://xmlns.com/foaf/0.1/name> "Jim Parsons" .
<http://dbpedia.org/resource/Kaley_Cuoco> <http://xmlns.com/foaf/0.1/name> "Kaley Cuoco" .
<http://dbpedia.org/resource/Sara_Gilbert> <http://xmlns.com/foaf/0.1/name> "Sara Gilbert" .
<http://dbpedia.org/resource/Kunal_Nayyar> <http://xmlns.com/foaf/0.1/name> "Kunal Nayyar" .
<http://dbpedia.org/resource/Laura_Spencer> <http://xmlns.com/foaf/0.1/name> "Laura Spencer" .
<http://dbpedia.org/resource/Simon_Helberg> <http://xmlns.com/foaf/0.1/name> "Simon Helberg" .
<http://dbpedia.org/resource/Johnny_Galecki> <http://xmlns.com/foaf/0.1/name> "Johnny Galecki" .
<http://dbpedia.org/resource/Mayim_Bialik> <http://xmlns.com/foaf/0.1/name> "Mayim Bialik" .
<http://dbpedia.org/resource/Melissa_Rauch> <http://xmlns.com/foaf/0.1/name> "Melissa Rauch" .

# file:///data/dump2.nt
<http://dbpedia.org/resource/Kevin_Sussman> <http://schema.org/name> "Kevin Sussman" .
<http://dbpedia.org/resource/Jim_Parsons> <http://schema.org/name> "Jim Parsons" .
<http://dbpedia.org/resource/Kaley_Cuoco> <http://schema.org/name> "Kaley Cuoco" .
<http://dbpedia.org/resource/Sara_Gilbert> <http://schema.org/name> "Sara Gilbert" .
<http://dbpedia.org/resource/Kunal_Nayyar> <http://schema.org/name> "Kunal Nayyar" .
<http://dbpedia.org/resource/Laura_Spencer> <http://schema.org/name> "Laura Spencer" .
<http://dbpedia.org/resource/Simon_Helberg> <http://schema.org/name> "Simon Helberg" .
<http://dbpedia.org/resource/Johnny_Galecki> <http://schema.org/name> "Johnny Galecki" .
<http://dbpedia.org/resource/Mayim_Bialik> <http://schema.org/name> "Mayim Bialik" .
<http://dbpedia.org/resource/Melissa_Rauch> <http://schema.org/name> "Melissa Rauch" .

6.2 Conditions

FnO functions MAY be leveraged to export triples only under certain conditions. Conditions are already integrated in RML+FnO processors, thus conditions apply on Targets as well. Triples are generated and exported based on the FnO condition's evaluation. Only if the condition is true, the triples are generated and exported.

In the example, the triples with Jim Parsons as object are exported to the first Target, triples with Kaley Cuoco as object are exported to the second Target.

# Results of DBPedia SPARQL query
actor,name,nickname
http://dbpedia.org/resource/Kevin_Sussman,Kevin Sussman
http://dbpedia.org/resource/Jim_Parsons,Jim Parsons
http://dbpedia.org/resource/Kaley_Cuoco,Kaley Cuoco
http://dbpedia.org/resource/Sara_Gilbert,Sara Gilbert
http://dbpedia.org/resource/Kunal_Nayyar,Kunal Nayyar
http://dbpedia.org/resource/Laura_Spencer_(actress),Laura Spencer
http://dbpedia.org/resource/Simon_Helberg,Simon Helberg
http://dbpedia.org/resource/Johnny_Galecki,Johnny Galecki
http://dbpedia.org/resource/Mayim_Bialik,Mayim Bialik
http://dbpedia.org/resource/Melissa_Rauch,Melissa Rauch
<#SDSourceAccess> a sd:Service;
  sd:endpoint ;
  sd:supportedLanguage sd:SPARQL11Query;
  sd:resultFormat formats:SPARQL_Results_CSV;
.
<#TriplesMap> a rr:TriplesMap;
  rml:logicalSource [ a rml:LogicalSource;
    rml:source <#SDSourceAccess>;
    rml:query """
      PREFIX dbo: 
      PREFIX rdf: 
      PREFIX rdfs: 
      SELECT DISTINCT ?actor ?name WHERE {
        ?tvshow rdf:type dbo:TelevisionShow .
        ?tvshow rdfs:label "The Big Bang Theory"@en .
        ?tvshow dbo:starring ?actor .
        ?actor foaf:name ?name .
      }
    """;
  ];
  rr:subjectMap [ a rr:SubjectMap;
    rml:reference "actor";
    rr:termType rr:IRI;
    rmlt:logicalTarget <TargetDump1>;
  ];
  rr:predicateObjectMap [ a rr:PredicateObjectMap;
    rr:predicateMap [ a rr:PredicateMap;
      rr:constant foaf:name;
    ];
    rr:objectMap [ a rr:ObjectMap;
      rml:reference "name";
    ];
  ];
  rr:predicateObjectMap [ 
    rr:predicateMap [ rr:constant foaf:name ];
    rr:objectMap [
      fnml:functionValue [
        rr:predicateObjectMap [
          rr:predicate fno:executes ;
          rr:objectMap [ rr:constant idlab-fn:decide ]
        ];
        rr:predicateObjectMap [
          rr:predicate idlab-fn:expectedStr ;
          rr:objectMap [ rr:constant "Jim Parsons"]
        ];
        rr:predicateObjectMap [
          rr:predicate idlab-fn:str ;
          rr:objectMap [ 
            rml:reference "name";
            rml:logicalTarget <#TargetDump1>;
          ];
        ];
      ];
    ];
  ];
  rr:predicateObjectMap [ 
    rr:predicateMap [ rr:constant foaf:name ];
    rr:objectMap [
      fnml:functionValue [
        rr:predicateObjectMap [
          rr:predicate fno:executes ;
          rr:objectMap [ rr:constant idlab-fn:decide ]
        ];
        rr:predicateObjectMap [
          rr:predicate idlab-fn:expectedStr ;
          rr:objectMap [ rr:constant "Kaley Cuoco"]
        ];
        rr:predicateObjectMap [
          rr:predicate idlab-fn:str ;
          rr:objectMap [ 
            rml:reference "name";
            rml:logicalTarget <#TargetDump2>;
          ];
        ];
      ];
    ];
  ];
<#TargetDump1> a rmlt:LogicalTarget;
  rmlt:target <#VoIDDump1>;
  rmlt:serialization formats:N-Triples;
.
<#TargetDump2> a rmlt:LogicalTarget;
  rmlt:target <#VoIDDump2>;
  rmlt:serialization formats:N-Triples;
.
<#VoIDDump1> a void:Dataset ;
  void:dataDump <file:///data/dump1.nt>;
.
<#VoIDDump2> a void:Dataset ;
  void:dataDump <file:///data/dump2.nt>;
.
# file:///data/dump1.nt
<http://dbpedia.org/resource/Jim_Parsons> <http://xmlns.com/foaf/0.1/name> "Jim Parsons" .

# file:///data/dump2.nt
<http://dbpedia.org/resource/Kaley_Cuoco> <http://xmlns.com/foaf/0.1/name> "Kaley Cuoco" .

A. References

A.1 Normative references

[CSVW]
CSV on the Web: A Primer. W3C. 25 February 2016. W3C Working Group Note. URL: https://www.w3.org/TR/tabular-data-primer/
[FnO]
The Function Ontology. FnO team. 05 January 2021. Unofficial Draft. URL: https://fno.io/spec
[R2RML]
R2RML: RDB to RDF Mapping Language. Souripriya Das; Seema Sundara; Richard Cyganiak. W3C. 27 September 2012. W3C Recommendation. URL: https://www.w3.org/TR/r2rml/
[RDF-Concepts]
Resource Description Framework (RDF): Concepts and Abstract Syntax. Graham Klyne; Jeremy Carroll. W3C. 10 February 2004. W3C Recommendation. URL: https://www.w3.org/TR/rdf-concepts/
[RFC2119]
Key words for use in RFCs to Indicate Requirement Levels. S. Bradner. IETF. March 1997. Best Current Practice. URL: https://datatracker.ietf.org/doc/html/rfc2119
[RFC8174]
Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words. B. Leiba. IETF. May 2017. Best Current Practice. URL: https://datatracker.ietf.org/doc/html/rfc8174
[RML]
RDF Mapping Language (RML). RML team. 06 October 2020. Unofficial Draft. URL: https://rml.io/specs/rml
[VoID]
Describing Linked Datasets with the VoID Vocabulary. Keith Alexander; Richard Cyganiak; Michael Hausenblas; Jun Zhao. W3C. 3 March 2011. W3C Note. URL: https://www.w3.org/TR/void/

A.2 Informative references

[DataIO]
DataIO. Dylan Van Assche; Anastasia Dimou. RML team. 24 March 2021. Unofficial Draft. URL: https://rml.io/specs/dataio