diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml new file mode 100644 index 00000000..cff1fe79 --- /dev/null +++ b/.idea/inspectionProfiles/Project_Default.xml @@ -0,0 +1,8 @@ + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml index 3bd7f31c..9f12a696 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -1,4 +1,3 @@ - diff --git a/fetch-test-cases.bat b/fetch-test-cases.bat new file mode 100644 index 00000000..c0586723 --- /dev/null +++ b/fetch-test-cases.bat @@ -0,0 +1,61 @@ +@echo off + +set "targetDir=target" + +echo Creating target directory... +if not exist "%targetDir%" mkdir "%targetDir%" +if errorlevel 1 goto error + +cd "%targetDir%" +if errorlevel 1 goto error + +echo Cloning https://github.com/kg-construct/rml-core +git clone https://github.com/kg-construct/rml-core +if errorlevel 1 goto error + +echo Cloning rhttps://github.com/kg-construct/rml-cc +git clone https://github.com/kg-construct/rml-cc +if errorlevel 1 goto error + +echo Cloning https://github.com/kg-construct/rml-io +git clone https://github.com/kg-construct/rml-io +if errorlevel 1 goto error + +echo Cloning rhttps://github.com/kg-construct/rml-fnml +git clone https://github.com/kg-construct/rml-fnml +if errorlevel 1 goto error + +echo Cloning https://github.com/kg-construct/rml-lv +git clone https://github.com/kg-construct/rml-lv +if errorlevel 1 goto error + +echo Cloning rhttps://github.com/kg-construct/rml-star +git clone https://github.com/kg-construct/rml-star +if errorlevel 1 goto error + +echo All repositories cloned successfully into the target directory! + +echo Copying test-case directories to ..\src\test\resources +xcopy .\rml-core\test-cases ..\src\test\resources\rml-core /E /I /Y +xcopy .\rml-cc\test-cases ..\src\test\resources\rml-cc /E /I /Y +xcopy .\target\rml-io\test-cases ..\src\test\resources\rml-io /E /I /Y +xcopy .\rml-lv\test-cases ..\src\test\resources\rml-lv /E /I /Y +xcopy .\rml-fnml\test-cases ..\src\test\resources\rml-fnml /E /I /Y +xcopy .\rml-star\test-cases ..\src\test\resources\rml-star /E /I /Y + +rmdir /S /Q .\rml-core +rmdir /S /Q .\rml-cc +rmdir /S /Q .\rml-io +rmdir /S /Q .\rml-lv +rmdir /S /Q .\rml-fnml +rmdir /S /Q .\rml-star + +goto end + +:error +echo Error occurred. +echo Check the repository URLs and your internet connection. +echo or verify that you have permissions to create and write to the target directory. + +:end +pause \ No newline at end of file diff --git a/fetch-test-cases.sh b/fetch-test-cases.sh new file mode 100755 index 00000000..fb070632 --- /dev/null +++ b/fetch-test-cases.sh @@ -0,0 +1,72 @@ +#!/usr/bin/env bash +set -Eeuo pipefail + +# --- config --- +target_dir="target" +resources_dir="src/test/resources" +shapes_resources_dir="src/main/resources/shapes" +repos=( + "rml-core" + "rml-cc" + "rml-io" + "rml-fnml" + "rml-lv" + "rml-star" +) + +trap 'echo; echo "Error occurred."; echo "• Check the repository URLs and your internet connection."; echo "• Verify you have permissions to create/write to \"$target_dir\"."; exit 1' ERR + +# Check prerequisites +command -v git >/dev/null 2>&1 || { echo "git is required but not found in PATH."; exit 1; } + +echo "Creating $target_dir directory..." +mkdir -p "$target_dir" + +echo "Entering $target_dir..." +cd "$target_dir" + +# Clone all repositories +for repo in "${repos[@]}"; do + echo "Cloning https://github.com/kg-construct/$repo ..." + git clone "https://github.com/kg-construct/$repo" +done + +echo "All repositories cloned successfully into $target_dir" + +# Copy test-cases into ../src/test/resources/ +echo "Copying test-case directories to ../$resources_dir ..." +for repo in "${repos[@]}"; do + src="$repo/test-cases" + dest="../$resources_dir/$repo" + if [[ -d "$src" ]]; then + mkdir -p "$dest" + # -a to preserve attrs; -r for recursive; --no-target-directory not needed here + cp -a "$src/." "$dest/" + echo "• Copied $src -> $dest" + else + echo "• Skipped $repo (no test-cases directory found)" + fi +done + +# Copy shapes into ../src/main/resources/ +echo "Copying shapes directories to ../$shapes_resources_dir ..." +for repo in "${repos[@]}"; do + src="$repo/shapes" + dest="../$shapes_resources_dir/$repo" + if [[ -d "$src" ]]; then + mkdir -p "$dest" + # -a to preserve attrs; -r for recursive; --no-target-directory not needed here + cp -a "$src/." "$dest/" + echo "• Copied $src -> $dest" + else + echo "• Skipped $repo (no shapes directory found)" + fi +done + +# Remove cloned repositories +echo "Cleaning up cloned repositories..." +for repo in "${repos[@]}"; do + rm -rf "./$repo" +done + +echo "Done." diff --git a/pom.xml b/pom.xml index c728053b..6dc54d76 100644 --- a/pom.xml +++ b/pom.xml @@ -2,7 +2,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - com.github.kg-construct + io.github.kg-construct BURP 0.1.2 Basic and Unassuming RML Processor @@ -220,6 +220,12 @@ test + org.junit.jupiter + junit-jupiter-params + 5.10.2 + test + + org.testcontainers junit-jupiter 1.19.5 diff --git a/src/main/java/burp/Main.java b/src/main/java/burp/Main.java index d318529e..d7ac6597 100644 --- a/src/main/java/burp/Main.java +++ b/src/main/java/burp/Main.java @@ -68,11 +68,13 @@ public static int doMain(String[] args) { } } - private static Dataset generate(List triplesmaps, String baseIRI) { + private static Dataset generate(List triplesmaps, String givenBaseIRI) { Dataset ds = DatasetFactory.create(); // Execute the triples maps for (TriplesMap tm : triplesmaps) { + String baseIRI = tm.baseIRI == null ? givenBaseIRI : tm.baseIRI; + // Let sm be the subject map of the triples map SubjectMap sm = tm.subjectMap; diff --git a/src/main/java/burp/ls/CSVSource.java b/src/main/java/burp/ls/CSVSource.java index cf81acd4..6910aaf1 100644 --- a/src/main/java/burp/ls/CSVSource.java +++ b/src/main/java/burp/ls/CSVSource.java @@ -1,18 +1,16 @@ package burp.ls; import java.io.FileReader; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.Set; +import java.io.StringWriter; +import java.util.*; +import java.util.stream.Collectors; import com.opencsv.CSVParserBuilder; import com.opencsv.CSVReader; import com.opencsv.CSVReaderBuilder; import burp.model.Iteration; +import com.opencsv.CSVWriter; class CSVSource extends FileBasedLogicalSource { @@ -23,7 +21,7 @@ class CSVSource extends FileBasedLogicalSource { public Iterator iterator() { try { if (iterations == null) { - iterations = new ArrayList(); + iterations = new ArrayList<>(); FileReader fr = new FileReader(getDecompressedFile(), encoding); @@ -64,7 +62,8 @@ public Iterator iterator() { class CSVIteration extends Iteration { - private Map map = new HashMap(); + // Use a LinkedHashMap to preserve a correspondence between keys and values + private final Map map = new LinkedHashMap<>(); protected CSVIteration(String[] header, String[] rec, Set nulls) { super(nulls); @@ -76,12 +75,12 @@ protected CSVIteration(String[] header, String[] rec, Set nulls) { @Override public List getValuesFor(String reference) { - List l = new ArrayList(); + List l = new ArrayList<>(); if(!map.containsKey(reference)) throw new RuntimeException("Attribute " + reference + " does not exist."); String o = map.get(reference); - if(!nulls.contains(o)) + if(nulls == null || !nulls.contains(o)) l.add(o); return l; @@ -89,15 +88,21 @@ public List getValuesFor(String reference) { @Override public List getStringsFor(String reference) { - List l = new ArrayList(); - if(!map.containsKey(reference)) - throw new RuntimeException("Attribute " + reference + " does not exist."); - - String o = map.get(reference); - if(!nulls.contains(o)) - l.add(o); - - return l; + return getValuesFor(reference).stream().map(Object::toString).collect(Collectors.toList()); } - + + @Override + public String asString() { + StringWriter stringWriter = new StringWriter(); + try (CSVWriter writer = new CSVWriter(stringWriter)) { + String[] header = map.keySet().toArray(new String[0]); + writer.writeNext(header); + String[] rec = map.values().toArray(new String[0]); + writer.writeNext(rec); + } catch(Exception e) { + throw new RuntimeException("Error representing CSV iteration as CSV."); + } + return stringWriter.toString(); + } + } \ No newline at end of file diff --git a/src/main/java/burp/ls/FileBasedLogicalSource.java b/src/main/java/burp/ls/FileBasedLogicalSource.java index 1a8dd937..b9c6f6c0 100644 --- a/src/main/java/burp/ls/FileBasedLogicalSource.java +++ b/src/main/java/burp/ls/FileBasedLogicalSource.java @@ -15,7 +15,6 @@ abstract class FileBasedLogicalSource extends LogicalSource { protected List iterations = null; public String file; - public String iterator; public Charset encoding = StandardCharsets.UTF_8; public Resource compression = RML.none; diff --git a/src/main/java/burp/ls/JSONSource.java b/src/main/java/burp/ls/JSONSource.java index e72f0960..eec35805 100644 --- a/src/main/java/burp/ls/JSONSource.java +++ b/src/main/java/burp/ls/JSONSource.java @@ -21,17 +21,20 @@ class JSONSource extends FileBasedLogicalSource { - private static Configuration c = Configuration.builder().mappingProvider(new JacksonMappingProvider()) - .jsonProvider(new JacksonJsonProvider()).build().addOptions(Option.ALWAYS_RETURN_LIST); + public static final Configuration configuration = Configuration.builder() + .mappingProvider(new JacksonMappingProvider()) + .jsonProvider(new JacksonJsonProvider()) + .build() + .addOptions(Option.ALWAYS_RETURN_LIST); @Override public Iterator iterator() { try { if (iterations == null) { - iterations = new ArrayList(); + iterations = new ArrayList<>(); String contents = Files.readString(Paths.get(getDecompressedFile()), encoding); - List> nodes = JsonPath.using(c).parse(contents).read(iterator); + List> nodes = JsonPath.using(configuration).parse(contents).read(iterator); for (Map n : nodes) { iterations.add(new JSONIteration(JSONObject.toJSONString(n), nulls)); } @@ -47,34 +50,22 @@ public Iterator iterator() { class JSONIteration extends Iteration { private DocumentContext doc = null; - - private static Configuration c = Configuration - .builder() - .mappingProvider(new JacksonMappingProvider()) - .jsonProvider(new JacksonJsonProvider()) - .build() - .addOptions(Option.ALWAYS_RETURN_LIST) - ; - + protected JSONIteration(String json, Set nulls) { super(nulls); - - doc = JsonPath.using(c).parse(json); + doc = JsonPath.using(JSONSource.configuration).parse(json); } @Override public List getValuesFor(String reference) { - // We need to explicitly convert the objects - // to strings because RML has not worked out - // "6.6.1 Automatically deriving datatypes" yet - List l2 = new ArrayList(); + List l2 = new ArrayList<>(); try { List l = doc.read(reference); for(Object o : l) { if (o instanceof List) throw new RuntimeException("Data error: reference retrieved an array"); - if (o != null && !nulls.contains(o)) - l2.add(o.toString()); + if (o != null && (nulls == null || !nulls.contains(o))) + l2.add(o); } } catch (PathNotFoundException e) { // No data, silently ignore @@ -85,16 +76,13 @@ public List getValuesFor(String reference) { @Override public List getStringsFor(String reference) { - // We need to explicitly convert the objects - // to strings (when they are null) because - // this JSONPath library is... difficult. - List l2 = new ArrayList(); + List l2 = new ArrayList<>(); try { List l = doc.read(reference); for(Object o : l) { if (o instanceof List) throw new RuntimeException("Data error: reference retrieved an array"); - if (o != null && !nulls.contains(o)) + if (o != null && (nulls == null || !nulls.contains(o))) l2.add(o.toString()); } } catch (PathNotFoundException e) { @@ -103,5 +91,10 @@ public List getStringsFor(String reference) { } return l2; } - + + @Override + public String asString() { + return doc.jsonString(); + } + } \ No newline at end of file diff --git a/src/main/java/burp/ls/LogicalSourceFactory.java b/src/main/java/burp/ls/LogicalSourceFactory.java index b5284e8c..edbc7040 100644 --- a/src/main/java/burp/ls/LogicalSourceFactory.java +++ b/src/main/java/burp/ls/LogicalSourceFactory.java @@ -1,14 +1,19 @@ package burp.ls; import java.io.File; +import java.io.StringReader; import java.net.MalformedURLException; import java.net.URL; import java.nio.charset.Charset; import java.nio.charset.StandardCharsets; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; - +import java.util.*; + +import burp.model.AbstractLogicalSource; +import burp.model.Iteration; +import com.jayway.jsonpath.JsonPath; +import com.opencsv.CSVReader; +import net.minidev.json.JSONObject; +import org.apache.commons.io.IOUtils; import org.apache.jena.rdf.model.Resource; import org.apache.jena.rdf.model.Statement; import org.apache.jena.rdf.model.StmtIterator; @@ -25,6 +30,15 @@ import burp.vocabularies.UCOCore; import burp.vocabularies.UCOObservable; import burp.vocabularies.YS; +import org.w3c.dom.Document; +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; + +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.xpath.XPath; +import javax.xml.xpath.XPathConstants; +import javax.xml.xpath.XPathFactory; public class LogicalSourceFactory { @@ -52,13 +66,11 @@ else if ("UTF-16".equals(e)) if (r.hasProperty(CSVW.delimiter)) { // TODO: According to CSVW, the delimiter is a string. But all examples are chars. - char e = r.getProperty(CSVW.delimiter).getChar(); - source.delimiter = e; + source.delimiter = r.getProperty(CSVW.delimiter).getChar(); } if (r.hasProperty(CSVW.header)) { - Boolean e = r.getProperty(CSVW.header).getBoolean(); - source.firstLineIsHeader = e; + source.firstLineIsHeader = r.getProperty(CSVW.header).getBoolean(); } if (r.hasProperty(CSVW.NULL) && !ls.hasProperty(RML.NULL)) { @@ -227,7 +239,7 @@ public static LogicalSource createNetconfQuerySource(Resource ls) { // Get operation filter source.filter = s.getPropertyResourceValue(YS.filter); // Set XPath for RML iterator - source.rmlIterator = ls.getProperty(RML.iterator).getLiteral().getString(); + source.iterator = ls.getProperty(RML.iterator).getLiteral().getString(); // Set map of prefixes for RML iterations source.rmlPrefixMap = getPrefixMap(ls); return source; @@ -340,7 +352,7 @@ private static HashMap getPrefixMap(Resource ls) { Resource referenceFormulation = ls.getPropertyResourceValue(RML.referenceFormulation); // Set map of namespaces for XPath iteration StmtIterator properties = referenceFormulation.listProperties(RML.namespace); - HashMap prefixMap = new HashMap(); + HashMap prefixMap = new HashMap<>(); while (properties.hasNext()) { Statement statement = properties.next(); Resource namespace = statement.getResource(); @@ -352,4 +364,50 @@ private static HashMap getPrefixMap(Resource ls) { return prefixMap; } + public static List changeIterator(String iterationAsString, Resource rf, String iterator) { + try { + if (RML.JSONPath.equals(rf)) { + // Create JSON iterations + List iterations = new ArrayList<>(); + String contents = iterationAsString; + List> nodes = JsonPath.using(JSONSource.configuration).parse(contents).read(iterator); + for (Map n : nodes) + // TODO: How do we provide null values? + iterations.add(new JSONIteration(JSONObject.toJSONString(n), new HashSet<>())); + return iterations; + + } else if (RML.CSV.equals(rf)) { + // Create CSV iterations + CSVReader reader = new CSVReader(new StringReader(iterationAsString)); + List all = reader.readAll(); + reader.close(); + String[] header = all.remove(0); + List iterations = new ArrayList<>(); + for (String[] rec : all) + // TODO: How do we provide null values? + iterations.add(new CSVIteration(header, rec, new HashSet<>())); + return iterations; + + } else if (RML.XPath.equals(rf)) { + // Create XPATH iterations + DocumentBuilderFactory builderFactory = DocumentBuilderFactory.newInstance(); + DocumentBuilder builder = builderFactory.newDocumentBuilder(); + Document xmlDocument = builder.parse(IOUtils.toInputStream(iterationAsString)); + XPath xPath = XPathFactory.newInstance().newXPath(); + NodeList nodes = (NodeList) xPath.compile(iterator).evaluate(xmlDocument, XPathConstants.NODESET); + + List iterations = new ArrayList<>(); + for (int index = 0; index < nodes.getLength(); index++) { + Node node = nodes.item(index); + // TODO: How do we provide null values? + // TODO: How do we provide the prefix mappings? + iterations.add(new XMLIteration(node, new HashSet<>(), new HashMap<>())); + } + } + } catch (Throwable e) { + throw new RuntimeException(e); + } + + throw new RuntimeException("Other reference formulations for iterable fields are not yet supported: " + rf); + } } diff --git a/src/main/java/burp/ls/NetconfQuerySource.java b/src/main/java/burp/ls/NetconfQuerySource.java index a3d9913d..e6218a27 100644 --- a/src/main/java/burp/ls/NetconfQuerySource.java +++ b/src/main/java/burp/ls/NetconfQuerySource.java @@ -49,13 +49,12 @@ class NetconfQuerySource extends LogicalSource { public Resource datastoreType; public Resource filter; - public String rmlIterator; public HashMap rmlPrefixMap; protected List iterations = null; public Charset encoding = StandardCharsets.UTF_8; - private Map datastoreMap = Map.ofEntries( + private final Map datastoreMap = Map.ofEntries( Map.entry(YS.CandidateDatastore, NetconfSession.CANDIDATE), Map.entry(YS.StartupDatastore, NetconfSession.STARTUP), Map.entry(YS.RunningDatastore, NetconfSession.RUNNING) @@ -78,7 +77,7 @@ public Iterator iterator() { if (filter.hasProperty(RDF.type, YS.XPathFilter)) { // Set map of namespaces for XPath iteration StmtIterator properties = filter.listProperties(YS.namespace); - HashMap prefixMap = new HashMap(); + HashMap prefixMap = new HashMap<>(); while (properties.hasNext()) { Statement statement = properties.next(); Resource namespace = statement.getResource(); @@ -122,16 +121,14 @@ public Iterator iterator() { } } c.close(); - } catch (IOException ex) { - throw new RuntimeException(ex); - } catch (JNCException ex) { + } catch (IOException | JNCException ex) { throw new RuntimeException(ex); } - // XML data fetched from YANG server. Now iterate. + // XML data fetched from YANG server. Now iterate. try { if (iterations == null) { - iterations = new ArrayList(); + iterations = new ArrayList<>(); DocumentBuilderFactory builderFactory = DocumentBuilderFactory.newInstance(); if (rmlPrefixMap != null) { @@ -147,7 +144,7 @@ public Iterator iterator() { xPath.setNamespaceContext(namespaces); } - NodeList nodes = (NodeList) xPath.compile(rmlIterator).evaluate(xmlDocument, XPathConstants.NODESET); + NodeList nodes = (NodeList) xPath.compile(iterator).evaluate(xmlDocument, XPathConstants.NODESET); for (int i = 0; i < nodes.getLength(); i++) { Node node = nodes.item(i); diff --git a/src/main/java/burp/ls/RDBSource.java b/src/main/java/burp/ls/RDBSource.java index a2c5463d..897c9166 100644 --- a/src/main/java/burp/ls/RDBSource.java +++ b/src/main/java/burp/ls/RDBSource.java @@ -1,18 +1,14 @@ package burp.ls; +import java.io.StringWriter; import java.sql.Connection; import java.sql.DriverManager; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.Properties; -import java.util.Set; +import java.util.*; +import com.opencsv.CSVWriter; import org.apache.commons.text.StringEscapeUtils; import burp.model.Iteration; @@ -31,9 +27,9 @@ class RDBSource extends LogicalSource { public Iterator iterator() { try { Properties props = new Properties(); - if (username != null && !"".equals(username)) + if (username != null && !username.isEmpty()) props.setProperty("user", username); - if (password != null && !"".equals(password)) + if (password != null && !password.isEmpty()) props.setProperty("password", password); Class.forName(jdbcDriver); @@ -41,12 +37,12 @@ public Iterator iterator() { Statement statement = connection.createStatement(); final ResultSet resultset = statement.executeQuery(query); - Map indexMap = new HashMap(); + Map indexMap = new HashMap<>(); for (int i = 1; i <= resultset.getMetaData().getColumnCount(); i++) { indexMap.put(resultset.getMetaData().getColumnLabel(i), i); } - return new Iterator() { + return new Iterator<>() { @Override public boolean hasNext() { @@ -72,7 +68,7 @@ public Iteration next() { class RDBIteration extends Iteration { - private Map values = new HashMap(); + private final Map values = new LinkedHashMap<>(); protected RDBIteration(ResultSet resultSet, Map indexMap, Set nulls) { super(nulls); @@ -95,7 +91,7 @@ protected RDBIteration(ResultSet resultSet, Map indexMap, Set getValuesFor(String reference) { - List l = new ArrayList(); + List l = new ArrayList<>(); String columnname = StringEscapeUtils.unescapeJava(reference); if(!values.containsKey(columnname) && !values.containsKey(columnname.replace("\"", ""))) @@ -116,11 +112,16 @@ public List getValuesFor(String reference) { @Override public List getStringsFor(String reference) { - List l = new ArrayList(); + List l = new ArrayList<>(); for(Object o : getValuesFor(reference)) if(o != null) l.add(o.toString()); return l; } - + + @Override + public String asString() { + throw new RuntimeException("Not implemented. Does this make sense in the context of LV?"); + } + } \ No newline at end of file diff --git a/src/main/java/burp/ls/SPARQLFileSource.java b/src/main/java/burp/ls/SPARQLFileSource.java index 69f84530..2de1b886 100644 --- a/src/main/java/burp/ls/SPARQLFileSource.java +++ b/src/main/java/burp/ls/SPARQLFileSource.java @@ -16,7 +16,7 @@ class SPARQLFileSource extends FileBasedLogicalSource { - private boolean isTSV; + private final boolean isTSV; public SPARQLFileSource(boolean isTSV) { this.isTSV = isTSV; @@ -26,7 +26,7 @@ public SPARQLFileSource(boolean isTSV) { public Iterator iterator() { try { if (iterations == null) { - iterations = new ArrayList(); + iterations = new ArrayList<>(); Dataset ds = RDFDataMgr.loadDataset(file); @@ -63,7 +63,7 @@ protected SPARQLIteratation(QuerySolution sol, Set nulls) { @Override public List getValuesFor(String reference) { - List l = new ArrayList(); + List l = new ArrayList<>(); RDFNode n = sol.get(reference); if(n != null && !nulls.contains(n)) l.add(n); @@ -72,13 +72,18 @@ public List getValuesFor(String reference) { @Override public List getStringsFor(String reference) { - List l = new ArrayList(); + List l = new ArrayList<>(); RDFNode n = sol.get(reference); if(n != null && !nulls.contains(n)) l.add(n.toString()); return l; } - + + @Override + public String asString() { + throw new RuntimeException("Not implemented. Does this make sense in the context of LV?"); + } + } class SPARQLTSVIteratation extends Iteration { @@ -93,7 +98,7 @@ protected SPARQLTSVIteratation(QuerySolution sol, Set nulls) { @Override public List getValuesFor(String reference) { - List l = new ArrayList(); + List l = new ArrayList<>(); // REMOVE THE ? FROM THE REFERENCE RDFNode n = sol.get(reference.substring(1)); if(n != null && !nulls.contains(n)) @@ -103,12 +108,16 @@ public List getValuesFor(String reference) { @Override public List getStringsFor(String reference) { - List l = new ArrayList(); + List l = new ArrayList<>(); // REMOVE THE ? FROM THE REFERENCE RDFNode n = sol.get(reference.substring(1)); if(n != null && !nulls.contains(n)) l.add(n.toString()); return l; } - + + @Override + public String asString() { + throw new RuntimeException("Not implemented. Does this make sense in the context of LV?"); + } } \ No newline at end of file diff --git a/src/main/java/burp/ls/SPARQLServiceSource.java b/src/main/java/burp/ls/SPARQLServiceSource.java index 9bcd70e7..abb6989c 100644 --- a/src/main/java/burp/ls/SPARQLServiceSource.java +++ b/src/main/java/burp/ls/SPARQLServiceSource.java @@ -15,7 +15,7 @@ class SPARQLServiceSource extends LogicalSource { private List iterations = null; - private boolean isTSV; + private final boolean isTSV; public String iterator; public String endpoint; @@ -28,7 +28,7 @@ public SPARQLServiceSource(boolean isTSV) { public Iterator iterator() { try { if (iterations == null) { - iterations = new ArrayList(); + iterations = new ArrayList<>(); QueryExecution exec = QueryExecutionHTTP.service(endpoint).query(iterator).build(); ResultSet results = exec.execSelect(); diff --git a/src/main/java/burp/ls/XMLSource.java b/src/main/java/burp/ls/XMLSource.java index 86bbadbf..ba3dbe65 100644 --- a/src/main/java/burp/ls/XMLSource.java +++ b/src/main/java/burp/ls/XMLSource.java @@ -1,5 +1,6 @@ package burp.ls; +import java.io.StringWriter; import java.nio.file.Files; import java.nio.file.Paths; import java.util.ArrayList; @@ -10,6 +11,11 @@ import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.transform.OutputKeys; +import javax.xml.transform.Transformer; +import javax.xml.transform.TransformerFactory; +import javax.xml.transform.dom.DOMSource; +import javax.xml.transform.stream.StreamResult; import javax.xml.xpath.XPath; import javax.xml.xpath.XPathConstants; import javax.xml.xpath.XPathFactory; @@ -30,7 +36,7 @@ class XMLSource extends FileBasedLogicalSource { public Iterator iterator() { try { if (iterations == null) { - iterations = new ArrayList(); + iterations = new ArrayList<>(); String contents = Files.readString(Paths.get(getDecompressedFile()), encoding); @@ -65,8 +71,8 @@ public Iterator iterator() { class XMLIteration extends Iteration { - private Node node; - private HashMap prefixMap; + private final Node node; + private final HashMap prefixMap; protected XMLIteration(Node node, Set nulls, HashMap prefixMap) { super(nulls); @@ -80,7 +86,7 @@ public List getValuesFor(String reference) { // We need to explicitly convert the objects // to strings because RML has not worked out // "6.6.1 Automatically deriving datatypes" yet - List l2 = new ArrayList(); + List l2 = new ArrayList<>(); try { XPath xPath = XPathFactory.newInstance().newXPath(); if (prefixMap != null) { @@ -118,7 +124,7 @@ public List getValuesFor(String reference) { @Override public List getStringsFor(String reference) { - List l2 = new ArrayList(); + List l2 = new ArrayList<>(); try { XPath xPath = XPathFactory.newInstance().newXPath(); if (prefixMap != null) { @@ -154,4 +160,17 @@ public List getStringsFor(String reference) { return l2; } + @Override + public String asString() { + try { + TransformerFactory tf = TransformerFactory.newInstance(); + Transformer transformer = tf.newTransformer(); + StringWriter writer = new StringWriter(); + transformer.transform(new DOMSource(node), new StreamResult(writer)); + return writer.toString(); + } catch (Exception e) { + throw new RuntimeException("Error converting Node to String", e); + } + } + } diff --git a/src/main/java/burp/model/AbstractLogicalSource.java b/src/main/java/burp/model/AbstractLogicalSource.java new file mode 100644 index 00000000..ec463091 --- /dev/null +++ b/src/main/java/burp/model/AbstractLogicalSource.java @@ -0,0 +1,16 @@ +package burp.model; + +import org.apache.jena.rdf.model.Resource; + +import java.util.*; + +public abstract class AbstractLogicalSource extends Iterable implements FieldParent { + + public Set nulls = new HashSet<>(); + public abstract Iterator iterator(); + + @Override + public String getAbsoluteFieldName() { + return ""; + } +} \ No newline at end of file diff --git a/src/main/java/burp/model/ConcreteExpressionMap.java b/src/main/java/burp/model/ConcreteExpressionMap.java index 92f169fb..aa524326 100644 --- a/src/main/java/burp/model/ConcreteExpressionMap.java +++ b/src/main/java/burp/model/ConcreteExpressionMap.java @@ -1,39 +1,32 @@ package burp.model; import java.util.ArrayList; +import java.util.Collections; import java.util.List; /** * * A ConcreteExpressionMap is a concrete implementation of the abstract class - * ExpressionMap for use in join conditions + * ExpressionMap for use in join conditions and logical views * */ public class ConcreteExpressionMap extends ExpressionMap { - public List generateValues(Iteration i) { - List l = new ArrayList(); - - if(expression instanceof RDFNodeConstant) { - // It is assumed to be a string, otherwise the shapes - // Would have caught the error. - l.add(((RDFNodeConstant) expression).constant.toString()); - return l; - } + public List generateValues(Iteration i) { + + if(expression instanceof RDFNodeConstant) + return Collections.singletonList(((RDFNodeConstant) expression).constant); - if(expression instanceof Template) { - l.addAll(((Template) expression).values(i)); - return l; - } + if(expression instanceof Template) + return new ArrayList<>(((Template) expression).values(i)); - if(expression instanceof Reference) { - List values = ((Reference) expression).values(i); - for(Object o : values) - l.add(o.toString()); - return l; - } + if(expression instanceof Reference) + return ((Reference) expression).values(i); + + if(expression instanceof FunctionExecution) + return ((FunctionExecution) expression).values(i, null); - throw new RuntimeException("Error generating language string."); + throw new RuntimeException("Error generating values."); } } \ No newline at end of file diff --git a/src/main/java/burp/model/ContainsFields.java b/src/main/java/burp/model/ContainsFields.java new file mode 100644 index 00000000..c11cda60 --- /dev/null +++ b/src/main/java/burp/model/ContainsFields.java @@ -0,0 +1,12 @@ +package burp.model; + +import java.util.List; + +public interface ContainsFields { + + List getIterableFields(); + List getExpressionFields(); + + void addField(Field field); + +} diff --git a/src/main/java/burp/model/ExpressionField.java b/src/main/java/burp/model/ExpressionField.java new file mode 100644 index 00000000..83395558 --- /dev/null +++ b/src/main/java/burp/model/ExpressionField.java @@ -0,0 +1,25 @@ +package burp.model; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; + +public class ExpressionField extends Field { + + public ConcreteExpressionMap fieldExpressionMap; + + public List enrich(LogicalIteration underlying){ + List list = new ArrayList<>(); + + int i = 0; + for(Object o : fieldExpressionMap.generateValues(underlying.getIteration(parent.getAbsoluteFieldName()))){ + LogicalIteration e = underlying.copy(); + e.put(getAbsoluteFieldName() + ".#", i++); + e.put(getAbsoluteFieldName(), o); + list.add(e); + } + + return Field.expand(list, expressionFields, iterableFields); + } + +} diff --git a/src/main/java/burp/model/ExpressionMap.java b/src/main/java/burp/model/ExpressionMap.java index 2a17ef06..c078d979 100644 --- a/src/main/java/burp/model/ExpressionMap.java +++ b/src/main/java/burp/model/ExpressionMap.java @@ -1,6 +1,7 @@ package burp.model; import java.math.BigDecimal; +import java.net.URI; import java.sql.Date; import java.sql.Timestamp; import java.text.DecimalFormat; @@ -15,6 +16,7 @@ import org.apache.jena.datatypes.xsd.XSDDatatype; import org.apache.jena.rdf.model.Literal; import org.apache.jena.rdf.model.RDFNode; +import org.apache.jena.rdf.model.Resource; import org.apache.jena.rdf.model.ResourceFactory; import burp.util.Util; @@ -24,7 +26,7 @@ public abstract class ExpressionMap { public Expression expression = null; protected List generateIRIs(Iteration i, String baseIRI) { - List set = new ArrayList(); + List set = new ArrayList<>(); if(expression instanceof RDFNodeConstant) { // It is assumed to be an IRI, otherwise the shapes @@ -38,8 +40,8 @@ protected List generateIRIs(Iteration i, String baseIRI) { if(Util.isAbsoluteAndValidIRI(v)) set.add(ResourceFactory.createResource(v)); - else if(Util.isAbsoluteAndValidIRI(baseIRI + v.toString())) - set.add(ResourceFactory.createResource(baseIRI + v.toString())); + else if(Util.isAbsoluteAndValidIRI(baseIRI + v)) + set.add(ResourceFactory.createResource(baseIRI + v)); else throw new RuntimeException(baseIRI + " and " + v + " do not constitute a valid IRI"); @@ -78,9 +80,74 @@ else if(Util.isAbsoluteAndValidIRI(baseIRI + s)) throw new RuntimeException("Error generating IRI."); } - static private Map map = new HashMap(); + protected List generateURIs(Iteration i, String baseIRI) { + List set = new ArrayList<>(); + + if(expression instanceof RDFNodeConstant) { + // It is assumed to be an IRI, otherwise the shapes + // Would have caught the error. But we need to test whether it is + // a URI. + + Resource r = ((RDFNodeConstant) expression).constant.asResource(); + + try { + new URI(r.getURI()); + } catch (Exception e) { + throw new RuntimeException("This is not a valid URI."); + } + + set.add(((RDFNodeConstant) expression).constant.asResource()); + return set; + } + + if(expression instanceof Template) { + for(String v : ((Template) expression).values(i, true)) { + + if(Util.isAbsoluteAndValidURI(v)) + set.add(ResourceFactory.createResource(v)); + else if(Util.isAbsoluteAndValidURI(baseIRI + v)) + set.add(ResourceFactory.createResource(baseIRI + v)); + else + throw new RuntimeException(baseIRI + " and " + v + " do not constitute a valid URI"); + + } + return set; + } + + if(expression instanceof Reference) { + for(Object v : ((Reference) expression).values(i)) { + String s = v.toString(); + + if(Util.isAbsoluteAndValidURI(s)) + set.add(ResourceFactory.createResource(s)); + else if(Util.isAbsoluteAndValidURI(baseIRI + s)) + set.add(ResourceFactory.createResource(baseIRI + s)); + else + throw new RuntimeException(baseIRI + " and " + s + " do not constitute a valid URI"); + } + return set; + } + + if(expression instanceof FunctionExecution) { + for(Object v : ((FunctionExecution) expression).values(i, baseIRI)) { + String s = v.toString(); + + if(Util.isAbsoluteAndValidURI(s)) + set.add(ResourceFactory.createResource(s)); + else if(Util.isAbsoluteAndValidURI(baseIRI + s)) + set.add(ResourceFactory.createResource(baseIRI + s)); + else + throw new RuntimeException(baseIRI + " and " + s + " do not constitute a valid IRI"); + } + return set; + } + + throw new RuntimeException("Error generating IRI."); + } + + static private final Map map = new HashMap<>(); protected List generateBlankNodes(Iteration i, String baseIRI) { - List set = new ArrayList(); + List set = new ArrayList<>(); if(expression instanceof RDFNodeConstant) { // It is assumed to be a BN, otherwise the shapes @@ -122,7 +189,7 @@ protected List generateBlankNodes(Iteration i, String baseIRI) { } protected List generateLiterals(Iteration i, String baseIRI, DatatypeMap dm, LanguageMap lm) { - List set = new ArrayList(); + List set = new ArrayList<>(); if(expression instanceof RDFNodeConstant) { // It is assumed to be a literal, otherwise the shapes @@ -202,9 +269,8 @@ else if(o instanceof Float) { return ResourceFactory.createTypedLiteral(s, XSDDatatype.XSDdouble); } else if(o instanceof Date) { return ResourceFactory.createTypedLiteral(o.toString(), XSDDatatype.XSDdate); - } else if(o instanceof Timestamp) { - Timestamp t = (Timestamp) o; - String s = o.toString().replace(" ", "T"); + } else if(o instanceof Timestamp t) { + String s = o.toString().replace(" ", "T"); // Ensure canonical xsd:dateTime by removing the ".0" when no fraction if(t.getNanos() == 0) @@ -223,16 +289,14 @@ private static String doubleCanonicalMap(Double d) { // The number of digits in the unscaled value int p = f.precision(); // We start from two digits - StringBuilder x = new StringBuilder("0.0"); - // Add the remaining digits to the pattern - for (int i = 2; i < p; i++) - x.append("#"); - // Let's not forget the e-notation - x.append("E0"); + // Add the remaining digits to the pattern + String x = "0.0" + "#".repeat(Math.max(0, p - 2)) + + // Let's not forget the e-notation + "E0"; NumberFormat numberFormat = NumberFormat.getNumberInstance(Locale.US); DecimalFormat formatter = (DecimalFormat) numberFormat; - formatter.applyPattern(x.toString()); + formatter.applyPattern(x); return formatter.format(d); } diff --git a/src/main/java/burp/model/Field.java b/src/main/java/burp/model/Field.java new file mode 100644 index 00000000..c57efe63 --- /dev/null +++ b/src/main/java/burp/model/Field.java @@ -0,0 +1,75 @@ +package burp.model; + +import java.util.ArrayList; +import java.util.List; + +public abstract class Field implements ContainsFields, FieldParent { + + public String fieldName ; + public FieldParent parent; + + public List expressionFields = new ArrayList<>(); + public List iterableFields = new ArrayList<>(); + + public static List expand(List list, List expressionFields, List iterableFields) { + List result = new ArrayList<>(list); + + if (expressionFields != null && !expressionFields.isEmpty()) { + // Let's process the expression fields + for (ExpressionField expressionField : expressionFields) { + List nlist = new ArrayList<>(); + for (LogicalIteration li : result) { + nlist.addAll(expressionField.enrich(li)); + } + result = nlist; + } + } + + if (iterableFields != null && !iterableFields.isEmpty()) { + // Let's process the iterable fields + List nlist = new ArrayList<>(); + for (LogicalIteration li : result) { + for (IterableField iterableField : iterableFields) { + nlist.addAll(iterableField.enrich(li)); + } + } + result = nlist; + } + + return result; + } + + @Override + public String getAbsoluteFieldName() { + if (parent instanceof AbstractLogicalSource) + return fieldName; + + Field parent = (Field) this.parent; + return parent.getAbsoluteFieldName() + "." + fieldName; + } + + @Override + public List getIterableFields() { + return iterableFields; + } + + @Override + public List getExpressionFields() { + return expressionFields; + } + + @Override + public void addField(Field field) { + field.parent = this; + + if (field instanceof IterableField) { + getIterableFields().add((IterableField) field); + } else if (field instanceof ExpressionField) { + getExpressionFields().add((ExpressionField) field); + } + else + throw new RuntimeException("Unknown field type."); + } + +} + diff --git a/src/main/java/burp/model/FieldParent.java b/src/main/java/burp/model/FieldParent.java new file mode 100644 index 00000000..3915bbb6 --- /dev/null +++ b/src/main/java/burp/model/FieldParent.java @@ -0,0 +1,9 @@ +package burp.model; + +import java.util.Iterator; +import java.util.List; + +public interface FieldParent { + + String getAbsoluteFieldName(); +} diff --git a/src/main/java/burp/model/FunctionExecution.java b/src/main/java/burp/model/FunctionExecution.java index a1a40d3a..d9346daa 100644 --- a/src/main/java/burp/model/FunctionExecution.java +++ b/src/main/java/burp/model/FunctionExecution.java @@ -5,8 +5,6 @@ import java.util.List; import java.util.Map; -import org.apache.jena.datatypes.RDFDatatype; -import org.apache.jena.rdf.model.Literal; import org.apache.jena.rdf.model.RDFNode; import burp.model.fnmlutil.Functions; @@ -14,11 +12,11 @@ public class FunctionExecution extends Expression { public FunctionMap functionMap; - public List inputs = new ArrayList(); + public List inputs = new ArrayList<>(); public ReturnMap returnMap; public List values(Iteration i, String baseIRI) { - List list = new ArrayList(); + List list = new ArrayList<>(); // TODO: We assume that function maps, parameter maps, and input value maps only yield one value List functions = functionMap.generateIRIs(i, baseIRI); @@ -28,7 +26,7 @@ public List values(Iteration i, String baseIRI) { String function = functions.get(0).asResource().getURI(); // Bind parameters via a map - Map map = new HashMap(); + Map map = new HashMap<>(); for(Input input : inputs) { List parameters = input.parameterMap.generateIRIs(i, baseIRI); diff --git a/src/main/java/burp/model/FunctionMap.java b/src/main/java/burp/model/FunctionMap.java index a9d74b55..31711568 100644 --- a/src/main/java/burp/model/FunctionMap.java +++ b/src/main/java/burp/model/FunctionMap.java @@ -14,10 +14,11 @@ public FunctionMap() { @Override public List generateTerms(Iteration i, String baseIRI) { - if(termType == RML.IRI) { - return generateIRIs(i, baseIRI); - } - + if(termType == RML.IRI) + return generateIRIs(i, baseIRI); + if(termType == RML.URI) + return generateURIs(i, baseIRI); + throw new RuntimeException("Incorrect term type for function map."); } diff --git a/src/main/java/burp/model/GatherMap.java b/src/main/java/burp/model/GatherMap.java index ce066961..2d6bab74 100644 --- a/src/main/java/burp/model/GatherMap.java +++ b/src/main/java/burp/model/GatherMap.java @@ -8,10 +8,10 @@ public interface GatherMap { - public abstract boolean isGatherMap(); + boolean isGatherMap(); - abstract public List generateGatherMapGraphs(Iteration i, String baseIRI); + List generateGatherMapGraphs(Iteration i, String baseIRI); - abstract public List generateTerms(Iteration i, String baseIRI); + List generateTerms(Iteration i, String baseIRI); } diff --git a/src/main/java/burp/model/GraphMap.java b/src/main/java/burp/model/GraphMap.java index 492f6f67..5c10e27d 100644 --- a/src/main/java/burp/model/GraphMap.java +++ b/src/main/java/burp/model/GraphMap.java @@ -15,6 +15,8 @@ public GraphMap() { public List generateTerms(Iteration i, String baseIRI) { if(RML.IRI.equals(termType)) return generateIRIs(i, baseIRI); + if(termType == RML.URI) + return generateURIs(i, baseIRI); if(RML.BLANKNODE.equals(termType)) return generateBlankNodes(i, baseIRI); diff --git a/src/main/java/burp/model/InputValueMap.java b/src/main/java/burp/model/InputValueMap.java index 6c94e822..663a15f1 100644 --- a/src/main/java/burp/model/InputValueMap.java +++ b/src/main/java/burp/model/InputValueMap.java @@ -1,6 +1,5 @@ package burp.model; -import java.util.ArrayList; import java.util.List; import org.apache.jena.rdf.model.RDFNode; @@ -18,10 +17,12 @@ public InputValueMap() { @Override public List generateTerms(Iteration i, String baseIRI) { - if(RML.IRI.equals(termType)) - return new ArrayList(generateIRIs(i, baseIRI)); - if(RML.BLANKNODE.equals(termType)) - return new ArrayList(generateBlankNodes(i, baseIRI)); + if(RML.IRI.equals(termType)) + return generateIRIs(i, baseIRI); + if(RML.URI.equals(termType)) + return generateURIs(i, baseIRI); + if(RML.BLANKNODE.equals(termType)) + return generateBlankNodes(i, baseIRI); if(RML.LITERAL.equals(termType)) return generateLiterals(i, baseIRI, datatypeMap, languageMap); diff --git a/src/main/java/burp/model/Iterable.java b/src/main/java/burp/model/Iterable.java new file mode 100644 index 00000000..3503f3d0 --- /dev/null +++ b/src/main/java/burp/model/Iterable.java @@ -0,0 +1,14 @@ +package burp.model; + +import org.apache.jena.rdf.model.Resource; + +import java.util.HashSet; +import java.util.Iterator; +import java.util.Set; + +public abstract class Iterable { + + public String iterator; + public Resource referenceFormulation; + +} \ No newline at end of file diff --git a/src/main/java/burp/model/IterableField.java b/src/main/java/burp/model/IterableField.java new file mode 100644 index 00000000..3e3a321d --- /dev/null +++ b/src/main/java/burp/model/IterableField.java @@ -0,0 +1,54 @@ +package burp.model; + +import burp.ls.LogicalSourceFactory; +import org.apache.jena.rdf.model.Resource; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; + +public class IterableField extends Field { + + public String iterator; + public Resource referenceFormulation; + + public List enrich(LogicalIteration underlying) { + List list = new ArrayList<>(); + + if (referenceFormulation == null) { + // The iterator has chanced + // We take the iterator from the parent + String i = underlying.getIterationString(parent.getAbsoluteFieldName()); + int index = 0; + for(Iteration newIteration : LogicalSourceFactory.changeIterator(i, getAncestorReferenceFormulation(), iterator)) { + LogicalIteration e = underlying.copy(); + e.put(getAbsoluteFieldName() + ".#", index++); + e.put(getAbsoluteFieldName(), newIteration); + list.add(e); + } + } else { + // The reference formulation (and iterator) have changed. + String i = underlying.getIterationString(parent.getAbsoluteFieldName()); + + int index = 0; + for(Iteration newIteration : LogicalSourceFactory.changeIterator(i, referenceFormulation, iterator)) { + System.out.println(newIteration); + LogicalIteration e = underlying.copy(); + e.put(getAbsoluteFieldName() + ".#", index++); + e.put(getAbsoluteFieldName(), newIteration); + list.add(e); + } + } + + return Field.expand(list, expressionFields, iterableFields); + } + + private Resource getAncestorReferenceFormulation() { + // Since we explicitly created an IterableField for the rood. the two lines below should suffice. + if(referenceFormulation != null) return referenceFormulation; + if(parent instanceof IterableField) return ((IterableField) parent).getAncestorReferenceFormulation(); + if(parent instanceof LogicalSource) return ((LogicalSource) parent).referenceFormulation; + return null; + } + +} \ No newline at end of file diff --git a/src/main/java/burp/model/Iteration.java b/src/main/java/burp/model/Iteration.java index 0df40571..bfa29bd4 100644 --- a/src/main/java/burp/model/Iteration.java +++ b/src/main/java/burp/model/Iteration.java @@ -1,11 +1,12 @@ package burp.model; +import java.util.HashSet; import java.util.List; import java.util.Set; public abstract class Iteration { - public Set nulls = null; + public Set nulls = new HashSet<>(); public Iteration(Set nulls) { this.nulls = nulls; @@ -15,53 +16,5 @@ public Iteration(Set nulls) { public abstract List getStringsFor(String reference); -} - -//class SPARQLTSVIteration extends Iteration { -// -// private Map map = new HashMap(); -// private Model m = ModelFactory.createDefaultModel(); -// -// public SPARQLTSVIteration(String[] header, String[] rec) { -// for(int i = 0; i < header.length; i++) { -// if(isResource(rec[i])) { -// map.put(header[i], m.createResource(rec[i])); -// } else if (rec[i].startsWith("_:")) { -// Resource r = m.createResource(new AnonId(rec[i])); -// map.put(header[i], r); -// } else { -// String triple = "<#a> <#b> " + rec[i] + "."; -// Model m2 = ModelFactory.createDefaultModel().read(new StringReader(triple), "http://example.org/"); -// Statement s = m2.listStatements().next(); -// map.put(header[i], s.getObject()); -// } -// } -// } -// -// private boolean isResource(String string) { -// try { -// IRIFactory.iriImplementation().create(string.toString()); -// return true; -// } catch(Exception e) { -// return false; -// } -// } -// -// @Override -// protected List getValuesFor(String reference) { -// List l = new ArrayList(); -// if(!map.containsKey(reference)) -// throw new RuntimeException("Attribute " + reference + " does not exist."); -// l.add(map.get(reference)); -// return l; -// } -// -// @Override -// protected List getStringsFor(String reference) { -// List l = new ArrayList(); -// if(map.containsKey(reference)) -// l.add(map.get(reference).toString()); -// return l; -// } -// -//} \ No newline at end of file + public abstract String asString(); +} \ No newline at end of file diff --git a/src/main/java/burp/model/LanguageMap.java b/src/main/java/burp/model/LanguageMap.java index 81b62082..244286ab 100644 --- a/src/main/java/burp/model/LanguageMap.java +++ b/src/main/java/burp/model/LanguageMap.java @@ -7,7 +7,7 @@ public class LanguageMap extends ExpressionMap { public List generateStrings(Iteration i) { - List set = new ArrayList(); + List set = new ArrayList<>(); if(expression instanceof RDFNodeConstant) { // It is assumed to be a string, otherwise the shapes diff --git a/src/main/java/burp/model/LogicalSource.java b/src/main/java/burp/model/LogicalSource.java index 17033181..2398e463 100644 --- a/src/main/java/burp/model/LogicalSource.java +++ b/src/main/java/burp/model/LogicalSource.java @@ -1,81 +1,11 @@ package burp.model; +import org.apache.jena.rdf.model.Resource; + import java.util.HashSet; import java.util.Iterator; import java.util.Set; -public abstract class LogicalSource { - - public Set nulls = new HashSet(); - - public abstract Iterator iterator(); - -} - -//class SPARQLTSVSource extends FileBasedLogicalSource { -// -// @Override -// protected Iterator iterator() { -// try { -// if (iterations == null) { -// iterations = new ArrayList(); -// -// Dataset ds = RDFDataMgr.loadDataset(file); -// -// try (QueryExecution exec = QueryExecution.dataset(ds).query(iterator).build()) { -// org.apache.jena.query.ResultSet results = exec.execSelect(); -// ByteArrayOutputStream bout = new ByteArrayOutputStream(); -// ResultSetFormatter.outputAsTSV(bout, results); -// -// TsvParserSettings settings = new TsvParserSettings(); -// TsvParser parser = new TsvParser(settings); -// List all = parser.parseAll(new StringReader(bout.toString())); -// -// System.err.println(bout.toString()); -// -// String[] header = all.remove(0); -// for (String[] rec : all) { -// iterations.add(new SPARQLTSVIteration(header, rec)); -// } -// } -// } -// return iterations.iterator(); -// } catch (Throwable e) { -// throw new RuntimeException(e); -// } -// } -// -//} +public abstract class LogicalSource extends AbstractLogicalSource { -//class SPARQLJSONSource extends JSONSource { -// -// private static Configuration c = Configuration.builder().mappingProvider(new JacksonMappingProvider()) -// .jsonProvider(new JacksonJsonProvider()).build().addOptions(Option.ALWAYS_RETURN_LIST); -// -// @Override -// protected Iterator iterator() { -// try { -// if (iterations == null) { -// iterations = new ArrayList(); -// -// Dataset ds = RDFDataMgr.loadDataset(file); -// -// try (QueryExecution exec = QueryExecution.dataset(ds).query(iterator).build()) { -// org.apache.jena.query.ResultSet results = exec.execSelect(); -// ByteArrayOutputStream bout = new ByteArrayOutputStream(); -// ResultSetFormatter.outputAsJSON(bout, results); -// -// List> nodes = JsonPath.using(c).parse(bout.toString()).read(iterator); -// for (Map n : nodes) { -// iterations.add(new JSONIteration(JSONObject.toJSONString(n))); -// } -// } -// -// } -// return iterations.iterator(); -// } catch (Throwable e) { -// throw new RuntimeException(e); -// } -// } -// -//} \ No newline at end of file +} \ No newline at end of file diff --git a/src/main/java/burp/model/LogicalView.java b/src/main/java/burp/model/LogicalView.java new file mode 100644 index 00000000..5dec733d --- /dev/null +++ b/src/main/java/burp/model/LogicalView.java @@ -0,0 +1,214 @@ +package burp.model; + +import com.opencsv.CSVWriter; + +import java.io.StringWriter; +import java.util.*; +import java.util.stream.Collectors; + +public class LogicalView extends AbstractLogicalSource implements ContainsFields { + + private List iterations = null; + + public AbstractLogicalSource logicalSource; + + public List expressionFields = new ArrayList<>(); + public List iterableFields = new ArrayList<>(); + + public List joins = new ArrayList<>(); + + @Override + public Iterator iterator() { + try { + if (iterations == null) { + iterations = new ArrayList<>(); + + List list = new ArrayList<>(); + Iterator iterator = logicalSource.iterator(); + int index = 0; + while (iterator.hasNext()) { + Iteration i = iterator.next(); + LogicalIteration li = new LogicalIteration(logicalSource.nulls); + li.put("#", index++); + li.put("", i); + list.add(li); + } + + iterations = Field.expand(list, expressionFields, iterableFields); + + for(ViewJoin join : joins) { + iterations = join.expand(iterations); + } + } + + // Create wrapper to safely treat LogicalIterations as Iterations... + return new Iterator<>() { + private final Iterator inner = iterations.iterator(); + + @Override + public boolean hasNext() { + return inner.hasNext(); + } + + @Override + public Iteration next() { + return inner.next(); + } + }; + + } catch (Throwable e) { + throw new RuntimeException(e); + } + } + + @Override + public List getIterableFields() { + return iterableFields; + } + + @Override + public List getExpressionFields() { + return expressionFields; + } + + @Override + public void addField(Field field) { + // The parent of a logical view's fields is its logical source. + field.parent = this.logicalSource; + + if (field instanceof IterableField) { + iterableFields.add((IterableField) field); + } else if (field instanceof ExpressionField) { + expressionFields.add((ExpressionField) field); + } else + throw new RuntimeException("Unknown field type."); + } + + public void addJoin(ViewJoin join) { + joins.add(join); + } + +} + +class LogicalIteration extends Iteration { + + public Map map = new HashMap<>(); + + public LogicalIteration(Set nulls) { + super(nulls); + } + + public LogicalIteration(Map map, Set nulls) { + super(nulls); + this.map = map; + } + + @Override + public List getValuesFor(String reference) { + List l = new ArrayList<>(); + if(!map.containsKey(reference)) + throw new RuntimeException("Attribute " + reference + " does not exist."); + + Object o = map.get(reference); + + if(o instanceof Iteration) + throw new RuntimeException("Attribute " + reference + " refers to a record key."); + + if(nulls == null || !nulls.contains(o)) + l.add(o); + + return l; + } + + @Override + public List getStringsFor(String reference) { + return getValuesFor(reference) + .stream() + .filter(x -> x != null) + .map(Object::toString) + .collect(Collectors.toList()); + } + + @Override + public String asString() { + StringWriter stringWriter = new StringWriter(); + try (CSVWriter writer = new CSVWriter(stringWriter)) { + String[] header = map.keySet().toArray(new String[0]); + writer.writeNext(header); + String[] rec = map.values().toArray(new String[0]); + writer.writeNext(rec); + } catch(Exception e) { + throw new RuntimeException("Error representing logical iteration as String/CSV."); + } + return stringWriter.toString(); + } + + public String toString() { + Map widths = new LinkedHashMap<>(); + for (var e : map.entrySet()) { + int width = Math.max(e.getKey().length(), String.valueOf(e.getValue()).length()); + widths.put(e.getKey(), width); + } + + StringBuilder sb = new StringBuilder(); + + // Build horizontal line + String line = "+" + widths.values().stream() + .map(w -> "-".repeat(w + 2)) + .reduce("", (a, b) -> a + "+" + b) + .substring(1) + "+"; + + // Header row (keys) + sb.append(line).append("\n"); + sb.append("|"); + for (var e : map.entrySet()) { + sb.append(" ").append(String.format("%-" + widths.get(e.getKey()) + "s", e.getKey())).append(" |"); + } + sb.append("\n").append(line).append("\n"); + + // Value row + sb.append("|"); + for (var e : map.entrySet()) { + sb.append(" ").append(String.format("%-" + widths.get(e.getKey()) + "s", e.getValue())).append(" |"); + } + sb.append("\n").append(line); + + return sb.toString(); + } + + public LogicalIteration copy() { + return new LogicalIteration(new HashMap<>(map),null); + } + + public void put(String key, Object o) { + if (map.containsKey(key)) { + throw new RuntimeException("Attribute " + key + " already exists in logical iteration (duplicate names in fields or joins)."); + } + map.put(key, o); + } + + // Used by ExpressionField + public Iteration getIteration(String fieldName) { + return (Iteration) map.get(fieldName); + } + + // Used by IterableField + public String getIterationString(String fieldName) { + Object o = map.get(fieldName); + if(o instanceof Iteration) + return ((Iteration) o).asString(); + return o.toString(); + } + + public void retainKeys(List keys) { + // remove all the keys in the map. + map.keySet().retainAll(keys); + } + + public void add(LogicalIteration iteration) { + for(String k : iteration.map.keySet()) { + // Use the Iteration's put instead of the maps to ensure not duplicate fields. + put(k, iteration.map.get(k)); + } + } +} \ No newline at end of file diff --git a/src/main/java/burp/model/ObjectMap.java b/src/main/java/burp/model/ObjectMap.java index ae856b67..5155310b 100644 --- a/src/main/java/burp/model/ObjectMap.java +++ b/src/main/java/burp/model/ObjectMap.java @@ -1,6 +1,5 @@ package burp.model; -import java.util.ArrayList; import java.util.List; import org.apache.jena.rdf.model.RDFNode; @@ -18,10 +17,12 @@ public ObjectMap() { @Override public List generateTerms(Iteration i, String baseIRI) { - if(RML.IRI.equals(termType)) - return new ArrayList(generateIRIs(i, baseIRI)); + if(RML.IRI.equals(termType)) + return generateIRIs(i, baseIRI); + if(RML.URI.equals(termType)) + return generateURIs(i, baseIRI); if(RML.BLANKNODE.equals(termType)) - return new ArrayList(generateBlankNodes(i, baseIRI)); + return generateBlankNodes(i, baseIRI); if(RML.LITERAL.equals(termType)) return generateLiterals(i, baseIRI, datatypeMap, languageMap); diff --git a/src/main/java/burp/model/ParameterMap.java b/src/main/java/burp/model/ParameterMap.java index a5936383..65e0a1b9 100644 --- a/src/main/java/burp/model/ParameterMap.java +++ b/src/main/java/burp/model/ParameterMap.java @@ -14,10 +14,11 @@ public ParameterMap() { @Override public List generateTerms(Iteration i, String baseIRI) { - if(termType == RML.IRI) { - return generateIRIs(i, baseIRI); - } - + if(RML.IRI.equals(termType)) + return generateIRIs(i, baseIRI); + if(RML.URI.equals(termType)) + return generateURIs(i, baseIRI); + throw new RuntimeException("Incorrect term type for parameter map."); } diff --git a/src/main/java/burp/model/PredicateMap.java b/src/main/java/burp/model/PredicateMap.java index 642b9854..0a1e894b 100644 --- a/src/main/java/burp/model/PredicateMap.java +++ b/src/main/java/burp/model/PredicateMap.java @@ -14,10 +14,11 @@ public PredicateMap() { @Override public List generateTerms(Iteration i, String baseIRI) { - if(termType == RML.IRI) { - return generateIRIs(i, baseIRI); - } - + if(RML.IRI.equals(termType)) + return generateIRIs(i, baseIRI); + if(RML.URI.equals(termType)) + return generateURIs(i, baseIRI); + throw new RuntimeException("Incorrect term type for predicate map."); } diff --git a/src/main/java/burp/model/PredicateObjectMap.java b/src/main/java/burp/model/PredicateObjectMap.java index 133c7063..d053a225 100644 --- a/src/main/java/burp/model/PredicateObjectMap.java +++ b/src/main/java/burp/model/PredicateObjectMap.java @@ -5,8 +5,8 @@ public class PredicateObjectMap { - public List predicateMaps = new ArrayList(); - public List objectMaps = new ArrayList(); - public List refObjectMaps = new ArrayList(); - public List graphMaps = new ArrayList(); + public List predicateMaps = new ArrayList<>(); + public List objectMaps = new ArrayList<>(); + public List refObjectMaps = new ArrayList<>(); + public List graphMaps = new ArrayList<>(); } diff --git a/src/main/java/burp/model/ReferencingObjectMap.java b/src/main/java/burp/model/ReferencingObjectMap.java index df770dba..2ea1833c 100644 --- a/src/main/java/burp/model/ReferencingObjectMap.java +++ b/src/main/java/burp/model/ReferencingObjectMap.java @@ -14,7 +14,7 @@ public class ReferencingObjectMap implements GatherMap { public TriplesMap parent = null; - public List joinConditions = new ArrayList(); + public List joinConditions = new ArrayList<>(); public GatherMapMixin gatherMap = null; @@ -28,7 +28,7 @@ public List generateGatherMapGraphs(Iteration i, String baseIRI) { if(!isGatherMap()) throw new RuntimeException("Trying to process a non-gathermap as gathermap"); - List g = new ArrayList(); + List g = new ArrayList<>(); for(RDFNode n : generateTerms(i, baseIRI)) { SubGraph sg = new SubGraph(n, ModelFactory.createDefaultModel()); @@ -47,7 +47,7 @@ public List generateTerms(Iteration i, String baseIRI) { if(joinConditions.isEmpty()) { return parent.subjectMap.generateTerms(i, baseIRI); } else { - List list = new ArrayList(); + List list = new ArrayList<>(); Iterator iter2 = parent.logicalSource.iterator(); while (iter2.hasNext()) { Iteration i2 = iter2.next(); @@ -57,8 +57,8 @@ public List generateTerms(Iteration i, String baseIRI) { boolean ok = true; for (JoinCondition jc : joinConditions) { - List values1 = jc.childMap.generateValues(i); - List values2 = jc.parentMap.generateValues(i2); + List values1 = jc.childMap.generateValues(i); + List values2 = jc.parentMap.generateValues(i2); if (values1.stream().distinct().filter(values2::contains) .collect(Collectors.toSet()).isEmpty()) { diff --git a/src/main/java/burp/model/Return.java b/src/main/java/burp/model/Return.java index a0b5bb3a..8b73c48d 100644 --- a/src/main/java/burp/model/Return.java +++ b/src/main/java/burp/model/Return.java @@ -5,7 +5,7 @@ public class Return { - private Map returns = new HashMap(); + private final Map returns = new HashMap<>(); public Object defaultValue = null; diff --git a/src/main/java/burp/model/ReturnMap.java b/src/main/java/burp/model/ReturnMap.java index 9fa79e33..a660ea52 100644 --- a/src/main/java/burp/model/ReturnMap.java +++ b/src/main/java/burp/model/ReturnMap.java @@ -14,10 +14,11 @@ public ReturnMap() { @Override public List generateTerms(Iteration i, String baseIRI) { - if(termType == RML.IRI) { - return generateIRIs(i, baseIRI); - } - + if(RML.IRI.equals(termType)) + return generateIRIs(i, baseIRI); + if(RML.URI.equals(termType)) + return generateURIs(i, baseIRI); + throw new RuntimeException("Incorrect term type for function map."); } diff --git a/src/main/java/burp/model/SubjectMap.java b/src/main/java/burp/model/SubjectMap.java index c112ff3f..51d20f02 100644 --- a/src/main/java/burp/model/SubjectMap.java +++ b/src/main/java/burp/model/SubjectMap.java @@ -10,8 +10,8 @@ public class SubjectMap extends TermMap { - public List classes = new ArrayList(); - public List graphMaps = new ArrayList(); + public List classes = new ArrayList<>(); + public List graphMaps = new ArrayList<>(); public SubjectMap() { termType = RML.IRI; @@ -19,9 +19,11 @@ public SubjectMap() { @Override public List generateTerms(Iteration i, String baseIRI) { - if(RML.IRI.equals(termType)) - return generateIRIs(i, baseIRI); - if(RML.BLANKNODE.equals(termType)) + if(RML.IRI.equals(termType)) + return generateIRIs(i, baseIRI); + if(RML.URI.equals(termType)) + return generateURIs(i, baseIRI); + if(RML.BLANKNODE.equals(termType)) return generateBlankNodes(i, baseIRI); throw new RuntimeException("Incorrect term type for subject map."); diff --git a/src/main/java/burp/model/Template.java b/src/main/java/burp/model/Template.java index 13b43395..f0deae5d 100644 --- a/src/main/java/burp/model/Template.java +++ b/src/main/java/burp/model/Template.java @@ -26,15 +26,15 @@ public List values(Iteration i) { } public List values(Iteration i, boolean safe) { - List list = new ArrayList(); + List list = new ArrayList<>(); list.add(template); for(String reference : references()) { List valuesForReference = i.getStringsFor(reference); - List newset = new ArrayList(); - - String search = "{" + StringEscapeUtils.escapeJava(reference) + "}"; + List newset = new ArrayList<>(); + String search = "{" + StringEscapeUtils.escapeJava(reference).replaceAll("([{}])", "\\\\$1") + "}"; + for(String s : list) for(String v : valuesForReference) if(v != null) { @@ -52,9 +52,9 @@ public List values(Iteration i, boolean safe) { } - private static Pattern p = Pattern.compile("(? references() { - List list = new ArrayList(); + private static final Pattern p = Pattern.compile("(? references() { + List list = new ArrayList<>(); Matcher m = p.matcher(template); while(m.find()) { String temp = template.substring(m.start(1), m.end(1)); diff --git a/src/main/java/burp/model/TermMap.java b/src/main/java/burp/model/TermMap.java index f9881daf..5b009128 100644 --- a/src/main/java/burp/model/TermMap.java +++ b/src/main/java/burp/model/TermMap.java @@ -20,12 +20,10 @@ public List generateGatherMapGraphs(Iteration i, String baseIRI) { if(!isGatherMap()) throw new RuntimeException("Trying to process a non-gathermap as gathermap"); - List g = new ArrayList(); + List g = new ArrayList<>(); if(expression == null) { - for(SubGraph sg : gatherMap.generateGraphs(i, baseIRI)) { - g.add(sg); - } + g.addAll(gatherMap.generateGraphs(i, baseIRI)); } else { for(RDFNode n : generateTerms(i, baseIRI)) { for(SubGraph sg : gatherMap.generateGraphs(i, baseIRI)) { diff --git a/src/main/java/burp/model/TriplesMap.java b/src/main/java/burp/model/TriplesMap.java index 8c3c9f37..1ffec0b4 100644 --- a/src/main/java/burp/model/TriplesMap.java +++ b/src/main/java/burp/model/TriplesMap.java @@ -3,17 +3,11 @@ import java.util.ArrayList; import java.util.List; -import org.apache.jena.query.Dataset; - public class TriplesMap { - public LogicalSource logicalSource = null; + public AbstractLogicalSource logicalSource = null; public SubjectMap subjectMap = null; - public List predicateObjectMaps = new ArrayList(); - - public void generateInto(Dataset ds) { - // TODO Auto-generated method stub - - } + public List predicateObjectMaps = new ArrayList<>(); + public String baseIRI = null; } \ No newline at end of file diff --git a/src/main/java/burp/model/ViewJoin.java b/src/main/java/burp/model/ViewJoin.java new file mode 100644 index 00000000..2000b4af --- /dev/null +++ b/src/main/java/burp/model/ViewJoin.java @@ -0,0 +1,120 @@ +package burp.model; + +import java.util.ArrayList; +import java.util.List; +import java.util.Spliterators; +import java.util.stream.Collectors; +import java.util.stream.StreamSupport; + +public class ViewJoin { + + public LogicalView parentLogicalView; + public List joinConditions = new ArrayList<>(); + public List expressionFields = new ArrayList<>(); + public boolean isInnerJoin = false; + + private List iterations = null; + + public List expand(List childIterations) { + try { + if (iterations == null) { + // Get logical iterations of parent logical view + iterations = StreamSupport + .stream(Spliterators.spliteratorUnknownSize(parentLogicalView.iterator(), 0), false) + .map(a -> (LogicalIteration) a) + .collect(Collectors.toList()); + } + + List newList = new ArrayList<>(); + + for (LogicalIteration childIteration : childIterations) { + boolean hasACorrespondence = false; + + // Discussion with Els. For each child, the counter for the parents are "reset" to 0 + // So we assign 0, 1, ..., n from the child's perspective. + int count = -1; // start at -1 as no match found yet + + for(LogicalIteration parentIteration : iterations) { + if(matches(childIteration, parentIteration)) { + hasACorrespondence = true; + + // Increment the index + count++; + + // Create new logical iterations for each value of each expression map + List result = new ArrayList<>(); + result.add(childIteration); + for (ExpressionField e : expressionFields) { + result = enrichForJoin(e, count, result, parentIteration); + } + + // add all new iterations to the list + newList.addAll(result); + } + } + + // Make the outer join if there is no match + if(!hasACorrespondence && !isInnerJoin) { + LogicalIteration newIteration = childIteration.copy(); + for (ExpressionField e : expressionFields) { + newIteration.put(e.fieldName, null); + newIteration.put(e.fieldName + ".#", null); + } + newList.add(newIteration); + } + } + + return newList; + } catch (Throwable e) { + throw new RuntimeException(e); + } + } + + private List enrichForJoin(ExpressionField e, int index, List result, LogicalIteration parentIteration) { + List nlist = new ArrayList<>(); + + for(LogicalIteration li : result) { + for (Object o : e.fieldExpressionMap.generateValues(parentIteration)) { + LogicalIteration newLogicalIteration = li.copy(); + newLogicalIteration.put(e.fieldName, o); + newLogicalIteration.put(e.fieldName + ".#", index); + nlist.add(newLogicalIteration); + } + } + + return nlist; + } + + private boolean matches(LogicalIteration childIteration, LogicalIteration parentIteration) { + // Expression Maps are multi-valued. We thus need + // For each join condition at least one match. + boolean ok = true; + for (JoinCondition jc : joinConditions) { + + List values1 = jc.childMap.generateValues(childIteration); + List values2 = jc.parentMap.generateValues(parentIteration); + + if (values1.stream().distinct().filter(values2::contains) + .collect(Collectors.toSet()).isEmpty()) { + // No match, break. + ok = false; + break; + } + } + return ok; + } + + public List getExpressionFields() { + return expressionFields; + } + + public void addField(Field field) { + field.parent = parentLogicalView; + if (field instanceof ExpressionField) { + getExpressionFields().add((ExpressionField) field); + } + else + throw new RuntimeException("Unknown field type for ViewJoin."); + } + +} diff --git a/src/main/java/burp/parse/Parse.java b/src/main/java/burp/parse/Parse.java index 871e901e..31ea5cd3 100644 --- a/src/main/java/burp/parse/Parse.java +++ b/src/main/java/burp/parse/Parse.java @@ -6,14 +6,9 @@ import java.util.List; import java.util.Map; +import burp.model.*; import org.apache.jena.query.QueryExecutionFactory; -import org.apache.jena.rdf.model.Model; -import org.apache.jena.rdf.model.ModelFactory; -import org.apache.jena.rdf.model.RDFList; -import org.apache.jena.rdf.model.RDFNode; -import org.apache.jena.rdf.model.Resource; -import org.apache.jena.rdf.model.Statement; -import org.apache.jena.rdf.model.StmtIterator; +import org.apache.jena.rdf.model.*; import org.apache.jena.riot.RDFDataMgr; import org.apache.jena.shacl.ShaclValidator; import org.apache.jena.shacl.ValidationReport; @@ -23,40 +18,25 @@ import org.apache.jena.vocabulary.RDF; import burp.ls.LogicalSourceFactory; -import burp.model.ConcreteExpressionMap; -import burp.model.DatatypeMap; -import burp.model.Expression; -import burp.model.FunctionExecution; -import burp.model.FunctionMap; -import burp.model.GraphMap; -import burp.model.Input; -import burp.model.InputValueMap; -import burp.model.JoinCondition; -import burp.model.LanguageMap; -import burp.model.LogicalSource; -import burp.model.ObjectMap; -import burp.model.ParameterMap; -import burp.model.PredicateMap; -import burp.model.PredicateObjectMap; -import burp.model.RDFNodeConstant; -import burp.model.Reference; -import burp.model.ReferencingObjectMap; -import burp.model.ReturnMap; -import burp.model.SubjectMap; -import burp.model.Template; -import burp.model.TriplesMap; import burp.model.gathermaputil.GatherMapMixin; import burp.vocabularies.RML; import burp.vocabularies.YS; +import org.apache.jena.vocabulary.XSD; public class Parse { - static Map triplesmaps = null; + static Map triplesmaps = null; + static Map logicalviews = null; + + private static String mappingPath = null; + private static String currentDirectory = null; public static List parseMappingFile(String mappingFile) throws Exception { - String mpath = Paths.get(mappingFile).toAbsolutePath().getParent().toString(); + mappingPath = Paths.get(mappingFile).toAbsolutePath().getParent().toString(); + currentDirectory = Paths.get("").toAbsolutePath().toString(); - triplesmaps = new HashMap(); + triplesmaps = new HashMap<>(); + logicalviews = new HashMap<>(); Model mapping = RDFDataMgr.loadModel(mappingFile); @@ -74,30 +54,36 @@ public static List parseMappingFile(String mappingFile) throws Excep TriplesMap tm = triplesmaps.computeIfAbsent(r, (x) -> new TriplesMap()); Resource ls = r.getPropertyResourceValue(RML.logicalSource); - tm.logicalSource = prepareLogicalSource(ls, mpath); + tm.logicalSource = prepareLogicalSource(ls); Resource sm = r.getPropertyResourceValue(RML.subjectMap); tm.subjectMap = prepareSubjectMap(sm); + if(r.hasProperty(RML.baseIRI)) + tm.baseIRI = r.getPropertyResourceValue(RML.baseIRI).getURI(); + r.listProperties(RML.predicateObjectMap).forEach((s) -> { PredicateObjectMap pom = preparePredicateObjectMap(s.getObject().asResource()); tm.predicateObjectMaps.add(pom); }); } - return new ArrayList(triplesmaps.values()); + return new ArrayList<>(triplesmaps.values()); } private static boolean isValid(Model mapping) { Model core = ModelFactory.createDefaultModel(); - core.read(Parse.class.getResourceAsStream("/shapes/core.ttl"), "urn:dummy", FileUtils.langTurtle); - core.read(Parse.class.getResourceAsStream("/shapes/cc.ttl"), "urn:dummy", FileUtils.langTurtle); - core.read(Parse.class.getResourceAsStream("/shapes/io.ttl"), "urn:dummy", FileUtils.langTurtle); - core.read(Parse.class.getResourceAsStream("/shapes/fnml.ttl"), "urn:dummy", FileUtils.langTurtle); + core.read(Parse.class.getResourceAsStream("/shapes/rml-core/core.ttl"), "urn:dummy", FileUtils.langTurtle); + core.read(Parse.class.getResourceAsStream("/shapes/rml-cc/cc.ttl"), "urn:dummy", FileUtils.langTurtle); + //core.read(Parse.class.getResourceAsStream("/shapes/rml-io/io.ttl"), "urn:dummy", FileUtils.langTurtle); + //core.read(Parse.class.getResourceAsStream("/shapes/rml-fnml/fnml.ttl"), "urn:dummy", FileUtils.langTurtle); + core.read(Parse.class.getResourceAsStream("/shapes/rml-lv/lv.ttl"), "urn:dummy", FileUtils.langTurtle); + //core.read(Parse.class.getResourceAsStream("/shapes/rml-star/star.ttl"), "urn:dummy", FileUtils.langTurtle); ValidationReport report = ShaclValidator.get().validate(core.getGraph(), mapping.getGraph()); if(!report.conforms()) { ShLib.printReport(report); + System.err.println(report); return false; } @@ -150,46 +136,145 @@ private static void normalizeConstants(Model mapping) { mapping.add(QueryExecutionFactory.create(IMPLICITTERMTYPE, mapping).execConstruct()); } - private static LogicalSource prepareLogicalSource(Resource ls, String mpath) throws Exception { - Resource referenceFormulation = ls.getPropertyResourceValue(RML.referenceFormulation); - - if (RML.CSV.equals(referenceFormulation)) - return LogicalSourceFactory.createCSVSource(ls, mpath); - - if (RML.JSONPath.equals(referenceFormulation)) - return LogicalSourceFactory.createJSONSource(ls, mpath); - - if (RML.XPath.equals(referenceFormulation)) - return LogicalSourceFactory.createXMLSource(ls, mpath); - - if (referenceFormulation.hasProperty(RDF.type, RML.XPathReferenceFormulation)) - return LogicalSourceFactory.createXMLSource(ls, mpath); - - if (RML.SQL2008Table.equals(referenceFormulation)) - return LogicalSourceFactory.createSQL2008TableSource(ls, mpath); - - if (RML.SQL2008Query.equals(referenceFormulation)) - return LogicalSourceFactory.createSQL2008QuerySource(ls, mpath); - - if(RML.SPARQL_Results_CSV.equals(referenceFormulation)) - return LogicalSourceFactory.createSPARQLSource(ls, mpath, false); - - if(RML.SPARQL_Results_TSV.equals(referenceFormulation)) - return LogicalSourceFactory.createSPARQLSource(ls, mpath, true); - - if(RML.SPARQL_Results_XML.equals(referenceFormulation)) - return LogicalSourceFactory.createSPARQLSource(ls, mpath, false); - - if(RML.SPARQL_Results_JSON.equals(referenceFormulation)) - return LogicalSourceFactory.createSPARQLSource(ls, mpath, false); - + private static AbstractLogicalSource prepareLogicalSource(Resource ls) throws Exception { + // This is RML-LV + if(ls.hasProperty(RML.viewOn)) { + return prepareLogicalView(ls); + } + + // This is RML-CORE + Resource referenceFormulation = ls.getPropertyResourceValue(RML.referenceFormulation); + + // The path is by default the current working directory + String sourcePath = getSourcePath(ls); + + LogicalSource s = null; + if (RML.JSONPath.equals(referenceFormulation)) + s = LogicalSourceFactory.createJSONSource(ls, sourcePath); + // This is RML-IO + else if (RML.CSV.equals(referenceFormulation)) + s = LogicalSourceFactory.createCSVSource(ls, sourcePath); + else if (RML.XPath.equals(referenceFormulation)) + s = LogicalSourceFactory.createXMLSource(ls, sourcePath); + else if (referenceFormulation.hasProperty(RDF.type, RML.XPathReferenceFormulation)) + s = LogicalSourceFactory.createXMLSource(ls, sourcePath); + else if (RML.SQL2008Table.equals(referenceFormulation)) + s = LogicalSourceFactory.createSQL2008TableSource(ls, sourcePath); + else if (RML.SQL2008Query.equals(referenceFormulation)) + s = LogicalSourceFactory.createSQL2008QuerySource(ls, sourcePath); + else if (RML.SPARQL_Results_CSV.equals(referenceFormulation)) + s = LogicalSourceFactory.createSPARQLSource(ls, sourcePath, false); + else if (RML.SPARQL_Results_TSV.equals(referenceFormulation)) + s = LogicalSourceFactory.createSPARQLSource(ls, sourcePath, true); + else if (RML.SPARQL_Results_XML.equals(referenceFormulation)) + s = LogicalSourceFactory.createSPARQLSource(ls, sourcePath, false); + else if (RML.SPARQL_Results_JSON.equals(referenceFormulation)) + s = LogicalSourceFactory.createSPARQLSource(ls, sourcePath, false); if (referenceFormulation.hasProperty(RDF.type, YS.NetconfQuerySource)) - return LogicalSourceFactory.createNetconfQuerySource(ls); + s = LogicalSourceFactory.createNetconfQuerySource(ls); + + if(s != null) { + s.referenceFormulation = referenceFormulation; + return s; + } throw new Exception("Reference formulation not (yet) supported."); } - private static SubjectMap prepareSubjectMap(Resource sm) { + private static String getSourcePath(Resource ls) { + String sourcePath = currentDirectory; + Statement statement = ls.getPropertyResourceValue(RML.source).getProperty(RML.root); + if(statement != null) { + if(statement.getObject().isResource()) { + if(RML.MappingDirectory.equals(statement.getObject())) { + sourcePath = mappingPath; + } else if(RML.CurrentWorkingDirectory.equals(statement.getObject())) { + // ignore, by default sourcePath + } else + throw new RuntimeException("Invalid resource for rml:root " + statement.getObject()); + } else { + Literal l = statement.getLiteral(); + if(l.getLanguage() != null) + throw new RuntimeException("rml:root must be a plain literal or string " + l); + + if(l.getDatatype() != null && XSD.xstring.equals(l.getDatatype())) + throw new RuntimeException("rml:root must be a plain literal or string " + l); + + String path = l.getString(); + if (Paths.get(path).isAbsolute()) + sourcePath = path; + else + throw new RuntimeException("Unsupported path: " + path + ". Is it absolute?"); + } + } + return sourcePath; + } + + private static LogicalView prepareLogicalView(Resource ls) { + try { + Resource view = ls.getPropertyResourceValue(RML.viewOn); + LogicalView lv = logicalviews.computeIfAbsent(ls, (x) -> new LogicalView()); + + lv.logicalSource = prepareLogicalSource(view); + + ls.listProperties(RML.field).forEach(s -> { + lv.addField(prepareField(s.getObject().asResource())); + }); + + ls.listProperties(RML.leftJoin).forEach(s -> { + lv.addJoin(prepareLeftJoin(s.getObject().asResource())); + }); + + ls.listProperties(RML.innerJoin).forEach(s -> { + lv.addJoin(prepareInnerJoin(s.getObject().asResource())); + }); + + return lv; + } catch (Exception e) { + throw new RuntimeException(e); + } + } + + private static ViewJoin prepareLeftJoin(Resource resource) { + return prepareViewJoin(false, resource); + } + + private static ViewJoin prepareInnerJoin(Resource resource) { + return prepareViewJoin(true, resource); + } + + private static ViewJoin prepareViewJoin(boolean isInnerJoin, Resource resource) { + ViewJoin viewJoin = new ViewJoin(); + viewJoin.isInnerJoin = isInnerJoin; + + Resource plv = resource.getRequiredProperty(RML.parentLogicalView).getObject().asResource(); + viewJoin.parentLogicalView = prepareLogicalView(plv); + + resource.listProperties(RML.joinCondition).forEach((s) -> { + JoinCondition jc = new JoinCondition(); + + Resource jcr = s.getObject().asResource(); + + Resource r = jcr.getPropertyResourceValue(RML.parentMap); + if(r != null) + jc.parentMap = prepareExpressionMap(r); + + r = jcr.getPropertyResourceValue(RML.childMap); + if(r != null) + jc.childMap = prepareExpressionMap(r); + + viewJoin.joinConditions.add(jc); + }); + + // We need the fields on the Logical View Join + resource.listProperties(RML.field).forEach(s -> { + viewJoin.addField(prepareField(s.getObject().asResource())); + }); + + return viewJoin; + } + + private static SubjectMap prepareSubjectMap(Resource sm) { SubjectMap subjectMap = new SubjectMap(); subjectMap.expression = prepareExpression(sm); @@ -309,18 +394,15 @@ private static GatherMapMixin prepareGatherMap(Resource gm) { GatherMapMixin gatherMap = new GatherMapMixin(); if(gm.hasProperty(RML.allowEmptyListAndContainer)) { - boolean empty = gm.getProperty(RML.allowEmptyListAndContainer).getObject().asLiteral().getBoolean(); - gatherMap.allowEmptyListAndContainer = empty; + gatherMap.allowEmptyListAndContainer = gm.getProperty(RML.allowEmptyListAndContainer).getObject().asLiteral().getBoolean(); } if(gm.hasProperty(RML.gatherAs)) { - Resource r = gm.getPropertyResourceValue(RML.gatherAs); - gatherMap.gatherAs = r; + gatherMap.gatherAs = gm.getPropertyResourceValue(RML.gatherAs); } if(gm.hasProperty(RML.strategy)) { - Resource r = gm.getPropertyResourceValue(RML.strategy); - gatherMap.strategy = r; + gatherMap.strategy = gm.getPropertyResourceValue(RML.strategy); } RDFList list = gm.getPropertyResourceValue(RML.gather).as(RDFList.class); @@ -352,6 +434,39 @@ private static LanguageMap prepareLanguageMap(Resource lam) { return x; } + private static Field prepareField(Resource p) { + Expression e = prepareExpression(p); + Field field = null; + if(e == null) { + // Create IterableField + IterableField f = new IterableField(); + + if(p.hasProperty(RML.iterator)) + f.iterator = p.getProperty(RML.iterator).getObject().asLiteral().getString(); + + if(p.hasProperty(RML.referenceFormulation)) + f.referenceFormulation = p.getProperty(RML.referenceFormulation).getObject().asResource(); + + field = f; + } else { + ExpressionField f = new ExpressionField(); + ConcreteExpressionMap fem = new ConcreteExpressionMap(); + fem.expression = prepareExpression(p); + f.fieldExpressionMap = fem; + field = f; + } + + field.fieldName = p.getRequiredProperty(RML.fieldName).getObject().asLiteral().getString(); + + // Add the subfields + Field finalField = field; + p.listProperties(RML.field).forEach(s -> { + finalField.addField(prepareField(s.getObject().asResource())); + }); + + return finalField; + } + private static ReferencingObjectMap prepareReferencingObjectMap(Resource rom) { ReferencingObjectMap referencingObjectMap = new ReferencingObjectMap(); @@ -429,7 +544,6 @@ private static Input prepareInput(Resource r) { pm.expression = prepareExpression(r.getPropertyResourceValue(RML.parameterMap)); input.parameterMap = pm; - input.inputValueMap = prepareInputValueMap(r.getPropertyResourceValue(RML.inputValueMap)); return input; @@ -473,8 +587,7 @@ private static boolean hasNoTemplateReferenceConstantOrFunction(Resource r) { if (r.hasProperty(RML.constant)) return false; if (r.hasProperty(RML.reference)) return false; if (r.hasProperty(RML.template)) return false; - if (r.hasProperty(RML.functionExecution)) return false; - return true; - } + return !r.hasProperty(RML.functionExecution); + } } diff --git a/src/main/java/burp/util/SimpleNamespaceContext.java b/src/main/java/burp/util/SimpleNamespaceContext.java index 197edd3f..efd5419f 100644 --- a/src/main/java/burp/util/SimpleNamespaceContext.java +++ b/src/main/java/burp/util/SimpleNamespaceContext.java @@ -9,7 +9,7 @@ // Kudos to https://stackoverflow.com/a/6392700 public class SimpleNamespaceContext implements NamespaceContext { - private final Map PREF_MAP = new HashMap(); + private final Map PREF_MAP = new HashMap<>(); public SimpleNamespaceContext(final Map prefMap) { PREF_MAP.putAll(prefMap); diff --git a/src/main/java/burp/util/Util.java b/src/main/java/burp/util/Util.java index dc1873ef..4dae6583 100644 --- a/src/main/java/burp/util/Util.java +++ b/src/main/java/burp/util/Util.java @@ -83,22 +83,45 @@ public static String bytesToHexString(byte[] o) { } return new String(hexChars); } - - public static boolean isAbsoluteAndValidIRI(String string) { - //return isAbsolute(string) && !IRIFactory.iriImplementation().create(string).hasViolation(false); - if(isAbsolute(string)) { - Iterator iter = IRIFactory.iriImplementation().create(string).violations(false); - while(iter.hasNext()) { - Violation v = iter.next(); - // TODO: We ignore CAPS in HOST for test cases, but we shouldn't - if(v.getViolationCode() == 11); - else - return false; - } - return true; - } - return false; - } + + public static boolean isAbsoluteAndValidIRI(String string) { + //return isAbsolute(string) && !IRIFactory.iriImplementation().create(string).hasViolation(false); + if(isAbsolute(string)) { + Iterator iter = IRIFactory.iriImplementation().create(string).violations(false); + while(iter.hasNext()) { + Violation v = iter.next(); + // TODO: We ignore CAPS in HOST for test cases, but we shouldn't + if(v.getViolationCode() == 11); + else + return false; + } + return true; + } + return false; + } + + public static boolean isAbsoluteAndValidURI(String string) { + //return isAbsolute(string) && !IRIFactory.iriImplementation().create(string).hasViolation(false); + if(isAbsolute(string)) { + Iterator iter = IRIFactory.iriImplementation().create(string).violations(false); + while(iter.hasNext()) { + Violation v = iter.next(); + // TODO: We ignore CAPS in HOST for test cases, but we shouldn't + if(v.getViolationCode() == 11); + else + return false; + } + + try { + URI uri = new URI(string); + } catch (Exception e) { + return false; + } + + return true; + } + return false; + } public static boolean isAbsolute(String string) { return URI.create(string.toLowerCase()).isAbsolute(); diff --git a/src/main/java/burp/vocabularies/RML.java b/src/main/java/burp/vocabularies/RML.java index 706a492d..c4d77e6b 100644 --- a/src/main/java/burp/vocabularies/RML.java +++ b/src/main/java/burp/vocabularies/RML.java @@ -10,7 +10,8 @@ public final class RML { public static final String NS = "http://w3id.org/rml/"; public static final Resource BLANKNODE = ResourceFactory.createResource(NS + "BlankNode"); - public static final Resource IRI = ResourceFactory.createResource(NS + "IRI"); + public static final Resource IRI = ResourceFactory.createResource(NS + "IRI"); + public static final Resource URI = ResourceFactory.createResource(NS + "URI"); public static final Resource LITERAL = ResourceFactory.createResource(NS + "Literal"); // RML Constants @@ -18,12 +19,12 @@ public final class RML { public static final Resource CSV = ResourceFactory.createResource(NS + "CSV"); public static final Resource JSONPath = ResourceFactory.createResource(NS + "JSONPath"); public static final Resource MappingDirectory = ResourceFactory.createResource(NS + "MappingDirectory"); - public static final Resource CurrentWorkingDirectory = ResourceFactory.createResource(NS + "CurrentWorkingDirectory"); + public static final Resource CurrentWorkingDirectory = ResourceFactory.createResource(NS + "CurrentWorkingDirectory"); public static final Resource Namespace = ResourceFactory.createResource(NS + "Namespace"); public static final Resource RelativePathSource = ResourceFactory.createResource(NS + "RelativePathSource"); public static final Resource SQL2008Table = ResourceFactory.createResource(NS + "SQL2008Table"); public static final Resource SQL2008Query = ResourceFactory.createResource(NS + "SQL2008Query"); - public static final Resource XPath = ResourceFactory.createResource(NS + "XPath"); + public static final Resource XPath = ResourceFactory.createResource(NS + "XPath"); public static final Resource XPathReferenceFormulation = ResourceFactory.createResource(NS + "XPathReferenceFormulation"); public static final Resource append = ResourceFactory.createResource(NS + "append"); @@ -44,9 +45,11 @@ public final class RML { public static final Resource SPARQL_Results_XML = ResourceFactory.createResource(FORMATSNS + "SPARQL_Results_XML"); // Classes + // We currently have no need for classes and that limits the memory footprint - // Properties + // Properties public static final Property allowEmptyListAndContainer = ResourceFactory.createProperty(NS + "allowEmptyListAndContainer"); + public static final Property baseIRI = ResourceFactory.createProperty(NS + "baseIRI"); public static final Property clazz = ResourceFactory.createProperty(NS + "class"); public static final Property childMap = ResourceFactory.createProperty(NS + "childMap"); public static final Property compression = ResourceFactory.createProperty(NS + "compression"); @@ -55,22 +58,27 @@ public final class RML { public static final Property encoding = ResourceFactory.createProperty(NS + "encoding"); public static final Property functionExecution = ResourceFactory.createProperty(NS + "functionExecution"); public static final Property functionMap = ResourceFactory.createProperty(NS + "functionMap"); - public static final Property gather = ResourceFactory.createProperty(NS + "gather"); - public static final Property gatherAs = ResourceFactory.createProperty(NS + "gatherAs"); + public static final Property field = ResourceFactory.createProperty(NS + "field"); + public static final Property fieldName = ResourceFactory.createProperty(NS + "fieldName"); + public static final Property gather = ResourceFactory.createProperty(NS + "gather"); + public static final Property gatherAs = ResourceFactory.createProperty(NS + "gatherAs"); public static final Property graphMap = ResourceFactory.createProperty(NS + "graphMap"); - public static final Property input = ResourceFactory.createProperty(NS + "input"); - public static final Property inputValueMap = ResourceFactory.createProperty(NS + "inputValueMap"); + public static final Property innerJoin = ResourceFactory.createProperty(NS + "innerJoin"); + public static final Property input = ResourceFactory.createProperty(NS + "input"); + public static final Property inputValueMap = ResourceFactory.createProperty(NS + "inputValueMap"); public static final Property iterator = ResourceFactory.createProperty(NS + "iterator"); public static final Property joinCondition = ResourceFactory.createProperty(NS + "joinCondition"); - public static final Property languageMap = ResourceFactory.createProperty(NS + "languageMap"); + public static final Property leftJoin = ResourceFactory.createProperty(NS + "leftJoin"); + public static final Property languageMap = ResourceFactory.createProperty(NS + "languageMap"); public static final Property logicalSource = ResourceFactory.createProperty(NS + "logicalSource"); public static final Property namespace = ResourceFactory.createProperty(NS + "namespace"); public static final Property namespacePrefix = ResourceFactory.createProperty(NS + "namespacePrefix"); public static final Property namespaceURL = ResourceFactory.createProperty(NS + "namespaceURL"); public static final Property NULL = ResourceFactory.createProperty(NS + "null"); public static final Property objectMap = ResourceFactory.createProperty(NS + "objectMap"); - public static final Property parameterMap = ResourceFactory.createProperty(NS + "parameterMap"); - public static final Property path = ResourceFactory.createProperty(NS + "path"); + public static final Property parameterMap = ResourceFactory.createProperty(NS + "parameterMap"); + public static final Property parentLogicalView = ResourceFactory.createProperty(NS + "parentLogicalView"); + public static final Property path = ResourceFactory.createProperty(NS + "path"); public static final Property parentMap = ResourceFactory.createProperty(NS + "parentMap"); public static final Property parentTriplesMap = ResourceFactory.createProperty(NS + "parentTriplesMap"); public static final Property predicateMap = ResourceFactory.createProperty(NS + "predicateMap"); @@ -83,7 +91,8 @@ public final class RML { public static final Property strategy = ResourceFactory.createProperty(NS + "strategy"); public static final Property subjectMap = ResourceFactory.createProperty(NS + "subjectMap"); public static final Property template = ResourceFactory.createProperty(NS + "template"); - public static final Property termType = ResourceFactory.createProperty(NS + "termType"); + public static final Property termType = ResourceFactory.createProperty(NS + "termType"); + public static final Property viewOn = ResourceFactory.createProperty(NS + "viewOn"); // Utility constants public static final Resource list = ResourceFactory.createResource(NS + "list"); diff --git a/src/main/resources/shapes/core.ttl b/src/main/resources/shapes/core.ttl deleted file mode 100644 index bcbfae3e..00000000 --- a/src/main/resources/shapes/core.ttl +++ /dev/null @@ -1,740 +0,0 @@ -@prefix brick: . -@prefix csvw: . -@prefix dc: . -@prefix dcam: . -@prefix dcat: . -@prefix dcmitype: . -@prefix dcterms: . -@prefix doap: . -@prefix foaf: . -@prefix geo: . -@prefix odrl: . -@prefix org: . -@prefix owl: . -@prefix prof: . -@prefix prov: . -@prefix qb: . -@prefix rdf: . -@prefix rdfs: . -@prefix rml: . -@prefix schema: . -@prefix sh: . -@prefix skos: . -@prefix sosa: . -@prefix ssn: . -@prefix time: . -@prefix vann: . -@prefix void: . -@prefix wgs: . -@prefix xml: . -@prefix xsd: . - - a sh:NodeShape ; - sh:description """ - Strategy to follow when generating RDF triples. - """ ; - sh:in ( rml:append rml:cartesianProduct ) ; - sh:message """ - Strategy must be either rml:append or rml:cartesianProduct. - """ ; - sh:name "Strategy" ; - sh:targetObjectsOf rml:strategy . - - a sh:NodeShape ; - sh:and ( [ ] ) ; - sh:description """ - Represents a Child Map. - """ ; - sh:message """ - rml:ChildMap must specify a literal referencing data in the child data - source. - """ ; - sh:name "ChildMap" ; - sh:targetClass ; - sh:targetObjectsOf . - - a sh:NodeShape ; - sh:and ( [ ] ) ; - sh:description """ - Represents a Datatype Map. - """ ; - sh:message """ - rml:DatatypeMap must specify an rml:template, rml:reference, or rml:constant - with the IRI of the datatype. - """ ; - sh:name "DatatypeMap" ; - sh:targetClass rml:DatatypeMap ; - sh:targetObjectsOf rml:datatypeMap . - - a sh:NodeShape ; - sh:and ( [ sh:in ( rml:IRI rml:BlankNode ) ; - sh:message """ - rml:termType must be an IRI or blank node for a Graph Map. - """ ; - sh:path rml:termType ] ) ; - sh:description """ - Represents a Graph Map. - """ ; - sh:message """ - rml:GraphMap must specify an rml:template, rml:reference or rml:constant - with the IRI of the Named Graph. - """ ; - sh:name "GraphMap" ; - sh:targetClass rml:GraphMap ; - sh:targetObjectsOf rml:graphMap . - - a sh:PropertyShape ; - sh:description """ - Specifies the join condition for joining a child data source with - a parent data source of the foreign key constraint. - """ ; - sh:message """ - rml:joinCondition must specify an rml:parent and rml:child. - """ ; - sh:name "joinCondition" ; - sh:node ; - sh:nodeKind sh:BlankNodeOrIRI ; - sh:path rml:joinCondition ; - sh:targetSubjectsOf rml:joinCondition . - - a sh:NodeShape ; - sh:description """ - Represents a Join. - """ ; - sh:message """ - rml:Join must specify exactly one rml:parent/rml:parentMap - and rml:child/rml:childMap. - """ ; - sh:name "Join" ; - sh:property [ sh:description """ - rml:parent/rml:parentMap may only be provided once and - not at the same time. - """ ; - sh:maxCount 1 ; - sh:minCount 1 ; - sh:name "parentMap/parent" ; - sh:path [ sh:alternativePath ( rml:parentMap rml:parent ) ] ], - [ sh:description """ - Specifies the child of the object component for joining. - """ ; - sh:message """ - rml:childMap must point to a rml:ChildMap specifying the - child of the Literal. - """ ; - sh:name "childMap" ; - sh:node ; - sh:nodeKind sh:BlankNodeOrIRI ; - sh:path rml:childMap ; - sh:targetSubjectsOf rml:childMap ], - [ sh:description """ - Specifies the child of the object component for joining. - """ ; - sh:name "child" ; - sh:node ; - sh:nodeKind sh:Literal ; - sh:path rml:child ; - sh:targetSubjectsOf rml:child ], - [ sh:description """ - Specifies the parent of the object component for joining. - """ ; - sh:message """ - rml:parentMap must point to a rml:ParentMap specifying the - parent tag of the string Literal. - """ ; - sh:name "parentMap" ; - sh:node ; - sh:nodeKind sh:BlankNodeOrIRI ; - sh:path rml:parentMap ; - sh:targetSubjectsOf rml:parentMap ], - [ sh:description """ - Specifies the parent of the object component for joining. - """ ; - sh:name "parent" ; - sh:node ; - sh:nodeKind sh:Literal ; - sh:path rml:parent ; - sh:targetSubjectsOf rml:parent ], - [ sh:description """ - rml:child/rml:childMap may only be provided once and - not at the same time. - """ ; - sh:maxCount 1 ; - sh:minCount 1 ; - sh:name "childMap/child" ; - sh:path [ sh:alternativePath ( rml:childMap rml:child ) ] ] ; - sh:targetClass rml:Join ; - sh:targetObjectsOf rml:joinCondition . - - a sh:NodeShape ; - sh:and ( [ sh:path rml:constant ; - sh:pattern "^((?:(en-GB-oed|i-ami|i-bnn|i-default|i-enochian|i-hak|i-klingon|i-lux|i-mingo|i-navajo|i-pwn|i-tao|i-tay|i-tsu|sgn-BE-FR|sgn-BE-NL|sgn-CH-DE)|(art-lojban|cel-gaulish|no-bok|no-nyn|zh-guoyu|zh-hakka|zh-min|zh-min-nan|zh-xiang))|((?:([A-Za-z]{2,3}(-(?:[A-Za-z]{3}(-[A-Za-z]{3}){0,2}))?)|[A-Za-z]{4})(-(?:[A-Za-z]{4}))?(-(?:[A-Za-z]{2}|[0-9]{3}))?(-(?:[A-Za-z0-9]{5,8}|[0-9][A-Za-z0-9]{3}))*(-(?:[0-9A-WY-Za-wy-z](-[A-Za-z0-9]{2,8})+))*(-(?:x(-[A-Za-z0-9]{1,8})+))?)|(?:x(-[A-Za-z0-9]{1,8})+))$" ] ) ; - sh:description """ - Represents a Language Map. - """ ; - sh:message """ - rml:LanguageMap must specify an rml:template or rml:constant with the IRI - of the language. - """ ; - sh:name "LanguageMap" ; - sh:targetClass rml:LanguageMap ; - sh:targetObjectsOf rml:languageMap . - - a sh:NodeShape ; - sh:and ( [ sh:description """ - rml:language/rml:languageMap and rml:datatype/rml:datatypeMap - may only be provided once and not at the same time. - """ ; - sh:maxCount 1 ; - sh:minCount 0 ; - sh:name "languageMap/datatypeMap/language/datatype" ; - sh:path [ sh:alternativePath ( rml:languageMap rml:datatypeMap rml:language rml:datatype ) ] ] [ sh:description """ - Specified the language map for the object component for the - generated RDF triples. - """ ; - sh:message """ - rml:languageMap must point to a rml:LanguageMap specifying the - language tag of the string Literal. - """ ; - sh:name "languageMap" ; - sh:node ; - sh:nodeKind sh:BlankNodeOrIRI ; - sh:path rml:languageMap ; - sh:targetSubjectsOf rml:languageMap ] [ sh:description """ - Specifies the datatype of the object component for the generated - RDF triples. - """ ; - sh:message """ - rml:datatypeMap must point to a rml:DatatypeMap specifying the - datatype of the Literal. - """ ; - sh:name "datatypeMap" ; - sh:node ; - sh:nodeKind sh:BlankNodeOrIRI ; - sh:path rml:datatypeMap ; - sh:targetSubjectsOf rml:datatypeMap ] [ sh:description """ - Language tag for the object. - """ ; - sh:name "language" ; - sh:node ; - sh:path rml:language ; - sh:targetSubjectsOf rml:language ] [ sh:description """ - Datatype for the object. - """ ; - sh:name "datatype" ; - sh:node ; - sh:path rml:datatype ; - sh:targetSubjectsOf rml:datatype ] ) ; - sh:description """ - Represents an Object Map. - """ ; - sh:message """ - Object Map must generate a IRI, Blank Node, or Literal which has optionally - a language tag or datatype. - """ ; - sh:name "ObjectMap" ; - sh:targetClass rml:ObjectMap . - - a sh:NodeShape ; - sh:and ( [ ] ) ; - sh:description """ - Represents a Parent Map. - """ ; - sh:message """ - rml:ParentMap must specify a literal referencing data in the parent data - source. - """ ; - sh:name "ParentMap" ; - sh:targetClass rml:ParentMap ; - sh:targetObjectsOf rml:parentMap . - - a sh:NodeShape ; - sh:and ( [ sh:in ( rml:IRI ) ; - sh:message """ - rml:termType for Predicate Map can only be a rml:IRI; - """ ; - sh:path rml:termType ] ) ; - sh:description """ - Represents a Predicate Map. - """ ; - sh:message """ - Predicate Object Map must generate an IRI representing the predicate of an - RDF triple. - """ ; - sh:name "PredicateMap" ; - sh:targetClass rml:PredicateMap ; - sh:targetObjectsOf rml:predicateMap . - - a sh:NodeShape ; - sh:and ( [ sh:description """ - At least one rml:predicate or rml:predicateMap must be provided. - """ ; - sh:message """ - At least one rml:predicate or rml:predicateMap must be provided. - """ ; - sh:minCount 1 ; - sh:name "predicate/predicateMap" ; - sh:path [ sh:alternativePath ( rml:predicate rml:predicateMap ) ] ; - sh:targetSubjectsOf rml:predicate, - rml:predicateMap ] [ sh:description """ - A PredicateMap element to generate the predicate component of the - (predicate, object) pair from a logical table row or iterator. - """ ; - sh:message """ - rml:predicateMap must be an IRI or blank node and be provided once. - """ ; - sh:name "predicateMap" ; - sh:node ; - sh:nodeKind sh:BlankNodeOrIRI ; - sh:path rml:predicateMap ; - sh:targetSubjectsOf rml:predicateMap ] [ sh:description """ - Specifies the predicate for the generated triple from the logical table - row or iterator. - """ ; - sh:message """ - rml:predicate must be an IRI and be provided once. - """ ; - sh:name "predicate" ; - sh:node ; - sh:nodeKind sh:IRI ; - sh:path rml:predicate ; - sh:targetSubjectsOf rml:predicate ] [ sh:description """ - Either an rml:object, rml:objectMap, or rml:quotedTriplesMap must be provided, not multiple. - """ ; - sh:message """ - Either an rml:object, rml:objectMap, or rml:quotedTriplesMap must be provided, not multiple - """ ; - sh:minCount 1 ; - sh:name "object/objectMap/quotedTriplesMap" ; - sh:path [ sh:alternativePath ( rml:object rml:objectMap rml:quotedTriplesMap ) ] ; - sh:targetSubjectsOf rml:object, - rml:objectMap, - rml:quotedTriplesMap ] [ sh:description """ - An ObjectMap element to generate the object component of the - (predicate, object) pair from a logical table row or iterator. - """ ; - sh:message """ - rml:objectMap must be an IRI or blank node and be provided once. - """ ; - sh:name "objectMap" ; - sh:nodeKind sh:BlankNodeOrIRI ; - sh:or ( [ sh:node ] [ sh:node ] [ sh:node ] ) ; - sh:path rml:objectMap ; - sh:targetSubjectsOf rml:objectMap ] [ sh:description """ - Specifies the object for the generated RDF triples. - """ ; - sh:message """ - rml:object must be an IRI and be provided once. - """ ; - sh:name "object" ; - sh:node ; - sh:path rml:object ; - sh:targetSubjectsOf rml:object ] ) ; - sh:description """ - Represents a Predicate Object Map. - """ ; - sh:name "PredicateObjectMap" ; - sh:targetClass rml:PredicateObjectMap ; - sh:targetObjectsOf rml:predicateObjectMap . - - a sh:NodeShape ; - sh:and ( [ - - - - sh:class rml:TriplesMap ; - - sh:description """ - Specifies the Triples Map element corresponding to the parent data - source of the foreign key constraint. - """ ; - sh:maxCount 1 ; - sh:message """ - rml:parentTriplesMap may only be provided once and must be an IRI - or Blank Node referring to a Triples Map. - """ ; - sh:minCount 1 ; - sh:name "parentTriplesMap" ; - sh:node ; - sh:nodeKind sh:BlankNodeOrIRI ; - sh:path rml:parentTriplesMap ; - sh:targetSubjectsOf rml:parentTriplesMap ] ) ; - sh:description """ - Represents a Reference Object Map. - """ ; - sh:message """ - rml:RefObjectMap must specify a rml:parentTriplesMap and zero or more - rml:joinConditions. - """ ; - sh:name "RefObjectMap" ; - sh:targetClass rml:RefObjectMap . - - a sh:NodeShape ; - sh:and ( [ sh:description """ - The subject value generated will be asserted as an instance of this - RDFS class. - """ ; - sh:message """ - rml:class must be an IRI and may be specified multiple times. - """ ; - sh:name "class" ; - sh:nodeKind sh:IRI ; - sh:path rml:class ; - sh:targetSubjectsOf rml:class ] [ sh:in ( rml:IRI rml:BlankNode ) ; - sh:message """ - rml:termType must be a rml:IRI or rml:BlankNode for Subject Map. - """ ; - sh:path rml:termType ] ) ; - sh:description """ - Represents a Subject Map. - """ ; - sh:message """ - Subject Map must generate an IRI representing the subject of an RDF triple. - """ ; - sh:name "SubjectMap" ; - sh:targetClass rml:SubjectMap ; - sh:targetObjectsOf rml:subjectMap . - - a sh:NodeShape ; - sh:property [ sh:description """ - A logical source is any source that is mapped to RDF triples. - """ ; - sh:maxCount 1 ; - sh:message """ - Exactly one rml:logicalSource is required to access the data source. - """ ; - sh:minCount 1 ; - sh:name "logicalSource" ; - sh:nodeKind sh:BlankNodeOrIRI ; - sh:path rml:logicalSource ; - sh:targetSubjectsOf rml:logicalSource ], - [ sh:description """ - An IRI reference for use as subject for all generated RDF triples. - """ ; - sh:message """ - rml:subject must be an IRI or blank node. - """ ; - sh:name "subject" ; - sh:node ; - sh:nodeKind sh:BlankNodeOrIRI ; - sh:path rml:subject ; - sh:targetSubjectsOf rml:subject ], - [ sh:description """ - A Predicate Object Map element to generate a (predicate, object) pair. - """ ; - sh:message """ - rml:PredicateObjectMap must be an IRI or blank node. - """ ; - sh:minCount 0 ; - sh:name "predicateObjectMap" ; - sh:node ; - sh:nodeKind sh:BlankNodeOrIRI ; - sh:path rml:predicateObjectMap ; - sh:targetSubjectsOf rml:predicateObjectMap ], - [ sh:description """ - Either a rml:subject, rml:subjectMap or a rml:quotedTriplesMap is required, not multiple. - """ ; - sh:maxCount 1 ; - sh:message """ - Either a rml:subject, rml:subjectMap or a rml:quotedTriplesMap is required, not multiple. - """ ; - sh:minCount 1 ; - sh:name "subjectMap/subject/quotedTriplesMap" ; - sh:path [ sh:alternativePath ( rml:subjectMap rml:subject rml:quotedTriplesMap ) ] ; - sh:targetSubjectsOf rml:quotedTriplesMap, - rml:subject, - rml:subjectMap ], - [ sh:description """ - A Subject Map element to generate a subject for generated RDF triples. - """ ; - sh:message """ - rml:SubjectMap must be an IRI or blank node. - """ ; - sh:name "subjectMap" ; - sh:nodeKind sh:BlankNodeOrIRI ; - sh:or ( [ sh:node ] [ sh:node ] ) ; - sh:path rml:subjectMap ; - sh:targetSubjectsOf rml:subjectMap ] ; - sh:targetClass rml:NonAssertedTriplesMap, - rml:TriplesMap . - - a sh:NodeShape ; - sh:and ( [ ] ) ; - sh:description """ - Represents a Triples Map. - """ ; - sh:message """ - Triples Map requires exactly one rml:subject or one rml:subjectMap and zero - or more rml:predicateObjectMaps. - """ ; - sh:name "TriplesMap" ; - sh:targetClass rml:TriplesMap . - - a sh:NodeShape ; - sh:datatype xsd:string ; - sh:description """ - A Literal reference to use as reference to the child data source. - """ ; - sh:message """ - rml:child shortcut for rml:ChildMap must be a Literal. - """ ; - sh:name "child" ; - sh:nodeKind sh:Literal ; - sh:targetObjectOf . - - a sh:NodeShape ; - sh:description """ - An IRI reference for use as the graph name of all triples generated with - the datatype. - """ ; - sh:message """ - rml:datatype must be an IRI. - """ ; - sh:name "datatype" ; - sh:nodeKind sh:IRI ; - sh:targetObjectsOf rml:datatype . - - a sh:NodeShape ; - sh:description """ - An IRI reference for use as the graph name of all triples generated with - the Graph Map. - """ ; - sh:message """ - rml:graph must be an IRI or blank node. - """ ; - sh:name "graph" ; - sh:nodeKind sh:BlankNodeOrIRI ; - sh:targetObjectsOf rml:graph . - - a sh:NodeShape ; - sh:description """ - Specified the language for the generated Literal. - """ ; - sh:message """ - rml:language must be a valid language tag according to BCP47 and may - only be provided once as string. - """ ; - sh:name "language" ; - sh:nodeKind sh:Literal ; - sh:pattern "^((?:(en-GB-oed|i-ami|i-bnn|i-default|i-enochian|i-hak|i-klingon|i-lux|i-mingo|i-navajo|i-pwn|i-tao|i-tay|i-tsu|sgn-BE-FR|sgn-BE-NL|sgn-CH-DE)|(art-lojban|cel-gaulish|no-bok|no-nyn|zh-guoyu|zh-hakka|zh-min|zh-min-nan|zh-xiang))|((?:([A-Za-z]{2,3}(-(?:[A-Za-z]{3}(-[A-Za-z]{3}){0,2}))?)|[A-Za-z]{4})(-(?:[A-Za-z]{4}))?(-(?:[A-Za-z]{2}|[0-9]{3}))?(-(?:[A-Za-z0-9]{5,8}|[0-9][A-Za-z0-9]{3}))*(-(?:[0-9A-WY-Za-wy-z](-[A-Za-z0-9]{2,8})+))*(-(?:x(-[A-Za-z0-9]{1,8})+))?)|(?:x(-[A-Za-z0-9]{1,8})+))$" ; - sh:targetObjectsOf rml:language . - - a sh:NodeShape ; - sh:description """ - An IRI, Blank Node, or Literal to use as object for all the RDF triples. - """ ; - sh:message """ - rml:object shortcut for rml:objectMap must be an IRI, Blank Node, - or Literal. - """ ; - sh:name "object" ; - sh:targetObjectsOf rml:object . - - a sh:NodeShape ; - sh:datatype xsd:string ; - sh:description """ - A Literal reference to use as reference to the parent data source. - """ ; - sh:message """ - rml:parent shortcut for rml:ParentMap must be a Literal. - """ ; - sh:name "parent" ; - sh:nodeKind sh:Literal ; - sh:targetObjectsOf rml:parent . - - a sh:NodeShape ; - sh:description """ - Specifies the predicate for the generated triple. - """ ; - sh:message """ - rml:predicate must be an IRI. - """ ; - sh:name "predicate" ; - sh:nodeKind sh:IRI ; - sh:targetObjectsOf rml:predicate . - - a sh:NodeShape ; - sh:description """ - An IRI reference to use as subject for all the RDF triples. - """ ; - sh:message """ - rml:subject shortcut for rml:SubjectMap must be a IRI or BlankNode. - """ ; - sh:name "subject" ; - sh:nodeKind sh:BlankNodeOrIRI ; - sh:targetObjectsOf rml:subject . - - a sh:NodeShape ; - sh:property [ sh:description """ - Either an rml:graph or rml:graphMap may be optionally be provided, - but not both. - """ ; - sh:maxCount 1 ; - sh:message """ - Either an rml:graph or rml:graphMap may be optionally be provided, - but not both. - """ ; - sh:minCount 0 ; - sh:name "graph/graphMap" ; - sh:path [ sh:alternativePath ( rml:graph rml:graphMap ) ] ], - [ sh:description """ - Specifies a Graph Map. When used with a Subject Map element, all the - RDF triples generated will be stored in the specified named graph. - Otherwise, the RDF triple generated using the (predicate, object) - pair will be stored in the specified named graph. - """ ; - sh:message """ - rml:graphMap must be either an IRI or blank node. - """ ; - sh:name "graphMap" ; - sh:node ; - sh:nodeKind sh:BlankNodeOrIRI ; - sh:path rml:graphMap ], - [ sh:description """ - An IRI reference to use as the named graph of all generated triples. - """ ; - sh:message """ - rml:graphMap must be an IRI. - """ ; - sh:name "graph" ; - sh:node ; - sh:nodeKind sh:IRI ; - sh:path rml:graph ] ; - sh:targetSubjectsOf rml:graph, - rml:graphMap . - - a sh:NodeShape . - - a sh:NodeShape ; - sh:and ( [ sh:description """ - An IRI indicating whether a generated term should be an IRI, - Blank Node, or a Literal. - """ ; - sh:in ( rml:IRI rml:Literal rml:BlankNode ) ; - sh:maxCount 1 ; - sh:message """ - rml:termType must be either rml:IRI, rml:Literal, or rml:BlankNode - for a Term Map. May only be provided once. - """ ; - sh:name "termType" ; - sh:nodeKind sh:IRI ; - sh:path rml:termType ; - sh:targetSubjectsOf rml:termType ] ) ; - sh:description """ - Represents a Term Map. - """ ; - sh:message """ - Term Map is an Expression Map with optionally a term type specified. - """ ; - sh:name "TermMap" . - - a sh:NodeShape ; - sh:description """ - Represents a Expression Map. - """ ; - sh:message """ - Expression Map requires one rml:template or one rml:constant or one - rml:reference. - """ ; - sh:name "ExpressionMap" ; - sh:property [ sh:description """ - Exactly one rml:template, one rml:constant, one rml:reference, - one rml:returnMap, or one rml:functionExecution is required. - """ ; - sh:maxCount 1 ; - sh:message """ - Exactly one rml:template, one rml:constant, one rml:reference, or one rml:functionExecution is required. - """ ; - - # SHOULD BE REMOVED? - # sh:minCount 1 ; - - - sh:name "template/constant/reference/returnMap/functionExecution" ; - sh:path [ sh:alternativePath ( rml:template rml:constant rml:reference rml:functionExecution ) ] ; - sh:targetSubjectsOf rml:constant, - rml:functionExecution, - rml:reference, - rml:returnMap, - rml:template ], - [ sh:datatype xsd:string ; - sh:description """ - A reference rml:reference is used to refer to a column in case of - databases, a record in case of CSV or TSV data source, an element in - case of XML data source, an object in case of a JSON data source, etc. - - A reference must be a valid identifier, considering the reference - formulation (rml:referenceFormulation) specified. The reference can be - an absolute path, or a path relative to the iterator specified at the - logical source. - """ ; - sh:message """ - rml:reference must be a string. - """ ; - sh:name "reference" ; - sh:nodeKind sh:Literal ; - sh:path rml:reference ; - sh:targetSubjectsOf rml:reference ], - [ sh:description """ - A Return Map rml:returnMap is used to define the return values of a FnO - function from the RML-FNML specification. RML Core only validates if the - property is present and has the right node kind. The actual validation - happens with RML-FNML SHACL shapes. - """ ; - sh:message """ - rml:returnMap must be an IRI; - """ ; - sh:name "returnMap" ; - sh:nodeKind sh:BlankNodeOrIRI ; - sh:path rml:returnMap ; - sh:targetSubjectsOf rml:returnMap ], - [ sh:description """ - A Function Execution rml:functionExecution is used to define the FnO - function to execute from the RML-FNML specification. RML Core only - validates if the property is present and has the right node kind. - The actual validation happens with RML-FNML SHACL shapes. - """ ; - sh:message """ - rml:functionExecution must be an IRI; - """ ; - sh:name "functionExecution" ; - sh:nodeKind sh:BlankNodeOrIRI ; - sh:path rml:functionExecution ; - sh:targetSubjectsOf rml:functionExecution ], - [ sh:datatype xsd:string ; - sh:description """ - A template (format string) to specify how to generate a value for a - subject, predicate, or object, using one or more columns from a logical - table row or iterator. - """ ; - sh:message """ - rml:template must be a string. - """ ; - sh:name "template" ; - sh:nodeKind sh:Literal ; - sh:path rml:template ], - [ sh:description """ - A property for indicating whether a term map is a constant-valued term - map. - """ ; - sh:message """ - rml:constant must be an IRI or Literal. - """ ; - sh:name "constant" ; - sh:path rml:constant ; - sh:targetSubjectsOf rml:constant ] . - - a sh:PropertyShape ; - sh:description """ - A logical target is any target to where generated RDF triples are - exported to. - """ ; - sh:maxCount 1 ; - sh:message """ - Zero or one rml:logicalTarget is required to export RDF triples. - """ ; - sh:minCount 0 ; - sh:name "logicalTarget" ; - sh:nodeKind sh:BlankNodeOrIRI ; - sh:path rml:logicalTarget ; - sh:targetSubjectsOf rml:logicalTarget . - diff --git a/src/main/resources/shapes/io.ttl b/src/main/resources/shapes/io.ttl deleted file mode 100644 index 756b85a8..00000000 --- a/src/main/resources/shapes/io.ttl +++ /dev/null @@ -1,224 +0,0 @@ -@prefix brick: . -@prefix csvw: . -@prefix dc: . -@prefix dcam: . -@prefix dcat: . -@prefix dcmitype: . -@prefix dcterms: . -@prefix doap: . -@prefix foaf: . -@prefix geo: . -@prefix odrl: . -@prefix org: . -@prefix owl: . -@prefix prof: . -@prefix prov: . -@prefix qb: . -@prefix rdf: . -@prefix rdfs: . -@prefix rml: . -@prefix schema: . -@prefix sh: . -@prefix skos: . -@prefix sosa: . -@prefix ssn: . -@prefix time: . -@prefix vann: . -@prefix void: . -@prefix wgs: . -@prefix xml: . -@prefix xsd: . - - a sh:NodeShape ; - sh:description """ - A logical source is any source that is mapped to RDF triples. - """ ; - sh:message """ - RML Logical Source requires one rml:source and depending on the source - type: one rml:referenceFormulation and/or one rml:iterator. - """ ; - sh:name "RML Logical Source" ; - sh:property [ sh:description """ - The source (rml:source) locates the input data source. It is a URI - that represents the data source where the data source is. - """ ; - sh:maxCount 1 ; - sh:message """ - rml:source must be provided to locate the data source. - rml:source must be provided exactly once as an URI. - """ ; - sh:minCount 1 ; - sh:name "rml:source" ; - sh:node ; - sh:nodeKind sh:BlankNodeOrIRI ; - sh:path rml:source ], - [ sh:datatype xsd:string ; - sh:description """ - The logical iterator (rml:iterator) defines the iteration loop used to - map the data of the input source. Depends on the reference formulation - if an iterator is necessary. - """ ; - sh:maxCount 1 ; - sh:message """ - rml:iterator must be a Literal specifying the iterator to iterate over - the data source. - """ ; - sh:minCount 0 ; - sh:name "rml:iterator" ; - sh:nodeKind sh:Literal ; - sh:path rml:iterator ], - [ sh:description """ - The reference formulation (rml:referenceFormulation) defines how to - reference to elements of the data of the input source. - """ ; - sh:maxCount 1 ; - sh:message """ - rml:referenceFormulation must be a blank node or IRI specifying the - reference formulation on how to reference elements of a data source. - """ ; - sh:minCount 0 ; - sh:name "rml:referenceFormulation" ; - sh:nodeKind sh:BlankNodeOrIRI ; - sh:path rml:referenceFormulation ] ; - sh:targetClass rml:LogicalSource ; - sh:targetObjectsOf rml:logicalSource . - - a sh:NodeShape ; - sh:description """ - A logical target is any target to where generated RDF triples are exported - to. - """ ; - sh:message """ - RML Logical Target requires one rml:target. - """ ; - sh:name "RML Logical Target" ; - sh:property [ sh:description """ - The target (rml:target) locates the output target. It is a URI - that represents the target where it must export generated RDF triples - to. - """ ; - sh:maxCount 1 ; - sh:message """ - rml:target must be provided to locate the target. rml:target must - be provided exactly once as an URI. - """ ; - sh:minCount 1 ; - sh:name "rml:target" ; - sh:node ; - sh:nodeKind sh:BlankNodeOrIRI ; - sh:path rml:target ] ; - sh:targetClass rml:LogicalTarget ; - sh:targetObjectsOf rml:logicalTarget . - - a sh:NodeShape ; - sh:description """ - A source describes access to a data source. Any data access description - is allowed, but rml:Source provides additional properties to complete - such descriptions. - """ ; - sh:message """ - RML Source accepts one or multiple rml:null, one rml:compression, - and one rml:encoding. All of them are optional. - """ ; - sh:name "RML Source" ; - sh:property [ sh:datatype xsd:string ; - sh:description """ - rml:null specifies how NULL or empty values are exposed by the data - source. - """ ; - sh:message """ - rml:source must be provided as a string Literal. - """ ; - sh:minCount 0 ; - sh:name "rml:null" ; - sh:nodeKind sh:Literal ; - sh:path rml:null ], - [ sh:description """ - rml:compression specifies the compression algorithm to use when - accessing the data source. By default, no compression is applied. - """ ; - sh:maxCount 1 ; - sh:message """ - rml:compression must be provided as an IRI. - """ ; - sh:minCount 0 ; - sh:name "rml:compression" ; - sh:nodeKind sh:IRI ; - sh:path rml:compression ], - [ sh:description """ - rml:encoding specifies the encoding to use when accessing the data - source. By default, UTF-8 is used. - """ ; - sh:maxCount 1 ; - sh:message """ - rml:encoding must be provided as an IRI. - """ ; - sh:minCount 0 ; - sh:name "rml:encoding" ; - sh:nodeKind sh:IRI ; - sh:path rml:encoding ], - [ sh:description """ - rml:null specifies which data values inside the source should be - considered as NULL. Defaults to the default NULL character of a source, - if available. - """ ; - sh:message """ - rml:null must be provided as a Literal. - """ ; - sh:minCount 0 ; - sh:name "rml:null" ; - sh:nodeKind sh:Literal ; - sh:path rml:null ] ; - sh:targetClass rml:Source ; - sh:targetObjectsOf rml:source . - - a sh:NodeShape ; - sh:description """ - A target describes access to a data target. Any data access description - is allowed, but rml:Target provides additional properties to complete - such descriptions. - """ ; - sh:message """ - RML Target accepts one rml:compression, and one rml:encoding. - All of them are optional. - """ ; - sh:name "RML Target" ; - sh:property [ sh:description """ - rml:compression specifies the compression algorithm to use when - accessing the data target. By default, no compression is applied. - """ ; - sh:maxCount 1 ; - sh:message """ - rml:compression must be provided as an IRI. - """ ; - sh:minCount 0 ; - sh:name "rml:compression" ; - sh:nodeKind sh:IRI ; - sh:path rml:compression ], - [ sh:description """ - rml:encoding specifies the encoding to use when accessing the data - target. By default, UTF-8 is used. - """ ; - sh:maxCount 1 ; - sh:message """ - rml:encoding must be provided as an IRI. - """ ; - sh:minCount 0 ; - sh:name "rml:encoding" ; - sh:nodeKind sh:IRI ; - sh:path rml:encoding ], - [ sh:description """ - rml:serialization specifies the serialization format to use when - exporting the generated RDF to a target. By default N-Quads is used. - """ ; - sh:maxCount 1 ; - sh:message """ - rml:serialization must be provided as an IRI. - """ ; - sh:minCount 0 ; - sh:name "rml:serialization" ; - sh:nodeKind sh:IRI ; - sh:path rml:serialization ] ; - sh:targetClass rml:Target ; - sh:targetObjectsOf rml:target . - diff --git a/src/main/resources/shapes/cc.ttl b/src/main/resources/shapes/rml-cc/cc.ttl similarity index 89% rename from src/main/resources/shapes/cc.ttl rename to src/main/resources/shapes/rml-cc/cc.ttl index 1496df3f..a3888dfd 100644 --- a/src/main/resources/shapes/cc.ttl +++ b/src/main/resources/shapes/rml-cc/cc.ttl @@ -30,7 +30,7 @@ @prefix xsd: . a sh:NodeShape ; - sh:and ( [ sh:description """ + sh:and ( [ rdfs:comment """ rml:strategy specifies the collection strategy to use: rml:append or rml:cartesianProduct. rml:append is the default strategy. """ ; @@ -39,10 +39,10 @@ Zero or one rml:strategy is required. """ ; sh:minCount 0 ; - sh:name "strategy" ; + rdfs:label "strategy" ; sh:node ; sh:nodeKind sh:IRI ; - sh:path rml:strategy ] [ sh:description """ + sh:path rml:strategy ] [ rdfs:comment """ rml:gatherAs specifies how to gather the collection e.g. a rdf:Alt, rdf:List, rdf:Bag, or rdf:Seq. """ ; @@ -52,10 +52,10 @@ One rml:gatherAs is required. """ ; sh:minCount 1 ; - sh:name "gatherAs" ; + rdfs:label "gatherAs" ; sh:nodeKind sh:IRI ; sh:path rml:gatherAs ] [ sh:datatype xsd:boolean ; - sh:description """ + rdfs:comment """ Defines the behavior when the collection is empty. True will generate a rdf:nil for a RDF collection or a resource with no members for an RDF container. False will not generate any collection or container. @@ -67,9 +67,9 @@ xsd:boolean. """ ; sh:minCount 0 ; - sh:name "allowEmptyListAndContainer" ; + rdfs:label "allowEmptyListAndContainer" ; sh:nodeKind sh:Literal ; - sh:path rml:allowEmptyListAndContainer ] [ sh:description """ + sh:path rml:allowEmptyListAndContainer ] [ rdfs:comment """ RML Term Maps to gather in the collection or container. """ ; sh:message """ @@ -77,17 +77,17 @@ RML Term Map. """ ; sh:minCount 1 ; - sh:name "gather" ; + rdfs:label "gather" ; sh:nodeKind sh:BlankNodeOrIRI ; sh:path rml:gather ] ) ; - sh:description """ + rdfs:comment """ Represents a Gather Map. """ ; sh:message """ Gather Map requires one rml:strategy, one rml:gatherAs, and a list of Term Map with rml:gather. """ ; - sh:name "GatherMap" . + rdfs:label "GatherMap" . a sh:NodeShape . diff --git a/src/main/resources/shapes/rml-cc/external_shapes.ttl b/src/main/resources/shapes/rml-cc/external_shapes.ttl new file mode 100644 index 00000000..79e83045 --- /dev/null +++ b/src/main/resources/shapes/rml-cc/external_shapes.ttl @@ -0,0 +1,24 @@ +############################################################################### +# RML FNML external resources shapes # +# Copyright Dylan Van Assche, IDLab - UGent - imec (2023) # +############################################################################### +@prefix sh: . +@prefix : . +@prefix rdf: . +@prefix rml: . +@prefix xsd: . + +# Shapes are defined in the corresponding repositories of each specification +# Provide their IRI as stub to allow validation in CC. + +:RMLTermMapShape + a sh:NodeShape; +. + +:RMLLogicalTargetPropertiesShape + a sh:NodeShape; +. + +:RMLStrategyAppendShape + a sh:NodeShape; +. diff --git a/src/main/resources/shapes/rml-cc/gather_map.ttl b/src/main/resources/shapes/rml-cc/gather_map.ttl new file mode 100644 index 00000000..cf053a74 --- /dev/null +++ b/src/main/resources/shapes/rml-cc/gather_map.ttl @@ -0,0 +1,90 @@ +############################################################################### +# RMLCC Gather Map shape # +# Copyright Dylan Van Assche, IDLab - UGent - imec (2023 - 2024) # +############################################################################### +@prefix sh: . +@prefix rdfs: . +@prefix : . +@prefix rdf: . +@prefix rml: . +@prefix xsd: . + +:RMLGatherMapShape + a sh:NodeShape ; + rdfs:label "GatherMap" ; + rdfs:comment """ + Represents a Gather Map. + """ ; + sh:message """ + Gather Map requires one rml:strategy, one rml:gatherAs, and a list of + Term Map with rml:gather. + """ ; + + sh:and ( + # Inherited shapes + :RMLTermMapShape + :RMLLogicalTargetPropertiesShape + # Gather Map specific shapes + [ + sh:path rml:strategy ; + rdfs:label "strategy" ; + rdfs:comment """ + rml:strategy specifies the collection strategy to use: rml:append + or rml:cartesianProduct. rml:append is the default strategy. + """ ; + sh:message """ + Zero or one rml:strategy is required. + """ ; + sh:node :RMLStrategyAppendShape ; + sh:nodeKind sh:IRI ; + sh:minCount 0 ; + sh:maxCount 1 ; + ] + [ + sh:path rml:gatherAs ; + rdfs:label "gatherAs" ; + rdfs:comment """ + rml:gatherAs specifies how to gather the collection e.g. a rdf:Alt, + rdf:List, rdf:Bag, or rdf:Seq. + """ ; + sh:message """ + One rml:gatherAs is required. + """ ; + sh:in (rdf:Alt rdf:List rdf:Bag rdf:Seq) ; + sh:nodeKind sh:IRI; + sh:minCount 1 ; + sh:maxCount 1 ; + ] + [ + sh:path rml:allowEmptyListAndContainer ; + rdfs:label "allowEmptyListAndContainer" ; + rdfs:comment """ + Defines the behavior when the collection is empty. True will generate + a rdf:nil for a RDF collection or a resource with no members for an RDF + container. False will not generate any collection or container. + Default is false. + """ ; + sh:message """ + Zero or one rml:allowEmptyListAndContainer is required with datatype + xsd:boolean. + """ ; + sh:minCount 0 ; + sh:maxCount 1 ; + sh:nodeKind sh:Literal ; + sh:datatype xsd:boolean ; + ] + [ + sh:path rml:gather ; + rdfs:label "gather" ; + rdfs:comment """ + RML Term Maps to gather in the collection or container. + """ ; + sh:message """ + one or more rml:gather properties are needed, each pointing to a + RML Term Map. + """ ; + sh:nodeKind sh:BlankNodeOrIRI ; + sh:minCount 1 ; + ] + ) ; +. diff --git a/src/main/resources/shapes/rml-cc/generate_shape.py b/src/main/resources/shapes/rml-cc/generate_shape.py new file mode 100755 index 00000000..5d4db637 --- /dev/null +++ b/src/main/resources/shapes/rml-cc/generate_shape.py @@ -0,0 +1,79 @@ +#!/usr/bin/env python + +import argparse +import sys +from os import path +from glob import glob +from rdflib import Graph, Namespace +from rdflib.plugins.serializers.turtle import TurtleSerializer +from rdflib import plugin + +SUBSHAPE_FORMAT = 'turtle' +SUBSHAPE_GLOB_PATTERN = '*.ttl' +SHACL = Namespace('http://www.w3.org/ns/shacl#') +RML = Namespace('http://w3id.org/rml/') + + +class TurtleWithPrefixes(TurtleSerializer): + """ + A turtle serializer that always emits prefixes + Workaround for https://github.com/RDFLib/rdflib/issues/1048 + """ + roundtrip_prefixes = True # Undocumented, forces to write all prefixes + + +class ShapeGenerator: + """ + Generates a complete SHACL shape of all the SHACL subshapes. + Useful for using the shapes in the shacl.org Playground. + """ + def __init__(self, glob_pattern: str, rdf_format: str, + destination: str) -> None: + self._glob_pattern: str = glob_pattern + self._rdf_format: str = rdf_format + self._destination: str = destination + self._shape = Graph() + self._shape.bind('sh', SHACL) + self._shape.bind('rml', RML) + # Register TurtleWithPrefixes serializer as 'tortoise' format + plugin.register('tortoise', + plugin.Serializer, + 'generate_shape', + 'TurtleWithPrefixes') + + def generate(self) -> None: + """ + Generate a full shape from the sub shapes. + """ + print('Reading subshapes:') + for sub_shape in glob(self._glob_pattern): + if 'cc' in sub_shape or 'shacl' in sub_shape: + continue + print(f"\t{sub_shape}") + g = Graph() + g.bind('sh', SHACL) + g.bind('rml', RML) + self._shape += g.parse(sub_shape, format=self._rdf_format) + + print(f'Writing shape to {self._destination}') + self._shape.serialize(destination=self._destination, format='tortoise') + + +if __name__ == '__main__': + p = argparse.ArgumentParser(description='Generate a complete SHACL shape ' + 'from the subshapes.') + p.add_argument('destination', type=str, help='Location to write the ' + 'complete SHACL shape as Turtle.') + # Arguments parsing + args = p.parse_args() + if not path.exists(args.destination): + print(f'{args.destination} file path does not exist!') + sys.exit(1) + + if path.isdir(args.destination): + args.destination = path.join(args.destination, 'cc.ttl') + + # Generate shape + generator = ShapeGenerator(SUBSHAPE_GLOB_PATTERN, SUBSHAPE_FORMAT, + args.destination) + generator.generate() diff --git a/src/main/resources/shapes/rml-cc/mapping_validator.py b/src/main/resources/shapes/rml-cc/mapping_validator.py new file mode 100644 index 00000000..f239f596 --- /dev/null +++ b/src/main/resources/shapes/rml-cc/mapping_validator.py @@ -0,0 +1,40 @@ +from logging import debug, info, critical +from pyshacl import validate +from rdflib import Graph +from shutil import get_terminal_size + + +class MappingValidator: + def __init__(self, shape: str) -> None: + g = Graph() + g.parse(shape, format='turtle') + self._shape = g + + def validate(self, rules: Graph, print_report: bool = True) -> None: + valid: bool + report_graph: Graph + report_text: str + valid, report_graph, report_text = validate(rules, + shacl_graph=self._shape) + debug(f'RML rules valid: {valid}') + debug(f'SHACL validation report: {report_text}') + + # If mapping rules are invalid, print SHACL report and raise exception + if not valid and print_report: + self._print_report(report_text) + msg = 'RML mapping rules are invalid, a detailed explanation' \ + ' is available in the report' + critical(msg) + raise ValueError(msg) + + def _print_report(self, report_text: str) -> None: + tty_columns: int + tty_columns, _ = get_terminal_size() + info('-' * tty_columns) + title: str = 'RML rules validation report' + white_space: int = int((tty_columns - len(title)) / 2) + title = ' ' * white_space + title + ' ' * white_space + info(title) + info('-' * tty_columns) + info(report_text) + info('-' * tty_columns) \ No newline at end of file diff --git a/src/main/resources/shapes/rml-cc/requirements.txt b/src/main/resources/shapes/rml-cc/requirements.txt new file mode 100644 index 00000000..e9fdd848 --- /dev/null +++ b/src/main/resources/shapes/rml-cc/requirements.txt @@ -0,0 +1,3 @@ +parameterized +rdflib +pyshacl \ No newline at end of file diff --git a/src/main/resources/shapes/rml-cc/shacl.ttl b/src/main/resources/shapes/rml-cc/shacl.ttl new file mode 100644 index 00000000..e37856a1 --- /dev/null +++ b/src/main/resources/shapes/rml-cc/shacl.ttl @@ -0,0 +1,406 @@ +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix xsd: . + +@prefix shsh: . + +shsh: + rdfs:label "SHACL for SHACL"@en ; + rdfs:comment "This shapes graph can be used to validate SHACL shapes graphs against a subset of the SHACL syntax rules."@en ; + sh:declare [ + sh:prefix "shsh" ; + sh:namespace "http://www.w3.org/ns/shacl-shacl#" ; + ] . + + +shsh:ListShape + a sh:NodeShape ; + rdfs:label "List shape"@en ; + rdfs:comment "A shape describing well-formed RDF lists. Currently does not check for non-recursion. This could be expressed using SHACL-SPARQL."@en ; + rdfs:seeAlso ; + sh:property [ + sh:path [ sh:zeroOrMorePath rdf:rest ] ; + rdfs:comment "Each list member (including this node) must be have the shape shsh:ListNodeShape."@en ; + sh:hasValue rdf:nil ; + sh:node shsh:ListNodeShape ; + ] . + +shsh:ListNodeShape + a sh:NodeShape ; + rdfs:label "List node shape"@en ; + rdfs:comment "Defines constraints on what it means for a node to be a node within a well-formed RDF list. Note that this does not check whether the rdf:rest items are also well-formed lists as this would lead to unsupported recursion."@en ; + sh:or ( [ + sh:hasValue rdf:nil ; + sh:property [ + sh:path rdf:first ; + sh:maxCount 0 ; + ] ; + sh:property [ + sh:path rdf:rest ; + sh:maxCount 0 ; + ] ; + ] + [ + sh:not [ sh:hasValue rdf:nil ] ; + sh:property [ + sh:path rdf:first ; + sh:maxCount 1 ; + sh:minCount 1 ; + ] ; + sh:property [ + sh:path rdf:rest ; + sh:maxCount 1 ; + sh:minCount 1 ; + ] ; + ] ) . + +shsh:ShapeShape + a sh:NodeShape ; + rdfs:label "Shape shape"@en ; + rdfs:comment "A shape that can be used to validate syntax rules for other shapes."@en ; + + # See https://www.w3.org/TR/shacl/#shapes for what counts as a shape + sh:targetClass sh:NodeShape ; + sh:targetClass sh:PropertyShape ; + sh:targetSubjectsOf sh:targetClass, sh:targetNode, sh:targetObjectsOf, sh:targetSubjectsOf ; + sh:targetSubjectsOf sh:and, sh:class, sh:closed, sh:datatype, sh:disjoint, sh:equals, sh:flags, sh:hasValue, + sh:ignoredProperties, sh:in, sh:languageIn, sh:lessThan, sh:lessThanOrEquals, sh:maxCount, sh:maxExclusive, + sh:maxInclusive, sh:maxLength, sh:minCount, sh:minExclusive, sh:minInclusive, sh:minLength, sh:node, sh:nodeKind, + sh:not, sh:or, sh:pattern, sh:property, sh:qualifiedMaxCount, sh:qualifiedMinCount, sh:qualifiedValueShape, + sh:qualifiedValueShape, sh:qualifiedValueShapesDisjoint, sh:qualifiedValueShapesDisjoint, sh:uniqueLang, sh:xone ; + + sh:targetObjectsOf sh:node ; # node-node + sh:targetObjectsOf sh:not ; # not-node + sh:targetObjectsOf sh:property ; # property-node + sh:targetObjectsOf sh:qualifiedValueShape ; # qualifiedValueShape-node + + # Shapes are either node shapes or property shapes + sh:xone ( shsh:NodeShapeShape shsh:PropertyShapeShape ) ; + + sh:property [ + sh:path sh:targetNode ; + sh:nodeKind sh:IRIOrLiteral ; # targetNode-nodeKind + ] ; + sh:property [ + sh:path sh:targetClass ; + sh:nodeKind sh:IRI ; # targetClass-nodeKind + ] ; + sh:property [ + sh:path sh:targetSubjectsOf ; + sh:nodeKind sh:IRI ; # targetSubjectsOf-nodeKind + ] ; + sh:property [ + sh:path sh:targetObjectsOf ; + sh:nodeKind sh:IRI ; # targetObjectsOf-nodeKind + ] ; + sh:or ( [ sh:not [ + sh:class rdfs:Class ; + sh:or ( [ sh:class sh:NodeShape ] [ sh:class sh:PropertyShape ] ) + ] ] + [ sh:nodeKind sh:IRI ] + ) ; # implicit-targetClass-nodeKind + + sh:property [ + sh:path sh:severity ; + sh:maxCount 1 ; # severity-maxCount + sh:nodeKind sh:IRI ; # severity-nodeKind + ] ; + sh:property [ + sh:path sh:message ; + sh:or ( [ sh:datatype xsd:string ] [ sh:datatype rdf:langString ] ) ; # message-datatype + ] ; + sh:property [ + sh:path sh:deactivated ; + sh:maxCount 1 ; # deactivated-maxCount + sh:in ( true false ) ; # deactivated-datatype + ] ; + + sh:property [ + sh:path sh:and ; + sh:node shsh:ListShape ; # and-node + ] ; + sh:property [ + sh:path sh:class ; + sh:nodeKind sh:IRI ; # class-nodeKind + ] ; + sh:property [ + sh:path sh:closed ; + sh:datatype xsd:boolean ; # closed-datatype + sh:maxCount 1 ; # multiple-parameters + ] ; + sh:property [ + sh:path sh:ignoredProperties ; + sh:node shsh:ListShape ; # ignoredProperties-node + sh:maxCount 1 ; # multiple-parameters + ] ; + sh:property [ + sh:path ( sh:ignoredProperties [ sh:zeroOrMorePath rdf:rest ] rdf:first ) ; + sh:nodeKind sh:IRI ; # ignoredProperties-members-nodeKind + ] ; + sh:property [ + sh:path sh:datatype ; + sh:nodeKind sh:IRI ; # datatype-nodeKind + sh:maxCount 1 ; # datatype-maxCount + ] ; + sh:property [ + sh:path sh:disjoint ; + sh:nodeKind sh:IRI ; # disjoint-nodeKind + ] ; + sh:property [ + sh:path sh:equals ; + sh:nodeKind sh:IRI ; # equals-nodeKind + ] ; + sh:property [ + sh:path sh:in ; + sh:maxCount 1 ; # in-maxCount + sh:node shsh:ListShape ; # in-node + ] ; + sh:property [ + sh:path sh:languageIn ; + sh:maxCount 1 ; # languageIn-maxCount + sh:node shsh:ListShape ; # languageIn-node + ] ; + sh:property [ + sh:path ( sh:languageIn [ sh:zeroOrMorePath rdf:rest ] rdf:first ) ; + sh:datatype xsd:string ; # languageIn-members-datatype + ] ; + sh:property [ + sh:path sh:lessThan ; + sh:nodeKind sh:IRI ; # lessThan-nodeKind + ] ; + sh:property [ + sh:path sh:lessThanOrEquals ; + sh:nodeKind sh:IRI ; # lessThanOrEquals-nodeKind + ] ; + sh:property [ + sh:path sh:maxCount ; + sh:datatype xsd:integer ; # maxCount-datatype + sh:maxCount 1 ; # maxCount-maxCount + ] ; + sh:property [ + sh:path sh:maxExclusive ; + sh:maxCount 1 ; # maxExclusive-maxCount + sh:nodeKind sh:Literal ; # maxExclusive-nodeKind + ] ; + sh:property [ + sh:path sh:maxInclusive ; + sh:maxCount 1 ; # maxInclusive-maxCount + sh:nodeKind sh:Literal ; # maxInclusive-nodeKind + ] ; + sh:property [ + sh:path sh:maxLength ; + sh:datatype xsd:integer ; # maxLength-datatype + sh:maxCount 1 ; # maxLength-maxCount + ] ; + sh:property [ + sh:path sh:minCount ; + sh:datatype xsd:integer ; # minCount-datatype + sh:maxCount 1 ; # minCount-maxCount + ] ; + sh:property [ + sh:path sh:minExclusive ; + sh:maxCount 1 ; # minExclusive-maxCount + sh:nodeKind sh:Literal ; # minExclusive-nodeKind + ] ; + sh:property [ + sh:path sh:minInclusive ; + sh:maxCount 1 ; # minInclusive-maxCount + sh:nodeKind sh:Literal ; # minInclusive-nodeKind + ] ; + sh:property [ + sh:path sh:minLength ; + sh:datatype xsd:integer ; # minLength-datatype + sh:maxCount 1 ; # minLength-maxCount + ] ; + sh:property [ + sh:path sh:nodeKind ; + sh:in ( sh:BlankNode sh:IRI sh:Literal sh:BlankNodeOrIRI sh:BlankNodeOrLiteral sh:IRIOrLiteral ) ; # nodeKind-in + sh:maxCount 1 ; # nodeKind-maxCount + ] ; + sh:property [ + sh:path sh:or ; + sh:node shsh:ListShape ; # or-node + ] ; + sh:property [ + sh:path sh:pattern ; + sh:datatype xsd:string ; # pattern-datatype + sh:maxCount 1 ; # multiple-parameters + # Not implemented: syntax rule pattern-regex + ] ; + sh:property [ + sh:path sh:flags ; + sh:datatype xsd:string ; # flags-datatype + sh:maxCount 1 ; # multiple-parameters + ] ; + sh:property [ + sh:path sh:qualifiedMaxCount ; + sh:datatype xsd:integer ; # qualifiedMaxCount-datatype + sh:maxCount 1 ; # multiple-parameters + ] ; + sh:property [ + sh:path sh:qualifiedMinCount ; + sh:datatype xsd:integer ; # qualifiedMinCount-datatype + sh:maxCount 1 ; # multiple-parameters + ] ; + sh:property [ + sh:path sh:qualifiedValueShape ; + sh:maxCount 1 ; # multiple-parameters + ] ; + sh:property [ + sh:path sh:qualifiedValueShapesDisjoint ; + sh:datatype xsd:boolean ; # qualifiedValueShapesDisjoint-datatype + sh:maxCount 1 ; # multiple-parameters + ] ; + sh:property [ + sh:path sh:uniqueLang ; + sh:datatype xsd:boolean ; # uniqueLang-datatype + sh:maxCount 1 ; # uniqueLang-maxCount + ] ; + sh:property [ + sh:path sh:xone ; + sh:node shsh:ListShape ; # xone-node + ] . + +shsh:NodeShapeShape + a sh:NodeShape ; + sh:targetObjectsOf sh:node ; # node-node + sh:property [ + sh:path sh:path ; + sh:maxCount 0 ; # NodeShape-path-maxCount + ] ; + sh:property [ + sh:path sh:lessThan ; + sh:maxCount 0 ; # lessThan-scope + ] ; + sh:property [ + sh:path sh:lessThanOrEquals ; + sh:maxCount 0 ; # lessThanOrEquals-scope + ] ; + sh:property [ + sh:path sh:maxCount ; + sh:maxCount 0 ; # maxCount-scope + ] ; + sh:property [ + sh:path sh:minCount ; + sh:maxCount 0 ; # minCount-scope + ] ; + sh:property [ + sh:path sh:qualifiedValueShape ; + sh:maxCount 0 ; # qualifiedValueShape-scope + ] ; + sh:property [ + sh:path sh:uniqueLang ; + sh:maxCount 0 ; # uniqueLang-scope + ] . + +shsh:PropertyShapeShape + a sh:NodeShape ; + sh:targetObjectsOf sh:property ; # property-node + sh:property [ + sh:path sh:path ; + sh:maxCount 1 ; # path-maxCount + sh:minCount 1 ; # PropertyShape-path-minCount + sh:node shsh:PathShape ; # path-node + ] . + +# Values of sh:and, sh:or and sh:xone must be lists of shapes +shsh:ShapesListShape + a sh:NodeShape ; + sh:targetObjectsOf sh:and ; # and-members-node + sh:targetObjectsOf sh:or ; # or-members-node + sh:targetObjectsOf sh:xone ; # xone-members-node + sh:property [ + sh:path ( [ sh:zeroOrMorePath rdf:rest ] rdf:first ) ; + sh:node shsh:ShapeShape ; + ] . + + +# A path of blank node path syntax, used to simulate recursion +_:PathPath + sh:alternativePath ( + ( [ sh:zeroOrMorePath rdf:rest ] rdf:first ) + ( sh:alternativePath [ sh:zeroOrMorePath rdf:rest ] rdf:first ) + sh:inversePath + sh:zeroOrMorePath + sh:oneOrMorePath + sh:zeroOrOnePath + ) . + +shsh:PathShape + a sh:NodeShape ; + rdfs:label "Path shape"@en ; + rdfs:comment "A shape that can be used to validate the syntax rules of well-formed SHACL paths."@en ; + rdfs:seeAlso ; + sh:property [ + sh:path [ sh:zeroOrMorePath _:PathPath ] ; + sh:node shsh:PathNodeShape ; + ] . + +shsh:PathNodeShape + sh:xone ( # path-metarule + [ sh:nodeKind sh:IRI ] # 2.3.1.1: Predicate path + [ sh:nodeKind sh:BlankNode ; # 2.3.1.2: Sequence path + sh:node shsh:PathListWithAtLeast2Members ; + ] + [ sh:nodeKind sh:BlankNode ; # 2.3.1.3: Alternative path + sh:closed true ; + sh:property [ + sh:path sh:alternativePath ; + sh:node shsh:PathListWithAtLeast2Members ; + sh:minCount 1 ; + sh:maxCount 1 ; + ] + ] + [ sh:nodeKind sh:BlankNode ; # 2.3.1.4: Inverse path + sh:closed true ; + sh:property [ + sh:path sh:inversePath ; + sh:minCount 1 ; + sh:maxCount 1 ; + ] + ] + [ sh:nodeKind sh:BlankNode ; # 2.3.1.5: Zero-or-more path + sh:closed true ; + sh:property [ + sh:path sh:zeroOrMorePath ; + sh:minCount 1 ; + sh:maxCount 1 ; + ] + ] + [ sh:nodeKind sh:BlankNode ; # 2.3.1.6: One-or-more path + sh:closed true ; + sh:property [ + sh:path sh:oneOrMorePath ; + sh:minCount 1 ; + sh:maxCount 1 ; + ] + ] + [ sh:nodeKind sh:BlankNode ; # 2.3.1.7: Zero-or-one path + sh:closed true ; + sh:property [ + sh:path sh:zeroOrOnePath ; + sh:minCount 1 ; + sh:maxCount 1 ; + ] + ] + ) . + +shsh:PathListWithAtLeast2Members + a sh:NodeShape ; + sh:node shsh:ListShape ; + sh:property [ + sh:path [ sh:oneOrMorePath rdf:rest ] ; + sh:minCount 2 ; # 1 other list node plus rdf:nil + ] . + +shsh:ShapesGraphShape + a sh:NodeShape ; + sh:targetObjectsOf sh:shapesGraph ; + sh:nodeKind sh:IRI . # shapesGraph-nodeKind + +shsh:EntailmentShape + a sh:NodeShape ; + sh:targetObjectsOf sh:entailment ; + sh:nodeKind sh:IRI . # entailment-nodeKind + diff --git a/src/main/resources/shapes/rml-cc/tests.py b/src/main/resources/shapes/rml-cc/tests.py new file mode 100755 index 00000000..91dfdde8 --- /dev/null +++ b/src/main/resources/shapes/rml-cc/tests.py @@ -0,0 +1,76 @@ +#!/usr/bin/env python +# +# (c) Dylan Van Assche (2020 - 2023) +# IDLab - Ghent University - imec +# MIT license +# + +import os +import argparse +import unittest +import logging +from parameterized import parameterized +from glob import glob +from rdflib import Graph + +from mapping_validator import MappingValidator + +TEST_CASES_DIR = os.path.join(os.path.abspath('../test-cases'), + '*/mapping.ttl') +CC_SHAPE_FILE = os.path.abspath('cc.ttl') +SHACL_SHAPE_FILE = os.path.abspath('shacl.ttl') + + +class MappingValidatorTests(unittest.TestCase): + def _validate_rules(self, path: str) -> None: + rules = Graph().parse(path, format='turtle') + mapping_validator = MappingValidator(CC_SHAPE_FILE) + mapping_validator.validate(rules) + + def _validate_shapes(self, path: str) -> None: + rules = Graph().parse(path, format='turtle') + mapping_validator = MappingValidator(SHACL_SHAPE_FILE) + mapping_validator.validate(rules) + + def test_non_existing_mapping_rules(self) -> None: + with self.assertRaises(FileNotFoundError): + p = os.path.abspath('does_not_exist.ttl') + self._validate_rules(p) + + @parameterized.expand([(p,) for p in sorted(glob(TEST_CASES_DIR))], + skip_on_empty=True) + def test_validation_rules(self, path: str) -> None: + """ + Test if our SHACL shapes are able to validate our validation mapping + rules test cases. + """ + print(f'Testing validation with: {path}') + self._validate_rules(path) + + def test_validation_shapes(self) -> None: + """ + Test if our SHACL shapes are valid according to the W3C Recommdendation + of SHACL. Validation with the official SHACL shapes for SHACL. + + See https://www.w3.org/TR/shacl/#shacl-shacl + """ + path = './cc.ttl' + print(f'Testing shape with: {path}') + self._validate_shapes(path) + + +if __name__ == '__main__': + parser = argparse.ArgumentParser(description='Execute tests for SHACL ' + 'shapes on RML mapping rules.') + parser.add_argument('--verbose', '-v', action='count', default=1, + help='Set verbosity level of messages. Example: -vvv') + args = parser.parse_args() + + args.verbose = 70 - (10 * args.verbose) if args.verbose > 0 else 0 + logging.basicConfig(level=args.verbose, + format='%(asctime)s %(levelname)s: %(message)s', + datefmt='%Y-%m-%d %H:%M:%S') + + print(TEST_CASES_DIR) + unittest.main(failfast=True) + diff --git a/src/main/resources/shapes/rml-core/README.md b/src/main/resources/shapes/rml-core/README.md new file mode 100644 index 00000000..54f12392 --- /dev/null +++ b/src/main/resources/shapes/rml-core/README.md @@ -0,0 +1,7 @@ +# SHACL shapes for RML mapping rules + +SHACL shapes to validate RML mapping rules. + +## License + +This code is copyrighted by [IDLab – Ghent University – imec](http://idlab.ugent.be/) and released under the [MIT license](http://opensource.org/licenses/MIT). diff --git a/src/main/resources/shapes/rml-core/child_map.ttl b/src/main/resources/shapes/rml-core/child_map.ttl new file mode 100644 index 00000000..a867cea4 --- /dev/null +++ b/src/main/resources/shapes/rml-core/child_map.ttl @@ -0,0 +1,46 @@ +############################################################################### +# RML Child Map shape # +# Copyright Dylan Van Assche, IDLab - UGent - imec (2023 - 2024) # +############################################################################### +@prefix sh: . +@prefix rdfs: . +@prefix : . +@prefix rdf: . +@prefix rml: . +@prefix xsd: . + +:RMLChildMapShape + a sh:NodeShape ; + sh:targetClass rml:ChildMap ; + sh:targetObjectsOf rml:childMap ; + rdfs:label "ChildMap" ; + rdfs:comment """ + Represents a Child Map. + """ ; + sh:message """ + rml:ChildMap must specify a literal referencing data in the child data + source. + """ ; + + sh:and ( + # Inherited shapes + :RMLExpressionMapShape + # Child Map specific shapes + [ + ] + ) ; +. + +:RMLchildShape + a sh:NodeShape ; + sh:targetObjectsOf rml:child ; + rdfs:label "child" ; + rdfs:comment """ + A Literal reference to use as reference to the child data source. + """ ; + sh:message """ + rml:child shortcut for rml:ChildMap must be a Literal. + """ ; + sh:nodeKind sh:Literal ; + sh:datatype xsd:string ; +. diff --git a/src/main/resources/shapes/rml-core/core.ttl b/src/main/resources/shapes/rml-core/core.ttl new file mode 100644 index 00000000..75df2895 --- /dev/null +++ b/src/main/resources/shapes/rml-core/core.ttl @@ -0,0 +1,784 @@ +@prefix brick: . +@prefix csvw: . +@prefix dc: . +@prefix dcam: . +@prefix dcat: . +@prefix dcmitype: . +@prefix dcterms: . +@prefix doap: . +@prefix foaf: . +@prefix geo: . +@prefix odrl: . +@prefix org: . +@prefix owl: . +@prefix prof: . +@prefix prov: . +@prefix qb: . +@prefix rdf: . +@prefix rdfs: . +@prefix rml: . +@prefix schema: . +@prefix sh: . +@prefix skos: . +@prefix sosa: . +@prefix ssn: . +@prefix time: . +@prefix vann: . +@prefix void: . +@prefix wgs: . +@prefix xml: . +@prefix xsd: . + + a sh:NodeShape ; + rdfs:label "ChildMap" ; + rdfs:comment """ + Represents a Child Map. + """ ; + sh:and ( [ ] ) ; + sh:message """ + rml:ChildMap must specify a literal referencing data in the child data + source. + """ ; + sh:targetClass ; + sh:targetObjectsOf . + + a sh:NodeShape ; + rdfs:label "DatatypeMap" ; + rdfs:comment """ + Represents a Datatype Map. + """ ; + sh:and ( [ ] ) ; + sh:message """ + rml:DatatypeMap must specify an rml:template, rml:reference, or rml:constant + with the IRI of the datatype. + """ ; + sh:targetClass rml:DatatypeMap ; + sh:targetObjectsOf rml:datatypeMap . + + a sh:NodeShape ; + rdfs:label "GraphMap" ; + rdfs:comment """ + Represents a Graph Map. + """ ; + sh:and ( [ sh:in ( rml:IRI rml:UnsafeIRI rml:URI rml:UnsafeURI rml:BlankNode ) ; + sh:message """ + rml:termType must be an rml:IRI, rml:UnsafeIRI, rml:URI, + rml:UnsafeURI, or rml:BlankNode for a Graph Map. + """ ; + sh:path rml:termType ] ) ; + sh:message """ + rml:GraphMap must specify an rml:template, rml:reference or rml:constant + with the IRI of the Named Graph. + """ ; + sh:targetClass rml:GraphMap ; + sh:targetObjectsOf rml:graphMap . + + a sh:NodeShape ; + rdfs:label "Join" ; + rdfs:comment """ + Represents a Join. + """ ; + sh:message """ + rml:Join must specify exactly one rml:parent/rml:parentMap + and rml:child/rml:childMap. + """ ; + sh:property [ rdfs:label "parentMap/parent" ; + rdfs:comment """ + rml:parent/rml:parentMap may only be provided once and + not at the same time. + """ ; + sh:maxCount 1 ; + sh:minCount 1 ; + sh:path [ sh:alternativePath ( rml:parentMap rml:parent ) ] ], + [ rdfs:label "childMap" ; + rdfs:comment """ + Specifies the child of the object component for joining. + """ ; + sh:message """ + rml:childMap must point to a rml:ChildMap specifying the + child of the Literal. + """ ; + sh:nodeKind sh:BlankNodeOrIRI ; + sh:path rml:childMap ; + sh:targetSubjectsOf rml:childMap ], + [ rdfs:label "child" ; + rdfs:comment """ + Specifies the child of the object component for joining. + """ ; + sh:nodeKind sh:Literal ; + sh:path rml:child ; + sh:targetSubjectsOf rml:child ], + [ rdfs:label "parentMap" ; + rdfs:comment """ + Specifies the parent of the object component for joining. + """ ; + sh:message """ + rml:parentMap must point to a rml:ParentMap specifying the + parent tag of the string Literal. + """ ; + sh:nodeKind sh:BlankNodeOrIRI ; + sh:path rml:parentMap ; + sh:targetSubjectsOf rml:parentMap ], + [ rdfs:label "parent" ; + rdfs:comment """ + Specifies the parent of the object component for joining. + """ ; + sh:nodeKind sh:Literal ; + sh:path rml:parent ; + sh:targetSubjectsOf rml:parent ], + [ rdfs:label "childMap/child" ; + rdfs:comment """ + rml:child/rml:childMap may only be provided once and + not at the same time. + """ ; + sh:maxCount 1 ; + sh:minCount 1 ; + sh:path [ sh:alternativePath ( rml:childMap rml:child ) ] ] ; + sh:targetClass rml:Join ; + sh:targetObjectsOf rml:joinCondition . + + a sh:NodeShape ; + rdfs:label "LanguageMap" ; + rdfs:comment """ + Represents a Language Map. + """ ; + sh:and ( [ sh:path rml:constant ; + sh:pattern "^((?:(en-GB-oed|i-ami|i-bnn|i-default|i-enochian|i-hak|i-klingon|i-lux|i-mingo|i-navajo|i-pwn|i-tao|i-tay|i-tsu|sgn-BE-FR|sgn-BE-NL|sgn-CH-DE)|(art-lojban|cel-gaulish|no-bok|no-nyn|zh-guoyu|zh-hakka|zh-min|zh-min-nan|zh-xiang))|((?:([A-Za-z]{2,3}(-(?:[A-Za-z]{3}(-[A-Za-z]{3}){0,2}))?)|[A-Za-z]{4})(-(?:[A-Za-z]{4}))?(-(?:[A-Za-z]{2}|[0-9]{3}))?(-(?:[A-Za-z0-9]{5,8}|[0-9][A-Za-z0-9]{3}))*(-(?:[0-9A-WY-Za-wy-z](-[A-Za-z0-9]{2,8})+))*(-(?:x(-[A-Za-z0-9]{1,8})+))?)|(?:x(-[A-Za-z0-9]{1,8})+))$" ] ) ; + sh:message """ + rml:LanguageMap must specify an rml:template, rml:reference, or rml:constant + with the BCP47 name of the language as string. + """ ; + sh:targetClass rml:LanguageMap ; + sh:targetObjectsOf rml:languageMap . + + a sh:NodeShape ; + rdfs:label "ParentMap" ; + rdfs:comment """ + Represents a Parent Map. + """ ; + sh:and ( [ ] ) ; + sh:message """ + rml:ParentMap must specify a literal referencing data in the parent data + source. + """ ; + sh:targetClass rml:ParentMap ; + sh:targetObjectsOf rml:parentMap . + + a sh:NodeShape ; + rdfs:label "PredicateMap" ; + rdfs:comment """ + Represents a Predicate Map. + """ ; + sh:and ( [ sh:in ( rml:IRI rml:UnsafeIRI rml:URI rml:UnsafeURI ) ; + sh:message """ + rml:termType for Predicate Map can only be a rml:IRI, rml:UnsafeIRI, + rml:URI, or rml:UnsafeURI; + """ ; + sh:path rml:termType ] ) ; + sh:message """ + Predicate Object Map must generate an IRI representing the predicate of an + RDF triple. + """ ; + sh:targetClass rml:PredicateMap ; + sh:targetObjectsOf rml:predicateMap . + + a sh:NodeShape ; + rdfs:label "PredicateObjectMap" ; + rdfs:comment """ + Represents a Predicate Object Map. + """ ; + sh:and ( [ rdfs:label "predicate/predicateMap" ; + rdfs:comment """ + At least one rml:predicate or rml:predicateMap must be provided. + """ ; + sh:message """ + At least one rml:predicate or rml:predicateMap must be provided. + """ ; + sh:minCount 1 ; + sh:path [ sh:alternativePath ( rml:predicate rml:predicateMap ) ] ; + sh:targetSubjectsOf rml:predicate, + rml:predicateMap ] [ rdfs:label "predicateMap" ; + rdfs:comment """ + A PredicateMap element to generate the predicate component of the + (predicate, object) pair from a logical table row or iterator. + """ ; + sh:message """ + rml:predicateMap must be an IRI or blank node and be provided once. + """ ; + sh:nodeKind sh:BlankNodeOrIRI ; + sh:path rml:predicateMap ; + sh:targetSubjectsOf rml:predicateMap ] [ rdfs:label "predicate" ; + rdfs:comment """ + Specifies the predicate for the generated triple from the logical table + row or iterator. + """ ; + sh:message """ + rml:predicate must be an IRI and be provided once. + """ ; + sh:nodeKind sh:IRI ; + sh:path rml:predicate ; + sh:targetSubjectsOf rml:predicate ] [ rdfs:label "object/objectMap/quotedTriplesMap" ; + rdfs:comment """ + Either an rml:object, rml:objectMap, or rml:quotedTriplesMap must be provided, not multiple. + """ ; + sh:message """ + Either an rml:object, rml:objectMap, or rml:quotedTriplesMap must be provided, not multiple + """ ; + sh:minCount 1 ; + sh:path [ sh:alternativePath ( rml:object rml:objectMap rml:quotedTriplesMap ) ] ; + sh:targetSubjectsOf rml:object, + rml:objectMap, + rml:quotedTriplesMap ] [ rdfs:label "objectMap" ; + rdfs:comment """ + An ObjectMap element to generate the object component of the + (predicate, object) pair from a logical table row or iterator. + """ ; + sh:message """ + rml:objectMap must be an IRI or blank node and be provided once. + """ ; + sh:nodeKind sh:BlankNodeOrIRI ; + sh:or ( [ sh:node ] [ sh:node ] [ sh:node ] ) ; + sh:path rml:objectMap ; + sh:targetSubjectsOf rml:objectMap ] [ rdfs:label "object" ; + rdfs:comment """ + Specifies the object for the generated RDF triples. + """ ; + sh:message """ + rml:object must be an IRI and be provided once. + """ ; + sh:path rml:object ; + sh:targetSubjectsOf rml:object ] ) ; + sh:targetClass rml:PredicateObjectMap ; + sh:targetObjectsOf rml:predicateObjectMap . + + a sh:NodeShape ; + rdfs:label "Strategy" ; + rdfs:comment """ + Strategy to follow when generating RDF triples. + """ ; + sh:in ( rml:append rml:cartesianProduct ) ; + sh:message """ + Strategy must be either rml:append or rml:cartesianProduct. + """ ; + sh:targetObjectsOf rml:strategy . + + a sh:NodeShape ; + rdfs:label "TriplesMap" ; + rdfs:comment """ + Represents a Triples Map. + """ ; + sh:and ( [ ] ) ; + sh:message """ + Triples Map requires exactly one rml:subject or one rml:subjectMap and zero + or more rml:predicateObjectMaps. + """ ; + sh:targetClass rml:TriplesMap ; + sh:targetObjectsOf rml:parentTriplesMap . + + a sh:NodeShape ; + rdfs:label "child" ; + rdfs:comment """ + A Literal reference to use as reference to the child data source. + """ ; + sh:datatype xsd:string ; + sh:message """ + rml:child shortcut for rml:ChildMap must be a Literal. + """ ; + sh:nodeKind sh:Literal ; + sh:targetObjectsOf . + + a sh:NodeShape ; + rdfs:label "datatype" ; + rdfs:comment """ + An IRI reference for use as the graph name of all triples generated with + the datatype. + """ ; + sh:message """ + rml:datatype must be an IRI. + """ ; + sh:nodeKind sh:IRI ; + sh:targetObjectsOf rml:datatype . + + a sh:NodeShape ; + rdfs:label "graph" ; + rdfs:comment """ + An IRI reference for use as the graph name of all triples generated with + the Graph Map. + """ ; + sh:message """ + rml:graph must be an IRI or blank node. + """ ; + sh:nodeKind sh:BlankNodeOrIRI ; + sh:targetObjectsOf rml:graph . + + a sh:NodeShape ; + rdfs:label "language" ; + rdfs:comment """ + Specified the language for the generated Literal. + """ ; + sh:message """ + rml:language must be a valid language tag according to BCP47 and may + only be provided once as string. + """ ; + sh:nodeKind sh:Literal ; + sh:pattern "^((?:(en-GB-oed|i-ami|i-bnn|i-default|i-enochian|i-hak|i-klingon|i-lux|i-mingo|i-navajo|i-pwn|i-tao|i-tay|i-tsu|sgn-BE-FR|sgn-BE-NL|sgn-CH-DE)|(art-lojban|cel-gaulish|no-bok|no-nyn|zh-guoyu|zh-hakka|zh-min|zh-min-nan|zh-xiang))|((?:([A-Za-z]{2,3}(-(?:[A-Za-z]{3}(-[A-Za-z]{3}){0,2}))?)|[A-Za-z]{4})(-(?:[A-Za-z]{4}))?(-(?:[A-Za-z]{2}|[0-9]{3}))?(-(?:[A-Za-z0-9]{5,8}|[0-9][A-Za-z0-9]{3}))*(-(?:[0-9A-WY-Za-wy-z](-[A-Za-z0-9]{2,8})+))*(-(?:x(-[A-Za-z0-9]{1,8})+))?)|(?:x(-[A-Za-z0-9]{1,8})+))$" ; + sh:targetObjectsOf rml:language . + + a sh:NodeShape ; + rdfs:label "object" ; + rdfs:comment """ + An IRI, Blank Node, or Literal to use as object for all the RDF triples. + """ ; + sh:message """ + rml:object shortcut for rml:objectMap must be an IRI, Blank Node, + or Literal. + """ ; + sh:targetObjectsOf rml:object . + + a sh:NodeShape ; + rdfs:label "parent" ; + rdfs:comment """ + A Literal reference to use as reference to the parent data source. + """ ; + sh:datatype xsd:string ; + sh:message """ + rml:parent shortcut for rml:ParentMap must be a Literal. + """ ; + sh:nodeKind sh:Literal ; + sh:targetObjectsOf rml:parent . + + a sh:NodeShape ; + rdfs:label "predicate" ; + rdfs:comment """ + Specifies the predicate for the generated triple. + """ ; + sh:message """ + rml:predicate must be an IRI. + """ ; + sh:nodeKind sh:IRI ; + sh:targetObjectsOf rml:predicate . + + a sh:NodeShape ; + rdfs:label "subject" ; + rdfs:comment """ + An IRI reference to use as subject for all the RDF triples. + """ ; + sh:message """ + rml:subject shortcut for rml:SubjectMap must be a IRI or BlankNode. + """ ; + sh:nodeKind sh:BlankNodeOrIRI ; + sh:targetObjectsOf rml:subject . + + a sh:NodeShape ; + rdfs:label "Abstract Logical Source" ; + rdfs:comment """ + A sub-class of iterable that can be associated with a triples map such that a data source can be mapped to RDF triples. + """ ; + sh:message """ + rml:AbstractLogicalSource must specify how to generate logical iterations on a data source for a triples map. + """ ; + sh:node ; + sh:targetClass rml:AbstractLogicalSource ; + sh:targetObjectsOf rml:logicalSource . + + a sh:NodeShape ; + rdfs:label "Iterable" ; + rdfs:comment """ + An abstract construct to describe data access and iteration for a data source. + """ ; + sh:message """ + Iterable must specify how to generate logical iterations on a data source. + """ ; + sh:property [ rdfs:label "rml:referenceFormulation" ; + rdfs:comment """ + The reference formulation (rml:referenceFormulation) defines how to + reference to elements of the data of the input source. + """ ; + sh:maxCount 1 ; + sh:message """ + rml:referenceFormulation must be a blank node or IRI specifying the + reference formulation on how to reference elements of a data source, + and may be provided at most once. + """ ; + sh:nodeKind sh:BlankNodeOrIRI ; + sh:path rml:referenceFormulation ], + [ rdfs:label "rml:iterator" ; + rdfs:comment """ + The logical iterator (rml:iterator) defines the iteration loop used to + map the data of the input source. Depends on the reference formulation + if an iterator is necessary. + """ ; + sh:maxCount 1 ; + sh:message """ + rml:iterator specifies the iterator to iterate over + the data source, and may be provided at most once. + """ ; + sh:path rml:iterator ] ; + sh:targetClass rml:Iterable . + + a sh:PropertyShape ; + rdfs:label "joinCondition" ; + rdfs:comment """ + Specifies the join condition for joining a child data source with + a parent data source of the foreign key constraint. + """ ; + sh:message """ + rml:joinCondition must specify an rml:parent and rml:child. + """ ; + sh:nodeKind sh:BlankNodeOrIRI ; + sh:path rml:joinCondition ; + sh:targetSubjectsOf rml:joinCondition . + + a sh:NodeShape ; + rdfs:label "ObjectMap" ; + rdfs:comment """ + Represents an Object Map. + """ ; + sh:and ( [ rdfs:label "languageMap/datatypeMap/language/datatype" ; + rdfs:comment """ + rml:language/rml:languageMap and rml:datatype/rml:datatypeMap + may only be provided once and not at the same time. + """ ; + sh:maxCount 1 ; + sh:minCount 0 ; + sh:path [ sh:alternativePath ( rml:languageMap rml:datatypeMap rml:language rml:datatype ) ] ] [ rdfs:label "languageMap" ; + rdfs:comment """ + Specified the language map for the object component for the + generated RDF triples. + """ ; + sh:message """ + rml:languageMap must point to a rml:LanguageMap specifying the + language tag of the string Literal. + """ ; + sh:nodeKind sh:BlankNodeOrIRI ; + sh:path rml:languageMap ; + sh:targetSubjectsOf rml:languageMap ] [ rdfs:label "datatypeMap" ; + rdfs:comment """ + Specifies the datatype of the object component for the generated + RDF triples. + """ ; + sh:message """ + rml:datatypeMap must point to a rml:DatatypeMap specifying the + datatype of the Literal. + """ ; + sh:nodeKind sh:BlankNodeOrIRI ; + sh:path rml:datatypeMap ; + sh:targetSubjectsOf rml:datatypeMap ] [ rdfs:label "language" ; + rdfs:comment """ + Language tag for the object. + """ ; + sh:nodeKind sh:Literal ; + sh:path rml:language ] [ rdfs:label "datatype" ; + rdfs:comment """ + Datatype for the object. + """ ; + sh:nodeKind sh:IRI ; + sh:path rml:datatype ; + sh:targetSubjectsOf rml:datatype ] ) ; + sh:message """ + Object Map must generate a IRI, Blank Node, or Literal which has optionally + a language tag or datatype. + """ ; + sh:targetClass rml:ObjectMap . + + a sh:NodeShape ; + rdfs:label "RefObjectMap" ; + rdfs:comment """ + Represents a Reference Object Map. + """ ; + sh:and ( [ rdfs:label "parentTriplesMap" ; + rdfs:comment """ + Specifies the Triples Map element corresponding to the parent data + source of the foreign key constraint. + """ ; + sh:class rml:TriplesMap ; + sh:maxCount 1 ; + sh:message """ + rml:parentTriplesMap may only be provided once and must be an IRI + or Blank Node referring to a Triples Map. + """ ; + sh:minCount 1 ; + sh:nodeKind sh:BlankNodeOrIRI ; + sh:path rml:parentTriplesMap ; + sh:targetSubjectsOf rml:parentTriplesMap ] ) ; + sh:message """ + rml:RefObjectMap must specify a rml:parentTriplesMap and zero or more + rml:joinConditions. + """ ; + sh:targetClass rml:RefObjectMap . + + a sh:NodeShape ; + rdfs:label "SubjectMap" ; + rdfs:comment """ + Represents a Subject Map. + """ ; + sh:and ( [ rdfs:label "class" ; + rdfs:comment """ + The subject value generated will be asserted as an instance of this + RDFS class. + """ ; + sh:message """ + rml:class must be an IRI and may be specified multiple times. + """ ; + sh:nodeKind sh:IRI ; + sh:path rml:class ; + sh:targetSubjectsOf rml:class ] [ sh:in ( rml:IRI rml:UnsafeIRI rml:URI rml:UnsafeURI rml:BlankNode ) ; + sh:message """ + rml:termType must be a rml:IRI, rml:UnsafeIRI, rml:URI, + rml:UnsafeURI, or rml:BlankNode for a Subject Map. + """ ; + sh:path rml:termType ] ) ; + sh:message """ + Subject Map must generate a resource representing the subject of + an RDF triple. + """ ; + sh:targetClass rml:SubjectMap ; + sh:targetObjectsOf rml:subjectMap . + + a sh:NodeShape ; + sh:property [ rdfs:label "logicalSource" ; + rdfs:comment """ + A logical source is any source that is mapped to RDF triples. + """ ; + sh:maxCount 1 ; + sh:message """ + Exactly one rml:logicalSource is required to access the data source. + """ ; + sh:minCount 1 ; + sh:node ; + sh:nodeKind sh:BlankNodeOrIRI ; + sh:path rml:logicalSource ; + sh:targetSubjectsOf rml:logicalSource ], + [ rdfs:label "subject" ; + rdfs:comment """ + An IRI reference for use as subject for all generated RDF triples. + """ ; + sh:message """ + rml:subject must be an IRI or blank node. + """ ; + sh:nodeKind sh:BlankNodeOrIRI ; + sh:path rml:subject ; + sh:targetSubjectsOf rml:subject ], + [ rdfs:label "predicateObjectMap" ; + rdfs:comment """ + A Predicate Object Map element to generate a (predicate, object) pair. + """ ; + sh:message """ + rml:PredicateObjectMap must be an IRI or blank node. + """ ; + sh:minCount 0 ; + sh:nodeKind sh:BlankNodeOrIRI ; + sh:path rml:predicateObjectMap ; + sh:targetSubjectsOf rml:predicateObjectMap ], + [ sh:description """ + Base IRI to use for generating RDF triples or quads. + """ ; + sh:maxCount 1 ; + sh:message """ + rml:baseIRI must be an IRI. + """ ; + sh:minCount 0 ; + sh:nodeKind sh:IRI ; + sh:path rml:baseIRI ], + [ rdfs:label "subjectMap/subject/quotedTriplesMap" ; + rdfs:comment """ + Either a rml:subject, rml:subjectMap or a rml:quotedTriplesMap is required, not multiple. + """ ; + sh:maxCount 1 ; + sh:message """ + Either a rml:subject, rml:subjectMap or a rml:quotedTriplesMap is required, not multiple. + """ ; + sh:minCount 1 ; + sh:path [ sh:alternativePath ( rml:subjectMap rml:subject rml:quotedTriplesMap ) ] ; + sh:targetSubjectsOf rml:quotedTriplesMap, + rml:subject, + rml:subjectMap ], + [ rdfs:label "subjectMap" ; + rdfs:comment """ + A Subject Map element to generate a subject for generated RDF triples. + """ ; + sh:message """ + rml:SubjectMap must be an IRI or blank node. + """ ; + sh:nodeKind sh:BlankNodeOrIRI ; + sh:or ( [ sh:node ] [ sh:node ] ) ; + sh:path rml:subjectMap ; + sh:targetSubjectsOf rml:subjectMap ] ; + sh:targetClass rml:NonAssertedTriplesMap, + rml:TriplesMap . + + a sh:NodeShape ; + sh:property [ rdfs:label "graph/graphMap" ; + rdfs:comment """ + Either an rml:graph or rml:graphMap may be optionally be provided, + but not both. + """ ; + sh:maxCount 1 ; + sh:message """ + Either an rml:graph or rml:graphMap may be optionally be provided, + but not both. + """ ; + sh:minCount 0 ; + sh:path [ sh:alternativePath ( rml:graph rml:graphMap ) ] ], + [ rdfs:label "graphMap" ; + rdfs:comment """ + Specifies a Graph Map. When used with a Subject Map element, all the + RDF triples generated will be stored in the specified named graph. + Otherwise, the RDF triple generated using the (predicate, object) + pair will be stored in the specified named graph. + """ ; + sh:message """ + rml:graphMap must be either an IRI or blank node. + """ ; + sh:nodeKind sh:BlankNodeOrIRI ; + sh:path rml:graphMap ], + [ rdfs:label "graph" ; + rdfs:comment """ + An IRI reference to use as the named graph of all generated triples. + """ ; + sh:message """ + rml:graphMap must be an IRI. + """ ; + sh:nodeKind sh:IRI ; + sh:path rml:graph ] ; + sh:targetSubjectsOf rml:graph, + rml:graphMap . + + a sh:NodeShape . + + a sh:NodeShape ; + rdfs:label "TermMap" ; + rdfs:comment """ + Represents a Term Map. + """ ; + sh:and ( [ rdfs:label "termType" ; + rdfs:comment """ + An IRI indicating whether a generated term should be an IRI, + Blank Node, or a Literal. + """ ; + sh:in ( rml:IRI rml:UnsafeIRI rml:URI rml:UnsafeURI rml:Literal rml:BlankNode ) ; + sh:maxCount 1 ; + sh:message """ + rml:termType must be either rml:IRI, rml:UnsafeIRI, + rml:URI, rml:UnsafeURI, rml:Literal, or rml:BlankNode for a Term Map. + May only be provided once. + """ ; + sh:nodeKind sh:IRI ; + sh:path rml:termType ; + sh:targetSubjectsOf rml:termType ] ) ; + sh:message """ + Term Map is an Expression Map with optionally a term type specified. + """ . + + a sh:NodeShape ; + rdfs:label "ExpressionMap" ; + rdfs:comment """ + Represents a Expression Map. + """ ; + sh:message """ + Expression Map may require one rml:template or one rml:constant or one + rml:reference. + """ ; + sh:or ( [ sh:not [ sh:property [ sh:minCount 1 ; + sh:path rml:returnMap ] ] ] [ sh:property [ sh:maxCount 1 ; + sh:minCount 1 ; + sh:path rml:returnMap ], + [ sh:maxCount 1 ; + sh:minCount 1 ; + sh:path rml:functionExecution ] ] ) ; + sh:property [ rdfs:label "template/constant/reference/functionExecution" ; + rdfs:comment """ + Only one rml:template, one rml:constant, one rml:reference, + or one rml:functionExecution is allowed. rml:returnMap is only allowed if rml:functionExecution is present. + """ ; + sh:maxCount 1 ; + sh:message """ + Exactly one rml:template, one rml:constant, one rml:reference, + one rml:returnMap, or one rml:functionExecution is required. + """ ; + sh:path [ sh:alternativePath ( rml:template rml:constant rml:reference rml:functionExecution ) ] ; + sh:targetSubjectsOf rml:constant, + rml:functionExecution, + rml:reference, + rml:template ], + [ rdfs:label "returnMap" ; + rdfs:comment """ + A Return Map rml:returnMap is used to define the return values of a FnO + function from the RML-FNML specification. RML Core only validates if the + property is present and has the right node kind. The actual validation + happens with RML-FNML SHACL shapes. + """ ; + sh:message """ + rml:returnMap must be an IRI; + """ ; + sh:nodeKind sh:BlankNodeOrIRI ; + sh:path rml:returnMap ; + sh:targetSubjectsOf rml:returnMap ], + [ rdfs:label "functionExecution" ; + rdfs:comment """ + A Function Execution rml:functionExecution is used to define the FnO + function to execute from the RML-FNML specification. RML Core only + validates if the property is present and has the right node kind. + The actual validation happens with RML-FNML SHACL shapes. + """ ; + sh:message """ + rml:functionExecution must be an IRI; + """ ; + sh:nodeKind sh:BlankNodeOrIRI ; + sh:path rml:functionExecution ; + sh:targetSubjectsOf rml:functionExecution ], + [ rdfs:label "template" ; + rdfs:comment """ + A template (format string) to specify how to generate a value for a + subject, predicate, or object, using one or more columns from a logical + table row or iterator. + """ ; + sh:datatype xsd:string ; + sh:message """ + rml:template must be a string. + """ ; + sh:nodeKind sh:Literal ; + sh:path rml:template ], + [ rdfs:label "constant" ; + rdfs:comment """ + A property for indicating whether a term map is a constant-valued term + map. + """ ; + sh:message """ + rml:constant must be an IRI or Literal. + """ ; + sh:path rml:constant ; + sh:targetSubjectsOf rml:constant ], + [ rdfs:label "reference" ; + rdfs:comment """ + A reference rml:reference is used to refer to a column in case of + databases, a record in case of CSV or TSV data source, an element in + case of XML data source, an object in case of a JSON data source, etc. + + A reference must be a valid identifier, considering the reference + formulation (rml:referenceFormulation) specified. The reference can be + an absolute path, or a path relative to the iterator specified at the + logical source. + """ ; + sh:datatype xsd:string ; + sh:message """ + rml:reference must be a string. + """ ; + sh:nodeKind sh:Literal ; + sh:path rml:reference ; + sh:targetSubjectsOf rml:reference ] . + + a sh:PropertyShape ; + rdfs:label "logicalTarget" ; + rdfs:comment """ + A logical target is any target to where generated RDF triples are + exported to. + """ ; + sh:message """ + Zero or more rml:logicalTarget is required to export RDF triples. + """ ; + sh:minCount 0 ; + sh:nodeKind sh:BlankNodeOrIRI ; + sh:path rml:logicalTarget ; + sh:targetSubjectsOf rml:logicalTarget . + diff --git a/src/main/resources/shapes/rml-core/datatype_map.ttl b/src/main/resources/shapes/rml-core/datatype_map.ttl new file mode 100644 index 00000000..b56da668 --- /dev/null +++ b/src/main/resources/shapes/rml-core/datatype_map.ttl @@ -0,0 +1,47 @@ +############################################################################### +# RML Datatype Map and datatype shortcut shape # +# Copyright Dylan Van Assche, IDLab - UGent - imec (2023 - 2024) # +############################################################################### +@prefix sh: . +@prefix rdfs: . +@prefix : . +@prefix rdf: . +@prefix rml: . +@prefix xsd: . + +:RMLDatatypeMapShape + a sh:NodeShape ; + sh:targetClass rml:DatatypeMap ; + sh:targetObjectsOf rml:datatypeMap ; + rdfs:label "DatatypeMap" ; + rdfs:comment """ + Represents a Datatype Map. + """ ; + sh:message """ + rml:DatatypeMap must specify an rml:template, rml:reference, or rml:constant + with the IRI of the datatype. + """ ; + + sh:and ( + # Inherited shapes + :RMLExpressionMapShape + # Datatype Map specific shapes + [ + ] + ) ; +. + + +:RMLdatatypeShape + a sh:NodeShape ; + sh:targetObjectsOf rml:datatype ; + rdfs:label "datatype" ; + rdfs:comment """ + An IRI reference for use as the graph name of all triples generated with + the datatype. + """ ; + sh:message """ + rml:datatype must be an IRI. + """ ; + sh:nodeKind sh:IRI ; +. diff --git a/src/main/resources/shapes/rml-core/expression_map.ttl b/src/main/resources/shapes/rml-core/expression_map.ttl new file mode 100644 index 00000000..35e23dbe --- /dev/null +++ b/src/main/resources/shapes/rml-core/expression_map.ttl @@ -0,0 +1,159 @@ +############################################################################### +# RML Expression Map shape # +# Copyright Dylan Van Assche, IDLab - UGent - imec (2023 - 2024) # +############################################################################### +@prefix sh: . +@prefix rdfs: . +@prefix : . +@prefix rdf: . +@prefix rml: . +@prefix xsd: . + +:RMLExpressionMapShape + a sh:NodeShape ; + rdfs:label "ExpressionMap" ; + rdfs:comment """ + Represents a Expression Map. + """ ; + sh:message """ + Expression Map may require one rml:template or one rml:constant or one + rml:reference. + """ ; + + # Exactly one rml:template, one rml:constant, one rml:reference, + # one rml:returnMap, or one rml:functionExecution is required. + sh:property [ + sh:targetSubjectsOf rml:template ; + sh:targetSubjectsOf rml:constant ; + sh:targetSubjectsOf rml:reference ; + sh:targetSubjectsOf rml:functionExecution ; + sh:path [sh:alternativePath (rml:template + rml:constant + rml:reference + rml:functionExecution)] ; + rdfs:label "template/constant/reference/functionExecution" ; + rdfs:comment """ + Only one rml:template, one rml:constant, one rml:reference, + or one rml:functionExecution is allowed. rml:returnMap is only allowed if rml:functionExecution is present. + """ ; + sh:message """ + Exactly one rml:template, one rml:constant, one rml:reference, + one rml:returnMap, or one rml:functionExecution is required. + """ ; + sh:maxCount 1 ; + ] ; + + # rml:template + sh:property [ + sh:path rml:template ; + rdfs:label "template" ; + rdfs:comment """ + A template (format string) to specify how to generate a value for a + subject, predicate, or object, using one or more columns from a logical + table row or iterator. + """ ; + sh:message """ + rml:template must be a string. + """ ; + sh:nodeKind sh:Literal ; + sh:datatype xsd:string ; + ] ; + + # rml:constant + sh:property [ + sh:targetSubjectsOf rml:constant ; + sh:path rml:constant ; + rdfs:label "constant" ; + rdfs:comment """ + A property for indicating whether a term map is a constant-valued term + map. + """ ; + sh:message """ + rml:constant must be an IRI or Literal. + """ ; + # Allow BlankNodes so ex:Student works as well for rml:constant + ] ; + + # rml:reference + sh:property [ + sh:targetSubjectsOf rml:reference ; + sh:path rml:reference ; + rdfs:label "reference" ; + rdfs:comment """ + A reference rml:reference is used to refer to a column in case of + databases, a record in case of CSV or TSV data source, an element in + case of XML data source, an object in case of a JSON data source, etc. + + A reference must be a valid identifier, considering the reference + formulation (rml:referenceFormulation) specified. The reference can be + an absolute path, or a path relative to the iterator specified at the + logical source. + """ ; + sh:message """ + rml:reference must be a string. + """ ; + sh:nodeKind sh:Literal ; + sh:datatype xsd:string ; + ] ; + + # rml:returnMap + sh:property [ + sh:targetSubjectsOf rml:returnMap ; + sh:path rml:returnMap ; + rdfs:label "returnMap" ; + rdfs:comment """ + A Return Map rml:returnMap is used to define the return values of a FnO + function from the RML-FNML specification. RML Core only validates if the + property is present and has the right node kind. The actual validation + happens with RML-FNML SHACL shapes. + """ ; + sh:message """ + rml:returnMap must be an IRI; + """ ; + sh:nodeKind sh:BlankNodeOrIRI ; + # Allow BlankNodes so nested structurces works as well for rml:returnMap + ] ; + + # rml:functionExecution + sh:property [ + sh:targetSubjectsOf rml:functionExecution ; + sh:path rml:functionExecution ; + rdfs:label "functionExecution" ; + rdfs:comment """ + A Function Execution rml:functionExecution is used to define the FnO + function to execute from the RML-FNML specification. RML Core only + validates if the property is present and has the right node kind. + The actual validation happens with RML-FNML SHACL shapes. + """ ; + sh:message """ + rml:functionExecution must be an IRI; + """ ; + sh:nodeKind sh:BlankNodeOrIRI ; + # Allow BlankNodes so nested structurces works as well for rml:returnMap + ] ; + # If returnMap appears, then functionExecution must also appear + sh:or ( + + [ + sh:not [ + sh:property [ + sh:path rml:returnMap ; + sh:minCount 1 + ] + ] + ] + + [ + sh:property [ + sh:path rml:returnMap ; + sh:minCount 1 ; + sh:maxCount 1 + ] ; + sh:property [ + sh:path rml:functionExecution ; + sh:minCount 1 ; + sh:maxCount 1 + ] + ] + ) +. diff --git a/src/main/resources/shapes/rml-core/external_shapes.ttl b/src/main/resources/shapes/rml-core/external_shapes.ttl new file mode 100644 index 00000000..066b10e1 --- /dev/null +++ b/src/main/resources/shapes/rml-core/external_shapes.ttl @@ -0,0 +1,16 @@ +############################################################################### +# RML external resources shapes # +# Copyright Dylan Van Assche, IDLab - UGent - imec (2023) # +############################################################################### +@prefix sh: . +@prefix : . +@prefix rdf: . +@prefix rml: . +@prefix xsd: . + +# Shapes are defined in the corresponding repositories of each specification +# Provide their IRI as stub to allow validation in Core. + +:RMLStarMapShape + a sh:NodeShape; +. diff --git a/src/main/resources/shapes/rml-core/generate_shape.py b/src/main/resources/shapes/rml-core/generate_shape.py new file mode 100755 index 00000000..a480b204 --- /dev/null +++ b/src/main/resources/shapes/rml-core/generate_shape.py @@ -0,0 +1,79 @@ +#!/usr/bin/env python + +import argparse +import sys +from os import path +from glob import glob +from rdflib import Graph, Namespace +from rdflib.plugins.serializers.turtle import TurtleSerializer +from rdflib import plugin + +SUBSHAPE_FORMAT = 'turtle' +SUBSHAPE_GLOB_PATTERN = '*.ttl' +SHACL = Namespace('http://www.w3.org/ns/shacl#') +RML = Namespace('http://w3id.org/rml/') + + +class TurtleWithPrefixes(TurtleSerializer): + """ + A turtle serializer that always emits prefixes + Workaround for https://github.com/RDFLib/rdflib/issues/1048 + """ + roundtrip_prefixes = True # Undocumented, forces to write all prefixes + + +class ShapeGenerator: + """ + Generates a complete SHACL shape of all the SHACL subshapes. + Useful for using the shapes in the shacl.org Playground. + """ + def __init__(self, glob_pattern: str, rdf_format: str, + destination: str) -> None: + self._glob_pattern: str = glob_pattern + self._rdf_format: str = rdf_format + self._destination: str = destination + self._shape = Graph() + self._shape.bind('sh', SHACL) + self._shape.bind('rml', RML) + # Register TurtleWithPrefixes serializer as 'tortoise' format + plugin.register('tortoise', + plugin.Serializer, + 'generate_shape', + 'TurtleWithPrefixes') + + def generate(self) -> None: + """ + Generate a full shape from the sub shapes. + """ + print('Reading subshapes:') + for sub_shape in glob(self._glob_pattern): + if 'core' in sub_shape or 'shacl' in sub_shape: + continue + print(f"\t{sub_shape}") + g = Graph() + g.bind('sh', SHACL) + g.bind('rml', RML) + self._shape += g.parse(sub_shape, format=self._rdf_format) + + print(f'Writing shape to {self._destination}') + self._shape.serialize(destination=self._destination, format='tortoise') + + +if __name__ == '__main__': + p = argparse.ArgumentParser(description='Generate a complete SHACL shape ' + 'from the subshapes.') + p.add_argument('destination', type=str, help='Location to write the ' + 'complete SHACL shape as Turtle.') + # Arguments parsing + args = p.parse_args() + if not path.exists(args.destination): + print(f'{args.destination} file path does not exist!') + sys.exit(1) + + if path.isdir(args.destination): + args.destination = path.join(args.destination, 'core.ttl') + + # Generate shape + generator = ShapeGenerator(SUBSHAPE_GLOB_PATTERN, SUBSHAPE_FORMAT, + args.destination) + generator.generate() diff --git a/src/main/resources/shapes/rml-core/graph_map.ttl b/src/main/resources/shapes/rml-core/graph_map.ttl new file mode 100644 index 00000000..6b7d6912 --- /dev/null +++ b/src/main/resources/shapes/rml-core/graph_map.ttl @@ -0,0 +1,55 @@ +############################################################################### +# RML Graph Map and graph shortcut shape # +# Copyright Dylan Van Assche, IDLab - UGent - imec (2020 - 2024) # +############################################################################### +@prefix sh: . +@prefix rdfs: . +@prefix : . +@prefix rdf: . +@prefix rml: . +@prefix xsd: . + +:RMLGraphMapShape + a sh:NodeShape ; + sh:targetClass rml:GraphMap ; + sh:targetObjectsOf rml:graphMap ; + rdfs:label "GraphMap" ; + rdfs:comment """ + Represents a Graph Map. + """ ; + sh:message """ + rml:GraphMap must specify an rml:template, rml:reference or rml:constant + with the IRI of the Named Graph. + """ ; + + sh:and ( + # Inherited shapes + :RMLTermMapShape + :RMLLogicalTargetPropertiesShape + # Graph Map specific shapes + [ + sh:path rml:termType; + sh:message """ + rml:termType must be an rml:IRI, rml:UnsafeIRI, rml:URI, + rml:UnsafeURI, or rml:BlankNode for a Graph Map. + """; + sh:in (rml:IRI rml:UnsafeIRI rml:URI rml:UnsafeURI rml:BlankNode); + ] + ) ; +. + + +:RMLgraphShape + a sh:NodeShape ; + sh:targetObjectsOf rml:graph ; + rdfs:label "graph" ; + rdfs:comment """ + An IRI reference for use as the graph name of all triples generated with + the Graph Map. + """ ; + sh:message """ + rml:graph must be an IRI or blank node. + """ ; + # Allow blank nodes because SHACL sees ex:PersonGraph also as blank node. + sh:nodeKind sh:BlankNodeOrIRI ; +. diff --git a/src/main/resources/shapes/rml-core/iterable.ttl b/src/main/resources/shapes/rml-core/iterable.ttl new file mode 100644 index 00000000..7a81f3a8 --- /dev/null +++ b/src/main/resources/shapes/rml-core/iterable.ttl @@ -0,0 +1,65 @@ +@prefix sh: . +@prefix rdfs: . +@prefix : . +@prefix rdf: . +@prefix rml: . +@prefix xsd: . + +:RMLIterableShape + a sh:NodeShape ; + sh:targetClass rml:Iterable ; + rdfs:label "Iterable" ; + rdfs:comment """ + An abstract construct to describe data access and iteration for a data source. + """ ; + sh:message """ + Iterable must specify how to generate logical iterations on a data source. + """ ; + + # rml:referenceFormulation + sh:property [ + sh:path rml:referenceFormulation ; + rdfs:label "rml:referenceFormulation" ; + rdfs:comment """ + The reference formulation (rml:referenceFormulation) defines how to + reference to elements of the data of the input source. + """ ; + sh:message """ + rml:referenceFormulation must be a blank node or IRI specifying the + reference formulation on how to reference elements of a data source, + and may be provided at most once. + """ ; + sh:maxCount 1 ; + sh:nodeKind sh:BlankNodeOrIRI ; + ] ; + + # rml:iterator + sh:property [ + sh:path rml:iterator ; + rdfs:label "rml:iterator" ; + rdfs:comment """ + The logical iterator (rml:iterator) defines the iteration loop used to + map the data of the input source. Depends on the reference formulation + if an iterator is necessary. + """ ; + sh:message """ + rml:iterator specifies the iterator to iterate over + the data source, and may be provided at most once. + """ ; + sh:maxCount 1 + ] ; +. + +:RMLAbstractLogicalSourceShape + a sh:NodeShape ; + sh:targetClass rml:AbstractLogicalSource ; + sh:targetObjectsOf rml:logicalSource ; + rdfs:label "Abstract Logical Source" ; + rdfs:comment """ + A sub-class of iterable that can be associated with a triples map such that a data source can be mapped to RDF triples. + """ ; + sh:message """ + rml:AbstractLogicalSource must specify how to generate logical iterations on a data source for a triples map. + """ ; + sh:node :RMLIterableShape ; +. diff --git a/src/main/resources/shapes/rml-core/join.ttl b/src/main/resources/shapes/rml-core/join.ttl new file mode 100644 index 00000000..4e2dbf85 --- /dev/null +++ b/src/main/resources/shapes/rml-core/join.ttl @@ -0,0 +1,93 @@ +############################################################################### +# RML Join shape # +# Copyright Dylan Van Assche, IDLab - UGent - imec (2023i - 2024) # +############################################################################### +@prefix sh: . +@prefix rdfs: . +@prefix : . +@prefix rdf: . +@prefix rml: . +@prefix xsd: . + +:RMLJoinShape + a sh:NodeShape ; + sh:targetClass rml:Join ; + sh:targetObjectsOf rml:joinCondition ; + rdfs:label "Join" ; + rdfs:comment """ + Represents a Join. + """ ; + sh:message """ + rml:Join must specify exactly one rml:parent/rml:parentMap + and rml:child/rml:childMap. + """ ; + + sh:property [ + sh:path [ sh:alternativePath ( rml:parentMap rml:parent ) ]; + rdfs:label "parentMap/parent" ; + rdfs:comment """ + rml:parent/rml:parentMap may only be provided once and + not at the same time. + """ ; + sh:maxCount 1 ; + sh:minCount 1 ; + ] ; + sh:property [ + sh:targetSubjectsOf rml:parentMap ; + sh:path rml:parentMap ; + rdfs:label "parentMap" ; + rdfs:comment """ + Specifies the parent of the object component for joining. + """ ; + sh:message """ + rml:parentMap must point to a rml:ParentMap specifying the + parent tag of the string Literal. + """ ; + sh:nodeKind sh:BlankNodeOrIRI ; + ] ; + + sh:property [ + sh:targetSubjectsOf rml:parent ; + sh:path rml:parent ; + rdfs:label "parent" ; + rdfs:comment """ + Specifies the parent of the object component for joining. + """ ; + sh:nodeKind sh:Literal ; + ] ; + + sh:property [ + sh:path [ sh:alternativePath ( rml:childMap rml:child ) ]; + rdfs:label "childMap/child" ; + rdfs:comment """ + rml:child/rml:childMap may only be provided once and + not at the same time. + """ ; + sh:maxCount 1 ; + sh:minCount 1 ; + ] ; + + sh:property [ + sh:targetSubjectsOf rml:childMap ; + sh:path rml:childMap ; + rdfs:label "childMap" ; + rdfs:comment """ + Specifies the child of the object component for joining. + """ ; + sh:message """ + rml:childMap must point to a rml:ChildMap specifying the + child of the Literal. + """ ; + sh:nodeKind sh:BlankNodeOrIRI ; + ] ; + + sh:property [ + sh:targetSubjectsOf rml:child ; + sh:path rml:child ; + rdfs:label "child" ; + rdfs:comment """ + Specifies the child of the object component for joining. + """ ; + sh:nodeKind sh:Literal ; + ] ; +. diff --git a/src/main/resources/shapes/rml-core/language_map.ttl b/src/main/resources/shapes/rml-core/language_map.ttl new file mode 100644 index 00000000..6ed2369b --- /dev/null +++ b/src/main/resources/shapes/rml-core/language_map.ttl @@ -0,0 +1,50 @@ +############################################################################### +# RML Language Map and language shortcut shape # +# Copyright Dylan Van Assche, IDLab - UGent - imec (2023i - 2024) # +############################################################################### +@prefix sh: . +@prefix rdfs: . +@prefix : . +@prefix rdf: . +@prefix rml: . +@prefix xsd: . + +:RMLLanguageMapShape + a sh:NodeShape ; + sh:targetClass rml:LanguageMap ; + sh:targetObjectsOf rml:languageMap ; + rdfs:label "LanguageMap" ; + rdfs:comment """ + Represents a Language Map. + """ ; + sh:message """ + rml:LanguageMap must specify an rml:template, rml:reference, or rml:constant + with the BCP47 name of the language as string. + """ ; + + sh:and ( + # Inherited shapes + :RMLExpressionMapShape + # Language Map specific shapes + [ + sh:path rml:constant ; + sh:pattern "^((?:(en-GB-oed|i-ami|i-bnn|i-default|i-enochian|i-hak|i-klingon|i-lux|i-mingo|i-navajo|i-pwn|i-tao|i-tay|i-tsu|sgn-BE-FR|sgn-BE-NL|sgn-CH-DE)|(art-lojban|cel-gaulish|no-bok|no-nyn|zh-guoyu|zh-hakka|zh-min|zh-min-nan|zh-xiang))|((?:([A-Za-z]{2,3}(-(?:[A-Za-z]{3}(-[A-Za-z]{3}){0,2}))?)|[A-Za-z]{4})(-(?:[A-Za-z]{4}))?(-(?:[A-Za-z]{2}|[0-9]{3}))?(-(?:[A-Za-z0-9]{5,8}|[0-9][A-Za-z0-9]{3}))*(-(?:[0-9A-WY-Za-wy-z](-[A-Za-z0-9]{2,8})+))*(-(?:x(-[A-Za-z0-9]{1,8})+))?)|(?:x(-[A-Za-z0-9]{1,8})+))$" ; + ] + ) ; +. + + +:RMLlanguageShape + a sh:NodeShape ; + sh:targetObjectsOf rml:language ; + rdfs:label "language" ; + rdfs:comment """ + Specified the language for the generated Literal. + """ ; + sh:message """ + rml:language must be a valid language tag according to BCP47 and may + only be provided once as string. + """ ; + sh:pattern "^((?:(en-GB-oed|i-ami|i-bnn|i-default|i-enochian|i-hak|i-klingon|i-lux|i-mingo|i-navajo|i-pwn|i-tao|i-tay|i-tsu|sgn-BE-FR|sgn-BE-NL|sgn-CH-DE)|(art-lojban|cel-gaulish|no-bok|no-nyn|zh-guoyu|zh-hakka|zh-min|zh-min-nan|zh-xiang))|((?:([A-Za-z]{2,3}(-(?:[A-Za-z]{3}(-[A-Za-z]{3}){0,2}))?)|[A-Za-z]{4})(-(?:[A-Za-z]{4}))?(-(?:[A-Za-z]{2}|[0-9]{3}))?(-(?:[A-Za-z0-9]{5,8}|[0-9][A-Za-z0-9]{3}))*(-(?:[0-9A-WY-Za-wy-z](-[A-Za-z0-9]{2,8})+))*(-(?:x(-[A-Za-z0-9]{1,8})+))?)|(?:x(-[A-Za-z0-9]{1,8})+))$" ; + sh:nodeKind sh:Literal ; +. diff --git a/src/main/resources/shapes/rml-core/mapping_validator.py b/src/main/resources/shapes/rml-core/mapping_validator.py new file mode 100755 index 00000000..dabb1d24 --- /dev/null +++ b/src/main/resources/shapes/rml-core/mapping_validator.py @@ -0,0 +1,40 @@ +from logging import debug, info, critical +from pyshacl import validate +from rdflib import Graph +from shutil import get_terminal_size + + +class MappingValidator: + def __init__(self, shape: str) -> None: + g = Graph() + g.parse(shape, format='turtle') + self._shape = g + + def validate(self, rules: Graph, print_report: bool = True) -> None: + valid: bool + report_graph: Graph + report_text: str + valid, report_graph, report_text = validate(rules, + shacl_graph=self._shape) + debug(f'RML rules valid: {valid}') + debug(f'SHACL validation report: {report_text}') + + # If mapping rules are invalid, print SHACL report and raise exception + if not valid and print_report: + self._print_report(report_text) + msg = 'RML mapping rules are invalid, a detailed explanation' \ + ' is available in the report' + critical(msg) + raise ValueError(msg) + + def _print_report(self, report_text: str) -> None: + tty_columns: int + tty_columns, _ = get_terminal_size() + info('-' * tty_columns) + title: str = 'RML rules validation report' + white_space: int = int((tty_columns - len(title)) / 2) + title = ' ' * white_space + title + ' ' * white_space + info(title) + info('-' * tty_columns) + info(report_text) + info('-' * tty_columns) diff --git a/src/main/resources/shapes/rml-core/object_map.ttl b/src/main/resources/shapes/rml-core/object_map.ttl new file mode 100644 index 00000000..e10ae138 --- /dev/null +++ b/src/main/resources/shapes/rml-core/object_map.ttl @@ -0,0 +1,100 @@ +############################################################################### +# RML Object Map and object shortcut shape # +# Copyright Dylan Van Assche, IDLab - UGent - imec (2020 - 2024) # +############################################################################### +@prefix sh: . +@prefix rdfs: . +@prefix : . +@prefix rdf: . +@prefix rml: . +@prefix xsd: . + +:RMLObjectMapShape + a sh:NodeShape ; + sh:targetClass rml:ObjectMap ; + rdfs:label "ObjectMap" ; + rdfs:comment """ + Represents an Object Map. + """ ; + sh:message """ + Object Map must generate a IRI, Blank Node, or Literal which has optionally + a language tag or datatype. + """ ; + + sh:and ( + # Inherited shapes + :RMLTermMapShape + :RMLLogicalTargetPropertiesShape + # Object Map specific shapes + [ + sh:path [ sh:alternativePath (rml:languageMap rml:datatypeMap + rml:language rml:datatype) ] ; + rdfs:label "languageMap/datatypeMap/language/datatype" ; + rdfs:comment """ + rml:language/rml:languageMap and rml:datatype/rml:datatypeMap + may only be provided once and not at the same time. + """ ; + sh:maxCount 1 ; + sh:minCount 0 ; + ] + [ + sh:path rml:languageMap ; + sh:targetSubjectsOf rml:languageMap ; + rdfs:label "languageMap" ; + rdfs:comment """ + Specified the language map for the object component for the + generated RDF triples. + """ ; + sh:message """ + rml:languageMap must point to a rml:LanguageMap specifying the + language tag of the string Literal. + """ ; + sh:nodeKind sh:BlankNodeOrIRI ; + ] + [ + sh:path rml:datatypeMap ; + sh:targetSubjectsOf rml:datatypeMap ; + rdfs:label "datatypeMap" ; + rdfs:comment """ + Specifies the datatype of the object component for the generated + RDF triples. + """ ; + sh:message """ + rml:datatypeMap must point to a rml:DatatypeMap specifying the + datatype of the Literal. + """ ; + sh:nodeKind sh:BlankNodeOrIRI ; + ] + [ + sh:path rml:language ; + rdfs:label "language" ; + rdfs:comment """ + Language tag for the object. + """ ; + sh:nodeKind sh:Literal ; + ] + [ + sh:path rml:datatype ; + sh:targetSubjectsOf rml:datatype ; + rdfs:label "datatype" ; + rdfs:comment """ + Datatype for the object. + """ ; + sh:nodeKind sh:IRI ; + ] + ) ; +. + + +:RMLobjectShape + a sh:NodeShape ; + sh:targetObjectsOf rml:object ; + rdfs:label "object" ; + rdfs:comment """ + An IRI, Blank Node, or Literal to use as object for all the RDF triples. + """ ; + sh:message """ + rml:object shortcut for rml:objectMap must be an IRI, Blank Node, + or Literal. + """ ; +. diff --git a/src/main/resources/shapes/rml-core/parent_map.ttl b/src/main/resources/shapes/rml-core/parent_map.ttl new file mode 100644 index 00000000..9e338ce1 --- /dev/null +++ b/src/main/resources/shapes/rml-core/parent_map.ttl @@ -0,0 +1,46 @@ +############################################################################### +# RML Parent Map shape # +# Copyright Dylan Van Assche, IDLab - UGent - imec (2023 - 2024) # +############################################################################### +@prefix sh: . +@prefix rdfs: . +@prefix : . +@prefix rdf: . +@prefix rml: . +@prefix xsd: . + +:RMLParentMapShape + a sh:NodeShape ; + sh:targetClass rml:ParentMap ; + sh:targetObjectsOf rml:parentMap ; + rdfs:label "ParentMap" ; + rdfs:comment """ + Represents a Parent Map. + """ ; + sh:message """ + rml:ParentMap must specify a literal referencing data in the parent data + source. + """ ; + + sh:and ( + # Inherited shapes + :RMLExpressionMapShape + # Parent Map specific shapes + [ + ] + ) ; +. + +:RMLparentShape + a sh:NodeShape ; + sh:targetObjectsOf rml:parent ; + rdfs:label "parent" ; + rdfs:comment """ + A Literal reference to use as reference to the parent data source. + """ ; + sh:message """ + rml:parent shortcut for rml:ParentMap must be a Literal. + """ ; + sh:nodeKind sh:Literal ; + sh:datatype xsd:string ; +. diff --git a/src/main/resources/shapes/rml-core/predicate_map.ttl b/src/main/resources/shapes/rml-core/predicate_map.ttl new file mode 100644 index 00000000..feb37bb3 --- /dev/null +++ b/src/main/resources/shapes/rml-core/predicate_map.ttl @@ -0,0 +1,52 @@ +############################################################################### +# RML Predicate Map and predicate shortcut shape # +# Copyright Dylan Van Assche, IDLab - UGent - imec (2020 - 2024) # +############################################################################### +@prefix sh: . +@prefix rdfs: . +@prefix : . +@prefix rdf: . +@prefix rml: . +@prefix xsd: . + +:RMLPredicateMapShape + a sh:NodeShape ; + sh:targetClass rml:PredicateMap ; + sh:targetObjectsOf rml:predicateMap ; + rdfs:label "PredicateMap" ; + rdfs:comment """ + Represents a Predicate Map. + """ ; + sh:message """ + Predicate Object Map must generate an IRI representing the predicate of an + RDF triple. + """ ; + sh:and ( + # Inherited shapes + :RMLTermMapShape + :RMLLogicalTargetPropertiesShape + # Predicate Map specific shapes + [ + sh:path rml:termType; + sh:message """ + rml:termType for Predicate Map can only be a rml:IRI, rml:UnsafeIRI, + rml:URI, or rml:UnsafeURI; + """; + sh:in (rml:IRI rml:UnsafeIRI rml:URI rml:UnsafeURI); + ] + ) ; +. + + +:RMLpredicateShape + a sh:NodeShape ; + sh:targetObjectsOf rml:predicate ; + rdfs:label "predicate" ; + rdfs:comment """ + Specifies the predicate for the generated triple. + """ ; + sh:message """ + rml:predicate must be an IRI. + """ ; + sh:nodeKind sh:IRI ; +. diff --git a/src/main/resources/shapes/rml-core/predicate_object_map.ttl b/src/main/resources/shapes/rml-core/predicate_object_map.ttl new file mode 100644 index 00000000..56a6cfb1 --- /dev/null +++ b/src/main/resources/shapes/rml-core/predicate_object_map.ttl @@ -0,0 +1,107 @@ +############################################################################### +# RML Predicate Object Map shape # +# Copyright Dylan Van Assche, IDLab - UGent - imec (2020 - 2024) # +############################################################################### +@prefix sh: . +@prefix rdfs: . +@prefix : . +@prefix rdf: . +@prefix rml: . +@prefix xsd: . + +:RMLPredicateObjectMapShape + a sh:NodeShape ; + sh:targetClass rml:PredicateObjectMap ; + sh:targetObjectsOf rml:predicateObjectMap ; + rdfs:label "PredicateObjectMap" ; + rdfs:comment """ + Represents a Predicate Object Map. + """; + + sh:and ( + # Inherited shapes + :RMLGraphMapPropertiesShape + :RMLLogicalTargetPropertiesShape + # Predicate Map specific shapes + [ + sh:targetSubjectsOf rml:predicate ; + sh:targetSubjectsOf rml:predicateMap ; + sh:path [sh:alternativePath (rml:predicate rml:predicateMap)] ; + rdfs:label "predicate/predicateMap" ; + rdfs:comment """ + At least one rml:predicate or rml:predicateMap must be provided. + """ ; + sh:message """ + At least one rml:predicate or rml:predicateMap must be provided. + """ ; + sh:minCount 1 ; + ] + [ + sh:targetSubjectsOf rml:predicateMap ; + sh:path rml:predicateMap ; + rdfs:label "predicateMap" ; + rdfs:comment """ + A PredicateMap element to generate the predicate component of the + (predicate, object) pair from a logical table row or iterator. + """ ; + sh:message """ + rml:predicateMap must be an IRI or blank node and be provided once. + """ ; + sh:nodeKind sh:BlankNodeOrIRI ; + ] + [ + sh:targetSubjectsOf rml:predicate ; + sh:path rml:predicate ; + rdfs:label "predicate" ; + rdfs:comment """ + Specifies the predicate for the generated triple from the logical table + row or iterator. + """ ; + sh:message """ + rml:predicate must be an IRI and be provided once. + """ ; + sh:nodeKind sh:IRI ; + ] + [ + sh:targetSubjectsOf rml:object ; + sh:targetSubjectsOf rml:objectMap ; + sh:targetSubjectsOf rml:quotedTriplesMap ; + sh:path [sh:alternativePath (rml:object rml:objectMap rml:quotedTriplesMap)] ; + rdfs:label "object/objectMap/quotedTriplesMap" ; + rdfs:comment """ + Either an rml:object, rml:objectMap, or rml:quotedTriplesMap must be provided, not multiple. + """ ; + sh:message """ + Either an rml:object, rml:objectMap, or rml:quotedTriplesMap must be provided, not multiple + """ ; + sh:minCount 1 ; + ] + [ + sh:targetSubjectsOf rml:objectMap ; + sh:path rml:objectMap ; + rdfs:label "objectMap" ; + rdfs:comment """ + An ObjectMap element to generate the object component of the + (predicate, object) pair from a logical table row or iterator. + """ ; + sh:message """ + rml:objectMap must be an IRI or blank node and be provided once. + """ ; + sh:nodeKind sh:BlankNodeOrIRI ; + sh:or ([sh:node :RMLObjectMapShape] + [sh:node :RMLRefObjectMapShape] + [sh:node :RMLStarMapShape]) ; + ] + [ + sh:targetSubjectsOf rml:object ; + sh:path rml:object ; + rdfs:label "object" ; + rdfs:comment """ + Specifies the object for the generated RDF triples. + """ ; + sh:message """ + rml:object must be an IRI and be provided once. + """ ; + ] + ) ; +. diff --git a/src/main/resources/shapes/rml-core/ref_object_map.ttl b/src/main/resources/shapes/rml-core/ref_object_map.ttl new file mode 100644 index 00000000..d4086c59 --- /dev/null +++ b/src/main/resources/shapes/rml-core/ref_object_map.ttl @@ -0,0 +1,46 @@ +############################################################################### +# RML RefObjectMap shape # +# Copyright Dylan Van Assche, IDLab - UGent - imec (2020 - 2024) # +############################################################################### +@prefix sh: . +@prefix rdfs: . +@prefix : . +@prefix rdf: . +@prefix rml: . +@prefix xsd: . + +:RMLRefObjectMapShape + a sh:NodeShape ; + sh:targetClass rml:RefObjectMap ; + rdfs:label "RefObjectMap" ; + rdfs:comment """ + Represents a Reference Object Map. + """ ; + sh:message """ + rml:RefObjectMap must specify a rml:parentTriplesMap and zero or more + rml:joinConditions. + """ ; + + sh:and ( + # Inherited shapes + :RMLJoinConditionPropertiesShape + # RefObjectMap specific shapes + [ + sh:targetSubjectsOf rml:parentTriplesMap ; + sh:path rml:parentTriplesMap ; + rdfs:label "parentTriplesMap" ; + rdfs:comment """ + Specifies the Triples Map element corresponding to the parent data + source of the foreign key constraint. + """ ; + sh:message """ + rml:parentTriplesMap may only be provided once and must be an IRI + or Blank Node referring to a Triples Map. + """ ; + sh:class rml:TriplesMap ; + sh:nodeKind sh:BlankNodeOrIRI ; + sh:minCount 1 ; + sh:maxCount 1 ; + ] + ) ; +. diff --git a/src/main/resources/shapes/rml-core/requirements.txt b/src/main/resources/shapes/rml-core/requirements.txt new file mode 100644 index 00000000..3d264b8e --- /dev/null +++ b/src/main/resources/shapes/rml-core/requirements.txt @@ -0,0 +1,3 @@ +parameterized +rdflib +pyshacl diff --git a/src/main/resources/shapes/rml-core/shacl.ttl b/src/main/resources/shapes/rml-core/shacl.ttl new file mode 100644 index 00000000..e37856a1 --- /dev/null +++ b/src/main/resources/shapes/rml-core/shacl.ttl @@ -0,0 +1,406 @@ +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix xsd: . + +@prefix shsh: . + +shsh: + rdfs:label "SHACL for SHACL"@en ; + rdfs:comment "This shapes graph can be used to validate SHACL shapes graphs against a subset of the SHACL syntax rules."@en ; + sh:declare [ + sh:prefix "shsh" ; + sh:namespace "http://www.w3.org/ns/shacl-shacl#" ; + ] . + + +shsh:ListShape + a sh:NodeShape ; + rdfs:label "List shape"@en ; + rdfs:comment "A shape describing well-formed RDF lists. Currently does not check for non-recursion. This could be expressed using SHACL-SPARQL."@en ; + rdfs:seeAlso ; + sh:property [ + sh:path [ sh:zeroOrMorePath rdf:rest ] ; + rdfs:comment "Each list member (including this node) must be have the shape shsh:ListNodeShape."@en ; + sh:hasValue rdf:nil ; + sh:node shsh:ListNodeShape ; + ] . + +shsh:ListNodeShape + a sh:NodeShape ; + rdfs:label "List node shape"@en ; + rdfs:comment "Defines constraints on what it means for a node to be a node within a well-formed RDF list. Note that this does not check whether the rdf:rest items are also well-formed lists as this would lead to unsupported recursion."@en ; + sh:or ( [ + sh:hasValue rdf:nil ; + sh:property [ + sh:path rdf:first ; + sh:maxCount 0 ; + ] ; + sh:property [ + sh:path rdf:rest ; + sh:maxCount 0 ; + ] ; + ] + [ + sh:not [ sh:hasValue rdf:nil ] ; + sh:property [ + sh:path rdf:first ; + sh:maxCount 1 ; + sh:minCount 1 ; + ] ; + sh:property [ + sh:path rdf:rest ; + sh:maxCount 1 ; + sh:minCount 1 ; + ] ; + ] ) . + +shsh:ShapeShape + a sh:NodeShape ; + rdfs:label "Shape shape"@en ; + rdfs:comment "A shape that can be used to validate syntax rules for other shapes."@en ; + + # See https://www.w3.org/TR/shacl/#shapes for what counts as a shape + sh:targetClass sh:NodeShape ; + sh:targetClass sh:PropertyShape ; + sh:targetSubjectsOf sh:targetClass, sh:targetNode, sh:targetObjectsOf, sh:targetSubjectsOf ; + sh:targetSubjectsOf sh:and, sh:class, sh:closed, sh:datatype, sh:disjoint, sh:equals, sh:flags, sh:hasValue, + sh:ignoredProperties, sh:in, sh:languageIn, sh:lessThan, sh:lessThanOrEquals, sh:maxCount, sh:maxExclusive, + sh:maxInclusive, sh:maxLength, sh:minCount, sh:minExclusive, sh:minInclusive, sh:minLength, sh:node, sh:nodeKind, + sh:not, sh:or, sh:pattern, sh:property, sh:qualifiedMaxCount, sh:qualifiedMinCount, sh:qualifiedValueShape, + sh:qualifiedValueShape, sh:qualifiedValueShapesDisjoint, sh:qualifiedValueShapesDisjoint, sh:uniqueLang, sh:xone ; + + sh:targetObjectsOf sh:node ; # node-node + sh:targetObjectsOf sh:not ; # not-node + sh:targetObjectsOf sh:property ; # property-node + sh:targetObjectsOf sh:qualifiedValueShape ; # qualifiedValueShape-node + + # Shapes are either node shapes or property shapes + sh:xone ( shsh:NodeShapeShape shsh:PropertyShapeShape ) ; + + sh:property [ + sh:path sh:targetNode ; + sh:nodeKind sh:IRIOrLiteral ; # targetNode-nodeKind + ] ; + sh:property [ + sh:path sh:targetClass ; + sh:nodeKind sh:IRI ; # targetClass-nodeKind + ] ; + sh:property [ + sh:path sh:targetSubjectsOf ; + sh:nodeKind sh:IRI ; # targetSubjectsOf-nodeKind + ] ; + sh:property [ + sh:path sh:targetObjectsOf ; + sh:nodeKind sh:IRI ; # targetObjectsOf-nodeKind + ] ; + sh:or ( [ sh:not [ + sh:class rdfs:Class ; + sh:or ( [ sh:class sh:NodeShape ] [ sh:class sh:PropertyShape ] ) + ] ] + [ sh:nodeKind sh:IRI ] + ) ; # implicit-targetClass-nodeKind + + sh:property [ + sh:path sh:severity ; + sh:maxCount 1 ; # severity-maxCount + sh:nodeKind sh:IRI ; # severity-nodeKind + ] ; + sh:property [ + sh:path sh:message ; + sh:or ( [ sh:datatype xsd:string ] [ sh:datatype rdf:langString ] ) ; # message-datatype + ] ; + sh:property [ + sh:path sh:deactivated ; + sh:maxCount 1 ; # deactivated-maxCount + sh:in ( true false ) ; # deactivated-datatype + ] ; + + sh:property [ + sh:path sh:and ; + sh:node shsh:ListShape ; # and-node + ] ; + sh:property [ + sh:path sh:class ; + sh:nodeKind sh:IRI ; # class-nodeKind + ] ; + sh:property [ + sh:path sh:closed ; + sh:datatype xsd:boolean ; # closed-datatype + sh:maxCount 1 ; # multiple-parameters + ] ; + sh:property [ + sh:path sh:ignoredProperties ; + sh:node shsh:ListShape ; # ignoredProperties-node + sh:maxCount 1 ; # multiple-parameters + ] ; + sh:property [ + sh:path ( sh:ignoredProperties [ sh:zeroOrMorePath rdf:rest ] rdf:first ) ; + sh:nodeKind sh:IRI ; # ignoredProperties-members-nodeKind + ] ; + sh:property [ + sh:path sh:datatype ; + sh:nodeKind sh:IRI ; # datatype-nodeKind + sh:maxCount 1 ; # datatype-maxCount + ] ; + sh:property [ + sh:path sh:disjoint ; + sh:nodeKind sh:IRI ; # disjoint-nodeKind + ] ; + sh:property [ + sh:path sh:equals ; + sh:nodeKind sh:IRI ; # equals-nodeKind + ] ; + sh:property [ + sh:path sh:in ; + sh:maxCount 1 ; # in-maxCount + sh:node shsh:ListShape ; # in-node + ] ; + sh:property [ + sh:path sh:languageIn ; + sh:maxCount 1 ; # languageIn-maxCount + sh:node shsh:ListShape ; # languageIn-node + ] ; + sh:property [ + sh:path ( sh:languageIn [ sh:zeroOrMorePath rdf:rest ] rdf:first ) ; + sh:datatype xsd:string ; # languageIn-members-datatype + ] ; + sh:property [ + sh:path sh:lessThan ; + sh:nodeKind sh:IRI ; # lessThan-nodeKind + ] ; + sh:property [ + sh:path sh:lessThanOrEquals ; + sh:nodeKind sh:IRI ; # lessThanOrEquals-nodeKind + ] ; + sh:property [ + sh:path sh:maxCount ; + sh:datatype xsd:integer ; # maxCount-datatype + sh:maxCount 1 ; # maxCount-maxCount + ] ; + sh:property [ + sh:path sh:maxExclusive ; + sh:maxCount 1 ; # maxExclusive-maxCount + sh:nodeKind sh:Literal ; # maxExclusive-nodeKind + ] ; + sh:property [ + sh:path sh:maxInclusive ; + sh:maxCount 1 ; # maxInclusive-maxCount + sh:nodeKind sh:Literal ; # maxInclusive-nodeKind + ] ; + sh:property [ + sh:path sh:maxLength ; + sh:datatype xsd:integer ; # maxLength-datatype + sh:maxCount 1 ; # maxLength-maxCount + ] ; + sh:property [ + sh:path sh:minCount ; + sh:datatype xsd:integer ; # minCount-datatype + sh:maxCount 1 ; # minCount-maxCount + ] ; + sh:property [ + sh:path sh:minExclusive ; + sh:maxCount 1 ; # minExclusive-maxCount + sh:nodeKind sh:Literal ; # minExclusive-nodeKind + ] ; + sh:property [ + sh:path sh:minInclusive ; + sh:maxCount 1 ; # minInclusive-maxCount + sh:nodeKind sh:Literal ; # minInclusive-nodeKind + ] ; + sh:property [ + sh:path sh:minLength ; + sh:datatype xsd:integer ; # minLength-datatype + sh:maxCount 1 ; # minLength-maxCount + ] ; + sh:property [ + sh:path sh:nodeKind ; + sh:in ( sh:BlankNode sh:IRI sh:Literal sh:BlankNodeOrIRI sh:BlankNodeOrLiteral sh:IRIOrLiteral ) ; # nodeKind-in + sh:maxCount 1 ; # nodeKind-maxCount + ] ; + sh:property [ + sh:path sh:or ; + sh:node shsh:ListShape ; # or-node + ] ; + sh:property [ + sh:path sh:pattern ; + sh:datatype xsd:string ; # pattern-datatype + sh:maxCount 1 ; # multiple-parameters + # Not implemented: syntax rule pattern-regex + ] ; + sh:property [ + sh:path sh:flags ; + sh:datatype xsd:string ; # flags-datatype + sh:maxCount 1 ; # multiple-parameters + ] ; + sh:property [ + sh:path sh:qualifiedMaxCount ; + sh:datatype xsd:integer ; # qualifiedMaxCount-datatype + sh:maxCount 1 ; # multiple-parameters + ] ; + sh:property [ + sh:path sh:qualifiedMinCount ; + sh:datatype xsd:integer ; # qualifiedMinCount-datatype + sh:maxCount 1 ; # multiple-parameters + ] ; + sh:property [ + sh:path sh:qualifiedValueShape ; + sh:maxCount 1 ; # multiple-parameters + ] ; + sh:property [ + sh:path sh:qualifiedValueShapesDisjoint ; + sh:datatype xsd:boolean ; # qualifiedValueShapesDisjoint-datatype + sh:maxCount 1 ; # multiple-parameters + ] ; + sh:property [ + sh:path sh:uniqueLang ; + sh:datatype xsd:boolean ; # uniqueLang-datatype + sh:maxCount 1 ; # uniqueLang-maxCount + ] ; + sh:property [ + sh:path sh:xone ; + sh:node shsh:ListShape ; # xone-node + ] . + +shsh:NodeShapeShape + a sh:NodeShape ; + sh:targetObjectsOf sh:node ; # node-node + sh:property [ + sh:path sh:path ; + sh:maxCount 0 ; # NodeShape-path-maxCount + ] ; + sh:property [ + sh:path sh:lessThan ; + sh:maxCount 0 ; # lessThan-scope + ] ; + sh:property [ + sh:path sh:lessThanOrEquals ; + sh:maxCount 0 ; # lessThanOrEquals-scope + ] ; + sh:property [ + sh:path sh:maxCount ; + sh:maxCount 0 ; # maxCount-scope + ] ; + sh:property [ + sh:path sh:minCount ; + sh:maxCount 0 ; # minCount-scope + ] ; + sh:property [ + sh:path sh:qualifiedValueShape ; + sh:maxCount 0 ; # qualifiedValueShape-scope + ] ; + sh:property [ + sh:path sh:uniqueLang ; + sh:maxCount 0 ; # uniqueLang-scope + ] . + +shsh:PropertyShapeShape + a sh:NodeShape ; + sh:targetObjectsOf sh:property ; # property-node + sh:property [ + sh:path sh:path ; + sh:maxCount 1 ; # path-maxCount + sh:minCount 1 ; # PropertyShape-path-minCount + sh:node shsh:PathShape ; # path-node + ] . + +# Values of sh:and, sh:or and sh:xone must be lists of shapes +shsh:ShapesListShape + a sh:NodeShape ; + sh:targetObjectsOf sh:and ; # and-members-node + sh:targetObjectsOf sh:or ; # or-members-node + sh:targetObjectsOf sh:xone ; # xone-members-node + sh:property [ + sh:path ( [ sh:zeroOrMorePath rdf:rest ] rdf:first ) ; + sh:node shsh:ShapeShape ; + ] . + + +# A path of blank node path syntax, used to simulate recursion +_:PathPath + sh:alternativePath ( + ( [ sh:zeroOrMorePath rdf:rest ] rdf:first ) + ( sh:alternativePath [ sh:zeroOrMorePath rdf:rest ] rdf:first ) + sh:inversePath + sh:zeroOrMorePath + sh:oneOrMorePath + sh:zeroOrOnePath + ) . + +shsh:PathShape + a sh:NodeShape ; + rdfs:label "Path shape"@en ; + rdfs:comment "A shape that can be used to validate the syntax rules of well-formed SHACL paths."@en ; + rdfs:seeAlso ; + sh:property [ + sh:path [ sh:zeroOrMorePath _:PathPath ] ; + sh:node shsh:PathNodeShape ; + ] . + +shsh:PathNodeShape + sh:xone ( # path-metarule + [ sh:nodeKind sh:IRI ] # 2.3.1.1: Predicate path + [ sh:nodeKind sh:BlankNode ; # 2.3.1.2: Sequence path + sh:node shsh:PathListWithAtLeast2Members ; + ] + [ sh:nodeKind sh:BlankNode ; # 2.3.1.3: Alternative path + sh:closed true ; + sh:property [ + sh:path sh:alternativePath ; + sh:node shsh:PathListWithAtLeast2Members ; + sh:minCount 1 ; + sh:maxCount 1 ; + ] + ] + [ sh:nodeKind sh:BlankNode ; # 2.3.1.4: Inverse path + sh:closed true ; + sh:property [ + sh:path sh:inversePath ; + sh:minCount 1 ; + sh:maxCount 1 ; + ] + ] + [ sh:nodeKind sh:BlankNode ; # 2.3.1.5: Zero-or-more path + sh:closed true ; + sh:property [ + sh:path sh:zeroOrMorePath ; + sh:minCount 1 ; + sh:maxCount 1 ; + ] + ] + [ sh:nodeKind sh:BlankNode ; # 2.3.1.6: One-or-more path + sh:closed true ; + sh:property [ + sh:path sh:oneOrMorePath ; + sh:minCount 1 ; + sh:maxCount 1 ; + ] + ] + [ sh:nodeKind sh:BlankNode ; # 2.3.1.7: Zero-or-one path + sh:closed true ; + sh:property [ + sh:path sh:zeroOrOnePath ; + sh:minCount 1 ; + sh:maxCount 1 ; + ] + ] + ) . + +shsh:PathListWithAtLeast2Members + a sh:NodeShape ; + sh:node shsh:ListShape ; + sh:property [ + sh:path [ sh:oneOrMorePath rdf:rest ] ; + sh:minCount 2 ; # 1 other list node plus rdf:nil + ] . + +shsh:ShapesGraphShape + a sh:NodeShape ; + sh:targetObjectsOf sh:shapesGraph ; + sh:nodeKind sh:IRI . # shapesGraph-nodeKind + +shsh:EntailmentShape + a sh:NodeShape ; + sh:targetObjectsOf sh:entailment ; + sh:nodeKind sh:IRI . # entailment-nodeKind + diff --git a/src/main/resources/shapes/rml-core/shared_properties.ttl b/src/main/resources/shapes/rml-core/shared_properties.ttl new file mode 100644 index 00000000..e757772d --- /dev/null +++ b/src/main/resources/shapes/rml-core/shared_properties.ttl @@ -0,0 +1,198 @@ +############################################################################### +# RML shared properties among resources shapes # +# Copyright Dylan Van Assche, IDLab - UGent - imec (2023 - 2024) # +############################################################################### +@prefix sh: . +@prefix rdfs: . +@prefix : . +@prefix rdf: . +@prefix rml: . +@prefix xsd: . + + +:RMLTriplesMapPropertiesShape + a sh:NodeShape; + sh:targetClass rml:TriplesMap; + sh:targetClass rml:NonAssertedTriplesMap; + + sh:property [ + sh:targetSubjectsOf rml:logicalSource ; + sh:path rml:logicalSource ; + rdfs:label "logicalSource" ; + rdfs:comment """ + A logical source is any source that is mapped to RDF triples. + """ ; + sh:message """ + Exactly one rml:logicalSource is required to access the data source. + """ ; + sh:nodeKind sh:BlankNodeOrIRI ; + sh:node :RMLAbstractLogicalSourceShape ; + sh:minCount 1 ; + sh:maxCount 1 ; + ] ; + + sh:property [ + sh:targetSubjectsOf rml:subjectMap ; + sh:targetSubjectsOf rml:subject ; + sh:targetSubjectsOf rml:quotedTriplesMap ; + sh:path [sh:alternativePath (rml:subjectMap rml:subject rml:quotedTriplesMap)] ; + rdfs:label "subjectMap/subject/quotedTriplesMap" ; + rdfs:comment """ + Either a rml:subject, rml:subjectMap or a rml:quotedTriplesMap is required, not multiple. + """ ; + sh:message """ + Either a rml:subject, rml:subjectMap or a rml:quotedTriplesMap is required, not multiple. + """ ; + sh:minCount 1 ; + sh:maxCount 1 ; + ] ; + + sh:property [ + sh:targetSubjectsOf rml:subjectMap ; + sh:path rml:subjectMap ; + rdfs:label "subjectMap" ; + rdfs:comment """ + A Subject Map element to generate a subject for generated RDF triples. + """ ; + sh:message """ + rml:SubjectMap must be an IRI or blank node. + """ ; + sh:nodeKind sh:BlankNodeOrIRI ; + sh:or ([sh:node :RMLSubjectMapShape] + [sh:node :RMLStarMapShape]) ; + ] ; + + # rml:subject + sh:property [ + sh:targetSubjectsOf rml:subject ; + sh:path rml:subject ; + rdfs:label "subject" ; + rdfs:comment """ + An IRI reference for use as subject for all generated RDF triples. + """ ; + sh:message """ + rml:subject must be an IRI or blank node. + """ ; + sh:nodeKind sh:BlankNodeOrIRI ; + ] ; + + # rml:predicateObjectMap + sh:property [ + sh:targetSubjectsOf rml:predicateObjectMap ; + sh:path rml:predicateObjectMap ; + rdfs:label "predicateObjectMap" ; + rdfs:comment """ + A Predicate Object Map element to generate a (predicate, object) pair. + """ ; + sh:message """ + rml:PredicateObjectMap must be an IRI or blank node. + """ ; + sh:minCount 0 ; + sh:nodeKind sh:BlankNodeOrIRI ; + ] ; + + # rml:baseIRI + sh:property [ + sh:path rml:baseIRI ; + sh:description """ + Base IRI to use for generating RDF triples or quads. + """ ; + sh:message """ + rml:baseIRI must be an IRI. + """ ; + sh:nodeKind sh:IRI ; + sh:minCount 0 ; + sh:maxCount 1 ; + ] ; +. + +:RMLGraphMapPropertiesShape + a sh:NodeShape; + sh:targetSubjectsOf rml:graphMap ; + sh:targetSubjectsOf rml:graph ; + + sh:property [ + sh:path [sh:alternativePath (rml:graph rml:graphMap)] ; + rdfs:label "graph/graphMap" ; + rdfs:comment """ + Either an rml:graph or rml:graphMap may be optionally be provided, + but not both. + """ ; + sh:message """ + Either an rml:graph or rml:graphMap may be optionally be provided, + but not both. + """ ; + sh:minCount 0 ; + sh:maxCount 1 ; + ] ; + sh:property [ + sh:path rml:graphMap ; + rdfs:label "graphMap" ; + rdfs:comment """ + Specifies a Graph Map. When used with a Subject Map element, all the + RDF triples generated will be stored in the specified named graph. + Otherwise, the RDF triple generated using the (predicate, object) + pair will be stored in the specified named graph. + """ ; + sh:message """ + rml:graphMap must be either an IRI or blank node. + """ ; + sh:nodeKind sh:BlankNodeOrIRI ; + ] ; + sh:property [ + sh:path rml:graph ; + rdfs:label "graph" ; + rdfs:comment """ + An IRI reference to use as the named graph of all generated triples. + """ ; + sh:message """ + rml:graphMap must be an IRI. + """ ; + sh:nodeKind sh:IRI ; + ] ; +. + +:RMLJoinConditionPropertiesShape + a sh:PropertyShape; + sh:path rml:joinCondition ; + sh:targetSubjectsOf rml:joinCondition ; + rdfs:label "joinCondition" ; + rdfs:comment """ + Specifies the join condition for joining a child data source with + a parent data source of the foreign key constraint. + """ ; + sh:message """ + rml:joinCondition must specify an rml:parent and rml:child. + """ ; + sh:nodeKind sh:BlankNodeOrIRI ; +. + +:RMLLogicalTargetPropertiesShape + a sh:PropertyShape ; + sh:path rml:logicalTarget ; + sh:targetSubjectsOf rml:logicalTarget ; + sh:path rml:logicalTarget ; + rdfs:label "logicalTarget" ; + rdfs:comment """ + A logical target is any target to where generated RDF triples are + exported to. + """ ; + sh:message """ + Zero or more rml:logicalTarget is required to export RDF triples. + """ ; + sh:nodeKind sh:BlankNodeOrIRI ; + sh:minCount 0 ; +. + +:RMLStrategyAppendShape + a sh:NodeShape ; + sh:targetObjectsOf rml:strategy ; + rdfs:label "Strategy" ; + rdfs:comment """ + Strategy to follow when generating RDF triples. + """ ; + sh:message """ + Strategy must be either rml:append or rml:cartesianProduct. + """ ; + sh:in (rml:append rml:cartesianProduct) ; +. diff --git a/src/main/resources/shapes/rml-core/subject_map.ttl b/src/main/resources/shapes/rml-core/subject_map.ttl new file mode 100644 index 00000000..4de0b242 --- /dev/null +++ b/src/main/resources/shapes/rml-core/subject_map.ttl @@ -0,0 +1,67 @@ +############################################################################### +# RML Subject Map and subject shortcut shape # +# Copyright Dylan Van Assche, IDLab - UGent - imec (2020 - 2024) # +############################################################################### +@prefix sh: . +@prefix rdfs: . +@prefix : . +@prefix rdf: . +@prefix rml: . +@prefix xsd: . + + +:RMLSubjectMapShape + a sh:NodeShape ; + sh:targetClass rml:SubjectMap ; + sh:targetObjectsOf rml:subjectMap ; + rdfs:label "SubjectMap" ; + rdfs:comment """ + Represents a Subject Map. + """ ; + sh:message """ + Subject Map must generate a resource representing the subject of + an RDF triple. + """ ; + + sh:and ( + # Inherited shapes + :RMLTermMapShape + :RMLGraphMapPropertiesShape + :RMLLogicalTargetPropertiesShape + # Subject Map specific shapes + [ + sh:targetSubjectsOf rml:class ; + sh:path rml:class ; + rdfs:label "class" ; + rdfs:comment """ + The subject value generated will be asserted as an instance of this + RDFS class. + """ ; + sh:message """ + rml:class must be an IRI and may be specified multiple times. + """ ; + sh:nodeKind sh:IRI ; + ] + [ + sh:path rml:termType ; + sh:message """ + rml:termType must be a rml:IRI, rml:UnsafeIRI, rml:URI, + rml:UnsafeURI, or rml:BlankNode for a Subject Map. + """ ; + sh:in (rml:IRI rml:UnsafeIRI rml:URI rml:UnsafeURI rml:BlankNode); + ] + ) ; +. + +:RMLsubjectShape + a sh:NodeShape ; + sh:targetObjectsOf rml:subject ; + rdfs:label "subject" ; + rdfs:comment """ + An IRI reference to use as subject for all the RDF triples. + """ ; + sh:message """ + rml:subject shortcut for rml:SubjectMap must be a IRI or BlankNode. + """ ; + sh:nodeKind sh:BlankNodeOrIRI ; +. diff --git a/src/main/resources/shapes/rml-core/term_map.ttl b/src/main/resources/shapes/rml-core/term_map.ttl new file mode 100644 index 00000000..a7bdcbaf --- /dev/null +++ b/src/main/resources/shapes/rml-core/term_map.ttl @@ -0,0 +1,43 @@ +############################################################################### +# RML Expression Map shape # +# Copyright Dylan Van Assche, IDLab - UGent - imec (2023 - 2024) # +############################################################################### +@prefix sh: . +@prefix rdfs: . +@prefix : . +@prefix rdf: . +@prefix rml: . +@prefix xsd: . + +:RMLTermMapShape + a sh:NodeShape ; + rdfs:label "TermMap" ; + rdfs:comment """ + Represents a Term Map. + """ ; + sh:message """ + Term Map is an Expression Map with optionally a term type specified. + """ ; + + # Inherit Expression Map shape and add rml:termType + sh:and ( + :RMLExpressionMapShape + [ + sh:targetSubjectsOf rml:termType ; + sh:path rml:termType ; + rdfs:label "termType" ; + rdfs:comment """ + An IRI indicating whether a generated term should be an IRI, + Blank Node, or a Literal. + """ ; + sh:message """ + rml:termType must be either rml:IRI, rml:UnsafeIRI, + rml:URI, rml:UnsafeURI, rml:Literal, or rml:BlankNode for a Term Map. + May only be provided once. + """ ; + sh:maxCount 1 ; + sh:in (rml:IRI rml:UnsafeIRI rml:URI rml:UnsafeURI rml:Literal rml:BlankNode) ; + sh:nodeKind sh:IRI ; + ] + ) ; +. diff --git a/src/main/resources/shapes/rml-core/tests.py b/src/main/resources/shapes/rml-core/tests.py new file mode 100755 index 00000000..2102e28c --- /dev/null +++ b/src/main/resources/shapes/rml-core/tests.py @@ -0,0 +1,80 @@ +#!/usr/bin/env python +# +# (c) Dylan Van Assche (2020 - 2023) +# IDLab - Ghent University - imec +# MIT license +# + +import os +import argparse +import unittest +import logging +from parameterized import parameterized +from glob import glob +from rdflib import Graph + +from mapping_validator import MappingValidator + +TEST_CASES_DIR = os.path.join(os.path.abspath('../test-cases'), + '*/mapping.ttl') +CORE_SHAPE_FILE = os.path.abspath('core.ttl') +SHACL_SHAPE_FILE = os.path.abspath('shacl.ttl') + + +class MappingValidatorTests(unittest.TestCase): + def _validate_rules(self, path: str) -> None: + rules = Graph().parse(path, format='turtle') + mapping_validator = MappingValidator(CORE_SHAPE_FILE) + mapping_validator.validate(rules) + + def _validate_shapes(self, path: str) -> None: + rules = Graph().parse(path, format='turtle') + mapping_validator = MappingValidator(SHACL_SHAPE_FILE) + mapping_validator.validate(rules) + + def test_non_existing_mapping_rules(self) -> None: + with self.assertRaises(FileNotFoundError): + p = os.path.abspath('does_not_exist.ttl') + self._validate_rules(p) + + @parameterized.expand([(p,) for p in sorted(glob(TEST_CASES_DIR))], + skip_on_empty=True) + def test_validation_rules(self, path: str) -> None: + """ + Test if our SHACL shapes are able to validate our validation mapping + rules test cases. + """ + print(f'Testing validation with: {path}') + if 'RMLTC0004b' in path or 'RMLTC0007h' in path or \ + 'RMLTC0012c' in path or 'RMLTC0012d' in path or \ + 'RMLTC0015b' in path or 'RMLTC0023c' in path: + with self.assertRaises(Exception): + self._validate_rules(path) + else: + self._validate_rules(path) + + @unittest.skip('pySHACL validation is broken for Core') + def test_validation_shapes(self) -> None: + """ + Test if our SHACL shapes are valid according to the W3C Recommdendation + of SHACL. Validation with the official SHACL shapes for SHACL. + + See https://www.w3.org/TR/shacl/#shacl-shacl + """ + self._validate_shapes('./core.ttl') + + +if __name__ == '__main__': + parser = argparse.ArgumentParser(description='Execute tests for SHACL ' + 'shapes on RML mapping rules.') + parser.add_argument('--verbose', '-v', action='count', default=1, + help='Set verbosity level of messages. Example: -vvv') + args = parser.parse_args() + + args.verbose = 70 - (10 * args.verbose) if args.verbose > 0 else 0 + logging.basicConfig(level=args.verbose, + format='%(asctime)s %(levelname)s: %(message)s', + datefmt='%Y-%m-%d %H:%M:%S') + + print(TEST_CASES_DIR) + unittest.main(failfast=True) diff --git a/src/main/resources/shapes/rml-core/triples_map.ttl b/src/main/resources/shapes/rml-core/triples_map.ttl new file mode 100644 index 00000000..a05bc109 --- /dev/null +++ b/src/main/resources/shapes/rml-core/triples_map.ttl @@ -0,0 +1,33 @@ +############################################################################### +# RML Triples Map shape # +# Copyright Dylan Van Assche, IDLab - UGent - imec (2020 - 2024) # +############################################################################### +@prefix : . +@prefix rdfs: . +@prefix sh: . +@prefix rdf: . +@prefix rml: . +@prefix xsd: . + +# Validate an RML Triples Map +:RMLTriplesMapShape + a sh:NodeShape ; + sh:targetClass rml:TriplesMap ; + sh:targetObjectsOf rml:parentTriplesMap ; + rdfs:label "TriplesMap" ; + rdfs:comment """ + Represents a Triples Map. + """ ; + sh:message """ + Triples Map requires exactly one rml:subject or one rml:subjectMap and zero + or more rml:predicateObjectMaps. + """ ; + + sh:and ( + # Inherited shapes + :RMLTriplesMapPropertiesShape + # Triples Map specific shapes + [ + ] + ) ; +. diff --git a/src/main/resources/shapes/rml-fnml/README.md b/src/main/resources/shapes/rml-fnml/README.md new file mode 100644 index 00000000..6b8f0dd6 --- /dev/null +++ b/src/main/resources/shapes/rml-fnml/README.md @@ -0,0 +1,20 @@ +# Shape editing + +## Setup + +`pip install -r requirements.txt` + +## Editing + +Edit following subshapes: + +- external_shapes.ttl +- function_execution.ttl +- function_map.ttl +- input.ttl +- parameter_map.ttl +- return_map.ttl + +## Generating + +./generate_shape.py fnml.ttl diff --git a/src/main/resources/shapes/rml-fnml/external_shapes.ttl b/src/main/resources/shapes/rml-fnml/external_shapes.ttl new file mode 100644 index 00000000..9e706792 --- /dev/null +++ b/src/main/resources/shapes/rml-fnml/external_shapes.ttl @@ -0,0 +1,20 @@ +############################################################################### +# RML FNML external resources shapes # +# Copyright Dylan Van Assche, IDLab - UGent - imec (2023) # +############################################################################### +@prefix sh: . +@prefix : . +@prefix rdf: . +@prefix rml: . +@prefix xsd: . + +# Shapes are defined in the corresponding repositories of each specification +# Provide their IRI as stub to allow validation in FNML. + +:RMLTermMapShape + a sh:NodeShape; +. + +:RMLLogicalTargetPropertiesShape + a sh:NodeShape; +. diff --git a/src/main/resources/shapes/fnml.ttl b/src/main/resources/shapes/rml-fnml/fnml.ttl similarity index 83% rename from src/main/resources/shapes/fnml.ttl rename to src/main/resources/shapes/rml-fnml/fnml.ttl index 8970d400..e5bc9eb4 100644 --- a/src/main/resources/shapes/fnml.ttl +++ b/src/main/resources/shapes/rml-fnml/fnml.ttl @@ -17,7 +17,7 @@ @prefix rdf: . @prefix rdfs: . @prefix rml: . -@prefix : . +@prefix schema: . @prefix sh: . @prefix skos: . @prefix sosa: . @@ -30,11 +30,12 @@ @prefix xsd: . a sh:NodeShape ; - sh:description """ + rdfs:label "rml:FunctionExecution" ; + rdfs:comment """ Represents a Function Execution. """ ; - sh:name "rml:FunctionExecution" ; - sh:property [ sh:description """ + sh:property [ rdfs:label "rml:function/rml:functionMap" ; + rdfs:comment """ Exactly one rml:function or rml:functionMap is required. """ ; sh:maxCount 1 ; @@ -42,52 +43,52 @@ Exactly one rml:function or rml:functionMap is required. """ ; sh:minCount 1 ; - sh:name "rml:function/rml:functionMap" ; sh:path [ sh:alternativePath ( rml:function rml:functionMap ) ] ], - [ sh:description """ + [ rdfs:label "rml:functionMap" ; + rdfs:comment """ FnO function to execute. """ ; sh:message """ rml:functionMap must be an IRI or Blank node. """ ; - sh:name "rml:functionMap" ; sh:node ; sh:nodeKind sh:BlankNodeOrIRI ; sh:path rml:functionMap ], - [ sh:description """ + [ rdfs:label "rml:function" ; + rdfs:comment """ FnO function to execute. """ ; sh:message """ rml:function must be an IRI. """ ; - sh:name "rml:function" ; sh:nodeKind sh:IRI ; sh:path rml:function ], - [ sh:description """ + [ rdfs:label "rml:input" ; + rdfs:comment """ Input parameters for the function. """ ; sh:message """ rml:input must be an IRI or Blank node. """ ; - sh:name "rml:input" ; sh:nodeKind sh:BlankNodeOrIRI ; sh:path rml:input ] ; sh:targetObjectsOf rml:functionExecution . a sh:NodeShape ; - sh:and ( [ ] ) ; - sh:description """ + rdfs:label "FunctionMap" ; + rdfs:comment """ Represents a Function Map. """ ; - sh:name "FunctionMap" ; + sh:and ( [ ] ) ; sh:targetObjectsOf rml:functionMap . a sh:NodeShape ; - sh:description """ + rdfs:label "rml:Input" ; + rdfs:comment """ Represents an Input for a function. """ ; - sh:name "rml:Input" ; - sh:property [ sh:description """ + sh:property [ rdfs:label "rml:parameter/rml:parameterMap" ; + rdfs:comment """ Exactly one rml:parameter or rml:parameterMap is required. """ ; sh:maxCount 1 ; @@ -95,51 +96,51 @@ Exactly one rml:parameter or rml:parameterMap is required. """ ; sh:minCount 1 ; - sh:name "rml:parameter/rml:parameterMap" ; sh:path [ sh:alternativePath ( rml:parameter rml:parameterMap ) ] ], - [ sh:description """ + [ rdfs:label "rml:inputValueMap" ; + rdfs:comment """ Values of the parameters. """ ; sh:maxCount 1 ; sh:message """ rml:inputValueMap must be an IRI or Blank node, provided once. """ ; - sh:name "rml:inputValueMap" ; sh:nodeKind sh:BlankNodeOrIRI ; sh:path rml:inputValueMap ], - [ sh:datatype xsd:string ; - sh:description """ + [ rdfs:label "rml:inputValue" ; + rdfs:comment """ Parameters to supply to FnO function. """ ; + sh:datatype xsd:string ; sh:maxCount 1 ; sh:message """ rml:inputValue must be a string Literal. """ ; - sh:name "rml:inputValue" ; sh:nodeKind sh:Literal ; sh:path rml:inputValue ], - [ sh:description """ + [ rdfs:label "rml:parameterMap" ; + rdfs:comment """ Parameters to supply to FnO function. """ ; sh:maxCount 1 ; sh:message """ rml:parameterMap must be an IRI or Blank node. """ ; - sh:name "rml:parameterMap" ; sh:node ; sh:nodeKind sh:BlankNodeOrIRI ; sh:path rml:parameterMap ], - [ sh:description """ + [ rdfs:label "rml:parameter" ; + rdfs:comment """ Parameters to supply to FnO function. """ ; sh:maxCount 1 ; sh:message """ rml:parameter must be an IRI. """ ; - sh:name "rml:parameter" ; sh:nodeKind sh:IRI ; sh:path rml:parameter ], - [ sh:description """ + [ rdfs:label "rml:inputValue/rml:inputValueMap" ; + rdfs:comment """ Exactly one rml:inputValue or rml:inputValueMap is required. """ ; sh:maxCount 1 ; @@ -147,24 +148,23 @@ Exactly one rml:inputValue or rml:inputValueMap is required. """ ; sh:minCount 1 ; - sh:name "rml:inputValue/rml:inputValueMap" ; sh:path [ sh:alternativePath ( rml:inputValue rml:inputValueMap ) ] ] ; sh:targetObjectsOf rml:input . a sh:NodeShape ; - sh:and ( [ ] ) ; - sh:description """ + rdfs:label "ParameterMap" ; + rdfs:comment """ Represents a Parameter Map of a function. """ ; - sh:name "ParameterMap" ; + sh:and ( [ ] ) ; sh:targetObjectsOf rml:parameterMap . a sh:NodeShape ; - sh:and ( [ ] ) ; - sh:description """ + rdfs:label "ReturnMap" ; + rdfs:comment """ Represents a Return Map. """ ; - sh:name "ReturnMap" ; + sh:and ( [ ] ) ; sh:targetObjectsOf rml:returnMap . a sh:NodeShape . diff --git a/src/main/resources/shapes/rml-fnml/function_execution.ttl b/src/main/resources/shapes/rml-fnml/function_execution.ttl new file mode 100644 index 00000000..275e767a --- /dev/null +++ b/src/main/resources/shapes/rml-fnml/function_execution.ttl @@ -0,0 +1,74 @@ +############################################################################### +# RML FunctionExecution shape # +# Copyright Dylan Van Assche, IDLab - UGent - imec (2023 - 2024) # +############################################################################### +@prefix sh: . +@prefix rdfs: . +@prefix : . +@prefix rdf: . +@prefix rml: . +@prefix xsd: . + +:RMLFunctionExecutionShape + a sh:NodeShape ; + rdfs:label "rml:FunctionExecution" ; + rdfs:comment """ + Represents a Function Execution. + """ ; + sh:targetObjectsOf rml:functionExecution ; + + # Exactly one rml:function or rml:functionMap is required + sh:property [ + sh:path [sh:alternativePath (rml:function + rml:functionMap)] ; + rdfs:label "rml:function/rml:functionMap" ; + rdfs:comment """ + Exactly one rml:function or rml:functionMap is required. + """ ; + sh:message """ + Exactly one rml:function or rml:functionMap is required. + """ ; + sh:minCount 1 ; + sh:maxCount 1 ; + ] ; + + # rml:functionMap non-shortcut + sh:property [ + sh:path rml:functionMap ; + rdfs:label "rml:functionMap" ; + rdfs:comment """ + FnO function to execute. + """ ; + sh:message """ + rml:functionMap must be an IRI or Blank node. + """ ; + sh:nodeKind sh:BlankNodeOrIRI ; + sh:node :RMLFunctionMap; + ] ; + + # rml:function shortcut + sh:property [ + sh:path rml:function ; + rdfs:label "rml:function" ; + rdfs:comment """ + FnO function to execute. + """ ; + sh:message """ + rml:function must be an IRI. + """ ; + sh:nodeKind sh:IRI ; + ] ; + + # rml:input + sh:property [ + sh:path rml:input ; + rdfs:label "rml:input" ; + rdfs:comment """ + Input parameters for the function. + """ ; + sh:message """ + rml:input must be an IRI or Blank node. + """ ; + sh:nodeKind sh:BlankNodeOrIRI ; + ] ; +. diff --git a/src/main/resources/shapes/rml-fnml/function_map.ttl b/src/main/resources/shapes/rml-fnml/function_map.ttl new file mode 100644 index 00000000..0c37a50d --- /dev/null +++ b/src/main/resources/shapes/rml-fnml/function_map.ttl @@ -0,0 +1,28 @@ +############################################################################### +# RML Function Map shape # +# Copyright Dylan Van Assche, IDLab - UGent - imec (2023 - 2024) # +############################################################################### +@prefix sh: . +@prefix rdfs: . +@prefix : . +@prefix rdf: . +@prefix rml: . +@prefix xsd: . + +:RMLFunctionMapShape + a sh:NodeShape ; + rdfs:label "FunctionMap" ; + rdfs:comment """ + Represents a Function Map. + """ ; + sh:targetObjectsOf rml:functionMap ; + + sh:and ( + # Inherited shapes + :RMLTermMapShape + :RMLLogicalTargetPropertiesShape + # Function Map specific shapes + [ + ] + ) ; +. diff --git a/src/main/resources/shapes/rml-fnml/generate_shape.py b/src/main/resources/shapes/rml-fnml/generate_shape.py new file mode 100755 index 00000000..f6c20d6b --- /dev/null +++ b/src/main/resources/shapes/rml-fnml/generate_shape.py @@ -0,0 +1,79 @@ +#!/usr/bin/env python + +import argparse +import sys +from os import path +from glob import glob +from rdflib import Graph, Namespace +from rdflib.plugins.serializers.turtle import TurtleSerializer +from rdflib import plugin + +SUBSHAPE_FORMAT = 'turtle' +SUBSHAPE_GLOB_PATTERN = '*.ttl' +SHACL = Namespace('http://www.w3.org/ns/shacl#') +RML = Namespace('http://w3id.org/rml/') + + +class TurtleWithPrefixes(TurtleSerializer): + """ + A turtle serializer that always emits prefixes + Workaround for https://github.com/RDFLib/rdflib/issues/1048 + """ + roundtrip_prefixes = True # Undocumented, forces to write all prefixes + + +class ShapeGenerator: + """ + Generates a complete SHACL shape of all the SHACL subshapes. + Useful for using the shapes in the shacl.org Playground. + """ + def __init__(self, glob_pattern: str, rdf_format: str, + destination: str) -> None: + self._glob_pattern: str = glob_pattern + self._rdf_format: str = rdf_format + self._destination: str = destination + self._shape = Graph() + self._shape.bind('sh', SHACL) + self._shape.bind('rml', RML) + # Register TurtleWithPrefixes serializer as 'tortoise' format + plugin.register('tortoise', + plugin.Serializer, + 'generate_shape', + 'TurtleWithPrefixes') + + def generate(self) -> None: + """ + Generate a full shape from the sub shapes. + """ + print('Reading subshapes:') + for sub_shape in glob(self._glob_pattern): + if 'fnml' in sub_shape or 'shacl' in sub_shape: + continue + print(f"\t{sub_shape}") + g = Graph() + g.bind('sh', SHACL) + g.bind('rml', RML) + self._shape += g.parse(sub_shape, format=self._rdf_format) + + print(f'Writing shape to {self._destination}') + self._shape.serialize(destination=self._destination, format='tortoise') + + +if __name__ == '__main__': + p = argparse.ArgumentParser(description='Generate a complete SHACL shape ' + 'from the subshapes.') + p.add_argument('destination', type=str, help='Location to write the ' + 'complete SHACL shape as Turtle.') + # Arguments parsing + args = p.parse_args() + if not path.exists(args.destination): + print(f'{args.destination} file path does not exist!') + sys.exit(1) + + if path.isdir(args.destination): + args.destination = path.join(args.destination, 'fnml.ttl') + + # Generate shape + generator = ShapeGenerator(SUBSHAPE_GLOB_PATTERN, SUBSHAPE_FORMAT, + args.destination) + generator.generate() diff --git a/src/main/resources/shapes/rml-fnml/input.ttl b/src/main/resources/shapes/rml-fnml/input.ttl new file mode 100644 index 00000000..bb791ee6 --- /dev/null +++ b/src/main/resources/shapes/rml-fnml/input.ttl @@ -0,0 +1,107 @@ +############################################################################### +# RML Input shape # +# Copyright Dylan Van Assche, IDLab - UGent - imec (2023 - 2024) # +############################################################################### +@prefix sh: . +@prefix rdfs: . +@prefix : . +@prefix rdf: . +@prefix rml: . +@prefix xsd: . + +:RMLInputShape + a sh:NodeShape ; + rdfs:label "rml:Input" ; + rdfs:comment """ + Represents an Input for a function. + """ ; + sh:targetObjectsOf rml:input ; + + # Exactly one rml:parameter or rml:parameterMap is required + sh:property [ + sh:path [sh:alternativePath (rml:parameter + rml:parameterMap)] ; + rdfs:label "rml:parameter/rml:parameterMap" ; + rdfs:comment """ + Exactly one rml:parameter or rml:parameterMap is required. + """ ; + sh:message """ + Exactly one rml:parameter or rml:parameterMap is required. + """ ; + sh:minCount 1 ; + sh:maxCount 1 ; + ] ; + + # rml:parameterMap non-shortcut + sh:property [ + sh:path rml:parameterMap ; + rdfs:label "rml:parameterMap" ; + rdfs:comment """ + Parameters to supply to FnO function. + """ ; + sh:message """ + rml:parameterMap must be an IRI or Blank node. + """ ; + sh:nodeKind sh:BlankNodeOrIRI ; + sh:node :RMLParameterMap; + sh:maxCount 1 ; + ] ; + + # rml:parameter shortcut + sh:property [ + sh:path rml:parameter ; + rdfs:label "rml:parameter" ; + rdfs:comment """ + Parameters to supply to FnO function. + """ ; + sh:message """ + rml:parameter must be an IRI. + """ ; + sh:nodeKind sh:IRI ; + sh:maxCount 1 ; + ] ; + + # Exactly one rml:inputValue or rml:inputValueMap is required + sh:property [ + sh:path [sh:alternativePath (rml:inputValue + rml:inputValueMap)] ; + rdfs:label "rml:inputValue/rml:inputValueMap" ; + rdfs:comment """ + Exactly one rml:inputValue or rml:inputValueMap is required. + """ ; + sh:message """ + Exactly one rml:inputValue or rml:inputValueMap is required. + """ ; + sh:minCount 1 ; + sh:maxCount 1 ; + ] ; + + # rml:inputValueMap + sh:property [ + sh:path rml:inputValueMap ; + rdfs:label "rml:inputValueMap" ; + rdfs:comment """ + Values of the parameters. + """ ; + sh:message """ + rml:inputValueMap must be an IRI or Blank node, provided once. + """ ; + sh:maxCount 1 ; + sh:nodeKind sh:BlankNodeOrIRI ; + ] ; + + # rml:inputValue shortcut + sh:property [ + sh:path rml:inputValue ; + rdfs:label "rml:inputValue" ; + rdfs:comment """ + Parameters to supply to FnO function. + """ ; + sh:message """ + rml:inputValue must be a string Literal. + """ ; + sh:nodeKind sh:Literal ; + sh:datatype xsd:string ; + sh:maxCount 1 ; + ] ; +. diff --git a/src/main/resources/shapes/rml-fnml/mapping_validator.py b/src/main/resources/shapes/rml-fnml/mapping_validator.py new file mode 100644 index 00000000..efaf4408 --- /dev/null +++ b/src/main/resources/shapes/rml-fnml/mapping_validator.py @@ -0,0 +1,43 @@ +#!/usr/bin/env python +# + +from logging import debug, info, critical +from pyshacl import validate +from rdflib import Graph +from shutil import get_terminal_size + + +class MappingValidator: + def __init__(self, shape: str) -> None: + g = Graph() + g.parse(shape, format='turtle') + self._shape = g + + def validate(self, rules: Graph, print_report: bool = True) -> None: + valid: bool + report_graph: Graph + report_text: str + valid, report_graph, report_text = validate(rules, + shacl_graph=self._shape) + debug(f'RML rules valid: {valid}') + debug(f'SHACL validation report: {report_text}') + + # If mapping rules are invalid, print SHACL report and raise exception + if not valid and print_report: + self._print_report(report_text) + msg = 'RML mapping rules are invalid, a detailed explanation' \ + ' is available in the report' + critical(msg) + raise ValueError(msg) + + def _print_report(self, report_text: str) -> None: + tty_columns: int + tty_columns, _ = get_terminal_size() + info('-' * tty_columns) + title: str = 'RML rules validation report' + white_space: int = int((tty_columns - len(title)) / 2) + title = ' ' * white_space + title + ' ' * white_space + info(title) + info('-' * tty_columns) + info(report_text) + info('-' * tty_columns) \ No newline at end of file diff --git a/src/main/resources/shapes/rml-fnml/parameter_map.ttl b/src/main/resources/shapes/rml-fnml/parameter_map.ttl new file mode 100644 index 00000000..25bc52c0 --- /dev/null +++ b/src/main/resources/shapes/rml-fnml/parameter_map.ttl @@ -0,0 +1,28 @@ +############################################################################### +# RML Parameter Map shape # +# Copyright Dylan Van Assche, IDLab - UGent - imec (2023 - 2024) # +############################################################################### +@prefix sh: . +@prefix rdfs: . +@prefix : . +@prefix rdf: . +@prefix rml: . +@prefix xsd: . + +:RMLParameterMapShape + a sh:NodeShape ; + rdfs:label "ParameterMap" ; + rdfs:comment """ + Represents a Parameter Map of a function. + """ ; + sh:targetObjectsOf rml:parameterMap ; + + sh:and ( + # Inherited shapes + :RMLTermMapShape + :RMLLogicalTargetPropertiesShape + # Parameter Map specific shapes + [ + ] + ) ; +. diff --git a/src/main/resources/shapes/rml-fnml/requirements.txt b/src/main/resources/shapes/rml-fnml/requirements.txt new file mode 100644 index 00000000..e9fdd848 --- /dev/null +++ b/src/main/resources/shapes/rml-fnml/requirements.txt @@ -0,0 +1,3 @@ +parameterized +rdflib +pyshacl \ No newline at end of file diff --git a/src/main/resources/shapes/rml-fnml/return_map.ttl b/src/main/resources/shapes/rml-fnml/return_map.ttl new file mode 100644 index 00000000..2e5b0446 --- /dev/null +++ b/src/main/resources/shapes/rml-fnml/return_map.ttl @@ -0,0 +1,28 @@ +############################################################################### +# RML Return Map shape # +# Copyright Dylan Van Assche, IDLab - UGent - imec (2023 - 2024) # +############################################################################### +@prefix sh: . +@prefix rdfs: . +@prefix : . +@prefix rdf: . +@prefix rml: . +@prefix xsd: . + +:RMLReturnMapShape + a sh:NodeShape ; + rdfs:label "ReturnMap" ; + rdfs:comment """ + Represents a Return Map. + """ ; + sh:targetObjectsOf rml:returnMap ; + + sh:and ( + # Inherited shapes + :RMLTermMapShape + :RMLLogicalTargetPropertiesShape + # Return Map specific shapes + [ + ] + ) ; +. diff --git a/src/main/resources/shapes/rml-fnml/shacl.ttl b/src/main/resources/shapes/rml-fnml/shacl.ttl new file mode 100644 index 00000000..e37856a1 --- /dev/null +++ b/src/main/resources/shapes/rml-fnml/shacl.ttl @@ -0,0 +1,406 @@ +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix xsd: . + +@prefix shsh: . + +shsh: + rdfs:label "SHACL for SHACL"@en ; + rdfs:comment "This shapes graph can be used to validate SHACL shapes graphs against a subset of the SHACL syntax rules."@en ; + sh:declare [ + sh:prefix "shsh" ; + sh:namespace "http://www.w3.org/ns/shacl-shacl#" ; + ] . + + +shsh:ListShape + a sh:NodeShape ; + rdfs:label "List shape"@en ; + rdfs:comment "A shape describing well-formed RDF lists. Currently does not check for non-recursion. This could be expressed using SHACL-SPARQL."@en ; + rdfs:seeAlso ; + sh:property [ + sh:path [ sh:zeroOrMorePath rdf:rest ] ; + rdfs:comment "Each list member (including this node) must be have the shape shsh:ListNodeShape."@en ; + sh:hasValue rdf:nil ; + sh:node shsh:ListNodeShape ; + ] . + +shsh:ListNodeShape + a sh:NodeShape ; + rdfs:label "List node shape"@en ; + rdfs:comment "Defines constraints on what it means for a node to be a node within a well-formed RDF list. Note that this does not check whether the rdf:rest items are also well-formed lists as this would lead to unsupported recursion."@en ; + sh:or ( [ + sh:hasValue rdf:nil ; + sh:property [ + sh:path rdf:first ; + sh:maxCount 0 ; + ] ; + sh:property [ + sh:path rdf:rest ; + sh:maxCount 0 ; + ] ; + ] + [ + sh:not [ sh:hasValue rdf:nil ] ; + sh:property [ + sh:path rdf:first ; + sh:maxCount 1 ; + sh:minCount 1 ; + ] ; + sh:property [ + sh:path rdf:rest ; + sh:maxCount 1 ; + sh:minCount 1 ; + ] ; + ] ) . + +shsh:ShapeShape + a sh:NodeShape ; + rdfs:label "Shape shape"@en ; + rdfs:comment "A shape that can be used to validate syntax rules for other shapes."@en ; + + # See https://www.w3.org/TR/shacl/#shapes for what counts as a shape + sh:targetClass sh:NodeShape ; + sh:targetClass sh:PropertyShape ; + sh:targetSubjectsOf sh:targetClass, sh:targetNode, sh:targetObjectsOf, sh:targetSubjectsOf ; + sh:targetSubjectsOf sh:and, sh:class, sh:closed, sh:datatype, sh:disjoint, sh:equals, sh:flags, sh:hasValue, + sh:ignoredProperties, sh:in, sh:languageIn, sh:lessThan, sh:lessThanOrEquals, sh:maxCount, sh:maxExclusive, + sh:maxInclusive, sh:maxLength, sh:minCount, sh:minExclusive, sh:minInclusive, sh:minLength, sh:node, sh:nodeKind, + sh:not, sh:or, sh:pattern, sh:property, sh:qualifiedMaxCount, sh:qualifiedMinCount, sh:qualifiedValueShape, + sh:qualifiedValueShape, sh:qualifiedValueShapesDisjoint, sh:qualifiedValueShapesDisjoint, sh:uniqueLang, sh:xone ; + + sh:targetObjectsOf sh:node ; # node-node + sh:targetObjectsOf sh:not ; # not-node + sh:targetObjectsOf sh:property ; # property-node + sh:targetObjectsOf sh:qualifiedValueShape ; # qualifiedValueShape-node + + # Shapes are either node shapes or property shapes + sh:xone ( shsh:NodeShapeShape shsh:PropertyShapeShape ) ; + + sh:property [ + sh:path sh:targetNode ; + sh:nodeKind sh:IRIOrLiteral ; # targetNode-nodeKind + ] ; + sh:property [ + sh:path sh:targetClass ; + sh:nodeKind sh:IRI ; # targetClass-nodeKind + ] ; + sh:property [ + sh:path sh:targetSubjectsOf ; + sh:nodeKind sh:IRI ; # targetSubjectsOf-nodeKind + ] ; + sh:property [ + sh:path sh:targetObjectsOf ; + sh:nodeKind sh:IRI ; # targetObjectsOf-nodeKind + ] ; + sh:or ( [ sh:not [ + sh:class rdfs:Class ; + sh:or ( [ sh:class sh:NodeShape ] [ sh:class sh:PropertyShape ] ) + ] ] + [ sh:nodeKind sh:IRI ] + ) ; # implicit-targetClass-nodeKind + + sh:property [ + sh:path sh:severity ; + sh:maxCount 1 ; # severity-maxCount + sh:nodeKind sh:IRI ; # severity-nodeKind + ] ; + sh:property [ + sh:path sh:message ; + sh:or ( [ sh:datatype xsd:string ] [ sh:datatype rdf:langString ] ) ; # message-datatype + ] ; + sh:property [ + sh:path sh:deactivated ; + sh:maxCount 1 ; # deactivated-maxCount + sh:in ( true false ) ; # deactivated-datatype + ] ; + + sh:property [ + sh:path sh:and ; + sh:node shsh:ListShape ; # and-node + ] ; + sh:property [ + sh:path sh:class ; + sh:nodeKind sh:IRI ; # class-nodeKind + ] ; + sh:property [ + sh:path sh:closed ; + sh:datatype xsd:boolean ; # closed-datatype + sh:maxCount 1 ; # multiple-parameters + ] ; + sh:property [ + sh:path sh:ignoredProperties ; + sh:node shsh:ListShape ; # ignoredProperties-node + sh:maxCount 1 ; # multiple-parameters + ] ; + sh:property [ + sh:path ( sh:ignoredProperties [ sh:zeroOrMorePath rdf:rest ] rdf:first ) ; + sh:nodeKind sh:IRI ; # ignoredProperties-members-nodeKind + ] ; + sh:property [ + sh:path sh:datatype ; + sh:nodeKind sh:IRI ; # datatype-nodeKind + sh:maxCount 1 ; # datatype-maxCount + ] ; + sh:property [ + sh:path sh:disjoint ; + sh:nodeKind sh:IRI ; # disjoint-nodeKind + ] ; + sh:property [ + sh:path sh:equals ; + sh:nodeKind sh:IRI ; # equals-nodeKind + ] ; + sh:property [ + sh:path sh:in ; + sh:maxCount 1 ; # in-maxCount + sh:node shsh:ListShape ; # in-node + ] ; + sh:property [ + sh:path sh:languageIn ; + sh:maxCount 1 ; # languageIn-maxCount + sh:node shsh:ListShape ; # languageIn-node + ] ; + sh:property [ + sh:path ( sh:languageIn [ sh:zeroOrMorePath rdf:rest ] rdf:first ) ; + sh:datatype xsd:string ; # languageIn-members-datatype + ] ; + sh:property [ + sh:path sh:lessThan ; + sh:nodeKind sh:IRI ; # lessThan-nodeKind + ] ; + sh:property [ + sh:path sh:lessThanOrEquals ; + sh:nodeKind sh:IRI ; # lessThanOrEquals-nodeKind + ] ; + sh:property [ + sh:path sh:maxCount ; + sh:datatype xsd:integer ; # maxCount-datatype + sh:maxCount 1 ; # maxCount-maxCount + ] ; + sh:property [ + sh:path sh:maxExclusive ; + sh:maxCount 1 ; # maxExclusive-maxCount + sh:nodeKind sh:Literal ; # maxExclusive-nodeKind + ] ; + sh:property [ + sh:path sh:maxInclusive ; + sh:maxCount 1 ; # maxInclusive-maxCount + sh:nodeKind sh:Literal ; # maxInclusive-nodeKind + ] ; + sh:property [ + sh:path sh:maxLength ; + sh:datatype xsd:integer ; # maxLength-datatype + sh:maxCount 1 ; # maxLength-maxCount + ] ; + sh:property [ + sh:path sh:minCount ; + sh:datatype xsd:integer ; # minCount-datatype + sh:maxCount 1 ; # minCount-maxCount + ] ; + sh:property [ + sh:path sh:minExclusive ; + sh:maxCount 1 ; # minExclusive-maxCount + sh:nodeKind sh:Literal ; # minExclusive-nodeKind + ] ; + sh:property [ + sh:path sh:minInclusive ; + sh:maxCount 1 ; # minInclusive-maxCount + sh:nodeKind sh:Literal ; # minInclusive-nodeKind + ] ; + sh:property [ + sh:path sh:minLength ; + sh:datatype xsd:integer ; # minLength-datatype + sh:maxCount 1 ; # minLength-maxCount + ] ; + sh:property [ + sh:path sh:nodeKind ; + sh:in ( sh:BlankNode sh:IRI sh:Literal sh:BlankNodeOrIRI sh:BlankNodeOrLiteral sh:IRIOrLiteral ) ; # nodeKind-in + sh:maxCount 1 ; # nodeKind-maxCount + ] ; + sh:property [ + sh:path sh:or ; + sh:node shsh:ListShape ; # or-node + ] ; + sh:property [ + sh:path sh:pattern ; + sh:datatype xsd:string ; # pattern-datatype + sh:maxCount 1 ; # multiple-parameters + # Not implemented: syntax rule pattern-regex + ] ; + sh:property [ + sh:path sh:flags ; + sh:datatype xsd:string ; # flags-datatype + sh:maxCount 1 ; # multiple-parameters + ] ; + sh:property [ + sh:path sh:qualifiedMaxCount ; + sh:datatype xsd:integer ; # qualifiedMaxCount-datatype + sh:maxCount 1 ; # multiple-parameters + ] ; + sh:property [ + sh:path sh:qualifiedMinCount ; + sh:datatype xsd:integer ; # qualifiedMinCount-datatype + sh:maxCount 1 ; # multiple-parameters + ] ; + sh:property [ + sh:path sh:qualifiedValueShape ; + sh:maxCount 1 ; # multiple-parameters + ] ; + sh:property [ + sh:path sh:qualifiedValueShapesDisjoint ; + sh:datatype xsd:boolean ; # qualifiedValueShapesDisjoint-datatype + sh:maxCount 1 ; # multiple-parameters + ] ; + sh:property [ + sh:path sh:uniqueLang ; + sh:datatype xsd:boolean ; # uniqueLang-datatype + sh:maxCount 1 ; # uniqueLang-maxCount + ] ; + sh:property [ + sh:path sh:xone ; + sh:node shsh:ListShape ; # xone-node + ] . + +shsh:NodeShapeShape + a sh:NodeShape ; + sh:targetObjectsOf sh:node ; # node-node + sh:property [ + sh:path sh:path ; + sh:maxCount 0 ; # NodeShape-path-maxCount + ] ; + sh:property [ + sh:path sh:lessThan ; + sh:maxCount 0 ; # lessThan-scope + ] ; + sh:property [ + sh:path sh:lessThanOrEquals ; + sh:maxCount 0 ; # lessThanOrEquals-scope + ] ; + sh:property [ + sh:path sh:maxCount ; + sh:maxCount 0 ; # maxCount-scope + ] ; + sh:property [ + sh:path sh:minCount ; + sh:maxCount 0 ; # minCount-scope + ] ; + sh:property [ + sh:path sh:qualifiedValueShape ; + sh:maxCount 0 ; # qualifiedValueShape-scope + ] ; + sh:property [ + sh:path sh:uniqueLang ; + sh:maxCount 0 ; # uniqueLang-scope + ] . + +shsh:PropertyShapeShape + a sh:NodeShape ; + sh:targetObjectsOf sh:property ; # property-node + sh:property [ + sh:path sh:path ; + sh:maxCount 1 ; # path-maxCount + sh:minCount 1 ; # PropertyShape-path-minCount + sh:node shsh:PathShape ; # path-node + ] . + +# Values of sh:and, sh:or and sh:xone must be lists of shapes +shsh:ShapesListShape + a sh:NodeShape ; + sh:targetObjectsOf sh:and ; # and-members-node + sh:targetObjectsOf sh:or ; # or-members-node + sh:targetObjectsOf sh:xone ; # xone-members-node + sh:property [ + sh:path ( [ sh:zeroOrMorePath rdf:rest ] rdf:first ) ; + sh:node shsh:ShapeShape ; + ] . + + +# A path of blank node path syntax, used to simulate recursion +_:PathPath + sh:alternativePath ( + ( [ sh:zeroOrMorePath rdf:rest ] rdf:first ) + ( sh:alternativePath [ sh:zeroOrMorePath rdf:rest ] rdf:first ) + sh:inversePath + sh:zeroOrMorePath + sh:oneOrMorePath + sh:zeroOrOnePath + ) . + +shsh:PathShape + a sh:NodeShape ; + rdfs:label "Path shape"@en ; + rdfs:comment "A shape that can be used to validate the syntax rules of well-formed SHACL paths."@en ; + rdfs:seeAlso ; + sh:property [ + sh:path [ sh:zeroOrMorePath _:PathPath ] ; + sh:node shsh:PathNodeShape ; + ] . + +shsh:PathNodeShape + sh:xone ( # path-metarule + [ sh:nodeKind sh:IRI ] # 2.3.1.1: Predicate path + [ sh:nodeKind sh:BlankNode ; # 2.3.1.2: Sequence path + sh:node shsh:PathListWithAtLeast2Members ; + ] + [ sh:nodeKind sh:BlankNode ; # 2.3.1.3: Alternative path + sh:closed true ; + sh:property [ + sh:path sh:alternativePath ; + sh:node shsh:PathListWithAtLeast2Members ; + sh:minCount 1 ; + sh:maxCount 1 ; + ] + ] + [ sh:nodeKind sh:BlankNode ; # 2.3.1.4: Inverse path + sh:closed true ; + sh:property [ + sh:path sh:inversePath ; + sh:minCount 1 ; + sh:maxCount 1 ; + ] + ] + [ sh:nodeKind sh:BlankNode ; # 2.3.1.5: Zero-or-more path + sh:closed true ; + sh:property [ + sh:path sh:zeroOrMorePath ; + sh:minCount 1 ; + sh:maxCount 1 ; + ] + ] + [ sh:nodeKind sh:BlankNode ; # 2.3.1.6: One-or-more path + sh:closed true ; + sh:property [ + sh:path sh:oneOrMorePath ; + sh:minCount 1 ; + sh:maxCount 1 ; + ] + ] + [ sh:nodeKind sh:BlankNode ; # 2.3.1.7: Zero-or-one path + sh:closed true ; + sh:property [ + sh:path sh:zeroOrOnePath ; + sh:minCount 1 ; + sh:maxCount 1 ; + ] + ] + ) . + +shsh:PathListWithAtLeast2Members + a sh:NodeShape ; + sh:node shsh:ListShape ; + sh:property [ + sh:path [ sh:oneOrMorePath rdf:rest ] ; + sh:minCount 2 ; # 1 other list node plus rdf:nil + ] . + +shsh:ShapesGraphShape + a sh:NodeShape ; + sh:targetObjectsOf sh:shapesGraph ; + sh:nodeKind sh:IRI . # shapesGraph-nodeKind + +shsh:EntailmentShape + a sh:NodeShape ; + sh:targetObjectsOf sh:entailment ; + sh:nodeKind sh:IRI . # entailment-nodeKind + diff --git a/src/main/resources/shapes/rml-fnml/tests.py b/src/main/resources/shapes/rml-fnml/tests.py new file mode 100755 index 00000000..1cfba5c5 --- /dev/null +++ b/src/main/resources/shapes/rml-fnml/tests.py @@ -0,0 +1,83 @@ +#!/usr/bin/env python +# +# (c) Dylan Van Assche (2020 - 2023) +# IDLab - Ghent University - imec +# MIT license +# + +import os +import argparse +import unittest +import logging +from parameterized import parameterized +from glob import glob +from rdflib import Graph + +from mapping_validator import MappingValidator + +TEST_CASES_DIR = os.path.join(os.path.abspath('../test-cases'), '*/mapping.ttl') +RESOURCES_DIR = os.path.join(os.path.abspath('../spec'), 'resources/*.ttl') +FNML_SHAPE_FILE = os.path.abspath('fnml.ttl') +SHACL_SHAPE_FILE = os.path.abspath('shacl.ttl') + + +class MappingValidatorTests(unittest.TestCase): + def _validate_rules(self, path: str) -> None: + rules = Graph().parse(path, format='turtle') + mapping_validator = MappingValidator(FNML_SHAPE_FILE) + mapping_validator.validate(rules) + + def _validate_shapes(self, path: str) -> None: + rules = Graph().parse(path, format='turtle') + mapping_validator = MappingValidator(SHACL_SHAPE_FILE) + mapping_validator.validate(rules) + + def test_non_existing_mapping_rules(self) -> None: + with self.assertRaises(FileNotFoundError): + p = os.path.abspath('does_not_exist.ttl') + self._validate_rules(p) + + @parameterized.expand([(p,) for p in sorted(glob(TEST_CASES_DIR))], skip_on_empty=True) + def test_validation_rules(self, path: str) -> None: + """ + Test if our SHACL shapes are able to validate our validation mapping + rules test cases. + """ + print(f'Testing validation with: {path}') + self._validate_rules(path) + + # @parameterized.expand([(p,) for p in sorted(glob(RESOURCES_DIR))], skip_on_empty=True) + # def test_resource_rules(self, path: str) -> None: + # """ + # Test if our SHACL shapes are able to validate our validation mapping + # rules resources. + # """ + # print(f'Testing validation with: {path}') + # self._validate_rules(path) + + def test_validation_shapes(self) -> None: + """ + Test if our SHACL shapes are valid according to the W3C Recommdendation + of SHACL. Validation with the official SHACL shapes for SHACL. + + See https://www.w3.org/TR/shacl/#shacl-shacl + """ + path = './fnml.ttl' + print(f'Testing shape with: {path}') + self._validate_shapes(path) + + +if __name__ == '__main__': + parser = argparse.ArgumentParser(description='Execute tests for SHACL shapes on RML mapping rules.') + parser.add_argument('--verbose', '-v', action='count', default=1, + help='Set verbosity level of messages. Example: -vvv') + args = parser.parse_args() + + args.verbose = 70 - (10 * args.verbose) if args.verbose > 0 else 0 + logging.basicConfig(level=args.verbose, + format='%(asctime)s %(levelname)s: %(message)s', + datefmt='%Y-%m-%d %H:%M:%S') + + print(TEST_CASES_DIR) + unittest.main(failfast=True) + diff --git a/src/main/resources/shapes/rml-io/generate_shape.py b/src/main/resources/shapes/rml-io/generate_shape.py new file mode 100755 index 00000000..ab6f2f53 --- /dev/null +++ b/src/main/resources/shapes/rml-io/generate_shape.py @@ -0,0 +1,79 @@ +#!/usr/bin/env python + +import argparse +import sys +from os import path +from glob import glob +from rdflib import Graph, Namespace +from rdflib.plugins.serializers.turtle import TurtleSerializer +from rdflib import plugin + +SUBSHAPE_FORMAT = 'turtle' +SUBSHAPE_GLOB_PATTERN = '*.ttl' +SHACL = Namespace('http://www.w3.org/ns/shacl#') +RML = Namespace('http://w3id.org/rml/') + + +class TurtleWithPrefixes(TurtleSerializer): + """ + A turtle serializer that always emits prefixes + Workaround for https://github.com/RDFLib/rdflib/issues/1048 + """ + roundtrip_prefixes = True # Undocumented, forces to write all prefixes + + +class ShapeGenerator: + """ + Generates a complete SHACL shape of all the SHACL subshapes. + Useful for using the shapes in the shacl.org Playground. + """ + def __init__(self, glob_pattern: str, rdf_format: str, + destination: str) -> None: + self._glob_pattern: str = glob_pattern + self._rdf_format: str = rdf_format + self._destination: str = destination + self._shape = Graph() + self._shape.bind('sh', SHACL) + self._shape.bind('rml', RML) + # Register TurtleWithPrefixes serializer as 'tortoise' format + plugin.register('tortoise', + plugin.Serializer, + 'generate_shape', + 'TurtleWithPrefixes') + + def generate(self) -> None: + """ + Generate a full shape from the sub shapes. + """ + print('Reading subshapes:') + for sub_shape in glob(self._glob_pattern): + if 'io' in sub_shape: + continue + print(f"\t{sub_shape}") + g = Graph() + g.bind('sh', SHACL) + g.bind('rml', RML) + self._shape += g.parse(sub_shape, format=self._rdf_format) + + print(f'Writing shape to {self._destination}') + self._shape.serialize(destination=self._destination, format='tortoise') + + +if __name__ == '__main__': + p = argparse.ArgumentParser(description='Generate a complete SHACL shape ' + 'from the subshapes.') + p.add_argument('destination', type=str, help='Location to write the ' + 'complete SHACL shape as Turtle.') + # Arguments parsing + args = p.parse_args() + if not path.exists(args.destination): + print(f'{args.destination} file path does not exist!') + sys.exit(1) + + if path.isdir(args.destination): + args.destination = path.join(args.destination, 'io.ttl') + + # Generate shape + generator = ShapeGenerator(SUBSHAPE_GLOB_PATTERN, SUBSHAPE_FORMAT, + args.destination) + generator.generate() diff --git a/src/main/resources/shapes/rml-io/io.ttl b/src/main/resources/shapes/rml-io/io.ttl new file mode 100644 index 00000000..caef0b46 --- /dev/null +++ b/src/main/resources/shapes/rml-io/io.ttl @@ -0,0 +1,283 @@ +@prefix brick: . +@prefix csvw: . +@prefix dc: . +@prefix dcam: . +@prefix dcat: . +@prefix dcmitype: . +@prefix dcterms: . +@prefix doap: . +@prefix foaf: . +@prefix geo: . +@prefix odrl: . +@prefix org: . +@prefix owl: . +@prefix prof: . +@prefix prov: . +@prefix qb: . +@prefix rdf: . +@prefix rdfs: . +@prefix rml: . +@prefix schema: . +@prefix sh: . +@prefix skos: . +@prefix sosa: . +@prefix ssn: . +@prefix time: . +@prefix vann: . +@prefix void: . +@prefix wgs: . +@prefix xml: . +@prefix xsd: . + + a owl:Ontology ; + owl:imports . + + a sh:NodeShape ; + rdfs:label "RML Logical Source" ; + rdfs:comment """ + A logical source is any source that is mapped to RDF triples. + """ ; + sh:message """ + RML Logical Source requires one rml:source and requires everyting + an Abstract Logical Source requires. + """ ; + sh:property [ rdfs:label "rml:source" ; + rdfs:comment """ + The source (rml:source) locates the input data source. It is a URI + that represents the data source where the data source is. + """ ; + sh:maxCount 1 ; + sh:message """ + rml:source must be provided to locate the data source. + rml:source must be provided exactly once as an URI. + """ ; + sh:minCount 1 ; + sh:node ; + sh:nodeKind sh:BlankNodeOrIRI ; + sh:path rml:source ] ; + sh:targetClass rml:LogicalSource ; + sh:targetSubjectsOf rml:source . + + a sh:NodeShape ; + rdfs:label "RML Logical Target" ; + rdfs:comment """ + A logical target is any target to where generated RDF triples are exported + to. + """ ; + sh:message """ + RML Logical Target requires one rml:target. + """ ; + sh:property [ rdfs:label "rml:target" ; + rdfs:comment """ + The target (rml:target) locates the output target. It is a URI + that represents the target where it must export generated RDF triples + to. + """ ; + sh:maxCount 1 ; + sh:message """ + rml:target must be provided to locate the target. rml:target must + be provided exactly once as an URI. + """ ; + sh:minCount 1 ; + sh:node ; + sh:nodeKind sh:BlankNodeOrIRI ; + sh:path rml:target ] ; + sh:targetClass rml:LogicalTarget ; + sh:targetObjectsOf rml:logicalTarget . + + a sh:NodeShape ; + rdfs:label "RML Relative Path Source" ; + rdfs:comment """ + A RML Relative Path Source provides a source with relative paths which is + not provided by existing vocabularies such as DCAT without a base IRI. + """ ; + sh:message """ + RML Relative Path Source accepts one rml:root, and one rml:path. + rml:root is optional and defaults to rml:CurrentWorkingDirectory. + """ ; + sh:property [ rdfs:label "rml:root" ; + rdfs:comment """ + rml:root defines the root directory against which relative paths are + resolved. If not provided, defaults to the current working directory. + """ ; + sh:in ( rml:CurrentWorkingDirectory rml:MappingDirectory ) ; + sh:maxCount 1 ; + sh:message """ + rml:root must be either rml:CurrentWorkingDirectory or + rml:MappingDirectory. + """ ; + sh:minCount 0 ; + sh:path rml:root ], + [ rdfs:label "rml:path" ; + rdfs:comment """ + rml:path specifies the relative path to access for the source. + """ ; + sh:maxCount 1 ; + sh:message """ + rml:path must be a string Literal. + """ ; + sh:minCount 1 ; + sh:nodeKind sh:Literal ; + sh:path rml:path ] ; + sh:targetClass rml:RelativePathSource . + + a sh:NodeShape ; + rdfs:label "RML Relative Path Target" ; + rdfs:comment """ + A RML Relative Path Target provides a target with relative paths which is + not provided by existing vocabularies such as DCAT without a base IRI. + """ ; + sh:message """ + RML Relative Path Target accepts one rml:root, and one rml:path. + rml:root is optional and defaults to rml:CurrentWorkingDirectory. + """ ; + sh:property [ rdfs:label "rml:root" ; + rdfs:comment """ + rml:root defines the root directory against which relative paths are + resolved. If not provided, defaults to the current working directory. + """ ; + sh:in ( rml:CurrentWorkingDirectory rml:MappingDirectory ) ; + sh:maxCount 1 ; + sh:message """ + rml:root must be either rml:CurrentWorkingDirectory or + rml:MappingDirectory. + """ ; + sh:minCount 0 ; + sh:path rml:root ], + [ rdfs:label "rml:path" ; + rdfs:comment """ + rml:path specifies the relative path to access for the target. + """ ; + sh:maxCount 1 ; + sh:message """ + rml:path must be a string Literal. + """ ; + sh:minCount 1 ; + sh:nodeKind sh:Literal ; + sh:path rml:path ] ; + sh:targetClass rml:RelativePathTarget . + + a sh:NodeShape ; + rdfs:label "RML Source" ; + rdfs:comment """ + A source describes access to a data source. Any data access description + is allowed, but rml:Source provides additional properties to complete + such descriptions. + """ ; + sh:message """ + RML Source accepts one or multiple rml:null, one rml:compression, + and one rml:encoding. All of them are optional. + """ ; + sh:property [ rdfs:label "rml:null" ; + rdfs:comment """ + rml:null specifies how NULL or empty values are exposed by the data + source. + """ ; + sh:datatype xsd:string ; + sh:message """ + rml:source must be provided as a string Literal. + """ ; + sh:minCount 0 ; + sh:nodeKind sh:Literal ; + sh:path rml:null ], + [ rdfs:label "rml:compression" ; + rdfs:comment """ + rml:compression specifies the compression algorithm to use when + accessing the data source. By default, no compression is applied. + """ ; + sh:maxCount 1 ; + sh:message """ + rml:compression must be provided as an IRI. + """ ; + sh:minCount 0 ; + sh:nodeKind sh:IRI ; + sh:path rml:compression ], + [ rdfs:label "rml:encoding" ; + rdfs:comment """ + rml:encoding specifies the encoding to use when accessing the data + source. By default, UTF-8 is used. + """ ; + sh:maxCount 1 ; + sh:message """ + rml:encoding must be provided as an IRI. + """ ; + sh:minCount 0 ; + sh:nodeKind sh:IRI ; + sh:path rml:encoding ], + [ rdfs:label "rml:null" ; + rdfs:comment """ + rml:null specifies which data values inside the source should be + considered as NULL. Defaults to the default NULL character of a source, + if available. + """ ; + sh:message """ + rml:null must be provided as a Literal. + """ ; + sh:minCount 0 ; + sh:nodeKind sh:Literal ; + sh:path rml:null ] ; + sh:targetClass rml:Source ; + sh:targetObjectsOf rml:source . + + a sh:NodeShape ; + rdfs:label "RML Target" ; + rdfs:comment """ + A target describes access to a data target. Any data access description + is allowed, but rml:Target provides additional properties to complete + such descriptions. + """ ; + sh:message """ + RML Target accepts one rml:compression, and one rml:encoding. + All of them are optional. + """ ; + sh:property [ rdfs:label "rml:compression" ; + rdfs:comment """ + rml:compression specifies the compression algorithm to use when + accessing the data target. By default, no compression is applied. + """ ; + sh:maxCount 1 ; + sh:message """ + rml:compression must be provided as an IRI. + """ ; + sh:minCount 0 ; + sh:nodeKind sh:IRI ; + sh:path rml:compression ], + [ rdfs:label "rml:encoding" ; + rdfs:comment """ + rml:encoding specifies the encoding to use when accessing the data + target. By default, UTF-8 is used. + """ ; + sh:maxCount 1 ; + sh:message """ + rml:encoding must be provided as an IRI. + """ ; + sh:minCount 0 ; + sh:nodeKind sh:IRI ; + sh:path rml:encoding ], + [ rdfs:label "rml:serialization" ; + rdfs:comment """ + rml:serialization specifies the serialization format to use when + exporting the generated RDF to a target. By default N-Quads is used. + """ ; + sh:maxCount 1 ; + sh:message """ + rml:serialization must be provided as an IRI. + """ ; + sh:minCount 0 ; + sh:nodeKind sh:IRI ; + sh:path rml:serialization ], + [ rdfs:label "rml:mode" ; + rdfs:comment """ + rml:mode specifies in which mode the target is opened such as read-only, + write-only, both, etc. + """ ; + sh:in ( rml:Read rml:ReadWrite rml:Write rml:WriteRead rml:Append rml:AppendRead ) ; + sh:maxCount 1 ; + sh:message """ + rml:mode must be specified by any of the modes from rml:Mode class. + """ ; + sh:minCount 0 ; + sh:path rml:mode ] ; + sh:targetClass rml:Target ; + sh:targetObjectsOf rml:target . + diff --git a/src/main/resources/shapes/rml-io/logical_source.ttl b/src/main/resources/shapes/rml-io/logical_source.ttl new file mode 100644 index 00000000..b185fdf1 --- /dev/null +++ b/src/main/resources/shapes/rml-io/logical_source.ttl @@ -0,0 +1,43 @@ +############################################################################### +# RML Logical Source shape # +# Copyright Dylan Van Assche, IDLab - UGent - imec (2020 - 2024) # +############################################################################### +@prefix sh: . +@prefix rdfs: . +@prefix : . +@prefix rdf: . +@prefix rml: . +@prefix xsd: . + +:RMLLogicalSourceShape + a sh:NodeShape ; + sh:targetSubjectsOf rml:source ; + sh:targetClass rml:LogicalSource ; # Used as a class + # Already targets 'rml:logicalSource' + rdfs:label "RML Logical Source" ; + rdfs:comment """ + A logical source is any source that is mapped to RDF triples. + """ ; + sh:message """ + RML Logical Source requires one rml:source and requires everyting + an Abstract Logical Source requires. + """ ; + + # rml:source + sh:property [ + sh:path rml:source ; + rdfs:label "rml:source" ; + rdfs:comment """ + The source (rml:source) locates the input data source. It is a URI + that represents the data source where the data source is. + """ ; + sh:message """ + rml:source must be provided to locate the data source. + rml:source must be provided exactly once as an URI. + """ ; + sh:minCount 1 ; + sh:maxCount 1 ; + sh:nodeKind sh:BlankNodeOrIRI; + sh:node :RMLSourceShape; + ] ; +. diff --git a/src/main/resources/shapes/rml-io/logical_target.ttl b/src/main/resources/shapes/rml-io/logical_target.ttl new file mode 100644 index 00000000..c4116441 --- /dev/null +++ b/src/main/resources/shapes/rml-io/logical_target.ttl @@ -0,0 +1,44 @@ +############################################################################### +# RML Logical Target shape # +# Copyright Dylan Van Assche, IDLab - UGent - imec (2023 - 2024) # +############################################################################### +@prefix sh: . +@prefix rdfs: . +@prefix : . +@prefix rdf: . +@prefix rml: . +@prefix xsd: . + +:RMLLogicalTargetShape + a sh:NodeShape ; + sh:targetObjectsOf rml:logicalTarget ; # Object of rml:TriplesMap + sh:targetClass rml:LogicalTarget ; # Used as a class + # Already targets 'rml:logicalTarget' + rdfs:label "RML Logical Target" ; + rdfs:comment """ + A logical target is any target to where generated RDF triples are exported + to. + """ ; + sh:message """ + RML Logical Target requires one rml:target. + """ ; + + # rml:target + sh:property [ + sh:path rml:target ; + rdfs:label "rml:target" ; + rdfs:comment """ + The target (rml:target) locates the output target. It is a URI + that represents the target where it must export generated RDF triples + to. + """ ; + sh:message """ + rml:target must be provided to locate the target. rml:target must + be provided exactly once as an URI. + """ ; + sh:minCount 1 ; + sh:maxCount 1 ; + sh:nodeKind sh:BlankNodeOrIRI; + sh:node :RMLTargetShape; + ] ; +. diff --git a/src/main/resources/shapes/rml-io/mapping_validator.py b/src/main/resources/shapes/rml-io/mapping_validator.py new file mode 100644 index 00000000..033c8b87 --- /dev/null +++ b/src/main/resources/shapes/rml-io/mapping_validator.py @@ -0,0 +1,45 @@ +from logging import debug, info, critical +from pyshacl import validate +from rdflib import Graph +from shutil import get_terminal_size + + +class MappingValidator: + def __init__(self, shape: str, ontology: str) -> None: + sg = Graph() + sg.parse(shape, format='turtle') + self._shape = sg + og = Graph() + og.parse(ontology, format='turtle') + self._ont = og + + def validate(self, rules: Graph, print_report: bool = True) -> None: + valid: bool + report_graph: Graph + report_text: str + valid, report_graph, report_text = validate(rules, + shacl_graph=self._shape, + ont_graph=self._ont, + do_owl_imports=True) + debug(f'RML rules valid: {valid}') + debug(f'SHACL validation report: {report_text}') + + # If mapping rules are invalid, print SHACL report and raise exception + if not valid and print_report: + self._print_report(report_text) + msg = 'RML mapping rules are invalid, a detailed explanation' \ + ' is available in the report' + critical(msg) + raise ValueError(msg) + + def _print_report(self, report_text: str) -> None: + tty_columns: int + tty_columns, _ = get_terminal_size() + info('-' * tty_columns) + title: str = 'RML rules validation report' + white_space: int = int((tty_columns - len(title)) / 2) + title = ' ' * white_space + title + ' ' * white_space + info(title) + info('-' * tty_columns) + info(report_text) + info('-' * tty_columns) diff --git a/src/main/resources/shapes/rml-io/relative_path_source.ttl b/src/main/resources/shapes/rml-io/relative_path_source.ttl new file mode 100644 index 00000000..0bf5d2b8 --- /dev/null +++ b/src/main/resources/shapes/rml-io/relative_path_source.ttl @@ -0,0 +1,56 @@ +############################################################################### +# RML Relative Path Source shape # +# Copyright Dylan Van Assche, IDLab - UGent - imec (2024) # +############################################################################### +@prefix sh: . +@prefix rdfs: . +@prefix : . +@prefix rdf: . +@prefix rml: . +@prefix xsd: . + +:RMLRelativePathSourceShape + a sh:NodeShape ; + sh:targetClass rml:RelativePathSource ; # Used as a class + rdfs:label "RML Relative Path Source" ; + rdfs:comment """ + A RML Relative Path Source provides a source with relative paths which is + not provided by existing vocabularies such as DCAT without a base IRI. + """ ; + sh:message """ + RML Relative Path Source accepts one rml:root, and one rml:path. + rml:root is optional and defaults to rml:CurrentWorkingDirectory. + """ ; + + # rml:root + sh:property [ + sh:path rml:root ; + rdfs:label "rml:root" ; + rdfs:comment """ + rml:root defines the root directory against which relative paths are + resolved. If not provided, defaults to the current working directory. + """ ; + sh:message """ + rml:root must be either rml:CurrentWorkingDirectory or + rml:MappingDirectory. + """ ; + sh:minCount 0 ; + sh:maxCount 1 ; + sh:in (rml:CurrentWorkingDirectory rml:MappingDirectory) ; + ] ; + + # rml:path + sh:property [ + sh:path rml:path ; + rdfs:label "rml:path" ; + rdfs:comment """ + rml:path specifies the relative path to access for the source. + """ ; + sh:message """ + rml:path must be a string Literal. + """ ; + sh:minCount 1 ; + sh:maxCount 1 ; + sh:nodeKind sh:Literal ; + ] ; +. diff --git a/src/main/resources/shapes/rml-io/relative_path_target.ttl b/src/main/resources/shapes/rml-io/relative_path_target.ttl new file mode 100644 index 00000000..980d5373 --- /dev/null +++ b/src/main/resources/shapes/rml-io/relative_path_target.ttl @@ -0,0 +1,56 @@ +############################################################################### +# RML Relative Path Target shape # +# Copyright Dylan Van Assche, IDLab - UGent - imec (2024) # +############################################################################### +@prefix sh: . +@prefix rdfs: . +@prefix : . +@prefix rdf: . +@prefix rml: . +@prefix xsd: . + +:RMLRelativePathTargetShape + a sh:NodeShape ; + sh:targetClass rml:RelativePathTarget ; # Used as a class + rdfs:label "RML Relative Path Target" ; + rdfs:comment """ + A RML Relative Path Target provides a target with relative paths which is + not provided by existing vocabularies such as DCAT without a base IRI. + """ ; + sh:message """ + RML Relative Path Target accepts one rml:root, and one rml:path. + rml:root is optional and defaults to rml:CurrentWorkingDirectory. + """ ; + + # rml:root + sh:property [ + sh:path rml:root ; + rdfs:label "rml:root" ; + rdfs:comment """ + rml:root defines the root directory against which relative paths are + resolved. If not provided, defaults to the current working directory. + """ ; + sh:message """ + rml:root must be either rml:CurrentWorkingDirectory or + rml:MappingDirectory. + """ ; + sh:minCount 0 ; + sh:maxCount 1 ; + sh:in (rml:CurrentWorkingDirectory rml:MappingDirectory) ; + ] ; + + # rml:path + sh:property [ + sh:path rml:path ; + rdfs:label "rml:path" ; + rdfs:comment """ + rml:path specifies the relative path to access for the target. + """ ; + sh:message """ + rml:path must be a string Literal. + """ ; + sh:minCount 1 ; + sh:maxCount 1 ; + sh:nodeKind sh:Literal ; + ] ; +. diff --git a/src/main/resources/shapes/rml-io/requirements.txt b/src/main/resources/shapes/rml-io/requirements.txt new file mode 100644 index 00000000..3d264b8e --- /dev/null +++ b/src/main/resources/shapes/rml-io/requirements.txt @@ -0,0 +1,3 @@ +parameterized +rdflib +pyshacl diff --git a/src/main/resources/shapes/rml-io/shapes_graph.ttl b/src/main/resources/shapes/rml-io/shapes_graph.ttl new file mode 100644 index 00000000..40f733c4 --- /dev/null +++ b/src/main/resources/shapes/rml-io/shapes_graph.ttl @@ -0,0 +1,5 @@ +@prefix owl: . + + a owl:Ontology ; + owl:imports ; +. diff --git a/src/main/resources/shapes/rml-io/source.ttl b/src/main/resources/shapes/rml-io/source.ttl new file mode 100644 index 00000000..9a29e45c --- /dev/null +++ b/src/main/resources/shapes/rml-io/source.ttl @@ -0,0 +1,91 @@ +############################################################################### +# RML Source shape # +# Copyright Dylan Van Assche, IDLab - UGent - imec (2023 - 2024) # +############################################################################### +@prefix sh: . +@prefix rdfs: . +@prefix : . +@prefix rdf: . +@prefix rml: . +@prefix xsd: . + +:RMLSourceShape + a sh:NodeShape ; + sh:targetObjectsOf rml:source ; # Object of rml:LogicalSource + sh:targetClass rml:Source ; # Used as a class + # Already targets 'rml:source' + rdfs:label "RML Source" ; + rdfs:comment """ + A source describes access to a data source. Any data access description + is allowed, but rml:Source provides additional properties to complete + such descriptions. + """ ; + sh:message """ + RML Source accepts one or multiple rml:null, one rml:compression, + and one rml:encoding. All of them are optional. + """ ; + + # rml:null + sh:property [ + sh:path rml:null ; + rdfs:label "rml:null" ; + rdfs:comment """ + rml:null specifies how NULL or empty values are exposed by the data + source. + """ ; + sh:message """ + rml:source must be provided as a string Literal. + """ ; + sh:minCount 0 ; + sh:nodeKind sh:Literal; + sh:datatype xsd:string ; + ] ; + + # rml:compression + sh:property [ + sh:path rml:compression ; + rdfs:label "rml:compression" ; + rdfs:comment """ + rml:compression specifies the compression algorithm to use when + accessing the data source. By default, no compression is applied. + """ ; + sh:message """ + rml:compression must be provided as an IRI. + """ ; + sh:minCount 0 ; + sh:maxCount 1 ; + sh:nodeKind sh:IRI; + ] ; + + # rml:encoding + sh:property [ + sh:path rml:encoding ; + rdfs:label "rml:encoding" ; + rdfs:comment """ + rml:encoding specifies the encoding to use when accessing the data + source. By default, UTF-8 is used. + """ ; + sh:message """ + rml:encoding must be provided as an IRI. + """ ; + sh:minCount 0; + sh:maxCount 1 ; + sh:nodeKind sh:IRI ; + ] ; + + # rml:null + sh:property [ + sh:path rml:null ; + rdfs:label "rml:null" ; + rdfs:comment """ + rml:null specifies which data values inside the source should be + considered as NULL. Defaults to the default NULL character of a source, + if available. + """ ; + sh:message """ + rml:null must be provided as a Literal. + """ ; + sh:minCount 0; + sh:nodeKind sh:Literal ; + ] ; +. diff --git a/src/main/resources/shapes/rml-io/target.ttl b/src/main/resources/shapes/rml-io/target.ttl new file mode 100644 index 00000000..82b55a0b --- /dev/null +++ b/src/main/resources/shapes/rml-io/target.ttl @@ -0,0 +1,92 @@ +############################################################################### +# RML Target shape # +# Copyright Dylan Van Assche, IDLab - UGent - imec (2023 - 2024) # +############################################################################### +@prefix sh: . +@prefix rdfs: . +@prefix : . +@prefix rdf: . +@prefix rml: . +@prefix xsd: . + +:RMLTargetShape + a sh:NodeShape ; + sh:targetObjectsOf rml:target ; # Object of rml:LogicalTarget + sh:targetClass rml:Target ; # Used as a class + # Already targets 'rml:target' + rdfs:label "RML Target" ; + rdfs:comment """ + A target describes access to a data target. Any data access description + is allowed, but rml:Target provides additional properties to complete + such descriptions. + """ ; + sh:message """ + RML Target accepts one rml:compression, and one rml:encoding. + All of them are optional. + """ ; + + # rml:compression + sh:property [ + sh:path rml:compression ; + rdfs:label "rml:compression" ; + rdfs:comment """ + rml:compression specifies the compression algorithm to use when + accessing the data target. By default, no compression is applied. + """ ; + sh:message """ + rml:compression must be provided as an IRI. + """ ; + sh:minCount 0 ; + sh:maxCount 1 ; + sh:nodeKind sh:IRI; + ] ; + + # rml:encoding + sh:property [ + sh:path rml:encoding ; + rdfs:label "rml:encoding" ; + rdfs:comment """ + rml:encoding specifies the encoding to use when accessing the data + target. By default, UTF-8 is used. + """ ; + sh:message """ + rml:encoding must be provided as an IRI. + """ ; + sh:minCount 0 ; + sh:maxCount 1 ; + sh:nodeKind sh:IRI ; + ] ; + + # rml:serialization + sh:property [ + sh:path rml:serialization ; + rdfs:label "rml:serialization" ; + rdfs:comment """ + rml:serialization specifies the serialization format to use when + exporting the generated RDF to a target. By default N-Quads is used. + """ ; + sh:message """ + rml:serialization must be provided as an IRI. + """ ; + sh:minCount 0 ; + sh:maxCount 1 ; + sh:nodeKind sh:IRI ; + ] ; + + # rml:mode + sh:property [ + sh:path rml:mode ; + rdfs:label "rml:mode" ; + rdfs:comment """ + rml:mode specifies in which mode the target is opened such as read-only, + write-only, both, etc. + """ ; + sh:message """ + rml:mode must be specified by any of the modes from rml:Mode class. + """ ; + sh:minCount 0 ; + sh:maxCount 1 ; + sh:in (rml:Read rml:ReadWrite rml:Write rml:WriteRead rml:Append + rml:AppendRead) ; + ] ; +. diff --git a/src/main/resources/shapes/rml-io/tests.py b/src/main/resources/shapes/rml-io/tests.py new file mode 100755 index 00000000..ef6666ae --- /dev/null +++ b/src/main/resources/shapes/rml-io/tests.py @@ -0,0 +1,72 @@ +#!/usr/bin/env python +# +# (c) Dylan Van Assche (2020 - 2023) +# IDLab - Ghent University - imec +# MIT license +# + +import os +import argparse +import unittest +import logging +from parameterized import parameterized +from glob import glob +from rdflib import Graph + +from mapping_validator import MappingValidator +from utils import replace_strings_in_file, cleanup_tmp_folder + +TEST_CASES_DIR = os.path.join(os.path.abspath('../test-cases'), '*/*.ttl') +SHAPE_FILE_LOCATION = 'io.ttl' +ONTOLOGY_FILE_LOCATION = '../ontology/documentation/ontology.ttl' + + +class MappingValidatorTests(unittest.TestCase): + def _validate_rules(self, path: str) -> None: + rules = Graph().parse(path, format='turtle') + + # Replace import statements + shapes = replace_strings_in_file(SHAPE_FILE_LOCATION, { + '': '' + }) + ontology = replace_strings_in_file(ONTOLOGY_FILE_LOCATION, { + '': '' + }) + + mapping_validator = MappingValidator(shapes, ontology) + mapping_validator.validate(rules) + + cleanup_tmp_folder(shapes) + cleanup_tmp_folder(ontology) + + def test_non_existing_mapping_rules(self) -> None: + with self.assertRaises(FileNotFoundError): + p = os.path.abspath('does_not_exist.ttl') + self._validate_rules(p) + + @parameterized.expand([(p,) for p in sorted(glob(TEST_CASES_DIR))], + skip_on_empty=True) + def test_validation_rules(self, path: str) -> None: + """ + Test if our SHACL shapes are able to validate our validation mapping + rules test cases. + """ + print(f'Testing validation with: {path}') + self._validate_rules(path) + + +if __name__ == '__main__': + parser = argparse.ArgumentParser(description='Execute tests for SHACL ' + 'shapes on RML mapping rules.') + parser.add_argument('--verbose', '-v', action='count', default=1, + help='Set verbosity level of messages. Example: -vvv') + args = parser.parse_args() + + args.verbose = 70 - (10 * args.verbose) if args.verbose > 0 else 0 + logging.basicConfig(level=args.verbose, + format='%(asctime)s %(levelname)s: %(message)s', + datefmt='%Y-%m-%d %H:%M:%S') + + print(TEST_CASES_DIR) + unittest.main(failfast=False) + diff --git a/src/main/resources/shapes/rml-io/utils.py b/src/main/resources/shapes/rml-io/utils.py new file mode 100644 index 00000000..437871a7 --- /dev/null +++ b/src/main/resources/shapes/rml-io/utils.py @@ -0,0 +1,25 @@ +import os +import shutil + +def replace_strings_in_file(file_path: str, replacements: dict) -> str: + abs_path = os.path.abspath(file_path) + tmp_dir = os.path.join(os.path.dirname(abs_path), 'tmp') + os.makedirs(tmp_dir, exist_ok=True) + tmp_file_path = os.path.join(tmp_dir, os.path.basename(abs_path)) + + with open(abs_path, 'r') as file: + file_data = file.read() + + for old_string, new_string in replacements.items(): + file_data = file_data.replace(old_string, new_string) + + with open(tmp_file_path, 'w') as file: + file.write(file_data) + + return tmp_file_path + +def cleanup_tmp_folder(file_path: str) -> None: + abs_path = os.path.abspath(file_path) + tmp_dir = os.path.dirname(abs_path) + if os.path.exists(tmp_dir): + shutil.rmtree(tmp_dir) diff --git a/src/main/resources/shapes/rml-lv/lv.ttl b/src/main/resources/shapes/rml-lv/lv.ttl new file mode 100644 index 00000000..31a23bea --- /dev/null +++ b/src/main/resources/shapes/rml-lv/lv.ttl @@ -0,0 +1,344 @@ +@prefix owl: . +@prefix rml: . +@prefix rmlsh: . +@prefix sh: . +@prefix xsd: . +@prefix rdfs: . + + a owl:Ontology ; + owl:imports ; +. + +# rml:LogicalView +rmlsh:LogicalViewShape a sh:NodeShape ; + rdfs:label "LogicalView" ; + rdfs:comment """ + A logical view (rml:LogicalView) is a type of abstract logical source that is derived from another abstract logical source by defining fields with data from said abstract logical source. + """ ; + sh:message """ + Node must have a valid rml:LogicalView description. + rml:LogicalView requires + - exactly one rml:viewOn property, with a rml:AbstractLogicalSource as its value. + - at least one rml:field property, with a rml:Field as its value. + """ ; + sh:targetClass rml:LogicalView ; + sh:targetSubjectsOf rml:viewOn ; + sh:targetObjectsOf rml:parentLogicalView ; + sh:property [ + sh:description """ + The source of the logical view. This is the logical source from which the logical view is derived. + """ ; + sh:message """ + Exactly one rml:viewOn property must be specified for a rml:LogicalView, with a rml:AbstractLogicalSource as its value. + """ ; + sh:path rml:viewOn ; + sh:minCount 1 ; + sh:maxCount 1 ; + sh:node rmlsh:RMLAbstractLogicalSourceShape ; + sh:nodeKind sh:BlankNodeOrIRI ; + ] , [ + sh:description """ + A field of the logical view. + """ ; + sh:message """ + At least one rml:field property must be specified for a rml:LogicalView, with either an rml:ExpressionField or an rml:IterableField its value. + """ ; + sh:path rml:field ; + sh:minCount 1 ; + sh:nodeKind sh:BlankNodeOrIRI ; + sh:or ( + [ sh:node rmlsh:ExpressionFieldShape ] + [ sh:node rmlsh:IterableFieldShape ] + ) + ] , [ + sh:description """ + A left join of the logical view. + """ ; + sh:message """ + The value of a rml:leftJoin property for a rml:LogicalView must be a resource. + """ ; + sh:path rml:leftJoin ; + sh:nodeKind sh:BlankNodeOrIRI ; + ] , [ + sh:description """ + An inner join of the logical view. + """ ; + sh:message """ + The value of a rml:innerJoin property for a rml:LogicalView must be a resource. + """ ; + sh:path rml:innerJoin ; + sh:nodeKind sh:BlankNodeOrIRI ; + ] , + [ + sh:description """ + A structural annotation of the logical view. + """ ; + sh:message """ + The value of a rml:structuralAnnotation property must be a resource. + """ ; + sh:path rml:structuralAnnotation ; + sh:nodeKind sh:BlankNodeOrIRI ; + ] +. + +rmlsh:FieldShape a sh:NodeShape ; + rdfs:label "Field" ; + rdfs:comment """ + A field is a construct that gives a name to data derived from an abstract logical source. + """ ; + sh:message """ + Node must have a valid rml:Field description. + rml:Field requires a rml:fieldName and may have zero or more rml:field properties. + Furthermore, subclass rml:ExpressionField requires what an rml:ExpressionMap requires, subclass rml:IterableField requires what an rml:Iterable requires,. + """ ; + sh:targetClass rml:Field ; + sh:targetObjectsOf rml:field ; + sh:property [ + sh:description """ + The name of the field. + """ ; + sh:message """ + Exactly one rml:fieldName property must be specified for a rml:Field, with a string as its value. + """ ; + sh:path rml:fieldName ; + sh:minCount 1 ; + sh:maxCount 1 ; + sh:datatype xsd:string ; + sh:nodeKind sh:Literal ; + ] , [ + sh:description """ + A child field of the field. + """ ; + sh:message """ + The value of a rml:field property for a rml:Field must be a resource. + """ ; + sh:path rml:field ; + sh:nodeKind sh:BlankNodeOrIRI ; + sh:or ( + [ sh:node rmlsh:ExpressionFieldShape ] + [ sh:node rmlsh:IterableFieldShape ] + ) + ] . + +rmlsh:ExpressionFieldShape a sh:NodeShape ; + rdfs:label "Expression Field" ; + rdfs:comment """ + A expression field is an expression map that gives a name to an expression. + """ ; + sh:message """ + Node must have a valid rml:ExpressionField description. + rml:ExpressionField requires what an rml:ExpressionMap and rml:Field requires. + """ ; + sh:targetClass rml:ExpressionField ; + sh:node rmlsh:RMLExpressionMapShape ; + ## Not using sh:node rmlsh:Field here due to shape recursion problem https://github.com/RDFLib/pySHACL/issues/154 + sh:property [ + sh:description """ + The name of the field. + """ ; + sh:message """ + Exactly one rml:fieldName property must be specified for a rml:Field, with a string as its value. + """ ; + sh:path rml:fieldName ; + sh:minCount 1 ; + sh:maxCount 1 ; + sh:datatype xsd:string ; + sh:nodeKind sh:Literal ; + ] , [ + sh:description """ + A child field of the field. + """ ; + sh:message """ + The value of a rml:field property for a rml:Field must be a resource. + """ ; + sh:path rml:field ; + sh:nodeKind sh:BlankNodeOrIRI ; + ## Disabled due to shape recursion. This is covered by rmlsh:FieldShape + # sh:or ( + # [ sh:node rmlsh:ExpressionFieldShape ] + # [ sh:node rmlsh:IterableFieldShape ] + # ) + ] +. + +rmlsh:IterableFieldShape a sh:NodeShape ; + rdfs:label "Iterable Field" ; + rdfs:comment """ + An iterable field is a construction that gives a name to logical iterations derived from the parent of the field. + """ ; + sh:message """ + Node must have a valid rml:IterableField description. + rml:IterableField must have one or more rml:field properties. + Furthermore, rml:IterableField requires what an rml:Iterable and rml:Field requires. + """ ; + sh:targetClass rml:IterableField ; + sh:node rmlsh:RMLIterableShape ; + ## Not using sh:node rmlsh:Field here due to shape recursion problem https://github.com/RDFLib/pySHACL/issues/154 + sh:property [ + sh:description """ + The name of the field. + """ ; + sh:message """ + Exactly one rml:fieldName property must be specified for a rml:Field, with a string as its value. + """ ; + sh:path rml:fieldName ; + sh:minCount 1 ; + sh:maxCount 1 ; + sh:datatype xsd:string ; + sh:nodeKind sh:Literal ; + ] ; + sh:property [ + sh:description """ + A child field of the iterable field. + """ ; + sh:message """ + The value of a rml:field property for a rml:Field must be a resource that describes an rml:ExpressionField. + """ ; + sh:path rml:field ; + sh:minCount 1 ; + sh:nodeKind sh:BlankNodeOrIRI ; + ] . + +rmlsh:LogicalViewJoinShape a sh:NodeShape ; + rdfs:label "LogicalViewJoin" ; + rdfs:comment """ + A LogicalViewJoin is an operation that adapts the logical iterations of one logical view (the child logical view) with fields from another logical view (the parent logical view). + """ ; + sh:message """ + Node must have a valid rml:LogicalViewJoin description. + rml:LogicalViewJoin requires: + - exactly one rml:parentLogicalView property. + - one or more rml:joinCondition properties. + - one or more rml:field properties. + Furthermore, rml:Field requires what an rml:ExpressionMap requires. + """ ; + sh:targetClass rml:LogicalViewJoin ; + sh:targetObjectsOf rml:leftJoin , rml:innerJoin ; + sh:property [ + sh:description """ + The parent logical view of the logical view join. + """ ; + sh:message """ + Exactly one rml:parentLogicalView property must be specified for a rml:LogicalViewJoin, with a resource as its value. + """ ; + sh:path rml:parentLogicalView ; + sh:minCount 1 ; + sh:maxCount 1 ; + sh:nodeKind sh:BlankNodeOrIRI ; + ] , [ + sh:description """ + A join condition of the logical view join. + """ ; + sh:message """ + At least one rml:parentLogicalView property must be specified for a rml:LogicalViewJoin, with a resource as its value. + """ ; + sh:path rml:joinCondition ; + sh:minCount 1 ; + sh:nodeKind sh:BlankNodeOrIRI ; + ] , [ + sh:description """ + A field of the logical view join. + """ ; + sh:message """ + At least one rml:field property must be specified for a rml:LogicalViewJoin, with a resource as its value. + """ ; + sh:path rml:field ; + sh:minCount 1 ; + sh:nodeKind sh:BlankNodeOrIRI ; + sh:or ( + [ sh:node rmlsh:ExpressionFieldShape ] + [ sh:node rmlsh:IterableFieldShape ] + ) + ] . + +rmlsh:StructuralAnnotationShape a sh:NodeShape; + rdfs:label "StructuralAnnotation" ; + rdfs:comment """ + Structural annotations provide a mechanism to express relationships between logical views, as well as additional information about fields. + """ ; + sh:message """ + Node must have a valid rml:StructuralAnnotationShape description. + All structural annotations of a logical view lv MUST have an on fields property (rml:onFields), linking the structural annotation to a list of field names occurring in lv. + rml:StructuralAnnotationShape requires: + - exactly one rml:onFields property. + """ ; + sh:targetClass rml:StructuralAnnotation ; + sh:targetObjectsOf rml:structuralAnnotation ; + sh:property [ + sh:description """ + property onFields specifies the fields in LogicalView that are involved by the structural annotation. The semantics of this involvement depends on the specific annotation. + """ ; + sh:message """ + Exactly one rml:onFields property must be specified for each rml:StructuralAnnotation + """ ; + sh:path rml:onFields ; + sh:minCount 1 ; + sh:maxCount 1 ; + sh:nodeKind sh:BlankNodeOrIRI ; + ] . + +rmlsh:InclusionAnnotationShape a sh:NodeShape; + rdfs:label "InclusionAnnotation" ; + rdfs:comment """ + The InclusionAnnotaton annotation (rml:InclusionAnnotation) is analogous to the notion of inclusion dependency in databases. + """ ; + sh:message """ + Node must have a valid rml:InclusionAnnotation description. + Each InclusionAnnotation annotation requires (additionally to the inherited `rml:onFields` property): + - Exactly one `rml:targetView` property + - Exactly one `rml:targetFields` property. + """ ; + sh:targetClass rml:InclusionAnnotation ; + sh:property [ + sh:description """ + property targetView specifies the LogicalView target of the InclusionAnnotation annotation. + """ ; + sh:message """ + Exactly one rml:targetView property must be specified for each rml:InclusionAnnotation. + """ ; + sh:path rml:targetView ; + sh:minCount 1 ; + sh:maxCount 1 ; + sh:nodeKind sh:BlankNodeOrIRI ; + ] , [ + sh:description """ + property targetFields specifies the Fields target of the InclusionAnnotation. + """ ; + sh:message """ + Exactly one rml:targetFields property must be specified for each rml:InclusionAnnotation. + """ ; + sh:path rml:targetFields ; + sh:minCount 1 ; + sh:maxCount 1 ; + sh:nodeKind sh:BlankNodeOrIRI ; + ] . + +rmlsh:parentCyclesShape a sh:NodeShape ; + sh:targetSubjectsOf rml:viewOn ; + sh:targetSubjectsOf rml:field ; + sh:sparql [ + a sh:SPARQLConstraint ; + sh:message "There must be no cycles via rml:viewOn or rml:Field." ; + sh:select """ + PREFIX rml: + SELECT ?this + WHERE { + ?this (rml:viewOn|rml:field)+ ?this . + } + """ ; + ] . + +rmlsh:joinCyclesShape a sh:NodeShape ; + sh:targetSubjectsOf rml:viewOn ; + sh:sparql [ + a sh:SPARQLConstraint ; + sh:message "There must be no cycles via rml:viewOn and rml:leftJoin or rml:innerJoin." ; + sh:select """ + PREFIX rml: + SELECT ?this + WHERE { + ?this a rml:LogicalView . + ?this ((rml:leftJoin|rml:innerJoin)/rml:parentLogicalView)+ ?this . + } + """ ; + ] . diff --git a/src/main/resources/shapes/rml-lv/mapping_validator.py b/src/main/resources/shapes/rml-lv/mapping_validator.py new file mode 100755 index 00000000..033c8b87 --- /dev/null +++ b/src/main/resources/shapes/rml-lv/mapping_validator.py @@ -0,0 +1,45 @@ +from logging import debug, info, critical +from pyshacl import validate +from rdflib import Graph +from shutil import get_terminal_size + + +class MappingValidator: + def __init__(self, shape: str, ontology: str) -> None: + sg = Graph() + sg.parse(shape, format='turtle') + self._shape = sg + og = Graph() + og.parse(ontology, format='turtle') + self._ont = og + + def validate(self, rules: Graph, print_report: bool = True) -> None: + valid: bool + report_graph: Graph + report_text: str + valid, report_graph, report_text = validate(rules, + shacl_graph=self._shape, + ont_graph=self._ont, + do_owl_imports=True) + debug(f'RML rules valid: {valid}') + debug(f'SHACL validation report: {report_text}') + + # If mapping rules are invalid, print SHACL report and raise exception + if not valid and print_report: + self._print_report(report_text) + msg = 'RML mapping rules are invalid, a detailed explanation' \ + ' is available in the report' + critical(msg) + raise ValueError(msg) + + def _print_report(self, report_text: str) -> None: + tty_columns: int + tty_columns, _ = get_terminal_size() + info('-' * tty_columns) + title: str = 'RML rules validation report' + white_space: int = int((tty_columns - len(title)) / 2) + title = ' ' * white_space + title + ' ' * white_space + info(title) + info('-' * tty_columns) + info(report_text) + info('-' * tty_columns) diff --git a/src/main/resources/shapes/rml-lv/requirements.txt b/src/main/resources/shapes/rml-lv/requirements.txt new file mode 100644 index 00000000..e9fdd848 --- /dev/null +++ b/src/main/resources/shapes/rml-lv/requirements.txt @@ -0,0 +1,3 @@ +parameterized +rdflib +pyshacl \ No newline at end of file diff --git a/src/main/resources/shapes/rml-lv/tests.py b/src/main/resources/shapes/rml-lv/tests.py new file mode 100755 index 00000000..8fe1fdd3 --- /dev/null +++ b/src/main/resources/shapes/rml-lv/tests.py @@ -0,0 +1,72 @@ +#!/usr/bin/env python +# +# (c) Dylan Van Assche (2020 - 2023) +# IDLab - Ghent University - imec +# MIT license +# + +import os +import argparse +import unittest +import logging +from parameterized import parameterized +from glob import glob +from rdflib import Graph + +from mapping_validator import MappingValidator +from utils import replace_strings_in_file, cleanup_tmp_folder + +TEST_CASES_DIR = os.path.join(os.path.abspath('../test-cases'), '*/*.ttl') +SHAPE_FILE_LOCATION = 'lv.ttl' +ONTOLOGY_FILE_LOCATION = '../ontology/documentation/ontology.ttl' + + +class MappingValidatorTests(unittest.TestCase): + def _validate_rules(self, path: str) -> None: + rules = Graph().parse(path, format='turtle') + + # Replace import statements + # also include io shapes just to validate the logical sources in the test cases + shapes = replace_strings_in_file(SHAPE_FILE_LOCATION, { + '': ', ' + }) + ontology = replace_strings_in_file(ONTOLOGY_FILE_LOCATION, { + '': '' + }) + + mapping_validator = MappingValidator(shapes, ontology) + mapping_validator.validate(rules) + + cleanup_tmp_folder(shapes) + cleanup_tmp_folder(ontology) + + def test_non_existing_mapping_rules(self) -> None: + with self.assertRaises(FileNotFoundError): + p = os.path.abspath('does_not_exist.ttl') + self._validate_rules(p) + + @parameterized.expand([(p,) for p in sorted(glob(TEST_CASES_DIR))], + skip_on_empty=True) + def test_validation_rules(self, path: str) -> None: + """ + Test if our SHACL shapes are able to validate our validation mapping + rules test cases. + """ + print(f'Testing validation with: {path}') + self._validate_rules(path) + + +if __name__ == '__main__': + parser = argparse.ArgumentParser(description='Execute tests for SHACL ' + 'shapes on RML mapping rules.') + parser.add_argument('--verbose', '-v', action='count', default=1, + help='Set verbosity level of messages. Example: -vvv') + args = parser.parse_args() + + args.verbose = 70 - (10 * args.verbose) if args.verbose > 0 else 0 + logging.basicConfig(level=args.verbose, + format='%(asctime)s %(levelname)s: %(message)s', + datefmt='%Y-%m-%d %H:%M:%S') + + print(TEST_CASES_DIR) + unittest.main(failfast=False) diff --git a/src/main/resources/shapes/rml-lv/utils.py b/src/main/resources/shapes/rml-lv/utils.py new file mode 100644 index 00000000..437871a7 --- /dev/null +++ b/src/main/resources/shapes/rml-lv/utils.py @@ -0,0 +1,25 @@ +import os +import shutil + +def replace_strings_in_file(file_path: str, replacements: dict) -> str: + abs_path = os.path.abspath(file_path) + tmp_dir = os.path.join(os.path.dirname(abs_path), 'tmp') + os.makedirs(tmp_dir, exist_ok=True) + tmp_file_path = os.path.join(tmp_dir, os.path.basename(abs_path)) + + with open(abs_path, 'r') as file: + file_data = file.read() + + for old_string, new_string in replacements.items(): + file_data = file_data.replace(old_string, new_string) + + with open(tmp_file_path, 'w') as file: + file.write(file_data) + + return tmp_file_path + +def cleanup_tmp_folder(file_path: str) -> None: + abs_path = os.path.abspath(file_path) + tmp_dir = os.path.dirname(abs_path) + if os.path.exists(tmp_dir): + shutil.rmtree(tmp_dir) diff --git a/src/main/resources/shapes/rml-star/assertedtriples_map.ttl b/src/main/resources/shapes/rml-star/assertedtriples_map.ttl new file mode 100644 index 00000000..628ab6e2 --- /dev/null +++ b/src/main/resources/shapes/rml-star/assertedtriples_map.ttl @@ -0,0 +1,38 @@ +############################################################################### +# RML Asserted Triples Map shape # +# Copyright Dylan Van Assche, IDLab - UGent - imec (2023 - 2025) # +############################################################################### +@prefix : . +@prefix rdfs: . +@prefix sh: . +@prefix rdf: . +@prefix rml: . +@prefix xsd: . + +# Validate an RML Asserted Triples Map +:RMLAssertedTriplesMapShape + a sh:NodeShape ; + sh:targetClass rml:AssertedTriplesMap ; + sh:message "AssertedTriplesMap" ; + rdfs:comment """ + Represents a Asserted Triples Map. + """ ; + sh:message """ + Asserted Triples Map requires exactly one rml:subject or + one rml:subjectMap and zero or more rml:predicateObjectMaps + and exactly one rml:logicalSource. + """ ; + + sh:and ( + # Inherited shapes + :RMLTriplesMapPropertiesShape + # Asserted Triples Map specific shapes + [ + sh:path rdf:type ; + sh:message """ + Asserted Triples Map must have a rml:AssertedTriplesMap type. + """ ; + sh:value rml:AssertedTriplesMap ; + ] + ) ; +. diff --git a/src/main/resources/shapes/rml-star/external_shapes.ttl b/src/main/resources/shapes/rml-star/external_shapes.ttl new file mode 100644 index 00000000..b58054a9 --- /dev/null +++ b/src/main/resources/shapes/rml-star/external_shapes.ttl @@ -0,0 +1,20 @@ +############################################################################### +# RML Star external resources shapes # +# Copyright Dylan Van Assche, IDLab - UGent - imec (2023) # +############################################################################### +@prefix sh: . +@prefix : . +@prefix rdf: . +@prefix rml: . +@prefix xsd: . + +# Shapes are defined in the corresponding repositories of each specification +# Provide their IRI as stub to allow validation in Star. + +:RMLJoinConditionPropertiesShape + a sh:NodeShape; +. + +:RMLTriplesMapPropertiesShape + a sh:NodeShape; +. diff --git a/src/main/resources/shapes/rml-star/generate_shape.py b/src/main/resources/shapes/rml-star/generate_shape.py new file mode 100755 index 00000000..33e47459 --- /dev/null +++ b/src/main/resources/shapes/rml-star/generate_shape.py @@ -0,0 +1,79 @@ +#!/usr/bin/env python + +import argparse +import sys +from os import path +from glob import glob +from rdflib import Graph, Namespace +from rdflib.plugins.serializers.turtle import TurtleSerializer +from rdflib import plugin + +SUBSHAPE_FORMAT = 'turtle' +SUBSHAPE_GLOB_PATTERN = '*.ttl' +SHACL = Namespace('http://www.w3.org/ns/shacl#') +RML = Namespace('http://w3id.org/rml/') + + +class TurtleWithPrefixes(TurtleSerializer): + """ + A turtle serializer that always emits prefixes + Workaround for https://github.com/RDFLib/rdflib/issues/1048 + """ + roundtrip_prefixes = True # Undocumented, forces to write all prefixes + + +class ShapeGenerator: + """ + Generates a complete SHACL shape of all the SHACL subshapes. + Useful for using the shapes in the shacl.org Playground. + """ + def __init__(self, glob_pattern: str, rdf_format: str, + destination: str) -> None: + self._glob_pattern: str = glob_pattern + self._rdf_format: str = rdf_format + self._destination: str = destination + self._shape = Graph() + self._shape.bind('sh', SHACL) + self._shape.bind('rml', RML) + # Register TurtleWithPrefixes serializer as 'tortoise' format + plugin.register('tortoise', + plugin.Serializer, + 'generate_shape', + 'TurtleWithPrefixes') + + def generate(self) -> None: + """ + Generate a full shape from the sub shapes. + """ + print('Reading subshapes:') + for sub_shape in glob(self._glob_pattern): + if 'star.ttl' in sub_shape or 'shacl.ttl' in sub_shape: + continue + print(f"\t{sub_shape}") + g = Graph() + g.bind('sh', SHACL) + g.bind('rml', RML) + self._shape += g.parse(sub_shape, format=self._rdf_format) + + print(f'Writing shape to {self._destination}') + self._shape.serialize(destination=self._destination, format='tortoise') + + +if __name__ == '__main__': + p = argparse.ArgumentParser(description='Generate a complete SHACL shape ' + 'from the subshapes.') + p.add_argument('destination', type=str, help='Location to write the ' + 'complete SHACL shape as Turtle.') + # Arguments parsing + args = p.parse_args() + if not path.exists(args.destination): + print(f'{args.destination} file path does not exist!') + sys.exit(1) + + if path.isdir(args.destination): + args.destination = path.join(args.destination, 'star.ttl') + + # Generate shape + generator = ShapeGenerator(SUBSHAPE_GLOB_PATTERN, SUBSHAPE_FORMAT, + args.destination) + generator.generate() diff --git a/src/main/resources/shapes/rml-star/mapping_validator.py b/src/main/resources/shapes/rml-star/mapping_validator.py new file mode 100755 index 00000000..dabb1d24 --- /dev/null +++ b/src/main/resources/shapes/rml-star/mapping_validator.py @@ -0,0 +1,40 @@ +from logging import debug, info, critical +from pyshacl import validate +from rdflib import Graph +from shutil import get_terminal_size + + +class MappingValidator: + def __init__(self, shape: str) -> None: + g = Graph() + g.parse(shape, format='turtle') + self._shape = g + + def validate(self, rules: Graph, print_report: bool = True) -> None: + valid: bool + report_graph: Graph + report_text: str + valid, report_graph, report_text = validate(rules, + shacl_graph=self._shape) + debug(f'RML rules valid: {valid}') + debug(f'SHACL validation report: {report_text}') + + # If mapping rules are invalid, print SHACL report and raise exception + if not valid and print_report: + self._print_report(report_text) + msg = 'RML mapping rules are invalid, a detailed explanation' \ + ' is available in the report' + critical(msg) + raise ValueError(msg) + + def _print_report(self, report_text: str) -> None: + tty_columns: int + tty_columns, _ = get_terminal_size() + info('-' * tty_columns) + title: str = 'RML rules validation report' + white_space: int = int((tty_columns - len(title)) / 2) + title = ' ' * white_space + title + ' ' * white_space + info(title) + info('-' * tty_columns) + info(report_text) + info('-' * tty_columns) diff --git a/src/main/resources/shapes/rml-star/nonassertedtriples_map.ttl b/src/main/resources/shapes/rml-star/nonassertedtriples_map.ttl new file mode 100644 index 00000000..7de4a219 --- /dev/null +++ b/src/main/resources/shapes/rml-star/nonassertedtriples_map.ttl @@ -0,0 +1,38 @@ +############################################################################### +# RML Non Asserted Triples Map shape # +# Copyright Dylan Van Assche, IDLab - UGent - imec (2023 - 2025) # +############################################################################### +@prefix : . +@prefix rdfs: . +@prefix sh: . +@prefix rdf: . +@prefix rml: . +@prefix xsd: . + +# Validate an RML Non Asserted Triples Map +:RMLNonAssertedTriplesMapShape + a sh:NodeShape ; + sh:targetClass rml:NonAssertedTriplesMap ; + sh:message "NonAssertedTriplesMap" ; + rdfs:comment """ + Represents a Non Asserted Triples Map. + """ ; + sh:message """ + Non Asserted Triples Map requires exactly one rml:subject or + one rml:subjectMap and zero or more rml:predicateObjectMaps + and exactly one rml:logicalSource. + """ ; + + sh:and ( + # Inherited shapes + :RMLTriplesMapPropertiesShape + # Non Asserted Triples Map specific shapes + [ + sh:path rdf:type ; + sh:message """ + Non Asserted Triples Map must have a rml:NonAssertedTriplesMap type. + """ ; + sh:value rml:NonAssertedTriplesMap ; + ] + ) ; +. diff --git a/src/main/resources/shapes/rml-star/requirements.txt b/src/main/resources/shapes/rml-star/requirements.txt new file mode 100644 index 00000000..3d264b8e --- /dev/null +++ b/src/main/resources/shapes/rml-star/requirements.txt @@ -0,0 +1,3 @@ +parameterized +rdflib +pyshacl diff --git a/src/main/resources/shapes/rml-star/shacl.ttl b/src/main/resources/shapes/rml-star/shacl.ttl new file mode 100644 index 00000000..e37856a1 --- /dev/null +++ b/src/main/resources/shapes/rml-star/shacl.ttl @@ -0,0 +1,406 @@ +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix xsd: . + +@prefix shsh: . + +shsh: + rdfs:label "SHACL for SHACL"@en ; + rdfs:comment "This shapes graph can be used to validate SHACL shapes graphs against a subset of the SHACL syntax rules."@en ; + sh:declare [ + sh:prefix "shsh" ; + sh:namespace "http://www.w3.org/ns/shacl-shacl#" ; + ] . + + +shsh:ListShape + a sh:NodeShape ; + rdfs:label "List shape"@en ; + rdfs:comment "A shape describing well-formed RDF lists. Currently does not check for non-recursion. This could be expressed using SHACL-SPARQL."@en ; + rdfs:seeAlso ; + sh:property [ + sh:path [ sh:zeroOrMorePath rdf:rest ] ; + rdfs:comment "Each list member (including this node) must be have the shape shsh:ListNodeShape."@en ; + sh:hasValue rdf:nil ; + sh:node shsh:ListNodeShape ; + ] . + +shsh:ListNodeShape + a sh:NodeShape ; + rdfs:label "List node shape"@en ; + rdfs:comment "Defines constraints on what it means for a node to be a node within a well-formed RDF list. Note that this does not check whether the rdf:rest items are also well-formed lists as this would lead to unsupported recursion."@en ; + sh:or ( [ + sh:hasValue rdf:nil ; + sh:property [ + sh:path rdf:first ; + sh:maxCount 0 ; + ] ; + sh:property [ + sh:path rdf:rest ; + sh:maxCount 0 ; + ] ; + ] + [ + sh:not [ sh:hasValue rdf:nil ] ; + sh:property [ + sh:path rdf:first ; + sh:maxCount 1 ; + sh:minCount 1 ; + ] ; + sh:property [ + sh:path rdf:rest ; + sh:maxCount 1 ; + sh:minCount 1 ; + ] ; + ] ) . + +shsh:ShapeShape + a sh:NodeShape ; + rdfs:label "Shape shape"@en ; + rdfs:comment "A shape that can be used to validate syntax rules for other shapes."@en ; + + # See https://www.w3.org/TR/shacl/#shapes for what counts as a shape + sh:targetClass sh:NodeShape ; + sh:targetClass sh:PropertyShape ; + sh:targetSubjectsOf sh:targetClass, sh:targetNode, sh:targetObjectsOf, sh:targetSubjectsOf ; + sh:targetSubjectsOf sh:and, sh:class, sh:closed, sh:datatype, sh:disjoint, sh:equals, sh:flags, sh:hasValue, + sh:ignoredProperties, sh:in, sh:languageIn, sh:lessThan, sh:lessThanOrEquals, sh:maxCount, sh:maxExclusive, + sh:maxInclusive, sh:maxLength, sh:minCount, sh:minExclusive, sh:minInclusive, sh:minLength, sh:node, sh:nodeKind, + sh:not, sh:or, sh:pattern, sh:property, sh:qualifiedMaxCount, sh:qualifiedMinCount, sh:qualifiedValueShape, + sh:qualifiedValueShape, sh:qualifiedValueShapesDisjoint, sh:qualifiedValueShapesDisjoint, sh:uniqueLang, sh:xone ; + + sh:targetObjectsOf sh:node ; # node-node + sh:targetObjectsOf sh:not ; # not-node + sh:targetObjectsOf sh:property ; # property-node + sh:targetObjectsOf sh:qualifiedValueShape ; # qualifiedValueShape-node + + # Shapes are either node shapes or property shapes + sh:xone ( shsh:NodeShapeShape shsh:PropertyShapeShape ) ; + + sh:property [ + sh:path sh:targetNode ; + sh:nodeKind sh:IRIOrLiteral ; # targetNode-nodeKind + ] ; + sh:property [ + sh:path sh:targetClass ; + sh:nodeKind sh:IRI ; # targetClass-nodeKind + ] ; + sh:property [ + sh:path sh:targetSubjectsOf ; + sh:nodeKind sh:IRI ; # targetSubjectsOf-nodeKind + ] ; + sh:property [ + sh:path sh:targetObjectsOf ; + sh:nodeKind sh:IRI ; # targetObjectsOf-nodeKind + ] ; + sh:or ( [ sh:not [ + sh:class rdfs:Class ; + sh:or ( [ sh:class sh:NodeShape ] [ sh:class sh:PropertyShape ] ) + ] ] + [ sh:nodeKind sh:IRI ] + ) ; # implicit-targetClass-nodeKind + + sh:property [ + sh:path sh:severity ; + sh:maxCount 1 ; # severity-maxCount + sh:nodeKind sh:IRI ; # severity-nodeKind + ] ; + sh:property [ + sh:path sh:message ; + sh:or ( [ sh:datatype xsd:string ] [ sh:datatype rdf:langString ] ) ; # message-datatype + ] ; + sh:property [ + sh:path sh:deactivated ; + sh:maxCount 1 ; # deactivated-maxCount + sh:in ( true false ) ; # deactivated-datatype + ] ; + + sh:property [ + sh:path sh:and ; + sh:node shsh:ListShape ; # and-node + ] ; + sh:property [ + sh:path sh:class ; + sh:nodeKind sh:IRI ; # class-nodeKind + ] ; + sh:property [ + sh:path sh:closed ; + sh:datatype xsd:boolean ; # closed-datatype + sh:maxCount 1 ; # multiple-parameters + ] ; + sh:property [ + sh:path sh:ignoredProperties ; + sh:node shsh:ListShape ; # ignoredProperties-node + sh:maxCount 1 ; # multiple-parameters + ] ; + sh:property [ + sh:path ( sh:ignoredProperties [ sh:zeroOrMorePath rdf:rest ] rdf:first ) ; + sh:nodeKind sh:IRI ; # ignoredProperties-members-nodeKind + ] ; + sh:property [ + sh:path sh:datatype ; + sh:nodeKind sh:IRI ; # datatype-nodeKind + sh:maxCount 1 ; # datatype-maxCount + ] ; + sh:property [ + sh:path sh:disjoint ; + sh:nodeKind sh:IRI ; # disjoint-nodeKind + ] ; + sh:property [ + sh:path sh:equals ; + sh:nodeKind sh:IRI ; # equals-nodeKind + ] ; + sh:property [ + sh:path sh:in ; + sh:maxCount 1 ; # in-maxCount + sh:node shsh:ListShape ; # in-node + ] ; + sh:property [ + sh:path sh:languageIn ; + sh:maxCount 1 ; # languageIn-maxCount + sh:node shsh:ListShape ; # languageIn-node + ] ; + sh:property [ + sh:path ( sh:languageIn [ sh:zeroOrMorePath rdf:rest ] rdf:first ) ; + sh:datatype xsd:string ; # languageIn-members-datatype + ] ; + sh:property [ + sh:path sh:lessThan ; + sh:nodeKind sh:IRI ; # lessThan-nodeKind + ] ; + sh:property [ + sh:path sh:lessThanOrEquals ; + sh:nodeKind sh:IRI ; # lessThanOrEquals-nodeKind + ] ; + sh:property [ + sh:path sh:maxCount ; + sh:datatype xsd:integer ; # maxCount-datatype + sh:maxCount 1 ; # maxCount-maxCount + ] ; + sh:property [ + sh:path sh:maxExclusive ; + sh:maxCount 1 ; # maxExclusive-maxCount + sh:nodeKind sh:Literal ; # maxExclusive-nodeKind + ] ; + sh:property [ + sh:path sh:maxInclusive ; + sh:maxCount 1 ; # maxInclusive-maxCount + sh:nodeKind sh:Literal ; # maxInclusive-nodeKind + ] ; + sh:property [ + sh:path sh:maxLength ; + sh:datatype xsd:integer ; # maxLength-datatype + sh:maxCount 1 ; # maxLength-maxCount + ] ; + sh:property [ + sh:path sh:minCount ; + sh:datatype xsd:integer ; # minCount-datatype + sh:maxCount 1 ; # minCount-maxCount + ] ; + sh:property [ + sh:path sh:minExclusive ; + sh:maxCount 1 ; # minExclusive-maxCount + sh:nodeKind sh:Literal ; # minExclusive-nodeKind + ] ; + sh:property [ + sh:path sh:minInclusive ; + sh:maxCount 1 ; # minInclusive-maxCount + sh:nodeKind sh:Literal ; # minInclusive-nodeKind + ] ; + sh:property [ + sh:path sh:minLength ; + sh:datatype xsd:integer ; # minLength-datatype + sh:maxCount 1 ; # minLength-maxCount + ] ; + sh:property [ + sh:path sh:nodeKind ; + sh:in ( sh:BlankNode sh:IRI sh:Literal sh:BlankNodeOrIRI sh:BlankNodeOrLiteral sh:IRIOrLiteral ) ; # nodeKind-in + sh:maxCount 1 ; # nodeKind-maxCount + ] ; + sh:property [ + sh:path sh:or ; + sh:node shsh:ListShape ; # or-node + ] ; + sh:property [ + sh:path sh:pattern ; + sh:datatype xsd:string ; # pattern-datatype + sh:maxCount 1 ; # multiple-parameters + # Not implemented: syntax rule pattern-regex + ] ; + sh:property [ + sh:path sh:flags ; + sh:datatype xsd:string ; # flags-datatype + sh:maxCount 1 ; # multiple-parameters + ] ; + sh:property [ + sh:path sh:qualifiedMaxCount ; + sh:datatype xsd:integer ; # qualifiedMaxCount-datatype + sh:maxCount 1 ; # multiple-parameters + ] ; + sh:property [ + sh:path sh:qualifiedMinCount ; + sh:datatype xsd:integer ; # qualifiedMinCount-datatype + sh:maxCount 1 ; # multiple-parameters + ] ; + sh:property [ + sh:path sh:qualifiedValueShape ; + sh:maxCount 1 ; # multiple-parameters + ] ; + sh:property [ + sh:path sh:qualifiedValueShapesDisjoint ; + sh:datatype xsd:boolean ; # qualifiedValueShapesDisjoint-datatype + sh:maxCount 1 ; # multiple-parameters + ] ; + sh:property [ + sh:path sh:uniqueLang ; + sh:datatype xsd:boolean ; # uniqueLang-datatype + sh:maxCount 1 ; # uniqueLang-maxCount + ] ; + sh:property [ + sh:path sh:xone ; + sh:node shsh:ListShape ; # xone-node + ] . + +shsh:NodeShapeShape + a sh:NodeShape ; + sh:targetObjectsOf sh:node ; # node-node + sh:property [ + sh:path sh:path ; + sh:maxCount 0 ; # NodeShape-path-maxCount + ] ; + sh:property [ + sh:path sh:lessThan ; + sh:maxCount 0 ; # lessThan-scope + ] ; + sh:property [ + sh:path sh:lessThanOrEquals ; + sh:maxCount 0 ; # lessThanOrEquals-scope + ] ; + sh:property [ + sh:path sh:maxCount ; + sh:maxCount 0 ; # maxCount-scope + ] ; + sh:property [ + sh:path sh:minCount ; + sh:maxCount 0 ; # minCount-scope + ] ; + sh:property [ + sh:path sh:qualifiedValueShape ; + sh:maxCount 0 ; # qualifiedValueShape-scope + ] ; + sh:property [ + sh:path sh:uniqueLang ; + sh:maxCount 0 ; # uniqueLang-scope + ] . + +shsh:PropertyShapeShape + a sh:NodeShape ; + sh:targetObjectsOf sh:property ; # property-node + sh:property [ + sh:path sh:path ; + sh:maxCount 1 ; # path-maxCount + sh:minCount 1 ; # PropertyShape-path-minCount + sh:node shsh:PathShape ; # path-node + ] . + +# Values of sh:and, sh:or and sh:xone must be lists of shapes +shsh:ShapesListShape + a sh:NodeShape ; + sh:targetObjectsOf sh:and ; # and-members-node + sh:targetObjectsOf sh:or ; # or-members-node + sh:targetObjectsOf sh:xone ; # xone-members-node + sh:property [ + sh:path ( [ sh:zeroOrMorePath rdf:rest ] rdf:first ) ; + sh:node shsh:ShapeShape ; + ] . + + +# A path of blank node path syntax, used to simulate recursion +_:PathPath + sh:alternativePath ( + ( [ sh:zeroOrMorePath rdf:rest ] rdf:first ) + ( sh:alternativePath [ sh:zeroOrMorePath rdf:rest ] rdf:first ) + sh:inversePath + sh:zeroOrMorePath + sh:oneOrMorePath + sh:zeroOrOnePath + ) . + +shsh:PathShape + a sh:NodeShape ; + rdfs:label "Path shape"@en ; + rdfs:comment "A shape that can be used to validate the syntax rules of well-formed SHACL paths."@en ; + rdfs:seeAlso ; + sh:property [ + sh:path [ sh:zeroOrMorePath _:PathPath ] ; + sh:node shsh:PathNodeShape ; + ] . + +shsh:PathNodeShape + sh:xone ( # path-metarule + [ sh:nodeKind sh:IRI ] # 2.3.1.1: Predicate path + [ sh:nodeKind sh:BlankNode ; # 2.3.1.2: Sequence path + sh:node shsh:PathListWithAtLeast2Members ; + ] + [ sh:nodeKind sh:BlankNode ; # 2.3.1.3: Alternative path + sh:closed true ; + sh:property [ + sh:path sh:alternativePath ; + sh:node shsh:PathListWithAtLeast2Members ; + sh:minCount 1 ; + sh:maxCount 1 ; + ] + ] + [ sh:nodeKind sh:BlankNode ; # 2.3.1.4: Inverse path + sh:closed true ; + sh:property [ + sh:path sh:inversePath ; + sh:minCount 1 ; + sh:maxCount 1 ; + ] + ] + [ sh:nodeKind sh:BlankNode ; # 2.3.1.5: Zero-or-more path + sh:closed true ; + sh:property [ + sh:path sh:zeroOrMorePath ; + sh:minCount 1 ; + sh:maxCount 1 ; + ] + ] + [ sh:nodeKind sh:BlankNode ; # 2.3.1.6: One-or-more path + sh:closed true ; + sh:property [ + sh:path sh:oneOrMorePath ; + sh:minCount 1 ; + sh:maxCount 1 ; + ] + ] + [ sh:nodeKind sh:BlankNode ; # 2.3.1.7: Zero-or-one path + sh:closed true ; + sh:property [ + sh:path sh:zeroOrOnePath ; + sh:minCount 1 ; + sh:maxCount 1 ; + ] + ] + ) . + +shsh:PathListWithAtLeast2Members + a sh:NodeShape ; + sh:node shsh:ListShape ; + sh:property [ + sh:path [ sh:oneOrMorePath rdf:rest ] ; + sh:minCount 2 ; # 1 other list node plus rdf:nil + ] . + +shsh:ShapesGraphShape + a sh:NodeShape ; + sh:targetObjectsOf sh:shapesGraph ; + sh:nodeKind sh:IRI . # shapesGraph-nodeKind + +shsh:EntailmentShape + a sh:NodeShape ; + sh:targetObjectsOf sh:entailment ; + sh:nodeKind sh:IRI . # entailment-nodeKind + diff --git a/src/main/resources/shapes/rml-star/shared_properties.ttl b/src/main/resources/shapes/rml-star/shared_properties.ttl new file mode 100644 index 00000000..82446fd5 --- /dev/null +++ b/src/main/resources/shapes/rml-star/shared_properties.ttl @@ -0,0 +1,48 @@ +############################################################################### +# RML shared properties among resources shapes # +# Copyright Dylan Van Assche, IDLab - UGent - imec (2023) # +############################################################################### +@prefix sh: . +@prefix : . +@prefix rdf: . +@prefix rml: . +@prefix xsd: . + + +:RMLAssertedAndNonTriplesMapPropertiesShape + a sh:NodeShape; + sh:targetObjectsOf rml:quotedTriplesMap ; + sh:targetClass rml:AssertedTriplesMap ; + sh:targetClass rml:NonAssertedTriplesMap ; + sh:nodeKind sh:BlankNodeOrIRI ; + sh:and ( + [ + sh:path rml:predicateObjectMap ; + sh:message """ + Exactly one Predicate Object Map must be specified in the + Triples Map referenced by rml:quotedTriplesMap. + """ ; + sh:minCount 1 ; + sh:maxCount 1 ; + ] + [ + sh:message """ + rml:quotedTriplesMap expects either a rml:AssertedTriplesMap + or rml:NonAssertedTriplesMap. + """ ; + sh:or ([sh:node :RMLAssertedTriplesMapShape] + [sh:node :RMLNonAssertedTriplesMapShape]) ; + ] + [ + sh:message """ + Either a rml:AssertedTriplesMap or rml:NonAssertedTriplesMap, + but not both. + """ ; + sh:path rdf:type ; + sh:alternativePath (rml:AssertedTriplesMap + rml:NonAssertedTriplesMap ); + sh:minCount 1 ; + sh:maxCount 1 ; + ] + ); +. diff --git a/src/main/resources/shapes/star.ttl b/src/main/resources/shapes/rml-star/star.ttl similarity index 98% rename from src/main/resources/shapes/star.ttl rename to src/main/resources/shapes/rml-star/star.ttl index 4fb8c271..02c0f0ec 100644 --- a/src/main/resources/shapes/star.ttl +++ b/src/main/resources/shapes/rml-star/star.ttl @@ -54,7 +54,7 @@ sh:targetObjectsOf rml:quotedTriplesMap . a sh:NodeShape ; - sh:and ( [ sh:description """ + sh:and ( [ rdfs:comment """ An Quoted Triples Map element to generate a RDF-star triple as subject or object or another triple from a logical source record. """ ; @@ -73,7 +73,7 @@ sh:xone ( [ sh:minCount 1 ; sh:path rml:predicate ] [ sh:minCount 1 ; sh:path rml:predicateMap ] ) ] ) ; - sh:description """ + rdfs:comment """ Represents a Star Map. """ ; sh:message """ @@ -89,7 +89,7 @@ """ ; sh:path rdf:type ; sh:value rml:AssertedTriplesMap ] ) ; - sh:description """ + rdfs:comment """ Represents a Asserted Triples Map. """ ; sh:message """ @@ -108,7 +108,7 @@ """ ; sh:path rdf:type ; sh:value rml:NonAssertedTriplesMap ] ) ; - sh:description """ + rdfs:comment """ Represents a Non Asserted Triples Map. """ ; sh:message """ diff --git a/src/main/resources/shapes/rml-star/star_map.ttl b/src/main/resources/shapes/rml-star/star_map.ttl new file mode 100644 index 00000000..73486a49 --- /dev/null +++ b/src/main/resources/shapes/rml-star/star_map.ttl @@ -0,0 +1,61 @@ +############################################################################### +# RML Star Map shape # +# Copyright Dylan Van Assche, IDLab - UGent - imec (2023 - 2025) # +############################################################################### +@prefix : . +@prefix rdfs: . +@prefix sh: . +@prefix rdf: . +@prefix rml: . +@prefix xsd: . + +# Validate an RMLS Star Map +:RMLStarMapShape + a sh:NodeShape ; + sh:targetClass rml:StarMap ; + sh:message "StarMap" ; + rdfs:comment """ + Represents a Star Map. + """ ; + sh:message """ + Star Map requires exactly one rml:quotedTriplesMap and + zero or more rml:joinCondition. + """ ; + + sh:and ( + # Inherited shapes + :RMLJoinConditionPropertiesShape + # Star Map specific shapes + [ + sh:path rml:quotedTriplesMap ; + sh:name "quotedTriplesMap" ; + sh:description """ + An Quoted Triples Map element to generate a RDF-star triple as + subject or object or another triple from a logical source record. + """ ; + sh:message """ + Exactly one rml:quotedTriplesMap is required. + """ ; + sh:nodeKind sh:BlankNodeOrIRI ; + sh:minCount 1 ; + sh:maxCount 1 ; + ] + [ + sh:targetObjectsOf rml:predicateObjectMap ; + sh:name "PredicateMap" ; + sh:message """ + An Quoted Triples Map may never be used for generating a predicate. + """ ; + sh:xone ( + [ + sh:path rml:predicate ; + sh:minCount 1 ; + ] + [ + sh:path rml:predicateMap ; + sh:minCount 1 ; + ] + ); + ] + ) ; +. diff --git a/src/main/resources/shapes/rml-star/tests.py b/src/main/resources/shapes/rml-star/tests.py new file mode 100755 index 00000000..317a08d7 --- /dev/null +++ b/src/main/resources/shapes/rml-star/tests.py @@ -0,0 +1,77 @@ +#!/usr/bin/env python +# +# (c) Dylan Van Assche (2020 - 2023) +# IDLab - Ghent University - imec +# MIT license +# + +import os +import argparse +import unittest +import logging +from parameterized import parameterized +from glob import glob +from rdflib import Graph + +from mapping_validator import MappingValidator + +TEST_CASES_DIR = os.path.join(os.path.abspath('../test-cases'), + '*/*/mapping.ttl') +STAR_SHAPE_FILE = os.path.abspath('star.ttl') +SHACL_SHAPE_FILE = os.path.abspath('shacl.ttl') + + +class MappingValidatorTests(unittest.TestCase): + def _validate_rules(self, path: str) -> None: + rules = Graph().parse(path, format='turtle') + mapping_validator = MappingValidator(STAR_SHAPE_FILE) + mapping_validator.validate(rules) + + def _validate_shapes(self, path: str) -> None: + rules = Graph().parse(path, format='turtle') + mapping_validator = MappingValidator(SHACL_SHAPE_FILE) + mapping_validator.validate(rules) + + def test_non_existing_mapping_rules(self) -> None: + with self.assertRaises(FileNotFoundError): + p = os.path.abspath('does_not_exist.ttl') + self._validate_rules(p) + + @parameterized.expand([(p,) for p in sorted(glob(TEST_CASES_DIR))], + skip_on_empty=True) + def test_validation_rules(self, path: str) -> None: + """ + Test if our SHACL shapes are able to validate our validation mapping + rules test cases. + """ + print(f'Testing validation with: {path}') + if 'invalid' in path: + with self.assertRaises(Exception): + self._validate_rules(path) + else: + self._validate_rules(path) + + def test_validation_shapes(self) -> None: + """ + Test if our SHACL shapes are valid according to the W3C Recommdendation + of SHACL. Validation with the official SHACL shapes for SHACL. + + See https://www.w3.org/TR/shacl/#shacl-shacl + """ + self._validate_shapes('./star.ttl') + + +if __name__ == '__main__': + parser = argparse.ArgumentParser(description='Execute tests for SHACL ' + 'shapes on RML mapping rules.') + parser.add_argument('--verbose', '-v', action='count', default=1, + help='Set verbosity level of messages. Example: -vvv') + args = parser.parse_args() + + args.verbose = 70 - (10 * args.verbose) if args.verbose > 0 else 0 + logging.basicConfig(level=args.verbose, + format='%(asctime)s %(levelname)s: %(message)s', + datefmt='%Y-%m-%d %H:%M:%S') + + print(TEST_CASES_DIR) + unittest.main(failfast=False) diff --git a/src/test/java/burp/Test.java b/src/test/java/burp/Test.java index 8a7135c9..e69de29b 100644 --- a/src/test/java/burp/Test.java +++ b/src/test/java/burp/Test.java @@ -1,18 +0,0 @@ -package burp; - -import com.google.common.collect.Lists; -import java.util.ArrayList; -import java.util.List; - -public class Test { - - public static void main(String[] args) { - List> list = new ArrayList>(); - list.add(List.of(1, 2)); - list.add(List.of(3, 4)); - - System.out.println(Lists.cartesianProduct(list)); - - } - -} diff --git a/src/test/java/burp/TestData.java b/src/test/java/burp/TestData.java new file mode 100644 index 00000000..78a36c9f --- /dev/null +++ b/src/test/java/burp/TestData.java @@ -0,0 +1,68 @@ +package burp; + +public class TestData { + + public String ID; + public String title; + public String description; + public String specification; + public String baseIRI; + public String mapping; + public String input_format1; + public String input_format2; + public String input_format3; + public String output_format1; + public String output_format2; + public String output_format3; + public String input1; + public String input2; + public String input3; + public String output1; + public String output2; + public String output3; + public boolean error; + + TestData(String ID, + String title, + String description, + String specification, + String baseIRI, + String mapping, + String input_format1, + String input_format2, + String input_format3, + String output_format1, + String output_format2, + String output_format3, + String input1, + String input2, + String input3, + String output1, + String output2, + String output3, + String error) { + this.ID = ID; + this.title = title; + this.description = description; + this.specification = specification; + this.baseIRI = baseIRI; + this.mapping = mapping; + this.input_format1 = input_format1; + this.input_format2 = input_format2; + this.input_format3 = input_format3; + this.output_format1 = output_format1; + this.output_format2 = output_format2; + this.output_format3 = output_format3; + this.input1 = input1; + this.input2 = input2; + this.input3 = input3; + this.output1 = output1; + this.output2 = output2; + this.output3 = output3; + this.error = "true".equalsIgnoreCase(error); + } + + public String toString() { + return ID; + } +} diff --git a/src/test/java/burp/TestRMLCC.java b/src/test/java/burp/TestRMLCC.java index 7d8ca2f2..37c5d5c8 100644 --- a/src/test/java/burp/TestRMLCC.java +++ b/src/test/java/burp/TestRMLCC.java @@ -1,133 +1,108 @@ - package burp; -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertTrue; + +import com.opencsv.CSVReader; +import com.opencsv.exceptions.CsvException; +import org.apache.jena.rdf.model.Model; +import org.apache.jena.riot.RDFDataMgr; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; import java.io.File; +import java.io.FileReader; import java.io.IOException; import java.nio.file.Files; +import java.nio.file.Path; import java.nio.file.Paths; -import java.util.Iterator; +import java.util.ArrayList; +import java.util.List; +import java.util.stream.Stream; -import org.apache.jena.query.Dataset; -import org.apache.jena.rdf.model.Model; -import org.apache.jena.rdf.model.Resource; -import org.apache.jena.riot.RDFDataMgr; -import org.apache.jena.riot.RDFFormat; -import org.junit.jupiter.api.Test; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; public class TestRMLCC { - private static String base = "./src/test/resources/rml-cc/"; - - @Test public void RMLTCCC0001Alt() throws IOException { testForOK("RMLTC-CC-0001-Alt"); } - @Test public void RMLTCCC0001Bag() throws IOException { testForOK("RMLTC-CC-0001-Bag"); } - @Test public void RMLTCCC0001List() throws IOException { testForOK("RMLTC-CC-0001-List"); } - @Test public void RMLTCCC0001Seq() throws IOException { testForOK("RMLTC-CC-0001-Seq"); } - @Test public void RMLTCCC0002Bag() throws IOException { testForOK("RMLTC-CC-0002-Bag"); } - @Test public void RMLTCCC0002List() throws IOException { testForOK("RMLTC-CC-0002-List"); } - @Test public void RMLTCCC0003EB() throws IOException { testForOK("RMLTC-CC-0003-EB"); } - @Test public void RMLTCCC0003EL() throws IOException { testForOK("RMLTC-CC-0003-EL"); } - @Test public void RMLTCCC0003ELNamed() throws IOException { testForOK("RMLTC-CC-0003-EL-Named"); } - @Test public void RMLTCCC0003ELBN() throws IOException { testForOK("RMLTC-CC-0003-EL-BN"); } - @Test public void RMLTCCC0003NEB() throws IOException { testForOK("RMLTC-CC-0003-NEB"); } - @Test public void RMLTCCC0003NEL() throws IOException { testForOK("RMLTC-CC-0003-NEL"); } - @Test public void RMLTCCC0003NELb() throws IOException { testForOK("RMLTC-CC-0003-NELb"); } - @Test public void RMLTCCC0004SM1() throws IOException { testForOK("RMLTC-CC-0004-SM1"); } - @Test public void RMLTCCC0004SM2() throws IOException { testForOK("RMLTC-CC-0004-SM2"); } - @Test public void RMLTCCC0004SM3() throws IOException { testForOK("RMLTC-CC-0004-SM3"); } - @Test public void RMLTCCC0004SM4() throws IOException { testForOK("RMLTC-CC-0004-SM4"); } - @Test public void RMLTCCC0004SM5() throws IOException { testForOK("RMLTC-CC-0004-SM5"); } - @Test public void RMLTCCC0005App1() throws IOException { testForOK("RMLTC-CC-0005-App1"); } - @Test public void RMLTCCC0005App2() throws IOException { testForOK("RMLTC-CC-0005-App2"); } - @Test public void RMLTCCC0005Car1() throws IOException { testForOK("RMLTC-CC-0005-Car1"); } - @Test public void RMLTCCC0005Car2() throws IOException { testForOK("RMLTC-CC-0005-Car2"); } - @Test public void RMLTCCC0006IT0() throws IOException { testForOK("RMLTC-CC-0006-IT0"); } - @Test public void RMLTCCC0006IT1() throws IOException { testForOK("RMLTC-CC-0006-IT1"); } - @Test public void RMLTCCC0006IT2() throws IOException { testForOK("RMLTC-CC-0006-IT2"); } - @Test public void RMLTCCC0007NES() throws IOException { testForOK("RMLTC-CC-0007-NES"); } - @Test public void RMLTCCC0008ROMa() throws IOException { testForOK("RMLTC-CC-0008-ROMa"); } - @Test public void RMLTCCC0008ROMb() throws IOException { testForOK("RMLTC-CC-0008-ROMb"); } - @Test public void RMLTCCC0009DUPLIST() throws IOException { testForOK("RMLTC-CC-0009-DUP-List"); } - @Test public void RMLTCCC0009DUPBAG() throws IOException { testForOK("RMLTC-CC-0009-DUP-BAG"); } - @Test public void RMLTCCC0010LIST() throws IOException { testForGraphsOK("RMLTC-CC-0010-List"); } - @Test public void RMLTCCC0010LISTb() throws IOException { testForGraphsOK("RMLTC-CC-0010-Listb"); } - - public void testForOK(String f) throws IOException { - System.out.println(String.format("Now processing %s", f)); - String m = new File(base + f, "mapping.ttl").getAbsolutePath().toString(); - String r = Files.createTempFile(null, ".nq").toString(); - System.out.println(String.format("Writing output to %s", r)); - - System.out.println("This test should generate a graph."); - String o = new File(base + f, "default.nq").getAbsolutePath().toString(); - - int exit = Main.doMain(new String[] { "-m", m, "-o", r, "-b", "http://example.com/base/" }); - - Model expected = RDFDataMgr.loadModel(o); - Model actual = RDFDataMgr.loadModel(r); - - if (!expected.isIsomorphicWith(actual)) { - expected.write(System.out, "NQ"); - System.out.println("---"); - actual.write(System.out, "NQ"); - } - - assertEquals(0, exit); - - System.out.println(expected.isIsomorphicWith(actual) ? "OK" : "NOK"); - - assertTrue(expected.isIsomorphicWith(actual)); - } - - public void testForGraphsOK(String f) throws IOException { - System.out.println(String.format("Now processing %s", f)); - String m = new File(base + f, "mapping.ttl").getAbsolutePath().toString(); - String r = Files.createTempFile(null, ".nq").toString(); - System.out.println(String.format("Writing output to %s", r)); - - System.out.println("This test should generate a graph."); - String o = new File(base + f, "default.nq").getAbsolutePath().toString(); - - int exit = Main.doMain(new String[] { "-m", m, "-o", r, "-b", "http://example.com/base/" }); - - Dataset expected = RDFDataMgr.loadDataset(o); - Dataset actual = RDFDataMgr.loadDataset(r); - - RDFDataMgr.write(System.out, expected, RDFFormat.TRIG); - System.out.println("----"); - RDFDataMgr.write(System.out, actual, RDFFormat.TRIG); - - assertTrue(expected.getDefaultModel().isIsomorphicWith(actual.getDefaultModel())); - Iterator names = expected.listModelNames(); - while(names.hasNext()) { - Resource name = names.next(); - assertTrue(expected.getNamedModel(r).isIsomorphicWith(actual.getNamedModel(r))); - } - names = actual.listModelNames(); - while(names.hasNext()) { - Resource name = names.next(); - assertTrue(expected.getNamedModel(r).isIsomorphicWith(actual.getNamedModel(r))); - } - - assertEquals(0, exit); - } - - public void testForNotOK(String f) throws IOException { - System.out.println(String.format("Now processing %s", f)); - String m = new File(base + f, "mapping.ttl").getAbsolutePath().toString(); - String r = Files.createTempFile(null, ".nq").toString(); - System.out.println(String.format("Writing output to %s", r)); - - System.out.println("This test should NOT generate a graph."); - int exit = Main.doMain(new String[] { "-m", m, "-o", r }); - System.out.println(Files.size(Paths.get(r)) == 0 ? "OK" : "NOK"); - Model actual = RDFDataMgr.loadModel(r); - actual.write(System.out, "NQ"); - - assertTrue(exit > 0); - assertTrue(Files.size(Paths.get(r)) == 0); - - System.out.println(); - } - -} \ No newline at end of file + + public static String base = "./src/test/resources/rml-cc/"; + + static Stream testDataProvider() throws IOException, CsvException { + + Path testCaseDir = Paths.get(base); + + List testDataList = new ArrayList(); + Path csvFilePath = testCaseDir.resolve("./metadata.csv"); + CSVReader reader = new CSVReader(new FileReader(csvFilePath.toFile())); + List records = reader.readAll(); + //skip the header + for (int i = 1; i < records.size(); i++) { + String[] record = records.get(i); + testDataList.add(new TestData( + record[0], record[1], record[2], record[3], "http://www.example.org/", + record[4], record[5], record[6], record[7], + record[8], record[9], record[10], record[11], + record[12], record[13], record[14], record[15], + record[16], record[17])); + } + return testDataList.stream(); + } + + @ParameterizedTest + @MethodSource("testDataProvider") + void testDirectoryBasedCases(TestData testData) throws IOException { + System.out.println("--------------------------------------------------------------------------------"); + System.out.println(String.format("Processing test %s", testData.ID)); + System.out.println("--------------------------------------------------------------------------------"); + + System.out.println(testData.mapping); + System.out.println(testData.output1); + System.out.println(testData.error); + System.out.println(); + + if(testData.error) + testForNotOK(testData); + else + testForOK(testData); + } + + public void testForOK(TestData testData) throws IOException { + String m = new File(base + testData.ID, testData.mapping).getAbsolutePath().toString(); + String r = Files.createTempFile(null, ".nq").toString(); + System.out.println(String.format("Writing output to %s", r)); + + System.out.println("This test should generate a graph."); + String o = new File(base + testData.ID, testData.output1).getAbsolutePath().toString(); + + int exit = Main.doMain(new String[] { "-m", m, "-o", r, "-b", "http://example.com/base/" }); + + Model expected = RDFDataMgr.loadModel(o); + Model actual = RDFDataMgr.loadModel(r); + + if (!expected.isIsomorphicWith(actual)) { + expected.write(System.out, "Turtle"); + System.out.println("---"); + actual.write(System.out, "Turtle"); + } + + assertEquals(0, exit); + + System.out.println(expected.isIsomorphicWith(actual) ? "OK" : "NOK"); + + assertTrue(expected.isIsomorphicWith(actual)); + } + + public void testForNotOK(TestData testData) throws IOException { + String m = new File(base + testData.ID, testData.mapping).getAbsolutePath().toString(); + String r = Files.createTempFile(null, ".nq").toString(); + System.out.println(String.format("Writing output to %s", r)); + + System.out.println("This test should NOT generate a graph."); + int exit = Main.doMain(new String[] { "-m", m, "-o", r }); + System.out.println(Files.size(Paths.get(r)) == 0 ? "OK" : "NOK"); + Model actual = RDFDataMgr.loadModel(r); + actual.write(System.out, "NQ"); + + assertTrue(exit > 0); + assertTrue(Files.size(Paths.get(r)) == 0); + + System.out.println(); + } +} diff --git a/src/test/java/burp/TestRMLCore.java b/src/test/java/burp/TestRMLCore.java index 4c0bcc86..b40c64c3 100644 --- a/src/test/java/burp/TestRMLCore.java +++ b/src/test/java/burp/TestRMLCore.java @@ -1,217 +1,109 @@ package burp; -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertTrue; +import com.opencsv.CSVReader; +import com.opencsv.exceptions.CsvException; +import org.apache.jena.rdf.model.Model; +import org.apache.jena.riot.RDFDataMgr; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; import java.io.File; +import java.io.FileReader; import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; import java.util.List; -import java.util.stream.Collectors; +import java.util.ArrayList; import java.util.stream.Stream; -import org.apache.jena.rdf.model.Model; -import org.apache.jena.riot.RDFDataMgr; -import org.junit.jupiter.api.Test; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; public class TestRMLCore { - private static String base = "./src/test/resources/rml-core/"; - -// public static void main(String[] args) { -// try (Stream stream = Files.list(Paths.get(base))) { -// List files = stream.filter(f -> Files.isDirectory(f) && f.getFileName().toString().contains("XML")) -// .map(Path::getFileName).map(Path::toString).collect(Collectors.toList()); -// -// for (String f : files) { -// if (!new File(base + f, "output.nq").exists()) { -// String f1 = f.replace("-", ""); -// System.out.println("@Test public void " + f1 + "() throws IOException { testForNotOK(\"" + f + "\"); }"); -// } -// } -// } catch (Exception e) { -// System.err.println(e.getMessage()); -// throw new RuntimeException(e); -// } -// } - - @Test public void RMLTC0000CSV() throws IOException { testForOK("RMLTC0000-CSV"); } - @Test public void RMLTC0001aCSV() throws IOException { testForOK("RMLTC0001a-CSV"); } - @Test public void RMLTC0001bCSV() throws IOException { testForOK("RMLTC0001b-CSV"); } - @Test public void RMLTC0002aCSV() throws IOException { testForOK("RMLTC0002a-CSV"); } - @Test public void RMLTC0002bCSV() throws IOException { testForOK("RMLTC0002b-CSV"); } - @Test public void RMLTC0003cCSV() throws IOException { testForOK("RMLTC0003c-CSV"); } - @Test public void RMLTC0004aCSV() throws IOException { testForOK("RMLTC0004a-CSV"); } - @Test public void RMLTC0005aCSV() throws IOException { testForOK("RMLTC0005a-CSV"); } - @Test public void RMLTC0006aCSV() throws IOException { testForOK("RMLTC0006a-CSV"); } - @Test public void RMLTC0007aCSV() throws IOException { testForOK("RMLTC0007a-CSV"); } - @Test public void RMLTC0007bCSV() throws IOException { testForOK("RMLTC0007b-CSV"); } - @Test public void RMLTC0007cCSV() throws IOException { testForOK("RMLTC0007c-CSV"); } - @Test public void RMLTC0007dCSV() throws IOException { testForOK("RMLTC0007d-CSV"); } - @Test public void RMLTC0007eCSV() throws IOException { testForOK("RMLTC0007e-CSV"); } - @Test public void RMLTC0007fCSV() throws IOException { testForOK("RMLTC0007f-CSV"); } - @Test public void RMLTC0007gCSV() throws IOException { testForOK("RMLTC0007g-CSV"); } - @Test public void RMLTC0008aCSV() throws IOException { testForOK("RMLTC0008a-CSV"); } - @Test public void RMLTC0008bCSV() throws IOException { testForOK("RMLTC0008b-CSV"); } - @Test public void RMLTC0008cCSV() throws IOException { testForOK("RMLTC0008c-CSV"); } - @Test public void RMLTC0009aCSV() throws IOException { testForOK("RMLTC0009a-CSV"); } - @Test public void RMLTC0009bCSV() throws IOException { testForOK("RMLTC0009b-CSV"); } - @Test public void RMLTC0010aCSV() throws IOException { testForOK("RMLTC0010a-CSV"); } - @Test public void RMLTC0010bCSV() throws IOException { testForOK("RMLTC0010b-CSV"); } - @Test public void RMLTC0010cCSV() throws IOException { testForOK("RMLTC0010c-CSV"); } - @Test public void RMLTC0011bCSV() throws IOException { testForOK("RMLTC0011b-CSV"); } - @Test public void RMLTC0012aCSV() throws IOException { testForOK("RMLTC0012a-CSV"); } - @Test public void RMLTC0012bCSV() throws IOException { testForOK("RMLTC0012b-CSV"); } - @Test public void RMLTC0015aCSV() throws IOException { testForOK("RMLTC0015a-CSV"); } - @Test public void RMLTC0019aCSV() throws IOException { testForOK("RMLTC0019a-CSV"); } - @Test public void RMLTC0020aCSV() throws IOException { testForOK("RMLTC0020a-CSV"); } - @Test public void RMLTC0021aCSV() throws IOException { testForOK("RMLTC0021a-CSV"); } - @Test public void RMLTC0022aCSV() throws IOException { testForOK("RMLTC0022a-CSV"); } - @Test public void RMLTC0022bCSV() throws IOException { testForOK("RMLTC0022b-CSV"); } - @Test public void RMLTC0022cCSV() throws IOException { testForOK("RMLTC0022c-CSV"); } - - @Test public void RMLTC0002cCSV() throws IOException { testForNotOK("RMLTC0002c-CSV"); } - @Test public void RMLTC0002eCSV() throws IOException { testForNotOK("RMLTC0002e-CSV"); } - @Test public void RMLTC0004bCSV() throws IOException { testForNotOK("RMLTC0004b-CSV"); } - @Test public void RMLTC0007hCSV() throws IOException { testForNotOK("RMLTC0007h-CSV"); } - @Test public void RMLTC0012cCSV() throws IOException { testForNotOK("RMLTC0012c-CSV"); } - @Test public void RMLTC0012dCSV() throws IOException { testForNotOK("RMLTC0012d-CSV"); } - @Test public void RMLTC0015bCSV() throws IOException { testForNotOK("RMLTC0015b-CSV"); } - @Test public void RMLTC0019bCSV() throws IOException { testForNotOK("RMLTC0019b-CSV"); } - - @Test public void RMLTC0000JSON() throws IOException { testForOK("RMLTC0000-JSON"); } - @Test public void RMLTC0001aJSON() throws IOException { testForOK("RMLTC0001a-JSON"); } - @Test public void RMLTC0001bJSON() throws IOException { testForOK("RMLTC0001b-JSON"); } - @Test public void RMLTC0002aJSON() throws IOException { testForOK("RMLTC0002a-JSON"); } - @Test public void RMLTC0002bJSON() throws IOException { testForOK("RMLTC0002b-JSON"); } - // This test should be removed - // @Test public void RMLTC0002cJSON() throws IOException { testForOK("RMLTC0002c-JSON"); } - @Test public void RMLTC0003cJSON() throws IOException { testForOK("RMLTC0003c-JSON"); } - @Test public void RMLTC0004aJSON() throws IOException { testForOK("RMLTC0004a-JSON"); } - @Test public void RMLTC0005aJSON() throws IOException { testForOK("RMLTC0005a-JSON"); } - @Test public void RMLTC0006aJSON() throws IOException { testForOK("RMLTC0006a-JSON"); } - @Test public void RMLTC0007aJSON() throws IOException { testForOK("RMLTC0007a-JSON"); } - @Test public void RMLTC0007bJSON() throws IOException { testForOK("RMLTC0007b-JSON"); } - @Test public void RMLTC0007cJSON() throws IOException { testForOK("RMLTC0007c-JSON"); } - @Test public void RMLTC0007dJSON() throws IOException { testForOK("RMLTC0007d-JSON"); } - @Test public void RMLTC0007eJSON() throws IOException { testForOK("RMLTC0007e-JSON"); } - @Test public void RMLTC0007fJSON() throws IOException { testForOK("RMLTC0007f-JSON"); } - @Test public void RMLTC0007gJSON() throws IOException { testForOK("RMLTC0007g-JSON"); } - @Test public void RMLTC0008aJSON() throws IOException { testForOK("RMLTC0008a-JSON"); } - @Test public void RMLTC0008bJSON() throws IOException { testForOK("RMLTC0008b-JSON"); } - @Test public void RMLTC0008cJSON() throws IOException { testForOK("RMLTC0008c-JSON"); } - @Test public void RMLTC0009aJSON() throws IOException { testForOK("RMLTC0009a-JSON"); } - @Test public void RMLTC0009bJSON() throws IOException { testForOK("RMLTC0009b-JSON"); } - @Test public void RMLTC0010aJSON() throws IOException { testForOK("RMLTC0010a-JSON"); } - @Test public void RMLTC0010bJSON() throws IOException { testForOK("RMLTC0010b-JSON"); } - @Test public void RMLTC0010cJSON() throws IOException { testForOK("RMLTC0010c-JSON"); } - @Test public void RMLTC0011bJSON() throws IOException { testForOK("RMLTC0011b-JSON"); } - @Test public void RMLTC0012aJSON() throws IOException { testForOK("RMLTC0012a-JSON"); } - @Test public void RMLTC0012bJSON() throws IOException { testForOK("RMLTC0012b-JSON"); } - @Test public void RMLTC0013aJSON() throws IOException { testForOK("RMLTC0013a-JSON"); } - @Test public void RMLTC0015aJSON() throws IOException { testForOK("RMLTC0015a-JSON"); } - @Test public void RMLTC0019aJSON() throws IOException { testForOK("RMLTC0019a-JSON"); } - @Test public void RMLTC0020aJSON() throws IOException { testForOK("RMLTC0020a-JSON"); } - @Test public void RMLTC0021aJSON() throws IOException { testForOK("RMLTC0021a-JSON"); } - - @Test public void RMLTC0002eJSON() throws IOException { testForNotOK("RMLTC0002e-JSON"); } - @Test public void RMLTC0002gJSON() throws IOException { testForNotOK("RMLTC0002g-JSON"); } - @Test public void RMLTC0004bJSON() throws IOException { testForNotOK("RMLTC0004b-JSON"); } - @Test public void RMLTC0007hJSON() throws IOException { testForNotOK("RMLTC0007h-JSON"); } - @Test public void RMLTC0012cJSON() throws IOException { testForNotOK("RMLTC0012c-JSON"); } - @Test public void RMLTC0012dJSON() throws IOException { testForNotOK("RMLTC0012d-JSON"); } - @Test public void RMLTC0015bJSON() throws IOException { testForNotOK("RMLTC0015b-JSON"); } - @Test public void RMLTC0019bJSON() throws IOException { testForNotOK("RMLTC0019b-JSON"); } - - @Test public void RMLTC0000XML() throws IOException { testForOK("RMLTC0000-XML"); } - @Test public void RMLTC0001aXML() throws IOException { testForOK("RMLTC0001a-XML"); } - @Test public void RMLTC0001bXML() throws IOException { testForOK("RMLTC0001b-XML"); } - @Test public void RMLTC0002aXML() throws IOException { testForOK("RMLTC0002a-XML"); } - @Test public void RMLTC0002bXML() throws IOException { testForOK("RMLTC0002b-XML"); } - // This test should be removed - //@Test public void RMLTC0002cXML() throws IOException { testForOK("RMLTC0002c-XML"); } - @Test public void RMLTC0003cXML() throws IOException { testForOK("RMLTC0003c-XML"); } - @Test public void RMLTC0004aXML() throws IOException { testForOK("RMLTC0004a-XML"); } - @Test public void RMLTC0005aXML() throws IOException { testForOK("RMLTC0005a-XML"); } - @Test public void RMLTC0006aXML() throws IOException { testForOK("RMLTC0006a-XML"); } - @Test public void RMLTC0007aXML() throws IOException { testForOK("RMLTC0007a-XML"); } - @Test public void RMLTC0007bXML() throws IOException { testForOK("RMLTC0007b-XML"); } - @Test public void RMLTC0007cXML() throws IOException { testForOK("RMLTC0007c-XML"); } - @Test public void RMLTC0007dXML() throws IOException { testForOK("RMLTC0007d-XML"); } - @Test public void RMLTC0007eXML() throws IOException { testForOK("RMLTC0007e-XML"); } - @Test public void RMLTC0007fXML() throws IOException { testForOK("RMLTC0007f-XML"); } - @Test public void RMLTC0007gXML() throws IOException { testForOK("RMLTC0007g-XML"); } - @Test public void RMLTC0008aXML() throws IOException { testForOK("RMLTC0008a-XML"); } - @Test public void RMLTC0008bXML() throws IOException { testForOK("RMLTC0008b-XML"); } - @Test public void RMLTC0008cXML() throws IOException { testForOK("RMLTC0008c-XML"); } - @Test public void RMLTC0009aXML() throws IOException { testForOK("RMLTC0009a-XML"); } - @Test public void RMLTC0009bXML() throws IOException { testForOK("RMLTC0009b-XML"); } - @Test public void RMLTC0010bXML() throws IOException { testForOK("RMLTC0010b-XML"); } - @Test public void RMLTC0010cXML() throws IOException { testForOK("RMLTC0010c-XML"); } - @Test public void RMLTC0011bXML() throws IOException { testForOK("RMLTC0011b-XML"); } - @Test public void RMLTC0012aXML() throws IOException { testForOK("RMLTC0012a-XML"); } - @Test public void RMLTC0012bXML() throws IOException { testForOK("RMLTC0012b-XML"); } - @Test public void RMLTC0015aXML() throws IOException { testForOK("RMLTC0015a-XML"); } - @Test public void RMLTC0019aXML() throws IOException { testForOK("RMLTC0019a-XML"); } - @Test public void RMLTC0020aXML() throws IOException { testForOK("RMLTC0020a-XML"); } - @Test public void RMLTC0021aXML() throws IOException { testForOK("RMLTC0021a-XML"); } - @Test public void RMLTC0023aXML() throws IOException { testForOK("RMLTC0023a-XML"); } - @Test public void RMLTC0027XML() throws IOException { testForOK("RMLTC0027-XML"); } - - @Test public void RMLTC0002eXML() throws IOException { testForNotOK("RMLTC0002e-XML"); } - @Test public void RMLTC0004bXML() throws IOException { testForNotOK("RMLTC0004b-XML"); } - @Test public void RMLTC0007hXML() throws IOException { testForNotOK("RMLTC0007h-XML"); } - @Test public void RMLTC0012cXML() throws IOException { testForNotOK("RMLTC0012c-XML"); } - @Test public void RMLTC0012dXML() throws IOException { testForNotOK("RMLTC0012d-XML"); } - @Test public void RMLTC0015bXML() throws IOException { testForNotOK("RMLTC0015b-XML"); } - @Test public void RMLTC0019bXML() throws IOException { testForNotOK("RMLTC0019b-XML"); } - - @Test public void testForNotOK() throws IOException { testForOK("RMLTC0026a-JSON"); } - - public void testForOK(String f) throws IOException { - System.out.println(String.format("Now processing %s", f)); - String m = new File(base + f, "mapping.ttl").getAbsolutePath().toString(); - String r = Files.createTempFile(null, ".nq").toString(); - System.out.println(String.format("Writing output to %s", r)); - - System.out.println("This test should generate a graph."); - String o = new File(base + f, "output.nq").getAbsolutePath().toString(); - - int exit = Main.doMain(new String[] { "-m", m, "-o", r, "-b", "http://example.com/base/" }); - - Model expected = RDFDataMgr.loadModel(o); - Model actual = RDFDataMgr.loadModel(r); - - if (!expected.isIsomorphicWith(actual)) { - expected.write(System.out, "NQ"); - System.out.println(); - actual.write(System.out, "NQ"); - } - - assertEquals(0, exit); - - System.out.println(expected.isIsomorphicWith(actual) ? "OK" : "NOK"); - - assertTrue(expected.isIsomorphicWith(actual)); - } - - public void testForNotOK(String f) throws IOException { - System.out.println(String.format("Now processing %s", f)); - String m = new File(base + f, "mapping.ttl").getAbsolutePath().toString(); - String r = Files.createTempFile(null, ".nq").toString(); - System.out.println(String.format("Writing output to %s", r)); - - System.out.println("This test should NOT generate a graph."); - int exit = Main.doMain(new String[] { "-m", m, "-o", r }); - System.out.println(Files.size(Paths.get(r)) == 0 ? "OK" : "NOK"); - Model actual = RDFDataMgr.loadModel(r); - actual.write(System.out, "NQ"); - - assertTrue(exit > 0); - assertTrue(Files.size(Paths.get(r)) == 0); - - System.out.println(); - } - -} \ No newline at end of file + + public static String base = "./src/test/resources/rml-core/"; + + static Stream testDataProvider() throws IOException, CsvException { + + Path testCaseDir = Paths.get(base); + + List testDataList = new ArrayList<>(); + Path csvFilePath = testCaseDir.resolve("./metadata.csv"); + CSVReader reader = new CSVReader(new FileReader(csvFilePath.toFile())); + List records = reader.readAll(); + //skip the header + for (int i = 1; i < records.size(); i++) { + String[] record = records.get(i); + testDataList.add(new TestData( + record[0], record[1], record[2], record[3], + record[4], record[5], record[6], record[7], + record[8], record[9], record[10], record[11], + record[12], record[13], record[14], record[15], + record[16], record[17], record[18])); + } + return testDataList.stream(); + } + + @ParameterizedTest + @MethodSource("testDataProvider") + void testDirectoryBasedCases(TestData testData) throws IOException { + System.out.println("--------------------------------------------------------------------------------"); + System.out.printf("Processing test %s%n", testData.ID); + System.out.println("--------------------------------------------------------------------------------"); + + System.out.println(testData.mapping); + System.out.println(testData.output1); + System.out.println(testData.error); + System.out.println(); + + if(testData.error) + testForNotOK(testData); + else + testForOK(testData); + } + + public void testForOK(TestData testData) throws IOException { + String m = new File(base + testData.ID, testData.mapping).getAbsolutePath(); + String r = Files.createTempFile(null, ".nq").toString(); + System.out.printf("Writing output to %s%n", r); + + System.out.println("This test should generate a graph."); + String o = new File(base + testData.ID, testData.output1).getAbsolutePath(); + + int exit = Main.doMain(new String[] { "-m", m, "-o", r, "-b", "http://example.com/" }); + + Model expected = RDFDataMgr.loadModel(o); + Model actual = RDFDataMgr.loadModel(r); + + if (!expected.isIsomorphicWith(actual)) { + expected.write(System.out, "Turtle"); + System.out.println("---"); + actual.write(System.out, "Turtle"); + } + + assertEquals(0, exit); + + System.out.println(expected.isIsomorphicWith(actual) ? "OK" : "NOK"); + + assertTrue(expected.isIsomorphicWith(actual)); + } + + public void testForNotOK(TestData testData) throws IOException { + String m = new File(base + testData.ID, testData.mapping).getAbsolutePath(); + String r = Files.createTempFile(null, ".nq").toString(); + System.out.printf("Writing output to %s%n", r); + + System.out.println("This test should NOT generate a graph."); + int exit = Main.doMain(new String[] { "-m", m, "-o", r }); + Path path = Paths.get(r); + System.out.println(Files.size(path) == 0 ? "OK" : "NOK"); + Model actual = RDFDataMgr.loadModel(r); + actual.write(System.out, "NQ"); + + assertTrue(exit > 0); + assertEquals(0, Files.size(path)); + + System.out.println(); + } +} diff --git a/src/test/java/burp/TestRMLCoreGM.java b/src/test/java/burp/TestRMLCoreGM.java.old similarity index 100% rename from src/test/java/burp/TestRMLCoreGM.java rename to src/test/java/burp/TestRMLCoreGM.java.old diff --git a/src/test/java/burp/TestRMLCoreMySQL.java b/src/test/java/burp/TestRMLCoreMySQL.java.old similarity index 100% rename from src/test/java/burp/TestRMLCoreMySQL.java rename to src/test/java/burp/TestRMLCoreMySQL.java.old diff --git a/src/test/java/burp/TestRMLCorePostgreSQL.java b/src/test/java/burp/TestRMLCorePostgreSQL.java.old similarity index 100% rename from src/test/java/burp/TestRMLCorePostgreSQL.java rename to src/test/java/burp/TestRMLCorePostgreSQL.java.old diff --git a/src/test/java/burp/TestRMLFNML.java b/src/test/java/burp/TestRMLFNML.java.old similarity index 100% rename from src/test/java/burp/TestRMLFNML.java rename to src/test/java/burp/TestRMLFNML.java.old diff --git a/src/test/java/burp/TestRMLFNMLGrellFunctions.java b/src/test/java/burp/TestRMLFNMLGrellFunctions.java.old similarity index 100% rename from src/test/java/burp/TestRMLFNMLGrellFunctions.java rename to src/test/java/burp/TestRMLFNMLGrellFunctions.java.old diff --git a/src/test/java/burp/TestRMLIOSource.java b/src/test/java/burp/TestRMLIOSource.java deleted file mode 100644 index aad3e31c..00000000 --- a/src/test/java/burp/TestRMLIOSource.java +++ /dev/null @@ -1,100 +0,0 @@ - -package burp; -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertTrue; - -import java.io.File; -import java.io.IOException; -import java.nio.file.Files; -import java.nio.file.Paths; - -import org.apache.jena.rdf.model.Model; -import org.apache.jena.riot.RDFDataMgr; -import org.junit.jupiter.api.Test; - -public class TestRMLIOSource { - private static String base = "./src/test/resources/rml-io/"; - - // This test fails because the remote file has been moved. - // @Test public void RMLTTC0000() throws IOException { testForOK("RMLTTC0000"); } - @Test public void RMLSTC0001a() throws IOException { testForOK("RMLSTC0001a"); } - @Test public void RMLSTC0001b() throws IOException { testForOK("RMLSTC0001b"); } - @Test public void RMLSTC0002a() throws IOException { testForOK("RMLSTC0002a"); } - @Test public void RMLSTC0002b() throws IOException { testForOK("RMLSTC0002b"); } - @Test public void RMLSTC0002c() throws IOException { testForOK("RMLSTC0002c"); } - @Test public void RMLSTC0002d() throws IOException { testForOK("RMLSTC0002d"); } - @Test public void RMLSTC0002e() throws IOException { testForOK("RMLSTC0002e"); } - @Test public void RMLSTC0003() throws IOException { testForOK("RMLSTC0003"); } - - // 3b --> SPARQL TSV --> Can of worms - // @Test public void RMLSTC0003b() throws IOException { testForOK("RMLSTC0003b"); } - // 3c --> SPARQL JSON --> Can of wormsO - // @Test public void RMLSTC0003c() throws IOException { testForOK("RMLSTC0003c"); } - - @Test public void RMLSTC0004a() throws IOException { testForOK("RMLSTC0004a"); } - @Test public void RMLSTC0004b() throws IOException { testForOK("RMLSTC0004b"); } - @Test public void RMLSTC0004c() throws IOException { testForOK("RMLSTC0004c"); } - @Test public void RMLSTC0005a() throws IOException { testForOK("RMLSTC0005a"); } - @Test public void RMLSTC0005b() throws IOException { testForOK("RMLSTC0005b"); } - @Test public void RMLSTC0006a() throws IOException { testForOK("RMLSTC0006a"); } - @Test public void RMLSTC0006b() throws IOException { testForOK("RMLSTC0006b"); } - - // This test requires a SPARQL endpoint [disabled] - // @Test public void RMLSTC0006c() throws IOException { testForOK("RMLSTC0006c"); } - - @Test public void RMLSTC0006d() throws IOException { testForOK("RMLSTC0006d"); } - @Test public void RMLSTC0006e() throws IOException { testForOK("RMLSTC0006e"); } - // TEST IS UNCLEAR - // @Test public void RMLSTC0006f() throws IOException { testForOK("RMLSTC0006f"); } - - @Test public void RMLSTC0007a() throws IOException { testForOK("RMLSTC0007a"); } - @Test public void RMLSTC0007b() throws IOException { testForOK("RMLSTC0007b"); } - @Test public void RMLSTC0007c() throws IOException { testForOK("RMLSTC0007c"); } - @Test public void RMLSTC0007d() throws IOException { testForOK("RMLSTC0007d"); } - - public void testForOK(String f) throws IOException { - System.out.println(String.format("Now processing %s", f)); - String m = new File(base + f, "mapping.ttl").getAbsolutePath().toString(); - String r = Files.createTempFile(null, ".nq").toString(); - System.out.println(String.format("Writing output to %s", r)); - - System.out.println("This test should generate a graph."); - String o = new File(base + f, "default.nq").getAbsolutePath().toString(); - - int exit = Main.doMain(new String[] { "-m", m, "-o", r, "-b", "http://example.com/base/" }); - - Model expected = RDFDataMgr.loadModel(o); - Model actual = RDFDataMgr.loadModel(r); - - if (!expected.isIsomorphicWith(actual)) { - expected.write(System.out, "Turtle"); - System.out.println("---"); - actual.write(System.out, "Turtle"); - } - - assertEquals(0, exit); - - System.out.println(expected.isIsomorphicWith(actual) ? "OK" : "NOK"); - - assertTrue(expected.isIsomorphicWith(actual)); - } - - public void testForNotOK(String f) throws IOException { - System.out.println(String.format("Now processing %s", f)); - String m = new File(base + f, "mapping.ttl").getAbsolutePath().toString(); - String r = Files.createTempFile(null, ".nq").toString(); - System.out.println(String.format("Writing output to %s", r)); - - System.out.println("This test should NOT generate a graph."); - int exit = Main.doMain(new String[] { "-m", m, "-o", r }); - System.out.println(Files.size(Paths.get(r)) == 0 ? "OK" : "NOK"); - Model actual = RDFDataMgr.loadModel(r); - actual.write(System.out, "NQ"); - - assertTrue(exit > 0); - assertTrue(Files.size(Paths.get(r)) == 0); - - System.out.println(); - } - -} \ No newline at end of file diff --git a/src/test/java/burp/TestRMLIOTarget.java b/src/test/java/burp/TestRMLIOTarget.java deleted file mode 100644 index d71dc655..00000000 --- a/src/test/java/burp/TestRMLIOTarget.java +++ /dev/null @@ -1,106 +0,0 @@ - -package burp; -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertTrue; - -import java.io.File; -import java.io.IOException; -import java.nio.file.Files; -import java.nio.file.Paths; - -import org.apache.jena.rdf.model.Model; -import org.apache.jena.riot.RDFDataMgr; - -public class TestRMLIOTarget { - private static String base = "./src/test/burp/rml-io/"; - -// @Test public void RMLTTC0001a() throws IOException { testForOK("RMLTTC0001a"); } -// @Test public void RMLTTC0001b() throws IOException { testForOK("RMLTTC0001b"); } -// @Test public void RMLTTC0001c() throws IOException { testForOK("RMLTTC0001c"); } -// @Test public void RMLTTC0001d() throws IOException { testForOK("RMLTTC0001d"); } -// @Test public void RMLTTC0001e() throws IOException { testForOK("RMLTTC0001e"); } -// @Test public void RMLTTC0001f() throws IOException { testForOK("RMLTTC0001f"); } -// @Test public void RMLTTC0002a() throws IOException { testForOK("RMLTTC0002a"); } -// @Test public void RMLTTC0002b() throws IOException { testForOK("RMLTTC0002b"); } -// @Test public void RMLTTC0002c() throws IOException { testForOK("RMLTTC0002c"); } -// @Test public void RMLTTC0002d() throws IOException { testForOK("RMLTTC0002d"); } -// @Test public void RMLTTC0002e() throws IOException { testForOK("RMLTTC0002e"); } -// @Test public void RMLTTC0002f() throws IOException { testForOK("RMLTTC0002f"); } -// @Test public void RMLTTC0002g() throws IOException { testForOK("RMLTTC0002g"); } -// @Test public void RMLTTC0002h() throws IOException { testForOK("RMLTTC0002h"); } -// @Test public void RMLTTC0002i() throws IOException { testForOK("RMLTTC0002i"); } -// @Test public void RMLTTC0002j() throws IOException { testForOK("RMLTTC0002j"); } -// @Test public void RMLTTC0002k() throws IOException { testForOK("RMLTTC0002k"); } -// @Test public void RMLTTC0002l() throws IOException { testForOK("RMLTTC0002l"); } -// @Test public void RMLTTC0002m() throws IOException { testForOK("RMLTTC0002m"); } -// @Test public void RMLTTC0002n() throws IOException { testForOK("RMLTTC0002n"); } -// @Test public void RMLTTC0002o() throws IOException { testForOK("RMLTTC0002o"); } -// @Test public void RMLTTC0002p() throws IOException { testForOK("RMLTTC0002p"); } -// @Test public void RMLTTC0002q() throws IOException { testForOK("RMLTTC0002q"); } -// @Test public void RMLTTC0002r() throws IOException { testForOK("RMLTTC0002r"); } -// @Test public void RMLTTC0003a() throws IOException { testForOK("RMLTTC0003a"); } -// @Test public void RMLTTC0004a() throws IOException { testForOK("RMLTTC0004a"); } -// @Test public void RMLTTC0004b() throws IOException { testForOK("RMLTTC0004b"); } -// @Test public void RMLTTC0004c() throws IOException { testForOK("RMLTTC0004c"); } -// @Test public void RMLTTC0004d() throws IOException { testForOK("RMLTTC0004d"); } -// @Test public void RMLTTC0004e() throws IOException { testForOK("RMLTTC0004e"); } -// @Test public void RMLTTC0004f() throws IOException { testForOK("RMLTTC0004f"); } -// @Test public void RMLTTC0004g() throws IOException { testForOK("RMLTTC0004g"); } -// @Test public void RMLTTC0005a() throws IOException { testForOK("RMLTTC0005a"); } -// @Test public void RMLTTC0005b() throws IOException { testForOK("RMLTTC0005b"); } -// @Test public void RMLTTC0006a() throws IOException { testForOK("RMLTTC0006a"); } -// @Test public void RMLTTC0006b() throws IOException { testForOK("RMLTTC0006b"); } -// @Test public void RMLTTC0006c() throws IOException { testForOK("RMLTTC0006c"); } -// @Test public void RMLTTC0006d() throws IOException { testForOK("RMLTTC0006d"); } -// @Test public void RMLTTC0006e() throws IOException { testForOK("RMLTTC0006e"); } -// @Test public void RMLTTC0007a() throws IOException { testForOK("RMLTTC0007a"); } -// @Test public void RMLTTC0007b() throws IOException { testForOK("RMLTTC0007b"); } -// @Test public void RMLTTC0007c() throws IOException { testForOK("RMLTTC0007c"); } -// @Test public void RMLTTC0007d() throws IOException { testForOK("RMLTTC0007d"); } - - public void testForOK(String f) throws IOException { - System.out.println(String.format("Now processing %s", f)); - String m = new File(base + f, "mapping.ttl").getAbsolutePath().toString(); - String r = Files.createTempFile(null, ".nq").toString(); - System.out.println(String.format("Writing output to %s", r)); - - System.out.println("This test should generate a graph."); - String o = new File(base + f, "default.nq").getAbsolutePath().toString(); - - int exit = Main.doMain(new String[] { "-m", m, "-o", r, "-b", "http://example.com/base/" }); - - Model expected = RDFDataMgr.loadModel(o); - Model actual = RDFDataMgr.loadModel(r); - - if (!expected.isIsomorphicWith(actual)) { - expected.write(System.out, "Turtle"); - System.out.println("---"); - actual.write(System.out, "Turtle"); - } - - assertEquals(0, exit); - - System.out.println(expected.isIsomorphicWith(actual) ? "OK" : "NOK"); - - assertTrue(expected.isIsomorphicWith(actual)); - } - - public void testForNotOK(String f) throws IOException { - System.out.println(String.format("Now processing %s", f)); - String m = new File(base + f, "mapping.ttl").getAbsolutePath().toString(); - String r = Files.createTempFile(null, ".nq").toString(); - System.out.println(String.format("Writing output to %s", r)); - - System.out.println("This test should NOT generate a graph."); - int exit = Main.doMain(new String[] { "-m", m, "-o", r }); - System.out.println(Files.size(Paths.get(r)) == 0 ? "OK" : "NOK"); - Model actual = RDFDataMgr.loadModel(r); - actual.write(System.out, "NQ"); - - assertTrue(exit > 0); - assertTrue(Files.size(Paths.get(r)) == 0); - - System.out.println(); - } - -} \ No newline at end of file diff --git a/src/test/java/burp/TestRMLLV.java b/src/test/java/burp/TestRMLLV.java new file mode 100644 index 00000000..55f1df37 --- /dev/null +++ b/src/test/java/burp/TestRMLLV.java @@ -0,0 +1,108 @@ +package burp; + +import com.opencsv.CSVReader; +import com.opencsv.exceptions.CsvException; +import org.apache.jena.rdf.model.Model; +import org.apache.jena.riot.RDFDataMgr; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; + +import java.io.File; +import java.io.FileReader; +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.util.ArrayList; +import java.util.List; +import java.util.stream.Stream; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; + +public class TestRMLLV { + + public static String base = "./src/test/resources/rml-lv/"; + + static Stream testDataProvider() throws IOException, CsvException { + + Path testCaseDir = Paths.get(base); + + List testDataList = new ArrayList(); + Path csvFilePath = testCaseDir.resolve("./metadata.csv"); + CSVReader reader = new CSVReader(new FileReader(csvFilePath.toFile())); + List records = reader.readAll(); + //skip the header + for (int i = 1; i < records.size(); i++) { + String[] record = records.get(i); + testDataList.add(new TestData( + record[0], record[1], record[2], record[3], "http://www.example.org/", + record[4], record[5], record[6], record[7], + record[8], record[9], record[10], record[11], + record[12], record[13], record[14], record[15], + record[16], record[17])); + } + return testDataList.stream(); + } + + @ParameterizedTest + @MethodSource("testDataProvider") + void testDirectoryBasedCases(TestData testData) throws IOException { + System.out.println("--------------------------------------------------------------------------------"); + System.out.println(String.format("Processing test %s", testData.ID)); + System.out.println("--------------------------------------------------------------------------------"); + + System.out.println(testData.mapping); + System.out.println(testData.output1); + System.out.println(testData.error); + System.out.println(); + + if(testData.error) + testForNotOK(testData); + else + testForOK(testData); + } + + public void testForOK(TestData testData) throws IOException { + String m = new File(base + testData.ID, testData.mapping).getAbsolutePath().toString(); + String r = Files.createTempFile(null, ".nq").toString(); + System.out.println(String.format("Writing output to %s", r)); + + System.out.println("This test should generate a graph."); + String o = new File(base + testData.ID, testData.output1).getAbsolutePath().toString(); + + int exit = Main.doMain(new String[] { "-m", m, "-o", r, "-b", "http://example.com/base/" }); + + Model expected = RDFDataMgr.loadModel(o); + Model actual = RDFDataMgr.loadModel(r); + + if (!expected.isIsomorphicWith(actual)) { + expected.write(System.out, "Turtle"); + System.out.println("---"); + actual.write(System.out, "Turtle"); + } + + assertEquals(0, exit); + + System.out.println(expected.isIsomorphicWith(actual) ? "OK" : "NOK"); + + assertTrue(expected.isIsomorphicWith(actual)); + } + + public void testForNotOK(TestData testData) throws IOException { + String m = new File(base + testData.ID, testData.mapping).getAbsolutePath().toString(); + String r = Files.createTempFile(null, ".nq").toString(); + System.out.println(String.format("Writing output to %s", r)); + + System.out.println("This test should NOT generate a graph."); + int exit = Main.doMain(new String[] { "-m", m, "-o", r }); + System.out.println(Files.size(Paths.get(r)) == 0 ? "OK" : "NOK"); + Model actual = RDFDataMgr.loadModel(r); + actual.write(System.out, "NQ"); + + assertTrue(exit > 0); + assertTrue(Files.size(Paths.get(r)) == 0); + + System.out.println(); + } +} diff --git a/src/test/resources/rml-cc/RMLTC-CC-0001-Alt/README.md b/src/test/resources/rml-cc/RMLTC-CC-0001-Alt/README.md new file mode 100644 index 00000000..6c1a5014 --- /dev/null +++ b/src/test/resources/rml-cc/RMLTC-CC-0001-Alt/README.md @@ -0,0 +1,64 @@ +## RMLTC-CC-0001-Alt + +**Title**: Generate a rdf:Alt as an object + +**Description**: Tests if a rdf:Alt is generated as an object + +**Error expected?** No + +**Input** + [http://w3id.org/rml/resources/rml-io/RMLTC-CC-0001-Alt/Friends.json](http://w3id.org/rml/resources/rml-io/RMLTC-CC-0001-Alt/Friends.json) + +**Mapping** +``` +@prefix rml: . +@prefix rdf: . +@prefix ex: . + + a rml:TriplesMap; + rml:logicalSource [ + rml:source _:b738439 ; + rml:referenceFormulation rml:JSONPath ; + rml:iterator "$.*" ; + ] ; + + rml:subjectMap [ + rml:template "e/{$.id}" ; + ] ; + + rml:predicateObjectMap [ + rml:predicate ex:with ; + rml:objectMap [ + rml:gather ( [ rml:reference "$.values.*" ; ] ) ; + rml:gatherAs rdf:Alt ; + ] ; + ] ; +. + +_:b738439 a rml:RelativePathSource ; + rml:root rml:MappingDirectory ; + rml:path "data.json" . +``` + +**Output** +``` + _:nc808fbd2e11a4baa939c61c8210b5909b1 . +_:nc808fbd2e11a4baa939c61c8210b5909b1 . +_:nc808fbd2e11a4baa939c61c8210b5909b1 "1" . +_:nc808fbd2e11a4baa939c61c8210b5909b1 "2" . +_:nc808fbd2e11a4baa939c61c8210b5909b1 "3" . + + _:nc808fbd2e11a4baa939c61c8210b5909b2 . +_:nc808fbd2e11a4baa939c61c8210b5909b2 . +_:nc808fbd2e11a4baa939c61c8210b5909b2 "4" . +_:nc808fbd2e11a4baa939c61c8210b5909b2 "5" . +_:nc808fbd2e11a4baa939c61c8210b5909b2 "6" . + + _:nc808fbd2e11a4baa939c61c8210b5909b3 . +_:nc808fbd2e11a4baa939c61c8210b5909b3 . +_:nc808fbd2e11a4baa939c61c8210b5909b3 "7" . +_:nc808fbd2e11a4baa939c61c8210b5909b3 "8" . +_:nc808fbd2e11a4baa939c61c8210b5909b3 "9" . + +``` + diff --git a/src/test/resources/rml-cc/RMLTC-CC-0001-Alt/mapping.ttl b/src/test/resources/rml-cc/RMLTC-CC-0001-Alt/mapping.ttl index a72409e0..11c108f3 100644 --- a/src/test/resources/rml-cc/RMLTC-CC-0001-Alt/mapping.ttl +++ b/src/test/resources/rml-cc/RMLTC-CC-0001-Alt/mapping.ttl @@ -1,9 +1,8 @@ @prefix rml: . @prefix rdf: . @prefix ex: . -@base . -<#TM> a rml:TriplesMap; + a rml:TriplesMap; rml:logicalSource [ rml:source _:b738439 ; rml:referenceFormulation rml:JSONPath ; @@ -24,4 +23,5 @@ . _:b738439 a rml:RelativePathSource ; + rml:root rml:MappingDirectory ; rml:path "data.json" . \ No newline at end of file diff --git a/src/test/resources/rml-cc/RMLTC-CC-0001-Bag/README.md b/src/test/resources/rml-cc/RMLTC-CC-0001-Bag/README.md new file mode 100644 index 00000000..d5eacf32 --- /dev/null +++ b/src/test/resources/rml-cc/RMLTC-CC-0001-Bag/README.md @@ -0,0 +1,61 @@ +## RMLTC-CC-0001-Bag + +**Title**: Generate a rdf:Bag as an object + +**Description**: Tests if a rdf:Bag is generated as an object + +**Error expected?** No + +**Input** + [http://w3id.org/rml/resources/rml-io/RMLTC-CC-0001-Bag/Friends.json](http://w3id.org/rml/resources/rml-io/RMLTC-CC-0001-Bag/Friends.json) + +**Mapping** +``` +@prefix rml: . +@prefix rdf: . +@prefix ex: . + + a rml:TriplesMap; + rml:logicalSource [ + rml:source _:b738439 ; + rml:referenceFormulation rml:JSONPath ; + rml:iterator "$.*" ; + ] ; + + rml:subjectMap [ + rml:template "e/{$.id}" ; + ] ; + + rml:predicateObjectMap [ + rml:predicate ex:with ; + rml:objectMap [ + rml:gather ( [ rml:reference "$.values.*" ; ] ) ; + rml:gatherAs rdf:Bag ; + ] ; + ] ; +. + +_:b738439 a rml:RelativePathSource ; + rml:root rml:MappingDirectory ; + rml:path "data.json" . +``` + +**Output** +``` +_:nc808fbd2e11a4baa939c61c8210b5909b1 . +_:nc808fbd2e11a4baa939c61c8210b5909b2 "5" . +_:nc808fbd2e11a4baa939c61c8210b5909b2 . +_:nc808fbd2e11a4baa939c61c8210b5909b3 . +_:nc808fbd2e11a4baa939c61c8210b5909b3 "9" . +_:nc808fbd2e11a4baa939c61c8210b5909b1 "2" . + _:nc808fbd2e11a4baa939c61c8210b5909b2 . +_:nc808fbd2e11a4baa939c61c8210b5909b1 "1" . + _:nc808fbd2e11a4baa939c61c8210b5909b3 . + _:nc808fbd2e11a4baa939c61c8210b5909b1 . +_:nc808fbd2e11a4baa939c61c8210b5909b2 "4" . +_:nc808fbd2e11a4baa939c61c8210b5909b3 "7" . +_:nc808fbd2e11a4baa939c61c8210b5909b2 "6" . +_:nc808fbd2e11a4baa939c61c8210b5909b1 "3" . +_:nc808fbd2e11a4baa939c61c8210b5909b3 "8" . +``` + diff --git a/src/test/resources/rml-cc/RMLTC-CC-0001-Bag/mapping.ttl b/src/test/resources/rml-cc/RMLTC-CC-0001-Bag/mapping.ttl index 20d9348f..cefcb53e 100644 --- a/src/test/resources/rml-cc/RMLTC-CC-0001-Bag/mapping.ttl +++ b/src/test/resources/rml-cc/RMLTC-CC-0001-Bag/mapping.ttl @@ -1,9 +1,8 @@ @prefix rml: . @prefix rdf: . @prefix ex: . -@base . -<#TM> a rml:TriplesMap; + a rml:TriplesMap; rml:logicalSource [ rml:source _:b738439 ; rml:referenceFormulation rml:JSONPath ; @@ -24,4 +23,5 @@ . _:b738439 a rml:RelativePathSource ; + rml:root rml:MappingDirectory ; rml:path "data.json" . \ No newline at end of file diff --git a/src/test/resources/rml-cc/RMLTC-CC-0001-List/README.md b/src/test/resources/rml-cc/RMLTC-CC-0001-List/README.md new file mode 100644 index 00000000..25824e58 --- /dev/null +++ b/src/test/resources/rml-cc/RMLTC-CC-0001-List/README.md @@ -0,0 +1,70 @@ +## RMLTC-CC-0001-List + +**Title**: Generate a rdf:List as an object + +**Description**: Tests if a rdf:List is generated as an object + +**Error expected?** No + +**Input** + [http://w3id.org/rml/resources/rml-io/RMLTC-CC-0001-List/Friends.json](http://w3id.org/rml/resources/rml-io/RMLTC-CC-0001-List/Friends.json) + +**Mapping** +``` +@prefix rml: . +@prefix rdf: . +@prefix ex: . + + a rml:TriplesMap; + rml:logicalSource [ + rml:source _:b738439 ; + rml:referenceFormulation rml:JSONPath ; + rml:iterator "$.*" ; + ] ; + + rml:subjectMap [ + rml:template "e/{$.id}" ; + ] ; + + rml:predicateObjectMap [ + rml:predicate ex:with ; + rml:objectMap [ + rml:gather ( [ rml:reference "$.values.*" ; ] ) ; + rml:gatherAs rdf:List ; + ] ; + ] ; +. + +_:b738439 a rml:RelativePathSource ; + rml:root rml:MappingDirectory ; + rml:path "data.json" . +``` + +**Output** +``` + _:n988e0f11d19c486fa3b3255f94c9b3bab1 . +_:n988e0f11d19c486fa3b3255f94c9b3bab1 "1" . +_:n988e0f11d19c486fa3b3255f94c9b3bab1 _:n988e0f11d19c486fa3b3255f94c9b3bab2 . +_:n988e0f11d19c486fa3b3255f94c9b3bab2 "2" . +_:n988e0f11d19c486fa3b3255f94c9b3bab2 _:n988e0f11d19c486fa3b3255f94c9b3bab3 . +_:n988e0f11d19c486fa3b3255f94c9b3bab3 "3" . +_:n988e0f11d19c486fa3b3255f94c9b3bab3 . + + _:n988e0f11d19c486fa3b3255f94c9b3bab4 . +_:n988e0f11d19c486fa3b3255f94c9b3bab4 "4" . +_:n988e0f11d19c486fa3b3255f94c9b3bab4 _:n988e0f11d19c486fa3b3255f94c9b3bab5 . +_:n988e0f11d19c486fa3b3255f94c9b3bab5 "5" . +_:n988e0f11d19c486fa3b3255f94c9b3bab5 _:n988e0f11d19c486fa3b3255f94c9b3bab6 . +_:n988e0f11d19c486fa3b3255f94c9b3bab6 "6" . +_:n988e0f11d19c486fa3b3255f94c9b3bab6 . + + _:n988e0f11d19c486fa3b3255f94c9b3bab7 . +_:n988e0f11d19c486fa3b3255f94c9b3bab7 "7" . +_:n988e0f11d19c486fa3b3255f94c9b3bab7 _:n988e0f11d19c486fa3b3255f94c9b3bab8 . +_:n988e0f11d19c486fa3b3255f94c9b3bab8 "8" . +_:n988e0f11d19c486fa3b3255f94c9b3bab8 _:n988e0f11d19c486fa3b3255f94c9b3bab9 . +_:n988e0f11d19c486fa3b3255f94c9b3bab9 "9" . +_:n988e0f11d19c486fa3b3255f94c9b3bab9 . + +``` + diff --git a/src/test/resources/rml-cc/RMLTC-CC-0001-List/mapping.ttl b/src/test/resources/rml-cc/RMLTC-CC-0001-List/mapping.ttl index ca963e35..0e837b79 100644 --- a/src/test/resources/rml-cc/RMLTC-CC-0001-List/mapping.ttl +++ b/src/test/resources/rml-cc/RMLTC-CC-0001-List/mapping.ttl @@ -1,9 +1,8 @@ @prefix rml: . @prefix rdf: . @prefix ex: . -@base . -<#TM> a rml:TriplesMap; + a rml:TriplesMap; rml:logicalSource [ rml:source _:b738439 ; rml:referenceFormulation rml:JSONPath ; @@ -24,4 +23,5 @@ . _:b738439 a rml:RelativePathSource ; + rml:root rml:MappingDirectory ; rml:path "data.json" . \ No newline at end of file diff --git a/src/test/resources/rml-cc/RMLTC-CC-0001-Seq/README.md b/src/test/resources/rml-cc/RMLTC-CC-0001-Seq/README.md new file mode 100644 index 00000000..8afa22d6 --- /dev/null +++ b/src/test/resources/rml-cc/RMLTC-CC-0001-Seq/README.md @@ -0,0 +1,61 @@ +## RMLTC-CC-0001-Seq + +**Title**: Generate a rdf:Seq as an object + +**Description**: Tests if a rdf:Seq is generated as an object + +**Error expected?** No + +**Input** + [http://w3id.org/rml/resources/rml-io/RMLTC-CC-0001-Seq/Friends.json](http://w3id.org/rml/resources/rml-io/RMLTC-CC-0001-Seq/Friends.json) + +**Mapping** +``` +@prefix rml: . +@prefix rdf: . +@prefix ex: . + + a rml:TriplesMap; + rml:logicalSource [ + rml:source _:b738439 ; + rml:referenceFormulation rml:JSONPath ; + rml:iterator "$.*" ; + ] ; + + rml:subjectMap [ + rml:template "e/{$.id}" ; + ] ; + + rml:predicateObjectMap [ + rml:predicate ex:with ; + rml:objectMap [ + rml:gather ( [ rml:reference "$.values.*" ; ] ) ; + rml:gatherAs rdf:Seq ; + ] ; + ] ; +. + +_:b738439 a rml:RelativePathSource ; + rml:root rml:MappingDirectory ; + rml:path "data.json" . +``` + +**Output** +``` +_:nc808fbd2e11a4baa939c61c8210b5909b1 . +_:nc808fbd2e11a4baa939c61c8210b5909b2 "5" . +_:nc808fbd2e11a4baa939c61c8210b5909b2 . +_:nc808fbd2e11a4baa939c61c8210b5909b3 . +_:nc808fbd2e11a4baa939c61c8210b5909b3 "9" . +_:nc808fbd2e11a4baa939c61c8210b5909b1 "2" . + _:nc808fbd2e11a4baa939c61c8210b5909b2 . +_:nc808fbd2e11a4baa939c61c8210b5909b1 "1" . + _:nc808fbd2e11a4baa939c61c8210b5909b3 . + _:nc808fbd2e11a4baa939c61c8210b5909b1 . +_:nc808fbd2e11a4baa939c61c8210b5909b2 "4" . +_:nc808fbd2e11a4baa939c61c8210b5909b3 "7" . +_:nc808fbd2e11a4baa939c61c8210b5909b2 "6" . +_:nc808fbd2e11a4baa939c61c8210b5909b1 "3" . +_:nc808fbd2e11a4baa939c61c8210b5909b3 "8" . +``` + diff --git a/src/test/resources/rml-cc/RMLTC-CC-0001-Seq/mapping.ttl b/src/test/resources/rml-cc/RMLTC-CC-0001-Seq/mapping.ttl index 2117ebdb..03a14754 100644 --- a/src/test/resources/rml-cc/RMLTC-CC-0001-Seq/mapping.ttl +++ b/src/test/resources/rml-cc/RMLTC-CC-0001-Seq/mapping.ttl @@ -1,9 +1,8 @@ @prefix rml: . @prefix rdf: . @prefix ex: . -@base . -<#TM> a rml:TriplesMap; + a rml:TriplesMap; rml:logicalSource [ rml:source _:b738439 ; rml:referenceFormulation rml:JSONPath ; @@ -24,4 +23,5 @@ . _:b738439 a rml:RelativePathSource ; + rml:root rml:MappingDirectory ; rml:path "data.json" . \ No newline at end of file diff --git a/src/test/resources/rml-cc/RMLTC-CC-0002-Bag/README.md b/src/test/resources/rml-cc/RMLTC-CC-0002-Bag/README.md new file mode 100644 index 00000000..2af1fbd5 --- /dev/null +++ b/src/test/resources/rml-cc/RMLTC-CC-0002-Bag/README.md @@ -0,0 +1,62 @@ +## RMLTC-CC-0002-Bag + +**Title**: Generate a named rdf:Bag as an object + +**Description**: Tests if a named rdf:Bag is generated as an object + +**Error expected?** No + +**Input** + [http://w3id.org/rml/resources/rml-io/RMLTC-CC-0002-Bag/Friends.json](http://w3id.org/rml/resources/rml-io/RMLTC-CC-0002-Bag/Friends.json) + +**Mapping** +``` +@prefix rml: . +@prefix rdf: . +@prefix ex: . + + a rml:TriplesMap; + rml:logicalSource [ + rml:source _:b738439 ; + rml:referenceFormulation rml:JSONPath ; + rml:iterator "$.*" ; + ] ; + + rml:subjectMap [ + rml:template "e/{$.id}" ; + ] ; + + rml:predicateObjectMap [ + rml:predicate ex:with ; + rml:objectMap [ + rml:template "c/{$.id}" ; + rml:gather ( [ rml:reference "$.values.*" ; ] ) ; + rml:gatherAs rdf:Bag ; + ] ; + ] ; +. + +_:b738439 a rml:RelativePathSource ; + rml:root rml:MappingDirectory ; + rml:path "data.json" . +``` + +**Output** +``` + . + "7" . + "8" . + "2" . + . + . + "6" . + . + "9" . + "1" . + "3" . + "4" . + . + . + "5" . +``` + diff --git a/src/test/resources/rml-cc/RMLTC-CC-0002-Bag/mapping.ttl b/src/test/resources/rml-cc/RMLTC-CC-0002-Bag/mapping.ttl index 9924fa09..88fbb315 100644 --- a/src/test/resources/rml-cc/RMLTC-CC-0002-Bag/mapping.ttl +++ b/src/test/resources/rml-cc/RMLTC-CC-0002-Bag/mapping.ttl @@ -1,9 +1,8 @@ @prefix rml: . @prefix rdf: . @prefix ex: . -@base . -<#TM> a rml:TriplesMap; + a rml:TriplesMap; rml:logicalSource [ rml:source _:b738439 ; rml:referenceFormulation rml:JSONPath ; @@ -25,4 +24,5 @@ . _:b738439 a rml:RelativePathSource ; + rml:root rml:MappingDirectory ; rml:path "data.json" . \ No newline at end of file diff --git a/src/test/resources/rml-cc/RMLTC-CC-0002-List/README.md b/src/test/resources/rml-cc/RMLTC-CC-0002-List/README.md new file mode 100644 index 00000000..e8635f8c --- /dev/null +++ b/src/test/resources/rml-cc/RMLTC-CC-0002-List/README.md @@ -0,0 +1,68 @@ +## RMLTC-CC-0002-List + +**Title**: Generate a named rdf:List as an object + +**Description**: Tests if a named rdf:List is generated as an object + +**Error expected?** No + +**Input** + [http://w3id.org/rml/resources/rml-io/RMLTC-CC-0002-List/Friends.json](http://w3id.org/rml/resources/rml-io/RMLTC-CC-0002-List/Friends.json) + +**Mapping** +``` +@prefix rml: . +@prefix rdf: . +@prefix ex: . + + a rml:TriplesMap; + rml:logicalSource [ + rml:source _:b738439 ; + rml:referenceFormulation rml:JSONPath ; + rml:iterator "$.*" ; + ] ; + + rml:subjectMap [ + rml:template "e/{$.id}" ; + ] ; + + rml:predicateObjectMap [ + rml:predicate ex:with ; + rml:objectMap [ + rml:template "c/{$.id}" ; + rml:gather ( [ rml:reference "$.values.*" ; ] ) ; + rml:gatherAs rdf:List ; + ] ; + ] ; +. + +_:b738439 a rml:RelativePathSource ; + rml:root rml:MappingDirectory ; + rml:path "data.json" . +``` + +**Output** +``` +_:nb73dd869d6bb47a5b865ee632fe27453b1 _:nb73dd869d6bb47a5b865ee632fe27453b2 . + . + "7" . +_:nb73dd869d6bb47a5b865ee632fe27453b5 "8" . +_:nb73dd869d6bb47a5b865ee632fe27453b3 _:nb73dd869d6bb47a5b865ee632fe27453b4 . +_:nb73dd869d6bb47a5b865ee632fe27453b6 . + . +_:nb73dd869d6bb47a5b865ee632fe27453b3 "5" . + _:nb73dd869d6bb47a5b865ee632fe27453b3 . +_:nb73dd869d6bb47a5b865ee632fe27453b4 "6" . +_:nb73dd869d6bb47a5b865ee632fe27453b4 . +_:nb73dd869d6bb47a5b865ee632fe27453b5 _:nb73dd869d6bb47a5b865ee632fe27453b6 . +_:nb73dd869d6bb47a5b865ee632fe27453b2 . +_:nb73dd869d6bb47a5b865ee632fe27453b1 "2" . +_:nb73dd869d6bb47a5b865ee632fe27453b2 "3" . + "4" . + _:nb73dd869d6bb47a5b865ee632fe27453b1 . + _:nb73dd869d6bb47a5b865ee632fe27453b5 . +_:nb73dd869d6bb47a5b865ee632fe27453b6 "9" . + . + "1" . +``` + diff --git a/src/test/resources/rml-cc/RMLTC-CC-0002-List/mapping.ttl b/src/test/resources/rml-cc/RMLTC-CC-0002-List/mapping.ttl index 77149652..a97b431e 100644 --- a/src/test/resources/rml-cc/RMLTC-CC-0002-List/mapping.ttl +++ b/src/test/resources/rml-cc/RMLTC-CC-0002-List/mapping.ttl @@ -1,9 +1,8 @@ @prefix rml: . @prefix rdf: . @prefix ex: . -@base . -<#TM> a rml:TriplesMap; + a rml:TriplesMap; rml:logicalSource [ rml:source _:b738439 ; rml:referenceFormulation rml:JSONPath ; @@ -25,4 +24,5 @@ . _:b738439 a rml:RelativePathSource ; + rml:root rml:MappingDirectory ; rml:path "data.json" . \ No newline at end of file diff --git a/src/test/resources/rml-cc/RMLTC-CC-0003-EB/README.md b/src/test/resources/rml-cc/RMLTC-CC-0003-EB/README.md new file mode 100644 index 00000000..66fc3969 --- /dev/null +++ b/src/test/resources/rml-cc/RMLTC-CC-0003-EB/README.md @@ -0,0 +1,54 @@ +## RMLTC-CC-0003-EB + +**Title**: Allow the generation of empty bags + +**Description**: Tests if the use of rml:allowEmptyListAndContainer yields an empty bag. + +**Error expected?** No + +**Input** + [http://w3id.org/rml/resources/rml-io/RMLTC-CC-0003-EB/Friends.json](http://w3id.org/rml/resources/rml-io/RMLTC-CC-0003-EB/Friends.json) + +**Mapping** +``` +@prefix rml: . +@prefix rdf: . +@prefix ex: . + + a rml:TriplesMap; + rml:logicalSource [ + rml:source _:b738439 ; + rml:referenceFormulation rml:JSONPath ; + rml:iterator "$.*" ; + ] ; + + rml:subjectMap [ + rml:template "e/{$.id}" ; + ] ; + + rml:predicateObjectMap [ + rml:predicate ex:with ; + rml:objectMap [ + rml:allowEmptyListAndContainer true ; + rml:gather ( [ rml:reference "$.values.*" ; ] ) ; + rml:gatherAs rdf:Bag ; + ] ; + ] ; +. + +_:b738439 a rml:RelativePathSource ; + rml:root rml:MappingDirectory ; + rml:path "data.json" . +``` + +**Output** +``` +_:nfecac3cfe48c4afa99539cc809138e96b2 . + _:nfecac3cfe48c4afa99539cc809138e96b1 . +_:nfecac3cfe48c4afa99539cc809138e96b1 . +_:nfecac3cfe48c4afa99539cc809138e96b1 "1" . + _:nfecac3cfe48c4afa99539cc809138e96b2 . +_:nfecac3cfe48c4afa99539cc809138e96b1 "2" . +_:nfecac3cfe48c4afa99539cc809138e96b1 "3" . +``` + diff --git a/src/test/resources/rml-cc/RMLTC-CC-0003-EB/mapping.ttl b/src/test/resources/rml-cc/RMLTC-CC-0003-EB/mapping.ttl index 7ed744a7..948c61f4 100644 --- a/src/test/resources/rml-cc/RMLTC-CC-0003-EB/mapping.ttl +++ b/src/test/resources/rml-cc/RMLTC-CC-0003-EB/mapping.ttl @@ -1,9 +1,8 @@ @prefix rml: . @prefix rdf: . @prefix ex: . -@base . -<#TM> a rml:TriplesMap; + a rml:TriplesMap; rml:logicalSource [ rml:source _:b738439 ; rml:referenceFormulation rml:JSONPath ; @@ -25,4 +24,5 @@ . _:b738439 a rml:RelativePathSource ; + rml:root rml:MappingDirectory ; rml:path "data.json" . \ No newline at end of file diff --git a/src/test/resources/rml-cc/RMLTC-CC-0003-EL-BN/README.md b/src/test/resources/rml-cc/RMLTC-CC-0003-EL-BN/README.md new file mode 100644 index 00000000..6968e66d --- /dev/null +++ b/src/test/resources/rml-cc/RMLTC-CC-0003-EL-BN/README.md @@ -0,0 +1,56 @@ +## RMLTC-CC-0003-EL-BN + +**Title**: Allow the generation of empty lists identified by blank node identifiers. + +**Description**: Tests if the use of rml:allowEmptyListAndContainer yields an empty list. The lists are identified by a blank node identifier generated in the mapping. + +**Error expected?** No + +**Input** + [http://w3id.org/rml/resources/rml-io/RMLTC-CC-0003-EL-BN/Friends.json](http://w3id.org/rml/resources/rml-io/RMLTC-CC-0003-EL-BN/Friends.json) + +**Mapping** +``` +@prefix rml: . +@prefix rdf: . +@prefix ex: . + + a rml:TriplesMap; + rml:logicalSource [ + rml:source _:b738439 ; + rml:referenceFormulation rml:JSONPath ; + rml:iterator "$.*" ; + ] ; + + rml:subjectMap [ + rml:template "e/{$.id}" ; + ] ; + + rml:predicateObjectMap [ + rml:predicate ex:with ; + rml:objectMap [ + rml:template "c/{$.id}" ; rml:termType rml:BlankNode ; + rml:allowEmptyListAndContainer true ; + rml:gather ( [ rml:reference "$.values.*" ; ] ) ; + rml:gatherAs rdf:List ; + ] ; + ] ; +. + +_:b738439 a rml:RelativePathSource ; + rml:root rml:MappingDirectory ; + rml:path "data.json" . +``` + +**Output** +``` +_:n302eecc856b44ed5b76965d9be2f5213b3 . + . +_:n302eecc856b44ed5b76965d9be2f5213b2 _:n302eecc856b44ed5b76965d9be2f5213b3 . +_:n302eecc856b44ed5b76965d9be2f5213b2 "2" . +_:n302eecc856b44ed5b76965d9be2f5213b3 "3" . +_:n302eecc856b44ed5b76965d9be2f5213b1 _:n302eecc856b44ed5b76965d9be2f5213b2 . + _:n302eecc856b44ed5b76965d9be2f5213b1 . +_:n302eecc856b44ed5b76965d9be2f5213b1 "1" . +``` + diff --git a/src/test/resources/rml-cc/RMLTC-CC-0003-EL-BN/mapping.ttl b/src/test/resources/rml-cc/RMLTC-CC-0003-EL-BN/mapping.ttl index a3545827..07dce410 100644 --- a/src/test/resources/rml-cc/RMLTC-CC-0003-EL-BN/mapping.ttl +++ b/src/test/resources/rml-cc/RMLTC-CC-0003-EL-BN/mapping.ttl @@ -1,9 +1,8 @@ @prefix rml: . @prefix rdf: . @prefix ex: . -@base . -<#TM> a rml:TriplesMap; + a rml:TriplesMap; rml:logicalSource [ rml:source _:b738439 ; rml:referenceFormulation rml:JSONPath ; @@ -26,4 +25,5 @@ . _:b738439 a rml:RelativePathSource ; + rml:root rml:MappingDirectory ; rml:path "data.json" . \ No newline at end of file diff --git a/src/test/resources/rml-cc/RMLTC-CC-0003-EL-Named/README.md b/src/test/resources/rml-cc/RMLTC-CC-0003-EL-Named/README.md new file mode 100644 index 00000000..a32fecae --- /dev/null +++ b/src/test/resources/rml-cc/RMLTC-CC-0003-EL-Named/README.md @@ -0,0 +1,56 @@ +## RMLTC-CC-0003-EL-Named + +**Title**: Allow the generation of empty lists identified by IRIs. + +**Description**: Tests if the use of rml:allowEmptyListAndContainer yields an empty list. The lists are identified by a IRI generated in the mapping. + +**Error expected?** No + +**Input** + [http://w3id.org/rml/resources/rml-io/RMLTC-CC-0003-EL-Named/Friends.json](http://w3id.org/rml/resources/rml-io/RMLTC-CC-0003-EL-Named/Friends.json) + +**Mapping** +``` +@prefix rml: . +@prefix rdf: . +@prefix ex: . + + a rml:TriplesMap; + rml:logicalSource [ + rml:source _:b738439 ; + rml:referenceFormulation rml:JSONPath ; + rml:iterator "$.*" ; + ] ; + + rml:subjectMap [ + rml:template "e/{$.id}" ; + ] ; + + rml:predicateObjectMap [ + rml:predicate ex:with ; + rml:objectMap [ + rml:template "c/{$.id}" ; + rml:allowEmptyListAndContainer true ; + rml:gather ( [ rml:reference "$.values.*" ; ] ) ; + rml:gatherAs rdf:List ; + ] ; + ] ; +. + +_:b738439 a rml:RelativePathSource ; + rml:root rml:MappingDirectory ; + rml:path "data.json" . +``` + +**Output** +``` +_:n302eecc856b44ed5b76965d9be2f5213b3 . + . +_:n302eecc856b44ed5b76965d9be2f5213b2 _:n302eecc856b44ed5b76965d9be2f5213b3 . +_:n302eecc856b44ed5b76965d9be2f5213b2 "2" . +_:n302eecc856b44ed5b76965d9be2f5213b3 "3" . + _:n302eecc856b44ed5b76965d9be2f5213b2 . + . + "1" . +``` + diff --git a/src/test/resources/rml-cc/RMLTC-CC-0003-EL-Named/mapping.ttl b/src/test/resources/rml-cc/RMLTC-CC-0003-EL-Named/mapping.ttl index 8bed79e7..066ecc7a 100644 --- a/src/test/resources/rml-cc/RMLTC-CC-0003-EL-Named/mapping.ttl +++ b/src/test/resources/rml-cc/RMLTC-CC-0003-EL-Named/mapping.ttl @@ -1,9 +1,8 @@ @prefix rml: . @prefix rdf: . @prefix ex: . -@base . -<#TM> a rml:TriplesMap; + a rml:TriplesMap; rml:logicalSource [ rml:source _:b738439 ; rml:referenceFormulation rml:JSONPath ; @@ -26,4 +25,5 @@ . _:b738439 a rml:RelativePathSource ; + rml:root rml:MappingDirectory ; rml:path "data.json" . \ No newline at end of file diff --git a/src/test/resources/rml-cc/RMLTC-CC-0003-EL/README.md b/src/test/resources/rml-cc/RMLTC-CC-0003-EL/README.md new file mode 100644 index 00000000..0d764a82 --- /dev/null +++ b/src/test/resources/rml-cc/RMLTC-CC-0003-EL/README.md @@ -0,0 +1,55 @@ +## RMLTC-CC-0003-EL + +**Title**: Allow the generation of empty lists + +**Description**: Tests if the use of rml:allowEmptyListAndContainer yields an empty list. + +**Error expected?** No + +**Input** + [http://w3id.org/rml/resources/rml-io/RMLTC-CC-0003-EL/Friends.json](http://w3id.org/rml/resources/rml-io/RMLTC-CC-0003-EL/Friends.json) + +**Mapping** +``` +@prefix rml: . +@prefix rdf: . +@prefix ex: . + + a rml:TriplesMap; + rml:logicalSource [ + rml:source _:b738439 ; + rml:referenceFormulation rml:JSONPath ; + rml:iterator "$.*" ; + ] ; + + rml:subjectMap [ + rml:template "e/{$.id}" ; + ] ; + + rml:predicateObjectMap [ + rml:predicate ex:with ; + rml:objectMap [ + rml:allowEmptyListAndContainer true ; + rml:gather ( [ rml:reference "$.values.*" ; ] ) ; + rml:gatherAs rdf:List ; + ] ; + ] ; +. + +_:b738439 a rml:RelativePathSource ; + rml:root rml:MappingDirectory ; + rml:path "data.json" . +``` + +**Output** +``` +_:n302eecc856b44ed5b76965d9be2f5213b3 . + . +_:n302eecc856b44ed5b76965d9be2f5213b2 _:n302eecc856b44ed5b76965d9be2f5213b3 . +_:n302eecc856b44ed5b76965d9be2f5213b2 "2" . +_:n302eecc856b44ed5b76965d9be2f5213b3 "3" . +_:n302eecc856b44ed5b76965d9be2f5213b1 _:n302eecc856b44ed5b76965d9be2f5213b2 . + _:n302eecc856b44ed5b76965d9be2f5213b1 . +_:n302eecc856b44ed5b76965d9be2f5213b1 "1" . +``` + diff --git a/src/test/resources/rml-cc/RMLTC-CC-0003-EL/mapping.ttl b/src/test/resources/rml-cc/RMLTC-CC-0003-EL/mapping.ttl index 87f8919e..c4877f5d 100644 --- a/src/test/resources/rml-cc/RMLTC-CC-0003-EL/mapping.ttl +++ b/src/test/resources/rml-cc/RMLTC-CC-0003-EL/mapping.ttl @@ -1,9 +1,8 @@ @prefix rml: . @prefix rdf: . @prefix ex: . -@base . -<#TM> a rml:TriplesMap; + a rml:TriplesMap; rml:logicalSource [ rml:source _:b738439 ; rml:referenceFormulation rml:JSONPath ; @@ -25,4 +24,5 @@ . _:b738439 a rml:RelativePathSource ; + rml:root rml:MappingDirectory ; rml:path "data.json" . \ No newline at end of file diff --git a/src/test/resources/rml-cc/RMLTC-CC-0003-NEB/README.md b/src/test/resources/rml-cc/RMLTC-CC-0003-NEB/README.md new file mode 100644 index 00000000..1b565b85 --- /dev/null +++ b/src/test/resources/rml-cc/RMLTC-CC-0003-NEB/README.md @@ -0,0 +1,51 @@ +## RMLTC-CC-0003-NEB + +**Title**: Empty bags are not generated + +**Description**: Tests if empty containers are not generated (expected default behavior). + +**Error expected?** No + +**Input** + [http://w3id.org/rml/resources/rml-io/RMLTC-CC-0003-NEB/Friends.json](http://w3id.org/rml/resources/rml-io/RMLTC-CC-0003-NEB/Friends.json) + +**Mapping** +``` +@prefix rml: . +@prefix rdf: . +@prefix ex: . + + a rml:TriplesMap; + rml:logicalSource [ + rml:source _:b738439 ; + rml:referenceFormulation rml:JSONPath ; + rml:iterator "$.*" ; + ] ; + + rml:subjectMap [ + rml:template "e/{$.id}" ; + ] ; + + rml:predicateObjectMap [ + rml:predicate ex:with ; + rml:objectMap [ + rml:gather ( [ rml:reference "$.values.*" ; ] ) ; + rml:gatherAs rdf:Bag ; + ] ; + ] ; +. + +_:b738439 a rml:RelativePathSource ; + rml:root rml:MappingDirectory ; + rml:path "data.json" . +``` + +**Output** +``` + _:n2bd72de9c571444081890e41009d92d4b1 . +_:n2bd72de9c571444081890e41009d92d4b1 "3" . +_:n2bd72de9c571444081890e41009d92d4b1 . +_:n2bd72de9c571444081890e41009d92d4b1 "2" . +_:n2bd72de9c571444081890e41009d92d4b1 "1" . +``` + diff --git a/src/test/resources/rml-cc/RMLTC-CC-0003-NEB/mapping.ttl b/src/test/resources/rml-cc/RMLTC-CC-0003-NEB/mapping.ttl index 20d9348f..cefcb53e 100644 --- a/src/test/resources/rml-cc/RMLTC-CC-0003-NEB/mapping.ttl +++ b/src/test/resources/rml-cc/RMLTC-CC-0003-NEB/mapping.ttl @@ -1,9 +1,8 @@ @prefix rml: . @prefix rdf: . @prefix ex: . -@base . -<#TM> a rml:TriplesMap; + a rml:TriplesMap; rml:logicalSource [ rml:source _:b738439 ; rml:referenceFormulation rml:JSONPath ; @@ -24,4 +23,5 @@ . _:b738439 a rml:RelativePathSource ; + rml:root rml:MappingDirectory ; rml:path "data.json" . \ No newline at end of file diff --git a/src/test/resources/rml-cc/RMLTC-CC-0003-NEL/README.md b/src/test/resources/rml-cc/RMLTC-CC-0003-NEL/README.md new file mode 100644 index 00000000..89ff517f --- /dev/null +++ b/src/test/resources/rml-cc/RMLTC-CC-0003-NEL/README.md @@ -0,0 +1,53 @@ +## RMLTC-CC-0003-NEL + +**Title**: Empty lists are not generated + +**Description**: Tests if empty lists are not generated (expected default behavior). + +**Error expected?** No + +**Input** + [http://w3id.org/rml/resources/rml-io/RMLTC-CC-0003-NEL/Friends.json](http://w3id.org/rml/resources/rml-io/RMLTC-CC-0003-NEL/Friends.json) + +**Mapping** +``` +@prefix rml: . +@prefix rdf: . +@prefix ex: . + + a rml:TriplesMap; + rml:logicalSource [ + rml:source _:b738439 ; + rml:referenceFormulation rml:JSONPath ; + rml:iterator "$.*" ; + ] ; + + rml:subjectMap [ + rml:template "e/{$.id}" ; + ] ; + + rml:predicateObjectMap [ + rml:predicate ex:with ; + rml:objectMap [ + rml:gather ( [ rml:reference "$.values.*" ; ] ) ; + rml:gatherAs rdf:List ; + ] ; + ] ; +. + +_:b738439 a rml:RelativePathSource ; + rml:root rml:MappingDirectory ; + rml:path "data.json" . +``` + +**Output** +``` +_:n434c2c54e09e4a259604ba1188ce038fb1 _:n434c2c54e09e4a259604ba1188ce038fb2 . +_:n434c2c54e09e4a259604ba1188ce038fb3 . +_:n434c2c54e09e4a259604ba1188ce038fb2 "2" . + _:n434c2c54e09e4a259604ba1188ce038fb1 . +_:n434c2c54e09e4a259604ba1188ce038fb2 _:n434c2c54e09e4a259604ba1188ce038fb3 . +_:n434c2c54e09e4a259604ba1188ce038fb1 "1" . +_:n434c2c54e09e4a259604ba1188ce038fb3 "3" . +``` + diff --git a/src/test/resources/rml-cc/RMLTC-CC-0003-NEL/mapping.ttl b/src/test/resources/rml-cc/RMLTC-CC-0003-NEL/mapping.ttl index ca963e35..0e837b79 100644 --- a/src/test/resources/rml-cc/RMLTC-CC-0003-NEL/mapping.ttl +++ b/src/test/resources/rml-cc/RMLTC-CC-0003-NEL/mapping.ttl @@ -1,9 +1,8 @@ @prefix rml: . @prefix rdf: . @prefix ex: . -@base . -<#TM> a rml:TriplesMap; + a rml:TriplesMap; rml:logicalSource [ rml:source _:b738439 ; rml:referenceFormulation rml:JSONPath ; @@ -24,4 +23,5 @@ . _:b738439 a rml:RelativePathSource ; + rml:root rml:MappingDirectory ; rml:path "data.json" . \ No newline at end of file diff --git a/src/test/resources/rml-cc/RMLTC-CC-0003-NELb/README.md b/src/test/resources/rml-cc/RMLTC-CC-0003-NELb/README.md new file mode 100644 index 00000000..2b7434bf --- /dev/null +++ b/src/test/resources/rml-cc/RMLTC-CC-0003-NELb/README.md @@ -0,0 +1,54 @@ +## RMLTC-CC-0003-NELb + +**Title**: Empty lists are not generated II + +**Description**: Tests if empty lists are not generated (expected default behavior). This test cases uses the predicate rml:allowEmptyListAndContainer. + +**Error expected?** No + +**Input** + [http://w3id.org/rml/resources/rml-io/RMLTC-CC-0003-NELb/Friends.json](http://w3id.org/rml/resources/rml-io/RMLTC-CC-0003-NELb/Friends.json) + +**Mapping** +``` +@prefix rml: . +@prefix rdf: . +@prefix ex: . + + a rml:TriplesMap; + rml:logicalSource [ + rml:source _:b738439 ; + rml:referenceFormulation rml:JSONPath ; + rml:iterator "$.*" ; + ] ; + + rml:subjectMap [ + rml:template "e/{$.id}" ; + ] ; + + rml:predicateObjectMap [ + rml:predicate ex:with ; + rml:objectMap [ + rml:allowEmptyListAndContainer false ; + rml:gather ( [ rml:reference "$.values.*" ; ] ) ; + rml:gatherAs rdf:List ; + ] ; + ] ; +. + +_:b738439 a rml:RelativePathSource ; + rml:root rml:MappingDirectory ; + rml:path "data.json" . +``` + +**Output** +``` +_:n434c2c54e09e4a259604ba1188ce038fb1 _:n434c2c54e09e4a259604ba1188ce038fb2 . +_:n434c2c54e09e4a259604ba1188ce038fb3 . +_:n434c2c54e09e4a259604ba1188ce038fb2 "2" . + _:n434c2c54e09e4a259604ba1188ce038fb1 . +_:n434c2c54e09e4a259604ba1188ce038fb2 _:n434c2c54e09e4a259604ba1188ce038fb3 . +_:n434c2c54e09e4a259604ba1188ce038fb1 "1" . +_:n434c2c54e09e4a259604ba1188ce038fb3 "3" . +``` + diff --git a/src/test/resources/rml-cc/RMLTC-CC-0003-NELb/mapping.ttl b/src/test/resources/rml-cc/RMLTC-CC-0003-NELb/mapping.ttl index 6da934ad..bfeaa8ae 100644 --- a/src/test/resources/rml-cc/RMLTC-CC-0003-NELb/mapping.ttl +++ b/src/test/resources/rml-cc/RMLTC-CC-0003-NELb/mapping.ttl @@ -1,9 +1,8 @@ @prefix rml: . @prefix rdf: . @prefix ex: . -@base . -<#TM> a rml:TriplesMap; + a rml:TriplesMap; rml:logicalSource [ rml:source _:b738439 ; rml:referenceFormulation rml:JSONPath ; @@ -25,4 +24,5 @@ . _:b738439 a rml:RelativePathSource ; + rml:root rml:MappingDirectory ; rml:path "data.json" . \ No newline at end of file diff --git a/src/test/resources/rml-cc/RMLTC-CC-0004-SM1/README.md b/src/test/resources/rml-cc/RMLTC-CC-0004-SM1/README.md new file mode 100644 index 00000000..a3ec666d --- /dev/null +++ b/src/test/resources/rml-cc/RMLTC-CC-0004-SM1/README.md @@ -0,0 +1,59 @@ +## RMLTC-CC-0004-SM1 + +**Title**: GatherMap in subject map (list) + +**Description**: Tests if the use of a gather map in the subject map is supported. This test generates a list. + +**Error expected?** No + +**Input** + [http://w3id.org/rml/resources/rml-io/RMLTC-CC-0004-SM1/Friends.json](http://w3id.org/rml/resources/rml-io/RMLTC-CC-0004-SM1/Friends.json) + +**Mapping** +``` +@prefix rml: . +@prefix rdf: . +@prefix ex: . + + a rml:TriplesMap; + rml:logicalSource [ + rml:source _:b738439 ; + rml:referenceFormulation rml:JSONPath ; + rml:iterator "$.*" ; + ] ; + + rml:subjectMap [ + rml:gather ( [ rml:reference "$.values.*" ; ] ) ; + rml:gatherAs rdf:List ; + ] ; + + rml:predicateObjectMap [ + rml:predicate ex:createdBy ; + rml:object ex:JohnDoe ; + ] ; +. + +_:b738439 a rml:RelativePathSource ; + rml:root rml:MappingDirectory ; + rml:path "data.json" . +``` + +**Output** +``` +_:n302eecc856b44ed5b76965d9be2f5213b1 . +_:n302eecc856b44ed5b76965d9be2f5213b1 "1" . +_:n302eecc856b44ed5b76965d9be2f5213b1 _:n302eecc856b44ed5b76965d9be2f5213b2 . +_:n302eecc856b44ed5b76965d9be2f5213b2 "2" . +_:n302eecc856b44ed5b76965d9be2f5213b2 _:n302eecc856b44ed5b76965d9be2f5213b3 . +_:n302eecc856b44ed5b76965d9be2f5213b3 "3" . +_:n302eecc856b44ed5b76965d9be2f5213b3 . +_:n1d393f12e993411498da676131f81ca4b1 . +_:n1d393f12e993411498da676131f81ca4b1 "4" . +_:n1d393f12e993411498da676131f81ca4b1 _:n1d393f12e993411498da676131f81ca4b2 . +_:n1d393f12e993411498da676131f81ca4b2 "5" . +_:n1d393f12e993411498da676131f81ca4b2 _:n1d393f12e993411498da676131f81ca4b3 . +_:n1d393f12e993411498da676131f81ca4b3 "6" . +_:n1d393f12e993411498da676131f81ca4b3 . + +``` + diff --git a/src/test/resources/rml-cc/RMLTC-CC-0004-SM1/mapping.ttl b/src/test/resources/rml-cc/RMLTC-CC-0004-SM1/mapping.ttl index 19eee717..5e2d7321 100644 --- a/src/test/resources/rml-cc/RMLTC-CC-0004-SM1/mapping.ttl +++ b/src/test/resources/rml-cc/RMLTC-CC-0004-SM1/mapping.ttl @@ -1,9 +1,8 @@ @prefix rml: . @prefix rdf: . @prefix ex: . -@base . -<#TM> a rml:TriplesMap; + a rml:TriplesMap; rml:logicalSource [ rml:source _:b738439 ; rml:referenceFormulation rml:JSONPath ; @@ -22,4 +21,5 @@ . _:b738439 a rml:RelativePathSource ; + rml:root rml:MappingDirectory ; rml:path "data.json" . \ No newline at end of file diff --git a/src/test/resources/rml-cc/RMLTC-CC-0004-SM2/README.md b/src/test/resources/rml-cc/RMLTC-CC-0004-SM2/README.md new file mode 100644 index 00000000..eedb608d --- /dev/null +++ b/src/test/resources/rml-cc/RMLTC-CC-0004-SM2/README.md @@ -0,0 +1,52 @@ +## RMLTC-CC-0004-SM2 + +**Title**: GatherMap in subject map (list) + +**Description**: Tests if the use of a gather map in the subject map is supported. This test has no predicate-object maps and no class declarations in the subject map. It still needs to generate triples as the lists consists of at least one cons-pair. + +**Error expected?** No + +**Input** + [http://w3id.org/rml/resources/rml-io/RMLTC-CC-0004-SM2/Friends.json](http://w3id.org/rml/resources/rml-io/RMLTC-CC-0004-SM2/Friends.json) + +**Mapping** +``` +@prefix rml: . +@prefix rdf: . +@prefix ex: . + + a rml:TriplesMap; + rml:logicalSource [ + rml:source _:b738439 ; + rml:referenceFormulation rml:JSONPath ; + rml:iterator "$.*" ; + ] ; + + rml:subjectMap [ + rml:gather ( [ rml:reference "$.values.*" ; ] ) ; + rml:gatherAs rdf:List ; + ] ; +. + +_:b738439 a rml:RelativePathSource ; + rml:root rml:MappingDirectory ; + rml:path "data.json" . +``` + +**Output** +``` +_:n302eecc856b44ed5b76965d9be2f5213b1 "1" . +_:n302eecc856b44ed5b76965d9be2f5213b1 _:n302eecc856b44ed5b76965d9be2f5213b2 . +_:n302eecc856b44ed5b76965d9be2f5213b2 "2" . +_:n302eecc856b44ed5b76965d9be2f5213b2 _:n302eecc856b44ed5b76965d9be2f5213b3 . +_:n302eecc856b44ed5b76965d9be2f5213b3 "3" . +_:n302eecc856b44ed5b76965d9be2f5213b3 . +_:n1d393f12e993411498da676131f81ca4b1 "4" . +_:n1d393f12e993411498da676131f81ca4b1 _:n1d393f12e993411498da676131f81ca4b2 . +_:n1d393f12e993411498da676131f81ca4b2 "5" . +_:n1d393f12e993411498da676131f81ca4b2 _:n1d393f12e993411498da676131f81ca4b3 . +_:n1d393f12e993411498da676131f81ca4b3 "6" . +_:n1d393f12e993411498da676131f81ca4b3 . + +``` + diff --git a/src/test/resources/rml-cc/RMLTC-CC-0004-SM2/mapping.ttl b/src/test/resources/rml-cc/RMLTC-CC-0004-SM2/mapping.ttl index b0db209a..3001e5f8 100644 --- a/src/test/resources/rml-cc/RMLTC-CC-0004-SM2/mapping.ttl +++ b/src/test/resources/rml-cc/RMLTC-CC-0004-SM2/mapping.ttl @@ -1,9 +1,8 @@ @prefix rml: . @prefix rdf: . @prefix ex: . -@base . -<#TM> a rml:TriplesMap; + a rml:TriplesMap; rml:logicalSource [ rml:source _:b738439 ; rml:referenceFormulation rml:JSONPath ; @@ -17,4 +16,5 @@ . _:b738439 a rml:RelativePathSource ; + rml:root rml:MappingDirectory ; rml:path "data.json" . \ No newline at end of file diff --git a/src/test/resources/rml-cc/RMLTC-CC-0004-SM3/README.md b/src/test/resources/rml-cc/RMLTC-CC-0004-SM3/README.md new file mode 100644 index 00000000..e0e52441 --- /dev/null +++ b/src/test/resources/rml-cc/RMLTC-CC-0004-SM3/README.md @@ -0,0 +1,45 @@ +## RMLTC-CC-0004-SM3 + +**Title**: GatherMap in subject map (list) + +**Description**: Tests if the use of a gather map in the subject map is supported. This test has no predicate-object maps and no class declarations in the subject map. Only one list needs to be generated as the other has no values and we only retain non-empty lists. + +**Error expected?** No + +**Input** + [http://w3id.org/rml/resources/rml-io/RMLTC-CC-0004-SM3/Friends.json](http://w3id.org/rml/resources/rml-io/RMLTC-CC-0004-SM3/Friends.json) + +**Mapping** +``` +@prefix rml: . +@prefix rdf: . +@prefix ex: . + + a rml:TriplesMap; + rml:logicalSource [ + rml:source _:b738439 ; + rml:referenceFormulation rml:JSONPath ; + rml:iterator "$.*" ; + ] ; + + rml:subjectMap [ + rml:gather ( [ rml:reference "$.values.*" ; ] ) ; + rml:gatherAs rdf:List ; + ] ; +. + +_:b738439 a rml:RelativePathSource ; + rml:root rml:MappingDirectory ; + rml:path "data.json" . +``` + +**Output** +``` +_:n648f8cf4c58149e8a0feea26fb2a5b5bb1 "1" . +_:n648f8cf4c58149e8a0feea26fb2a5b5bb1 _:n648f8cf4c58149e8a0feea26fb2a5b5bb2 . +_:n648f8cf4c58149e8a0feea26fb2a5b5bb3 "3" . +_:n648f8cf4c58149e8a0feea26fb2a5b5bb2 _:n648f8cf4c58149e8a0feea26fb2a5b5bb3 . +_:n648f8cf4c58149e8a0feea26fb2a5b5bb2 "2" . +_:n648f8cf4c58149e8a0feea26fb2a5b5bb3 . +``` + diff --git a/src/test/resources/rml-cc/RMLTC-CC-0004-SM3/mapping.ttl b/src/test/resources/rml-cc/RMLTC-CC-0004-SM3/mapping.ttl index b0db209a..3001e5f8 100644 --- a/src/test/resources/rml-cc/RMLTC-CC-0004-SM3/mapping.ttl +++ b/src/test/resources/rml-cc/RMLTC-CC-0004-SM3/mapping.ttl @@ -1,9 +1,8 @@ @prefix rml: . @prefix rdf: . @prefix ex: . -@base . -<#TM> a rml:TriplesMap; + a rml:TriplesMap; rml:logicalSource [ rml:source _:b738439 ; rml:referenceFormulation rml:JSONPath ; @@ -17,4 +16,5 @@ . _:b738439 a rml:RelativePathSource ; + rml:root rml:MappingDirectory ; rml:path "data.json" . \ No newline at end of file diff --git a/src/test/resources/rml-cc/RMLTC-CC-0004-SM4/README.md b/src/test/resources/rml-cc/RMLTC-CC-0004-SM4/README.md new file mode 100644 index 00000000..84711d18 --- /dev/null +++ b/src/test/resources/rml-cc/RMLTC-CC-0004-SM4/README.md @@ -0,0 +1,54 @@ +## RMLTC-CC-0004-SM4 + +**Title**: GatherMap in subject map (bag) + +**Description**: Tests if the use of a gather map in the subject map is supported. This test generates a bag. + +**Error expected?** No + +**Input** + [http://w3id.org/rml/resources/rml-io/RMLTC-CC-0004-SM4/Friends.json](http://w3id.org/rml/resources/rml-io/RMLTC-CC-0004-SM4/Friends.json) + +**Mapping** +``` +@prefix rml: . +@prefix rdf: . +@prefix ex: . + + a rml:TriplesMap; + rml:logicalSource [ + rml:source _:b738439 ; + rml:referenceFormulation rml:JSONPath ; + rml:iterator "$.*" ; + ] ; + + rml:subjectMap [ + rml:gather ( [ rml:reference "$.values.*" ; ] ) ; + rml:gatherAs rdf:Bag ; + ] ; + + rml:predicateObjectMap [ + rml:predicate ex:createdBy ; + rml:object ex:JohnDoe ; + ] ; +. + +_:b738439 a rml:RelativePathSource ; + rml:root rml:MappingDirectory ; + rml:path "data.json" . +``` + +**Output** +``` +_:n1d393f12e993411498da676131f81ca4b1 "2" . +_:n1d393f12e993411498da676131f81ca4b2 "5" . +_:n1d393f12e993411498da676131f81ca4b1 "1" . +_:n1d393f12e993411498da676131f81ca4b2 . +_:n1d393f12e993411498da676131f81ca4b2 . +_:n1d393f12e993411498da676131f81ca4b1 "3" . +_:n1d393f12e993411498da676131f81ca4b2 "4" . +_:n1d393f12e993411498da676131f81ca4b1 . +_:n1d393f12e993411498da676131f81ca4b1 . +_:n1d393f12e993411498da676131f81ca4b2 "6" . +``` + diff --git a/src/test/resources/rml-cc/RMLTC-CC-0004-SM4/mapping.ttl b/src/test/resources/rml-cc/RMLTC-CC-0004-SM4/mapping.ttl index a6f85e5e..bb8af2b4 100644 --- a/src/test/resources/rml-cc/RMLTC-CC-0004-SM4/mapping.ttl +++ b/src/test/resources/rml-cc/RMLTC-CC-0004-SM4/mapping.ttl @@ -1,9 +1,8 @@ @prefix rml: . @prefix rdf: . @prefix ex: . -@base . -<#TM> a rml:TriplesMap; + a rml:TriplesMap; rml:logicalSource [ rml:source _:b738439 ; rml:referenceFormulation rml:JSONPath ; @@ -22,4 +21,5 @@ . _:b738439 a rml:RelativePathSource ; + rml:root rml:MappingDirectory ; rml:path "data.json" . \ No newline at end of file diff --git a/src/test/resources/rml-cc/RMLTC-CC-0004-SM5/README.md b/src/test/resources/rml-cc/RMLTC-CC-0004-SM5/README.md new file mode 100644 index 00000000..99fd6210 --- /dev/null +++ b/src/test/resources/rml-cc/RMLTC-CC-0004-SM5/README.md @@ -0,0 +1,43 @@ +## RMLTC-CC-0004-SM5 + +**Title**: GatherMap in subject map (bag) + +**Description**: Tests if the use of a gather map in the subject map is supported. This test has no predicate-object maps and no class declarations in the subject map. It should generate a non-empty bag and an empty bag. The reason being that a container has at least one triple ; it's type (bag, seq, or alt). + +**Error expected?** No + +**Input** + [http://w3id.org/rml/resources/rml-io/RMLTC-CC-0004-SM5/Friends.json](http://w3id.org/rml/resources/rml-io/RMLTC-CC-0004-SM5/Friends.json) + +**Mapping** +``` +@prefix rml: . +@prefix rdf: . +@prefix ex: . + + a rml:TriplesMap; + rml:logicalSource [ + rml:source _:b738439 ; + rml:referenceFormulation rml:JSONPath ; + rml:iterator "$.*" ; + ] ; + + rml:subjectMap [ + rml:gather ( [ rml:reference "$.values.*" ; ] ) ; + rml:gatherAs rdf:Bag ; + ] ; +. + +_:b738439 a rml:RelativePathSource ; + rml:root rml:MappingDirectory ; + rml:path "data.json" . +``` + +**Output** +``` +_:ne32066984b71404a953025d001cd3cdfb1 . +_:ne32066984b71404a953025d001cd3cdfb1 "2" . +_:ne32066984b71404a953025d001cd3cdfb1 "1" . +_:ne32066984b71404a953025d001cd3cdfb1 "3" . +``` + diff --git a/src/test/resources/rml-cc/RMLTC-CC-0004-SM5/mapping.ttl b/src/test/resources/rml-cc/RMLTC-CC-0004-SM5/mapping.ttl index b8cbc6a9..83c9751b 100644 --- a/src/test/resources/rml-cc/RMLTC-CC-0004-SM5/mapping.ttl +++ b/src/test/resources/rml-cc/RMLTC-CC-0004-SM5/mapping.ttl @@ -1,9 +1,8 @@ @prefix rml: . @prefix rdf: . @prefix ex: . -@base . -<#TM> a rml:TriplesMap; + a rml:TriplesMap; rml:logicalSource [ rml:source _:b738439 ; rml:referenceFormulation rml:JSONPath ; @@ -17,4 +16,5 @@ . _:b738439 a rml:RelativePathSource ; + rml:root rml:MappingDirectory ; rml:path "data.json" . \ No newline at end of file diff --git a/src/test/resources/rml-cc/RMLTC-CC-0005-App1/README.md b/src/test/resources/rml-cc/RMLTC-CC-0005-App1/README.md new file mode 100644 index 00000000..95c4b898 --- /dev/null +++ b/src/test/resources/rml-cc/RMLTC-CC-0005-App1/README.md @@ -0,0 +1,63 @@ +## RMLTC-CC-0005-App1 + +**Title**: Append values of multiple term maps + +**Description**: Tests appending of values from multiple term maps in an gather map. This test covers the case where all sets of values are non-empty. + +**Error expected?** No + +**Input** + [http://w3id.org/rml/resources/rml-io/RMLTC-CC-0005-App1/Friends.json](http://w3id.org/rml/resources/rml-io/RMLTC-CC-0005-App1/Friends.json) + +**Mapping** +``` +@prefix rml: . +@prefix rdf: . +@prefix ex: . + + a rml:TriplesMap; + rml:logicalSource [ + rml:source _:b738439 ; + rml:referenceFormulation rml:JSONPath ; + rml:iterator "$.*" ; + ] ; + + rml:subjectMap [ + rml:template "e/{$.id}" ; + ] ; + + rml:predicateObjectMap [ + rml:predicate ex:with ; + rml:objectMap [ + rml:gather ( [ rml:reference "$.v1.*" ; ] [ rml:reference "$.v2.*" ; ] ) ; + rml:gatherAs rdf:List ; + ] ; + ] ; +. + +_:b738439 a rml:RelativePathSource ; + rml:root rml:MappingDirectory ; + rml:path "data.json" . +``` + +**Output** +``` + _:n1ee4a5a2b1344422919d171ab2cd6c39b1 . +_:n1ee4a5a2b1344422919d171ab2cd6c39b1 "1" . +_:n1ee4a5a2b1344422919d171ab2cd6c39b1 _:n1ee4a5a2b1344422919d171ab2cd6c39b2 . +_:n1ee4a5a2b1344422919d171ab2cd6c39b2 "2" . +_:n1ee4a5a2b1344422919d171ab2cd6c39b2 _:n1ee4a5a2b1344422919d171ab2cd6c39b4 . +_:n1ee4a5a2b1344422919d171ab2cd6c39b4 "a" . +_:n1ee4a5a2b1344422919d171ab2cd6c39b4 _:n1ee4a5a2b1344422919d171ab2cd6c39b5 . +_:n1ee4a5a2b1344422919d171ab2cd6c39b5 "b" . +_:n1ee4a5a2b1344422919d171ab2cd6c39b5 . + _:n1ee4a5a2b1344422919d171ab2cd6c39b6 . +_:n1ee4a5a2b1344422919d171ab2cd6c39b6 "3" . +_:n1ee4a5a2b1344422919d171ab2cd6c39b6 _:n1ee4a5a2b1344422919d171ab2cd6c39b7 . +_:n1ee4a5a2b1344422919d171ab2cd6c39b7 "4" . +_:n1ee4a5a2b1344422919d171ab2cd6c39b7 _:n1ee4a5a2b1344422919d171ab2cd6c39b8 . +_:n1ee4a5a2b1344422919d171ab2cd6c39b8 "c" . +_:n1ee4a5a2b1344422919d171ab2cd6c39b8 . + +``` + diff --git a/src/test/resources/rml-cc/RMLTC-CC-0005-App1/mapping.ttl b/src/test/resources/rml-cc/RMLTC-CC-0005-App1/mapping.ttl index b8b8b2f4..e2789c99 100644 --- a/src/test/resources/rml-cc/RMLTC-CC-0005-App1/mapping.ttl +++ b/src/test/resources/rml-cc/RMLTC-CC-0005-App1/mapping.ttl @@ -1,9 +1,8 @@ @prefix rml: . @prefix rdf: . @prefix ex: . -@base . -<#TM> a rml:TriplesMap; + a rml:TriplesMap; rml:logicalSource [ rml:source _:b738439 ; rml:referenceFormulation rml:JSONPath ; @@ -24,4 +23,5 @@ . _:b738439 a rml:RelativePathSource ; + rml:root rml:MappingDirectory ; rml:path "data.json" . \ No newline at end of file diff --git a/src/test/resources/rml-cc/RMLTC-CC-0005-App2/README.md b/src/test/resources/rml-cc/RMLTC-CC-0005-App2/README.md new file mode 100644 index 00000000..2800e435 --- /dev/null +++ b/src/test/resources/rml-cc/RMLTC-CC-0005-App2/README.md @@ -0,0 +1,64 @@ +## RMLTC-CC-0005-App2 + +**Title**: Append values of multiple term maps + +**Description**: Tests appending of values from multiple term maps in an iteration. In this example, one of the arrays is empty and the expected behavior is to concatinate a list with the empty list. + +**Error expected?** No + +**Input** + [http://w3id.org/rml/resources/rml-io/RMLTC-CC-0005-App2/Friends.json](http://w3id.org/rml/resources/rml-io/RMLTC-CC-0005-App2/Friends.json) + +**Mapping** +``` +@prefix rml: . +@prefix rdf: . +@prefix ex: . + + a rml:TriplesMap; + rml:logicalSource [ + rml:source _:b738439 ; + rml:referenceFormulation rml:JSONPath ; + rml:iterator "$.*" ; + ] ; + + rml:subjectMap [ + rml:template "e/{$.id}" ; + ] ; + + rml:predicateObjectMap [ + rml:predicate ex:with ; + rml:objectMap [ + rml:gather ( [ rml:reference "$.v1.*" ; ] [ rml:reference "$.v2.*" ; ] ) ; + rml:gatherAs rdf:List ; + ] ; + ] ; +. + +_:b738439 a rml:RelativePathSource ; + rml:root rml:MappingDirectory ; + rml:path "data.json" . +``` + +**Output** +``` +_:n1d9b8ef217cb44f299a062d746116deab1 _:n1d9b8ef217cb44f299a062d746116deab2 . +_:n1d9b8ef217cb44f299a062d746116deab5 "b" . +_:n1d9b8ef217cb44f299a062d746116deab4 _:n1d9b8ef217cb44f299a062d746116deab5 . +_:n1d9b8ef217cb44f299a062d746116deab3 _:n1d9b8ef217cb44f299a062d746116deab4 . +_:n1d9b8ef217cb44f299a062d746116deab7 "5" . +_:n1d9b8ef217cb44f299a062d746116deab2 "2" . +_:n1d9b8ef217cb44f299a062d746116deab8 "6" . +_:n1d9b8ef217cb44f299a062d746116deab8 . +_:n1d9b8ef217cb44f299a062d746116deab3 "3" . +_:n1d9b8ef217cb44f299a062d746116deab4 "a" . +_:n1d9b8ef217cb44f299a062d746116deab5 . +_:n1d9b8ef217cb44f299a062d746116deab2 _:n1d9b8ef217cb44f299a062d746116deab3 . +_:n1d9b8ef217cb44f299a062d746116deab1 "1" . + _:n1d9b8ef217cb44f299a062d746116deab1 . + _:n1d9b8ef217cb44f299a062d746116deab6 . +_:n1d9b8ef217cb44f299a062d746116deab7 _:n1d9b8ef217cb44f299a062d746116deab8 . +_:n1d9b8ef217cb44f299a062d746116deab6 _:n1d9b8ef217cb44f299a062d746116deab7 . +_:n1d9b8ef217cb44f299a062d746116deab6 "4" . +``` + diff --git a/src/test/resources/rml-cc/RMLTC-CC-0005-App2/mapping.ttl b/src/test/resources/rml-cc/RMLTC-CC-0005-App2/mapping.ttl index b8b8b2f4..e2789c99 100644 --- a/src/test/resources/rml-cc/RMLTC-CC-0005-App2/mapping.ttl +++ b/src/test/resources/rml-cc/RMLTC-CC-0005-App2/mapping.ttl @@ -1,9 +1,8 @@ @prefix rml: . @prefix rdf: . @prefix ex: . -@base . -<#TM> a rml:TriplesMap; + a rml:TriplesMap; rml:logicalSource [ rml:source _:b738439 ; rml:referenceFormulation rml:JSONPath ; @@ -24,4 +23,5 @@ . _:b738439 a rml:RelativePathSource ; + rml:root rml:MappingDirectory ; rml:path "data.json" . \ No newline at end of file diff --git a/src/test/resources/rml-cc/RMLTC-CC-0005-Car1/README.md b/src/test/resources/rml-cc/RMLTC-CC-0005-Car1/README.md new file mode 100644 index 00000000..b902b515 --- /dev/null +++ b/src/test/resources/rml-cc/RMLTC-CC-0005-Car1/README.md @@ -0,0 +1,82 @@ +## RMLTC-CC-0005-Car1 + +**Title**: Cartesian product of values from multiple term maps of a gather map. + +**Description**: Tests generating the Cartesian product of values from multiple term maps in a gather map. This test covers the case where all sets of values are non-empty. + +**Error expected?** No + +**Input** + [http://w3id.org/rml/resources/rml-io/RMLTC-CC-0005-Car1/Friends.json](http://w3id.org/rml/resources/rml-io/RMLTC-CC-0005-Car1/Friends.json) + +**Mapping** +``` +@prefix rml: . +@prefix rdf: . +@prefix ex: . + + a rml:TriplesMap; + rml:logicalSource [ + rml:source _:b738439 ; + rml:referenceFormulation rml:JSONPath ; + rml:iterator "$.*" ; + ] ; + + rml:subjectMap [ + rml:template "e/{$.id}" ; + ] ; + + rml:predicateObjectMap [ + rml:predicate ex:with ; + rml:objectMap [ + rml:gather ( [ rml:reference "$.v1.*" ; ] [ rml:reference "$.v2.*" ; ] ) ; + rml:gatherAs rdf:List ; + rml:strategy rml:cartesianProduct ; + ] ; + ] ; +. + +_:b738439 a rml:RelativePathSource ; + rml:root rml:MappingDirectory ; + rml:path "data.json" . +``` + +**Output** +``` + _:nfc398e5692654ca98dfb3fb5432d277cb1 . +_:nfc398e5692654ca98dfb3fb5432d277cb1 "1" . +_:nfc398e5692654ca98dfb3fb5432d277cb1 _:nfc398e5692654ca98dfb3fb5432d277cb2 . +_:nfc398e5692654ca98dfb3fb5432d277cb2 . +_:nfc398e5692654ca98dfb3fb5432d277cb2 "a" . + + _:nfc398e5692654ca98dfb3fb5432d277cb3 . +_:nfc398e5692654ca98dfb3fb5432d277cb3 "1" . +_:nfc398e5692654ca98dfb3fb5432d277cb3 _:nfc398e5692654ca98dfb3fb5432d277cb4 . +_:nfc398e5692654ca98dfb3fb5432d277cb4 "b" . +_:nfc398e5692654ca98dfb3fb5432d277cb4 . + + _:nfc398e5692654ca98dfb3fb5432d277cb5 . +_:nfc398e5692654ca98dfb3fb5432d277cb5 "2" . +_:nfc398e5692654ca98dfb3fb5432d277cb5 _:nfc398e5692654ca98dfb3fb5432d277cb6 . +_:nfc398e5692654ca98dfb3fb5432d277cb6 "a" . +_:nfc398e5692654ca98dfb3fb5432d277cb6 . + + _:nfc398e5692654ca98dfb3fb5432d277cb7 . +_:nfc398e5692654ca98dfb3fb5432d277cb7 "2" . +_:nfc398e5692654ca98dfb3fb5432d277cb7 _:nfc398e5692654ca98dfb3fb5432d277cb8 . +_:nfc398e5692654ca98dfb3fb5432d277cb8 "b" . +_:nfc398e5692654ca98dfb3fb5432d277cb8 . + + _:nfc398e5692654ca98dfb3fb5432d277cb9 . +_:nfc398e5692654ca98dfb3fb5432d277cb9 "3" . +_:nfc398e5692654ca98dfb3fb5432d277cb9 _:nfc398e5692654ca98dfb3fb5432d277cb10 . +_:nfc398e5692654ca98dfb3fb5432d277cb10 "c" . +_:nfc398e5692654ca98dfb3fb5432d277cb10 . + + _:nfc398e5692654ca98dfb3fb5432d277cb11 . +_:nfc398e5692654ca98dfb3fb5432d277cb11 "4" . +_:nfc398e5692654ca98dfb3fb5432d277cb11 _:nfc398e5692654ca98dfb3fb5432d277cb12 . +_:nfc398e5692654ca98dfb3fb5432d277cb12 "c" . +_:nfc398e5692654ca98dfb3fb5432d277cb12 . +``` + diff --git a/src/test/resources/rml-cc/RMLTC-CC-0005-Car1/mapping.ttl b/src/test/resources/rml-cc/RMLTC-CC-0005-Car1/mapping.ttl index 6a91a0db..6d6f2bd9 100644 --- a/src/test/resources/rml-cc/RMLTC-CC-0005-Car1/mapping.ttl +++ b/src/test/resources/rml-cc/RMLTC-CC-0005-Car1/mapping.ttl @@ -1,9 +1,8 @@ @prefix rml: . @prefix rdf: . @prefix ex: . -@base . -<#TM> a rml:TriplesMap; + a rml:TriplesMap; rml:logicalSource [ rml:source _:b738439 ; rml:referenceFormulation rml:JSONPath ; @@ -25,4 +24,5 @@ . _:b738439 a rml:RelativePathSource ; + rml:root rml:MappingDirectory ; rml:path "data.json" . \ No newline at end of file diff --git a/src/test/resources/rml-cc/RMLTC-CC-0005-Car2/README.md b/src/test/resources/rml-cc/RMLTC-CC-0005-Car2/README.md new file mode 100644 index 00000000..b9b80a2f --- /dev/null +++ b/src/test/resources/rml-cc/RMLTC-CC-0005-Car2/README.md @@ -0,0 +1,70 @@ +## RMLTC-CC-0005-Car2 + +**Title**: Cartesian product of values from multiple term maps of a gather map. + +**Description**: Tests generating the Cartesian product of values from multiple term maps in a gather map. This test covers the case where one of the sets is empty. The Cartesian product of a set with an empty set is empty. This entry should thus not yield a list. + +**Error expected?** No + +**Input** + [http://w3id.org/rml/resources/rml-io/RMLTC-CC-0005-Car2/Friends.json](http://w3id.org/rml/resources/rml-io/RMLTC-CC-0005-Car2/Friends.json) + +**Mapping** +``` +@prefix rml: . +@prefix rdf: . +@prefix ex: . + + a rml:TriplesMap; + rml:logicalSource [ + rml:source _:b738439 ; + rml:referenceFormulation rml:JSONPath ; + rml:iterator "$.*" ; + ] ; + + rml:subjectMap [ + rml:template "e/{$.id}" ; + ] ; + + rml:predicateObjectMap [ + rml:predicate ex:with ; + rml:objectMap [ + rml:gather ( [ rml:reference "$.v1.*" ; ] [ rml:reference "$.v2.*" ; ] ) ; + rml:gatherAs rdf:List ; + rml:strategy rml:cartesianProduct ; + ] ; + ] ; +. + +_:b738439 a rml:RelativePathSource ; + rml:root rml:MappingDirectory ; + rml:path "data.json" . +``` + +**Output** +``` + _:nfc398e5692654ca98dfb3fb5432d277cb1 . +_:nfc398e5692654ca98dfb3fb5432d277cb1 "1" . +_:nfc398e5692654ca98dfb3fb5432d277cb1 _:nfc398e5692654ca98dfb3fb5432d277cb2 . +_:nfc398e5692654ca98dfb3fb5432d277cb2 . +_:nfc398e5692654ca98dfb3fb5432d277cb2 "a" . + + _:nfc398e5692654ca98dfb3fb5432d277cb3 . +_:nfc398e5692654ca98dfb3fb5432d277cb3 "1" . +_:nfc398e5692654ca98dfb3fb5432d277cb3 _:nfc398e5692654ca98dfb3fb5432d277cb4 . +_:nfc398e5692654ca98dfb3fb5432d277cb4 "b" . +_:nfc398e5692654ca98dfb3fb5432d277cb4 . + + _:nfc398e5692654ca98dfb3fb5432d277cb5 . +_:nfc398e5692654ca98dfb3fb5432d277cb5 "2" . +_:nfc398e5692654ca98dfb3fb5432d277cb5 _:nfc398e5692654ca98dfb3fb5432d277cb6 . +_:nfc398e5692654ca98dfb3fb5432d277cb6 "a" . +_:nfc398e5692654ca98dfb3fb5432d277cb6 . + + _:nfc398e5692654ca98dfb3fb5432d277cb7 . +_:nfc398e5692654ca98dfb3fb5432d277cb7 "2" . +_:nfc398e5692654ca98dfb3fb5432d277cb7 _:nfc398e5692654ca98dfb3fb5432d277cb8 . +_:nfc398e5692654ca98dfb3fb5432d277cb8 "b" . +_:nfc398e5692654ca98dfb3fb5432d277cb8 . +``` + diff --git a/src/test/resources/rml-cc/RMLTC-CC-0005-Car2/mapping.ttl b/src/test/resources/rml-cc/RMLTC-CC-0005-Car2/mapping.ttl index 6a91a0db..6d6f2bd9 100644 --- a/src/test/resources/rml-cc/RMLTC-CC-0005-Car2/mapping.ttl +++ b/src/test/resources/rml-cc/RMLTC-CC-0005-Car2/mapping.ttl @@ -1,9 +1,8 @@ @prefix rml: . @prefix rdf: . @prefix ex: . -@base . -<#TM> a rml:TriplesMap; + a rml:TriplesMap; rml:logicalSource [ rml:source _:b738439 ; rml:referenceFormulation rml:JSONPath ; @@ -25,4 +24,5 @@ . _:b738439 a rml:RelativePathSource ; + rml:root rml:MappingDirectory ; rml:path "data.json" . \ No newline at end of file diff --git a/src/test/resources/rml-cc/RMLTC-CC-0006-IT0/README.md b/src/test/resources/rml-cc/RMLTC-CC-0006-IT0/README.md new file mode 100644 index 00000000..4fc561d6 --- /dev/null +++ b/src/test/resources/rml-cc/RMLTC-CC-0006-IT0/README.md @@ -0,0 +1,63 @@ +## RMLTC-CC-0006-IT0 + +**Title**: Gather values across iterations to create a collection. + +**Description**: When no template, constant, or reference is given to a gather map, then each iteration yields a different collection. + +**Error expected?** No + +**Input** + [http://w3id.org/rml/resources/rml-io/RMLTC-CC-0006-IT0/Friends.json](http://w3id.org/rml/resources/rml-io/RMLTC-CC-0006-IT0/Friends.json) + +**Mapping** +``` +@prefix rml: . +@prefix rdf: . +@prefix ex: . + + a rml:TriplesMap; + rml:logicalSource [ + rml:source _:b738439 ; + rml:referenceFormulation rml:JSONPath ; + rml:iterator "$.*" ; + ] ; + + rml:subjectMap [ + rml:template "e/{$.id}" ; + ] ; + + rml:predicateObjectMap [ + rml:predicate ex:with ; + rml:objectMap [ + rml:gather ( [ rml:reference "$.v1.*" ; ] ) ; + rml:gatherAs rdf:List ; + ] ; + ] ; +. + +_:b738439 a rml:RelativePathSource ; + rml:root rml:MappingDirectory ; + rml:path "data.json" . +``` + +**Output** +``` + _:n9d785cd672d3484cb5d9fd831e6dfc07b1 . +_:n9d785cd672d3484cb5d9fd831e6dfc07b1 "1" . +_:n9d785cd672d3484cb5d9fd831e6dfc07b1 _:n9d785cd672d3484cb5d9fd831e6dfc07b2 . +_:n9d785cd672d3484cb5d9fd831e6dfc07b2 "2" . +_:n9d785cd672d3484cb5d9fd831e6dfc07b2 . + + _:n9d785cd672d3484cb5d9fd831e6dfc07b5 . +_:n9d785cd672d3484cb5d9fd831e6dfc07b5 "3" . +_:n9d785cd672d3484cb5d9fd831e6dfc07b5 _:n9d785cd672d3484cb5d9fd831e6dfc07b6 . +_:n9d785cd672d3484cb5d9fd831e6dfc07b6 "4" . +_:n9d785cd672d3484cb5d9fd831e6dfc07b6 . + + _:n9d785cd672d3484cb5d9fd831e6dfc07b3 . +_:n9d785cd672d3484cb5d9fd831e6dfc07b3 "5" . +_:n9d785cd672d3484cb5d9fd831e6dfc07b3 _:n9d785cd672d3484cb5d9fd831e6dfc07b4 . +_:n9d785cd672d3484cb5d9fd831e6dfc07b4 "6" . +_:n9d785cd672d3484cb5d9fd831e6dfc07b4 . +``` + diff --git a/src/test/resources/rml-cc/RMLTC-CC-0006-IT0/mapping.ttl b/src/test/resources/rml-cc/RMLTC-CC-0006-IT0/mapping.ttl index 0a156f5c..91bccaa0 100644 --- a/src/test/resources/rml-cc/RMLTC-CC-0006-IT0/mapping.ttl +++ b/src/test/resources/rml-cc/RMLTC-CC-0006-IT0/mapping.ttl @@ -1,9 +1,8 @@ @prefix rml: . @prefix rdf: . @prefix ex: . -@base . -<#TM> a rml:TriplesMap; + a rml:TriplesMap; rml:logicalSource [ rml:source _:b738439 ; rml:referenceFormulation rml:JSONPath ; @@ -24,4 +23,5 @@ . _:b738439 a rml:RelativePathSource ; + rml:root rml:MappingDirectory ; rml:path "data.json" . \ No newline at end of file diff --git a/src/test/resources/rml-cc/RMLTC-CC-0006-IT1/README.md b/src/test/resources/rml-cc/RMLTC-CC-0006-IT1/README.md new file mode 100644 index 00000000..e5248c6d --- /dev/null +++ b/src/test/resources/rml-cc/RMLTC-CC-0006-IT1/README.md @@ -0,0 +1,63 @@ +## RMLTC-CC-0006-IT1 + +**Title**: Gather values across iterations to create a collection. + +**Description**: When using a template, constant, or reference for a gather map, this tests determines whether the values are correctly appended to the list. The natural order of the term maps inside the gather map as well as the iteration are respected. This test covers one term map in the gather map. + +**Error expected?** No + +**Input** + [http://w3id.org/rml/resources/rml-io/RMLTC-CC-0006-IT1/Friends.json](http://w3id.org/rml/resources/rml-io/RMLTC-CC-0006-IT1/Friends.json) + +**Mapping** +``` +@prefix rml: . +@prefix rdf: . +@prefix ex: . + + a rml:TriplesMap; + rml:logicalSource [ + rml:source _:b738439 ; + rml:referenceFormulation rml:JSONPath ; + rml:iterator "$.*" ; + ] ; + + rml:subjectMap [ + rml:template "e/{$.id}" ; + ] ; + + rml:predicateObjectMap [ + rml:predicate ex:with ; + rml:objectMap [ + rml:template "c/{$.id}" ; + rml:gather ( [ rml:reference "$.v1.*" ; ] ) ; + rml:gatherAs rdf:List ; + ] ; + ] ; +. + +_:b738439 a rml:RelativePathSource ; + rml:root rml:MappingDirectory ; + rml:path "data.json" . +``` + +**Output** +``` + . + "1" . + _:nab8f496caee443c5ac19ce3a109f4b22b1 . +_:nab8f496caee443c5ac19ce3a109f4b22b1 "2" . +_:nab8f496caee443c5ac19ce3a109f4b22b1 _:nab8f496caee443c5ac19ce3a109f4b22b2 . +_:nab8f496caee443c5ac19ce3a109f4b22b2 "5" . +_:nab8f496caee443c5ac19ce3a109f4b22b2 _:nab8f496caee443c5ac19ce3a109f4b22b3 . +_:nab8f496caee443c5ac19ce3a109f4b22b3 "6" . +_:nab8f496caee443c5ac19ce3a109f4b22b3 . + + . + "3" . + _:nab8f496caee443c5ac19ce3a109f4b22b4 . +_:nab8f496caee443c5ac19ce3a109f4b22b4 "4" . +_:nab8f496caee443c5ac19ce3a109f4b22b4 . + +``` + diff --git a/src/test/resources/rml-cc/RMLTC-CC-0006-IT1/mapping.ttl b/src/test/resources/rml-cc/RMLTC-CC-0006-IT1/mapping.ttl index 847277ca..6bb8841b 100644 --- a/src/test/resources/rml-cc/RMLTC-CC-0006-IT1/mapping.ttl +++ b/src/test/resources/rml-cc/RMLTC-CC-0006-IT1/mapping.ttl @@ -1,9 +1,8 @@ @prefix rml: . @prefix rdf: . @prefix ex: . -@base . -<#TM> a rml:TriplesMap; + a rml:TriplesMap; rml:logicalSource [ rml:source _:b738439 ; rml:referenceFormulation rml:JSONPath ; @@ -25,4 +24,5 @@ . _:b738439 a rml:RelativePathSource ; + rml:root rml:MappingDirectory ; rml:path "data.json" . \ No newline at end of file diff --git a/src/test/resources/rml-cc/RMLTC-CC-0006-IT2/README.md b/src/test/resources/rml-cc/RMLTC-CC-0006-IT2/README.md new file mode 100644 index 00000000..a35f394c --- /dev/null +++ b/src/test/resources/rml-cc/RMLTC-CC-0006-IT2/README.md @@ -0,0 +1,73 @@ +## RMLTC-CC-0006-IT2 + +**Title**: Gather values across iterations to create a collection. + +**Description**: When using a template, constant, or reference for a gather map, this tests determines whether the values are correctly appended to the list. The natural order of the term maps inside the gather map as well as the iteration are respected. This test covers two term maps in the gather map. + +**Error expected?** No + +**Input** + [http://w3id.org/rml/resources/rml-io/RMLTC-CC-0006-IT2/Friends.json](http://w3id.org/rml/resources/rml-io/RMLTC-CC-0006-IT2/Friends.json) + +**Mapping** +``` +@prefix rml: . +@prefix rdf: . +@prefix ex: . + + a rml:TriplesMap; + rml:logicalSource [ + rml:source _:b738439 ; + rml:referenceFormulation rml:JSONPath ; + rml:iterator "$.*" ; + ] ; + + rml:subjectMap [ + rml:template "e/{$.id}" ; + ] ; + + rml:predicateObjectMap [ + rml:predicate ex:with ; + rml:objectMap [ + rml:template "c/{$.id}" ; + rml:gather ( [ rml:reference "$.v1.*" ; ] [ rml:reference "$.v2.*" ; ] ) ; + rml:gatherAs rdf:List ; + ] ; + ] ; +. + +_:b738439 a rml:RelativePathSource ; + rml:root rml:MappingDirectory ; + rml:path "data.json" . +``` + +**Output** +``` + . + "1" . + _:n0cbb21ce98464358963007f95dc35c0ab1 . +_:n0cbb21ce98464358963007f95dc35c0ab1 "2" . +_:n0cbb21ce98464358963007f95dc35c0ab1 _:n0cbb21ce98464358963007f95dc35c0ab2 . +_:n0cbb21ce98464358963007f95dc35c0ab2 "a" . +_:n0cbb21ce98464358963007f95dc35c0ab2 _:n0cbb21ce98464358963007f95dc35c0ab3 . +_:n0cbb21ce98464358963007f95dc35c0ab3 "b" . +_:n0cbb21ce98464358963007f95dc35c0ab3 _:n0cbb21ce98464358963007f95dc35c0ab4 . +_:n0cbb21ce98464358963007f95dc35c0ab4 "5" . +_:n0cbb21ce98464358963007f95dc35c0ab4 _:n0cbb21ce98464358963007f95dc35c0ab5 . +_:n0cbb21ce98464358963007f95dc35c0ab5 "6" . +_:n0cbb21ce98464358963007f95dc35c0ab5 _:n0cbb21ce98464358963007f95dc35c0ab6 . +_:n0cbb21ce98464358963007f95dc35c0ab6 "d" . +_:n0cbb21ce98464358963007f95dc35c0ab6 _:n0cbb21ce98464358963007f95dc35c0ab7 . +_:n0cbb21ce98464358963007f95dc35c0ab7 "e" . +_:n0cbb21ce98464358963007f95dc35c0ab7 . + + . + "3" . + _:n0cbb21ce98464358963007f95dc35c0ab8 . +_:n0cbb21ce98464358963007f95dc35c0ab8 "4" . +_:n0cbb21ce98464358963007f95dc35c0ab8 _:n0cbb21ce98464358963007f95dc35c0ab9 . +_:n0cbb21ce98464358963007f95dc35c0ab9 "c" . +_:n0cbb21ce98464358963007f95dc35c0ab9 . + +``` + diff --git a/src/test/resources/rml-cc/RMLTC-CC-0006-IT2/mapping.ttl b/src/test/resources/rml-cc/RMLTC-CC-0006-IT2/mapping.ttl index 14e90fed..23251ff9 100644 --- a/src/test/resources/rml-cc/RMLTC-CC-0006-IT2/mapping.ttl +++ b/src/test/resources/rml-cc/RMLTC-CC-0006-IT2/mapping.ttl @@ -1,9 +1,8 @@ @prefix rml: . @prefix rdf: . @prefix ex: . -@base . -<#TM> a rml:TriplesMap; + a rml:TriplesMap; rml:logicalSource [ rml:source _:b738439 ; rml:referenceFormulation rml:JSONPath ; @@ -25,4 +24,5 @@ . _:b738439 a rml:RelativePathSource ; + rml:root rml:MappingDirectory ; rml:path "data.json" . \ No newline at end of file diff --git a/src/test/resources/rml-cc/RMLTC-CC-0006-IT3/README.md b/src/test/resources/rml-cc/RMLTC-CC-0006-IT3/README.md new file mode 100644 index 00000000..ed86d92b --- /dev/null +++ b/src/test/resources/rml-cc/RMLTC-CC-0006-IT3/README.md @@ -0,0 +1,60 @@ +## RMLTC-CC-0006-IT3 + +**Title**: Gather values across iterations to create a container. + +**Description**: When no template, constant, or reference is given to a gather map, then each iteration yields a different container. + +**Error expected?** No + +**Input** + [http://w3id.org/rml/resources/rml-io/RMLTC-CC-0006-IT3/Friends.json](http://w3id.org/rml/resources/rml-io/RMLTC-CC-0006-IT3/Friends.json) + +**Mapping** +``` +@prefix rml: . +@prefix rdf: . +@prefix ex: . + + a rml:TriplesMap; + rml:logicalSource [ + rml:source _:b738439 ; + rml:referenceFormulation rml:JSONPath ; + rml:iterator "$.*" ; + ] ; + + rml:subjectMap [ + rml:template "e/{$.id}" ; + ] ; + + rml:predicateObjectMap [ + rml:predicate ex:with ; + rml:objectMap [ + rml:gather ( [ rml:reference "$.v1.*" ; ] ) ; + rml:gatherAs rdf:Bag ; + ] ; + ] ; +. + +_:b738439 a rml:RelativePathSource ; + rml:root rml:MappingDirectory ; + rml:path "data.json" . +``` + +**Output** +``` + _:a . +_:a . +_:a "1" . +_:a "2" . + + _:b . +_:b . +_:b "3" . +_:b "4" . + + _:c . +_:c . +_:c "5" . +_:c "6" . +``` + diff --git a/src/test/resources/rml-cc/RMLTC-CC-0006-IT3/data.json b/src/test/resources/rml-cc/RMLTC-CC-0006-IT3/data.json new file mode 100644 index 00000000..a17afe2c --- /dev/null +++ b/src/test/resources/rml-cc/RMLTC-CC-0006-IT3/data.json @@ -0,0 +1,23 @@ +[ + { + "id": "a", + "v1": [ + "1", + "2" + ] + }, + { + "id": "b", + "v1": [ + "3", + "4" + ] + }, + { + "id": "a", + "v1": [ + "5", + "6" + ] + } +] \ No newline at end of file diff --git a/src/test/resources/rml-cc/RMLTC-CC-0006-IT3/default.nq b/src/test/resources/rml-cc/RMLTC-CC-0006-IT3/default.nq new file mode 100644 index 00000000..4141428b --- /dev/null +++ b/src/test/resources/rml-cc/RMLTC-CC-0006-IT3/default.nq @@ -0,0 +1,14 @@ + _:a . +_:a . +_:a "1" . +_:a "2" . + + _:b . +_:b . +_:b "3" . +_:b "4" . + + _:c . +_:c . +_:c "5" . +_:c "6" . \ No newline at end of file diff --git a/src/test/resources/rml-cc/RMLTC-CC-0006-IT3/mapping.ttl b/src/test/resources/rml-cc/RMLTC-CC-0006-IT3/mapping.ttl new file mode 100644 index 00000000..d88fe4df --- /dev/null +++ b/src/test/resources/rml-cc/RMLTC-CC-0006-IT3/mapping.ttl @@ -0,0 +1,27 @@ +@prefix rml: . +@prefix rdf: . +@prefix ex: . + + a rml:TriplesMap; + rml:logicalSource [ + rml:source _:b738439 ; + rml:referenceFormulation rml:JSONPath ; + rml:iterator "$.*" ; + ] ; + + rml:subjectMap [ + rml:template "e/{$.id}" ; + ] ; + + rml:predicateObjectMap [ + rml:predicate ex:with ; + rml:objectMap [ + rml:gather ( [ rml:reference "$.v1.*" ; ] ) ; + rml:gatherAs rdf:Bag ; + ] ; + ] ; +. + +_:b738439 a rml:RelativePathSource ; + rml:root rml:MappingDirectory ; + rml:path "data.json" . \ No newline at end of file diff --git a/src/test/resources/rml-cc/RMLTC-CC-0006-IT4/README.md b/src/test/resources/rml-cc/RMLTC-CC-0006-IT4/README.md new file mode 100644 index 00000000..f5a8d823 --- /dev/null +++ b/src/test/resources/rml-cc/RMLTC-CC-0006-IT4/README.md @@ -0,0 +1,58 @@ +## RMLTC-CC-0006-IT4 + +**Title**: Gather values across iterations to create a container. + +**Description**: When using a template, constant, or reference for a gather map, this tests determines whether the values are correctly appended to the container. The natural order of the term maps inside the gather map as well as the iteration are respected. This test covers one term map in the gather map. + +**Error expected?** No + +**Input** + [http://w3id.org/rml/resources/rml-io/RMLTC-CC-0006-IT4/Friends.json](http://w3id.org/rml/resources/rml-io/RMLTC-CC-0006-IT4/Friends.json) + +**Mapping** +``` +@prefix rml: . +@prefix rdf: . +@prefix ex: . + + a rml:TriplesMap; + rml:logicalSource [ + rml:source _:b738439 ; + rml:referenceFormulation rml:JSONPath ; + rml:iterator "$.*" ; + ] ; + + rml:subjectMap [ + rml:template "e/{$.id}" ; + ] ; + + rml:predicateObjectMap [ + rml:predicate ex:with ; + rml:objectMap [ + rml:template "c/{$.id}" ; + rml:gather ( [ rml:reference "$.v1.*" ; ] ) ; + rml:gatherAs rdf:Bag ; + ] ; + ] ; +. + +_:b738439 a rml:RelativePathSource ; + rml:root rml:MappingDirectory ; + rml:path "data.json" . +``` + +**Output** +``` + . + . + "1" . + "2" . + "5" . + "6" . + + . + . + "3" . + "4" . +``` + diff --git a/src/test/resources/rml-cc/RMLTC-CC-0006-IT4/data.json b/src/test/resources/rml-cc/RMLTC-CC-0006-IT4/data.json new file mode 100644 index 00000000..a17afe2c --- /dev/null +++ b/src/test/resources/rml-cc/RMLTC-CC-0006-IT4/data.json @@ -0,0 +1,23 @@ +[ + { + "id": "a", + "v1": [ + "1", + "2" + ] + }, + { + "id": "b", + "v1": [ + "3", + "4" + ] + }, + { + "id": "a", + "v1": [ + "5", + "6" + ] + } +] \ No newline at end of file diff --git a/src/test/resources/rml-cc/RMLTC-CC-0006-IT4/default.nq b/src/test/resources/rml-cc/RMLTC-CC-0006-IT4/default.nq new file mode 100644 index 00000000..008e8e52 --- /dev/null +++ b/src/test/resources/rml-cc/RMLTC-CC-0006-IT4/default.nq @@ -0,0 +1,11 @@ + . + . + "1" . + "2" . + "5" . + "6" . + + . + . + "3" . + "4" . \ No newline at end of file diff --git a/src/test/resources/rml-cc/RMLTC-CC-0006-IT4/mapping.ttl b/src/test/resources/rml-cc/RMLTC-CC-0006-IT4/mapping.ttl new file mode 100644 index 00000000..4adddc15 --- /dev/null +++ b/src/test/resources/rml-cc/RMLTC-CC-0006-IT4/mapping.ttl @@ -0,0 +1,28 @@ +@prefix rml: . +@prefix rdf: . +@prefix ex: . + + a rml:TriplesMap; + rml:logicalSource [ + rml:source _:b738439 ; + rml:referenceFormulation rml:JSONPath ; + rml:iterator "$.*" ; + ] ; + + rml:subjectMap [ + rml:template "e/{$.id}" ; + ] ; + + rml:predicateObjectMap [ + rml:predicate ex:with ; + rml:objectMap [ + rml:template "c/{$.id}" ; + rml:gather ( [ rml:reference "$.v1.*" ; ] ) ; + rml:gatherAs rdf:Bag ; + ] ; + ] ; +. + +_:b738439 a rml:RelativePathSource ; + rml:root rml:MappingDirectory ; + rml:path "data.json" . \ No newline at end of file diff --git a/src/test/resources/rml-cc/RMLTC-CC-0006-IT5/README.md b/src/test/resources/rml-cc/RMLTC-CC-0006-IT5/README.md new file mode 100644 index 00000000..6c3b43d2 --- /dev/null +++ b/src/test/resources/rml-cc/RMLTC-CC-0006-IT5/README.md @@ -0,0 +1,63 @@ +## RMLTC-CC-0006-IT5 + +**Title**: Gather values across iterations to create a container. + +**Description**: When using a template, constant, or reference for a gather map, this tests determines whether the values are correctly appended to the container. The natural order of the term maps inside the gather map as well as the iteration are respected. This test covers two term maps in the gather map. + +**Error expected?** No + +**Input** + [http://w3id.org/rml/resources/rml-io/RMLTC-CC-0006-IT5/Friends.json](http://w3id.org/rml/resources/rml-io/RMLTC-CC-0006-IT5/Friends.json) + +**Mapping** +``` +@prefix rml: . +@prefix rdf: . +@prefix ex: . + + a rml:TriplesMap; + rml:logicalSource [ + rml:source _:b738439 ; + rml:referenceFormulation rml:JSONPath ; + rml:iterator "$.*" ; + ] ; + + rml:subjectMap [ + rml:template "e/{$.id}" ; + ] ; + + rml:predicateObjectMap [ + rml:predicate ex:with ; + rml:objectMap [ + rml:template "c/{$.id}" ; + rml:gather ( [ rml:reference "$.v1.*" ; ] [ rml:reference "$.v2.*" ; ] ) ; + rml:gatherAs rdf:Bag ; + ] ; + ] ; +. + +_:b738439 a rml:RelativePathSource ; + rml:root rml:MappingDirectory ; + rml:path "data.json" . +``` + +**Output** +``` + . + . + "1" . + "2" . + "a" . + "b" . + "5" . + "6" . + "d" . + "e" . + + . + . + "3" . + "4" . + "c" . +``` + diff --git a/src/test/resources/rml-cc/RMLTC-CC-0006-IT5/data.json b/src/test/resources/rml-cc/RMLTC-CC-0006-IT5/data.json new file mode 100644 index 00000000..ab3d8c52 --- /dev/null +++ b/src/test/resources/rml-cc/RMLTC-CC-0006-IT5/data.json @@ -0,0 +1,34 @@ +[ + { + "id": "a", + "v1": [ + "1", + "2" + ], + "v2": [ + "a", + "b" + ] + }, + { + "id": "b", + "v1": [ + "3", + "4" + ], + "v2": [ + "c" + ] + }, + { + "id": "a", + "v1": [ + "5", + "6" + ], + "v2": [ + "d", + "e" + ] + } +] \ No newline at end of file diff --git a/src/test/resources/rml-cc/RMLTC-CC-0006-IT5/default.nq b/src/test/resources/rml-cc/RMLTC-CC-0006-IT5/default.nq new file mode 100644 index 00000000..19c6f4cc --- /dev/null +++ b/src/test/resources/rml-cc/RMLTC-CC-0006-IT5/default.nq @@ -0,0 +1,16 @@ + . + . + "1" . + "2" . + "a" . + "b" . + "5" . + "6" . + "d" . + "e" . + + . + . + "3" . + "4" . + "c" . \ No newline at end of file diff --git a/src/test/resources/rml-cc/RMLTC-CC-0006-IT5/mapping.ttl b/src/test/resources/rml-cc/RMLTC-CC-0006-IT5/mapping.ttl new file mode 100644 index 00000000..071a777d --- /dev/null +++ b/src/test/resources/rml-cc/RMLTC-CC-0006-IT5/mapping.ttl @@ -0,0 +1,28 @@ +@prefix rml: . +@prefix rdf: . +@prefix ex: . + + a rml:TriplesMap; + rml:logicalSource [ + rml:source _:b738439 ; + rml:referenceFormulation rml:JSONPath ; + rml:iterator "$.*" ; + ] ; + + rml:subjectMap [ + rml:template "e/{$.id}" ; + ] ; + + rml:predicateObjectMap [ + rml:predicate ex:with ; + rml:objectMap [ + rml:template "c/{$.id}" ; + rml:gather ( [ rml:reference "$.v1.*" ; ] [ rml:reference "$.v2.*" ; ] ) ; + rml:gatherAs rdf:Bag ; + ] ; + ] ; +. + +_:b738439 a rml:RelativePathSource ; + rml:root rml:MappingDirectory ; + rml:path "data.json" . \ No newline at end of file diff --git a/src/test/resources/rml-cc/RMLTC-CC-0007-NES/README.md b/src/test/resources/rml-cc/RMLTC-CC-0007-NES/README.md new file mode 100644 index 00000000..7d4f7b5c --- /dev/null +++ b/src/test/resources/rml-cc/RMLTC-CC-0007-NES/README.md @@ -0,0 +1,85 @@ +## RMLTC-CC-0007-NES + +**Title**: Nested gather maps + +**Description**: Testing whether nested gather maps are created. The mapping should generate a list of bags. + +**Error expected?** No + +**Input** + [http://w3id.org/rml/resources/rml-io/RMLTC-CC-0007-NES/Friends.json](http://w3id.org/rml/resources/rml-io/RMLTC-CC-0007-NES/Friends.json) + +**Mapping** +``` +@prefix rml: . +@prefix rdf: . +@prefix ex: . + + a rml:TriplesMap; + rml:logicalSource [ + rml:source _:b738439 ; + rml:referenceFormulation rml:JSONPath ; + rml:iterator "$.*" ; + ] ; + + rml:subjectMap [ + rml:template "e/{$.id}" ; + ] ; + + rml:predicateObjectMap [ + rml:predicate ex:with ; + rml:objectMap [ + rml:gather ( + [ + rml:gather ( [ rml:reference "$.v1.*" ; ] ) ; + rml:gatherAs rdf:Bag ; + ] + [ + rml:gather ( [ rml:reference "$.v2.*" ; ] ) ; + rml:gatherAs rdf:Bag ; + ] + ) ; + rml:gatherAs rdf:List ; + ] ; + ] ; +. + +_:b738439 a rml:RelativePathSource ; + rml:root rml:MappingDirectory ; + rml:path "data.json" . +``` + +**Output** +``` +_:nab9af1206e584ab2afd457e8a605872cb1 . +_:nab9af1206e584ab2afd457e8a605872cb1 "1" . +_:nab9af1206e584ab2afd457e8a605872cb1 "2" . + +_:nab9af1206e584ab2afd457e8a605872cb2 . +_:nab9af1206e584ab2afd457e8a605872cb2 "a" . +_:nab9af1206e584ab2afd457e8a605872cb2 "b" . + +_:nab9af1206e584ab2afd457e8a605872cb5 . +_:nab9af1206e584ab2afd457e8a605872cb5 "3" . +_:nab9af1206e584ab2afd457e8a605872cb5 "4" . + +_:nab9af1206e584ab2afd457e8a605872cb6 . +_:nab9af1206e584ab2afd457e8a605872cb6 "c" . + + _:nab9af1206e584ab2afd457e8a605872cb3 . +_:nab9af1206e584ab2afd457e8a605872cb3 _:nab9af1206e584ab2afd457e8a605872cb1 . +_:nab9af1206e584ab2afd457e8a605872cb3 _:nab9af1206e584ab2afd457e8a605872cb4 . + +_:nab9af1206e584ab2afd457e8a605872cb4 _:nab9af1206e584ab2afd457e8a605872cb2 . +_:nab9af1206e584ab2afd457e8a605872cb4 . + + _:nab9af1206e584ab2afd457e8a605872cb7 . +_:nab9af1206e584ab2afd457e8a605872cb7 _:nab9af1206e584ab2afd457e8a605872cb5 . +_:nab9af1206e584ab2afd457e8a605872cb7 _:nab9af1206e584ab2afd457e8a605872cb8 . + +_:nab9af1206e584ab2afd457e8a605872cb8 _:nab9af1206e584ab2afd457e8a605872cb6 . +_:nab9af1206e584ab2afd457e8a605872cb8 . + + +``` + diff --git a/src/test/resources/rml-cc/RMLTC-CC-0007-NES/mapping.ttl b/src/test/resources/rml-cc/RMLTC-CC-0007-NES/mapping.ttl index 98d2787a..8423745d 100644 --- a/src/test/resources/rml-cc/RMLTC-CC-0007-NES/mapping.ttl +++ b/src/test/resources/rml-cc/RMLTC-CC-0007-NES/mapping.ttl @@ -1,9 +1,8 @@ @prefix rml: . @prefix rdf: . @prefix ex: . -@base . -<#TM> a rml:TriplesMap; + a rml:TriplesMap; rml:logicalSource [ rml:source _:b738439 ; rml:referenceFormulation rml:JSONPath ; @@ -33,4 +32,5 @@ . _:b738439 a rml:RelativePathSource ; + rml:root rml:MappingDirectory ; rml:path "data.json" . \ No newline at end of file diff --git a/src/test/resources/rml-cc/RMLTC-CC-0008-ROMa/README.md b/src/test/resources/rml-cc/RMLTC-CC-0008-ROMa/README.md new file mode 100644 index 00000000..5f400157 --- /dev/null +++ b/src/test/resources/rml-cc/RMLTC-CC-0008-ROMa/README.md @@ -0,0 +1,61 @@ +## RMLTC-CC-0008-ROMa + +**Title**: Elements via reference object-map. + +**Description**: Testing whether gather maps generate an RDF list whose members are generated by a referencing object-map. + +**Error expected?** No + +**Input** + [http://w3id.org/rml/resources/rml-io/RMLTC-CC-0008-ROMa/Friends.json](http://w3id.org/rml/resources/rml-io/RMLTC-CC-0008-ROMa/Friends.json) + +**Mapping** +``` +@prefix ex: . +@prefix rml: . +@prefix rdf: . + +_:b273446 a rml:RelativePathSource ; + rml:root rml:MappingDirectory ; + rml:path "student.csv" . + + a rml:TriplesMap ; + rml:logicalSource [ a rml:LogicalSource ; + rml:referenceFormulation rml:CSV ; + rml:source _:b273446 ] ; + + rml:predicateObjectMap [ + rml:objectMap [ + rml:reference "ID" ; rml:termType rml:BlankNode ; + rml:gather ( + [ + rml:parentTriplesMap ; + rml:joinCondition [ rml:child "Sport" ; rml:parent "Sport" ] ; + ] + ) ; + rml:gatherAs rdf:List; + ] ; + rml:predicate ex:sameSportAs + ] ; + + rml:subjectMap [ rml:template "http://example.com/Student/{ID}/{Name}" ] . + +``` + +**Output** +``` +_:genid1 . +_:genid1 _:genid2 . +_:genid2 . +_:genid2 . + _:genid1 . +_:genid3 . +_:genid3 _:genid4 . +_:genid4 . +_:genid4 . + _:genid3 . +_:genid5 . +_:genid5 . + _:genid5 . +``` + diff --git a/src/test/resources/rml-cc/RMLTC-CC-0008-ROMa/mapping.ttl b/src/test/resources/rml-cc/RMLTC-CC-0008-ROMa/mapping.ttl index 26953922..fb097e85 100644 --- a/src/test/resources/rml-cc/RMLTC-CC-0008-ROMa/mapping.ttl +++ b/src/test/resources/rml-cc/RMLTC-CC-0008-ROMa/mapping.ttl @@ -3,6 +3,7 @@ @prefix rdf: . _:b273446 a rml:RelativePathSource ; + rml:root rml:MappingDirectory ; rml:path "student.csv" . a rml:TriplesMap ; diff --git a/src/test/resources/rml-cc/RMLTC-CC-0008-ROMb/README.md b/src/test/resources/rml-cc/RMLTC-CC-0008-ROMb/README.md new file mode 100644 index 00000000..8b5690af --- /dev/null +++ b/src/test/resources/rml-cc/RMLTC-CC-0008-ROMb/README.md @@ -0,0 +1,57 @@ +## RMLTC-CC-0008-ROMb + +**Title**: Elements via reference object-map with default join condition + +**Description**: Testing whether gather maps generate an RDF list whose members are generated by a referencing object-map with a default join condition. + +**Error expected?** No + +**Input** + [http://w3id.org/rml/resources/rml-io/RMLTC-CC-0008-ROMb/Friends.json](http://w3id.org/rml/resources/rml-io/RMLTC-CC-0008-ROMb/Friends.json) + +**Mapping** +``` +@prefix ex: . +@prefix rml: . +@prefix rdf: . + +_:b273446 a rml:RelativePathSource ; + rml:root rml:MappingDirectory ; + rml:path "student.csv" . + + a rml:TriplesMap ; + rml:logicalSource [ a rml:LogicalSource ; + rml:referenceFormulation rml:CSV ; + rml:source _:b273446 ] ; + + rml:predicateObjectMap [ + rml:objectMap [ + rml:reference "ID" ; rml:termType rml:BlankNode ; + rml:gather ( + [ + rml:parentTriplesMap ; + ] + ) ; + rml:gatherAs rdf:List; + ] ; + rml:predicate ex:sameSportAs + ] ; + + rml:subjectMap [ rml:template "http://example.com/Student/{ID}/{Name}" ] . + + +``` + +**Output** +``` +_:genid1 . +_:genid1 . + _:genid1 . +_:genid2 . +_:genid2 . + _:genid2 . +_:genid3 . +_:genid3 . + _:genid3 . +``` + diff --git a/src/test/resources/rml-cc/RMLTC-CC-0008-ROMb/mapping.ttl b/src/test/resources/rml-cc/RMLTC-CC-0008-ROMb/mapping.ttl index b1ce8c6c..e6707b77 100644 --- a/src/test/resources/rml-cc/RMLTC-CC-0008-ROMb/mapping.ttl +++ b/src/test/resources/rml-cc/RMLTC-CC-0008-ROMb/mapping.ttl @@ -3,6 +3,7 @@ @prefix rdf: . _:b273446 a rml:RelativePathSource ; + rml:root rml:MappingDirectory ; rml:path "student.csv" . a rml:TriplesMap ; diff --git a/src/test/resources/rml-cc/RMLTC-CC-0009-DUP-Bag/README.md b/src/test/resources/rml-cc/RMLTC-CC-0009-DUP-Bag/README.md new file mode 100644 index 00000000..733ae3e8 --- /dev/null +++ b/src/test/resources/rml-cc/RMLTC-CC-0009-DUP-Bag/README.md @@ -0,0 +1,61 @@ +## RMLTC-CC-0009-DUP-Bag + +**Title**: Gather duplicate values in an RDF Bag + +**Description**: Testing the expected behavior of multi-valued expression maps containing duplicate values when these expression maps are used in a gather map to create an RDF Bag. + +**Error expected?** No + +**Input** + [http://w3id.org/rml/resources/rml-io/RMLTC-CC-0009-DUP-Bag/Friends.json](http://w3id.org/rml/resources/rml-io/RMLTC-CC-0009-DUP-Bag/Friends.json) + +**Mapping** +``` +@prefix rml: . +@prefix rdf: . +@prefix ex: . + + a rml:TriplesMap; + rml:logicalSource [ + rml:source _:b738439 ; + rml:referenceFormulation rml:JSONPath ; + rml:iterator "$.*" ; + ] ; + + rml:subjectMap [ + rml:template "e/{$.id}" ; + ] ; + + rml:predicateObjectMap [ + rml:predicate ex:with ; + rml:objectMap [ + rml:gather ( [ rml:reference "$.values.*" ; ] ) ; + rml:gatherAs rdf:Bag ; + ] ; + ] ; +. + +_:b738439 a rml:RelativePathSource ; + rml:root rml:MappingDirectory ; + rml:path "data.json" . +``` + +**Output** +``` +_:nc808fbd2e11a4baa939c61c8210b5909b1 . +_:nc808fbd2e11a4baa939c61c8210b5909b2 "2" . +_:nc808fbd2e11a4baa939c61c8210b5909b2 . +_:nc808fbd2e11a4baa939c61c8210b5909b3 . +_:nc808fbd2e11a4baa939c61c8210b5909b3 "9" . +_:nc808fbd2e11a4baa939c61c8210b5909b1 "1" . + _:nc808fbd2e11a4baa939c61c8210b5909b2 . +_:nc808fbd2e11a4baa939c61c8210b5909b1 "1" . + _:nc808fbd2e11a4baa939c61c8210b5909b3 . + _:nc808fbd2e11a4baa939c61c8210b5909b1 . +_:nc808fbd2e11a4baa939c61c8210b5909b2 "2" . +_:nc808fbd2e11a4baa939c61c8210b5909b3 "7" . +_:nc808fbd2e11a4baa939c61c8210b5909b2 "6" . +_:nc808fbd2e11a4baa939c61c8210b5909b1 "1" . +_:nc808fbd2e11a4baa939c61c8210b5909b3 "8" . +``` + diff --git a/src/test/resources/rml-cc/RMLTC-CC-0009-DUP-Bag/mapping.ttl b/src/test/resources/rml-cc/RMLTC-CC-0009-DUP-Bag/mapping.ttl index 20d9348f..cefcb53e 100644 --- a/src/test/resources/rml-cc/RMLTC-CC-0009-DUP-Bag/mapping.ttl +++ b/src/test/resources/rml-cc/RMLTC-CC-0009-DUP-Bag/mapping.ttl @@ -1,9 +1,8 @@ @prefix rml: . @prefix rdf: . @prefix ex: . -@base . -<#TM> a rml:TriplesMap; + a rml:TriplesMap; rml:logicalSource [ rml:source _:b738439 ; rml:referenceFormulation rml:JSONPath ; @@ -24,4 +23,5 @@ . _:b738439 a rml:RelativePathSource ; + rml:root rml:MappingDirectory ; rml:path "data.json" . \ No newline at end of file diff --git a/src/test/resources/rml-cc/RMLTC-CC-0009-DUP-List/README.md b/src/test/resources/rml-cc/RMLTC-CC-0009-DUP-List/README.md new file mode 100644 index 00000000..4b44f018 --- /dev/null +++ b/src/test/resources/rml-cc/RMLTC-CC-0009-DUP-List/README.md @@ -0,0 +1,70 @@ +## RMLTC-CC-0009-DUP-List + +**Title**: Gather duplicate values in an RDF List + +**Description**: Testing the expected behavior of multi-valued expression maps containing duplicate values when these expression maps are used in a gather map to create a list. + +**Error expected?** No + +**Input** + [http://w3id.org/rml/resources/rml-io/RMLTC-CC-0009-DUP-List/Friends.json](http://w3id.org/rml/resources/rml-io/RMLTC-CC-0009-DUP-List/Friends.json) + +**Mapping** +``` +@prefix rml: . +@prefix rdf: . +@prefix ex: . + + a rml:TriplesMap; + rml:logicalSource [ + rml:source _:b738439 ; + rml:referenceFormulation rml:JSONPath ; + rml:iterator "$.*" ; + ] ; + + rml:subjectMap [ + rml:template "e/{$.id}" ; + ] ; + + rml:predicateObjectMap [ + rml:predicate ex:with ; + rml:objectMap [ + rml:gather ( [ rml:reference "$.values.*" ; ] ) ; + rml:gatherAs rdf:List ; + ] ; + ] ; +. + +_:b738439 a rml:RelativePathSource ; + rml:root rml:MappingDirectory ; + rml:path "data.json" . +``` + +**Output** +``` + _:n988e0f11d19c486fa3b3255f94c9b3bab1 . +_:n988e0f11d19c486fa3b3255f94c9b3bab1 "1" . +_:n988e0f11d19c486fa3b3255f94c9b3bab1 _:n988e0f11d19c486fa3b3255f94c9b3bab2 . +_:n988e0f11d19c486fa3b3255f94c9b3bab2 "1" . +_:n988e0f11d19c486fa3b3255f94c9b3bab2 _:n988e0f11d19c486fa3b3255f94c9b3bab3 . +_:n988e0f11d19c486fa3b3255f94c9b3bab3 "1" . +_:n988e0f11d19c486fa3b3255f94c9b3bab3 . + + _:n988e0f11d19c486fa3b3255f94c9b3bab4 . +_:n988e0f11d19c486fa3b3255f94c9b3bab4 "2" . +_:n988e0f11d19c486fa3b3255f94c9b3bab4 _:n988e0f11d19c486fa3b3255f94c9b3bab5 . +_:n988e0f11d19c486fa3b3255f94c9b3bab5 "2" . +_:n988e0f11d19c486fa3b3255f94c9b3bab5 _:n988e0f11d19c486fa3b3255f94c9b3bab6 . +_:n988e0f11d19c486fa3b3255f94c9b3bab6 "6" . +_:n988e0f11d19c486fa3b3255f94c9b3bab6 . + + _:n988e0f11d19c486fa3b3255f94c9b3bab7 . +_:n988e0f11d19c486fa3b3255f94c9b3bab7 "7" . +_:n988e0f11d19c486fa3b3255f94c9b3bab7 _:n988e0f11d19c486fa3b3255f94c9b3bab8 . +_:n988e0f11d19c486fa3b3255f94c9b3bab8 "8" . +_:n988e0f11d19c486fa3b3255f94c9b3bab8 _:n988e0f11d19c486fa3b3255f94c9b3bab9 . +_:n988e0f11d19c486fa3b3255f94c9b3bab9 "9" . +_:n988e0f11d19c486fa3b3255f94c9b3bab9 . + +``` + diff --git a/src/test/resources/rml-cc/RMLTC-CC-0009-DUP-List/mapping.ttl b/src/test/resources/rml-cc/RMLTC-CC-0009-DUP-List/mapping.ttl index ca963e35..0e837b79 100644 --- a/src/test/resources/rml-cc/RMLTC-CC-0009-DUP-List/mapping.ttl +++ b/src/test/resources/rml-cc/RMLTC-CC-0009-DUP-List/mapping.ttl @@ -1,9 +1,8 @@ @prefix rml: . @prefix rdf: . @prefix ex: . -@base . -<#TM> a rml:TriplesMap; + a rml:TriplesMap; rml:logicalSource [ rml:source _:b738439 ; rml:referenceFormulation rml:JSONPath ; @@ -24,4 +23,5 @@ . _:b738439 a rml:RelativePathSource ; + rml:root rml:MappingDirectory ; rml:path "data.json" . \ No newline at end of file diff --git a/src/test/resources/rml-cc/RMLTC-CC-0010-List/mapping.ttl b/src/test/resources/rml-cc/RMLTC-CC-0010-List/mapping.ttl deleted file mode 100644 index 1dd36510..00000000 --- a/src/test/resources/rml-cc/RMLTC-CC-0010-List/mapping.ttl +++ /dev/null @@ -1,28 +0,0 @@ -@prefix rml: . -@prefix rdf: . -@prefix ex: . -@base . - -<#TM> a rml:TriplesMap; - rml:logicalSource [ - rml:source _:b738439 ; - rml:referenceFormulation rml:JSONPath ; - rml:iterator "$.*" ; - ] ; - - rml:subjectMap [ - rml:template "e/{$.id}" ; - ] ; - - rml:predicateObjectMap [ - rml:graphMap [ rml:template "g/{$.graph}" ; ] ; - rml:predicate ex:with ; - rml:objectMap [ - rml:gather ( [ rml:reference "$.values.*" ; ] ) ; - rml:gatherAs rdf:List ; - ] ; - ] ; -. - -_:b738439 a rml:RelativePathSource ; - rml:path "data.json" . \ No newline at end of file diff --git a/src/test/resources/rml-cc/RMLTC-CC-0010-Lista/README.md b/src/test/resources/rml-cc/RMLTC-CC-0010-Lista/README.md new file mode 100644 index 00000000..870ad33c --- /dev/null +++ b/src/test/resources/rml-cc/RMLTC-CC-0010-Lista/README.md @@ -0,0 +1,57 @@ +## RMLTC-CC-0010-Lista + +**Title**: Combining graph maps and gather maps (graph map has a template and gather map does not) + +**Description**: Tests the behavior of combining graph- and gather maps. In this example, a blank node for each list is expected. + +**Error expected?** No + +**Input** + [http://w3id.org/rml/resources/rml-io/RMLTC-CC-0010-Lista/Friends.json](http://w3id.org/rml/resources/rml-io/RMLTC-CC-0010-Lista/Friends.json) + +**Mapping** +``` +@prefix rml: . +@prefix rdf: . +@prefix ex: . + + a rml:TriplesMap; + rml:logicalSource [ + rml:source _:b738439 ; + rml:referenceFormulation rml:JSONPath ; + rml:iterator "$.*" ; + ] ; + + rml:subjectMap [ + rml:template "e/{$.id}" ; + ] ; + + rml:predicateObjectMap [ + rml:graphMap [ rml:template "g/{$.graph}" ; ] ; + rml:predicate ex:with ; + rml:objectMap [ + rml:gather ( [ rml:reference "$.values.*" ; ] ) ; + rml:gatherAs rdf:List ; + ] ; + ] ; +. + +_:b738439 a rml:RelativePathSource ; + rml:root rml:MappingDirectory ; + rml:path "data.json" . +``` + +**Output** +``` +_:genid1 "1" . +_:genid1 . +_:genid2 "3" . +_:genid2 . + _:genid1 . + _:genid2 . + +_:genidx1 "2" . +_:genidx1 . + _:genidx1 . +``` + diff --git a/src/test/resources/rml-cc/RMLTC-CC-0010-List/data.json b/src/test/resources/rml-cc/RMLTC-CC-0010-Lista/data.json similarity index 100% rename from src/test/resources/rml-cc/RMLTC-CC-0010-List/data.json rename to src/test/resources/rml-cc/RMLTC-CC-0010-Lista/data.json diff --git a/src/test/resources/rml-cc/RMLTC-CC-0010-List/default.nq b/src/test/resources/rml-cc/RMLTC-CC-0010-Lista/default.nq similarity index 100% rename from src/test/resources/rml-cc/RMLTC-CC-0010-List/default.nq rename to src/test/resources/rml-cc/RMLTC-CC-0010-Lista/default.nq diff --git a/src/test/resources/rml-cc/RMLTC-CC-0010-Lista/mapping.ttl b/src/test/resources/rml-cc/RMLTC-CC-0010-Lista/mapping.ttl new file mode 100644 index 00000000..6eeb8b99 --- /dev/null +++ b/src/test/resources/rml-cc/RMLTC-CC-0010-Lista/mapping.ttl @@ -0,0 +1,28 @@ +@prefix rml: . +@prefix rdf: . +@prefix ex: . + + a rml:TriplesMap; + rml:logicalSource [ + rml:source _:b738439 ; + rml:referenceFormulation rml:JSONPath ; + rml:iterator "$.*" ; + ] ; + + rml:subjectMap [ + rml:template "e/{$.id}" ; + ] ; + + rml:predicateObjectMap [ + rml:graphMap [ rml:template "g/{$.graph}" ; ] ; + rml:predicate ex:with ; + rml:objectMap [ + rml:gather ( [ rml:reference "$.values.*" ; ] ) ; + rml:gatherAs rdf:List ; + ] ; + ] ; +. + +_:b738439 a rml:RelativePathSource ; + rml:root rml:MappingDirectory ; + rml:path "data.json" . \ No newline at end of file diff --git a/src/test/resources/rml-cc/RMLTC-CC-0010-Listb/README.md b/src/test/resources/rml-cc/RMLTC-CC-0010-Listb/README.md new file mode 100644 index 00000000..0859ca2a --- /dev/null +++ b/src/test/resources/rml-cc/RMLTC-CC-0010-Listb/README.md @@ -0,0 +1,57 @@ +## RMLTC-CC-0010-Listb + +**Title**: Combining graph maps and gather maps (both graph map and gather map have a template) + +**Description**: Tests the behavior of combining graph- and gather maps. In this example, lists are concatinated in some named graphs via blank node identifiers constructed with templates. + +**Error expected?** No + +**Input** + [http://w3id.org/rml/resources/rml-io/RMLTC-CC-0010-Listb/Friends.json](http://w3id.org/rml/resources/rml-io/RMLTC-CC-0010-Listb/Friends.json) + +**Mapping** +``` +@prefix rml: . +@prefix rdf: . +@prefix ex: . + + a rml:TriplesMap; + rml:logicalSource [ + rml:source _:b738439 ; + rml:referenceFormulation rml:JSONPath ; + rml:iterator "$.*" ; + ] ; + + rml:subjectMap [ + rml:template "e/{$.id}" ; + ] ; + + rml:predicateObjectMap [ + rml:graphMap [ rml:template "g/{$.graph}" ; ] ; + rml:predicate ex:with ; + rml:objectMap [ + rml:template "l/{$.id}" ; rml:termType rml:BlankNode ; + rml:gather ( [ rml:reference "$.values.*" ; ] ) ; + rml:gatherAs rdf:List ; + ] ; + ] ; +. + +_:b738439 a rml:RelativePathSource ; + rml:root rml:MappingDirectory ; + rml:path "data.json" . +``` + +**Output** +``` +_:genid1 "1" . +_:genid1 _:genid2 . +_:genid2 "3" . +_:genid2 . + _:genid1 . + +_:genidx1 "2" . +_:genidx1 . + _:genidx1 . +``` + diff --git a/src/test/resources/rml-cc/RMLTC-CC-0010-Listb/mapping.ttl b/src/test/resources/rml-cc/RMLTC-CC-0010-Listb/mapping.ttl index 230573f4..0f744299 100644 --- a/src/test/resources/rml-cc/RMLTC-CC-0010-Listb/mapping.ttl +++ b/src/test/resources/rml-cc/RMLTC-CC-0010-Listb/mapping.ttl @@ -1,9 +1,8 @@ @prefix rml: . @prefix rdf: . @prefix ex: . -@base . -<#TM> a rml:TriplesMap; + a rml:TriplesMap; rml:logicalSource [ rml:source _:b738439 ; rml:referenceFormulation rml:JSONPath ; @@ -26,4 +25,5 @@ . _:b738439 a rml:RelativePathSource ; + rml:root rml:MappingDirectory ; rml:path "data.json" . \ No newline at end of file diff --git a/src/test/resources/rml-cc/config.js b/src/test/resources/rml-cc/config.js new file mode 100644 index 00000000..dd32f38d --- /dev/null +++ b/src/test/resources/rml-cc/config.js @@ -0,0 +1,72 @@ +async function loadTurtle() { + //this is the function you call in 'preProcess', to load the highlighter + const worker = await new Promise(resolve => { + require(["core/worker"], ({ worker }) => resolve(worker)); + }); + const action = "highlight-load-lang"; + const langURL = + "https://cdn.jsdelivr.net/gh/redmer/highlightjs-turtle/src/languages/turtle.js"; + const propName = "hljsDefineTurtle"; // This funtion is defined in the highlighter being loaded + const lang = "turtle"; // this is the class you use to identify the language + worker.postMessage({ action, langURL, propName, lang }); + return new Promise(resolve => { + worker.addEventListener("message", function listener({ data }) { + const { action: responseAction, lang: responseLang } = data; + if (responseAction === action && responseLang === lang) { + worker.removeEventListener("message", listener); + resolve(); + } + }); + }); +} + +var respecConfig = { + // check https://respec.org/docs/ for the meaning of these keys + preProcess: [loadTurtle], + authors: [ + { + name: "Dylan Van Assche", + url: "https://dylanvanassche.be", + company: "IDLab – Ghent University – imec", + orcid: "0000-0002-7195-9935", + companyURL: "https://knows.idlab.ugent.be/" + } + ], + edDraftURI: "https://w3id.org/rml/cc/test-cases/", + editors: [ + { + name: "Dylan Van Assche", + url: "https://dylanvanassche.be", + company: "IDLab – Ghent University – imec", + orcid: "0000-0002-7195-9935", + companyURL: "https://knows.idlab.ugent.be/" + } + ], + formerEditors: [ + ], + github: "https://github.com/kg-construct/rml-cc", + license: "w3c-software-doc", + localBiblio: { + "RML-Core": { + title: "RML-Core", + href: "https://w3id.org/rml/core/spec", + status: "Draft Community Group Report", + publisher: "W3C", + date: "07 August 2024", + }, + "RML-IO": { + title: "RML-IO", + href: "https://w3id.org/rml/io/spec", + status: "Draft Community Group Report", + publisher: "W3C", + date: "12 March 2024", + }, + }, + otherLinks: [], + shortName: "RML-CC-Testcases", + specStatus: "CG-DRAFT", + // W3C config + copyrightStart: "2024", + doJsonLd: true, + group: "kg-construct", +}; diff --git a/src/test/resources/rml-cc/descriptions.csv b/src/test/resources/rml-cc/descriptions.csv new file mode 100644 index 00000000..df4bf68b --- /dev/null +++ b/src/test/resources/rml-cc/descriptions.csv @@ -0,0 +1,36 @@ +ID,title,purpose,part of spec,data format,ref. formulation,error expected?,input file 1,input file 2,input file 3,comment +RMLTC-CC-0001-List,Generate a rdf:List as an object,Tests if a rdf:List is generated as an object,,JSON,JSON,no,data.json,,, +RMLTC-CC-0001-Bag,Generate a rdf:Bag as an object,Tests if a rdf:Bag is generated as an object,,JSON,JSON,no,data.json,,, +RMLTC-CC-0001-Seq,Generate a rdf:Seq as an object,Tests if a rdf:Seq is generated as an object,,JSON,JSON,no,data.json,,, +RMLTC-CC-0001-Alt,Generate a rdf:Alt as an object,Tests if a rdf:Alt is generated as an object,,JSON,JSON,no,data.json,,, +RMLTC-CC-0002-List,Generate a named rdf:List as an object,Tests if a named rdf:List is generated as an object,,JSON,JSON,no,data.json,,, +RMLTC-CC-0002-Bag,Generate a named rdf:Bag as an object,Tests if a named rdf:Bag is generated as an object,,JSON,JSON,no,data.json,,,"If it works for bags, then it should work for sequences and alternatives." +RMLTC-CC-0003-EL,Allow the generation of empty lists,Tests if the use of rml:allowEmptyListAndContainer yields an empty list.,,JSON,JSON,no,data.json,,, +RMLTC-CC-0003-EL-BN,Allow the generation of empty lists identified by blank node identifiers.,Tests if the use of rml:allowEmptyListAndContainer yields an empty list. The lists are identified by a blank node identifier generated in the mapping.,,JSON,JSON,no,data.json,,, +RMLTC-CC-0003-EL-Named,Allow the generation of empty lists identified by IRIs.,Tests if the use of rml:allowEmptyListAndContainer yields an empty list. The lists are identified by a IRI generated in the mapping.,,JSON,JSON,no,data.json,,, +RMLTC-CC-0003-NEL,Empty lists are not generated,Tests if empty lists are not generated (expected default behavior).,,JSON,JSON,no,data.json,,, +RMLTC-CC-0003-NELb,Empty lists are not generated II,Tests if empty lists are not generated (expected default behavior). This test cases uses the predicate rml:allowEmptyListAndContainer.,,JSON,JSON,no,data.json,,, +RMLTC-CC-0003-EB,Allow the generation of empty bags,Tests if the use of rml:allowEmptyListAndContainer yields an empty bag.,,JSON,JSON,no,data.json,,,"If it works for bags, then it should work for sequences and alternatives." +RMLTC-CC-0003-NEB,Empty bags are not generated,Tests if empty containers are not generated (expected default behavior).,,JSON,JSON,no,data.json,,, +RMLTC-CC-0004-SM1,GatherMap in subject map (list),Tests if the use of a gather map in the subject map is supported. This test generates a list.,,JSON,JSON,no,data.json,,, +RMLTC-CC-0004-SM2,GatherMap in subject map (list),Tests if the use of a gather map in the subject map is supported. This test has no predicate-object maps and no class declarations in the subject map. It still needs to generate triples as the lists consists of at least one cons-pair.,,JSON,JSON,no,data.json,,, +RMLTC-CC-0004-SM3,GatherMap in subject map (list),Tests if the use of a gather map in the subject map is supported. This test has no predicate-object maps and no class declarations in the subject map. Only one list needs to be generated as the other has no values and we only retain non-empty lists. ,,JSON,JSON,no,data.json,,, +RMLTC-CC-0004-SM4,GatherMap in subject map (bag),Tests if the use of a gather map in the subject map is supported. This test generates a bag.,,JSON,JSON,no,data.json,,, +RMLTC-CC-0004-SM5,GatherMap in subject map (bag),"Tests if the use of a gather map in the subject map is supported. This test has no predicate-object maps and no class declarations in the subject map. It should generate a non-empty bag and an empty bag. The reason being that a container has at least one triple ; it's type (bag, seq, or alt).",,JSON,JSON,no,data.json,,, +RMLTC-CC-0005-App1,Append values of multiple term maps,Tests appending of values from multiple term maps in an gather map. This test covers the case where all sets of values are non-empty.,,JSON,JSON,no,data.json,,, +RMLTC-CC-0005-App2,Append values of multiple term maps,"Tests appending of values from multiple term maps in an iteration. In this example, one of the arrays is empty and the expected behavior is to concatinate a list with the empty list.",,JSON,JSON,no,data.json,,, +RMLTC-CC-0005-Car1,Cartesian product of values from multiple term maps of a gather map.,Tests generating the Cartesian product of values from multiple term maps in a gather map. This test covers the case where all sets of values are non-empty.,,JSON,JSON,no,data.json,,, +RMLTC-CC-0005-Car2,Cartesian product of values from multiple term maps of a gather map.,Tests generating the Cartesian product of values from multiple term maps in a gather map. This test covers the case where one of the sets is empty. The Cartesian product of a set with an empty set is empty. This entry should thus not yield a list.,,JSON,JSON,no,data.json,,, +RMLTC-CC-0006-IT0,Gather values across iterations to create a collection.,"When no template, constant, or reference is given to a gather map, then each iteration yields a different collection.",,JSON,JSON,no,data.json,,, +RMLTC-CC-0006-IT1,Gather values across iterations to create a collection.,"When using a template, constant, or reference for a gather map, this tests determines whether the values are correctly appended to the list. The natural order of the term maps inside the gather map as well as the iteration are respected. This test covers one term map in the gather map.",,JSON,JSON,no,data.json,,, +RMLTC-CC-0006-IT2,Gather values across iterations to create a collection.,"When using a template, constant, or reference for a gather map, this tests determines whether the values are correctly appended to the list. The natural order of the term maps inside the gather map as well as the iteration are respected. This test covers two term maps in the gather map.",,JSON,JSON,no,data.json,,, +RMLTC-CC-0006-IT3,Gather values across iterations to create a container.,"When no template, constant, or reference is given to a gather map, then each iteration yields a different container.",,JSON,JSON,no,data.json,,, +RMLTC-CC-0006-IT4,Gather values across iterations to create a container.,"When using a template, constant, or reference for a gather map, this tests determines whether the values are correctly appended to the container. The natural order of the term maps inside the gather map as well as the iteration are respected. This test covers one term map in the gather map.",,JSON,JSON,no,data.json,,, +RMLTC-CC-0006-IT5,Gather values across iterations to create a container.,"When using a template, constant, or reference for a gather map, this tests determines whether the values are correctly appended to the container. The natural order of the term maps inside the gather map as well as the iteration are respected. This test covers two term maps in the gather map.",,JSON,JSON,no,data.json,,, +RMLTC-CC-0007-NES,Nested gather maps,Testing whether nested gather maps are created. The mapping should generate a list of bags.,,JSON,JSON,no,data.json,,, +RMLTC-CC-0008-ROMa,Elements via reference object-map.,Testing whether gather maps generate an RDF list whose members are generated by a referencing object-map.,,CSV,CSV,no,student.csv,,, +RMLTC-CC-0008-ROMb,Elements via reference object-map with default join condition,Testing whether gather maps generate an RDF list whose members are generated by a referencing object-map with a default join condition.,,CSV,CSV,no,student.csv,,, +RMLTC-CC-0009-DUP-Bag,Gather duplicate values in an RDF Bag,Testing the expected behavior of multi-valued expression maps containing duplicate values when these expression maps are used in a gather map to create an RDF Bag.,,JSON,JSON,no,data.json,,, +RMLTC-CC-0009-DUP-List,Gather duplicate values in an RDF List,Testing the expected behavior of multi-valued expression maps containing duplicate values when these expression maps are used in a gather map to create a list.,,JSON,JSON,no,data.json,,, +RMLTC-CC-0010-Lista,Combining graph maps and gather maps (graph map has a template and gather map does not),"Tests the behavior of combining graph- and gather maps. In this example, a blank node for each list is expected.",,JSON,JSON,no,data.json,,, +RMLTC-CC-0010-Listb,Combining graph maps and gather maps (both graph map and gather map have a template),"Tests the behavior of combining graph- and gather maps. In this example, lists are concatinated in some named graphs via blank node identifiers constructed with templates.",,JSON,JSON,no,data.json,,, \ No newline at end of file diff --git a/src/test/resources/rml-cc/dev.html b/src/test/resources/rml-cc/dev.html new file mode 100644 index 00000000..375747e7 --- /dev/null +++ b/src/test/resources/rml-cc/dev.html @@ -0,0 +1,219 @@ + + + + + RML-CC: Test Cases + + + + + + + + + + +
+ +
+ +
+ +
+ +
+ + +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ + + + diff --git a/src/test/resources/rml-cc/docs/20250130/index.html b/src/test/resources/rml-cc/docs/20250130/index.html new file mode 100644 index 00000000..27f834b9 --- /dev/null +++ b/src/test/resources/rml-cc/docs/20250130/index.html @@ -0,0 +1,2158 @@ + + + + + + +RML-CC: Test Cases + + + + + + + + + + + + + + +
+ +

RML-CC: Test Cases

+

+ Draft Community Group Report + +

+
+ +
Latest published version:
+ https://www.w3.org/RML-CC-Testcases/ +
+
Latest editor's draft:
https://w3id.org/rml/cc/test-cases/
+ + + + +
Editor:
+ Dylan Van Assche + + + + (IDLab – Ghent University – imec) +
+ +
Author:
+ Dylan Van Assche + + + + (IDLab – Ghent University – imec) +
+
Feedback:
+ GitHub kg-construct/rml-cc + (pull requests, + new issue, + open issues) +
+ +
+ + +
+
+ + + +

Abstract

This document defines the RML-CC test cases to the determine the RML-CC specification conformance of tools.

+
+ +

Status of This Document

+ This specification was published by the + Knowledge Graph Construction Community Group. It is not a W3C Standard nor is it + on the W3C Standards Track. + + Please note that under the + W3C Community Contributor License Agreement (CLA) + there is a limited opt-out and other conditions apply. + + Learn more about + W3C Community and Business Groups. +

+ GitHub Issues are preferred for + discussion of this specification. + + +

+ +

1. Introduction

+

This document defines the RML-CC test cases, consisting of a collection of test case documents (input and expected output). +The purpose of the test cases is to determine the conformance of tools that execute RML rules to the RML-CC specification.

+
+ +

2. Data model

+

The test cases are semantically described for re-usability and shareability following the W3C Test case description. +Each test:Testcase as the following properties:

+
    +
  • dcterms:identifier: unique ID of the test case.
  • +
  • rmltest:hasError: if an error of the RML Processor is expected or not.
  • +
  • rmltest:input: One or more input data of the test case.
  • +
  • rmltest:output: One or more output data of the test case.
  • +
  • rmltest:inputFormat: the input data format.
  • +
  • rmltest:outputFormat: the output data format.
  • +
  • rmltest:mappingDocument: the RML mapping rules in Turtle.
  • +
+
+ +

3. Test cases

+

This section describes the RML-CC test cases. These descriptions are also available as RDF. +The files are available on GitHub in the folder test-cases. +Each test case is contained in a single folder, containing three types of files:

+
    +
  • Zero or more files containing the data sources, in the case of JSON, XML, CSV, or containing the SQL statements to create the necessary tables, in the case of MySQL, PostgreSQL, and SQL Server.
  • +
  • One file with the RML rules, called mapping.ttl, in the Turtle format.
  • +
  • Zero or more files with the expected RDF. No file is provided if an error is expected that must halt the generation of the RDF because of an error.
  • +
+
+ + +

4. RMLTC-CC-0001-Alt

+

Title: Generate a rdf:Alt as an object

+

Description: Tests if a rdf:Alt is generated as an object

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0001-Alt/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/>.
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+@prefix ex:  <http://example.com/ns#>.
+@base        <http://example.com/>.
+
+<#TM> a rml:TriplesMap;
+    rml:logicalSource [
+        rml:source _:b738439 ;
+        rml:referenceFormulation rml:JSONPath ;
+        rml:iterator "$.*" ;
+    ] ;
+
+    rml:subjectMap [
+        rml:template "e/{$.id}" ;
+    ] ;
+
+    rml:predicateObjectMap [
+        rml:predicate ex:with ;
+        rml:objectMap [
+            rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
+            rml:gatherAs rdf:Alt ;
+        ] ;
+    ] ;
+.
+
+_:b738439 a rml:RelativePathSource ;
+    rml:path "data.json" .
+
+

Output

+
<http://example.com/base/e/a> <http://example.com/ns#with> _:nc808fbd2e11a4baa939c61c8210b5909b1 .
+_:nc808fbd2e11a4baa939c61c8210b5909b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Alt> .
+_:nc808fbd2e11a4baa939c61c8210b5909b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "1" .
+_:nc808fbd2e11a4baa939c61c8210b5909b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "2" .
+_:nc808fbd2e11a4baa939c61c8210b5909b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "3" .
+
+<http://example.com/base/e/b> <http://example.com/ns#with> _:nc808fbd2e11a4baa939c61c8210b5909b2 .
+_:nc808fbd2e11a4baa939c61c8210b5909b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Alt> .
+_:nc808fbd2e11a4baa939c61c8210b5909b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "4" .
+_:nc808fbd2e11a4baa939c61c8210b5909b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "5" .
+_:nc808fbd2e11a4baa939c61c8210b5909b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "6" .
+
+<http://example.com/base/e/c> <http://example.com/ns#with> _:nc808fbd2e11a4baa939c61c8210b5909b3 .
+_:nc808fbd2e11a4baa939c61c8210b5909b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Alt> .
+_:nc808fbd2e11a4baa939c61c8210b5909b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "7" .
+_:nc808fbd2e11a4baa939c61c8210b5909b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "8" .
+_:nc808fbd2e11a4baa939c61c8210b5909b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "9" .
+
+
+

5. RMLTC-CC-0001-Bag

+

Title: Generate a rdf:Bag as an object

+

Description: Tests if a rdf:Bag is generated as an object

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0001-Bag/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/>.
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+@prefix ex:  <http://example.com/ns#>.
+@base        <http://example.com/>.
+
+<#TM> a rml:TriplesMap;
+    rml:logicalSource [
+        rml:source _:b738439 ;
+        rml:referenceFormulation rml:JSONPath ;
+        rml:iterator "$.*" ;
+    ] ;
+
+    rml:subjectMap [
+        rml:template "e/{$.id}" ;
+    ] ;
+
+    rml:predicateObjectMap [
+        rml:predicate ex:with ;
+        rml:objectMap [
+            rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
+            rml:gatherAs rdf:Bag ;
+        ] ;
+    ] ;
+.
+
+_:b738439 a rml:RelativePathSource ;
+    rml:path "data.json" .
+
+

Output

+
_:nc808fbd2e11a4baa939c61c8210b5909b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
+_:nc808fbd2e11a4baa939c61c8210b5909b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "5" .
+_:nc808fbd2e11a4baa939c61c8210b5909b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
+_:nc808fbd2e11a4baa939c61c8210b5909b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
+_:nc808fbd2e11a4baa939c61c8210b5909b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "9" .
+_:nc808fbd2e11a4baa939c61c8210b5909b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "2" .
+<http://example.com/base/e/b> <http://example.com/ns#with> _:nc808fbd2e11a4baa939c61c8210b5909b2 .
+_:nc808fbd2e11a4baa939c61c8210b5909b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "1" .
+<http://example.com/base/e/c> <http://example.com/ns#with> _:nc808fbd2e11a4baa939c61c8210b5909b3 .
+<http://example.com/base/e/a> <http://example.com/ns#with> _:nc808fbd2e11a4baa939c61c8210b5909b1 .
+_:nc808fbd2e11a4baa939c61c8210b5909b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "4" .
+_:nc808fbd2e11a4baa939c61c8210b5909b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "7" .
+_:nc808fbd2e11a4baa939c61c8210b5909b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "6" .
+_:nc808fbd2e11a4baa939c61c8210b5909b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "3" .
+_:nc808fbd2e11a4baa939c61c8210b5909b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "8" .
+
+
+

6. RMLTC-CC-0001-List

+

Title: Generate a rdf:List as an object

+

Description: Tests if a rdf:List is generated as an object

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0001-List/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/>.
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+@prefix ex:  <http://example.com/ns#>.
+@base        <http://example.com/>.
+
+<#TM> a rml:TriplesMap;
+    rml:logicalSource [
+        rml:source _:b738439 ;
+        rml:referenceFormulation rml:JSONPath ;
+        rml:iterator "$.*" ;
+    ] ;
+
+    rml:subjectMap [
+        rml:template "e/{$.id}" ;
+    ] ;
+
+    rml:predicateObjectMap [
+        rml:predicate ex:with ;
+        rml:objectMap [
+            rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
+            rml:gatherAs rdf:List ;
+        ] ;
+    ] ;
+.
+
+_:b738439 a rml:RelativePathSource ;
+    rml:path "data.json" .
+
+

Output

+
<http://example.com/base/e/a> <http://example.com/ns#with> _:n988e0f11d19c486fa3b3255f94c9b3bab1 .
+_:n988e0f11d19c486fa3b3255f94c9b3bab1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
+_:n988e0f11d19c486fa3b3255f94c9b3bab1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n988e0f11d19c486fa3b3255f94c9b3bab2 .
+_:n988e0f11d19c486fa3b3255f94c9b3bab2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
+_:n988e0f11d19c486fa3b3255f94c9b3bab2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n988e0f11d19c486fa3b3255f94c9b3bab3 .
+_:n988e0f11d19c486fa3b3255f94c9b3bab3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" .
+_:n988e0f11d19c486fa3b3255f94c9b3bab3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+
+<http://example.com/base/e/b> <http://example.com/ns#with> _:n988e0f11d19c486fa3b3255f94c9b3bab4 .
+_:n988e0f11d19c486fa3b3255f94c9b3bab4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "4" .
+_:n988e0f11d19c486fa3b3255f94c9b3bab4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n988e0f11d19c486fa3b3255f94c9b3bab5 .
+_:n988e0f11d19c486fa3b3255f94c9b3bab5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "5" .
+_:n988e0f11d19c486fa3b3255f94c9b3bab5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n988e0f11d19c486fa3b3255f94c9b3bab6 .
+_:n988e0f11d19c486fa3b3255f94c9b3bab6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "6" .
+_:n988e0f11d19c486fa3b3255f94c9b3bab6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+
+<http://example.com/base/e/c> <http://example.com/ns#with> _:n988e0f11d19c486fa3b3255f94c9b3bab7 .
+_:n988e0f11d19c486fa3b3255f94c9b3bab7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "7" .
+_:n988e0f11d19c486fa3b3255f94c9b3bab7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n988e0f11d19c486fa3b3255f94c9b3bab8 .
+_:n988e0f11d19c486fa3b3255f94c9b3bab8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "8" .
+_:n988e0f11d19c486fa3b3255f94c9b3bab8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n988e0f11d19c486fa3b3255f94c9b3bab9 .
+_:n988e0f11d19c486fa3b3255f94c9b3bab9 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "9" .
+_:n988e0f11d19c486fa3b3255f94c9b3bab9 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+
+
+

7. RMLTC-CC-0001-Seq

+

Title: Generate a rdf:Seq as an object

+

Description: Tests if a rdf:Seq is generated as an object

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0001-Seq/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/>.
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+@prefix ex:  <http://example.com/ns#>.
+@base        <http://example.com/>.
+
+<#TM> a rml:TriplesMap;
+    rml:logicalSource [
+        rml:source _:b738439 ;
+        rml:referenceFormulation rml:JSONPath ;
+        rml:iterator "$.*" ;
+    ] ;
+
+    rml:subjectMap [
+        rml:template "e/{$.id}" ;
+    ] ;
+
+    rml:predicateObjectMap [
+        rml:predicate ex:with ;
+        rml:objectMap [
+            rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
+            rml:gatherAs rdf:Seq ;
+        ] ;
+    ] ;
+.
+
+_:b738439 a rml:RelativePathSource ;
+    rml:path "data.json" .
+
+

Output

+
_:nc808fbd2e11a4baa939c61c8210b5909b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Seq> .
+_:nc808fbd2e11a4baa939c61c8210b5909b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "5" .
+_:nc808fbd2e11a4baa939c61c8210b5909b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Seq> .
+_:nc808fbd2e11a4baa939c61c8210b5909b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Seq> .
+_:nc808fbd2e11a4baa939c61c8210b5909b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "9" .
+_:nc808fbd2e11a4baa939c61c8210b5909b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "2" .
+<http://example.com/base/e/b> <http://example.com/ns#with> _:nc808fbd2e11a4baa939c61c8210b5909b2 .
+_:nc808fbd2e11a4baa939c61c8210b5909b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "1" .
+<http://example.com/base/e/c> <http://example.com/ns#with> _:nc808fbd2e11a4baa939c61c8210b5909b3 .
+<http://example.com/base/e/a> <http://example.com/ns#with> _:nc808fbd2e11a4baa939c61c8210b5909b1 .
+_:nc808fbd2e11a4baa939c61c8210b5909b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "4" .
+_:nc808fbd2e11a4baa939c61c8210b5909b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "7" .
+_:nc808fbd2e11a4baa939c61c8210b5909b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "6" .
+_:nc808fbd2e11a4baa939c61c8210b5909b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "3" .
+_:nc808fbd2e11a4baa939c61c8210b5909b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "8" .
+
+
+

8. RMLTC-CC-0002-Bag

+

Title: Generate a named rdf:Bag as an object

+

Description: Tests if a named rdf:Bag is generated as an object

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0002-Bag/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/>.
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+@prefix ex:  <http://example.com/ns#>.
+@base        <http://example.com/>.
+
+<#TM> a rml:TriplesMap;
+    rml:logicalSource [
+        rml:source _:b738439 ;
+        rml:referenceFormulation rml:JSONPath ;
+        rml:iterator "$.*" ;
+    ] ;
+
+    rml:subjectMap [
+        rml:template "e/{$.id}" ;
+    ] ;
+
+    rml:predicateObjectMap [
+        rml:predicate ex:with ;
+        rml:objectMap [
+            rml:template "c/{$.id}" ;
+            rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
+            rml:gatherAs rdf:Bag ;
+        ] ;
+    ] ;
+.
+
+_:b738439 a rml:RelativePathSource ;
+    rml:path "data.json" .
+
+

Output

+
<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
+<http://example.com/base/c/c> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "7" .
+<http://example.com/base/c/c> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "8" .
+<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "2" .
+<http://example.com/base/e/c> <http://example.com/ns#with> <http://example.com/base/c/c> .
+<http://example.com/base/c/c> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
+<http://example.com/base/c/b> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "6" .
+<http://example.com/base/e/a> <http://example.com/ns#with> <http://example.com/base/c/a> .
+<http://example.com/base/c/c> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "9" .
+<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "1" .
+<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "3" .
+<http://example.com/base/c/b> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "4" .
+<http://example.com/base/e/b> <http://example.com/ns#with> <http://example.com/base/c/b> .
+<http://example.com/base/c/b> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
+<http://example.com/base/c/b> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "5" .
+
+
+

9. RMLTC-CC-0002-List

+

Title: Generate a named rdf:List as an object

+

Description: Tests if a named rdf:List is generated as an object

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0002-List/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/>.
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+@prefix ex:  <http://example.com/ns#>.
+@base        <http://example.com/>.
+
+<#TM> a rml:TriplesMap;
+    rml:logicalSource [
+        rml:source _:b738439 ;
+        rml:referenceFormulation rml:JSONPath ;
+        rml:iterator "$.*" ;
+    ] ;
+
+    rml:subjectMap [
+        rml:template "e/{$.id}" ;
+    ] ;
+
+    rml:predicateObjectMap [
+        rml:predicate ex:with ;
+        rml:objectMap [
+            rml:template "c/{$.id}" ;
+            rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
+            rml:gatherAs rdf:List ;
+        ] ;
+    ] ;
+.
+
+_:b738439 a rml:RelativePathSource ;
+    rml:path "data.json" .
+
+

Output

+
_:nb73dd869d6bb47a5b865ee632fe27453b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nb73dd869d6bb47a5b865ee632fe27453b2 .
+<http://example.com/base/e/c> <http://example.com/ns#with> <http://example.com/base/c/c> .
+<http://example.com/base/c/c> <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "7" .
+_:nb73dd869d6bb47a5b865ee632fe27453b5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "8" .
+_:nb73dd869d6bb47a5b865ee632fe27453b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nb73dd869d6bb47a5b865ee632fe27453b4 .
+_:nb73dd869d6bb47a5b865ee632fe27453b6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+<http://example.com/base/e/a> <http://example.com/ns#with> <http://example.com/base/c/a> .
+_:nb73dd869d6bb47a5b865ee632fe27453b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "5" .
+<http://example.com/base/c/b> <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nb73dd869d6bb47a5b865ee632fe27453b3 .
+_:nb73dd869d6bb47a5b865ee632fe27453b4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "6" .
+_:nb73dd869d6bb47a5b865ee632fe27453b4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+_:nb73dd869d6bb47a5b865ee632fe27453b5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nb73dd869d6bb47a5b865ee632fe27453b6 .
+_:nb73dd869d6bb47a5b865ee632fe27453b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+_:nb73dd869d6bb47a5b865ee632fe27453b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
+_:nb73dd869d6bb47a5b865ee632fe27453b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" .
+<http://example.com/base/c/b> <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "4" .
+<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nb73dd869d6bb47a5b865ee632fe27453b1 .
+<http://example.com/base/c/c> <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nb73dd869d6bb47a5b865ee632fe27453b5 .
+_:nb73dd869d6bb47a5b865ee632fe27453b6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "9" .
+<http://example.com/base/e/b> <http://example.com/ns#with> <http://example.com/base/c/b> .
+<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
+
+
+

10. RMLTC-CC-0003-EB

+

Title: Allow the generation of empty bags

+

Description: Tests if the use of rml:allowTemptyListAndContainer yields an empty bag.

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0003-EB/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/>.
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+@prefix ex:  <http://example.com/ns#>.
+@base        <http://example.com/>.
+
+<#TM> a rml:TriplesMap;
+    rml:logicalSource [
+        rml:source _:b738439 ;
+        rml:referenceFormulation rml:JSONPath ;
+        rml:iterator "$.*" ;
+    ] ;
+
+    rml:subjectMap [
+        rml:template "e/{$.id}" ;
+    ] ;
+
+    rml:predicateObjectMap [
+        rml:predicate ex:with ;
+        rml:objectMap [
+            rml:allowEmptyListAndContainer true ;
+            rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
+            rml:gatherAs rdf:Bag ;
+        ] ;
+    ] ;
+.
+
+_:b738439 a rml:RelativePathSource ;
+    rml:path "data.json" .
+
+

Output

+
_:nfecac3cfe48c4afa99539cc809138e96b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
+<http://example.com/base/e/a> <http://example.com/ns#with> _:nfecac3cfe48c4afa99539cc809138e96b1 .
+_:nfecac3cfe48c4afa99539cc809138e96b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
+_:nfecac3cfe48c4afa99539cc809138e96b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "1" .
+<http://example.com/base/e/b> <http://example.com/ns#with> _:nfecac3cfe48c4afa99539cc809138e96b2 .
+_:nfecac3cfe48c4afa99539cc809138e96b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "2" .
+_:nfecac3cfe48c4afa99539cc809138e96b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "3" .
+
+
+

11. RMLTC-CC-0003-EL

+

Title: Allow the generation of empty lists

+

Description: Tests if the use of rml:allowTemptyListAndContainer yields an empty list.

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0003-EL/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/>.
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+@prefix ex:  <http://example.com/ns#>.
+@base        <http://example.com/>.
+
+<#TM> a rml:TriplesMap;
+    rml:logicalSource [
+        rml:source _:b738439 ;
+        rml:referenceFormulation rml:JSONPath ;
+        rml:iterator "$.*" ;
+    ] ;
+
+    rml:subjectMap [
+        rml:template "e/{$.id}" ;
+    ] ;
+
+    rml:predicateObjectMap [
+        rml:predicate ex:with ;
+        rml:objectMap [
+            rml:allowEmptyListAndContainer true ;
+            rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
+            rml:gatherAs rdf:List ;
+        ] ;
+    ] ;
+.
+
+_:b738439 a rml:RelativePathSource ;
+    rml:path "data.json" .
+
+

Output

+
_:n302eecc856b44ed5b76965d9be2f5213b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+<http://example.com/base/e/b> <http://example.com/ns#with> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+_:n302eecc856b44ed5b76965d9be2f5213b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n302eecc856b44ed5b76965d9be2f5213b3 .
+_:n302eecc856b44ed5b76965d9be2f5213b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
+_:n302eecc856b44ed5b76965d9be2f5213b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" .
+_:n302eecc856b44ed5b76965d9be2f5213b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n302eecc856b44ed5b76965d9be2f5213b2 .
+<http://example.com/base/e/a> <http://example.com/ns#with> _:n302eecc856b44ed5b76965d9be2f5213b1 .
+_:n302eecc856b44ed5b76965d9be2f5213b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
+
+
+

12. RMLTC-CC-0003-NEB

+

Title: Empty bags are not generated

+

Description: Tests if empty containers are not generated (expected default behavior).

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0003-NEB/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/>.
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+@prefix ex:  <http://example.com/ns#>.
+@base        <http://example.com/>.
+
+<#TM> a rml:TriplesMap;
+    rml:logicalSource [
+        rml:source _:b738439 ;
+        rml:referenceFormulation rml:JSONPath ;
+        rml:iterator "$.*" ;
+    ] ;
+
+    rml:subjectMap [
+        rml:template "e/{$.id}" ;
+    ] ;
+
+    rml:predicateObjectMap [
+        rml:predicate ex:with ;
+        rml:objectMap [
+            rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
+            rml:gatherAs rdf:Bag ;
+        ] ;
+    ] ;
+.
+
+_:b738439 a rml:RelativePathSource ;
+    rml:path "data.json" .
+
+

Output

+
<http://example.com/base/e/a> <http://example.com/ns#with> _:n2bd72de9c571444081890e41009d92d4b1 .
+_:n2bd72de9c571444081890e41009d92d4b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "3" .
+_:n2bd72de9c571444081890e41009d92d4b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
+_:n2bd72de9c571444081890e41009d92d4b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "2" .
+_:n2bd72de9c571444081890e41009d92d4b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "1" .
+
+
+

13. RMLTC-CC-0003-NEL

+

Title: Empty lists are not generated

+

Description: Tests if empty lists are not generated (expected default behavior).

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0003-NEL/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/>.
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+@prefix ex:  <http://example.com/ns#>.
+@base        <http://example.com/>.
+
+<#TM> a rml:TriplesMap;
+    rml:logicalSource [
+        rml:source _:b738439 ;
+        rml:referenceFormulation rml:JSONPath ;
+        rml:iterator "$.*" ;
+    ] ;
+
+    rml:subjectMap [
+        rml:template "e/{$.id}" ;
+    ] ;
+
+    rml:predicateObjectMap [
+        rml:predicate ex:with ;
+        rml:objectMap [
+            rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
+            rml:gatherAs rdf:List ;
+        ] ;
+    ] ;
+.
+
+_:b738439 a rml:RelativePathSource ;
+    rml:path "data.json" .
+
+

Output

+
_:n434c2c54e09e4a259604ba1188ce038fb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n434c2c54e09e4a259604ba1188ce038fb2 .
+_:n434c2c54e09e4a259604ba1188ce038fb3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+_:n434c2c54e09e4a259604ba1188ce038fb2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
+<http://example.com/base/e/a> <http://example.com/ns#with> _:n434c2c54e09e4a259604ba1188ce038fb1 .
+_:n434c2c54e09e4a259604ba1188ce038fb2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n434c2c54e09e4a259604ba1188ce038fb3 .
+_:n434c2c54e09e4a259604ba1188ce038fb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
+_:n434c2c54e09e4a259604ba1188ce038fb3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" .
+
+
+

14. RMLTC-CC-0003-NELb

+

Title: Empty lists are not generated II

+

Description: Tests if empty lists are not generated (expected default behavior). This test cases uses the predicate rml:allowEmptyListAndContainer.

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0003-NELb/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/>.
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+@prefix ex:  <http://example.com/ns#>.
+@base        <http://example.com/>.
+
+<#TM> a rml:TriplesMap;
+    rml:logicalSource [
+        rml:source _:b738439 ;
+        rml:referenceFormulation rml:JSONPath ;
+        rml:iterator "$.*" ;
+    ] ;
+
+    rml:subjectMap [
+        rml:template "e/{$.id}" ;
+    ] ;
+
+    rml:predicateObjectMap [
+        rml:predicate ex:with ;
+        rml:objectMap [
+            rml:allowEmptyListAndContainer false ;
+            rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
+            rml:gatherAs rdf:List ;
+        ] ;
+    ] ;
+.
+
+_:b738439 a rml:RelativePathSource ;
+    rml:path "data.json" .
+
+

Output

+
_:n434c2c54e09e4a259604ba1188ce038fb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n434c2c54e09e4a259604ba1188ce038fb2 .
+_:n434c2c54e09e4a259604ba1188ce038fb3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+_:n434c2c54e09e4a259604ba1188ce038fb2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
+<http://example.com/base/e/a> <http://example.com/ns#with> _:n434c2c54e09e4a259604ba1188ce038fb1 .
+_:n434c2c54e09e4a259604ba1188ce038fb2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n434c2c54e09e4a259604ba1188ce038fb3 .
+_:n434c2c54e09e4a259604ba1188ce038fb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
+_:n434c2c54e09e4a259604ba1188ce038fb3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" .
+
+
+

15. RMLTC-CC-0004-SM1

+

Title: GatherMap in subject map (list)

+

Description: Tests if the use of a gather map in the subject map is supported. This test generates a list.

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0004-SM1/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/>.
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+@prefix ex:  <http://example.com/ns#>.
+@base        <http://example.com/>.
+
+<#TM> a rml:TriplesMap;
+    rml:logicalSource [
+        rml:source _:b738439 ;
+        rml:referenceFormulation rml:JSONPath ;
+        rml:iterator "$.*" ;
+    ] ;
+
+    rml:subjectMap [
+        rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
+        rml:gatherAs rdf:List ;
+    ] ;
+
+    rml:predicateObjectMap [
+        rml:predicate ex:createdBy ;
+        rml:object ex:JohnDoe ;
+    ] ;
+.
+
+_:b738439 a rml:RelativePathSource ;
+    rml:path "data.json" .
+
+

Output

+
_:n302eecc856b44ed5b76965d9be2f5213b1 <http://example.com/ns#createdBy> <http://example.com/ns#JohnDoe> .
+_:n302eecc856b44ed5b76965d9be2f5213b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
+_:n302eecc856b44ed5b76965d9be2f5213b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n302eecc856b44ed5b76965d9be2f5213b2 .
+_:n302eecc856b44ed5b76965d9be2f5213b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
+_:n302eecc856b44ed5b76965d9be2f5213b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n302eecc856b44ed5b76965d9be2f5213b3 .
+_:n302eecc856b44ed5b76965d9be2f5213b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" .
+_:n302eecc856b44ed5b76965d9be2f5213b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+_:n1d393f12e993411498da676131f81ca4b1 <http://example.com/ns#createdBy> <http://example.com/ns#JohnDoe> .
+_:n1d393f12e993411498da676131f81ca4b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "4" .
+_:n1d393f12e993411498da676131f81ca4b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n1d393f12e993411498da676131f81ca4b2 .
+_:n1d393f12e993411498da676131f81ca4b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "5" .
+_:n1d393f12e993411498da676131f81ca4b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n1d393f12e993411498da676131f81ca4b3 .
+_:n1d393f12e993411498da676131f81ca4b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "6" .
+_:n1d393f12e993411498da676131f81ca4b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+
+
+

16. RMLTC-CC-0004-SM2

+

Title: GatherMap in subject map (list)

+

Description: Tests if the use of a gather map in the subject map is supported. This test has no predicate-object maps and no class declarations in the subject map. It still needs to generate triples as the lists consists of at least one cons-pair.

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0004-SM2/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/>.
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+@prefix ex:  <http://example.com/ns#>.
+@base        <http://example.com/>.
+
+<#TM> a rml:TriplesMap;
+    rml:logicalSource [
+        rml:source _:b738439 ;
+        rml:referenceFormulation rml:JSONPath ;
+        rml:iterator "$.*" ;
+    ] ;
+
+    rml:subjectMap [
+        rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
+        rml:gatherAs rdf:List ;
+    ] ;
+.
+
+_:b738439 a rml:RelativePathSource ;
+    rml:path "data.json" .
+
+

Output

+
_:n302eecc856b44ed5b76965d9be2f5213b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
+_:n302eecc856b44ed5b76965d9be2f5213b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n302eecc856b44ed5b76965d9be2f5213b2 .
+_:n302eecc856b44ed5b76965d9be2f5213b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
+_:n302eecc856b44ed5b76965d9be2f5213b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n302eecc856b44ed5b76965d9be2f5213b3 .
+_:n302eecc856b44ed5b76965d9be2f5213b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" .
+_:n302eecc856b44ed5b76965d9be2f5213b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+_:n1d393f12e993411498da676131f81ca4b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "4" .
+_:n1d393f12e993411498da676131f81ca4b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n1d393f12e993411498da676131f81ca4b2 .
+_:n1d393f12e993411498da676131f81ca4b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "5" .
+_:n1d393f12e993411498da676131f81ca4b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n1d393f12e993411498da676131f81ca4b3 .
+_:n1d393f12e993411498da676131f81ca4b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "6" .
+_:n1d393f12e993411498da676131f81ca4b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+
+
+

17. RMLTC-CC-0004-SM3

+

Title: GatherMap in subject map (list)

+

Description: Tests if the use of a gather map in the subject map is supported. This test has no predicate-object maps and no class declarations in the subject map. Only one list needs to be generated as the other has no values and we only retain non-empty lists.

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0004-SM3/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/>.
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+@prefix ex:  <http://example.com/ns#>.
+@base        <http://example.com/>.
+
+<#TM> a rml:TriplesMap;
+    rml:logicalSource [
+        rml:source _:b738439 ;
+        rml:referenceFormulation rml:JSONPath ;
+        rml:iterator "$.*" ;
+    ] ;
+
+    rml:subjectMap [
+        rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
+        rml:gatherAs rdf:List ;
+    ] ;
+.
+
+_:b738439 a rml:RelativePathSource ;
+    rml:path "data.json" .
+
+

Output

+
_:n648f8cf4c58149e8a0feea26fb2a5b5bb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
+_:n648f8cf4c58149e8a0feea26fb2a5b5bb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n648f8cf4c58149e8a0feea26fb2a5b5bb2 .
+_:n648f8cf4c58149e8a0feea26fb2a5b5bb3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" .
+_:n648f8cf4c58149e8a0feea26fb2a5b5bb2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n648f8cf4c58149e8a0feea26fb2a5b5bb3 .
+_:n648f8cf4c58149e8a0feea26fb2a5b5bb2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
+_:n648f8cf4c58149e8a0feea26fb2a5b5bb3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+
+
+

18. RMLTC-CC-0004-SM4

+

Title: GatherMap in subject map (bag)

+

Description: Tests if the use of a gather map in the subject map is supported. This test generates a bag.

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0004-SM4/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/>.
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+@prefix ex:  <http://example.com/ns#>.
+@base        <http://example.com/>.
+
+<#TM> a rml:TriplesMap;
+    rml:logicalSource [
+        rml:source _:b738439 ;
+        rml:referenceFormulation rml:JSONPath ;
+        rml:iterator "$.*" ;
+    ] ;
+
+    rml:subjectMap [
+        rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
+        rml:gatherAs rdf:Bag ;
+    ] ;
+
+    rml:predicateObjectMap [
+        rml:predicate ex:createdBy ;
+        rml:object ex:JohnDoe ;
+    ] ;
+.
+
+_:b738439 a rml:RelativePathSource ;
+    rml:path "data.json" .
+
+

Output

+
_:n1d393f12e993411498da676131f81ca4b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "2" .
+_:n1d393f12e993411498da676131f81ca4b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "5" .
+_:n1d393f12e993411498da676131f81ca4b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "1" .
+_:n1d393f12e993411498da676131f81ca4b2 <http://example.com/ns#createdBy> <http://example.com/ns#JohnDoe> .
+_:n1d393f12e993411498da676131f81ca4b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
+_:n1d393f12e993411498da676131f81ca4b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "3" .
+_:n1d393f12e993411498da676131f81ca4b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "4" .
+_:n1d393f12e993411498da676131f81ca4b1 <http://example.com/ns#createdBy> <http://example.com/ns#JohnDoe> .
+_:n1d393f12e993411498da676131f81ca4b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
+_:n1d393f12e993411498da676131f81ca4b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "6" .
+
+
+

19. RMLTC-CC-0004-SM5

+

Title: GatherMap in subject map (bag)

+

Description: Tests if the use of a gather map in the subject map is supported. This test has no predicate-object maps and no class declarations in the subject map. It should generate a non-empty bag and an empty bag. The reason being that a container has at least one triple ; it's type (bag, seq, or alt).

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0004-SM5/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/>.
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+@prefix ex:  <http://example.com/ns#>.
+@base        <http://example.com/>.
+
+<#TM> a rml:TriplesMap;
+    rml:logicalSource [
+        rml:source _:b738439 ;
+        rml:referenceFormulation rml:JSONPath ;
+        rml:iterator "$.*" ;
+    ] ;
+
+    rml:subjectMap [
+        rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
+        rml:gatherAs rdf:Bag ;
+    ] ;
+.
+
+_:b738439 a rml:RelativePathSource ;
+    rml:path "data.json" .
+
+

Output

+
_:ne32066984b71404a953025d001cd3cdfb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
+_:ne32066984b71404a953025d001cd3cdfb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "2" .
+_:ne32066984b71404a953025d001cd3cdfb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "1" .
+_:ne32066984b71404a953025d001cd3cdfb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "3" .
+
+
+

20. RMLTC-CC-0005-App1

+

Title: Append values of multiple term maps

+

Description: Tests appending of values from multiple term maps in an gather map. This test covers the case where all sets of values are non-empty.

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0005-App1/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/>.
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+@prefix ex:  <http://example.com/ns#>.
+@base        <http://example.com/>.
+
+<#TM> a rml:TriplesMap;
+    rml:logicalSource [
+        rml:source _:b738439 ;
+        rml:referenceFormulation rml:JSONPath ;
+        rml:iterator "$.*" ;
+    ] ;
+
+    rml:subjectMap [
+        rml:template "e/{$.id}" ;
+    ] ;
+
+    rml:predicateObjectMap [
+        rml:predicate ex:with ;
+        rml:objectMap [
+            rml:gather ( [ rml:reference "$.v1.*" ; ] [ rml:reference "$.v2.*" ; ] ) ;
+            rml:gatherAs rdf:List ;
+        ] ;
+    ] ;
+.
+
+_:b738439 a rml:RelativePathSource ;
+    rml:path "data.json" .
+
+

Output

+
<http://example.com/base/e/a> <http://example.com/ns#with> _:n1ee4a5a2b1344422919d171ab2cd6c39b1 .
+_:n1ee4a5a2b1344422919d171ab2cd6c39b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
+_:n1ee4a5a2b1344422919d171ab2cd6c39b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n1ee4a5a2b1344422919d171ab2cd6c39b2 .
+_:n1ee4a5a2b1344422919d171ab2cd6c39b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
+_:n1ee4a5a2b1344422919d171ab2cd6c39b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n1ee4a5a2b1344422919d171ab2cd6c39b4 .
+_:n1ee4a5a2b1344422919d171ab2cd6c39b4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "a" .
+_:n1ee4a5a2b1344422919d171ab2cd6c39b4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n1ee4a5a2b1344422919d171ab2cd6c39b5 .
+_:n1ee4a5a2b1344422919d171ab2cd6c39b5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "b" .
+_:n1ee4a5a2b1344422919d171ab2cd6c39b5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+<http://example.com/base/e/b> <http://example.com/ns#with> _:n1ee4a5a2b1344422919d171ab2cd6c39b6 .
+_:n1ee4a5a2b1344422919d171ab2cd6c39b6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" .
+_:n1ee4a5a2b1344422919d171ab2cd6c39b6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n1ee4a5a2b1344422919d171ab2cd6c39b7 .
+_:n1ee4a5a2b1344422919d171ab2cd6c39b7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "4" .
+_:n1ee4a5a2b1344422919d171ab2cd6c39b7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n1ee4a5a2b1344422919d171ab2cd6c39b8 .
+_:n1ee4a5a2b1344422919d171ab2cd6c39b8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "c" .
+_:n1ee4a5a2b1344422919d171ab2cd6c39b8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+
+
+

21. RMLTC-CC-0005-App2

+

Title: Append values of multiple term maps

+

Description: Tests appending of values from multiple term maps in an iteration. In this example, one of the arrays is empty and the expected behavior is to concatinate a list with the empty list.

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0005-App2/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/>.
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+@prefix ex:  <http://example.com/ns#>.
+@base        <http://example.com/>.
+
+<#TM> a rml:TriplesMap;
+    rml:logicalSource [
+        rml:source _:b738439 ;
+        rml:referenceFormulation rml:JSONPath ;
+        rml:iterator "$.*" ;
+    ] ;
+
+    rml:subjectMap [
+        rml:template "e/{$.id}" ;
+    ] ;
+
+    rml:predicateObjectMap [
+        rml:predicate ex:with ;
+        rml:objectMap [
+            rml:gather ( [ rml:reference "$.v1.*" ; ] [ rml:reference "$.v2.*" ; ] ) ;
+            rml:gatherAs rdf:List ;
+        ] ;
+    ] ;
+.
+
+_:b738439 a rml:RelativePathSource ;
+    rml:path "data.json" .
+
+

Output

+
_:n1d9b8ef217cb44f299a062d746116deab1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n1d9b8ef217cb44f299a062d746116deab2 .
+_:n1d9b8ef217cb44f299a062d746116deab5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "b" .
+_:n1d9b8ef217cb44f299a062d746116deab4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n1d9b8ef217cb44f299a062d746116deab5 .
+_:n1d9b8ef217cb44f299a062d746116deab3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n1d9b8ef217cb44f299a062d746116deab4 .
+_:n1d9b8ef217cb44f299a062d746116deab7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "5" .
+_:n1d9b8ef217cb44f299a062d746116deab2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
+_:n1d9b8ef217cb44f299a062d746116deab8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "6" .
+_:n1d9b8ef217cb44f299a062d746116deab8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+_:n1d9b8ef217cb44f299a062d746116deab3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" .
+_:n1d9b8ef217cb44f299a062d746116deab4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "a" .
+_:n1d9b8ef217cb44f299a062d746116deab5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+_:n1d9b8ef217cb44f299a062d746116deab2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n1d9b8ef217cb44f299a062d746116deab3 .
+_:n1d9b8ef217cb44f299a062d746116deab1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
+<http://example.com/base/e/a> <http://example.com/ns#with> _:n1d9b8ef217cb44f299a062d746116deab1 .
+<http://example.com/base/e/b> <http://example.com/ns#with> _:n1d9b8ef217cb44f299a062d746116deab6 .
+_:n1d9b8ef217cb44f299a062d746116deab7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n1d9b8ef217cb44f299a062d746116deab8 .
+_:n1d9b8ef217cb44f299a062d746116deab6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n1d9b8ef217cb44f299a062d746116deab7 .
+_:n1d9b8ef217cb44f299a062d746116deab6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "4" .
+
+
+

22. RMLTC-CC-0005-Car1

+

Title: Cartesian product of values from multiple term maps of a gather map.

+

Description: Tests generating the Cartesian product of values from multiple term maps in a gather map. This test covers the case where all sets of values are non-empty.

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0005-Car1/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/>.
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+@prefix ex:  <http://example.com/ns#>.
+@base        <http://example.com/>.
+
+<#TM> a rml:TriplesMap;
+    rml:logicalSource [
+        rml:source _:b738439 ;
+        rml:referenceFormulation rml:JSONPath ;
+        rml:iterator "$.*" ;
+    ] ;
+
+    rml:subjectMap [
+        rml:template "e/{$.id}" ;
+    ] ;
+
+    rml:predicateObjectMap [
+        rml:predicate ex:with ;
+        rml:objectMap [
+            rml:gather ( [ rml:reference "$.v1.*" ; ] [ rml:reference "$.v2.*" ; ] ) ;
+            rml:gatherAs rdf:List ;
+            rml:strategy rml:cartesianProduct ;
+        ] ;
+    ] ;
+.
+
+_:b738439 a rml:RelativePathSource ;
+    rml:path "data.json" .
+
+

Output

+
<http://example.com/base/e/a> <http://example.com/ns#with> _:nfc398e5692654ca98dfb3fb5432d277cb1 .
+_:nfc398e5692654ca98dfb3fb5432d277cb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
+_:nfc398e5692654ca98dfb3fb5432d277cb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nfc398e5692654ca98dfb3fb5432d277cb2 .
+_:nfc398e5692654ca98dfb3fb5432d277cb2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+_:nfc398e5692654ca98dfb3fb5432d277cb2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "a" .
+
+<http://example.com/base/e/a> <http://example.com/ns#with> _:nfc398e5692654ca98dfb3fb5432d277cb3 .
+_:nfc398e5692654ca98dfb3fb5432d277cb3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
+_:nfc398e5692654ca98dfb3fb5432d277cb3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nfc398e5692654ca98dfb3fb5432d277cb4 .
+_:nfc398e5692654ca98dfb3fb5432d277cb4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "b" .
+_:nfc398e5692654ca98dfb3fb5432d277cb4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+
+<http://example.com/base/e/a> <http://example.com/ns#with> _:nfc398e5692654ca98dfb3fb5432d277cb5 .
+_:nfc398e5692654ca98dfb3fb5432d277cb5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
+_:nfc398e5692654ca98dfb3fb5432d277cb5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nfc398e5692654ca98dfb3fb5432d277cb6 .
+_:nfc398e5692654ca98dfb3fb5432d277cb6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "a" .
+_:nfc398e5692654ca98dfb3fb5432d277cb6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+
+<http://example.com/base/e/a> <http://example.com/ns#with> _:nfc398e5692654ca98dfb3fb5432d277cb7 .
+_:nfc398e5692654ca98dfb3fb5432d277cb7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
+_:nfc398e5692654ca98dfb3fb5432d277cb7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nfc398e5692654ca98dfb3fb5432d277cb8 .
+_:nfc398e5692654ca98dfb3fb5432d277cb8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "b" .
+_:nfc398e5692654ca98dfb3fb5432d277cb8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+
+<http://example.com/base/e/b> <http://example.com/ns#with> _:nfc398e5692654ca98dfb3fb5432d277cb9 .
+_:nfc398e5692654ca98dfb3fb5432d277cb9 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" .
+_:nfc398e5692654ca98dfb3fb5432d277cb9 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nfc398e5692654ca98dfb3fb5432d277cb10 .
+_:nfc398e5692654ca98dfb3fb5432d277cb10 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "c" .
+_:nfc398e5692654ca98dfb3fb5432d277cb10 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+
+<http://example.com/base/e/b> <http://example.com/ns#with> _:nfc398e5692654ca98dfb3fb5432d277cb11 .
+_:nfc398e5692654ca98dfb3fb5432d277cb11 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "4" .
+_:nfc398e5692654ca98dfb3fb5432d277cb11 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nfc398e5692654ca98dfb3fb5432d277cb12 .
+_:nfc398e5692654ca98dfb3fb5432d277cb12 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "c" .
+_:nfc398e5692654ca98dfb3fb5432d277cb12 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+
+
+

23. RMLTC-CC-0005-Car2

+

Title: Cartesian product of values from multiple term maps of a gather map.

+

Description: Tests generating the Cartesian product of values from multiple term maps in a gather map. This test covers the case where one of the sets is empty. The Cartesian product of a set with an empty set is empty. This entry should thus not yield a list.

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0005-Car2/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/>.
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+@prefix ex:  <http://example.com/ns#>.
+@base        <http://example.com/>.
+
+<#TM> a rml:TriplesMap;
+    rml:logicalSource [
+        rml:source _:b738439 ;
+        rml:referenceFormulation rml:JSONPath ;
+        rml:iterator "$.*" ;
+    ] ;
+
+    rml:subjectMap [
+        rml:template "e/{$.id}" ;
+    ] ;
+
+    rml:predicateObjectMap [
+        rml:predicate ex:with ;
+        rml:objectMap [
+            rml:gather ( [ rml:reference "$.v1.*" ; ] [ rml:reference "$.v2.*" ; ] ) ;
+            rml:gatherAs rdf:List ;
+            rml:strategy rml:cartesianProduct ;
+        ] ;
+    ] ;
+.
+
+_:b738439 a rml:RelativePathSource ;
+    rml:path "data.json" .
+
+

Output

+
<http://example.com/base/e/a> <http://example.com/ns#with> _:nfc398e5692654ca98dfb3fb5432d277cb1 .
+_:nfc398e5692654ca98dfb3fb5432d277cb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
+_:nfc398e5692654ca98dfb3fb5432d277cb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nfc398e5692654ca98dfb3fb5432d277cb2 .
+_:nfc398e5692654ca98dfb3fb5432d277cb2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+_:nfc398e5692654ca98dfb3fb5432d277cb2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "a" .
+
+<http://example.com/base/e/a> <http://example.com/ns#with> _:nfc398e5692654ca98dfb3fb5432d277cb3 .
+_:nfc398e5692654ca98dfb3fb5432d277cb3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
+_:nfc398e5692654ca98dfb3fb5432d277cb3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nfc398e5692654ca98dfb3fb5432d277cb4 .
+_:nfc398e5692654ca98dfb3fb5432d277cb4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "b" .
+_:nfc398e5692654ca98dfb3fb5432d277cb4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+
+<http://example.com/base/e/a> <http://example.com/ns#with> _:nfc398e5692654ca98dfb3fb5432d277cb5 .
+_:nfc398e5692654ca98dfb3fb5432d277cb5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
+_:nfc398e5692654ca98dfb3fb5432d277cb5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nfc398e5692654ca98dfb3fb5432d277cb6 .
+_:nfc398e5692654ca98dfb3fb5432d277cb6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "a" .
+_:nfc398e5692654ca98dfb3fb5432d277cb6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+
+<http://example.com/base/e/a> <http://example.com/ns#with> _:nfc398e5692654ca98dfb3fb5432d277cb7 .
+_:nfc398e5692654ca98dfb3fb5432d277cb7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
+_:nfc398e5692654ca98dfb3fb5432d277cb7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nfc398e5692654ca98dfb3fb5432d277cb8 .
+_:nfc398e5692654ca98dfb3fb5432d277cb8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "b" .
+_:nfc398e5692654ca98dfb3fb5432d277cb8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+
+
+

24. RMLTC-CC-0006-IT0

+

Title: Gather values accross iterations.

+

Description: When no template, constant, or reference is given to a gather map, then each iteration yields a different collection or container.

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0006-IT0/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/>.
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+@prefix ex:  <http://example.com/ns#>.
+@base        <http://example.com/>.
+
+<#TM> a rml:TriplesMap;
+    rml:logicalSource [
+        rml:source _:b738439 ;
+        rml:referenceFormulation rml:JSONPath ;
+        rml:iterator "$.*" ;
+    ] ;
+
+    rml:subjectMap [
+        rml:template "e/{$.id}" ;
+    ] ;
+
+    rml:predicateObjectMap [
+        rml:predicate ex:with ;
+        rml:objectMap [
+            rml:gather ( [ rml:reference "$.v1.*" ; ] ) ;
+            rml:gatherAs rdf:List ;
+        ] ;
+    ] ;
+.
+
+_:b738439 a rml:RelativePathSource ;
+    rml:path "data.json" .
+
+

Output

+
<http://example.com/base/e/a> <http://example.com/ns#with> _:n9d785cd672d3484cb5d9fd831e6dfc07b1 .
+_:n9d785cd672d3484cb5d9fd831e6dfc07b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
+_:n9d785cd672d3484cb5d9fd831e6dfc07b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n9d785cd672d3484cb5d9fd831e6dfc07b2 .
+_:n9d785cd672d3484cb5d9fd831e6dfc07b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
+_:n9d785cd672d3484cb5d9fd831e6dfc07b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+
+<http://example.com/base/e/b> <http://example.com/ns#with> _:n9d785cd672d3484cb5d9fd831e6dfc07b5 .
+_:n9d785cd672d3484cb5d9fd831e6dfc07b5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" .
+_:n9d785cd672d3484cb5d9fd831e6dfc07b5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n9d785cd672d3484cb5d9fd831e6dfc07b6 .
+_:n9d785cd672d3484cb5d9fd831e6dfc07b6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "4" .
+_:n9d785cd672d3484cb5d9fd831e6dfc07b6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+
+<http://example.com/base/e/a> <http://example.com/ns#with> _:n9d785cd672d3484cb5d9fd831e6dfc07b3 .
+_:n9d785cd672d3484cb5d9fd831e6dfc07b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "5" .
+_:n9d785cd672d3484cb5d9fd831e6dfc07b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n9d785cd672d3484cb5d9fd831e6dfc07b4 .
+_:n9d785cd672d3484cb5d9fd831e6dfc07b4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "6" .
+_:n9d785cd672d3484cb5d9fd831e6dfc07b4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+
+
+

25. RMLTC-CC-0006-IT1

+

Title: Gather values accross iterations.

+

Description: When using a template, constant, or reference for a gather map, this tests determines whether the values are correctly appended to the list. The natural order of the term maps inside the gather map as well as the iteration are respected. This test covers one term map in the gather map.

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0006-IT1/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/>.
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+@prefix ex:  <http://example.com/ns#>.
+@base        <http://example.com/>.
+
+<#TM> a rml:TriplesMap;
+    rml:logicalSource [
+        rml:source _:b738439 ;
+        rml:referenceFormulation rml:JSONPath ;
+        rml:iterator "$.*" ;
+    ] ;
+
+    rml:subjectMap [
+        rml:template "e/{$.id}" ;
+    ] ;
+
+    rml:predicateObjectMap [
+        rml:predicate ex:with ;
+        rml:objectMap [
+            rml:template "c/{$.id}" ;
+            rml:gather ( [ rml:reference "$.v1.*" ; ] ) ;
+            rml:gatherAs rdf:List ;
+        ] ;
+    ] ;
+.
+
+_:b738439 a rml:RelativePathSource ;
+    rml:path "data.json" .
+
+

Output

+
<http://example.com/base/e/a> <http://example.com/ns#with> <http://example.com/base/c/a> .
+<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
+<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nab8f496caee443c5ac19ce3a109f4b22b1 .
+_:nab8f496caee443c5ac19ce3a109f4b22b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
+_:nab8f496caee443c5ac19ce3a109f4b22b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nab8f496caee443c5ac19ce3a109f4b22b2 .
+_:nab8f496caee443c5ac19ce3a109f4b22b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "5" .
+_:nab8f496caee443c5ac19ce3a109f4b22b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nab8f496caee443c5ac19ce3a109f4b22b3 .
+_:nab8f496caee443c5ac19ce3a109f4b22b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "6" .
+_:nab8f496caee443c5ac19ce3a109f4b22b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+
+<http://example.com/base/e/b> <http://example.com/ns#with> <http://example.com/base/c/b> .
+<http://example.com/base/c/b> <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" .
+<http://example.com/base/c/b> <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nab8f496caee443c5ac19ce3a109f4b22b4 .
+_:nab8f496caee443c5ac19ce3a109f4b22b4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "4" .
+_:nab8f496caee443c5ac19ce3a109f4b22b4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+
+
+

26. RMLTC-CC-0006-IT2

+

Title: Gather values accross iterations.

+

Description: When using a template, constant, or reference for a gather map, this tests determines whether the values are correctly appended to the list. The natural order of the term maps inside the gather map as well as the iteration are respected. This test covers two term maps in the gather map.

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0006-IT2/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/>.
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+@prefix ex:  <http://example.com/ns#>.
+@base        <http://example.com/>.
+
+<#TM> a rml:TriplesMap;
+    rml:logicalSource [
+        rml:source _:b738439 ;
+        rml:referenceFormulation rml:JSONPath ;
+        rml:iterator "$.*" ;
+    ] ;
+
+    rml:subjectMap [
+        rml:template "e/{$.id}" ;
+    ] ;
+
+    rml:predicateObjectMap [
+        rml:predicate ex:with ;
+        rml:objectMap [
+            rml:template "c/{$.id}" ;
+            rml:gather ( [ rml:reference "$.v1.*" ; ] [ rml:reference "$.v2.*" ; ] ) ;
+            rml:gatherAs rdf:List ;
+        ] ;
+    ] ;
+.
+
+_:b738439 a rml:RelativePathSource ;
+    rml:path "data.json" .
+
+

Output

+
<http://example.com/base/e/a> <http://example.com/ns#with> <http://example.com/base/c/a> .
+<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
+<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n0cbb21ce98464358963007f95dc35c0ab1 .
+_:n0cbb21ce98464358963007f95dc35c0ab1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
+_:n0cbb21ce98464358963007f95dc35c0ab1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n0cbb21ce98464358963007f95dc35c0ab2 .
+_:n0cbb21ce98464358963007f95dc35c0ab2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "a" .
+_:n0cbb21ce98464358963007f95dc35c0ab2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n0cbb21ce98464358963007f95dc35c0ab3 .
+_:n0cbb21ce98464358963007f95dc35c0ab3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "b" .
+_:n0cbb21ce98464358963007f95dc35c0ab3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n0cbb21ce98464358963007f95dc35c0ab4 .
+_:n0cbb21ce98464358963007f95dc35c0ab4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "5" .
+_:n0cbb21ce98464358963007f95dc35c0ab4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n0cbb21ce98464358963007f95dc35c0ab5 .
+_:n0cbb21ce98464358963007f95dc35c0ab5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "6" .
+_:n0cbb21ce98464358963007f95dc35c0ab5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n0cbb21ce98464358963007f95dc35c0ab6 .
+_:n0cbb21ce98464358963007f95dc35c0ab6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "d" .
+_:n0cbb21ce98464358963007f95dc35c0ab6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n0cbb21ce98464358963007f95dc35c0ab7 .
+_:n0cbb21ce98464358963007f95dc35c0ab7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "e" .
+_:n0cbb21ce98464358963007f95dc35c0ab7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+
+<http://example.com/base/e/b> <http://example.com/ns#with> <http://example.com/base/c/b> .
+<http://example.com/base/c/b> <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" .
+<http://example.com/base/c/b> <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n0cbb21ce98464358963007f95dc35c0ab8 .
+_:n0cbb21ce98464358963007f95dc35c0ab8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "4" .
+_:n0cbb21ce98464358963007f95dc35c0ab8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n0cbb21ce98464358963007f95dc35c0ab9 .
+_:n0cbb21ce98464358963007f95dc35c0ab9 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "c" .
+_:n0cbb21ce98464358963007f95dc35c0ab9 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+
+
+

27. RMLTC-CC-0007-NES

+

Title: Nested gather maps

+

Description: Testing whether nested gather maps are created. The mapping should generate a list of bags.

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0007-NES/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/>.
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+@prefix ex:  <http://example.com/ns#>.
+@base        <http://example.com/>.
+
+<#TM> a rml:TriplesMap;
+    rml:logicalSource [
+        rml:source _:b738439 ;
+        rml:referenceFormulation rml:JSONPath ;
+        rml:iterator "$.*" ;
+    ] ;
+
+    rml:subjectMap [
+        rml:template "e/{$.id}" ;
+    ] ;
+
+    rml:predicateObjectMap [
+        rml:predicate ex:with ;
+        rml:objectMap [
+            rml:gather (
+                [
+                    rml:gather ( [ rml:reference "$.v1.*" ; ] ) ;
+                    rml:gatherAs rdf:Bag ;
+                ]
+                [
+                    rml:gather ( [ rml:reference "$.v2.*" ; ] ) ;
+                    rml:gatherAs rdf:Bag ;
+                ]
+            ) ;
+            rml:gatherAs rdf:List ;
+        ] ;
+    ] ;
+.
+
+_:b738439 a rml:RelativePathSource ;
+    rml:path "data.json" .
+
+

Output

+
_:nab9af1206e584ab2afd457e8a605872cb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
+_:nab9af1206e584ab2afd457e8a605872cb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "1" .
+_:nab9af1206e584ab2afd457e8a605872cb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "2" .
+
+_:nab9af1206e584ab2afd457e8a605872cb2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
+_:nab9af1206e584ab2afd457e8a605872cb2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "a" .
+_:nab9af1206e584ab2afd457e8a605872cb2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "b" .
+
+_:nab9af1206e584ab2afd457e8a605872cb5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
+_:nab9af1206e584ab2afd457e8a605872cb5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "3" .
+_:nab9af1206e584ab2afd457e8a605872cb5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "4" .
+
+_:nab9af1206e584ab2afd457e8a605872cb6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
+_:nab9af1206e584ab2afd457e8a605872cb6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "c" .
+
+<http://example.com/base/e/a> <http://example.com/ns#with> _:nab9af1206e584ab2afd457e8a605872cb3 .
+_:nab9af1206e584ab2afd457e8a605872cb3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> _:nab9af1206e584ab2afd457e8a605872cb1 .
+_:nab9af1206e584ab2afd457e8a605872cb3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nab9af1206e584ab2afd457e8a605872cb4 .
+
+_:nab9af1206e584ab2afd457e8a605872cb4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> _:nab9af1206e584ab2afd457e8a605872cb2 .
+_:nab9af1206e584ab2afd457e8a605872cb4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+
+<http://example.com/base/e/b> <http://example.com/ns#with> _:nab9af1206e584ab2afd457e8a605872cb7 .
+_:nab9af1206e584ab2afd457e8a605872cb7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> _:nab9af1206e584ab2afd457e8a605872cb5 .
+_:nab9af1206e584ab2afd457e8a605872cb7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nab9af1206e584ab2afd457e8a605872cb8 .
+
+_:nab9af1206e584ab2afd457e8a605872cb8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> _:nab9af1206e584ab2afd457e8a605872cb6 .
+_:nab9af1206e584ab2afd457e8a605872cb8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+
+
+
+

28. RMLTC-CC-0008-ROMa

+

Title:

+

Description:

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0008-ROMa/Friends.json

+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+
+_:b273446 a rml:RelativePathSource ;
+    rml:path "student.csv" .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap ;
+    rml:logicalSource [ a rml:LogicalSource ;
+            rml:referenceFormulation rml:CSV ;
+            rml:source _:b273446 ] ;
+            
+    rml:predicateObjectMap [ 
+        rml:objectMap [
+                rml:reference "ID" ; rml:termType rml:BlankNode ;
+                rml:gather ( 
+                    [ 
+                        rml:parentTriplesMap <http://example.com/base/TriplesMap1> ;
+                        rml:joinCondition [ rml:child "Sport" ; rml:parent "Sport" ] ;
+                    ] 
+                ) ;
+                rml:gatherAs rdf:List;
+            ] ;    
+        rml:predicate ex:sameSportAs 
+    ] ;
+
+    rml:subjectMap [ rml:template "http://example.com/Student/{ID}/{Name}" ] .
+
+

Output

+
_:genid1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> <http://example.com/Student/10/Venus%20Williams> .
+_:genid1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:genid2 .
+_:genid2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> <http://example.com/Student/20/Serena%20Williams> .
+_:genid2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+<http://example.com/Student/10/Venus%20Williams> <http://example.com/sameSportAs> _:genid1 .
+_:genid3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> <http://example.com/Student/10/Venus%20Williams> .
+_:genid3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:genid4 .
+_:genid4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> <http://example.com/Student/20/Serena%20Williams> .
+_:genid4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+<http://example.com/Student/20/Serena%20Williams> <http://example.com/sameSportAs> _:genid3 .
+_:genid5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> <http://example.com/Student/30/Loena%20Hendrickx> .
+_:genid5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+<http://example.com/Student/30/Loena%20Hendrickx> <http://example.com/sameSportAs> _:genid5 .
+
+
+

29. RMLTC-CC-0008-ROMb

+

Title:

+

Description:

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0008-ROMb/Friends.json

+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+
+_:b273446 a rml:RelativePathSource ;
+    rml:path "student.csv" .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap ;
+    rml:logicalSource [ a rml:LogicalSource ;
+            rml:referenceFormulation rml:CSV ;
+            rml:source _:b273446 ] ;
+            
+    rml:predicateObjectMap [
+        rml:objectMap [
+            rml:reference "ID" ; rml:termType rml:BlankNode ;
+            rml:gather ( 
+                [ 
+                    rml:parentTriplesMap <http://example.com/base/TriplesMap1> ;
+                ] 
+            ) ;
+            rml:gatherAs rdf:List;
+        ] ;
+        rml:predicate ex:sameSportAs 
+    ] ;
+        
+    rml:subjectMap [ rml:template "http://example.com/Student/{ID}/{Name}" ] .
+
+
+

Output

+
_:genid1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> <http://example.com/Student/30/Loena%20Hendrickx> .
+_:genid1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+<http://example.com/Student/30/Loena%20Hendrickx> <http://example.com/sameSportAs> _:genid1 .
+_:genid2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> <http://example.com/Student/20/Serena%20Williams> .
+_:genid2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+<http://example.com/Student/20/Serena%20Williams> <http://example.com/sameSportAs> _:genid2 .
+_:genid3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> <http://example.com/Student/10/Venus%20Williams> .
+_:genid3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+<http://example.com/Student/10/Venus%20Williams> <http://example.com/sameSportAs> _:genid3 .
+
+
+

30. RMLTC-CC-0009-DUP-Bag

+

Title:

+

Description:

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0009-DUP-Bag/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/>.
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+@prefix ex:  <http://example.com/ns#>.
+@base        <http://example.com/>.
+
+<#TM> a rml:TriplesMap;
+    rml:logicalSource [
+        rml:source _:b738439 ;
+        rml:referenceFormulation rml:JSONPath ;
+        rml:iterator "$.*" ;
+    ] ;
+
+    rml:subjectMap [
+        rml:template "e/{$.id}" ;
+    ] ;
+
+    rml:predicateObjectMap [
+        rml:predicate ex:with ;
+        rml:objectMap [
+            rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
+            rml:gatherAs rdf:Bag ;
+        ] ;
+    ] ;
+.
+
+_:b738439 a rml:RelativePathSource ;
+    rml:path "data.json" .
+
+

Output

+
_:nc808fbd2e11a4baa939c61c8210b5909b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
+_:nc808fbd2e11a4baa939c61c8210b5909b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "2" .
+_:nc808fbd2e11a4baa939c61c8210b5909b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
+_:nc808fbd2e11a4baa939c61c8210b5909b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
+_:nc808fbd2e11a4baa939c61c8210b5909b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "9" .
+_:nc808fbd2e11a4baa939c61c8210b5909b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "1" .
+<http://example.com/base/e/b> <http://example.com/ns#with> _:nc808fbd2e11a4baa939c61c8210b5909b2 .
+_:nc808fbd2e11a4baa939c61c8210b5909b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "1" .
+<http://example.com/base/e/c> <http://example.com/ns#with> _:nc808fbd2e11a4baa939c61c8210b5909b3 .
+<http://example.com/base/e/a> <http://example.com/ns#with> _:nc808fbd2e11a4baa939c61c8210b5909b1 .
+_:nc808fbd2e11a4baa939c61c8210b5909b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "2" .
+_:nc808fbd2e11a4baa939c61c8210b5909b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "7" .
+_:nc808fbd2e11a4baa939c61c8210b5909b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "6" .
+_:nc808fbd2e11a4baa939c61c8210b5909b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "1" .
+_:nc808fbd2e11a4baa939c61c8210b5909b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "8" .
+
+
+

31. RMLTC-CC-0009-DUP-List

+

Title:

+

Description:

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0009-DUP-List/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/>.
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+@prefix ex:  <http://example.com/ns#>.
+@base        <http://example.com/>.
+
+<#TM> a rml:TriplesMap;
+    rml:logicalSource [
+        rml:source _:b738439 ;
+        rml:referenceFormulation rml:JSONPath ;
+        rml:iterator "$.*" ;
+    ] ;
+
+    rml:subjectMap [
+        rml:template "e/{$.id}" ;
+    ] ;
+
+    rml:predicateObjectMap [
+        rml:predicate ex:with ;
+        rml:objectMap [
+            rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
+            rml:gatherAs rdf:List ;
+        ] ;
+    ] ;
+.
+
+_:b738439 a rml:RelativePathSource ;
+    rml:path "data.json" .
+
+

Output

+
<http://example.com/base/e/a> <http://example.com/ns#with> _:n988e0f11d19c486fa3b3255f94c9b3bab1 .
+_:n988e0f11d19c486fa3b3255f94c9b3bab1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
+_:n988e0f11d19c486fa3b3255f94c9b3bab1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n988e0f11d19c486fa3b3255f94c9b3bab2 .
+_:n988e0f11d19c486fa3b3255f94c9b3bab2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
+_:n988e0f11d19c486fa3b3255f94c9b3bab2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n988e0f11d19c486fa3b3255f94c9b3bab3 .
+_:n988e0f11d19c486fa3b3255f94c9b3bab3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
+_:n988e0f11d19c486fa3b3255f94c9b3bab3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+
+<http://example.com/base/e/b> <http://example.com/ns#with> _:n988e0f11d19c486fa3b3255f94c9b3bab4 .
+_:n988e0f11d19c486fa3b3255f94c9b3bab4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
+_:n988e0f11d19c486fa3b3255f94c9b3bab4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n988e0f11d19c486fa3b3255f94c9b3bab5 .
+_:n988e0f11d19c486fa3b3255f94c9b3bab5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
+_:n988e0f11d19c486fa3b3255f94c9b3bab5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n988e0f11d19c486fa3b3255f94c9b3bab6 .
+_:n988e0f11d19c486fa3b3255f94c9b3bab6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "6" .
+_:n988e0f11d19c486fa3b3255f94c9b3bab6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+
+<http://example.com/base/e/c> <http://example.com/ns#with> _:n988e0f11d19c486fa3b3255f94c9b3bab7 .
+_:n988e0f11d19c486fa3b3255f94c9b3bab7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "7" .
+_:n988e0f11d19c486fa3b3255f94c9b3bab7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n988e0f11d19c486fa3b3255f94c9b3bab8 .
+_:n988e0f11d19c486fa3b3255f94c9b3bab8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "8" .
+_:n988e0f11d19c486fa3b3255f94c9b3bab8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n988e0f11d19c486fa3b3255f94c9b3bab9 .
+_:n988e0f11d19c486fa3b3255f94c9b3bab9 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "9" .
+_:n988e0f11d19c486fa3b3255f94c9b3bab9 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+
+
+

32. RMLTC-CC-0010-Lista

+

Title:

+

Description:

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0010-Lista/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/>.
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+@prefix ex:  <http://example.com/ns#>.
+@base        <http://example.com/>.
+
+<#TM> a rml:TriplesMap;
+    rml:logicalSource [
+        rml:source _:b738439 ;
+        rml:referenceFormulation rml:JSONPath ;
+        rml:iterator "$.*" ;
+    ] ;
+
+    rml:subjectMap [
+        rml:template "e/{$.id}" ;
+    ] ;
+
+    rml:predicateObjectMap [
+        rml:graphMap [ rml:template "g/{$.graph}" ; ] ;
+        rml:predicate ex:with ;
+        rml:objectMap [
+            rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
+            rml:gatherAs rdf:List ;
+        ] ;
+    ] ;
+.
+
+_:b738439 a rml:RelativePathSource ;
+    rml:path "data.json" .
+
+

Output

+
_:genid1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" <http://example.com/base/g/1> .
+_:genid1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> <http://example.com/base/g/1> .
+_:genid2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" <http://example.com/base/g/1> .
+_:genid2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> <http://example.com/base/g/1> .
+<http://example.com/base/e/a> <http://example.com/ns#with> _:genid1 <http://example.com/base/g/1> .
+<http://example.com/base/e/a> <http://example.com/ns#with> _:genid2 <http://example.com/base/g/1> .
+
+_:genidx1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" <http://example.com/base/g/2> .
+_:genidx1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> <http://example.com/base/g/2> .
+<http://example.com/base/e/a> <http://example.com/ns#with> _:genidx1 <http://example.com/base/g/2> .
+
+
+

33. RMLTC-CC-0010-Listb

+

Title:

+

Description:

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0010-Listb/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/>.
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+@prefix ex:  <http://example.com/ns#>.
+@base        <http://example.com/>.
+
+<#TM> a rml:TriplesMap;
+    rml:logicalSource [
+        rml:source _:b738439 ;
+        rml:referenceFormulation rml:JSONPath ;
+        rml:iterator "$.*" ;
+    ] ;
+
+    rml:subjectMap [
+        rml:template "e/{$.id}" ;
+    ] ;
+
+    rml:predicateObjectMap [
+        rml:graphMap [ rml:template "g/{$.graph}" ; ] ;
+        rml:predicate ex:with ;
+        rml:objectMap [
+            rml:template "l/{$.id}" ; rml:termType rml:BlankNode ;
+            rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
+            rml:gatherAs rdf:List ;
+        ] ;
+    ] ;
+.
+
+_:b738439 a rml:RelativePathSource ;
+    rml:path "data.json" .
+
+

Output

+
_:genid1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" <http://example.com/base/g/1> .
+_:genid1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:genid2 <http://example.com/base/g/1> .
+_:genid2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" <http://example.com/base/g/1> .
+_:genid2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> <http://example.com/base/g/1> .
+<http://example.com/base/e/a> <http://example.com/ns#with> _:genid1 <http://example.com/base/g/1> .
+
+_:genidx1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" <http://example.com/base/g/2> .
+_:genidx1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> <http://example.com/base/g/2> .
+<http://example.com/base/e/a> <http://example.com/ns#with> _:genidx1 <http://example.com/base/g/2> .
+
+
+ + + + + diff --git a/src/test/resources/rml-cc/docs/20250206/index.html b/src/test/resources/rml-cc/docs/20250206/index.html new file mode 100644 index 00000000..abe1c494 --- /dev/null +++ b/src/test/resources/rml-cc/docs/20250206/index.html @@ -0,0 +1,2158 @@ + + + + + + +RML-CC: Test Cases + + + + + + + + + + + + + + +
+ +

RML-CC: Test Cases

+

+ Draft Community Group Report + +

+
+ +
Latest published version:
+ https://www.w3.org/RML-CC-Testcases/ +
+
Latest editor's draft:
https://w3id.org/rml/cc/test-cases/
+ + + + +
Editor:
+ Dylan Van Assche + + + + (IDLab – Ghent University – imec) +
+ +
Author:
+ Dylan Van Assche + + + + (IDLab – Ghent University – imec) +
+
Feedback:
+ GitHub kg-construct/rml-cc + (pull requests, + new issue, + open issues) +
+ +
+ + +
+
+ + + +

Abstract

This document defines the RML-CC test cases to the determine the RML-CC specification conformance of tools.

+
+ +

Status of This Document

+ This specification was published by the + Knowledge Graph Construction Community Group. It is not a W3C Standard nor is it + on the W3C Standards Track. + + Please note that under the + W3C Community Contributor License Agreement (CLA) + there is a limited opt-out and other conditions apply. + + Learn more about + W3C Community and Business Groups. +

+ GitHub Issues are preferred for + discussion of this specification. + + +

+ +

1. Introduction

+

This document defines the RML-CC test cases, consisting of a collection of test case documents (input and expected output). +The purpose of the test cases is to determine the conformance of tools that execute RML rules to the RML-CC specification.

+
+ +

2. Data model

+

The test cases are semantically described for re-usability and shareability following the W3C Test case description. +Each test:Testcase as the following properties:

+
    +
  • dcterms:identifier: unique ID of the test case.
  • +
  • rmltest:hasError: if an error of the RML Processor is expected or not.
  • +
  • rmltest:input: One or more input data of the test case.
  • +
  • rmltest:output: One or more output data of the test case.
  • +
  • rmltest:inputFormat: the input data format.
  • +
  • rmltest:outputFormat: the output data format.
  • +
  • rmltest:mappingDocument: the RML mapping rules in Turtle.
  • +
+
+ +

3. Test cases

+

This section describes the RML-CC test cases. These descriptions are also available as RDF. +The files are available on GitHub in the folder test-cases. +Each test case is contained in a single folder, containing three types of files:

+
    +
  • Zero or more files containing the data sources, in the case of JSON, XML, CSV, or containing the SQL statements to create the necessary tables, in the case of MySQL, PostgreSQL, and SQL Server.
  • +
  • One file with the RML rules, called mapping.ttl, in the Turtle format.
  • +
  • Zero or more files with the expected RDF. No file is provided if an error is expected that must halt the generation of the RDF because of an error.
  • +
+
+ + +

4. RMLTC-CC-0001-Alt

+

Title: Generate a rdf:Alt as an object

+

Description: Tests if a rdf:Alt is generated as an object

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0001-Alt/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/>.
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+@prefix ex:  <http://example.com/ns#>.
+@base        <http://example.com/>.
+
+<#TM> a rml:TriplesMap;
+    rml:logicalSource [
+        rml:source _:b738439 ;
+        rml:referenceFormulation rml:JSONPath ;
+        rml:iterator "$.*" ;
+    ] ;
+
+    rml:subjectMap [
+        rml:template "e/{$.id}" ;
+    ] ;
+
+    rml:predicateObjectMap [
+        rml:predicate ex:with ;
+        rml:objectMap [
+            rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
+            rml:gatherAs rdf:Alt ;
+        ] ;
+    ] ;
+.
+
+_:b738439 a rml:RelativePathSource ;
+    rml:path "data.json" .
+
+

Output

+
<http://example.com/base/e/a> <http://example.com/ns#with> _:nc808fbd2e11a4baa939c61c8210b5909b1 .
+_:nc808fbd2e11a4baa939c61c8210b5909b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Alt> .
+_:nc808fbd2e11a4baa939c61c8210b5909b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "1" .
+_:nc808fbd2e11a4baa939c61c8210b5909b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "2" .
+_:nc808fbd2e11a4baa939c61c8210b5909b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "3" .
+
+<http://example.com/base/e/b> <http://example.com/ns#with> _:nc808fbd2e11a4baa939c61c8210b5909b2 .
+_:nc808fbd2e11a4baa939c61c8210b5909b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Alt> .
+_:nc808fbd2e11a4baa939c61c8210b5909b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "4" .
+_:nc808fbd2e11a4baa939c61c8210b5909b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "5" .
+_:nc808fbd2e11a4baa939c61c8210b5909b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "6" .
+
+<http://example.com/base/e/c> <http://example.com/ns#with> _:nc808fbd2e11a4baa939c61c8210b5909b3 .
+_:nc808fbd2e11a4baa939c61c8210b5909b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Alt> .
+_:nc808fbd2e11a4baa939c61c8210b5909b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "7" .
+_:nc808fbd2e11a4baa939c61c8210b5909b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "8" .
+_:nc808fbd2e11a4baa939c61c8210b5909b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "9" .
+
+
+

5. RMLTC-CC-0001-Bag

+

Title: Generate a rdf:Bag as an object

+

Description: Tests if a rdf:Bag is generated as an object

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0001-Bag/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/>.
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+@prefix ex:  <http://example.com/ns#>.
+@base        <http://example.com/>.
+
+<#TM> a rml:TriplesMap;
+    rml:logicalSource [
+        rml:source _:b738439 ;
+        rml:referenceFormulation rml:JSONPath ;
+        rml:iterator "$.*" ;
+    ] ;
+
+    rml:subjectMap [
+        rml:template "e/{$.id}" ;
+    ] ;
+
+    rml:predicateObjectMap [
+        rml:predicate ex:with ;
+        rml:objectMap [
+            rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
+            rml:gatherAs rdf:Bag ;
+        ] ;
+    ] ;
+.
+
+_:b738439 a rml:RelativePathSource ;
+    rml:path "data.json" .
+
+

Output

+
_:nc808fbd2e11a4baa939c61c8210b5909b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
+_:nc808fbd2e11a4baa939c61c8210b5909b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "5" .
+_:nc808fbd2e11a4baa939c61c8210b5909b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
+_:nc808fbd2e11a4baa939c61c8210b5909b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
+_:nc808fbd2e11a4baa939c61c8210b5909b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "9" .
+_:nc808fbd2e11a4baa939c61c8210b5909b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "2" .
+<http://example.com/base/e/b> <http://example.com/ns#with> _:nc808fbd2e11a4baa939c61c8210b5909b2 .
+_:nc808fbd2e11a4baa939c61c8210b5909b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "1" .
+<http://example.com/base/e/c> <http://example.com/ns#with> _:nc808fbd2e11a4baa939c61c8210b5909b3 .
+<http://example.com/base/e/a> <http://example.com/ns#with> _:nc808fbd2e11a4baa939c61c8210b5909b1 .
+_:nc808fbd2e11a4baa939c61c8210b5909b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "4" .
+_:nc808fbd2e11a4baa939c61c8210b5909b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "7" .
+_:nc808fbd2e11a4baa939c61c8210b5909b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "6" .
+_:nc808fbd2e11a4baa939c61c8210b5909b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "3" .
+_:nc808fbd2e11a4baa939c61c8210b5909b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "8" .
+
+
+

6. RMLTC-CC-0001-List

+

Title: Generate a rdf:List as an object

+

Description: Tests if a rdf:List is generated as an object

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0001-List/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/>.
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+@prefix ex:  <http://example.com/ns#>.
+@base        <http://example.com/>.
+
+<#TM> a rml:TriplesMap;
+    rml:logicalSource [
+        rml:source _:b738439 ;
+        rml:referenceFormulation rml:JSONPath ;
+        rml:iterator "$.*" ;
+    ] ;
+
+    rml:subjectMap [
+        rml:template "e/{$.id}" ;
+    ] ;
+
+    rml:predicateObjectMap [
+        rml:predicate ex:with ;
+        rml:objectMap [
+            rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
+            rml:gatherAs rdf:List ;
+        ] ;
+    ] ;
+.
+
+_:b738439 a rml:RelativePathSource ;
+    rml:path "data.json" .
+
+

Output

+
<http://example.com/base/e/a> <http://example.com/ns#with> _:n988e0f11d19c486fa3b3255f94c9b3bab1 .
+_:n988e0f11d19c486fa3b3255f94c9b3bab1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
+_:n988e0f11d19c486fa3b3255f94c9b3bab1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n988e0f11d19c486fa3b3255f94c9b3bab2 .
+_:n988e0f11d19c486fa3b3255f94c9b3bab2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
+_:n988e0f11d19c486fa3b3255f94c9b3bab2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n988e0f11d19c486fa3b3255f94c9b3bab3 .
+_:n988e0f11d19c486fa3b3255f94c9b3bab3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" .
+_:n988e0f11d19c486fa3b3255f94c9b3bab3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+
+<http://example.com/base/e/b> <http://example.com/ns#with> _:n988e0f11d19c486fa3b3255f94c9b3bab4 .
+_:n988e0f11d19c486fa3b3255f94c9b3bab4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "4" .
+_:n988e0f11d19c486fa3b3255f94c9b3bab4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n988e0f11d19c486fa3b3255f94c9b3bab5 .
+_:n988e0f11d19c486fa3b3255f94c9b3bab5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "5" .
+_:n988e0f11d19c486fa3b3255f94c9b3bab5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n988e0f11d19c486fa3b3255f94c9b3bab6 .
+_:n988e0f11d19c486fa3b3255f94c9b3bab6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "6" .
+_:n988e0f11d19c486fa3b3255f94c9b3bab6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+
+<http://example.com/base/e/c> <http://example.com/ns#with> _:n988e0f11d19c486fa3b3255f94c9b3bab7 .
+_:n988e0f11d19c486fa3b3255f94c9b3bab7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "7" .
+_:n988e0f11d19c486fa3b3255f94c9b3bab7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n988e0f11d19c486fa3b3255f94c9b3bab8 .
+_:n988e0f11d19c486fa3b3255f94c9b3bab8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "8" .
+_:n988e0f11d19c486fa3b3255f94c9b3bab8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n988e0f11d19c486fa3b3255f94c9b3bab9 .
+_:n988e0f11d19c486fa3b3255f94c9b3bab9 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "9" .
+_:n988e0f11d19c486fa3b3255f94c9b3bab9 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+
+
+

7. RMLTC-CC-0001-Seq

+

Title: Generate a rdf:Seq as an object

+

Description: Tests if a rdf:Seq is generated as an object

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0001-Seq/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/>.
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+@prefix ex:  <http://example.com/ns#>.
+@base        <http://example.com/>.
+
+<#TM> a rml:TriplesMap;
+    rml:logicalSource [
+        rml:source _:b738439 ;
+        rml:referenceFormulation rml:JSONPath ;
+        rml:iterator "$.*" ;
+    ] ;
+
+    rml:subjectMap [
+        rml:template "e/{$.id}" ;
+    ] ;
+
+    rml:predicateObjectMap [
+        rml:predicate ex:with ;
+        rml:objectMap [
+            rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
+            rml:gatherAs rdf:Seq ;
+        ] ;
+    ] ;
+.
+
+_:b738439 a rml:RelativePathSource ;
+    rml:path "data.json" .
+
+

Output

+
_:nc808fbd2e11a4baa939c61c8210b5909b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Seq> .
+_:nc808fbd2e11a4baa939c61c8210b5909b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "5" .
+_:nc808fbd2e11a4baa939c61c8210b5909b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Seq> .
+_:nc808fbd2e11a4baa939c61c8210b5909b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Seq> .
+_:nc808fbd2e11a4baa939c61c8210b5909b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "9" .
+_:nc808fbd2e11a4baa939c61c8210b5909b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "2" .
+<http://example.com/base/e/b> <http://example.com/ns#with> _:nc808fbd2e11a4baa939c61c8210b5909b2 .
+_:nc808fbd2e11a4baa939c61c8210b5909b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "1" .
+<http://example.com/base/e/c> <http://example.com/ns#with> _:nc808fbd2e11a4baa939c61c8210b5909b3 .
+<http://example.com/base/e/a> <http://example.com/ns#with> _:nc808fbd2e11a4baa939c61c8210b5909b1 .
+_:nc808fbd2e11a4baa939c61c8210b5909b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "4" .
+_:nc808fbd2e11a4baa939c61c8210b5909b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "7" .
+_:nc808fbd2e11a4baa939c61c8210b5909b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "6" .
+_:nc808fbd2e11a4baa939c61c8210b5909b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "3" .
+_:nc808fbd2e11a4baa939c61c8210b5909b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "8" .
+
+
+

8. RMLTC-CC-0002-Bag

+

Title: Generate a named rdf:Bag as an object

+

Description: Tests if a named rdf:Bag is generated as an object

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0002-Bag/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/>.
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+@prefix ex:  <http://example.com/ns#>.
+@base        <http://example.com/>.
+
+<#TM> a rml:TriplesMap;
+    rml:logicalSource [
+        rml:source _:b738439 ;
+        rml:referenceFormulation rml:JSONPath ;
+        rml:iterator "$.*" ;
+    ] ;
+
+    rml:subjectMap [
+        rml:template "e/{$.id}" ;
+    ] ;
+
+    rml:predicateObjectMap [
+        rml:predicate ex:with ;
+        rml:objectMap [
+            rml:template "c/{$.id}" ;
+            rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
+            rml:gatherAs rdf:Bag ;
+        ] ;
+    ] ;
+.
+
+_:b738439 a rml:RelativePathSource ;
+    rml:path "data.json" .
+
+

Output

+
<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
+<http://example.com/base/c/c> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "7" .
+<http://example.com/base/c/c> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "8" .
+<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "2" .
+<http://example.com/base/e/c> <http://example.com/ns#with> <http://example.com/base/c/c> .
+<http://example.com/base/c/c> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
+<http://example.com/base/c/b> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "6" .
+<http://example.com/base/e/a> <http://example.com/ns#with> <http://example.com/base/c/a> .
+<http://example.com/base/c/c> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "9" .
+<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "1" .
+<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "3" .
+<http://example.com/base/c/b> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "4" .
+<http://example.com/base/e/b> <http://example.com/ns#with> <http://example.com/base/c/b> .
+<http://example.com/base/c/b> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
+<http://example.com/base/c/b> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "5" .
+
+
+

9. RMLTC-CC-0002-List

+

Title: Generate a named rdf:List as an object

+

Description: Tests if a named rdf:List is generated as an object

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0002-List/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/>.
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+@prefix ex:  <http://example.com/ns#>.
+@base        <http://example.com/>.
+
+<#TM> a rml:TriplesMap;
+    rml:logicalSource [
+        rml:source _:b738439 ;
+        rml:referenceFormulation rml:JSONPath ;
+        rml:iterator "$.*" ;
+    ] ;
+
+    rml:subjectMap [
+        rml:template "e/{$.id}" ;
+    ] ;
+
+    rml:predicateObjectMap [
+        rml:predicate ex:with ;
+        rml:objectMap [
+            rml:template "c/{$.id}" ;
+            rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
+            rml:gatherAs rdf:List ;
+        ] ;
+    ] ;
+.
+
+_:b738439 a rml:RelativePathSource ;
+    rml:path "data.json" .
+
+

Output

+
_:nb73dd869d6bb47a5b865ee632fe27453b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nb73dd869d6bb47a5b865ee632fe27453b2 .
+<http://example.com/base/e/c> <http://example.com/ns#with> <http://example.com/base/c/c> .
+<http://example.com/base/c/c> <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "7" .
+_:nb73dd869d6bb47a5b865ee632fe27453b5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "8" .
+_:nb73dd869d6bb47a5b865ee632fe27453b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nb73dd869d6bb47a5b865ee632fe27453b4 .
+_:nb73dd869d6bb47a5b865ee632fe27453b6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+<http://example.com/base/e/a> <http://example.com/ns#with> <http://example.com/base/c/a> .
+_:nb73dd869d6bb47a5b865ee632fe27453b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "5" .
+<http://example.com/base/c/b> <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nb73dd869d6bb47a5b865ee632fe27453b3 .
+_:nb73dd869d6bb47a5b865ee632fe27453b4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "6" .
+_:nb73dd869d6bb47a5b865ee632fe27453b4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+_:nb73dd869d6bb47a5b865ee632fe27453b5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nb73dd869d6bb47a5b865ee632fe27453b6 .
+_:nb73dd869d6bb47a5b865ee632fe27453b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+_:nb73dd869d6bb47a5b865ee632fe27453b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
+_:nb73dd869d6bb47a5b865ee632fe27453b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" .
+<http://example.com/base/c/b> <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "4" .
+<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nb73dd869d6bb47a5b865ee632fe27453b1 .
+<http://example.com/base/c/c> <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nb73dd869d6bb47a5b865ee632fe27453b5 .
+_:nb73dd869d6bb47a5b865ee632fe27453b6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "9" .
+<http://example.com/base/e/b> <http://example.com/ns#with> <http://example.com/base/c/b> .
+<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
+
+
+

10. RMLTC-CC-0003-EB

+

Title: Allow the generation of empty bags

+

Description: Tests if the use of rml:allowTemptyListAndContainer yields an empty bag.

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0003-EB/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/>.
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+@prefix ex:  <http://example.com/ns#>.
+@base        <http://example.com/>.
+
+<#TM> a rml:TriplesMap;
+    rml:logicalSource [
+        rml:source _:b738439 ;
+        rml:referenceFormulation rml:JSONPath ;
+        rml:iterator "$.*" ;
+    ] ;
+
+    rml:subjectMap [
+        rml:template "e/{$.id}" ;
+    ] ;
+
+    rml:predicateObjectMap [
+        rml:predicate ex:with ;
+        rml:objectMap [
+            rml:allowEmptyListAndContainer true ;
+            rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
+            rml:gatherAs rdf:Bag ;
+        ] ;
+    ] ;
+.
+
+_:b738439 a rml:RelativePathSource ;
+    rml:path "data.json" .
+
+

Output

+
_:nfecac3cfe48c4afa99539cc809138e96b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
+<http://example.com/base/e/a> <http://example.com/ns#with> _:nfecac3cfe48c4afa99539cc809138e96b1 .
+_:nfecac3cfe48c4afa99539cc809138e96b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
+_:nfecac3cfe48c4afa99539cc809138e96b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "1" .
+<http://example.com/base/e/b> <http://example.com/ns#with> _:nfecac3cfe48c4afa99539cc809138e96b2 .
+_:nfecac3cfe48c4afa99539cc809138e96b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "2" .
+_:nfecac3cfe48c4afa99539cc809138e96b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "3" .
+
+
+

11. RMLTC-CC-0003-EL

+

Title: Allow the generation of empty lists

+

Description: Tests if the use of rml:allowTemptyListAndContainer yields an empty list.

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0003-EL/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/>.
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+@prefix ex:  <http://example.com/ns#>.
+@base        <http://example.com/>.
+
+<#TM> a rml:TriplesMap;
+    rml:logicalSource [
+        rml:source _:b738439 ;
+        rml:referenceFormulation rml:JSONPath ;
+        rml:iterator "$.*" ;
+    ] ;
+
+    rml:subjectMap [
+        rml:template "e/{$.id}" ;
+    ] ;
+
+    rml:predicateObjectMap [
+        rml:predicate ex:with ;
+        rml:objectMap [
+            rml:allowEmptyListAndContainer true ;
+            rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
+            rml:gatherAs rdf:List ;
+        ] ;
+    ] ;
+.
+
+_:b738439 a rml:RelativePathSource ;
+    rml:path "data.json" .
+
+

Output

+
_:n302eecc856b44ed5b76965d9be2f5213b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+<http://example.com/base/e/b> <http://example.com/ns#with> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+_:n302eecc856b44ed5b76965d9be2f5213b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n302eecc856b44ed5b76965d9be2f5213b3 .
+_:n302eecc856b44ed5b76965d9be2f5213b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
+_:n302eecc856b44ed5b76965d9be2f5213b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" .
+_:n302eecc856b44ed5b76965d9be2f5213b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n302eecc856b44ed5b76965d9be2f5213b2 .
+<http://example.com/base/e/a> <http://example.com/ns#with> _:n302eecc856b44ed5b76965d9be2f5213b1 .
+_:n302eecc856b44ed5b76965d9be2f5213b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
+
+
+

12. RMLTC-CC-0003-NEB

+

Title: Empty bags are not generated

+

Description: Tests if empty containers are not generated (expected default behavior).

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0003-NEB/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/>.
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+@prefix ex:  <http://example.com/ns#>.
+@base        <http://example.com/>.
+
+<#TM> a rml:TriplesMap;
+    rml:logicalSource [
+        rml:source _:b738439 ;
+        rml:referenceFormulation rml:JSONPath ;
+        rml:iterator "$.*" ;
+    ] ;
+
+    rml:subjectMap [
+        rml:template "e/{$.id}" ;
+    ] ;
+
+    rml:predicateObjectMap [
+        rml:predicate ex:with ;
+        rml:objectMap [
+            rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
+            rml:gatherAs rdf:Bag ;
+        ] ;
+    ] ;
+.
+
+_:b738439 a rml:RelativePathSource ;
+    rml:path "data.json" .
+
+

Output

+
<http://example.com/base/e/a> <http://example.com/ns#with> _:n2bd72de9c571444081890e41009d92d4b1 .
+_:n2bd72de9c571444081890e41009d92d4b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "3" .
+_:n2bd72de9c571444081890e41009d92d4b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
+_:n2bd72de9c571444081890e41009d92d4b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "2" .
+_:n2bd72de9c571444081890e41009d92d4b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "1" .
+
+
+

13. RMLTC-CC-0003-NEL

+

Title: Empty lists are not generated

+

Description: Tests if empty lists are not generated (expected default behavior).

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0003-NEL/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/>.
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+@prefix ex:  <http://example.com/ns#>.
+@base        <http://example.com/>.
+
+<#TM> a rml:TriplesMap;
+    rml:logicalSource [
+        rml:source _:b738439 ;
+        rml:referenceFormulation rml:JSONPath ;
+        rml:iterator "$.*" ;
+    ] ;
+
+    rml:subjectMap [
+        rml:template "e/{$.id}" ;
+    ] ;
+
+    rml:predicateObjectMap [
+        rml:predicate ex:with ;
+        rml:objectMap [
+            rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
+            rml:gatherAs rdf:List ;
+        ] ;
+    ] ;
+.
+
+_:b738439 a rml:RelativePathSource ;
+    rml:path "data.json" .
+
+

Output

+
_:n434c2c54e09e4a259604ba1188ce038fb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n434c2c54e09e4a259604ba1188ce038fb2 .
+_:n434c2c54e09e4a259604ba1188ce038fb3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+_:n434c2c54e09e4a259604ba1188ce038fb2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
+<http://example.com/base/e/a> <http://example.com/ns#with> _:n434c2c54e09e4a259604ba1188ce038fb1 .
+_:n434c2c54e09e4a259604ba1188ce038fb2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n434c2c54e09e4a259604ba1188ce038fb3 .
+_:n434c2c54e09e4a259604ba1188ce038fb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
+_:n434c2c54e09e4a259604ba1188ce038fb3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" .
+
+
+

14. RMLTC-CC-0003-NELb

+

Title: Empty lists are not generated II

+

Description: Tests if empty lists are not generated (expected default behavior). This test cases uses the predicate rml:allowEmptyListAndContainer.

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0003-NELb/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/>.
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+@prefix ex:  <http://example.com/ns#>.
+@base        <http://example.com/>.
+
+<#TM> a rml:TriplesMap;
+    rml:logicalSource [
+        rml:source _:b738439 ;
+        rml:referenceFormulation rml:JSONPath ;
+        rml:iterator "$.*" ;
+    ] ;
+
+    rml:subjectMap [
+        rml:template "e/{$.id}" ;
+    ] ;
+
+    rml:predicateObjectMap [
+        rml:predicate ex:with ;
+        rml:objectMap [
+            rml:allowEmptyListAndContainer false ;
+            rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
+            rml:gatherAs rdf:List ;
+        ] ;
+    ] ;
+.
+
+_:b738439 a rml:RelativePathSource ;
+    rml:path "data.json" .
+
+

Output

+
_:n434c2c54e09e4a259604ba1188ce038fb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n434c2c54e09e4a259604ba1188ce038fb2 .
+_:n434c2c54e09e4a259604ba1188ce038fb3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+_:n434c2c54e09e4a259604ba1188ce038fb2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
+<http://example.com/base/e/a> <http://example.com/ns#with> _:n434c2c54e09e4a259604ba1188ce038fb1 .
+_:n434c2c54e09e4a259604ba1188ce038fb2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n434c2c54e09e4a259604ba1188ce038fb3 .
+_:n434c2c54e09e4a259604ba1188ce038fb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
+_:n434c2c54e09e4a259604ba1188ce038fb3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" .
+
+
+

15. RMLTC-CC-0004-SM1

+

Title: GatherMap in subject map (list)

+

Description: Tests if the use of a gather map in the subject map is supported. This test generates a list.

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0004-SM1/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/>.
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+@prefix ex:  <http://example.com/ns#>.
+@base        <http://example.com/>.
+
+<#TM> a rml:TriplesMap;
+    rml:logicalSource [
+        rml:source _:b738439 ;
+        rml:referenceFormulation rml:JSONPath ;
+        rml:iterator "$.*" ;
+    ] ;
+
+    rml:subjectMap [
+        rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
+        rml:gatherAs rdf:List ;
+    ] ;
+
+    rml:predicateObjectMap [
+        rml:predicate ex:createdBy ;
+        rml:object ex:JohnDoe ;
+    ] ;
+.
+
+_:b738439 a rml:RelativePathSource ;
+    rml:path "data.json" .
+
+

Output

+
_:n302eecc856b44ed5b76965d9be2f5213b1 <http://example.com/ns#createdBy> <http://example.com/ns#JohnDoe> .
+_:n302eecc856b44ed5b76965d9be2f5213b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
+_:n302eecc856b44ed5b76965d9be2f5213b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n302eecc856b44ed5b76965d9be2f5213b2 .
+_:n302eecc856b44ed5b76965d9be2f5213b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
+_:n302eecc856b44ed5b76965d9be2f5213b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n302eecc856b44ed5b76965d9be2f5213b3 .
+_:n302eecc856b44ed5b76965d9be2f5213b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" .
+_:n302eecc856b44ed5b76965d9be2f5213b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+_:n1d393f12e993411498da676131f81ca4b1 <http://example.com/ns#createdBy> <http://example.com/ns#JohnDoe> .
+_:n1d393f12e993411498da676131f81ca4b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "4" .
+_:n1d393f12e993411498da676131f81ca4b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n1d393f12e993411498da676131f81ca4b2 .
+_:n1d393f12e993411498da676131f81ca4b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "5" .
+_:n1d393f12e993411498da676131f81ca4b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n1d393f12e993411498da676131f81ca4b3 .
+_:n1d393f12e993411498da676131f81ca4b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "6" .
+_:n1d393f12e993411498da676131f81ca4b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+
+
+

16. RMLTC-CC-0004-SM2

+

Title: GatherMap in subject map (list)

+

Description: Tests if the use of a gather map in the subject map is supported. This test has no predicate-object maps and no class declarations in the subject map. It still needs to generate triples as the lists consists of at least one cons-pair.

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0004-SM2/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/>.
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+@prefix ex:  <http://example.com/ns#>.
+@base        <http://example.com/>.
+
+<#TM> a rml:TriplesMap;
+    rml:logicalSource [
+        rml:source _:b738439 ;
+        rml:referenceFormulation rml:JSONPath ;
+        rml:iterator "$.*" ;
+    ] ;
+
+    rml:subjectMap [
+        rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
+        rml:gatherAs rdf:List ;
+    ] ;
+.
+
+_:b738439 a rml:RelativePathSource ;
+    rml:path "data.json" .
+
+

Output

+
_:n302eecc856b44ed5b76965d9be2f5213b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
+_:n302eecc856b44ed5b76965d9be2f5213b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n302eecc856b44ed5b76965d9be2f5213b2 .
+_:n302eecc856b44ed5b76965d9be2f5213b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
+_:n302eecc856b44ed5b76965d9be2f5213b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n302eecc856b44ed5b76965d9be2f5213b3 .
+_:n302eecc856b44ed5b76965d9be2f5213b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" .
+_:n302eecc856b44ed5b76965d9be2f5213b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+_:n1d393f12e993411498da676131f81ca4b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "4" .
+_:n1d393f12e993411498da676131f81ca4b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n1d393f12e993411498da676131f81ca4b2 .
+_:n1d393f12e993411498da676131f81ca4b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "5" .
+_:n1d393f12e993411498da676131f81ca4b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n1d393f12e993411498da676131f81ca4b3 .
+_:n1d393f12e993411498da676131f81ca4b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "6" .
+_:n1d393f12e993411498da676131f81ca4b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+
+
+

17. RMLTC-CC-0004-SM3

+

Title: GatherMap in subject map (list)

+

Description: Tests if the use of a gather map in the subject map is supported. This test has no predicate-object maps and no class declarations in the subject map. Only one list needs to be generated as the other has no values and we only retain non-empty lists.

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0004-SM3/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/>.
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+@prefix ex:  <http://example.com/ns#>.
+@base        <http://example.com/>.
+
+<#TM> a rml:TriplesMap;
+    rml:logicalSource [
+        rml:source _:b738439 ;
+        rml:referenceFormulation rml:JSONPath ;
+        rml:iterator "$.*" ;
+    ] ;
+
+    rml:subjectMap [
+        rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
+        rml:gatherAs rdf:List ;
+    ] ;
+.
+
+_:b738439 a rml:RelativePathSource ;
+    rml:path "data.json" .
+
+

Output

+
_:n648f8cf4c58149e8a0feea26fb2a5b5bb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
+_:n648f8cf4c58149e8a0feea26fb2a5b5bb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n648f8cf4c58149e8a0feea26fb2a5b5bb2 .
+_:n648f8cf4c58149e8a0feea26fb2a5b5bb3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" .
+_:n648f8cf4c58149e8a0feea26fb2a5b5bb2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n648f8cf4c58149e8a0feea26fb2a5b5bb3 .
+_:n648f8cf4c58149e8a0feea26fb2a5b5bb2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
+_:n648f8cf4c58149e8a0feea26fb2a5b5bb3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+
+
+

18. RMLTC-CC-0004-SM4

+

Title: GatherMap in subject map (bag)

+

Description: Tests if the use of a gather map in the subject map is supported. This test generates a bag.

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0004-SM4/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/>.
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+@prefix ex:  <http://example.com/ns#>.
+@base        <http://example.com/>.
+
+<#TM> a rml:TriplesMap;
+    rml:logicalSource [
+        rml:source _:b738439 ;
+        rml:referenceFormulation rml:JSONPath ;
+        rml:iterator "$.*" ;
+    ] ;
+
+    rml:subjectMap [
+        rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
+        rml:gatherAs rdf:Bag ;
+    ] ;
+
+    rml:predicateObjectMap [
+        rml:predicate ex:createdBy ;
+        rml:object ex:JohnDoe ;
+    ] ;
+.
+
+_:b738439 a rml:RelativePathSource ;
+    rml:path "data.json" .
+
+

Output

+
_:n1d393f12e993411498da676131f81ca4b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "2" .
+_:n1d393f12e993411498da676131f81ca4b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "5" .
+_:n1d393f12e993411498da676131f81ca4b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "1" .
+_:n1d393f12e993411498da676131f81ca4b2 <http://example.com/ns#createdBy> <http://example.com/ns#JohnDoe> .
+_:n1d393f12e993411498da676131f81ca4b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
+_:n1d393f12e993411498da676131f81ca4b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "3" .
+_:n1d393f12e993411498da676131f81ca4b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "4" .
+_:n1d393f12e993411498da676131f81ca4b1 <http://example.com/ns#createdBy> <http://example.com/ns#JohnDoe> .
+_:n1d393f12e993411498da676131f81ca4b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
+_:n1d393f12e993411498da676131f81ca4b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "6" .
+
+
+

19. RMLTC-CC-0004-SM5

+

Title: GatherMap in subject map (bag)

+

Description: Tests if the use of a gather map in the subject map is supported. This test has no predicate-object maps and no class declarations in the subject map. It should generate a non-empty bag and an empty bag. The reason being that a container has at least one triple ; it's type (bag, seq, or alt).

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0004-SM5/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/>.
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+@prefix ex:  <http://example.com/ns#>.
+@base        <http://example.com/>.
+
+<#TM> a rml:TriplesMap;
+    rml:logicalSource [
+        rml:source _:b738439 ;
+        rml:referenceFormulation rml:JSONPath ;
+        rml:iterator "$.*" ;
+    ] ;
+
+    rml:subjectMap [
+        rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
+        rml:gatherAs rdf:Bag ;
+    ] ;
+.
+
+_:b738439 a rml:RelativePathSource ;
+    rml:path "data.json" .
+
+

Output

+
_:ne32066984b71404a953025d001cd3cdfb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
+_:ne32066984b71404a953025d001cd3cdfb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "2" .
+_:ne32066984b71404a953025d001cd3cdfb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "1" .
+_:ne32066984b71404a953025d001cd3cdfb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "3" .
+
+
+

20. RMLTC-CC-0005-App1

+

Title: Append values of multiple term maps

+

Description: Tests appending of values from multiple term maps in an gather map. This test covers the case where all sets of values are non-empty.

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0005-App1/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/>.
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+@prefix ex:  <http://example.com/ns#>.
+@base        <http://example.com/>.
+
+<#TM> a rml:TriplesMap;
+    rml:logicalSource [
+        rml:source _:b738439 ;
+        rml:referenceFormulation rml:JSONPath ;
+        rml:iterator "$.*" ;
+    ] ;
+
+    rml:subjectMap [
+        rml:template "e/{$.id}" ;
+    ] ;
+
+    rml:predicateObjectMap [
+        rml:predicate ex:with ;
+        rml:objectMap [
+            rml:gather ( [ rml:reference "$.v1.*" ; ] [ rml:reference "$.v2.*" ; ] ) ;
+            rml:gatherAs rdf:List ;
+        ] ;
+    ] ;
+.
+
+_:b738439 a rml:RelativePathSource ;
+    rml:path "data.json" .
+
+

Output

+
<http://example.com/base/e/a> <http://example.com/ns#with> _:n1ee4a5a2b1344422919d171ab2cd6c39b1 .
+_:n1ee4a5a2b1344422919d171ab2cd6c39b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
+_:n1ee4a5a2b1344422919d171ab2cd6c39b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n1ee4a5a2b1344422919d171ab2cd6c39b2 .
+_:n1ee4a5a2b1344422919d171ab2cd6c39b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
+_:n1ee4a5a2b1344422919d171ab2cd6c39b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n1ee4a5a2b1344422919d171ab2cd6c39b4 .
+_:n1ee4a5a2b1344422919d171ab2cd6c39b4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "a" .
+_:n1ee4a5a2b1344422919d171ab2cd6c39b4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n1ee4a5a2b1344422919d171ab2cd6c39b5 .
+_:n1ee4a5a2b1344422919d171ab2cd6c39b5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "b" .
+_:n1ee4a5a2b1344422919d171ab2cd6c39b5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+<http://example.com/base/e/b> <http://example.com/ns#with> _:n1ee4a5a2b1344422919d171ab2cd6c39b6 .
+_:n1ee4a5a2b1344422919d171ab2cd6c39b6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" .
+_:n1ee4a5a2b1344422919d171ab2cd6c39b6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n1ee4a5a2b1344422919d171ab2cd6c39b7 .
+_:n1ee4a5a2b1344422919d171ab2cd6c39b7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "4" .
+_:n1ee4a5a2b1344422919d171ab2cd6c39b7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n1ee4a5a2b1344422919d171ab2cd6c39b8 .
+_:n1ee4a5a2b1344422919d171ab2cd6c39b8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "c" .
+_:n1ee4a5a2b1344422919d171ab2cd6c39b8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+
+
+

21. RMLTC-CC-0005-App2

+

Title: Append values of multiple term maps

+

Description: Tests appending of values from multiple term maps in an iteration. In this example, one of the arrays is empty and the expected behavior is to concatinate a list with the empty list.

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0005-App2/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/>.
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+@prefix ex:  <http://example.com/ns#>.
+@base        <http://example.com/>.
+
+<#TM> a rml:TriplesMap;
+    rml:logicalSource [
+        rml:source _:b738439 ;
+        rml:referenceFormulation rml:JSONPath ;
+        rml:iterator "$.*" ;
+    ] ;
+
+    rml:subjectMap [
+        rml:template "e/{$.id}" ;
+    ] ;
+
+    rml:predicateObjectMap [
+        rml:predicate ex:with ;
+        rml:objectMap [
+            rml:gather ( [ rml:reference "$.v1.*" ; ] [ rml:reference "$.v2.*" ; ] ) ;
+            rml:gatherAs rdf:List ;
+        ] ;
+    ] ;
+.
+
+_:b738439 a rml:RelativePathSource ;
+    rml:path "data.json" .
+
+

Output

+
_:n1d9b8ef217cb44f299a062d746116deab1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n1d9b8ef217cb44f299a062d746116deab2 .
+_:n1d9b8ef217cb44f299a062d746116deab5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "b" .
+_:n1d9b8ef217cb44f299a062d746116deab4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n1d9b8ef217cb44f299a062d746116deab5 .
+_:n1d9b8ef217cb44f299a062d746116deab3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n1d9b8ef217cb44f299a062d746116deab4 .
+_:n1d9b8ef217cb44f299a062d746116deab7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "5" .
+_:n1d9b8ef217cb44f299a062d746116deab2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
+_:n1d9b8ef217cb44f299a062d746116deab8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "6" .
+_:n1d9b8ef217cb44f299a062d746116deab8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+_:n1d9b8ef217cb44f299a062d746116deab3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" .
+_:n1d9b8ef217cb44f299a062d746116deab4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "a" .
+_:n1d9b8ef217cb44f299a062d746116deab5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+_:n1d9b8ef217cb44f299a062d746116deab2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n1d9b8ef217cb44f299a062d746116deab3 .
+_:n1d9b8ef217cb44f299a062d746116deab1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
+<http://example.com/base/e/a> <http://example.com/ns#with> _:n1d9b8ef217cb44f299a062d746116deab1 .
+<http://example.com/base/e/b> <http://example.com/ns#with> _:n1d9b8ef217cb44f299a062d746116deab6 .
+_:n1d9b8ef217cb44f299a062d746116deab7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n1d9b8ef217cb44f299a062d746116deab8 .
+_:n1d9b8ef217cb44f299a062d746116deab6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n1d9b8ef217cb44f299a062d746116deab7 .
+_:n1d9b8ef217cb44f299a062d746116deab6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "4" .
+
+
+

22. RMLTC-CC-0005-Car1

+

Title: Cartesian product of values from multiple term maps of a gather map.

+

Description: Tests generating the Cartesian product of values from multiple term maps in a gather map. This test covers the case where all sets of values are non-empty.

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0005-Car1/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/>.
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+@prefix ex:  <http://example.com/ns#>.
+@base        <http://example.com/>.
+
+<#TM> a rml:TriplesMap;
+    rml:logicalSource [
+        rml:source _:b738439 ;
+        rml:referenceFormulation rml:JSONPath ;
+        rml:iterator "$.*" ;
+    ] ;
+
+    rml:subjectMap [
+        rml:template "e/{$.id}" ;
+    ] ;
+
+    rml:predicateObjectMap [
+        rml:predicate ex:with ;
+        rml:objectMap [
+            rml:gather ( [ rml:reference "$.v1.*" ; ] [ rml:reference "$.v2.*" ; ] ) ;
+            rml:gatherAs rdf:List ;
+            rml:strategy rml:cartesianProduct ;
+        ] ;
+    ] ;
+.
+
+_:b738439 a rml:RelativePathSource ;
+    rml:path "data.json" .
+
+

Output

+
<http://example.com/base/e/a> <http://example.com/ns#with> _:nfc398e5692654ca98dfb3fb5432d277cb1 .
+_:nfc398e5692654ca98dfb3fb5432d277cb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
+_:nfc398e5692654ca98dfb3fb5432d277cb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nfc398e5692654ca98dfb3fb5432d277cb2 .
+_:nfc398e5692654ca98dfb3fb5432d277cb2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+_:nfc398e5692654ca98dfb3fb5432d277cb2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "a" .
+
+<http://example.com/base/e/a> <http://example.com/ns#with> _:nfc398e5692654ca98dfb3fb5432d277cb3 .
+_:nfc398e5692654ca98dfb3fb5432d277cb3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
+_:nfc398e5692654ca98dfb3fb5432d277cb3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nfc398e5692654ca98dfb3fb5432d277cb4 .
+_:nfc398e5692654ca98dfb3fb5432d277cb4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "b" .
+_:nfc398e5692654ca98dfb3fb5432d277cb4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+
+<http://example.com/base/e/a> <http://example.com/ns#with> _:nfc398e5692654ca98dfb3fb5432d277cb5 .
+_:nfc398e5692654ca98dfb3fb5432d277cb5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
+_:nfc398e5692654ca98dfb3fb5432d277cb5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nfc398e5692654ca98dfb3fb5432d277cb6 .
+_:nfc398e5692654ca98dfb3fb5432d277cb6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "a" .
+_:nfc398e5692654ca98dfb3fb5432d277cb6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+
+<http://example.com/base/e/a> <http://example.com/ns#with> _:nfc398e5692654ca98dfb3fb5432d277cb7 .
+_:nfc398e5692654ca98dfb3fb5432d277cb7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
+_:nfc398e5692654ca98dfb3fb5432d277cb7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nfc398e5692654ca98dfb3fb5432d277cb8 .
+_:nfc398e5692654ca98dfb3fb5432d277cb8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "b" .
+_:nfc398e5692654ca98dfb3fb5432d277cb8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+
+<http://example.com/base/e/b> <http://example.com/ns#with> _:nfc398e5692654ca98dfb3fb5432d277cb9 .
+_:nfc398e5692654ca98dfb3fb5432d277cb9 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" .
+_:nfc398e5692654ca98dfb3fb5432d277cb9 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nfc398e5692654ca98dfb3fb5432d277cb10 .
+_:nfc398e5692654ca98dfb3fb5432d277cb10 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "c" .
+_:nfc398e5692654ca98dfb3fb5432d277cb10 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+
+<http://example.com/base/e/b> <http://example.com/ns#with> _:nfc398e5692654ca98dfb3fb5432d277cb11 .
+_:nfc398e5692654ca98dfb3fb5432d277cb11 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "4" .
+_:nfc398e5692654ca98dfb3fb5432d277cb11 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nfc398e5692654ca98dfb3fb5432d277cb12 .
+_:nfc398e5692654ca98dfb3fb5432d277cb12 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "c" .
+_:nfc398e5692654ca98dfb3fb5432d277cb12 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+
+
+

23. RMLTC-CC-0005-Car2

+

Title: Cartesian product of values from multiple term maps of a gather map.

+

Description: Tests generating the Cartesian product of values from multiple term maps in a gather map. This test covers the case where one of the sets is empty. The Cartesian product of a set with an empty set is empty. This entry should thus not yield a list.

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0005-Car2/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/>.
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+@prefix ex:  <http://example.com/ns#>.
+@base        <http://example.com/>.
+
+<#TM> a rml:TriplesMap;
+    rml:logicalSource [
+        rml:source _:b738439 ;
+        rml:referenceFormulation rml:JSONPath ;
+        rml:iterator "$.*" ;
+    ] ;
+
+    rml:subjectMap [
+        rml:template "e/{$.id}" ;
+    ] ;
+
+    rml:predicateObjectMap [
+        rml:predicate ex:with ;
+        rml:objectMap [
+            rml:gather ( [ rml:reference "$.v1.*" ; ] [ rml:reference "$.v2.*" ; ] ) ;
+            rml:gatherAs rdf:List ;
+            rml:strategy rml:cartesianProduct ;
+        ] ;
+    ] ;
+.
+
+_:b738439 a rml:RelativePathSource ;
+    rml:path "data.json" .
+
+

Output

+
<http://example.com/base/e/a> <http://example.com/ns#with> _:nfc398e5692654ca98dfb3fb5432d277cb1 .
+_:nfc398e5692654ca98dfb3fb5432d277cb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
+_:nfc398e5692654ca98dfb3fb5432d277cb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nfc398e5692654ca98dfb3fb5432d277cb2 .
+_:nfc398e5692654ca98dfb3fb5432d277cb2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+_:nfc398e5692654ca98dfb3fb5432d277cb2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "a" .
+
+<http://example.com/base/e/a> <http://example.com/ns#with> _:nfc398e5692654ca98dfb3fb5432d277cb3 .
+_:nfc398e5692654ca98dfb3fb5432d277cb3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
+_:nfc398e5692654ca98dfb3fb5432d277cb3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nfc398e5692654ca98dfb3fb5432d277cb4 .
+_:nfc398e5692654ca98dfb3fb5432d277cb4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "b" .
+_:nfc398e5692654ca98dfb3fb5432d277cb4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+
+<http://example.com/base/e/a> <http://example.com/ns#with> _:nfc398e5692654ca98dfb3fb5432d277cb5 .
+_:nfc398e5692654ca98dfb3fb5432d277cb5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
+_:nfc398e5692654ca98dfb3fb5432d277cb5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nfc398e5692654ca98dfb3fb5432d277cb6 .
+_:nfc398e5692654ca98dfb3fb5432d277cb6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "a" .
+_:nfc398e5692654ca98dfb3fb5432d277cb6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+
+<http://example.com/base/e/a> <http://example.com/ns#with> _:nfc398e5692654ca98dfb3fb5432d277cb7 .
+_:nfc398e5692654ca98dfb3fb5432d277cb7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
+_:nfc398e5692654ca98dfb3fb5432d277cb7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nfc398e5692654ca98dfb3fb5432d277cb8 .
+_:nfc398e5692654ca98dfb3fb5432d277cb8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "b" .
+_:nfc398e5692654ca98dfb3fb5432d277cb8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+
+
+

24. RMLTC-CC-0006-IT0

+

Title: Gather values accross iterations.

+

Description: When no template, constant, or reference is given to a gather map, then each iteration yields a different collection or container.

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0006-IT0/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/>.
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+@prefix ex:  <http://example.com/ns#>.
+@base        <http://example.com/>.
+
+<#TM> a rml:TriplesMap;
+    rml:logicalSource [
+        rml:source _:b738439 ;
+        rml:referenceFormulation rml:JSONPath ;
+        rml:iterator "$.*" ;
+    ] ;
+
+    rml:subjectMap [
+        rml:template "e/{$.id}" ;
+    ] ;
+
+    rml:predicateObjectMap [
+        rml:predicate ex:with ;
+        rml:objectMap [
+            rml:gather ( [ rml:reference "$.v1.*" ; ] ) ;
+            rml:gatherAs rdf:List ;
+        ] ;
+    ] ;
+.
+
+_:b738439 a rml:RelativePathSource ;
+    rml:path "data.json" .
+
+

Output

+
<http://example.com/base/e/a> <http://example.com/ns#with> _:n9d785cd672d3484cb5d9fd831e6dfc07b1 .
+_:n9d785cd672d3484cb5d9fd831e6dfc07b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
+_:n9d785cd672d3484cb5d9fd831e6dfc07b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n9d785cd672d3484cb5d9fd831e6dfc07b2 .
+_:n9d785cd672d3484cb5d9fd831e6dfc07b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
+_:n9d785cd672d3484cb5d9fd831e6dfc07b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+
+<http://example.com/base/e/b> <http://example.com/ns#with> _:n9d785cd672d3484cb5d9fd831e6dfc07b5 .
+_:n9d785cd672d3484cb5d9fd831e6dfc07b5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" .
+_:n9d785cd672d3484cb5d9fd831e6dfc07b5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n9d785cd672d3484cb5d9fd831e6dfc07b6 .
+_:n9d785cd672d3484cb5d9fd831e6dfc07b6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "4" .
+_:n9d785cd672d3484cb5d9fd831e6dfc07b6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+
+<http://example.com/base/e/a> <http://example.com/ns#with> _:n9d785cd672d3484cb5d9fd831e6dfc07b3 .
+_:n9d785cd672d3484cb5d9fd831e6dfc07b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "5" .
+_:n9d785cd672d3484cb5d9fd831e6dfc07b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n9d785cd672d3484cb5d9fd831e6dfc07b4 .
+_:n9d785cd672d3484cb5d9fd831e6dfc07b4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "6" .
+_:n9d785cd672d3484cb5d9fd831e6dfc07b4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+
+
+

25. RMLTC-CC-0006-IT1

+

Title: Gather values accross iterations.

+

Description: When using a template, constant, or reference for a gather map, this tests determines whether the values are correctly appended to the list. The natural order of the term maps inside the gather map as well as the iteration are respected. This test covers one term map in the gather map.

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0006-IT1/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/>.
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+@prefix ex:  <http://example.com/ns#>.
+@base        <http://example.com/>.
+
+<#TM> a rml:TriplesMap;
+    rml:logicalSource [
+        rml:source _:b738439 ;
+        rml:referenceFormulation rml:JSONPath ;
+        rml:iterator "$.*" ;
+    ] ;
+
+    rml:subjectMap [
+        rml:template "e/{$.id}" ;
+    ] ;
+
+    rml:predicateObjectMap [
+        rml:predicate ex:with ;
+        rml:objectMap [
+            rml:template "c/{$.id}" ;
+            rml:gather ( [ rml:reference "$.v1.*" ; ] ) ;
+            rml:gatherAs rdf:List ;
+        ] ;
+    ] ;
+.
+
+_:b738439 a rml:RelativePathSource ;
+    rml:path "data.json" .
+
+

Output

+
<http://example.com/base/e/a> <http://example.com/ns#with> <http://example.com/base/c/a> .
+<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
+<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nab8f496caee443c5ac19ce3a109f4b22b1 .
+_:nab8f496caee443c5ac19ce3a109f4b22b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
+_:nab8f496caee443c5ac19ce3a109f4b22b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nab8f496caee443c5ac19ce3a109f4b22b2 .
+_:nab8f496caee443c5ac19ce3a109f4b22b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "5" .
+_:nab8f496caee443c5ac19ce3a109f4b22b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nab8f496caee443c5ac19ce3a109f4b22b3 .
+_:nab8f496caee443c5ac19ce3a109f4b22b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "6" .
+_:nab8f496caee443c5ac19ce3a109f4b22b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+
+<http://example.com/base/e/b> <http://example.com/ns#with> <http://example.com/base/c/b> .
+<http://example.com/base/c/b> <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" .
+<http://example.com/base/c/b> <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nab8f496caee443c5ac19ce3a109f4b22b4 .
+_:nab8f496caee443c5ac19ce3a109f4b22b4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "4" .
+_:nab8f496caee443c5ac19ce3a109f4b22b4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+
+
+

26. RMLTC-CC-0006-IT2

+

Title: Gather values accross iterations.

+

Description: When using a template, constant, or reference for a gather map, this tests determines whether the values are correctly appended to the list. The natural order of the term maps inside the gather map as well as the iteration are respected. This test covers two term maps in the gather map.

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0006-IT2/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/>.
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+@prefix ex:  <http://example.com/ns#>.
+@base        <http://example.com/>.
+
+<#TM> a rml:TriplesMap;
+    rml:logicalSource [
+        rml:source _:b738439 ;
+        rml:referenceFormulation rml:JSONPath ;
+        rml:iterator "$.*" ;
+    ] ;
+
+    rml:subjectMap [
+        rml:template "e/{$.id}" ;
+    ] ;
+
+    rml:predicateObjectMap [
+        rml:predicate ex:with ;
+        rml:objectMap [
+            rml:template "c/{$.id}" ;
+            rml:gather ( [ rml:reference "$.v1.*" ; ] [ rml:reference "$.v2.*" ; ] ) ;
+            rml:gatherAs rdf:List ;
+        ] ;
+    ] ;
+.
+
+_:b738439 a rml:RelativePathSource ;
+    rml:path "data.json" .
+
+

Output

+
<http://example.com/base/e/a> <http://example.com/ns#with> <http://example.com/base/c/a> .
+<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
+<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n0cbb21ce98464358963007f95dc35c0ab1 .
+_:n0cbb21ce98464358963007f95dc35c0ab1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
+_:n0cbb21ce98464358963007f95dc35c0ab1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n0cbb21ce98464358963007f95dc35c0ab2 .
+_:n0cbb21ce98464358963007f95dc35c0ab2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "a" .
+_:n0cbb21ce98464358963007f95dc35c0ab2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n0cbb21ce98464358963007f95dc35c0ab3 .
+_:n0cbb21ce98464358963007f95dc35c0ab3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "b" .
+_:n0cbb21ce98464358963007f95dc35c0ab3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n0cbb21ce98464358963007f95dc35c0ab4 .
+_:n0cbb21ce98464358963007f95dc35c0ab4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "5" .
+_:n0cbb21ce98464358963007f95dc35c0ab4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n0cbb21ce98464358963007f95dc35c0ab5 .
+_:n0cbb21ce98464358963007f95dc35c0ab5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "6" .
+_:n0cbb21ce98464358963007f95dc35c0ab5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n0cbb21ce98464358963007f95dc35c0ab6 .
+_:n0cbb21ce98464358963007f95dc35c0ab6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "d" .
+_:n0cbb21ce98464358963007f95dc35c0ab6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n0cbb21ce98464358963007f95dc35c0ab7 .
+_:n0cbb21ce98464358963007f95dc35c0ab7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "e" .
+_:n0cbb21ce98464358963007f95dc35c0ab7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+
+<http://example.com/base/e/b> <http://example.com/ns#with> <http://example.com/base/c/b> .
+<http://example.com/base/c/b> <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" .
+<http://example.com/base/c/b> <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n0cbb21ce98464358963007f95dc35c0ab8 .
+_:n0cbb21ce98464358963007f95dc35c0ab8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "4" .
+_:n0cbb21ce98464358963007f95dc35c0ab8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n0cbb21ce98464358963007f95dc35c0ab9 .
+_:n0cbb21ce98464358963007f95dc35c0ab9 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "c" .
+_:n0cbb21ce98464358963007f95dc35c0ab9 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+
+
+

27. RMLTC-CC-0007-NES

+

Title: Nested gather maps

+

Description: Testing whether nested gather maps are created. The mapping should generate a list of bags.

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0007-NES/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/>.
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+@prefix ex:  <http://example.com/ns#>.
+@base        <http://example.com/>.
+
+<#TM> a rml:TriplesMap;
+    rml:logicalSource [
+        rml:source _:b738439 ;
+        rml:referenceFormulation rml:JSONPath ;
+        rml:iterator "$.*" ;
+    ] ;
+
+    rml:subjectMap [
+        rml:template "e/{$.id}" ;
+    ] ;
+
+    rml:predicateObjectMap [
+        rml:predicate ex:with ;
+        rml:objectMap [
+            rml:gather (
+                [
+                    rml:gather ( [ rml:reference "$.v1.*" ; ] ) ;
+                    rml:gatherAs rdf:Bag ;
+                ]
+                [
+                    rml:gather ( [ rml:reference "$.v2.*" ; ] ) ;
+                    rml:gatherAs rdf:Bag ;
+                ]
+            ) ;
+            rml:gatherAs rdf:List ;
+        ] ;
+    ] ;
+.
+
+_:b738439 a rml:RelativePathSource ;
+    rml:path "data.json" .
+
+

Output

+
_:nab9af1206e584ab2afd457e8a605872cb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
+_:nab9af1206e584ab2afd457e8a605872cb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "1" .
+_:nab9af1206e584ab2afd457e8a605872cb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "2" .
+
+_:nab9af1206e584ab2afd457e8a605872cb2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
+_:nab9af1206e584ab2afd457e8a605872cb2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "a" .
+_:nab9af1206e584ab2afd457e8a605872cb2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "b" .
+
+_:nab9af1206e584ab2afd457e8a605872cb5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
+_:nab9af1206e584ab2afd457e8a605872cb5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "3" .
+_:nab9af1206e584ab2afd457e8a605872cb5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "4" .
+
+_:nab9af1206e584ab2afd457e8a605872cb6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
+_:nab9af1206e584ab2afd457e8a605872cb6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "c" .
+
+<http://example.com/base/e/a> <http://example.com/ns#with> _:nab9af1206e584ab2afd457e8a605872cb3 .
+_:nab9af1206e584ab2afd457e8a605872cb3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> _:nab9af1206e584ab2afd457e8a605872cb1 .
+_:nab9af1206e584ab2afd457e8a605872cb3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nab9af1206e584ab2afd457e8a605872cb4 .
+
+_:nab9af1206e584ab2afd457e8a605872cb4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> _:nab9af1206e584ab2afd457e8a605872cb2 .
+_:nab9af1206e584ab2afd457e8a605872cb4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+
+<http://example.com/base/e/b> <http://example.com/ns#with> _:nab9af1206e584ab2afd457e8a605872cb7 .
+_:nab9af1206e584ab2afd457e8a605872cb7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> _:nab9af1206e584ab2afd457e8a605872cb5 .
+_:nab9af1206e584ab2afd457e8a605872cb7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nab9af1206e584ab2afd457e8a605872cb8 .
+
+_:nab9af1206e584ab2afd457e8a605872cb8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> _:nab9af1206e584ab2afd457e8a605872cb6 .
+_:nab9af1206e584ab2afd457e8a605872cb8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+
+
+
+

28. RMLTC-CC-0008-ROMa

+

Title: Elements via reference object-map.

+

Description: Testing whether gather maps generate an RDF list whose members are generated by a referencing object-map.

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0008-ROMa/Friends.json

+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+
+_:b273446 a rml:RelativePathSource ;
+    rml:path "student.csv" .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap ;
+    rml:logicalSource [ a rml:LogicalSource ;
+            rml:referenceFormulation rml:CSV ;
+            rml:source _:b273446 ] ;
+            
+    rml:predicateObjectMap [ 
+        rml:objectMap [
+                rml:reference "ID" ; rml:termType rml:BlankNode ;
+                rml:gather ( 
+                    [ 
+                        rml:parentTriplesMap <http://example.com/base/TriplesMap1> ;
+                        rml:joinCondition [ rml:child "Sport" ; rml:parent "Sport" ] ;
+                    ] 
+                ) ;
+                rml:gatherAs rdf:List;
+            ] ;    
+        rml:predicate ex:sameSportAs 
+    ] ;
+
+    rml:subjectMap [ rml:template "http://example.com/Student/{ID}/{Name}" ] .
+
+

Output

+
_:genid1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> <http://example.com/Student/10/Venus%20Williams> .
+_:genid1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:genid2 .
+_:genid2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> <http://example.com/Student/20/Serena%20Williams> .
+_:genid2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+<http://example.com/Student/10/Venus%20Williams> <http://example.com/sameSportAs> _:genid1 .
+_:genid3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> <http://example.com/Student/10/Venus%20Williams> .
+_:genid3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:genid4 .
+_:genid4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> <http://example.com/Student/20/Serena%20Williams> .
+_:genid4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+<http://example.com/Student/20/Serena%20Williams> <http://example.com/sameSportAs> _:genid3 .
+_:genid5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> <http://example.com/Student/30/Loena%20Hendrickx> .
+_:genid5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+<http://example.com/Student/30/Loena%20Hendrickx> <http://example.com/sameSportAs> _:genid5 .
+
+
+

29. RMLTC-CC-0008-ROMb

+

Title: Elements via reference object-map with default join condition

+

Description: Testing whether gather maps generate an RDF list whose members are generated by a referencing object-map with a default join condition.

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0008-ROMb/Friends.json

+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+
+_:b273446 a rml:RelativePathSource ;
+    rml:path "student.csv" .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap ;
+    rml:logicalSource [ a rml:LogicalSource ;
+            rml:referenceFormulation rml:CSV ;
+            rml:source _:b273446 ] ;
+            
+    rml:predicateObjectMap [
+        rml:objectMap [
+            rml:reference "ID" ; rml:termType rml:BlankNode ;
+            rml:gather ( 
+                [ 
+                    rml:parentTriplesMap <http://example.com/base/TriplesMap1> ;
+                ] 
+            ) ;
+            rml:gatherAs rdf:List;
+        ] ;
+        rml:predicate ex:sameSportAs 
+    ] ;
+        
+    rml:subjectMap [ rml:template "http://example.com/Student/{ID}/{Name}" ] .
+
+
+

Output

+
_:genid1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> <http://example.com/Student/30/Loena%20Hendrickx> .
+_:genid1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+<http://example.com/Student/30/Loena%20Hendrickx> <http://example.com/sameSportAs> _:genid1 .
+_:genid2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> <http://example.com/Student/20/Serena%20Williams> .
+_:genid2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+<http://example.com/Student/20/Serena%20Williams> <http://example.com/sameSportAs> _:genid2 .
+_:genid3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> <http://example.com/Student/10/Venus%20Williams> .
+_:genid3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+<http://example.com/Student/10/Venus%20Williams> <http://example.com/sameSportAs> _:genid3 .
+
+
+

30. RMLTC-CC-0009-DUP-Bag

+

Title: Gather duplicate values in an RDF Bag

+

Description: Testing the expected behavior of multi-valued expression maps containing duplicate values when these expression maps are used in a gather map to create an RDF Bag.

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0009-DUP-Bag/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/>.
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+@prefix ex:  <http://example.com/ns#>.
+@base        <http://example.com/>.
+
+<#TM> a rml:TriplesMap;
+    rml:logicalSource [
+        rml:source _:b738439 ;
+        rml:referenceFormulation rml:JSONPath ;
+        rml:iterator "$.*" ;
+    ] ;
+
+    rml:subjectMap [
+        rml:template "e/{$.id}" ;
+    ] ;
+
+    rml:predicateObjectMap [
+        rml:predicate ex:with ;
+        rml:objectMap [
+            rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
+            rml:gatherAs rdf:Bag ;
+        ] ;
+    ] ;
+.
+
+_:b738439 a rml:RelativePathSource ;
+    rml:path "data.json" .
+
+

Output

+
_:nc808fbd2e11a4baa939c61c8210b5909b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
+_:nc808fbd2e11a4baa939c61c8210b5909b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "2" .
+_:nc808fbd2e11a4baa939c61c8210b5909b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
+_:nc808fbd2e11a4baa939c61c8210b5909b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
+_:nc808fbd2e11a4baa939c61c8210b5909b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "9" .
+_:nc808fbd2e11a4baa939c61c8210b5909b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "1" .
+<http://example.com/base/e/b> <http://example.com/ns#with> _:nc808fbd2e11a4baa939c61c8210b5909b2 .
+_:nc808fbd2e11a4baa939c61c8210b5909b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "1" .
+<http://example.com/base/e/c> <http://example.com/ns#with> _:nc808fbd2e11a4baa939c61c8210b5909b3 .
+<http://example.com/base/e/a> <http://example.com/ns#with> _:nc808fbd2e11a4baa939c61c8210b5909b1 .
+_:nc808fbd2e11a4baa939c61c8210b5909b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "2" .
+_:nc808fbd2e11a4baa939c61c8210b5909b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "7" .
+_:nc808fbd2e11a4baa939c61c8210b5909b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "6" .
+_:nc808fbd2e11a4baa939c61c8210b5909b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "1" .
+_:nc808fbd2e11a4baa939c61c8210b5909b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "8" .
+
+
+

31. RMLTC-CC-0009-DUP-List

+

Title: Gather duplicate values in an RDF List

+

Description: Testing the expected behavior of multi-valued expression maps containing duplicate values when these expression maps are used in a gather map to create a list.

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0009-DUP-List/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/>.
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+@prefix ex:  <http://example.com/ns#>.
+@base        <http://example.com/>.
+
+<#TM> a rml:TriplesMap;
+    rml:logicalSource [
+        rml:source _:b738439 ;
+        rml:referenceFormulation rml:JSONPath ;
+        rml:iterator "$.*" ;
+    ] ;
+
+    rml:subjectMap [
+        rml:template "e/{$.id}" ;
+    ] ;
+
+    rml:predicateObjectMap [
+        rml:predicate ex:with ;
+        rml:objectMap [
+            rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
+            rml:gatherAs rdf:List ;
+        ] ;
+    ] ;
+.
+
+_:b738439 a rml:RelativePathSource ;
+    rml:path "data.json" .
+
+

Output

+
<http://example.com/base/e/a> <http://example.com/ns#with> _:n988e0f11d19c486fa3b3255f94c9b3bab1 .
+_:n988e0f11d19c486fa3b3255f94c9b3bab1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
+_:n988e0f11d19c486fa3b3255f94c9b3bab1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n988e0f11d19c486fa3b3255f94c9b3bab2 .
+_:n988e0f11d19c486fa3b3255f94c9b3bab2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
+_:n988e0f11d19c486fa3b3255f94c9b3bab2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n988e0f11d19c486fa3b3255f94c9b3bab3 .
+_:n988e0f11d19c486fa3b3255f94c9b3bab3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
+_:n988e0f11d19c486fa3b3255f94c9b3bab3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+
+<http://example.com/base/e/b> <http://example.com/ns#with> _:n988e0f11d19c486fa3b3255f94c9b3bab4 .
+_:n988e0f11d19c486fa3b3255f94c9b3bab4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
+_:n988e0f11d19c486fa3b3255f94c9b3bab4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n988e0f11d19c486fa3b3255f94c9b3bab5 .
+_:n988e0f11d19c486fa3b3255f94c9b3bab5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
+_:n988e0f11d19c486fa3b3255f94c9b3bab5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n988e0f11d19c486fa3b3255f94c9b3bab6 .
+_:n988e0f11d19c486fa3b3255f94c9b3bab6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "6" .
+_:n988e0f11d19c486fa3b3255f94c9b3bab6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+
+<http://example.com/base/e/c> <http://example.com/ns#with> _:n988e0f11d19c486fa3b3255f94c9b3bab7 .
+_:n988e0f11d19c486fa3b3255f94c9b3bab7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "7" .
+_:n988e0f11d19c486fa3b3255f94c9b3bab7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n988e0f11d19c486fa3b3255f94c9b3bab8 .
+_:n988e0f11d19c486fa3b3255f94c9b3bab8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "8" .
+_:n988e0f11d19c486fa3b3255f94c9b3bab8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n988e0f11d19c486fa3b3255f94c9b3bab9 .
+_:n988e0f11d19c486fa3b3255f94c9b3bab9 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "9" .
+_:n988e0f11d19c486fa3b3255f94c9b3bab9 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+
+
+

32. RMLTC-CC-0010-Lista

+

Title: Combining graph maps and gather maps (graph map has a template and gather map does not)

+

Description: Tests the behavior of combining graph- and gather maps. In this example, a blank node for each list is expected.

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0010-Lista/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/>.
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+@prefix ex:  <http://example.com/ns#>.
+@base        <http://example.com/>.
+
+<#TM> a rml:TriplesMap;
+    rml:logicalSource [
+        rml:source _:b738439 ;
+        rml:referenceFormulation rml:JSONPath ;
+        rml:iterator "$.*" ;
+    ] ;
+
+    rml:subjectMap [
+        rml:template "e/{$.id}" ;
+    ] ;
+
+    rml:predicateObjectMap [
+        rml:graphMap [ rml:template "g/{$.graph}" ; ] ;
+        rml:predicate ex:with ;
+        rml:objectMap [
+            rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
+            rml:gatherAs rdf:List ;
+        ] ;
+    ] ;
+.
+
+_:b738439 a rml:RelativePathSource ;
+    rml:path "data.json" .
+
+

Output

+
_:genid1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" <http://example.com/base/g/1> .
+_:genid1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> <http://example.com/base/g/1> .
+_:genid2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" <http://example.com/base/g/1> .
+_:genid2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> <http://example.com/base/g/1> .
+<http://example.com/base/e/a> <http://example.com/ns#with> _:genid1 <http://example.com/base/g/1> .
+<http://example.com/base/e/a> <http://example.com/ns#with> _:genid2 <http://example.com/base/g/1> .
+
+_:genidx1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" <http://example.com/base/g/2> .
+_:genidx1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> <http://example.com/base/g/2> .
+<http://example.com/base/e/a> <http://example.com/ns#with> _:genidx1 <http://example.com/base/g/2> .
+
+
+

33. RMLTC-CC-0010-Listb

+

Title: Combining graph maps and gather maps (both graph map and gather map have a template)

+

Description: Tests the behavior of combining graph- and gather maps. In this example, lists are concatinated in some named graphs via blank node identifiers constructed with templates.

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0010-Listb/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/>.
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+@prefix ex:  <http://example.com/ns#>.
+@base        <http://example.com/>.
+
+<#TM> a rml:TriplesMap;
+    rml:logicalSource [
+        rml:source _:b738439 ;
+        rml:referenceFormulation rml:JSONPath ;
+        rml:iterator "$.*" ;
+    ] ;
+
+    rml:subjectMap [
+        rml:template "e/{$.id}" ;
+    ] ;
+
+    rml:predicateObjectMap [
+        rml:graphMap [ rml:template "g/{$.graph}" ; ] ;
+        rml:predicate ex:with ;
+        rml:objectMap [
+            rml:template "l/{$.id}" ; rml:termType rml:BlankNode ;
+            rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
+            rml:gatherAs rdf:List ;
+        ] ;
+    ] ;
+.
+
+_:b738439 a rml:RelativePathSource ;
+    rml:path "data.json" .
+
+

Output

+
_:genid1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" <http://example.com/base/g/1> .
+_:genid1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:genid2 <http://example.com/base/g/1> .
+_:genid2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" <http://example.com/base/g/1> .
+_:genid2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> <http://example.com/base/g/1> .
+<http://example.com/base/e/a> <http://example.com/ns#with> _:genid1 <http://example.com/base/g/1> .
+
+_:genidx1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" <http://example.com/base/g/2> .
+_:genidx1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> <http://example.com/base/g/2> .
+<http://example.com/base/e/a> <http://example.com/ns#with> _:genidx1 <http://example.com/base/g/2> .
+
+
+ + + + + \ No newline at end of file diff --git a/src/test/resources/rml-cc/docs/20250225/index.html b/src/test/resources/rml-cc/docs/20250225/index.html new file mode 100644 index 00000000..cfe40fdb --- /dev/null +++ b/src/test/resources/rml-cc/docs/20250225/index.html @@ -0,0 +1,2472 @@ + + + + + + +RML-CC: Test Cases + + + + + + + + + + + + + + + + + + +

Abstract

This document describes the [RML] vocabulary and approach to generating RDF containers and collections [RDF11-Concepts].

+
+ +

Status of This Document

+ This specification was published by the + Knowledge Graph Construction Community Group. It is not a W3C Standard nor is it + on the W3C Standards Track. + + Please note that under the + W3C Community Contributor License Agreement (CLA) + there is a limited opt-out and other conditions apply. + + Learn more about + W3C Community and Business Groups. +

+ +

1. Introduction

+

This document defines the RML-CC test cases, consisting of a collection of test case documents (input and expected output). +The purpose of the test cases is to determine the conformance of tools that execute RML rules to the RML-CC specification.

+
+ +

2. Data model

+

The test cases are semantically described for re-usability and shareability following the W3C Test case description. +Each test:Testcase as the following properties:

+
    +
  • dcterms:identifier: unique ID of the test case.
  • +
  • rmltest:hasError: if an error of the RML Processor is expected or not.
  • +
  • rmltest:input: One or more input data of the test case.
  • +
  • rmltest:output: One or more output data of the test case.
  • +
  • rmltest:inputFormat: the input data format.
  • +
  • rmltest:outputFormat: the output data format.
  • +
  • rmltest:mappingDocument: the RML mapping rules in Turtle.
  • +
+
+ +

3. Test cases

+

This section describes the RML-CC test cases. These descriptions are also available as RDF. +The files are available on GitHub in the folder test-cases. +Each test case is contained in a single folder, containing three types of files:

+
    +
  • Zero or more files containing the data sources, in the case of JSON, XML, CSV, or containing the SQL statements to create the necessary tables, in the case of MySQL, PostgreSQL, and SQL Server.
  • +
  • One file with the RML rules, called mapping.ttl, in the Turtle format.
  • +
  • Zero or more files with the expected RDF. No file is provided if an error is expected that must halt the generation of the RDF because of an error.
  • +
+
+ + +

4. RMLTC-CC-0001-Alt

+

Title: Generate a rdf:Alt as an object

+

Description: Tests if a rdf:Alt is generated as an object

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0001-Alt/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/>.
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+@prefix ex:  <http://example.com/ns#>.
+@base        <http://example.com/>.
+
+<#TM> a rml:TriplesMap;
+    rml:logicalSource [
+        rml:source _:b738439 ;
+        rml:referenceFormulation rml:JSONPath ;
+        rml:iterator "$.*" ;
+    ] ;
+
+    rml:subjectMap [
+        rml:template "e/{$.id}" ;
+    ] ;
+
+    rml:predicateObjectMap [
+        rml:predicate ex:with ;
+        rml:objectMap [
+            rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
+            rml:gatherAs rdf:Alt ;
+        ] ;
+    ] ;
+.
+
+_:b738439 a rml:RelativePathSource ;
+    rml:path "data.json" .
+
+

Output

+
<http://example.com/base/e/a> <http://example.com/ns#with> _:nc808fbd2e11a4baa939c61c8210b5909b1 .
+_:nc808fbd2e11a4baa939c61c8210b5909b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Alt> .
+_:nc808fbd2e11a4baa939c61c8210b5909b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "1" .
+_:nc808fbd2e11a4baa939c61c8210b5909b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "2" .
+_:nc808fbd2e11a4baa939c61c8210b5909b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "3" .
+
+<http://example.com/base/e/b> <http://example.com/ns#with> _:nc808fbd2e11a4baa939c61c8210b5909b2 .
+_:nc808fbd2e11a4baa939c61c8210b5909b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Alt> .
+_:nc808fbd2e11a4baa939c61c8210b5909b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "4" .
+_:nc808fbd2e11a4baa939c61c8210b5909b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "5" .
+_:nc808fbd2e11a4baa939c61c8210b5909b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "6" .
+
+<http://example.com/base/e/c> <http://example.com/ns#with> _:nc808fbd2e11a4baa939c61c8210b5909b3 .
+_:nc808fbd2e11a4baa939c61c8210b5909b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Alt> .
+_:nc808fbd2e11a4baa939c61c8210b5909b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "7" .
+_:nc808fbd2e11a4baa939c61c8210b5909b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "8" .
+_:nc808fbd2e11a4baa939c61c8210b5909b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "9" .
+
+
+

5. RMLTC-CC-0001-Bag

+

Title: Generate a rdf:Bag as an object

+

Description: Tests if a rdf:Bag is generated as an object

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0001-Bag/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/>.
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+@prefix ex:  <http://example.com/ns#>.
+@base        <http://example.com/>.
+
+<#TM> a rml:TriplesMap;
+    rml:logicalSource [
+        rml:source _:b738439 ;
+        rml:referenceFormulation rml:JSONPath ;
+        rml:iterator "$.*" ;
+    ] ;
+
+    rml:subjectMap [
+        rml:template "e/{$.id}" ;
+    ] ;
+
+    rml:predicateObjectMap [
+        rml:predicate ex:with ;
+        rml:objectMap [
+            rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
+            rml:gatherAs rdf:Bag ;
+        ] ;
+    ] ;
+.
+
+_:b738439 a rml:RelativePathSource ;
+    rml:path "data.json" .
+
+

Output

+
_:nc808fbd2e11a4baa939c61c8210b5909b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
+_:nc808fbd2e11a4baa939c61c8210b5909b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "5" .
+_:nc808fbd2e11a4baa939c61c8210b5909b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
+_:nc808fbd2e11a4baa939c61c8210b5909b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
+_:nc808fbd2e11a4baa939c61c8210b5909b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "9" .
+_:nc808fbd2e11a4baa939c61c8210b5909b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "2" .
+<http://example.com/base/e/b> <http://example.com/ns#with> _:nc808fbd2e11a4baa939c61c8210b5909b2 .
+_:nc808fbd2e11a4baa939c61c8210b5909b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "1" .
+<http://example.com/base/e/c> <http://example.com/ns#with> _:nc808fbd2e11a4baa939c61c8210b5909b3 .
+<http://example.com/base/e/a> <http://example.com/ns#with> _:nc808fbd2e11a4baa939c61c8210b5909b1 .
+_:nc808fbd2e11a4baa939c61c8210b5909b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "4" .
+_:nc808fbd2e11a4baa939c61c8210b5909b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "7" .
+_:nc808fbd2e11a4baa939c61c8210b5909b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "6" .
+_:nc808fbd2e11a4baa939c61c8210b5909b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "3" .
+_:nc808fbd2e11a4baa939c61c8210b5909b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "8" .
+
+
+

6. RMLTC-CC-0001-List

+

Title: Generate a rdf:List as an object

+

Description: Tests if a rdf:List is generated as an object

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0001-List/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/>.
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+@prefix ex:  <http://example.com/ns#>.
+@base        <http://example.com/>.
+
+<#TM> a rml:TriplesMap;
+    rml:logicalSource [
+        rml:source _:b738439 ;
+        rml:referenceFormulation rml:JSONPath ;
+        rml:iterator "$.*" ;
+    ] ;
+
+    rml:subjectMap [
+        rml:template "e/{$.id}" ;
+    ] ;
+
+    rml:predicateObjectMap [
+        rml:predicate ex:with ;
+        rml:objectMap [
+            rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
+            rml:gatherAs rdf:List ;
+        ] ;
+    ] ;
+.
+
+_:b738439 a rml:RelativePathSource ;
+    rml:path "data.json" .
+
+

Output

+
<http://example.com/base/e/a> <http://example.com/ns#with> _:n988e0f11d19c486fa3b3255f94c9b3bab1 .
+_:n988e0f11d19c486fa3b3255f94c9b3bab1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
+_:n988e0f11d19c486fa3b3255f94c9b3bab1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n988e0f11d19c486fa3b3255f94c9b3bab2 .
+_:n988e0f11d19c486fa3b3255f94c9b3bab2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
+_:n988e0f11d19c486fa3b3255f94c9b3bab2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n988e0f11d19c486fa3b3255f94c9b3bab3 .
+_:n988e0f11d19c486fa3b3255f94c9b3bab3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" .
+_:n988e0f11d19c486fa3b3255f94c9b3bab3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+
+<http://example.com/base/e/b> <http://example.com/ns#with> _:n988e0f11d19c486fa3b3255f94c9b3bab4 .
+_:n988e0f11d19c486fa3b3255f94c9b3bab4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "4" .
+_:n988e0f11d19c486fa3b3255f94c9b3bab4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n988e0f11d19c486fa3b3255f94c9b3bab5 .
+_:n988e0f11d19c486fa3b3255f94c9b3bab5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "5" .
+_:n988e0f11d19c486fa3b3255f94c9b3bab5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n988e0f11d19c486fa3b3255f94c9b3bab6 .
+_:n988e0f11d19c486fa3b3255f94c9b3bab6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "6" .
+_:n988e0f11d19c486fa3b3255f94c9b3bab6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+
+<http://example.com/base/e/c> <http://example.com/ns#with> _:n988e0f11d19c486fa3b3255f94c9b3bab7 .
+_:n988e0f11d19c486fa3b3255f94c9b3bab7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "7" .
+_:n988e0f11d19c486fa3b3255f94c9b3bab7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n988e0f11d19c486fa3b3255f94c9b3bab8 .
+_:n988e0f11d19c486fa3b3255f94c9b3bab8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "8" .
+_:n988e0f11d19c486fa3b3255f94c9b3bab8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n988e0f11d19c486fa3b3255f94c9b3bab9 .
+_:n988e0f11d19c486fa3b3255f94c9b3bab9 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "9" .
+_:n988e0f11d19c486fa3b3255f94c9b3bab9 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+
+
+

7. RMLTC-CC-0001-Seq

+

Title: Generate a rdf:Seq as an object

+

Description: Tests if a rdf:Seq is generated as an object

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0001-Seq/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/>.
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+@prefix ex:  <http://example.com/ns#>.
+@base        <http://example.com/>.
+
+<#TM> a rml:TriplesMap;
+    rml:logicalSource [
+        rml:source _:b738439 ;
+        rml:referenceFormulation rml:JSONPath ;
+        rml:iterator "$.*" ;
+    ] ;
+
+    rml:subjectMap [
+        rml:template "e/{$.id}" ;
+    ] ;
+
+    rml:predicateObjectMap [
+        rml:predicate ex:with ;
+        rml:objectMap [
+            rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
+            rml:gatherAs rdf:Seq ;
+        ] ;
+    ] ;
+.
+
+_:b738439 a rml:RelativePathSource ;
+    rml:path "data.json" .
+
+

Output

+
_:nc808fbd2e11a4baa939c61c8210b5909b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Seq> .
+_:nc808fbd2e11a4baa939c61c8210b5909b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "5" .
+_:nc808fbd2e11a4baa939c61c8210b5909b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Seq> .
+_:nc808fbd2e11a4baa939c61c8210b5909b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Seq> .
+_:nc808fbd2e11a4baa939c61c8210b5909b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "9" .
+_:nc808fbd2e11a4baa939c61c8210b5909b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "2" .
+<http://example.com/base/e/b> <http://example.com/ns#with> _:nc808fbd2e11a4baa939c61c8210b5909b2 .
+_:nc808fbd2e11a4baa939c61c8210b5909b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "1" .
+<http://example.com/base/e/c> <http://example.com/ns#with> _:nc808fbd2e11a4baa939c61c8210b5909b3 .
+<http://example.com/base/e/a> <http://example.com/ns#with> _:nc808fbd2e11a4baa939c61c8210b5909b1 .
+_:nc808fbd2e11a4baa939c61c8210b5909b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "4" .
+_:nc808fbd2e11a4baa939c61c8210b5909b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "7" .
+_:nc808fbd2e11a4baa939c61c8210b5909b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "6" .
+_:nc808fbd2e11a4baa939c61c8210b5909b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "3" .
+_:nc808fbd2e11a4baa939c61c8210b5909b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "8" .
+
+
+

8. RMLTC-CC-0002-Bag

+

Title: Generate a named rdf:Bag as an object

+

Description: Tests if a named rdf:Bag is generated as an object

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0002-Bag/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/>.
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+@prefix ex:  <http://example.com/ns#>.
+@base        <http://example.com/>.
+
+<#TM> a rml:TriplesMap;
+    rml:logicalSource [
+        rml:source _:b738439 ;
+        rml:referenceFormulation rml:JSONPath ;
+        rml:iterator "$.*" ;
+    ] ;
+
+    rml:subjectMap [
+        rml:template "e/{$.id}" ;
+    ] ;
+
+    rml:predicateObjectMap [
+        rml:predicate ex:with ;
+        rml:objectMap [
+            rml:template "c/{$.id}" ;
+            rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
+            rml:gatherAs rdf:Bag ;
+        ] ;
+    ] ;
+.
+
+_:b738439 a rml:RelativePathSource ;
+    rml:path "data.json" .
+
+

Output

+
<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
+<http://example.com/base/c/c> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "7" .
+<http://example.com/base/c/c> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "8" .
+<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "2" .
+<http://example.com/base/e/c> <http://example.com/ns#with> <http://example.com/base/c/c> .
+<http://example.com/base/c/c> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
+<http://example.com/base/c/b> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "6" .
+<http://example.com/base/e/a> <http://example.com/ns#with> <http://example.com/base/c/a> .
+<http://example.com/base/c/c> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "9" .
+<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "1" .
+<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "3" .
+<http://example.com/base/c/b> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "4" .
+<http://example.com/base/e/b> <http://example.com/ns#with> <http://example.com/base/c/b> .
+<http://example.com/base/c/b> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
+<http://example.com/base/c/b> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "5" .
+
+
+

9. RMLTC-CC-0002-List

+

Title: Generate a named rdf:List as an object

+

Description: Tests if a named rdf:List is generated as an object

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0002-List/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/>.
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+@prefix ex:  <http://example.com/ns#>.
+@base        <http://example.com/>.
+
+<#TM> a rml:TriplesMap;
+    rml:logicalSource [
+        rml:source _:b738439 ;
+        rml:referenceFormulation rml:JSONPath ;
+        rml:iterator "$.*" ;
+    ] ;
+
+    rml:subjectMap [
+        rml:template "e/{$.id}" ;
+    ] ;
+
+    rml:predicateObjectMap [
+        rml:predicate ex:with ;
+        rml:objectMap [
+            rml:template "c/{$.id}" ;
+            rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
+            rml:gatherAs rdf:List ;
+        ] ;
+    ] ;
+.
+
+_:b738439 a rml:RelativePathSource ;
+    rml:path "data.json" .
+
+

Output

+
_:nb73dd869d6bb47a5b865ee632fe27453b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nb73dd869d6bb47a5b865ee632fe27453b2 .
+<http://example.com/base/e/c> <http://example.com/ns#with> <http://example.com/base/c/c> .
+<http://example.com/base/c/c> <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "7" .
+_:nb73dd869d6bb47a5b865ee632fe27453b5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "8" .
+_:nb73dd869d6bb47a5b865ee632fe27453b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nb73dd869d6bb47a5b865ee632fe27453b4 .
+_:nb73dd869d6bb47a5b865ee632fe27453b6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+<http://example.com/base/e/a> <http://example.com/ns#with> <http://example.com/base/c/a> .
+_:nb73dd869d6bb47a5b865ee632fe27453b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "5" .
+<http://example.com/base/c/b> <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nb73dd869d6bb47a5b865ee632fe27453b3 .
+_:nb73dd869d6bb47a5b865ee632fe27453b4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "6" .
+_:nb73dd869d6bb47a5b865ee632fe27453b4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+_:nb73dd869d6bb47a5b865ee632fe27453b5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nb73dd869d6bb47a5b865ee632fe27453b6 .
+_:nb73dd869d6bb47a5b865ee632fe27453b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+_:nb73dd869d6bb47a5b865ee632fe27453b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
+_:nb73dd869d6bb47a5b865ee632fe27453b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" .
+<http://example.com/base/c/b> <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "4" .
+<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nb73dd869d6bb47a5b865ee632fe27453b1 .
+<http://example.com/base/c/c> <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nb73dd869d6bb47a5b865ee632fe27453b5 .
+_:nb73dd869d6bb47a5b865ee632fe27453b6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "9" .
+<http://example.com/base/e/b> <http://example.com/ns#with> <http://example.com/base/c/b> .
+<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
+
+
+

10. RMLTC-CC-0003-EB

+

Title: Allow the generation of empty bags

+

Description: Tests if the use of rml:allowEmptyListAndContainer yields an empty bag.

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0003-EB/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/>.
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+@prefix ex:  <http://example.com/ns#>.
+@base        <http://example.com/>.
+
+<#TM> a rml:TriplesMap;
+    rml:logicalSource [
+        rml:source _:b738439 ;
+        rml:referenceFormulation rml:JSONPath ;
+        rml:iterator "$.*" ;
+    ] ;
+
+    rml:subjectMap [
+        rml:template "e/{$.id}" ;
+    ] ;
+
+    rml:predicateObjectMap [
+        rml:predicate ex:with ;
+        rml:objectMap [
+            rml:allowEmptyListAndContainer true ;
+            rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
+            rml:gatherAs rdf:Bag ;
+        ] ;
+    ] ;
+.
+
+_:b738439 a rml:RelativePathSource ;
+    rml:path "data.json" .
+
+

Output

+
_:nfecac3cfe48c4afa99539cc809138e96b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
+<http://example.com/base/e/a> <http://example.com/ns#with> _:nfecac3cfe48c4afa99539cc809138e96b1 .
+_:nfecac3cfe48c4afa99539cc809138e96b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
+_:nfecac3cfe48c4afa99539cc809138e96b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "1" .
+<http://example.com/base/e/b> <http://example.com/ns#with> _:nfecac3cfe48c4afa99539cc809138e96b2 .
+_:nfecac3cfe48c4afa99539cc809138e96b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "2" .
+_:nfecac3cfe48c4afa99539cc809138e96b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "3" .
+
+
+

11. RMLTC-CC-0003-EL

+

Title: Allow the generation of empty lists

+

Description: Tests if the use of rml:allowEmptyListAndContainer yields an empty list.

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0003-EL/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/>.
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+@prefix ex:  <http://example.com/ns#>.
+@base        <http://example.com/>.
+
+<#TM> a rml:TriplesMap;
+    rml:logicalSource [
+        rml:source _:b738439 ;
+        rml:referenceFormulation rml:JSONPath ;
+        rml:iterator "$.*" ;
+    ] ;
+
+    rml:subjectMap [
+        rml:template "e/{$.id}" ;
+    ] ;
+
+    rml:predicateObjectMap [
+        rml:predicate ex:with ;
+        rml:objectMap [
+            rml:allowEmptyListAndContainer true ;
+            rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
+            rml:gatherAs rdf:List ;
+        ] ;
+    ] ;
+.
+
+_:b738439 a rml:RelativePathSource ;
+    rml:path "data.json" .
+
+

Output

+
_:n302eecc856b44ed5b76965d9be2f5213b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+<http://example.com/base/e/b> <http://example.com/ns#with> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+_:n302eecc856b44ed5b76965d9be2f5213b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n302eecc856b44ed5b76965d9be2f5213b3 .
+_:n302eecc856b44ed5b76965d9be2f5213b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
+_:n302eecc856b44ed5b76965d9be2f5213b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" .
+_:n302eecc856b44ed5b76965d9be2f5213b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n302eecc856b44ed5b76965d9be2f5213b2 .
+<http://example.com/base/e/a> <http://example.com/ns#with> _:n302eecc856b44ed5b76965d9be2f5213b1 .
+_:n302eecc856b44ed5b76965d9be2f5213b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
+
+
+

12. RMLTC-CC-0003-EL-BN

+

Title: Allow the generation of empty lists identified by blank node identifiers.

+

Description: Tests if the use of rml:allowEmptyListAndContainer yields an empty list. The lists are identified by a blank node identifier generated in the mapping.

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0003-EL-BN/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/>.
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+@prefix ex:  <http://example.com/ns#>.
+@base        <http://example.com/>.
+
+<#TM> a rml:TriplesMap;
+    rml:logicalSource [
+        rml:source _:b738439 ;
+        rml:referenceFormulation rml:JSONPath ;
+        rml:iterator "$.*" ;
+    ] ;
+
+    rml:subjectMap [
+        rml:template "e/{$.id}" ;
+    ] ;
+
+    rml:predicateObjectMap [
+        rml:predicate ex:with ;
+        rml:objectMap [
+            rml:template "c/{$.id}" ; rml:termType rml:BlankNode ;
+            rml:allowEmptyListAndContainer true ;
+            rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
+            rml:gatherAs rdf:List ;
+        ] ;
+    ] ;
+.
+
+_:b738439 a rml:RelativePathSource ;
+    rml:path "data.json" .
+
+

Output

+
_:n302eecc856b44ed5b76965d9be2f5213b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+<http://example.com/base/e/b> <http://example.com/ns#with> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+_:n302eecc856b44ed5b76965d9be2f5213b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n302eecc856b44ed5b76965d9be2f5213b3 .
+_:n302eecc856b44ed5b76965d9be2f5213b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
+_:n302eecc856b44ed5b76965d9be2f5213b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" .
+_:n302eecc856b44ed5b76965d9be2f5213b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n302eecc856b44ed5b76965d9be2f5213b2 .
+<http://example.com/base/e/a> <http://example.com/ns#with> _:n302eecc856b44ed5b76965d9be2f5213b1 .
+_:n302eecc856b44ed5b76965d9be2f5213b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
+
+
+

13. RMLTC-CC-0003-EL-Named

+

Title: Allow the generation of empty lists identified by IRIs.

+

Description: Tests if the use of rml:allowEmptyListAndContainer yields an empty list. The lists are identified by a IRI generated in the mapping.

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0003-EL-Named/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/>.
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+@prefix ex:  <http://example.com/ns#>.
+@base        <http://example.com/>.
+
+<#TM> a rml:TriplesMap;
+    rml:logicalSource [
+        rml:source _:b738439 ;
+        rml:referenceFormulation rml:JSONPath ;
+        rml:iterator "$.*" ;
+    ] ;
+
+    rml:subjectMap [
+        rml:template "e/{$.id}" ;
+    ] ;
+
+    rml:predicateObjectMap [
+        rml:predicate ex:with ;
+        rml:objectMap [
+            rml:template "c/{$.id}" ;
+            rml:allowEmptyListAndContainer true ;
+            rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
+            rml:gatherAs rdf:List ;
+        ] ;
+    ] ;
+.
+
+_:b738439 a rml:RelativePathSource ;
+    rml:path "data.json" .
+
+

Output

+
_:n302eecc856b44ed5b76965d9be2f5213b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+<http://example.com/base/e/b> <http://example.com/ns#with> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+_:n302eecc856b44ed5b76965d9be2f5213b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n302eecc856b44ed5b76965d9be2f5213b3 .
+_:n302eecc856b44ed5b76965d9be2f5213b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
+_:n302eecc856b44ed5b76965d9be2f5213b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" .
+<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n302eecc856b44ed5b76965d9be2f5213b2 .
+<http://example.com/base/e/a> <http://example.com/ns#with> <http://example.com/base/c/a> .
+<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
+
+
+

14. RMLTC-CC-0003-NEB

+

Title: Empty bags are not generated

+

Description: Tests if empty containers are not generated (expected default behavior).

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0003-NEB/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/>.
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+@prefix ex:  <http://example.com/ns#>.
+@base        <http://example.com/>.
+
+<#TM> a rml:TriplesMap;
+    rml:logicalSource [
+        rml:source _:b738439 ;
+        rml:referenceFormulation rml:JSONPath ;
+        rml:iterator "$.*" ;
+    ] ;
+
+    rml:subjectMap [
+        rml:template "e/{$.id}" ;
+    ] ;
+
+    rml:predicateObjectMap [
+        rml:predicate ex:with ;
+        rml:objectMap [
+            rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
+            rml:gatherAs rdf:Bag ;
+        ] ;
+    ] ;
+.
+
+_:b738439 a rml:RelativePathSource ;
+    rml:path "data.json" .
+
+

Output

+
<http://example.com/base/e/a> <http://example.com/ns#with> _:n2bd72de9c571444081890e41009d92d4b1 .
+_:n2bd72de9c571444081890e41009d92d4b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "3" .
+_:n2bd72de9c571444081890e41009d92d4b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
+_:n2bd72de9c571444081890e41009d92d4b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "2" .
+_:n2bd72de9c571444081890e41009d92d4b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "1" .
+
+
+

15. RMLTC-CC-0003-NEL

+

Title: Empty lists are not generated

+

Description: Tests if empty lists are not generated (expected default behavior).

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0003-NEL/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/>.
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+@prefix ex:  <http://example.com/ns#>.
+@base        <http://example.com/>.
+
+<#TM> a rml:TriplesMap;
+    rml:logicalSource [
+        rml:source _:b738439 ;
+        rml:referenceFormulation rml:JSONPath ;
+        rml:iterator "$.*" ;
+    ] ;
+
+    rml:subjectMap [
+        rml:template "e/{$.id}" ;
+    ] ;
+
+    rml:predicateObjectMap [
+        rml:predicate ex:with ;
+        rml:objectMap [
+            rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
+            rml:gatherAs rdf:List ;
+        ] ;
+    ] ;
+.
+
+_:b738439 a rml:RelativePathSource ;
+    rml:path "data.json" .
+
+

Output

+
_:n434c2c54e09e4a259604ba1188ce038fb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n434c2c54e09e4a259604ba1188ce038fb2 .
+_:n434c2c54e09e4a259604ba1188ce038fb3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+_:n434c2c54e09e4a259604ba1188ce038fb2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
+<http://example.com/base/e/a> <http://example.com/ns#with> _:n434c2c54e09e4a259604ba1188ce038fb1 .
+_:n434c2c54e09e4a259604ba1188ce038fb2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n434c2c54e09e4a259604ba1188ce038fb3 .
+_:n434c2c54e09e4a259604ba1188ce038fb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
+_:n434c2c54e09e4a259604ba1188ce038fb3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" .
+
+
+

16. RMLTC-CC-0003-NELb

+

Title: Empty lists are not generated II

+

Description: Tests if empty lists are not generated (expected default behavior). This test cases uses the predicate rml:allowEmptyListAndContainer.

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0003-NELb/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/>.
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+@prefix ex:  <http://example.com/ns#>.
+@base        <http://example.com/>.
+
+<#TM> a rml:TriplesMap;
+    rml:logicalSource [
+        rml:source _:b738439 ;
+        rml:referenceFormulation rml:JSONPath ;
+        rml:iterator "$.*" ;
+    ] ;
+
+    rml:subjectMap [
+        rml:template "e/{$.id}" ;
+    ] ;
+
+    rml:predicateObjectMap [
+        rml:predicate ex:with ;
+        rml:objectMap [
+            rml:allowEmptyListAndContainer false ;
+            rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
+            rml:gatherAs rdf:List ;
+        ] ;
+    ] ;
+.
+
+_:b738439 a rml:RelativePathSource ;
+    rml:path "data.json" .
+
+

Output

+
_:n434c2c54e09e4a259604ba1188ce038fb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n434c2c54e09e4a259604ba1188ce038fb2 .
+_:n434c2c54e09e4a259604ba1188ce038fb3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+_:n434c2c54e09e4a259604ba1188ce038fb2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
+<http://example.com/base/e/a> <http://example.com/ns#with> _:n434c2c54e09e4a259604ba1188ce038fb1 .
+_:n434c2c54e09e4a259604ba1188ce038fb2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n434c2c54e09e4a259604ba1188ce038fb3 .
+_:n434c2c54e09e4a259604ba1188ce038fb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
+_:n434c2c54e09e4a259604ba1188ce038fb3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" .
+
+
+

17. RMLTC-CC-0004-SM1

+

Title: GatherMap in subject map (list)

+

Description: Tests if the use of a gather map in the subject map is supported. This test generates a list.

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0004-SM1/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/>.
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+@prefix ex:  <http://example.com/ns#>.
+@base        <http://example.com/>.
+
+<#TM> a rml:TriplesMap;
+    rml:logicalSource [
+        rml:source _:b738439 ;
+        rml:referenceFormulation rml:JSONPath ;
+        rml:iterator "$.*" ;
+    ] ;
+
+    rml:subjectMap [
+        rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
+        rml:gatherAs rdf:List ;
+    ] ;
+
+    rml:predicateObjectMap [
+        rml:predicate ex:createdBy ;
+        rml:object ex:JohnDoe ;
+    ] ;
+.
+
+_:b738439 a rml:RelativePathSource ;
+    rml:path "data.json" .
+
+

Output

+
_:n302eecc856b44ed5b76965d9be2f5213b1 <http://example.com/ns#createdBy> <http://example.com/ns#JohnDoe> .
+_:n302eecc856b44ed5b76965d9be2f5213b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
+_:n302eecc856b44ed5b76965d9be2f5213b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n302eecc856b44ed5b76965d9be2f5213b2 .
+_:n302eecc856b44ed5b76965d9be2f5213b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
+_:n302eecc856b44ed5b76965d9be2f5213b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n302eecc856b44ed5b76965d9be2f5213b3 .
+_:n302eecc856b44ed5b76965d9be2f5213b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" .
+_:n302eecc856b44ed5b76965d9be2f5213b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+_:n1d393f12e993411498da676131f81ca4b1 <http://example.com/ns#createdBy> <http://example.com/ns#JohnDoe> .
+_:n1d393f12e993411498da676131f81ca4b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "4" .
+_:n1d393f12e993411498da676131f81ca4b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n1d393f12e993411498da676131f81ca4b2 .
+_:n1d393f12e993411498da676131f81ca4b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "5" .
+_:n1d393f12e993411498da676131f81ca4b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n1d393f12e993411498da676131f81ca4b3 .
+_:n1d393f12e993411498da676131f81ca4b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "6" .
+_:n1d393f12e993411498da676131f81ca4b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+
+
+

18. RMLTC-CC-0004-SM2

+

Title: GatherMap in subject map (list)

+

Description: Tests if the use of a gather map in the subject map is supported. This test has no predicate-object maps and no class declarations in the subject map. It still needs to generate triples as the lists consists of at least one cons-pair.

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0004-SM2/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/>.
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+@prefix ex:  <http://example.com/ns#>.
+@base        <http://example.com/>.
+
+<#TM> a rml:TriplesMap;
+    rml:logicalSource [
+        rml:source _:b738439 ;
+        rml:referenceFormulation rml:JSONPath ;
+        rml:iterator "$.*" ;
+    ] ;
+
+    rml:subjectMap [
+        rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
+        rml:gatherAs rdf:List ;
+    ] ;
+.
+
+_:b738439 a rml:RelativePathSource ;
+    rml:path "data.json" .
+
+

Output

+
_:n302eecc856b44ed5b76965d9be2f5213b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
+_:n302eecc856b44ed5b76965d9be2f5213b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n302eecc856b44ed5b76965d9be2f5213b2 .
+_:n302eecc856b44ed5b76965d9be2f5213b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
+_:n302eecc856b44ed5b76965d9be2f5213b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n302eecc856b44ed5b76965d9be2f5213b3 .
+_:n302eecc856b44ed5b76965d9be2f5213b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" .
+_:n302eecc856b44ed5b76965d9be2f5213b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+_:n1d393f12e993411498da676131f81ca4b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "4" .
+_:n1d393f12e993411498da676131f81ca4b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n1d393f12e993411498da676131f81ca4b2 .
+_:n1d393f12e993411498da676131f81ca4b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "5" .
+_:n1d393f12e993411498da676131f81ca4b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n1d393f12e993411498da676131f81ca4b3 .
+_:n1d393f12e993411498da676131f81ca4b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "6" .
+_:n1d393f12e993411498da676131f81ca4b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+
+
+

19. RMLTC-CC-0004-SM3

+

Title: GatherMap in subject map (list)

+

Description: Tests if the use of a gather map in the subject map is supported. This test has no predicate-object maps and no class declarations in the subject map. Only one list needs to be generated as the other has no values and we only retain non-empty lists.

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0004-SM3/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/>.
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+@prefix ex:  <http://example.com/ns#>.
+@base        <http://example.com/>.
+
+<#TM> a rml:TriplesMap;
+    rml:logicalSource [
+        rml:source _:b738439 ;
+        rml:referenceFormulation rml:JSONPath ;
+        rml:iterator "$.*" ;
+    ] ;
+
+    rml:subjectMap [
+        rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
+        rml:gatherAs rdf:List ;
+    ] ;
+.
+
+_:b738439 a rml:RelativePathSource ;
+    rml:path "data.json" .
+
+

Output

+
_:n648f8cf4c58149e8a0feea26fb2a5b5bb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
+_:n648f8cf4c58149e8a0feea26fb2a5b5bb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n648f8cf4c58149e8a0feea26fb2a5b5bb2 .
+_:n648f8cf4c58149e8a0feea26fb2a5b5bb3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" .
+_:n648f8cf4c58149e8a0feea26fb2a5b5bb2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n648f8cf4c58149e8a0feea26fb2a5b5bb3 .
+_:n648f8cf4c58149e8a0feea26fb2a5b5bb2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
+_:n648f8cf4c58149e8a0feea26fb2a5b5bb3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+
+
+

20. RMLTC-CC-0004-SM4

+

Title: GatherMap in subject map (bag)

+

Description: Tests if the use of a gather map in the subject map is supported. This test generates a bag.

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0004-SM4/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/>.
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+@prefix ex:  <http://example.com/ns#>.
+@base        <http://example.com/>.
+
+<#TM> a rml:TriplesMap;
+    rml:logicalSource [
+        rml:source _:b738439 ;
+        rml:referenceFormulation rml:JSONPath ;
+        rml:iterator "$.*" ;
+    ] ;
+
+    rml:subjectMap [
+        rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
+        rml:gatherAs rdf:Bag ;
+    ] ;
+
+    rml:predicateObjectMap [
+        rml:predicate ex:createdBy ;
+        rml:object ex:JohnDoe ;
+    ] ;
+.
+
+_:b738439 a rml:RelativePathSource ;
+    rml:path "data.json" .
+
+

Output

+
_:n1d393f12e993411498da676131f81ca4b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "2" .
+_:n1d393f12e993411498da676131f81ca4b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "5" .
+_:n1d393f12e993411498da676131f81ca4b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "1" .
+_:n1d393f12e993411498da676131f81ca4b2 <http://example.com/ns#createdBy> <http://example.com/ns#JohnDoe> .
+_:n1d393f12e993411498da676131f81ca4b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
+_:n1d393f12e993411498da676131f81ca4b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "3" .
+_:n1d393f12e993411498da676131f81ca4b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "4" .
+_:n1d393f12e993411498da676131f81ca4b1 <http://example.com/ns#createdBy> <http://example.com/ns#JohnDoe> .
+_:n1d393f12e993411498da676131f81ca4b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
+_:n1d393f12e993411498da676131f81ca4b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "6" .
+
+
+

21. RMLTC-CC-0004-SM5

+

Title: GatherMap in subject map (bag)

+

Description: Tests if the use of a gather map in the subject map is supported. This test has no predicate-object maps and no class declarations in the subject map. It should generate a non-empty bag and an empty bag. The reason being that a container has at least one triple ; it's type (bag, seq, or alt).

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0004-SM5/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/>.
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+@prefix ex:  <http://example.com/ns#>.
+@base        <http://example.com/>.
+
+<#TM> a rml:TriplesMap;
+    rml:logicalSource [
+        rml:source _:b738439 ;
+        rml:referenceFormulation rml:JSONPath ;
+        rml:iterator "$.*" ;
+    ] ;
+
+    rml:subjectMap [
+        rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
+        rml:gatherAs rdf:Bag ;
+    ] ;
+.
+
+_:b738439 a rml:RelativePathSource ;
+    rml:path "data.json" .
+
+

Output

+
_:ne32066984b71404a953025d001cd3cdfb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
+_:ne32066984b71404a953025d001cd3cdfb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "2" .
+_:ne32066984b71404a953025d001cd3cdfb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "1" .
+_:ne32066984b71404a953025d001cd3cdfb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "3" .
+
+
+

22. RMLTC-CC-0005-App1

+

Title: Append values of multiple term maps

+

Description: Tests appending of values from multiple term maps in an gather map. This test covers the case where all sets of values are non-empty.

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0005-App1/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/>.
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+@prefix ex:  <http://example.com/ns#>.
+@base        <http://example.com/>.
+
+<#TM> a rml:TriplesMap;
+    rml:logicalSource [
+        rml:source _:b738439 ;
+        rml:referenceFormulation rml:JSONPath ;
+        rml:iterator "$.*" ;
+    ] ;
+
+    rml:subjectMap [
+        rml:template "e/{$.id}" ;
+    ] ;
+
+    rml:predicateObjectMap [
+        rml:predicate ex:with ;
+        rml:objectMap [
+            rml:gather ( [ rml:reference "$.v1.*" ; ] [ rml:reference "$.v2.*" ; ] ) ;
+            rml:gatherAs rdf:List ;
+        ] ;
+    ] ;
+.
+
+_:b738439 a rml:RelativePathSource ;
+    rml:path "data.json" .
+
+

Output

+
<http://example.com/base/e/a> <http://example.com/ns#with> _:n1ee4a5a2b1344422919d171ab2cd6c39b1 .
+_:n1ee4a5a2b1344422919d171ab2cd6c39b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
+_:n1ee4a5a2b1344422919d171ab2cd6c39b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n1ee4a5a2b1344422919d171ab2cd6c39b2 .
+_:n1ee4a5a2b1344422919d171ab2cd6c39b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
+_:n1ee4a5a2b1344422919d171ab2cd6c39b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n1ee4a5a2b1344422919d171ab2cd6c39b4 .
+_:n1ee4a5a2b1344422919d171ab2cd6c39b4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "a" .
+_:n1ee4a5a2b1344422919d171ab2cd6c39b4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n1ee4a5a2b1344422919d171ab2cd6c39b5 .
+_:n1ee4a5a2b1344422919d171ab2cd6c39b5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "b" .
+_:n1ee4a5a2b1344422919d171ab2cd6c39b5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+<http://example.com/base/e/b> <http://example.com/ns#with> _:n1ee4a5a2b1344422919d171ab2cd6c39b6 .
+_:n1ee4a5a2b1344422919d171ab2cd6c39b6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" .
+_:n1ee4a5a2b1344422919d171ab2cd6c39b6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n1ee4a5a2b1344422919d171ab2cd6c39b7 .
+_:n1ee4a5a2b1344422919d171ab2cd6c39b7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "4" .
+_:n1ee4a5a2b1344422919d171ab2cd6c39b7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n1ee4a5a2b1344422919d171ab2cd6c39b8 .
+_:n1ee4a5a2b1344422919d171ab2cd6c39b8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "c" .
+_:n1ee4a5a2b1344422919d171ab2cd6c39b8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+
+
+

23. RMLTC-CC-0005-App2

+

Title: Append values of multiple term maps

+

Description: Tests appending of values from multiple term maps in an iteration. In this example, one of the arrays is empty and the expected behavior is to concatinate a list with the empty list.

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0005-App2/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/>.
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+@prefix ex:  <http://example.com/ns#>.
+@base        <http://example.com/>.
+
+<#TM> a rml:TriplesMap;
+    rml:logicalSource [
+        rml:source _:b738439 ;
+        rml:referenceFormulation rml:JSONPath ;
+        rml:iterator "$.*" ;
+    ] ;
+
+    rml:subjectMap [
+        rml:template "e/{$.id}" ;
+    ] ;
+
+    rml:predicateObjectMap [
+        rml:predicate ex:with ;
+        rml:objectMap [
+            rml:gather ( [ rml:reference "$.v1.*" ; ] [ rml:reference "$.v2.*" ; ] ) ;
+            rml:gatherAs rdf:List ;
+        ] ;
+    ] ;
+.
+
+_:b738439 a rml:RelativePathSource ;
+    rml:path "data.json" .
+
+

Output

+
_:n1d9b8ef217cb44f299a062d746116deab1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n1d9b8ef217cb44f299a062d746116deab2 .
+_:n1d9b8ef217cb44f299a062d746116deab5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "b" .
+_:n1d9b8ef217cb44f299a062d746116deab4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n1d9b8ef217cb44f299a062d746116deab5 .
+_:n1d9b8ef217cb44f299a062d746116deab3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n1d9b8ef217cb44f299a062d746116deab4 .
+_:n1d9b8ef217cb44f299a062d746116deab7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "5" .
+_:n1d9b8ef217cb44f299a062d746116deab2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
+_:n1d9b8ef217cb44f299a062d746116deab8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "6" .
+_:n1d9b8ef217cb44f299a062d746116deab8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+_:n1d9b8ef217cb44f299a062d746116deab3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" .
+_:n1d9b8ef217cb44f299a062d746116deab4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "a" .
+_:n1d9b8ef217cb44f299a062d746116deab5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+_:n1d9b8ef217cb44f299a062d746116deab2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n1d9b8ef217cb44f299a062d746116deab3 .
+_:n1d9b8ef217cb44f299a062d746116deab1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
+<http://example.com/base/e/a> <http://example.com/ns#with> _:n1d9b8ef217cb44f299a062d746116deab1 .
+<http://example.com/base/e/b> <http://example.com/ns#with> _:n1d9b8ef217cb44f299a062d746116deab6 .
+_:n1d9b8ef217cb44f299a062d746116deab7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n1d9b8ef217cb44f299a062d746116deab8 .
+_:n1d9b8ef217cb44f299a062d746116deab6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n1d9b8ef217cb44f299a062d746116deab7 .
+_:n1d9b8ef217cb44f299a062d746116deab6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "4" .
+
+
+

24. RMLTC-CC-0005-Car1

+

Title: Cartesian product of values from multiple term maps of a gather map.

+

Description: Tests generating the Cartesian product of values from multiple term maps in a gather map. This test covers the case where all sets of values are non-empty.

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0005-Car1/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/>.
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+@prefix ex:  <http://example.com/ns#>.
+@base        <http://example.com/>.
+
+<#TM> a rml:TriplesMap;
+    rml:logicalSource [
+        rml:source _:b738439 ;
+        rml:referenceFormulation rml:JSONPath ;
+        rml:iterator "$.*" ;
+    ] ;
+
+    rml:subjectMap [
+        rml:template "e/{$.id}" ;
+    ] ;
+
+    rml:predicateObjectMap [
+        rml:predicate ex:with ;
+        rml:objectMap [
+            rml:gather ( [ rml:reference "$.v1.*" ; ] [ rml:reference "$.v2.*" ; ] ) ;
+            rml:gatherAs rdf:List ;
+            rml:strategy rml:cartesianProduct ;
+        ] ;
+    ] ;
+.
+
+_:b738439 a rml:RelativePathSource ;
+    rml:path "data.json" .
+
+

Output

+
<http://example.com/base/e/a> <http://example.com/ns#with> _:nfc398e5692654ca98dfb3fb5432d277cb1 .
+_:nfc398e5692654ca98dfb3fb5432d277cb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
+_:nfc398e5692654ca98dfb3fb5432d277cb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nfc398e5692654ca98dfb3fb5432d277cb2 .
+_:nfc398e5692654ca98dfb3fb5432d277cb2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+_:nfc398e5692654ca98dfb3fb5432d277cb2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "a" .
+
+<http://example.com/base/e/a> <http://example.com/ns#with> _:nfc398e5692654ca98dfb3fb5432d277cb3 .
+_:nfc398e5692654ca98dfb3fb5432d277cb3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
+_:nfc398e5692654ca98dfb3fb5432d277cb3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nfc398e5692654ca98dfb3fb5432d277cb4 .
+_:nfc398e5692654ca98dfb3fb5432d277cb4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "b" .
+_:nfc398e5692654ca98dfb3fb5432d277cb4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+
+<http://example.com/base/e/a> <http://example.com/ns#with> _:nfc398e5692654ca98dfb3fb5432d277cb5 .
+_:nfc398e5692654ca98dfb3fb5432d277cb5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
+_:nfc398e5692654ca98dfb3fb5432d277cb5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nfc398e5692654ca98dfb3fb5432d277cb6 .
+_:nfc398e5692654ca98dfb3fb5432d277cb6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "a" .
+_:nfc398e5692654ca98dfb3fb5432d277cb6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+
+<http://example.com/base/e/a> <http://example.com/ns#with> _:nfc398e5692654ca98dfb3fb5432d277cb7 .
+_:nfc398e5692654ca98dfb3fb5432d277cb7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
+_:nfc398e5692654ca98dfb3fb5432d277cb7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nfc398e5692654ca98dfb3fb5432d277cb8 .
+_:nfc398e5692654ca98dfb3fb5432d277cb8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "b" .
+_:nfc398e5692654ca98dfb3fb5432d277cb8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+
+<http://example.com/base/e/b> <http://example.com/ns#with> _:nfc398e5692654ca98dfb3fb5432d277cb9 .
+_:nfc398e5692654ca98dfb3fb5432d277cb9 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" .
+_:nfc398e5692654ca98dfb3fb5432d277cb9 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nfc398e5692654ca98dfb3fb5432d277cb10 .
+_:nfc398e5692654ca98dfb3fb5432d277cb10 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "c" .
+_:nfc398e5692654ca98dfb3fb5432d277cb10 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+
+<http://example.com/base/e/b> <http://example.com/ns#with> _:nfc398e5692654ca98dfb3fb5432d277cb11 .
+_:nfc398e5692654ca98dfb3fb5432d277cb11 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "4" .
+_:nfc398e5692654ca98dfb3fb5432d277cb11 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nfc398e5692654ca98dfb3fb5432d277cb12 .
+_:nfc398e5692654ca98dfb3fb5432d277cb12 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "c" .
+_:nfc398e5692654ca98dfb3fb5432d277cb12 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+
+
+

25. RMLTC-CC-0005-Car2

+

Title: Cartesian product of values from multiple term maps of a gather map.

+

Description: Tests generating the Cartesian product of values from multiple term maps in a gather map. This test covers the case where one of the sets is empty. The Cartesian product of a set with an empty set is empty. This entry should thus not yield a list.

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0005-Car2/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/>.
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+@prefix ex:  <http://example.com/ns#>.
+@base        <http://example.com/>.
+
+<#TM> a rml:TriplesMap;
+    rml:logicalSource [
+        rml:source _:b738439 ;
+        rml:referenceFormulation rml:JSONPath ;
+        rml:iterator "$.*" ;
+    ] ;
+
+    rml:subjectMap [
+        rml:template "e/{$.id}" ;
+    ] ;
+
+    rml:predicateObjectMap [
+        rml:predicate ex:with ;
+        rml:objectMap [
+            rml:gather ( [ rml:reference "$.v1.*" ; ] [ rml:reference "$.v2.*" ; ] ) ;
+            rml:gatherAs rdf:List ;
+            rml:strategy rml:cartesianProduct ;
+        ] ;
+    ] ;
+.
+
+_:b738439 a rml:RelativePathSource ;
+    rml:path "data.json" .
+
+

Output

+
<http://example.com/base/e/a> <http://example.com/ns#with> _:nfc398e5692654ca98dfb3fb5432d277cb1 .
+_:nfc398e5692654ca98dfb3fb5432d277cb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
+_:nfc398e5692654ca98dfb3fb5432d277cb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nfc398e5692654ca98dfb3fb5432d277cb2 .
+_:nfc398e5692654ca98dfb3fb5432d277cb2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+_:nfc398e5692654ca98dfb3fb5432d277cb2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "a" .
+
+<http://example.com/base/e/a> <http://example.com/ns#with> _:nfc398e5692654ca98dfb3fb5432d277cb3 .
+_:nfc398e5692654ca98dfb3fb5432d277cb3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
+_:nfc398e5692654ca98dfb3fb5432d277cb3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nfc398e5692654ca98dfb3fb5432d277cb4 .
+_:nfc398e5692654ca98dfb3fb5432d277cb4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "b" .
+_:nfc398e5692654ca98dfb3fb5432d277cb4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+
+<http://example.com/base/e/a> <http://example.com/ns#with> _:nfc398e5692654ca98dfb3fb5432d277cb5 .
+_:nfc398e5692654ca98dfb3fb5432d277cb5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
+_:nfc398e5692654ca98dfb3fb5432d277cb5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nfc398e5692654ca98dfb3fb5432d277cb6 .
+_:nfc398e5692654ca98dfb3fb5432d277cb6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "a" .
+_:nfc398e5692654ca98dfb3fb5432d277cb6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+
+<http://example.com/base/e/a> <http://example.com/ns#with> _:nfc398e5692654ca98dfb3fb5432d277cb7 .
+_:nfc398e5692654ca98dfb3fb5432d277cb7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
+_:nfc398e5692654ca98dfb3fb5432d277cb7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nfc398e5692654ca98dfb3fb5432d277cb8 .
+_:nfc398e5692654ca98dfb3fb5432d277cb8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "b" .
+_:nfc398e5692654ca98dfb3fb5432d277cb8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+
+
+

26. RMLTC-CC-0006-IT0

+

Title: Gather values across iterations to create a collection.

+

Description: When no template, constant, or reference is given to a gather map, then each iteration yields a different collection.

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0006-IT0/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/>.
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+@prefix ex:  <http://example.com/ns#>.
+@base        <http://example.com/>.
+
+<#TM> a rml:TriplesMap;
+    rml:logicalSource [
+        rml:source _:b738439 ;
+        rml:referenceFormulation rml:JSONPath ;
+        rml:iterator "$.*" ;
+    ] ;
+
+    rml:subjectMap [
+        rml:template "e/{$.id}" ;
+    ] ;
+
+    rml:predicateObjectMap [
+        rml:predicate ex:with ;
+        rml:objectMap [
+            rml:gather ( [ rml:reference "$.v1.*" ; ] ) ;
+            rml:gatherAs rdf:List ;
+        ] ;
+    ] ;
+.
+
+_:b738439 a rml:RelativePathSource ;
+    rml:path "data.json" .
+
+

Output

+
<http://example.com/base/e/a> <http://example.com/ns#with> _:n9d785cd672d3484cb5d9fd831e6dfc07b1 .
+_:n9d785cd672d3484cb5d9fd831e6dfc07b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
+_:n9d785cd672d3484cb5d9fd831e6dfc07b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n9d785cd672d3484cb5d9fd831e6dfc07b2 .
+_:n9d785cd672d3484cb5d9fd831e6dfc07b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
+_:n9d785cd672d3484cb5d9fd831e6dfc07b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+
+<http://example.com/base/e/b> <http://example.com/ns#with> _:n9d785cd672d3484cb5d9fd831e6dfc07b5 .
+_:n9d785cd672d3484cb5d9fd831e6dfc07b5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" .
+_:n9d785cd672d3484cb5d9fd831e6dfc07b5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n9d785cd672d3484cb5d9fd831e6dfc07b6 .
+_:n9d785cd672d3484cb5d9fd831e6dfc07b6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "4" .
+_:n9d785cd672d3484cb5d9fd831e6dfc07b6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+
+<http://example.com/base/e/a> <http://example.com/ns#with> _:n9d785cd672d3484cb5d9fd831e6dfc07b3 .
+_:n9d785cd672d3484cb5d9fd831e6dfc07b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "5" .
+_:n9d785cd672d3484cb5d9fd831e6dfc07b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n9d785cd672d3484cb5d9fd831e6dfc07b4 .
+_:n9d785cd672d3484cb5d9fd831e6dfc07b4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "6" .
+_:n9d785cd672d3484cb5d9fd831e6dfc07b4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+
+
+

27. RMLTC-CC-0006-IT1

+

Title: Gather values across iterations to create a collection.

+

Description: When using a template, constant, or reference for a gather map, this tests determines whether the values are correctly appended to the list. The natural order of the term maps inside the gather map as well as the iteration are respected. This test covers one term map in the gather map.

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0006-IT1/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/>.
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+@prefix ex:  <http://example.com/ns#>.
+@base        <http://example.com/>.
+
+<#TM> a rml:TriplesMap;
+    rml:logicalSource [
+        rml:source _:b738439 ;
+        rml:referenceFormulation rml:JSONPath ;
+        rml:iterator "$.*" ;
+    ] ;
+
+    rml:subjectMap [
+        rml:template "e/{$.id}" ;
+    ] ;
+
+    rml:predicateObjectMap [
+        rml:predicate ex:with ;
+        rml:objectMap [
+            rml:template "c/{$.id}" ;
+            rml:gather ( [ rml:reference "$.v1.*" ; ] ) ;
+            rml:gatherAs rdf:List ;
+        ] ;
+    ] ;
+.
+
+_:b738439 a rml:RelativePathSource ;
+    rml:path "data.json" .
+
+

Output

+
<http://example.com/base/e/a> <http://example.com/ns#with> <http://example.com/base/c/a> .
+<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
+<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nab8f496caee443c5ac19ce3a109f4b22b1 .
+_:nab8f496caee443c5ac19ce3a109f4b22b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
+_:nab8f496caee443c5ac19ce3a109f4b22b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nab8f496caee443c5ac19ce3a109f4b22b2 .
+_:nab8f496caee443c5ac19ce3a109f4b22b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "5" .
+_:nab8f496caee443c5ac19ce3a109f4b22b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nab8f496caee443c5ac19ce3a109f4b22b3 .
+_:nab8f496caee443c5ac19ce3a109f4b22b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "6" .
+_:nab8f496caee443c5ac19ce3a109f4b22b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+
+<http://example.com/base/e/b> <http://example.com/ns#with> <http://example.com/base/c/b> .
+<http://example.com/base/c/b> <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" .
+<http://example.com/base/c/b> <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nab8f496caee443c5ac19ce3a109f4b22b4 .
+_:nab8f496caee443c5ac19ce3a109f4b22b4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "4" .
+_:nab8f496caee443c5ac19ce3a109f4b22b4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+
+
+

28. RMLTC-CC-0006-IT2

+

Title: Gather values across iterations to create a collection.

+

Description: When using a template, constant, or reference for a gather map, this tests determines whether the values are correctly appended to the list. The natural order of the term maps inside the gather map as well as the iteration are respected. This test covers two term maps in the gather map.

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0006-IT2/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/>.
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+@prefix ex:  <http://example.com/ns#>.
+@base        <http://example.com/>.
+
+<#TM> a rml:TriplesMap;
+    rml:logicalSource [
+        rml:source _:b738439 ;
+        rml:referenceFormulation rml:JSONPath ;
+        rml:iterator "$.*" ;
+    ] ;
+
+    rml:subjectMap [
+        rml:template "e/{$.id}" ;
+    ] ;
+
+    rml:predicateObjectMap [
+        rml:predicate ex:with ;
+        rml:objectMap [
+            rml:template "c/{$.id}" ;
+            rml:gather ( [ rml:reference "$.v1.*" ; ] [ rml:reference "$.v2.*" ; ] ) ;
+            rml:gatherAs rdf:List ;
+        ] ;
+    ] ;
+.
+
+_:b738439 a rml:RelativePathSource ;
+    rml:path "data.json" .
+
+

Output

+
<http://example.com/base/e/a> <http://example.com/ns#with> <http://example.com/base/c/a> .
+<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
+<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n0cbb21ce98464358963007f95dc35c0ab1 .
+_:n0cbb21ce98464358963007f95dc35c0ab1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
+_:n0cbb21ce98464358963007f95dc35c0ab1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n0cbb21ce98464358963007f95dc35c0ab2 .
+_:n0cbb21ce98464358963007f95dc35c0ab2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "a" .
+_:n0cbb21ce98464358963007f95dc35c0ab2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n0cbb21ce98464358963007f95dc35c0ab3 .
+_:n0cbb21ce98464358963007f95dc35c0ab3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "b" .
+_:n0cbb21ce98464358963007f95dc35c0ab3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n0cbb21ce98464358963007f95dc35c0ab4 .
+_:n0cbb21ce98464358963007f95dc35c0ab4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "5" .
+_:n0cbb21ce98464358963007f95dc35c0ab4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n0cbb21ce98464358963007f95dc35c0ab5 .
+_:n0cbb21ce98464358963007f95dc35c0ab5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "6" .
+_:n0cbb21ce98464358963007f95dc35c0ab5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n0cbb21ce98464358963007f95dc35c0ab6 .
+_:n0cbb21ce98464358963007f95dc35c0ab6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "d" .
+_:n0cbb21ce98464358963007f95dc35c0ab6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n0cbb21ce98464358963007f95dc35c0ab7 .
+_:n0cbb21ce98464358963007f95dc35c0ab7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "e" .
+_:n0cbb21ce98464358963007f95dc35c0ab7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+
+<http://example.com/base/e/b> <http://example.com/ns#with> <http://example.com/base/c/b> .
+<http://example.com/base/c/b> <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" .
+<http://example.com/base/c/b> <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n0cbb21ce98464358963007f95dc35c0ab8 .
+_:n0cbb21ce98464358963007f95dc35c0ab8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "4" .
+_:n0cbb21ce98464358963007f95dc35c0ab8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n0cbb21ce98464358963007f95dc35c0ab9 .
+_:n0cbb21ce98464358963007f95dc35c0ab9 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "c" .
+_:n0cbb21ce98464358963007f95dc35c0ab9 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+
+
+

29. RMLTC-CC-0006-IT3

+

Title: Gather values across iterations to create a container.

+

Description: When no template, constant, or reference is given to a gather map, then each iteration yields a different container.

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0006-IT3/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/>.
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+@prefix ex:  <http://example.com/ns#>.
+@base        <http://example.com/>.
+
+<#TM> a rml:TriplesMap;
+    rml:logicalSource [
+        rml:source _:b738439 ;
+        rml:referenceFormulation rml:JSONPath ;
+        rml:iterator "$.*" ;
+    ] ;
+
+    rml:subjectMap [
+        rml:template "e/{$.id}" ;
+    ] ;
+
+    rml:predicateObjectMap [
+        rml:predicate ex:with ;
+        rml:objectMap [
+            rml:gather ( [ rml:reference "$.v1.*" ; ] ) ;
+            rml:gatherAs rdf:Bag ;
+        ] ;
+    ] ;
+.
+
+_:b738439 a rml:RelativePathSource ;
+    rml:path "data.json" .
+
+

Output

+
<http://example.com/base/e/a> <http://example.com/ns#with> _:a .
+_:a <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
+_:a <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "1" .
+_:a <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "2" .
+
+<http://example.com/base/e/b> <http://example.com/ns#with> _:b .
+_:b <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
+_:b <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "3" .
+_:b <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "4" .
+
+<http://example.com/base/e/a> <http://example.com/ns#with> _:c .
+_:c <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
+_:c <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "5" .
+_:c <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "6" .
+
+
+

30. RMLTC-CC-0006-IT4

+

Title: Gather values across iterations to create a container.

+

Description: When using a template, constant, or reference for a gather map, this tests determines whether the values are correctly appended to the container. The natural order of the term maps inside the gather map as well as the iteration are respected. This test covers one term map in the gather map.

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0006-IT4/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/>.
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+@prefix ex:  <http://example.com/ns#>.
+@base        <http://example.com/>.
+
+<#TM> a rml:TriplesMap;
+    rml:logicalSource [
+        rml:source _:b738439 ;
+        rml:referenceFormulation rml:JSONPath ;
+        rml:iterator "$.*" ;
+    ] ;
+
+    rml:subjectMap [
+        rml:template "e/{$.id}" ;
+    ] ;
+
+    rml:predicateObjectMap [
+        rml:predicate ex:with ;
+        rml:objectMap [
+            rml:template "c/{$.id}" ;
+            rml:gather ( [ rml:reference "$.v1.*" ; ] ) ;
+            rml:gatherAs rdf:Bag ;
+        ] ;
+    ] ;
+.
+
+_:b738439 a rml:RelativePathSource ;
+    rml:path "data.json" .
+
+

Output

+
<http://example.com/base/e/a> <http://example.com/ns#with> <http://example.com/base/c/a> .
+<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
+<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "1" .
+<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "2" .
+<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "5" .
+<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_4> "6" .
+
+<http://example.com/base/e/b> <http://example.com/ns#with> <http://example.com/base/c/b> .
+<http://example.com/base/c/b> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
+<http://example.com/base/c/b> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "3" .
+<http://example.com/base/c/b> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "4" .
+
+
+

31. RMLTC-CC-0006-IT5

+

Title: Gather values across iterations to create a container.

+

Description: When using a template, constant, or reference for a gather map, this tests determines whether the values are correctly appended to the container. The natural order of the term maps inside the gather map as well as the iteration are respected. This test covers two term maps in the gather map.

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0006-IT5/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/>.
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+@prefix ex:  <http://example.com/ns#>.
+@base        <http://example.com/>.
+
+<#TM> a rml:TriplesMap;
+    rml:logicalSource [
+        rml:source _:b738439 ;
+        rml:referenceFormulation rml:JSONPath ;
+        rml:iterator "$.*" ;
+    ] ;
+
+    rml:subjectMap [
+        rml:template "e/{$.id}" ;
+    ] ;
+
+    rml:predicateObjectMap [
+        rml:predicate ex:with ;
+        rml:objectMap [
+            rml:template "c/{$.id}" ;
+            rml:gather ( [ rml:reference "$.v1.*" ; ] [ rml:reference "$.v2.*" ; ] ) ;
+            rml:gatherAs rdf:Bag ;
+        ] ;
+    ] ;
+.
+
+_:b738439 a rml:RelativePathSource ;
+    rml:path "data.json" .
+
+

Output

+
<http://example.com/base/e/a> <http://example.com/ns#with> <http://example.com/base/c/a> .
+<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
+<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "1" .
+<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "2" .
+<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "a" .
+<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_4> "b" .
+<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_5> "5" .
+<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_6> "6" .
+<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_7> "d" .
+<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_8> "e" .
+
+<http://example.com/base/e/b> <http://example.com/ns#with> <http://example.com/base/c/b> .
+<http://example.com/base/c/b> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
+<http://example.com/base/c/b> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "3" .
+<http://example.com/base/c/b> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "4" .
+<http://example.com/base/c/b> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "c" .
+
+
+

32. RMLTC-CC-0007-NES

+

Title: Nested gather maps

+

Description: Testing whether nested gather maps are created. The mapping should generate a list of bags.

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0007-NES/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/>.
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+@prefix ex:  <http://example.com/ns#>.
+@base        <http://example.com/>.
+
+<#TM> a rml:TriplesMap;
+    rml:logicalSource [
+        rml:source _:b738439 ;
+        rml:referenceFormulation rml:JSONPath ;
+        rml:iterator "$.*" ;
+    ] ;
+
+    rml:subjectMap [
+        rml:template "e/{$.id}" ;
+    ] ;
+
+    rml:predicateObjectMap [
+        rml:predicate ex:with ;
+        rml:objectMap [
+            rml:gather (
+                [
+                    rml:gather ( [ rml:reference "$.v1.*" ; ] ) ;
+                    rml:gatherAs rdf:Bag ;
+                ]
+                [
+                    rml:gather ( [ rml:reference "$.v2.*" ; ] ) ;
+                    rml:gatherAs rdf:Bag ;
+                ]
+            ) ;
+            rml:gatherAs rdf:List ;
+        ] ;
+    ] ;
+.
+
+_:b738439 a rml:RelativePathSource ;
+    rml:path "data.json" .
+
+

Output

+
_:nab9af1206e584ab2afd457e8a605872cb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
+_:nab9af1206e584ab2afd457e8a605872cb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "1" .
+_:nab9af1206e584ab2afd457e8a605872cb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "2" .
+
+_:nab9af1206e584ab2afd457e8a605872cb2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
+_:nab9af1206e584ab2afd457e8a605872cb2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "a" .
+_:nab9af1206e584ab2afd457e8a605872cb2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "b" .
+
+_:nab9af1206e584ab2afd457e8a605872cb5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
+_:nab9af1206e584ab2afd457e8a605872cb5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "3" .
+_:nab9af1206e584ab2afd457e8a605872cb5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "4" .
+
+_:nab9af1206e584ab2afd457e8a605872cb6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
+_:nab9af1206e584ab2afd457e8a605872cb6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "c" .
+
+<http://example.com/base/e/a> <http://example.com/ns#with> _:nab9af1206e584ab2afd457e8a605872cb3 .
+_:nab9af1206e584ab2afd457e8a605872cb3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> _:nab9af1206e584ab2afd457e8a605872cb1 .
+_:nab9af1206e584ab2afd457e8a605872cb3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nab9af1206e584ab2afd457e8a605872cb4 .
+
+_:nab9af1206e584ab2afd457e8a605872cb4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> _:nab9af1206e584ab2afd457e8a605872cb2 .
+_:nab9af1206e584ab2afd457e8a605872cb4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+
+<http://example.com/base/e/b> <http://example.com/ns#with> _:nab9af1206e584ab2afd457e8a605872cb7 .
+_:nab9af1206e584ab2afd457e8a605872cb7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> _:nab9af1206e584ab2afd457e8a605872cb5 .
+_:nab9af1206e584ab2afd457e8a605872cb7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nab9af1206e584ab2afd457e8a605872cb8 .
+
+_:nab9af1206e584ab2afd457e8a605872cb8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> _:nab9af1206e584ab2afd457e8a605872cb6 .
+_:nab9af1206e584ab2afd457e8a605872cb8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+
+
+
+

33. RMLTC-CC-0008-ROMa

+

Title: Elements via reference object-map.

+

Description: Testing whether gather maps generate an RDF list whose members are generated by a referencing object-map.

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0008-ROMa/Friends.json

+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+
+_:b273446 a rml:RelativePathSource ;
+    rml:path "student.csv" .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap ;
+    rml:logicalSource [ a rml:LogicalSource ;
+            rml:referenceFormulation rml:CSV ;
+            rml:source _:b273446 ] ;
+            
+    rml:predicateObjectMap [ 
+        rml:objectMap [
+                rml:reference "ID" ; rml:termType rml:BlankNode ;
+                rml:gather ( 
+                    [ 
+                        rml:parentTriplesMap <http://example.com/base/TriplesMap1> ;
+                        rml:joinCondition [ rml:child "Sport" ; rml:parent "Sport" ] ;
+                    ] 
+                ) ;
+                rml:gatherAs rdf:List;
+            ] ;    
+        rml:predicate ex:sameSportAs 
+    ] ;
+
+    rml:subjectMap [ rml:template "http://example.com/Student/{ID}/{Name}" ] .
+
+

Output

+
_:genid1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> <http://example.com/Student/10/Venus%20Williams> .
+_:genid1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:genid2 .
+_:genid2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> <http://example.com/Student/20/Serena%20Williams> .
+_:genid2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+<http://example.com/Student/10/Venus%20Williams> <http://example.com/sameSportAs> _:genid1 .
+_:genid3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> <http://example.com/Student/10/Venus%20Williams> .
+_:genid3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:genid4 .
+_:genid4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> <http://example.com/Student/20/Serena%20Williams> .
+_:genid4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+<http://example.com/Student/20/Serena%20Williams> <http://example.com/sameSportAs> _:genid3 .
+_:genid5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> <http://example.com/Student/30/Loena%20Hendrickx> .
+_:genid5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+<http://example.com/Student/30/Loena%20Hendrickx> <http://example.com/sameSportAs> _:genid5 .
+
+
+

34. RMLTC-CC-0008-ROMb

+

Title: Elements via reference object-map with default join condition

+

Description: Testing whether gather maps generate an RDF list whose members are generated by a referencing object-map with a default join condition.

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0008-ROMb/Friends.json

+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+
+_:b273446 a rml:RelativePathSource ;
+    rml:path "student.csv" .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap ;
+    rml:logicalSource [ a rml:LogicalSource ;
+            rml:referenceFormulation rml:CSV ;
+            rml:source _:b273446 ] ;
+            
+    rml:predicateObjectMap [
+        rml:objectMap [
+            rml:reference "ID" ; rml:termType rml:BlankNode ;
+            rml:gather ( 
+                [ 
+                    rml:parentTriplesMap <http://example.com/base/TriplesMap1> ;
+                ] 
+            ) ;
+            rml:gatherAs rdf:List;
+        ] ;
+        rml:predicate ex:sameSportAs 
+    ] ;
+        
+    rml:subjectMap [ rml:template "http://example.com/Student/{ID}/{Name}" ] .
+
+
+

Output

+
_:genid1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> <http://example.com/Student/30/Loena%20Hendrickx> .
+_:genid1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+<http://example.com/Student/30/Loena%20Hendrickx> <http://example.com/sameSportAs> _:genid1 .
+_:genid2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> <http://example.com/Student/20/Serena%20Williams> .
+_:genid2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+<http://example.com/Student/20/Serena%20Williams> <http://example.com/sameSportAs> _:genid2 .
+_:genid3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> <http://example.com/Student/10/Venus%20Williams> .
+_:genid3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+<http://example.com/Student/10/Venus%20Williams> <http://example.com/sameSportAs> _:genid3 .
+
+
+

35. RMLTC-CC-0009-DUP-Bag

+

Title: Gather duplicate values in an RDF Bag

+

Description: Testing the expected behavior of multi-valued expression maps containing duplicate values when these expression maps are used in a gather map to create an RDF Bag.

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0009-DUP-Bag/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/>.
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+@prefix ex:  <http://example.com/ns#>.
+@base        <http://example.com/>.
+
+<#TM> a rml:TriplesMap;
+    rml:logicalSource [
+        rml:source _:b738439 ;
+        rml:referenceFormulation rml:JSONPath ;
+        rml:iterator "$.*" ;
+    ] ;
+
+    rml:subjectMap [
+        rml:template "e/{$.id}" ;
+    ] ;
+
+    rml:predicateObjectMap [
+        rml:predicate ex:with ;
+        rml:objectMap [
+            rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
+            rml:gatherAs rdf:Bag ;
+        ] ;
+    ] ;
+.
+
+_:b738439 a rml:RelativePathSource ;
+    rml:path "data.json" .
+
+

Output

+
_:nc808fbd2e11a4baa939c61c8210b5909b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
+_:nc808fbd2e11a4baa939c61c8210b5909b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "2" .
+_:nc808fbd2e11a4baa939c61c8210b5909b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
+_:nc808fbd2e11a4baa939c61c8210b5909b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
+_:nc808fbd2e11a4baa939c61c8210b5909b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "9" .
+_:nc808fbd2e11a4baa939c61c8210b5909b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "1" .
+<http://example.com/base/e/b> <http://example.com/ns#with> _:nc808fbd2e11a4baa939c61c8210b5909b2 .
+_:nc808fbd2e11a4baa939c61c8210b5909b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "1" .
+<http://example.com/base/e/c> <http://example.com/ns#with> _:nc808fbd2e11a4baa939c61c8210b5909b3 .
+<http://example.com/base/e/a> <http://example.com/ns#with> _:nc808fbd2e11a4baa939c61c8210b5909b1 .
+_:nc808fbd2e11a4baa939c61c8210b5909b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "2" .
+_:nc808fbd2e11a4baa939c61c8210b5909b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "7" .
+_:nc808fbd2e11a4baa939c61c8210b5909b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "6" .
+_:nc808fbd2e11a4baa939c61c8210b5909b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "1" .
+_:nc808fbd2e11a4baa939c61c8210b5909b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "8" .
+
+
+

36. RMLTC-CC-0009-DUP-List

+

Title: Gather duplicate values in an RDF List

+

Description: Testing the expected behavior of multi-valued expression maps containing duplicate values when these expression maps are used in a gather map to create a list.

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0009-DUP-List/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/>.
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+@prefix ex:  <http://example.com/ns#>.
+@base        <http://example.com/>.
+
+<#TM> a rml:TriplesMap;
+    rml:logicalSource [
+        rml:source _:b738439 ;
+        rml:referenceFormulation rml:JSONPath ;
+        rml:iterator "$.*" ;
+    ] ;
+
+    rml:subjectMap [
+        rml:template "e/{$.id}" ;
+    ] ;
+
+    rml:predicateObjectMap [
+        rml:predicate ex:with ;
+        rml:objectMap [
+            rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
+            rml:gatherAs rdf:List ;
+        ] ;
+    ] ;
+.
+
+_:b738439 a rml:RelativePathSource ;
+    rml:path "data.json" .
+
+

Output

+
<http://example.com/base/e/a> <http://example.com/ns#with> _:n988e0f11d19c486fa3b3255f94c9b3bab1 .
+_:n988e0f11d19c486fa3b3255f94c9b3bab1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
+_:n988e0f11d19c486fa3b3255f94c9b3bab1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n988e0f11d19c486fa3b3255f94c9b3bab2 .
+_:n988e0f11d19c486fa3b3255f94c9b3bab2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
+_:n988e0f11d19c486fa3b3255f94c9b3bab2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n988e0f11d19c486fa3b3255f94c9b3bab3 .
+_:n988e0f11d19c486fa3b3255f94c9b3bab3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
+_:n988e0f11d19c486fa3b3255f94c9b3bab3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+
+<http://example.com/base/e/b> <http://example.com/ns#with> _:n988e0f11d19c486fa3b3255f94c9b3bab4 .
+_:n988e0f11d19c486fa3b3255f94c9b3bab4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
+_:n988e0f11d19c486fa3b3255f94c9b3bab4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n988e0f11d19c486fa3b3255f94c9b3bab5 .
+_:n988e0f11d19c486fa3b3255f94c9b3bab5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
+_:n988e0f11d19c486fa3b3255f94c9b3bab5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n988e0f11d19c486fa3b3255f94c9b3bab6 .
+_:n988e0f11d19c486fa3b3255f94c9b3bab6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "6" .
+_:n988e0f11d19c486fa3b3255f94c9b3bab6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+
+<http://example.com/base/e/c> <http://example.com/ns#with> _:n988e0f11d19c486fa3b3255f94c9b3bab7 .
+_:n988e0f11d19c486fa3b3255f94c9b3bab7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "7" .
+_:n988e0f11d19c486fa3b3255f94c9b3bab7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n988e0f11d19c486fa3b3255f94c9b3bab8 .
+_:n988e0f11d19c486fa3b3255f94c9b3bab8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "8" .
+_:n988e0f11d19c486fa3b3255f94c9b3bab8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n988e0f11d19c486fa3b3255f94c9b3bab9 .
+_:n988e0f11d19c486fa3b3255f94c9b3bab9 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "9" .
+_:n988e0f11d19c486fa3b3255f94c9b3bab9 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+
+
+

37. RMLTC-CC-0010-Lista

+

Title: Combining graph maps and gather maps (graph map has a template and gather map does not)

+

Description: Tests the behavior of combining graph- and gather maps. In this example, a blank node for each list is expected.

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0010-Lista/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/>.
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+@prefix ex:  <http://example.com/ns#>.
+@base        <http://example.com/>.
+
+<#TM> a rml:TriplesMap;
+    rml:logicalSource [
+        rml:source _:b738439 ;
+        rml:referenceFormulation rml:JSONPath ;
+        rml:iterator "$.*" ;
+    ] ;
+
+    rml:subjectMap [
+        rml:template "e/{$.id}" ;
+    ] ;
+
+    rml:predicateObjectMap [
+        rml:graphMap [ rml:template "g/{$.graph}" ; ] ;
+        rml:predicate ex:with ;
+        rml:objectMap [
+            rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
+            rml:gatherAs rdf:List ;
+        ] ;
+    ] ;
+.
+
+_:b738439 a rml:RelativePathSource ;
+    rml:path "data.json" .
+
+

Output

+
_:genid1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" <http://example.com/base/g/1> .
+_:genid1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> <http://example.com/base/g/1> .
+_:genid2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" <http://example.com/base/g/1> .
+_:genid2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> <http://example.com/base/g/1> .
+<http://example.com/base/e/a> <http://example.com/ns#with> _:genid1 <http://example.com/base/g/1> .
+<http://example.com/base/e/a> <http://example.com/ns#with> _:genid2 <http://example.com/base/g/1> .
+
+_:genidx1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" <http://example.com/base/g/2> .
+_:genidx1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> <http://example.com/base/g/2> .
+<http://example.com/base/e/a> <http://example.com/ns#with> _:genidx1 <http://example.com/base/g/2> .
+
+
+

38. RMLTC-CC-0010-Listb

+

Title: Combining graph maps and gather maps (both graph map and gather map have a template)

+

Description: Tests the behavior of combining graph- and gather maps. In this example, lists are concatinated in some named graphs via blank node identifiers constructed with templates.

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0010-Listb/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/>.
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+@prefix ex:  <http://example.com/ns#>.
+@base        <http://example.com/>.
+
+<#TM> a rml:TriplesMap;
+    rml:logicalSource [
+        rml:source _:b738439 ;
+        rml:referenceFormulation rml:JSONPath ;
+        rml:iterator "$.*" ;
+    ] ;
+
+    rml:subjectMap [
+        rml:template "e/{$.id}" ;
+    ] ;
+
+    rml:predicateObjectMap [
+        rml:graphMap [ rml:template "g/{$.graph}" ; ] ;
+        rml:predicate ex:with ;
+        rml:objectMap [
+            rml:template "l/{$.id}" ; rml:termType rml:BlankNode ;
+            rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
+            rml:gatherAs rdf:List ;
+        ] ;
+    ] ;
+.
+
+_:b738439 a rml:RelativePathSource ;
+    rml:path "data.json" .
+
+

Output

+
_:genid1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" <http://example.com/base/g/1> .
+_:genid1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:genid2 <http://example.com/base/g/1> .
+_:genid2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" <http://example.com/base/g/1> .
+_:genid2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> <http://example.com/base/g/1> .
+<http://example.com/base/e/a> <http://example.com/ns#with> _:genid1 <http://example.com/base/g/1> .
+
+_:genidx1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" <http://example.com/base/g/2> .
+_:genidx1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> <http://example.com/base/g/2> .
+<http://example.com/base/e/a> <http://example.com/ns#with> _:genidx1 <http://example.com/base/g/2> .
+
+
+ + + + +

A. References

A.1 Informative references

+ +
[RDF11-Concepts]
+ RDF 1.1 Concepts and Abstract Syntax. W3C. 25 February 2014. W3C Recommendation. URL: https://www.w3.org/TR/rdf11-concepts/ +
[RML]
+ RDF Mapping Language. https://rml.io. 06 October 2020. Unofficial draft. URL: https://rml.io/specs/rml/ +
+
\ No newline at end of file diff --git a/src/test/resources/rml-cc/docs/20250915/index.html b/src/test/resources/rml-cc/docs/20250915/index.html new file mode 100644 index 00000000..2ad784eb --- /dev/null +++ b/src/test/resources/rml-cc/docs/20250915/index.html @@ -0,0 +1,2544 @@ + + + + + + +RML-CC: Test Cases + + + + + + + + + + + + + + + + + + + +

Abstract

This document defines the RML-CC test cases to the determine the RML-CC specification conformance of tools.

+
+ +

Status of This Document

+ This specification was published by the + Knowledge Graph Construction Community Group. It is not a W3C Standard nor is it + on the W3C Standards Track. + + Please note that under the + W3C Community Contributor License Agreement (CLA) + there is a limited opt-out and other conditions apply. + + Learn more about + W3C Community and Business Groups. +

+ +

1. Introduction

+

This document defines the RML-CC test cases, consisting of a collection of test case documents (input and expected output). +The purpose of the test cases is to determine the conformance of tools that execute RML rules to the RML-CC specification.

+
+ +

2. Data model

+

The test cases are semantically described for re-usability and shareability following the W3C Test case description. +Each test:Testcase as the following properties:

+
    +
  • dcterms:identifier: unique ID of the test case.
  • +
  • rmltest:hasError: if an error of the RML Processor is expected or not.
  • +
  • rmltest:input: One or more input data of the test case.
  • +
  • rmltest:output: One or more output data of the test case.
  • +
  • rmltest:inputFormat: the input data format.
  • +
  • rmltest:outputFormat: the output data format.
  • +
  • rmltest:mappingDocument: the RML mapping rules in Turtle.
  • +
+
+ +

3. Test cases

+

This section describes the RML-CC test cases. These descriptions are also available as RDF. +The files are available on GitHub in the folder test-cases. +Each test case is contained in a single folder, containing three types of files:

+
    +
  • Zero or more files containing the data sources, in the case of JSON, XML, CSV, or containing the SQL statements to create the necessary tables, in the case of MySQL, PostgreSQL, and SQL Server.
  • +
  • One file with the RML rules, called mapping.ttl, in the Turtle format.
  • +
  • Zero or more files with the expected RDF. No file is provided if an error is expected that must halt the generation of the RDF because of an error.
  • +
+
+ + +

4. RMLTC-CC-0001-Alt

+

Title: Generate a rdf:Alt as an object

+

Description: Tests if a rdf:Alt is generated as an object

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0001-Alt/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/>.
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+@prefix ex:  <http://example.com/ns#>.
+
+<http://example.com/base#TM> a rml:TriplesMap;
+    rml:logicalSource [
+        rml:source _:b738439 ;
+        rml:referenceFormulation rml:JSONPath ;
+        rml:iterator "$.*" ;
+    ] ;
+
+    rml:subjectMap [
+        rml:template "e/{$.id}" ;
+    ] ;
+
+    rml:predicateObjectMap [
+        rml:predicate ex:with ;
+        rml:objectMap [
+            rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
+            rml:gatherAs rdf:Alt ;
+        ] ;
+    ] ;
+.
+
+_:b738439 a rml:RelativePathSource ;
+    rml:path "data.json" .
+
+

Output

+
<http://example.com/base/e/a> <http://example.com/ns#with> _:nc808fbd2e11a4baa939c61c8210b5909b1 .
+_:nc808fbd2e11a4baa939c61c8210b5909b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Alt> .
+_:nc808fbd2e11a4baa939c61c8210b5909b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "1" .
+_:nc808fbd2e11a4baa939c61c8210b5909b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "2" .
+_:nc808fbd2e11a4baa939c61c8210b5909b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "3" .
+
+<http://example.com/base/e/b> <http://example.com/ns#with> _:nc808fbd2e11a4baa939c61c8210b5909b2 .
+_:nc808fbd2e11a4baa939c61c8210b5909b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Alt> .
+_:nc808fbd2e11a4baa939c61c8210b5909b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "4" .
+_:nc808fbd2e11a4baa939c61c8210b5909b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "5" .
+_:nc808fbd2e11a4baa939c61c8210b5909b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "6" .
+
+<http://example.com/base/e/c> <http://example.com/ns#with> _:nc808fbd2e11a4baa939c61c8210b5909b3 .
+_:nc808fbd2e11a4baa939c61c8210b5909b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Alt> .
+_:nc808fbd2e11a4baa939c61c8210b5909b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "7" .
+_:nc808fbd2e11a4baa939c61c8210b5909b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "8" .
+_:nc808fbd2e11a4baa939c61c8210b5909b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "9" .
+
+
+

5. RMLTC-CC-0001-Bag

+

Title: Generate a rdf:Bag as an object

+

Description: Tests if a rdf:Bag is generated as an object

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0001-Bag/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/>.
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+@prefix ex:  <http://example.com/ns#>.
+
+<http://example.com/base#TM> a rml:TriplesMap;
+    rml:logicalSource [
+        rml:source _:b738439 ;
+        rml:referenceFormulation rml:JSONPath ;
+        rml:iterator "$.*" ;
+    ] ;
+
+    rml:subjectMap [
+        rml:template "e/{$.id}" ;
+    ] ;
+
+    rml:predicateObjectMap [
+        rml:predicate ex:with ;
+        rml:objectMap [
+            rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
+            rml:gatherAs rdf:Bag ;
+        ] ;
+    ] ;
+.
+
+_:b738439 a rml:RelativePathSource ;
+    rml:path "data.json" .
+
+

Output

+
_:nc808fbd2e11a4baa939c61c8210b5909b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
+_:nc808fbd2e11a4baa939c61c8210b5909b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "5" .
+_:nc808fbd2e11a4baa939c61c8210b5909b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
+_:nc808fbd2e11a4baa939c61c8210b5909b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
+_:nc808fbd2e11a4baa939c61c8210b5909b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "9" .
+_:nc808fbd2e11a4baa939c61c8210b5909b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "2" .
+<http://example.com/base/e/b> <http://example.com/ns#with> _:nc808fbd2e11a4baa939c61c8210b5909b2 .
+_:nc808fbd2e11a4baa939c61c8210b5909b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "1" .
+<http://example.com/base/e/c> <http://example.com/ns#with> _:nc808fbd2e11a4baa939c61c8210b5909b3 .
+<http://example.com/base/e/a> <http://example.com/ns#with> _:nc808fbd2e11a4baa939c61c8210b5909b1 .
+_:nc808fbd2e11a4baa939c61c8210b5909b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "4" .
+_:nc808fbd2e11a4baa939c61c8210b5909b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "7" .
+_:nc808fbd2e11a4baa939c61c8210b5909b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "6" .
+_:nc808fbd2e11a4baa939c61c8210b5909b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "3" .
+_:nc808fbd2e11a4baa939c61c8210b5909b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "8" .
+
+
+

6. RMLTC-CC-0001-List

+

Title: Generate a rdf:List as an object

+

Description: Tests if a rdf:List is generated as an object

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0001-List/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/>.
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+@prefix ex:  <http://example.com/ns#>.
+
+<http://example.com/base#TM> a rml:TriplesMap;
+    rml:logicalSource [
+        rml:source _:b738439 ;
+        rml:referenceFormulation rml:JSONPath ;
+        rml:iterator "$.*" ;
+    ] ;
+
+    rml:subjectMap [
+        rml:template "e/{$.id}" ;
+    ] ;
+
+    rml:predicateObjectMap [
+        rml:predicate ex:with ;
+        rml:objectMap [
+            rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
+            rml:gatherAs rdf:List ;
+        ] ;
+    ] ;
+.
+
+_:b738439 a rml:RelativePathSource ;
+    rml:path "data.json" .
+
+

Output

+
<http://example.com/base/e/a> <http://example.com/ns#with> _:n988e0f11d19c486fa3b3255f94c9b3bab1 .
+_:n988e0f11d19c486fa3b3255f94c9b3bab1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
+_:n988e0f11d19c486fa3b3255f94c9b3bab1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n988e0f11d19c486fa3b3255f94c9b3bab2 .
+_:n988e0f11d19c486fa3b3255f94c9b3bab2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
+_:n988e0f11d19c486fa3b3255f94c9b3bab2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n988e0f11d19c486fa3b3255f94c9b3bab3 .
+_:n988e0f11d19c486fa3b3255f94c9b3bab3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" .
+_:n988e0f11d19c486fa3b3255f94c9b3bab3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+
+<http://example.com/base/e/b> <http://example.com/ns#with> _:n988e0f11d19c486fa3b3255f94c9b3bab4 .
+_:n988e0f11d19c486fa3b3255f94c9b3bab4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "4" .
+_:n988e0f11d19c486fa3b3255f94c9b3bab4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n988e0f11d19c486fa3b3255f94c9b3bab5 .
+_:n988e0f11d19c486fa3b3255f94c9b3bab5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "5" .
+_:n988e0f11d19c486fa3b3255f94c9b3bab5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n988e0f11d19c486fa3b3255f94c9b3bab6 .
+_:n988e0f11d19c486fa3b3255f94c9b3bab6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "6" .
+_:n988e0f11d19c486fa3b3255f94c9b3bab6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+
+<http://example.com/base/e/c> <http://example.com/ns#with> _:n988e0f11d19c486fa3b3255f94c9b3bab7 .
+_:n988e0f11d19c486fa3b3255f94c9b3bab7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "7" .
+_:n988e0f11d19c486fa3b3255f94c9b3bab7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n988e0f11d19c486fa3b3255f94c9b3bab8 .
+_:n988e0f11d19c486fa3b3255f94c9b3bab8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "8" .
+_:n988e0f11d19c486fa3b3255f94c9b3bab8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n988e0f11d19c486fa3b3255f94c9b3bab9 .
+_:n988e0f11d19c486fa3b3255f94c9b3bab9 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "9" .
+_:n988e0f11d19c486fa3b3255f94c9b3bab9 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+
+
+

7. RMLTC-CC-0001-Seq

+

Title: Generate a rdf:Seq as an object

+

Description: Tests if a rdf:Seq is generated as an object

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0001-Seq/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/>.
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+@prefix ex:  <http://example.com/ns#>.
+
+<http://example.com/base#TM> a rml:TriplesMap;
+    rml:logicalSource [
+        rml:source _:b738439 ;
+        rml:referenceFormulation rml:JSONPath ;
+        rml:iterator "$.*" ;
+    ] ;
+
+    rml:subjectMap [
+        rml:template "e/{$.id}" ;
+    ] ;
+
+    rml:predicateObjectMap [
+        rml:predicate ex:with ;
+        rml:objectMap [
+            rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
+            rml:gatherAs rdf:Seq ;
+        ] ;
+    ] ;
+.
+
+_:b738439 a rml:RelativePathSource ;
+    rml:path "data.json" .
+
+

Output

+
_:nc808fbd2e11a4baa939c61c8210b5909b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Seq> .
+_:nc808fbd2e11a4baa939c61c8210b5909b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "5" .
+_:nc808fbd2e11a4baa939c61c8210b5909b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Seq> .
+_:nc808fbd2e11a4baa939c61c8210b5909b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Seq> .
+_:nc808fbd2e11a4baa939c61c8210b5909b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "9" .
+_:nc808fbd2e11a4baa939c61c8210b5909b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "2" .
+<http://example.com/base/e/b> <http://example.com/ns#with> _:nc808fbd2e11a4baa939c61c8210b5909b2 .
+_:nc808fbd2e11a4baa939c61c8210b5909b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "1" .
+<http://example.com/base/e/c> <http://example.com/ns#with> _:nc808fbd2e11a4baa939c61c8210b5909b3 .
+<http://example.com/base/e/a> <http://example.com/ns#with> _:nc808fbd2e11a4baa939c61c8210b5909b1 .
+_:nc808fbd2e11a4baa939c61c8210b5909b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "4" .
+_:nc808fbd2e11a4baa939c61c8210b5909b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "7" .
+_:nc808fbd2e11a4baa939c61c8210b5909b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "6" .
+_:nc808fbd2e11a4baa939c61c8210b5909b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "3" .
+_:nc808fbd2e11a4baa939c61c8210b5909b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "8" .
+
+
+

8. RMLTC-CC-0002-Bag

+

Title: Generate a named rdf:Bag as an object

+

Description: Tests if a named rdf:Bag is generated as an object

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0002-Bag/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/>.
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+@prefix ex:  <http://example.com/ns#>.
+
+<http://example.com/base#TM> a rml:TriplesMap;
+    rml:logicalSource [
+        rml:source _:b738439 ;
+        rml:referenceFormulation rml:JSONPath ;
+        rml:iterator "$.*" ;
+    ] ;
+
+    rml:subjectMap [
+        rml:template "e/{$.id}" ;
+    ] ;
+
+    rml:predicateObjectMap [
+        rml:predicate ex:with ;
+        rml:objectMap [
+            rml:template "c/{$.id}" ;
+            rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
+            rml:gatherAs rdf:Bag ;
+        ] ;
+    ] ;
+.
+
+_:b738439 a rml:RelativePathSource ;
+    rml:path "data.json" .
+
+

Output

+
<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
+<http://example.com/base/c/c> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "7" .
+<http://example.com/base/c/c> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "8" .
+<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "2" .
+<http://example.com/base/e/c> <http://example.com/ns#with> <http://example.com/base/c/c> .
+<http://example.com/base/c/c> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
+<http://example.com/base/c/b> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "6" .
+<http://example.com/base/e/a> <http://example.com/ns#with> <http://example.com/base/c/a> .
+<http://example.com/base/c/c> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "9" .
+<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "1" .
+<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "3" .
+<http://example.com/base/c/b> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "4" .
+<http://example.com/base/e/b> <http://example.com/ns#with> <http://example.com/base/c/b> .
+<http://example.com/base/c/b> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
+<http://example.com/base/c/b> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "5" .
+
+
+

9. RMLTC-CC-0002-List

+

Title: Generate a named rdf:List as an object

+

Description: Tests if a named rdf:List is generated as an object

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0002-List/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/>.
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+@prefix ex:  <http://example.com/ns#>.
+
+<http://example.com/base#TM> a rml:TriplesMap;
+    rml:logicalSource [
+        rml:source _:b738439 ;
+        rml:referenceFormulation rml:JSONPath ;
+        rml:iterator "$.*" ;
+    ] ;
+
+    rml:subjectMap [
+        rml:template "e/{$.id}" ;
+    ] ;
+
+    rml:predicateObjectMap [
+        rml:predicate ex:with ;
+        rml:objectMap [
+            rml:template "c/{$.id}" ;
+            rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
+            rml:gatherAs rdf:List ;
+        ] ;
+    ] ;
+.
+
+_:b738439 a rml:RelativePathSource ;
+    rml:path "data.json" .
+
+

Output

+
_:nb73dd869d6bb47a5b865ee632fe27453b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nb73dd869d6bb47a5b865ee632fe27453b2 .
+<http://example.com/base/e/c> <http://example.com/ns#with> <http://example.com/base/c/c> .
+<http://example.com/base/c/c> <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "7" .
+_:nb73dd869d6bb47a5b865ee632fe27453b5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "8" .
+_:nb73dd869d6bb47a5b865ee632fe27453b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nb73dd869d6bb47a5b865ee632fe27453b4 .
+_:nb73dd869d6bb47a5b865ee632fe27453b6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+<http://example.com/base/e/a> <http://example.com/ns#with> <http://example.com/base/c/a> .
+_:nb73dd869d6bb47a5b865ee632fe27453b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "5" .
+<http://example.com/base/c/b> <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nb73dd869d6bb47a5b865ee632fe27453b3 .
+_:nb73dd869d6bb47a5b865ee632fe27453b4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "6" .
+_:nb73dd869d6bb47a5b865ee632fe27453b4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+_:nb73dd869d6bb47a5b865ee632fe27453b5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nb73dd869d6bb47a5b865ee632fe27453b6 .
+_:nb73dd869d6bb47a5b865ee632fe27453b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+_:nb73dd869d6bb47a5b865ee632fe27453b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
+_:nb73dd869d6bb47a5b865ee632fe27453b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" .
+<http://example.com/base/c/b> <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "4" .
+<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nb73dd869d6bb47a5b865ee632fe27453b1 .
+<http://example.com/base/c/c> <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nb73dd869d6bb47a5b865ee632fe27453b5 .
+_:nb73dd869d6bb47a5b865ee632fe27453b6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "9" .
+<http://example.com/base/e/b> <http://example.com/ns#with> <http://example.com/base/c/b> .
+<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
+
+
+

10. RMLTC-CC-0003-EB

+

Title: Allow the generation of empty bags

+

Description: Tests if the use of rml:allowEmptyListAndContainer yields an empty bag.

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0003-EB/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/>.
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+@prefix ex:  <http://example.com/ns#>.
+
+<http://example.com/base#TM> a rml:TriplesMap;
+    rml:logicalSource [
+        rml:source _:b738439 ;
+        rml:referenceFormulation rml:JSONPath ;
+        rml:iterator "$.*" ;
+    ] ;
+
+    rml:subjectMap [
+        rml:template "e/{$.id}" ;
+    ] ;
+
+    rml:predicateObjectMap [
+        rml:predicate ex:with ;
+        rml:objectMap [
+            rml:allowEmptyListAndContainer true ;
+            rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
+            rml:gatherAs rdf:Bag ;
+        ] ;
+    ] ;
+.
+
+_:b738439 a rml:RelativePathSource ;
+    rml:path "data.json" .
+
+

Output

+
_:nfecac3cfe48c4afa99539cc809138e96b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
+<http://example.com/base/e/a> <http://example.com/ns#with> _:nfecac3cfe48c4afa99539cc809138e96b1 .
+_:nfecac3cfe48c4afa99539cc809138e96b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
+_:nfecac3cfe48c4afa99539cc809138e96b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "1" .
+<http://example.com/base/e/b> <http://example.com/ns#with> _:nfecac3cfe48c4afa99539cc809138e96b2 .
+_:nfecac3cfe48c4afa99539cc809138e96b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "2" .
+_:nfecac3cfe48c4afa99539cc809138e96b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "3" .
+
+
+

11. RMLTC-CC-0003-EL

+

Title: Allow the generation of empty lists

+

Description: Tests if the use of rml:allowEmptyListAndContainer yields an empty list.

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0003-EL/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/>.
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+@prefix ex:  <http://example.com/ns#>.
+
+<http://example.com/base#TM> a rml:TriplesMap;
+    rml:logicalSource [
+        rml:source _:b738439 ;
+        rml:referenceFormulation rml:JSONPath ;
+        rml:iterator "$.*" ;
+    ] ;
+
+    rml:subjectMap [
+        rml:template "e/{$.id}" ;
+    ] ;
+
+    rml:predicateObjectMap [
+        rml:predicate ex:with ;
+        rml:objectMap [
+            rml:allowEmptyListAndContainer true ;
+            rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
+            rml:gatherAs rdf:List ;
+        ] ;
+    ] ;
+.
+
+_:b738439 a rml:RelativePathSource ;
+    rml:path "data.json" .
+
+

Output

+
_:n302eecc856b44ed5b76965d9be2f5213b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+<http://example.com/base/e/b> <http://example.com/ns#with> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+_:n302eecc856b44ed5b76965d9be2f5213b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n302eecc856b44ed5b76965d9be2f5213b3 .
+_:n302eecc856b44ed5b76965d9be2f5213b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
+_:n302eecc856b44ed5b76965d9be2f5213b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" .
+_:n302eecc856b44ed5b76965d9be2f5213b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n302eecc856b44ed5b76965d9be2f5213b2 .
+<http://example.com/base/e/a> <http://example.com/ns#with> _:n302eecc856b44ed5b76965d9be2f5213b1 .
+_:n302eecc856b44ed5b76965d9be2f5213b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
+
+
+

12. RMLTC-CC-0003-EL-BN

+

Title: Allow the generation of empty lists identified by blank node identifiers.

+

Description: Tests if the use of rml:allowEmptyListAndContainer yields an empty list. The lists are identified by a blank node identifier generated in the mapping.

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0003-EL-BN/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/>.
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+@prefix ex:  <http://example.com/ns#>.
+
+<http://example.com/base#TM> a rml:TriplesMap;
+    rml:logicalSource [
+        rml:source _:b738439 ;
+        rml:referenceFormulation rml:JSONPath ;
+        rml:iterator "$.*" ;
+    ] ;
+
+    rml:subjectMap [
+        rml:template "e/{$.id}" ;
+    ] ;
+
+    rml:predicateObjectMap [
+        rml:predicate ex:with ;
+        rml:objectMap [
+            rml:template "c/{$.id}" ; rml:termType rml:BlankNode ;
+            rml:allowEmptyListAndContainer true ;
+            rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
+            rml:gatherAs rdf:List ;
+        ] ;
+    ] ;
+.
+
+_:b738439 a rml:RelativePathSource ;
+    rml:path "data.json" .
+
+

Output

+
_:n302eecc856b44ed5b76965d9be2f5213b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+<http://example.com/base/e/b> <http://example.com/ns#with> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+_:n302eecc856b44ed5b76965d9be2f5213b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n302eecc856b44ed5b76965d9be2f5213b3 .
+_:n302eecc856b44ed5b76965d9be2f5213b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
+_:n302eecc856b44ed5b76965d9be2f5213b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" .
+_:n302eecc856b44ed5b76965d9be2f5213b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n302eecc856b44ed5b76965d9be2f5213b2 .
+<http://example.com/base/e/a> <http://example.com/ns#with> _:n302eecc856b44ed5b76965d9be2f5213b1 .
+_:n302eecc856b44ed5b76965d9be2f5213b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
+
+
+

13. RMLTC-CC-0003-EL-Named

+

Title: Allow the generation of empty lists identified by IRIs.

+

Description: Tests if the use of rml:allowEmptyListAndContainer yields an empty list. The lists are identified by a IRI generated in the mapping.

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0003-EL-Named/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/>.
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+@prefix ex:  <http://example.com/ns#>.
+
+<http://example.com/base#TM> a rml:TriplesMap;
+    rml:logicalSource [
+        rml:source _:b738439 ;
+        rml:referenceFormulation rml:JSONPath ;
+        rml:iterator "$.*" ;
+    ] ;
+
+    rml:subjectMap [
+        rml:template "e/{$.id}" ;
+    ] ;
+
+    rml:predicateObjectMap [
+        rml:predicate ex:with ;
+        rml:objectMap [
+            rml:template "c/{$.id}" ;
+            rml:allowEmptyListAndContainer true ;
+            rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
+            rml:gatherAs rdf:List ;
+        ] ;
+    ] ;
+.
+
+_:b738439 a rml:RelativePathSource ;
+    rml:path "data.json" .
+
+

Output

+
_:n302eecc856b44ed5b76965d9be2f5213b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+<http://example.com/base/e/b> <http://example.com/ns#with> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+_:n302eecc856b44ed5b76965d9be2f5213b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n302eecc856b44ed5b76965d9be2f5213b3 .
+_:n302eecc856b44ed5b76965d9be2f5213b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
+_:n302eecc856b44ed5b76965d9be2f5213b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" .
+<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n302eecc856b44ed5b76965d9be2f5213b2 .
+<http://example.com/base/e/a> <http://example.com/ns#with> <http://example.com/base/c/a> .
+<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
+
+
+

14. RMLTC-CC-0003-NEB

+

Title: Empty bags are not generated

+

Description: Tests if empty containers are not generated (expected default behavior).

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0003-NEB/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/>.
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+@prefix ex:  <http://example.com/ns#>.
+
+<http://example.com/base#TM> a rml:TriplesMap;
+    rml:logicalSource [
+        rml:source _:b738439 ;
+        rml:referenceFormulation rml:JSONPath ;
+        rml:iterator "$.*" ;
+    ] ;
+
+    rml:subjectMap [
+        rml:template "e/{$.id}" ;
+    ] ;
+
+    rml:predicateObjectMap [
+        rml:predicate ex:with ;
+        rml:objectMap [
+            rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
+            rml:gatherAs rdf:Bag ;
+        ] ;
+    ] ;
+.
+
+_:b738439 a rml:RelativePathSource ;
+    rml:path "data.json" .
+
+

Output

+
<http://example.com/base/e/a> <http://example.com/ns#with> _:n2bd72de9c571444081890e41009d92d4b1 .
+_:n2bd72de9c571444081890e41009d92d4b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "3" .
+_:n2bd72de9c571444081890e41009d92d4b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
+_:n2bd72de9c571444081890e41009d92d4b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "2" .
+_:n2bd72de9c571444081890e41009d92d4b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "1" .
+
+
+

15. RMLTC-CC-0003-NEL

+

Title: Empty lists are not generated

+

Description: Tests if empty lists are not generated (expected default behavior).

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0003-NEL/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/>.
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+@prefix ex:  <http://example.com/ns#>.
+
+<http://example.com/base#TM> a rml:TriplesMap;
+    rml:logicalSource [
+        rml:source _:b738439 ;
+        rml:referenceFormulation rml:JSONPath ;
+        rml:iterator "$.*" ;
+    ] ;
+
+    rml:subjectMap [
+        rml:template "e/{$.id}" ;
+    ] ;
+
+    rml:predicateObjectMap [
+        rml:predicate ex:with ;
+        rml:objectMap [
+            rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
+            rml:gatherAs rdf:List ;
+        ] ;
+    ] ;
+.
+
+_:b738439 a rml:RelativePathSource ;
+    rml:path "data.json" .
+
+

Output

+
_:n434c2c54e09e4a259604ba1188ce038fb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n434c2c54e09e4a259604ba1188ce038fb2 .
+_:n434c2c54e09e4a259604ba1188ce038fb3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+_:n434c2c54e09e4a259604ba1188ce038fb2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
+<http://example.com/base/e/a> <http://example.com/ns#with> _:n434c2c54e09e4a259604ba1188ce038fb1 .
+_:n434c2c54e09e4a259604ba1188ce038fb2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n434c2c54e09e4a259604ba1188ce038fb3 .
+_:n434c2c54e09e4a259604ba1188ce038fb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
+_:n434c2c54e09e4a259604ba1188ce038fb3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" .
+
+
+

16. RMLTC-CC-0003-NELb

+

Title: Empty lists are not generated II

+

Description: Tests if empty lists are not generated (expected default behavior). This test cases uses the predicate rml:allowEmptyListAndContainer.

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0003-NELb/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/>.
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+@prefix ex:  <http://example.com/ns#>.
+
+<http://example.com/base#TM> a rml:TriplesMap;
+    rml:logicalSource [
+        rml:source _:b738439 ;
+        rml:referenceFormulation rml:JSONPath ;
+        rml:iterator "$.*" ;
+    ] ;
+
+    rml:subjectMap [
+        rml:template "e/{$.id}" ;
+    ] ;
+
+    rml:predicateObjectMap [
+        rml:predicate ex:with ;
+        rml:objectMap [
+            rml:allowEmptyListAndContainer false ;
+            rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
+            rml:gatherAs rdf:List ;
+        ] ;
+    ] ;
+.
+
+_:b738439 a rml:RelativePathSource ;
+    rml:path "data.json" .
+
+

Output

+
_:n434c2c54e09e4a259604ba1188ce038fb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n434c2c54e09e4a259604ba1188ce038fb2 .
+_:n434c2c54e09e4a259604ba1188ce038fb3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+_:n434c2c54e09e4a259604ba1188ce038fb2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
+<http://example.com/base/e/a> <http://example.com/ns#with> _:n434c2c54e09e4a259604ba1188ce038fb1 .
+_:n434c2c54e09e4a259604ba1188ce038fb2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n434c2c54e09e4a259604ba1188ce038fb3 .
+_:n434c2c54e09e4a259604ba1188ce038fb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
+_:n434c2c54e09e4a259604ba1188ce038fb3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" .
+
+
+

17. RMLTC-CC-0004-SM1

+

Title: GatherMap in subject map (list)

+

Description: Tests if the use of a gather map in the subject map is supported. This test generates a list.

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0004-SM1/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/>.
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+@prefix ex:  <http://example.com/ns#>.
+
+<http://example.com/base#TM> a rml:TriplesMap;
+    rml:logicalSource [
+        rml:source _:b738439 ;
+        rml:referenceFormulation rml:JSONPath ;
+        rml:iterator "$.*" ;
+    ] ;
+
+    rml:subjectMap [
+        rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
+        rml:gatherAs rdf:List ;
+    ] ;
+
+    rml:predicateObjectMap [
+        rml:predicate ex:createdBy ;
+        rml:object ex:JohnDoe ;
+    ] ;
+.
+
+_:b738439 a rml:RelativePathSource ;
+    rml:path "data.json" .
+
+

Output

+
_:n302eecc856b44ed5b76965d9be2f5213b1 <http://example.com/ns#createdBy> <http://example.com/ns#JohnDoe> .
+_:n302eecc856b44ed5b76965d9be2f5213b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
+_:n302eecc856b44ed5b76965d9be2f5213b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n302eecc856b44ed5b76965d9be2f5213b2 .
+_:n302eecc856b44ed5b76965d9be2f5213b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
+_:n302eecc856b44ed5b76965d9be2f5213b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n302eecc856b44ed5b76965d9be2f5213b3 .
+_:n302eecc856b44ed5b76965d9be2f5213b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" .
+_:n302eecc856b44ed5b76965d9be2f5213b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+_:n1d393f12e993411498da676131f81ca4b1 <http://example.com/ns#createdBy> <http://example.com/ns#JohnDoe> .
+_:n1d393f12e993411498da676131f81ca4b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "4" .
+_:n1d393f12e993411498da676131f81ca4b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n1d393f12e993411498da676131f81ca4b2 .
+_:n1d393f12e993411498da676131f81ca4b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "5" .
+_:n1d393f12e993411498da676131f81ca4b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n1d393f12e993411498da676131f81ca4b3 .
+_:n1d393f12e993411498da676131f81ca4b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "6" .
+_:n1d393f12e993411498da676131f81ca4b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+
+
+

18. RMLTC-CC-0004-SM2

+

Title: GatherMap in subject map (list)

+

Description: Tests if the use of a gather map in the subject map is supported. This test has no predicate-object maps and no class declarations in the subject map. It still needs to generate triples as the lists consists of at least one cons-pair.

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0004-SM2/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/>.
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+@prefix ex:  <http://example.com/ns#>.
+
+<http://example.com/base#TM> a rml:TriplesMap;
+    rml:logicalSource [
+        rml:source _:b738439 ;
+        rml:referenceFormulation rml:JSONPath ;
+        rml:iterator "$.*" ;
+    ] ;
+
+    rml:subjectMap [
+        rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
+        rml:gatherAs rdf:List ;
+    ] ;
+.
+
+_:b738439 a rml:RelativePathSource ;
+    rml:path "data.json" .
+
+

Output

+
_:n302eecc856b44ed5b76965d9be2f5213b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
+_:n302eecc856b44ed5b76965d9be2f5213b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n302eecc856b44ed5b76965d9be2f5213b2 .
+_:n302eecc856b44ed5b76965d9be2f5213b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
+_:n302eecc856b44ed5b76965d9be2f5213b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n302eecc856b44ed5b76965d9be2f5213b3 .
+_:n302eecc856b44ed5b76965d9be2f5213b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" .
+_:n302eecc856b44ed5b76965d9be2f5213b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+_:n1d393f12e993411498da676131f81ca4b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "4" .
+_:n1d393f12e993411498da676131f81ca4b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n1d393f12e993411498da676131f81ca4b2 .
+_:n1d393f12e993411498da676131f81ca4b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "5" .
+_:n1d393f12e993411498da676131f81ca4b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n1d393f12e993411498da676131f81ca4b3 .
+_:n1d393f12e993411498da676131f81ca4b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "6" .
+_:n1d393f12e993411498da676131f81ca4b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+
+
+

19. RMLTC-CC-0004-SM3

+

Title: GatherMap in subject map (list)

+

Description: Tests if the use of a gather map in the subject map is supported. This test has no predicate-object maps and no class declarations in the subject map. Only one list needs to be generated as the other has no values and we only retain non-empty lists.

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0004-SM3/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/>.
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+@prefix ex:  <http://example.com/ns#>.
+
+<http://example.com/base#TM> a rml:TriplesMap;
+    rml:logicalSource [
+        rml:source _:b738439 ;
+        rml:referenceFormulation rml:JSONPath ;
+        rml:iterator "$.*" ;
+    ] ;
+
+    rml:subjectMap [
+        rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
+        rml:gatherAs rdf:List ;
+    ] ;
+.
+
+_:b738439 a rml:RelativePathSource ;
+    rml:path "data.json" .
+
+

Output

+
_:n648f8cf4c58149e8a0feea26fb2a5b5bb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
+_:n648f8cf4c58149e8a0feea26fb2a5b5bb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n648f8cf4c58149e8a0feea26fb2a5b5bb2 .
+_:n648f8cf4c58149e8a0feea26fb2a5b5bb3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" .
+_:n648f8cf4c58149e8a0feea26fb2a5b5bb2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n648f8cf4c58149e8a0feea26fb2a5b5bb3 .
+_:n648f8cf4c58149e8a0feea26fb2a5b5bb2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
+_:n648f8cf4c58149e8a0feea26fb2a5b5bb3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+
+
+

20. RMLTC-CC-0004-SM4

+

Title: GatherMap in subject map (bag)

+

Description: Tests if the use of a gather map in the subject map is supported. This test generates a bag.

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0004-SM4/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/>.
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+@prefix ex:  <http://example.com/ns#>.
+
+<http://example.com/base#TM> a rml:TriplesMap;
+    rml:logicalSource [
+        rml:source _:b738439 ;
+        rml:referenceFormulation rml:JSONPath ;
+        rml:iterator "$.*" ;
+    ] ;
+
+    rml:subjectMap [
+        rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
+        rml:gatherAs rdf:Bag ;
+    ] ;
+
+    rml:predicateObjectMap [
+        rml:predicate ex:createdBy ;
+        rml:object ex:JohnDoe ;
+    ] ;
+.
+
+_:b738439 a rml:RelativePathSource ;
+    rml:path "data.json" .
+
+

Output

+
_:n1d393f12e993411498da676131f81ca4b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "2" .
+_:n1d393f12e993411498da676131f81ca4b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "5" .
+_:n1d393f12e993411498da676131f81ca4b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "1" .
+_:n1d393f12e993411498da676131f81ca4b2 <http://example.com/ns#createdBy> <http://example.com/ns#JohnDoe> .
+_:n1d393f12e993411498da676131f81ca4b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
+_:n1d393f12e993411498da676131f81ca4b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "3" .
+_:n1d393f12e993411498da676131f81ca4b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "4" .
+_:n1d393f12e993411498da676131f81ca4b1 <http://example.com/ns#createdBy> <http://example.com/ns#JohnDoe> .
+_:n1d393f12e993411498da676131f81ca4b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
+_:n1d393f12e993411498da676131f81ca4b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "6" .
+
+
+

21. RMLTC-CC-0004-SM5

+

Title: GatherMap in subject map (bag)

+

Description: Tests if the use of a gather map in the subject map is supported. This test has no predicate-object maps and no class declarations in the subject map. It should generate a non-empty bag and an empty bag. The reason being that a container has at least one triple ; it's type (bag, seq, or alt).

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0004-SM5/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/>.
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+@prefix ex:  <http://example.com/ns#>.
+
+<http://example.com/base#TM> a rml:TriplesMap;
+    rml:logicalSource [
+        rml:source _:b738439 ;
+        rml:referenceFormulation rml:JSONPath ;
+        rml:iterator "$.*" ;
+    ] ;
+
+    rml:subjectMap [
+        rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
+        rml:gatherAs rdf:Bag ;
+    ] ;
+.
+
+_:b738439 a rml:RelativePathSource ;
+    rml:path "data.json" .
+
+

Output

+
_:ne32066984b71404a953025d001cd3cdfb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
+_:ne32066984b71404a953025d001cd3cdfb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "2" .
+_:ne32066984b71404a953025d001cd3cdfb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "1" .
+_:ne32066984b71404a953025d001cd3cdfb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "3" .
+
+
+

22. RMLTC-CC-0005-App1

+

Title: Append values of multiple term maps

+

Description: Tests appending of values from multiple term maps in an gather map. This test covers the case where all sets of values are non-empty.

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0005-App1/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/>.
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+@prefix ex:  <http://example.com/ns#>.
+
+<http://example.com/base#TM> a rml:TriplesMap;
+    rml:logicalSource [
+        rml:source _:b738439 ;
+        rml:referenceFormulation rml:JSONPath ;
+        rml:iterator "$.*" ;
+    ] ;
+
+    rml:subjectMap [
+        rml:template "e/{$.id}" ;
+    ] ;
+
+    rml:predicateObjectMap [
+        rml:predicate ex:with ;
+        rml:objectMap [
+            rml:gather ( [ rml:reference "$.v1.*" ; ] [ rml:reference "$.v2.*" ; ] ) ;
+            rml:gatherAs rdf:List ;
+        ] ;
+    ] ;
+.
+
+_:b738439 a rml:RelativePathSource ;
+    rml:path "data.json" .
+
+

Output

+
<http://example.com/base/e/a> <http://example.com/ns#with> _:n1ee4a5a2b1344422919d171ab2cd6c39b1 .
+_:n1ee4a5a2b1344422919d171ab2cd6c39b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
+_:n1ee4a5a2b1344422919d171ab2cd6c39b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n1ee4a5a2b1344422919d171ab2cd6c39b2 .
+_:n1ee4a5a2b1344422919d171ab2cd6c39b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
+_:n1ee4a5a2b1344422919d171ab2cd6c39b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n1ee4a5a2b1344422919d171ab2cd6c39b4 .
+_:n1ee4a5a2b1344422919d171ab2cd6c39b4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "a" .
+_:n1ee4a5a2b1344422919d171ab2cd6c39b4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n1ee4a5a2b1344422919d171ab2cd6c39b5 .
+_:n1ee4a5a2b1344422919d171ab2cd6c39b5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "b" .
+_:n1ee4a5a2b1344422919d171ab2cd6c39b5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+<http://example.com/base/e/b> <http://example.com/ns#with> _:n1ee4a5a2b1344422919d171ab2cd6c39b6 .
+_:n1ee4a5a2b1344422919d171ab2cd6c39b6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" .
+_:n1ee4a5a2b1344422919d171ab2cd6c39b6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n1ee4a5a2b1344422919d171ab2cd6c39b7 .
+_:n1ee4a5a2b1344422919d171ab2cd6c39b7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "4" .
+_:n1ee4a5a2b1344422919d171ab2cd6c39b7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n1ee4a5a2b1344422919d171ab2cd6c39b8 .
+_:n1ee4a5a2b1344422919d171ab2cd6c39b8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "c" .
+_:n1ee4a5a2b1344422919d171ab2cd6c39b8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+
+
+

23. RMLTC-CC-0005-App2

+

Title: Append values of multiple term maps

+

Description: Tests appending of values from multiple term maps in an iteration. In this example, one of the arrays is empty and the expected behavior is to concatinate a list with the empty list.

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0005-App2/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/>.
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+@prefix ex:  <http://example.com/ns#>.
+
+<http://example.com/base#TM> a rml:TriplesMap;
+    rml:logicalSource [
+        rml:source _:b738439 ;
+        rml:referenceFormulation rml:JSONPath ;
+        rml:iterator "$.*" ;
+    ] ;
+
+    rml:subjectMap [
+        rml:template "e/{$.id}" ;
+    ] ;
+
+    rml:predicateObjectMap [
+        rml:predicate ex:with ;
+        rml:objectMap [
+            rml:gather ( [ rml:reference "$.v1.*" ; ] [ rml:reference "$.v2.*" ; ] ) ;
+            rml:gatherAs rdf:List ;
+        ] ;
+    ] ;
+.
+
+_:b738439 a rml:RelativePathSource ;
+    rml:path "data.json" .
+
+

Output

+
_:n1d9b8ef217cb44f299a062d746116deab1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n1d9b8ef217cb44f299a062d746116deab2 .
+_:n1d9b8ef217cb44f299a062d746116deab5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "b" .
+_:n1d9b8ef217cb44f299a062d746116deab4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n1d9b8ef217cb44f299a062d746116deab5 .
+_:n1d9b8ef217cb44f299a062d746116deab3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n1d9b8ef217cb44f299a062d746116deab4 .
+_:n1d9b8ef217cb44f299a062d746116deab7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "5" .
+_:n1d9b8ef217cb44f299a062d746116deab2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
+_:n1d9b8ef217cb44f299a062d746116deab8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "6" .
+_:n1d9b8ef217cb44f299a062d746116deab8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+_:n1d9b8ef217cb44f299a062d746116deab3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" .
+_:n1d9b8ef217cb44f299a062d746116deab4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "a" .
+_:n1d9b8ef217cb44f299a062d746116deab5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+_:n1d9b8ef217cb44f299a062d746116deab2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n1d9b8ef217cb44f299a062d746116deab3 .
+_:n1d9b8ef217cb44f299a062d746116deab1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
+<http://example.com/base/e/a> <http://example.com/ns#with> _:n1d9b8ef217cb44f299a062d746116deab1 .
+<http://example.com/base/e/b> <http://example.com/ns#with> _:n1d9b8ef217cb44f299a062d746116deab6 .
+_:n1d9b8ef217cb44f299a062d746116deab7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n1d9b8ef217cb44f299a062d746116deab8 .
+_:n1d9b8ef217cb44f299a062d746116deab6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n1d9b8ef217cb44f299a062d746116deab7 .
+_:n1d9b8ef217cb44f299a062d746116deab6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "4" .
+
+
+

24. RMLTC-CC-0005-Car1

+

Title: Cartesian product of values from multiple term maps of a gather map.

+

Description: Tests generating the Cartesian product of values from multiple term maps in a gather map. This test covers the case where all sets of values are non-empty.

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0005-Car1/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/>.
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+@prefix ex:  <http://example.com/ns#>.
+
+<http://example.com/base#TM> a rml:TriplesMap;
+    rml:logicalSource [
+        rml:source _:b738439 ;
+        rml:referenceFormulation rml:JSONPath ;
+        rml:iterator "$.*" ;
+    ] ;
+
+    rml:subjectMap [
+        rml:template "e/{$.id}" ;
+    ] ;
+
+    rml:predicateObjectMap [
+        rml:predicate ex:with ;
+        rml:objectMap [
+            rml:gather ( [ rml:reference "$.v1.*" ; ] [ rml:reference "$.v2.*" ; ] ) ;
+            rml:gatherAs rdf:List ;
+            rml:strategy rml:cartesianProduct ;
+        ] ;
+    ] ;
+.
+
+_:b738439 a rml:RelativePathSource ;
+    rml:path "data.json" .
+
+

Output

+
<http://example.com/base/e/a> <http://example.com/ns#with> _:nfc398e5692654ca98dfb3fb5432d277cb1 .
+_:nfc398e5692654ca98dfb3fb5432d277cb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
+_:nfc398e5692654ca98dfb3fb5432d277cb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nfc398e5692654ca98dfb3fb5432d277cb2 .
+_:nfc398e5692654ca98dfb3fb5432d277cb2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+_:nfc398e5692654ca98dfb3fb5432d277cb2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "a" .
+
+<http://example.com/base/e/a> <http://example.com/ns#with> _:nfc398e5692654ca98dfb3fb5432d277cb3 .
+_:nfc398e5692654ca98dfb3fb5432d277cb3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
+_:nfc398e5692654ca98dfb3fb5432d277cb3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nfc398e5692654ca98dfb3fb5432d277cb4 .
+_:nfc398e5692654ca98dfb3fb5432d277cb4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "b" .
+_:nfc398e5692654ca98dfb3fb5432d277cb4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+
+<http://example.com/base/e/a> <http://example.com/ns#with> _:nfc398e5692654ca98dfb3fb5432d277cb5 .
+_:nfc398e5692654ca98dfb3fb5432d277cb5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
+_:nfc398e5692654ca98dfb3fb5432d277cb5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nfc398e5692654ca98dfb3fb5432d277cb6 .
+_:nfc398e5692654ca98dfb3fb5432d277cb6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "a" .
+_:nfc398e5692654ca98dfb3fb5432d277cb6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+
+<http://example.com/base/e/a> <http://example.com/ns#with> _:nfc398e5692654ca98dfb3fb5432d277cb7 .
+_:nfc398e5692654ca98dfb3fb5432d277cb7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
+_:nfc398e5692654ca98dfb3fb5432d277cb7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nfc398e5692654ca98dfb3fb5432d277cb8 .
+_:nfc398e5692654ca98dfb3fb5432d277cb8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "b" .
+_:nfc398e5692654ca98dfb3fb5432d277cb8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+
+<http://example.com/base/e/b> <http://example.com/ns#with> _:nfc398e5692654ca98dfb3fb5432d277cb9 .
+_:nfc398e5692654ca98dfb3fb5432d277cb9 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" .
+_:nfc398e5692654ca98dfb3fb5432d277cb9 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nfc398e5692654ca98dfb3fb5432d277cb10 .
+_:nfc398e5692654ca98dfb3fb5432d277cb10 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "c" .
+_:nfc398e5692654ca98dfb3fb5432d277cb10 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+
+<http://example.com/base/e/b> <http://example.com/ns#with> _:nfc398e5692654ca98dfb3fb5432d277cb11 .
+_:nfc398e5692654ca98dfb3fb5432d277cb11 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "4" .
+_:nfc398e5692654ca98dfb3fb5432d277cb11 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nfc398e5692654ca98dfb3fb5432d277cb12 .
+_:nfc398e5692654ca98dfb3fb5432d277cb12 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "c" .
+_:nfc398e5692654ca98dfb3fb5432d277cb12 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+
+
+

25. RMLTC-CC-0005-Car2

+

Title: Cartesian product of values from multiple term maps of a gather map.

+

Description: Tests generating the Cartesian product of values from multiple term maps in a gather map. This test covers the case where one of the sets is empty. The Cartesian product of a set with an empty set is empty. This entry should thus not yield a list.

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0005-Car2/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/>.
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+@prefix ex:  <http://example.com/ns#>.
+
+<http://example.com/base#TM> a rml:TriplesMap;
+    rml:logicalSource [
+        rml:source _:b738439 ;
+        rml:referenceFormulation rml:JSONPath ;
+        rml:iterator "$.*" ;
+    ] ;
+
+    rml:subjectMap [
+        rml:template "e/{$.id}" ;
+    ] ;
+
+    rml:predicateObjectMap [
+        rml:predicate ex:with ;
+        rml:objectMap [
+            rml:gather ( [ rml:reference "$.v1.*" ; ] [ rml:reference "$.v2.*" ; ] ) ;
+            rml:gatherAs rdf:List ;
+            rml:strategy rml:cartesianProduct ;
+        ] ;
+    ] ;
+.
+
+_:b738439 a rml:RelativePathSource ;
+    rml:path "data.json" .
+
+

Output

+
<http://example.com/base/e/a> <http://example.com/ns#with> _:nfc398e5692654ca98dfb3fb5432d277cb1 .
+_:nfc398e5692654ca98dfb3fb5432d277cb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
+_:nfc398e5692654ca98dfb3fb5432d277cb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nfc398e5692654ca98dfb3fb5432d277cb2 .
+_:nfc398e5692654ca98dfb3fb5432d277cb2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+_:nfc398e5692654ca98dfb3fb5432d277cb2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "a" .
+
+<http://example.com/base/e/a> <http://example.com/ns#with> _:nfc398e5692654ca98dfb3fb5432d277cb3 .
+_:nfc398e5692654ca98dfb3fb5432d277cb3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
+_:nfc398e5692654ca98dfb3fb5432d277cb3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nfc398e5692654ca98dfb3fb5432d277cb4 .
+_:nfc398e5692654ca98dfb3fb5432d277cb4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "b" .
+_:nfc398e5692654ca98dfb3fb5432d277cb4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+
+<http://example.com/base/e/a> <http://example.com/ns#with> _:nfc398e5692654ca98dfb3fb5432d277cb5 .
+_:nfc398e5692654ca98dfb3fb5432d277cb5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
+_:nfc398e5692654ca98dfb3fb5432d277cb5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nfc398e5692654ca98dfb3fb5432d277cb6 .
+_:nfc398e5692654ca98dfb3fb5432d277cb6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "a" .
+_:nfc398e5692654ca98dfb3fb5432d277cb6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+
+<http://example.com/base/e/a> <http://example.com/ns#with> _:nfc398e5692654ca98dfb3fb5432d277cb7 .
+_:nfc398e5692654ca98dfb3fb5432d277cb7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
+_:nfc398e5692654ca98dfb3fb5432d277cb7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nfc398e5692654ca98dfb3fb5432d277cb8 .
+_:nfc398e5692654ca98dfb3fb5432d277cb8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "b" .
+_:nfc398e5692654ca98dfb3fb5432d277cb8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+
+
+

26. RMLTC-CC-0006-IT0

+

Title: Gather values across iterations to create a collection.

+

Description: When no template, constant, or reference is given to a gather map, then each iteration yields a different collection.

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0006-IT0/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/>.
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+@prefix ex:  <http://example.com/ns#>.
+
+<http://example.com/base#TM> a rml:TriplesMap;
+    rml:logicalSource [
+        rml:source _:b738439 ;
+        rml:referenceFormulation rml:JSONPath ;
+        rml:iterator "$.*" ;
+    ] ;
+
+    rml:subjectMap [
+        rml:template "e/{$.id}" ;
+    ] ;
+
+    rml:predicateObjectMap [
+        rml:predicate ex:with ;
+        rml:objectMap [
+            rml:gather ( [ rml:reference "$.v1.*" ; ] ) ;
+            rml:gatherAs rdf:List ;
+        ] ;
+    ] ;
+.
+
+_:b738439 a rml:RelativePathSource ;
+    rml:path "data.json" .
+
+

Output

+
<http://example.com/base/e/a> <http://example.com/ns#with> _:n9d785cd672d3484cb5d9fd831e6dfc07b1 .
+_:n9d785cd672d3484cb5d9fd831e6dfc07b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
+_:n9d785cd672d3484cb5d9fd831e6dfc07b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n9d785cd672d3484cb5d9fd831e6dfc07b2 .
+_:n9d785cd672d3484cb5d9fd831e6dfc07b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
+_:n9d785cd672d3484cb5d9fd831e6dfc07b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+
+<http://example.com/base/e/b> <http://example.com/ns#with> _:n9d785cd672d3484cb5d9fd831e6dfc07b5 .
+_:n9d785cd672d3484cb5d9fd831e6dfc07b5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" .
+_:n9d785cd672d3484cb5d9fd831e6dfc07b5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n9d785cd672d3484cb5d9fd831e6dfc07b6 .
+_:n9d785cd672d3484cb5d9fd831e6dfc07b6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "4" .
+_:n9d785cd672d3484cb5d9fd831e6dfc07b6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+
+<http://example.com/base/e/a> <http://example.com/ns#with> _:n9d785cd672d3484cb5d9fd831e6dfc07b3 .
+_:n9d785cd672d3484cb5d9fd831e6dfc07b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "5" .
+_:n9d785cd672d3484cb5d9fd831e6dfc07b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n9d785cd672d3484cb5d9fd831e6dfc07b4 .
+_:n9d785cd672d3484cb5d9fd831e6dfc07b4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "6" .
+_:n9d785cd672d3484cb5d9fd831e6dfc07b4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+
+
+

27. RMLTC-CC-0006-IT1

+

Title: Gather values across iterations to create a collection.

+

Description: When using a template, constant, or reference for a gather map, this tests determines whether the values are correctly appended to the list. The natural order of the term maps inside the gather map as well as the iteration are respected. This test covers one term map in the gather map.

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0006-IT1/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/>.
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+@prefix ex:  <http://example.com/ns#>.
+
+<http://example.com/base#TM> a rml:TriplesMap;
+    rml:logicalSource [
+        rml:source _:b738439 ;
+        rml:referenceFormulation rml:JSONPath ;
+        rml:iterator "$.*" ;
+    ] ;
+
+    rml:subjectMap [
+        rml:template "e/{$.id}" ;
+    ] ;
+
+    rml:predicateObjectMap [
+        rml:predicate ex:with ;
+        rml:objectMap [
+            rml:template "c/{$.id}" ;
+            rml:gather ( [ rml:reference "$.v1.*" ; ] ) ;
+            rml:gatherAs rdf:List ;
+        ] ;
+    ] ;
+.
+
+_:b738439 a rml:RelativePathSource ;
+    rml:path "data.json" .
+
+

Output

+
<http://example.com/base/e/a> <http://example.com/ns#with> <http://example.com/base/c/a> .
+<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
+<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nab8f496caee443c5ac19ce3a109f4b22b1 .
+_:nab8f496caee443c5ac19ce3a109f4b22b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
+_:nab8f496caee443c5ac19ce3a109f4b22b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nab8f496caee443c5ac19ce3a109f4b22b2 .
+_:nab8f496caee443c5ac19ce3a109f4b22b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "5" .
+_:nab8f496caee443c5ac19ce3a109f4b22b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nab8f496caee443c5ac19ce3a109f4b22b3 .
+_:nab8f496caee443c5ac19ce3a109f4b22b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "6" .
+_:nab8f496caee443c5ac19ce3a109f4b22b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+
+<http://example.com/base/e/b> <http://example.com/ns#with> <http://example.com/base/c/b> .
+<http://example.com/base/c/b> <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" .
+<http://example.com/base/c/b> <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nab8f496caee443c5ac19ce3a109f4b22b4 .
+_:nab8f496caee443c5ac19ce3a109f4b22b4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "4" .
+_:nab8f496caee443c5ac19ce3a109f4b22b4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+
+
+

28. RMLTC-CC-0006-IT2

+

Title: Gather values across iterations to create a collection.

+

Description: When using a template, constant, or reference for a gather map, this tests determines whether the values are correctly appended to the list. The natural order of the term maps inside the gather map as well as the iteration are respected. This test covers two term maps in the gather map.

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0006-IT2/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/>.
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+@prefix ex:  <http://example.com/ns#>.
+
+<http://example.com/base#TM> a rml:TriplesMap;
+    rml:logicalSource [
+        rml:source _:b738439 ;
+        rml:referenceFormulation rml:JSONPath ;
+        rml:iterator "$.*" ;
+    ] ;
+
+    rml:subjectMap [
+        rml:template "e/{$.id}" ;
+    ] ;
+
+    rml:predicateObjectMap [
+        rml:predicate ex:with ;
+        rml:objectMap [
+            rml:template "c/{$.id}" ;
+            rml:gather ( [ rml:reference "$.v1.*" ; ] [ rml:reference "$.v2.*" ; ] ) ;
+            rml:gatherAs rdf:List ;
+        ] ;
+    ] ;
+.
+
+_:b738439 a rml:RelativePathSource ;
+    rml:path "data.json" .
+
+

Output

+
<http://example.com/base/e/a> <http://example.com/ns#with> <http://example.com/base/c/a> .
+<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
+<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n0cbb21ce98464358963007f95dc35c0ab1 .
+_:n0cbb21ce98464358963007f95dc35c0ab1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
+_:n0cbb21ce98464358963007f95dc35c0ab1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n0cbb21ce98464358963007f95dc35c0ab2 .
+_:n0cbb21ce98464358963007f95dc35c0ab2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "a" .
+_:n0cbb21ce98464358963007f95dc35c0ab2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n0cbb21ce98464358963007f95dc35c0ab3 .
+_:n0cbb21ce98464358963007f95dc35c0ab3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "b" .
+_:n0cbb21ce98464358963007f95dc35c0ab3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n0cbb21ce98464358963007f95dc35c0ab4 .
+_:n0cbb21ce98464358963007f95dc35c0ab4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "5" .
+_:n0cbb21ce98464358963007f95dc35c0ab4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n0cbb21ce98464358963007f95dc35c0ab5 .
+_:n0cbb21ce98464358963007f95dc35c0ab5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "6" .
+_:n0cbb21ce98464358963007f95dc35c0ab5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n0cbb21ce98464358963007f95dc35c0ab6 .
+_:n0cbb21ce98464358963007f95dc35c0ab6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "d" .
+_:n0cbb21ce98464358963007f95dc35c0ab6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n0cbb21ce98464358963007f95dc35c0ab7 .
+_:n0cbb21ce98464358963007f95dc35c0ab7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "e" .
+_:n0cbb21ce98464358963007f95dc35c0ab7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+
+<http://example.com/base/e/b> <http://example.com/ns#with> <http://example.com/base/c/b> .
+<http://example.com/base/c/b> <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" .
+<http://example.com/base/c/b> <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n0cbb21ce98464358963007f95dc35c0ab8 .
+_:n0cbb21ce98464358963007f95dc35c0ab8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "4" .
+_:n0cbb21ce98464358963007f95dc35c0ab8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n0cbb21ce98464358963007f95dc35c0ab9 .
+_:n0cbb21ce98464358963007f95dc35c0ab9 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "c" .
+_:n0cbb21ce98464358963007f95dc35c0ab9 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+
+
+

29. RMLTC-CC-0006-IT3

+

Title: Gather values across iterations to create a container.

+

Description: When no template, constant, or reference is given to a gather map, then each iteration yields a different container.

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0006-IT3/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/>.
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+@prefix ex:  <http://example.com/ns#>.
+
+<http://example.com/base#TM> a rml:TriplesMap;
+    rml:logicalSource [
+        rml:source _:b738439 ;
+        rml:referenceFormulation rml:JSONPath ;
+        rml:iterator "$.*" ;
+    ] ;
+
+    rml:subjectMap [
+        rml:template "e/{$.id}" ;
+    ] ;
+
+    rml:predicateObjectMap [
+        rml:predicate ex:with ;
+        rml:objectMap [
+            rml:gather ( [ rml:reference "$.v1.*" ; ] ) ;
+            rml:gatherAs rdf:Bag ;
+        ] ;
+    ] ;
+.
+
+_:b738439 a rml:RelativePathSource ;
+    rml:path "data.json" .
+
+

Output

+
<http://example.com/base/e/a> <http://example.com/ns#with> _:a .
+_:a <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
+_:a <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "1" .
+_:a <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "2" .
+
+<http://example.com/base/e/b> <http://example.com/ns#with> _:b .
+_:b <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
+_:b <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "3" .
+_:b <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "4" .
+
+<http://example.com/base/e/a> <http://example.com/ns#with> _:c .
+_:c <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
+_:c <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "5" .
+_:c <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "6" .
+
+
+

30. RMLTC-CC-0006-IT4

+

Title: Gather values across iterations to create a container.

+

Description: When using a template, constant, or reference for a gather map, this tests determines whether the values are correctly appended to the container. The natural order of the term maps inside the gather map as well as the iteration are respected. This test covers one term map in the gather map.

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0006-IT4/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/>.
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+@prefix ex:  <http://example.com/ns#>.
+
+<http://example.com/base#TM> a rml:TriplesMap;
+    rml:logicalSource [
+        rml:source _:b738439 ;
+        rml:referenceFormulation rml:JSONPath ;
+        rml:iterator "$.*" ;
+    ] ;
+
+    rml:subjectMap [
+        rml:template "e/{$.id}" ;
+    ] ;
+
+    rml:predicateObjectMap [
+        rml:predicate ex:with ;
+        rml:objectMap [
+            rml:template "c/{$.id}" ;
+            rml:gather ( [ rml:reference "$.v1.*" ; ] ) ;
+            rml:gatherAs rdf:Bag ;
+        ] ;
+    ] ;
+.
+
+_:b738439 a rml:RelativePathSource ;
+    rml:path "data.json" .
+
+

Output

+
<http://example.com/base/e/a> <http://example.com/ns#with> <http://example.com/base/c/a> .
+<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
+<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "1" .
+<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "2" .
+<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "5" .
+<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_4> "6" .
+
+<http://example.com/base/e/b> <http://example.com/ns#with> <http://example.com/base/c/b> .
+<http://example.com/base/c/b> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
+<http://example.com/base/c/b> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "3" .
+<http://example.com/base/c/b> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "4" .
+
+
+

31. RMLTC-CC-0006-IT5

+

Title: Gather values across iterations to create a container.

+

Description: When using a template, constant, or reference for a gather map, this tests determines whether the values are correctly appended to the container. The natural order of the term maps inside the gather map as well as the iteration are respected. This test covers two term maps in the gather map.

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0006-IT5/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/>.
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+@prefix ex:  <http://example.com/ns#>.
+
+<http://example.com/base#TM> a rml:TriplesMap;
+    rml:logicalSource [
+        rml:source _:b738439 ;
+        rml:referenceFormulation rml:JSONPath ;
+        rml:iterator "$.*" ;
+    ] ;
+
+    rml:subjectMap [
+        rml:template "e/{$.id}" ;
+    ] ;
+
+    rml:predicateObjectMap [
+        rml:predicate ex:with ;
+        rml:objectMap [
+            rml:template "c/{$.id}" ;
+            rml:gather ( [ rml:reference "$.v1.*" ; ] [ rml:reference "$.v2.*" ; ] ) ;
+            rml:gatherAs rdf:Bag ;
+        ] ;
+    ] ;
+.
+
+_:b738439 a rml:RelativePathSource ;
+    rml:path "data.json" .
+
+

Output

+
<http://example.com/base/e/a> <http://example.com/ns#with> <http://example.com/base/c/a> .
+<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
+<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "1" .
+<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "2" .
+<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "a" .
+<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_4> "b" .
+<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_5> "5" .
+<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_6> "6" .
+<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_7> "d" .
+<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_8> "e" .
+
+<http://example.com/base/e/b> <http://example.com/ns#with> <http://example.com/base/c/b> .
+<http://example.com/base/c/b> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
+<http://example.com/base/c/b> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "3" .
+<http://example.com/base/c/b> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "4" .
+<http://example.com/base/c/b> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "c" .
+
+
+

32. RMLTC-CC-0007-NES

+

Title: Nested gather maps

+

Description: Testing whether nested gather maps are created. The mapping should generate a list of bags.

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0007-NES/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/>.
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+@prefix ex:  <http://example.com/ns#>.
+
+<http://example.com/base#TM> a rml:TriplesMap;
+    rml:logicalSource [
+        rml:source _:b738439 ;
+        rml:referenceFormulation rml:JSONPath ;
+        rml:iterator "$.*" ;
+    ] ;
+
+    rml:subjectMap [
+        rml:template "e/{$.id}" ;
+    ] ;
+
+    rml:predicateObjectMap [
+        rml:predicate ex:with ;
+        rml:objectMap [
+            rml:gather (
+                [
+                    rml:gather ( [ rml:reference "$.v1.*" ; ] ) ;
+                    rml:gatherAs rdf:Bag ;
+                ]
+                [
+                    rml:gather ( [ rml:reference "$.v2.*" ; ] ) ;
+                    rml:gatherAs rdf:Bag ;
+                ]
+            ) ;
+            rml:gatherAs rdf:List ;
+        ] ;
+    ] ;
+.
+
+_:b738439 a rml:RelativePathSource ;
+    rml:path "data.json" .
+
+

Output

+
_:nab9af1206e584ab2afd457e8a605872cb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
+_:nab9af1206e584ab2afd457e8a605872cb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "1" .
+_:nab9af1206e584ab2afd457e8a605872cb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "2" .
+
+_:nab9af1206e584ab2afd457e8a605872cb2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
+_:nab9af1206e584ab2afd457e8a605872cb2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "a" .
+_:nab9af1206e584ab2afd457e8a605872cb2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "b" .
+
+_:nab9af1206e584ab2afd457e8a605872cb5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
+_:nab9af1206e584ab2afd457e8a605872cb5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "3" .
+_:nab9af1206e584ab2afd457e8a605872cb5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "4" .
+
+_:nab9af1206e584ab2afd457e8a605872cb6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
+_:nab9af1206e584ab2afd457e8a605872cb6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "c" .
+
+<http://example.com/base/e/a> <http://example.com/ns#with> _:nab9af1206e584ab2afd457e8a605872cb3 .
+_:nab9af1206e584ab2afd457e8a605872cb3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> _:nab9af1206e584ab2afd457e8a605872cb1 .
+_:nab9af1206e584ab2afd457e8a605872cb3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nab9af1206e584ab2afd457e8a605872cb4 .
+
+_:nab9af1206e584ab2afd457e8a605872cb4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> _:nab9af1206e584ab2afd457e8a605872cb2 .
+_:nab9af1206e584ab2afd457e8a605872cb4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+
+<http://example.com/base/e/b> <http://example.com/ns#with> _:nab9af1206e584ab2afd457e8a605872cb7 .
+_:nab9af1206e584ab2afd457e8a605872cb7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> _:nab9af1206e584ab2afd457e8a605872cb5 .
+_:nab9af1206e584ab2afd457e8a605872cb7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nab9af1206e584ab2afd457e8a605872cb8 .
+
+_:nab9af1206e584ab2afd457e8a605872cb8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> _:nab9af1206e584ab2afd457e8a605872cb6 .
+_:nab9af1206e584ab2afd457e8a605872cb8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+
+
+
+

33. RMLTC-CC-0008-ROMa

+

Title: Elements via reference object-map.

+

Description: Testing whether gather maps generate an RDF list whose members are generated by a referencing object-map.

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0008-ROMa/Friends.json

+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+
+_:b273446 a rml:RelativePathSource ;
+    rml:path "student.csv" .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap ;
+    rml:logicalSource [ a rml:LogicalSource ;
+            rml:referenceFormulation rml:CSV ;
+            rml:source _:b273446 ] ;
+            
+    rml:predicateObjectMap [ 
+        rml:objectMap [
+                rml:reference "ID" ; rml:termType rml:BlankNode ;
+                rml:gather ( 
+                    [ 
+                        rml:parentTriplesMap <http://example.com/base/TriplesMap1> ;
+                        rml:joinCondition [ rml:child "Sport" ; rml:parent "Sport" ] ;
+                    ] 
+                ) ;
+                rml:gatherAs rdf:List;
+            ] ;    
+        rml:predicate ex:sameSportAs 
+    ] ;
+
+    rml:subjectMap [ rml:template "http://example.com/Student/{ID}/{Name}" ] .
+
+

Output

+
_:genid1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> <http://example.com/Student/10/Venus%20Williams> .
+_:genid1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:genid2 .
+_:genid2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> <http://example.com/Student/20/Serena%20Williams> .
+_:genid2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+<http://example.com/Student/10/Venus%20Williams> <http://example.com/sameSportAs> _:genid1 .
+_:genid3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> <http://example.com/Student/10/Venus%20Williams> .
+_:genid3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:genid4 .
+_:genid4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> <http://example.com/Student/20/Serena%20Williams> .
+_:genid4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+<http://example.com/Student/20/Serena%20Williams> <http://example.com/sameSportAs> _:genid3 .
+_:genid5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> <http://example.com/Student/30/Loena%20Hendrickx> .
+_:genid5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+<http://example.com/Student/30/Loena%20Hendrickx> <http://example.com/sameSportAs> _:genid5 .
+
+
+

34. RMLTC-CC-0008-ROMb

+

Title: Elements via reference object-map with default join condition

+

Description: Testing whether gather maps generate an RDF list whose members are generated by a referencing object-map with a default join condition.

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0008-ROMb/Friends.json

+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+
+_:b273446 a rml:RelativePathSource ;
+    rml:path "student.csv" .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap ;
+    rml:logicalSource [ a rml:LogicalSource ;
+            rml:referenceFormulation rml:CSV ;
+            rml:source _:b273446 ] ;
+            
+    rml:predicateObjectMap [
+        rml:objectMap [
+            rml:reference "ID" ; rml:termType rml:BlankNode ;
+            rml:gather ( 
+                [ 
+                    rml:parentTriplesMap <http://example.com/base/TriplesMap1> ;
+                ] 
+            ) ;
+            rml:gatherAs rdf:List;
+        ] ;
+        rml:predicate ex:sameSportAs 
+    ] ;
+        
+    rml:subjectMap [ rml:template "http://example.com/Student/{ID}/{Name}" ] .
+
+
+

Output

+
_:genid1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> <http://example.com/Student/30/Loena%20Hendrickx> .
+_:genid1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+<http://example.com/Student/30/Loena%20Hendrickx> <http://example.com/sameSportAs> _:genid1 .
+_:genid2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> <http://example.com/Student/20/Serena%20Williams> .
+_:genid2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+<http://example.com/Student/20/Serena%20Williams> <http://example.com/sameSportAs> _:genid2 .
+_:genid3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> <http://example.com/Student/10/Venus%20Williams> .
+_:genid3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+<http://example.com/Student/10/Venus%20Williams> <http://example.com/sameSportAs> _:genid3 .
+
+
+

35. RMLTC-CC-0009-DUP-Bag

+

Title: Gather duplicate values in an RDF Bag

+

Description: Testing the expected behavior of multi-valued expression maps containing duplicate values when these expression maps are used in a gather map to create an RDF Bag.

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0009-DUP-Bag/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/>.
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+@prefix ex:  <http://example.com/ns#>.
+
+<http://example.com/base#TM> a rml:TriplesMap;
+    rml:logicalSource [
+        rml:source _:b738439 ;
+        rml:referenceFormulation rml:JSONPath ;
+        rml:iterator "$.*" ;
+    ] ;
+
+    rml:subjectMap [
+        rml:template "e/{$.id}" ;
+    ] ;
+
+    rml:predicateObjectMap [
+        rml:predicate ex:with ;
+        rml:objectMap [
+            rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
+            rml:gatherAs rdf:Bag ;
+        ] ;
+    ] ;
+.
+
+_:b738439 a rml:RelativePathSource ;
+    rml:path "data.json" .
+
+

Output

+
_:nc808fbd2e11a4baa939c61c8210b5909b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
+_:nc808fbd2e11a4baa939c61c8210b5909b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "2" .
+_:nc808fbd2e11a4baa939c61c8210b5909b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
+_:nc808fbd2e11a4baa939c61c8210b5909b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
+_:nc808fbd2e11a4baa939c61c8210b5909b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "9" .
+_:nc808fbd2e11a4baa939c61c8210b5909b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "1" .
+<http://example.com/base/e/b> <http://example.com/ns#with> _:nc808fbd2e11a4baa939c61c8210b5909b2 .
+_:nc808fbd2e11a4baa939c61c8210b5909b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "1" .
+<http://example.com/base/e/c> <http://example.com/ns#with> _:nc808fbd2e11a4baa939c61c8210b5909b3 .
+<http://example.com/base/e/a> <http://example.com/ns#with> _:nc808fbd2e11a4baa939c61c8210b5909b1 .
+_:nc808fbd2e11a4baa939c61c8210b5909b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "2" .
+_:nc808fbd2e11a4baa939c61c8210b5909b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "7" .
+_:nc808fbd2e11a4baa939c61c8210b5909b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "6" .
+_:nc808fbd2e11a4baa939c61c8210b5909b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "1" .
+_:nc808fbd2e11a4baa939c61c8210b5909b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "8" .
+
+
+

36. RMLTC-CC-0009-DUP-List

+

Title: Gather duplicate values in an RDF List

+

Description: Testing the expected behavior of multi-valued expression maps containing duplicate values when these expression maps are used in a gather map to create a list.

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0009-DUP-List/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/>.
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+@prefix ex:  <http://example.com/ns#>.
+
+<http://example.com/base#TM> a rml:TriplesMap;
+    rml:logicalSource [
+        rml:source _:b738439 ;
+        rml:referenceFormulation rml:JSONPath ;
+        rml:iterator "$.*" ;
+    ] ;
+
+    rml:subjectMap [
+        rml:template "e/{$.id}" ;
+    ] ;
+
+    rml:predicateObjectMap [
+        rml:predicate ex:with ;
+        rml:objectMap [
+            rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
+            rml:gatherAs rdf:List ;
+        ] ;
+    ] ;
+.
+
+_:b738439 a rml:RelativePathSource ;
+    rml:path "data.json" .
+
+

Output

+
<http://example.com/base/e/a> <http://example.com/ns#with> _:n988e0f11d19c486fa3b3255f94c9b3bab1 .
+_:n988e0f11d19c486fa3b3255f94c9b3bab1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
+_:n988e0f11d19c486fa3b3255f94c9b3bab1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n988e0f11d19c486fa3b3255f94c9b3bab2 .
+_:n988e0f11d19c486fa3b3255f94c9b3bab2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
+_:n988e0f11d19c486fa3b3255f94c9b3bab2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n988e0f11d19c486fa3b3255f94c9b3bab3 .
+_:n988e0f11d19c486fa3b3255f94c9b3bab3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
+_:n988e0f11d19c486fa3b3255f94c9b3bab3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+
+<http://example.com/base/e/b> <http://example.com/ns#with> _:n988e0f11d19c486fa3b3255f94c9b3bab4 .
+_:n988e0f11d19c486fa3b3255f94c9b3bab4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
+_:n988e0f11d19c486fa3b3255f94c9b3bab4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n988e0f11d19c486fa3b3255f94c9b3bab5 .
+_:n988e0f11d19c486fa3b3255f94c9b3bab5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
+_:n988e0f11d19c486fa3b3255f94c9b3bab5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n988e0f11d19c486fa3b3255f94c9b3bab6 .
+_:n988e0f11d19c486fa3b3255f94c9b3bab6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "6" .
+_:n988e0f11d19c486fa3b3255f94c9b3bab6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+
+<http://example.com/base/e/c> <http://example.com/ns#with> _:n988e0f11d19c486fa3b3255f94c9b3bab7 .
+_:n988e0f11d19c486fa3b3255f94c9b3bab7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "7" .
+_:n988e0f11d19c486fa3b3255f94c9b3bab7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n988e0f11d19c486fa3b3255f94c9b3bab8 .
+_:n988e0f11d19c486fa3b3255f94c9b3bab8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "8" .
+_:n988e0f11d19c486fa3b3255f94c9b3bab8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n988e0f11d19c486fa3b3255f94c9b3bab9 .
+_:n988e0f11d19c486fa3b3255f94c9b3bab9 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "9" .
+_:n988e0f11d19c486fa3b3255f94c9b3bab9 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+
+
+

37. RMLTC-CC-0010-Lista

+

Title: Combining graph maps and gather maps (graph map has a template and gather map does not)

+

Description: Tests the behavior of combining graph- and gather maps. In this example, a blank node for each list is expected.

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0010-Lista/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/>.
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+@prefix ex:  <http://example.com/ns#>.
+
+<http://example.com/base#TM> a rml:TriplesMap;
+    rml:logicalSource [
+        rml:source _:b738439 ;
+        rml:referenceFormulation rml:JSONPath ;
+        rml:iterator "$.*" ;
+    ] ;
+
+    rml:subjectMap [
+        rml:template "e/{$.id}" ;
+    ] ;
+
+    rml:predicateObjectMap [
+        rml:graphMap [ rml:template "g/{$.graph}" ; ] ;
+        rml:predicate ex:with ;
+        rml:objectMap [
+            rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
+            rml:gatherAs rdf:List ;
+        ] ;
+    ] ;
+.
+
+_:b738439 a rml:RelativePathSource ;
+    rml:path "data.json" .
+
+

Output

+
_:genid1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" <http://example.com/base/g/1> .
+_:genid1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> <http://example.com/base/g/1> .
+_:genid2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" <http://example.com/base/g/1> .
+_:genid2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> <http://example.com/base/g/1> .
+<http://example.com/base/e/a> <http://example.com/ns#with> _:genid1 <http://example.com/base/g/1> .
+<http://example.com/base/e/a> <http://example.com/ns#with> _:genid2 <http://example.com/base/g/1> .
+
+_:genidx1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" <http://example.com/base/g/2> .
+_:genidx1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> <http://example.com/base/g/2> .
+<http://example.com/base/e/a> <http://example.com/ns#with> _:genidx1 <http://example.com/base/g/2> .
+
+
+

38. RMLTC-CC-0010-Listb

+

Title: Combining graph maps and gather maps (both graph map and gather map have a template)

+

Description: Tests the behavior of combining graph- and gather maps. In this example, lists are concatinated in some named graphs via blank node identifiers constructed with templates.

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0010-Listb/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/>.
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+@prefix ex:  <http://example.com/ns#>.
+
+<http://example.com/base#TM> a rml:TriplesMap;
+    rml:logicalSource [
+        rml:source _:b738439 ;
+        rml:referenceFormulation rml:JSONPath ;
+        rml:iterator "$.*" ;
+    ] ;
+
+    rml:subjectMap [
+        rml:template "e/{$.id}" ;
+    ] ;
+
+    rml:predicateObjectMap [
+        rml:graphMap [ rml:template "g/{$.graph}" ; ] ;
+        rml:predicate ex:with ;
+        rml:objectMap [
+            rml:template "l/{$.id}" ; rml:termType rml:BlankNode ;
+            rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
+            rml:gatherAs rdf:List ;
+        ] ;
+    ] ;
+.
+
+_:b738439 a rml:RelativePathSource ;
+    rml:path "data.json" .
+
+

Output

+
_:genid1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" <http://example.com/base/g/1> .
+_:genid1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:genid2 <http://example.com/base/g/1> .
+_:genid2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" <http://example.com/base/g/1> .
+_:genid2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> <http://example.com/base/g/1> .
+<http://example.com/base/e/a> <http://example.com/ns#with> _:genid1 <http://example.com/base/g/1> .
+
+_:genidx1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" <http://example.com/base/g/2> .
+_:genidx1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> <http://example.com/base/g/2> .
+<http://example.com/base/e/a> <http://example.com/ns#with> _:genidx1 <http://example.com/base/g/2> .
+
+
+ + + + + \ No newline at end of file diff --git a/src/test/resources/rml-cc/docs/index.html b/src/test/resources/rml-cc/docs/index.html new file mode 100644 index 00000000..2ad784eb --- /dev/null +++ b/src/test/resources/rml-cc/docs/index.html @@ -0,0 +1,2544 @@ + + + + + + +RML-CC: Test Cases + + + + + + + + + + + + + + + + + + + +

Abstract

This document defines the RML-CC test cases to the determine the RML-CC specification conformance of tools.

+
+ +

Status of This Document

+ This specification was published by the + Knowledge Graph Construction Community Group. It is not a W3C Standard nor is it + on the W3C Standards Track. + + Please note that under the + W3C Community Contributor License Agreement (CLA) + there is a limited opt-out and other conditions apply. + + Learn more about + W3C Community and Business Groups. +

+ +

1. Introduction

+

This document defines the RML-CC test cases, consisting of a collection of test case documents (input and expected output). +The purpose of the test cases is to determine the conformance of tools that execute RML rules to the RML-CC specification.

+
+ +

2. Data model

+

The test cases are semantically described for re-usability and shareability following the W3C Test case description. +Each test:Testcase as the following properties:

+
    +
  • dcterms:identifier: unique ID of the test case.
  • +
  • rmltest:hasError: if an error of the RML Processor is expected or not.
  • +
  • rmltest:input: One or more input data of the test case.
  • +
  • rmltest:output: One or more output data of the test case.
  • +
  • rmltest:inputFormat: the input data format.
  • +
  • rmltest:outputFormat: the output data format.
  • +
  • rmltest:mappingDocument: the RML mapping rules in Turtle.
  • +
+
+ +

3. Test cases

+

This section describes the RML-CC test cases. These descriptions are also available as RDF. +The files are available on GitHub in the folder test-cases. +Each test case is contained in a single folder, containing three types of files:

+
    +
  • Zero or more files containing the data sources, in the case of JSON, XML, CSV, or containing the SQL statements to create the necessary tables, in the case of MySQL, PostgreSQL, and SQL Server.
  • +
  • One file with the RML rules, called mapping.ttl, in the Turtle format.
  • +
  • Zero or more files with the expected RDF. No file is provided if an error is expected that must halt the generation of the RDF because of an error.
  • +
+
+ + +

4. RMLTC-CC-0001-Alt

+

Title: Generate a rdf:Alt as an object

+

Description: Tests if a rdf:Alt is generated as an object

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0001-Alt/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/>.
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+@prefix ex:  <http://example.com/ns#>.
+
+<http://example.com/base#TM> a rml:TriplesMap;
+    rml:logicalSource [
+        rml:source _:b738439 ;
+        rml:referenceFormulation rml:JSONPath ;
+        rml:iterator "$.*" ;
+    ] ;
+
+    rml:subjectMap [
+        rml:template "e/{$.id}" ;
+    ] ;
+
+    rml:predicateObjectMap [
+        rml:predicate ex:with ;
+        rml:objectMap [
+            rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
+            rml:gatherAs rdf:Alt ;
+        ] ;
+    ] ;
+.
+
+_:b738439 a rml:RelativePathSource ;
+    rml:path "data.json" .
+
+

Output

+
<http://example.com/base/e/a> <http://example.com/ns#with> _:nc808fbd2e11a4baa939c61c8210b5909b1 .
+_:nc808fbd2e11a4baa939c61c8210b5909b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Alt> .
+_:nc808fbd2e11a4baa939c61c8210b5909b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "1" .
+_:nc808fbd2e11a4baa939c61c8210b5909b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "2" .
+_:nc808fbd2e11a4baa939c61c8210b5909b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "3" .
+
+<http://example.com/base/e/b> <http://example.com/ns#with> _:nc808fbd2e11a4baa939c61c8210b5909b2 .
+_:nc808fbd2e11a4baa939c61c8210b5909b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Alt> .
+_:nc808fbd2e11a4baa939c61c8210b5909b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "4" .
+_:nc808fbd2e11a4baa939c61c8210b5909b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "5" .
+_:nc808fbd2e11a4baa939c61c8210b5909b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "6" .
+
+<http://example.com/base/e/c> <http://example.com/ns#with> _:nc808fbd2e11a4baa939c61c8210b5909b3 .
+_:nc808fbd2e11a4baa939c61c8210b5909b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Alt> .
+_:nc808fbd2e11a4baa939c61c8210b5909b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "7" .
+_:nc808fbd2e11a4baa939c61c8210b5909b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "8" .
+_:nc808fbd2e11a4baa939c61c8210b5909b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "9" .
+
+
+

5. RMLTC-CC-0001-Bag

+

Title: Generate a rdf:Bag as an object

+

Description: Tests if a rdf:Bag is generated as an object

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0001-Bag/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/>.
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+@prefix ex:  <http://example.com/ns#>.
+
+<http://example.com/base#TM> a rml:TriplesMap;
+    rml:logicalSource [
+        rml:source _:b738439 ;
+        rml:referenceFormulation rml:JSONPath ;
+        rml:iterator "$.*" ;
+    ] ;
+
+    rml:subjectMap [
+        rml:template "e/{$.id}" ;
+    ] ;
+
+    rml:predicateObjectMap [
+        rml:predicate ex:with ;
+        rml:objectMap [
+            rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
+            rml:gatherAs rdf:Bag ;
+        ] ;
+    ] ;
+.
+
+_:b738439 a rml:RelativePathSource ;
+    rml:path "data.json" .
+
+

Output

+
_:nc808fbd2e11a4baa939c61c8210b5909b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
+_:nc808fbd2e11a4baa939c61c8210b5909b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "5" .
+_:nc808fbd2e11a4baa939c61c8210b5909b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
+_:nc808fbd2e11a4baa939c61c8210b5909b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
+_:nc808fbd2e11a4baa939c61c8210b5909b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "9" .
+_:nc808fbd2e11a4baa939c61c8210b5909b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "2" .
+<http://example.com/base/e/b> <http://example.com/ns#with> _:nc808fbd2e11a4baa939c61c8210b5909b2 .
+_:nc808fbd2e11a4baa939c61c8210b5909b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "1" .
+<http://example.com/base/e/c> <http://example.com/ns#with> _:nc808fbd2e11a4baa939c61c8210b5909b3 .
+<http://example.com/base/e/a> <http://example.com/ns#with> _:nc808fbd2e11a4baa939c61c8210b5909b1 .
+_:nc808fbd2e11a4baa939c61c8210b5909b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "4" .
+_:nc808fbd2e11a4baa939c61c8210b5909b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "7" .
+_:nc808fbd2e11a4baa939c61c8210b5909b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "6" .
+_:nc808fbd2e11a4baa939c61c8210b5909b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "3" .
+_:nc808fbd2e11a4baa939c61c8210b5909b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "8" .
+
+
+

6. RMLTC-CC-0001-List

+

Title: Generate a rdf:List as an object

+

Description: Tests if a rdf:List is generated as an object

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0001-List/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/>.
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+@prefix ex:  <http://example.com/ns#>.
+
+<http://example.com/base#TM> a rml:TriplesMap;
+    rml:logicalSource [
+        rml:source _:b738439 ;
+        rml:referenceFormulation rml:JSONPath ;
+        rml:iterator "$.*" ;
+    ] ;
+
+    rml:subjectMap [
+        rml:template "e/{$.id}" ;
+    ] ;
+
+    rml:predicateObjectMap [
+        rml:predicate ex:with ;
+        rml:objectMap [
+            rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
+            rml:gatherAs rdf:List ;
+        ] ;
+    ] ;
+.
+
+_:b738439 a rml:RelativePathSource ;
+    rml:path "data.json" .
+
+

Output

+
<http://example.com/base/e/a> <http://example.com/ns#with> _:n988e0f11d19c486fa3b3255f94c9b3bab1 .
+_:n988e0f11d19c486fa3b3255f94c9b3bab1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
+_:n988e0f11d19c486fa3b3255f94c9b3bab1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n988e0f11d19c486fa3b3255f94c9b3bab2 .
+_:n988e0f11d19c486fa3b3255f94c9b3bab2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
+_:n988e0f11d19c486fa3b3255f94c9b3bab2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n988e0f11d19c486fa3b3255f94c9b3bab3 .
+_:n988e0f11d19c486fa3b3255f94c9b3bab3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" .
+_:n988e0f11d19c486fa3b3255f94c9b3bab3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+
+<http://example.com/base/e/b> <http://example.com/ns#with> _:n988e0f11d19c486fa3b3255f94c9b3bab4 .
+_:n988e0f11d19c486fa3b3255f94c9b3bab4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "4" .
+_:n988e0f11d19c486fa3b3255f94c9b3bab4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n988e0f11d19c486fa3b3255f94c9b3bab5 .
+_:n988e0f11d19c486fa3b3255f94c9b3bab5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "5" .
+_:n988e0f11d19c486fa3b3255f94c9b3bab5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n988e0f11d19c486fa3b3255f94c9b3bab6 .
+_:n988e0f11d19c486fa3b3255f94c9b3bab6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "6" .
+_:n988e0f11d19c486fa3b3255f94c9b3bab6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+
+<http://example.com/base/e/c> <http://example.com/ns#with> _:n988e0f11d19c486fa3b3255f94c9b3bab7 .
+_:n988e0f11d19c486fa3b3255f94c9b3bab7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "7" .
+_:n988e0f11d19c486fa3b3255f94c9b3bab7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n988e0f11d19c486fa3b3255f94c9b3bab8 .
+_:n988e0f11d19c486fa3b3255f94c9b3bab8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "8" .
+_:n988e0f11d19c486fa3b3255f94c9b3bab8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n988e0f11d19c486fa3b3255f94c9b3bab9 .
+_:n988e0f11d19c486fa3b3255f94c9b3bab9 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "9" .
+_:n988e0f11d19c486fa3b3255f94c9b3bab9 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+
+
+

7. RMLTC-CC-0001-Seq

+

Title: Generate a rdf:Seq as an object

+

Description: Tests if a rdf:Seq is generated as an object

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0001-Seq/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/>.
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+@prefix ex:  <http://example.com/ns#>.
+
+<http://example.com/base#TM> a rml:TriplesMap;
+    rml:logicalSource [
+        rml:source _:b738439 ;
+        rml:referenceFormulation rml:JSONPath ;
+        rml:iterator "$.*" ;
+    ] ;
+
+    rml:subjectMap [
+        rml:template "e/{$.id}" ;
+    ] ;
+
+    rml:predicateObjectMap [
+        rml:predicate ex:with ;
+        rml:objectMap [
+            rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
+            rml:gatherAs rdf:Seq ;
+        ] ;
+    ] ;
+.
+
+_:b738439 a rml:RelativePathSource ;
+    rml:path "data.json" .
+
+

Output

+
_:nc808fbd2e11a4baa939c61c8210b5909b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Seq> .
+_:nc808fbd2e11a4baa939c61c8210b5909b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "5" .
+_:nc808fbd2e11a4baa939c61c8210b5909b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Seq> .
+_:nc808fbd2e11a4baa939c61c8210b5909b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Seq> .
+_:nc808fbd2e11a4baa939c61c8210b5909b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "9" .
+_:nc808fbd2e11a4baa939c61c8210b5909b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "2" .
+<http://example.com/base/e/b> <http://example.com/ns#with> _:nc808fbd2e11a4baa939c61c8210b5909b2 .
+_:nc808fbd2e11a4baa939c61c8210b5909b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "1" .
+<http://example.com/base/e/c> <http://example.com/ns#with> _:nc808fbd2e11a4baa939c61c8210b5909b3 .
+<http://example.com/base/e/a> <http://example.com/ns#with> _:nc808fbd2e11a4baa939c61c8210b5909b1 .
+_:nc808fbd2e11a4baa939c61c8210b5909b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "4" .
+_:nc808fbd2e11a4baa939c61c8210b5909b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "7" .
+_:nc808fbd2e11a4baa939c61c8210b5909b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "6" .
+_:nc808fbd2e11a4baa939c61c8210b5909b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "3" .
+_:nc808fbd2e11a4baa939c61c8210b5909b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "8" .
+
+
+

8. RMLTC-CC-0002-Bag

+

Title: Generate a named rdf:Bag as an object

+

Description: Tests if a named rdf:Bag is generated as an object

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0002-Bag/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/>.
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+@prefix ex:  <http://example.com/ns#>.
+
+<http://example.com/base#TM> a rml:TriplesMap;
+    rml:logicalSource [
+        rml:source _:b738439 ;
+        rml:referenceFormulation rml:JSONPath ;
+        rml:iterator "$.*" ;
+    ] ;
+
+    rml:subjectMap [
+        rml:template "e/{$.id}" ;
+    ] ;
+
+    rml:predicateObjectMap [
+        rml:predicate ex:with ;
+        rml:objectMap [
+            rml:template "c/{$.id}" ;
+            rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
+            rml:gatherAs rdf:Bag ;
+        ] ;
+    ] ;
+.
+
+_:b738439 a rml:RelativePathSource ;
+    rml:path "data.json" .
+
+

Output

+
<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
+<http://example.com/base/c/c> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "7" .
+<http://example.com/base/c/c> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "8" .
+<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "2" .
+<http://example.com/base/e/c> <http://example.com/ns#with> <http://example.com/base/c/c> .
+<http://example.com/base/c/c> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
+<http://example.com/base/c/b> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "6" .
+<http://example.com/base/e/a> <http://example.com/ns#with> <http://example.com/base/c/a> .
+<http://example.com/base/c/c> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "9" .
+<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "1" .
+<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "3" .
+<http://example.com/base/c/b> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "4" .
+<http://example.com/base/e/b> <http://example.com/ns#with> <http://example.com/base/c/b> .
+<http://example.com/base/c/b> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
+<http://example.com/base/c/b> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "5" .
+
+
+

9. RMLTC-CC-0002-List

+

Title: Generate a named rdf:List as an object

+

Description: Tests if a named rdf:List is generated as an object

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0002-List/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/>.
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+@prefix ex:  <http://example.com/ns#>.
+
+<http://example.com/base#TM> a rml:TriplesMap;
+    rml:logicalSource [
+        rml:source _:b738439 ;
+        rml:referenceFormulation rml:JSONPath ;
+        rml:iterator "$.*" ;
+    ] ;
+
+    rml:subjectMap [
+        rml:template "e/{$.id}" ;
+    ] ;
+
+    rml:predicateObjectMap [
+        rml:predicate ex:with ;
+        rml:objectMap [
+            rml:template "c/{$.id}" ;
+            rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
+            rml:gatherAs rdf:List ;
+        ] ;
+    ] ;
+.
+
+_:b738439 a rml:RelativePathSource ;
+    rml:path "data.json" .
+
+

Output

+
_:nb73dd869d6bb47a5b865ee632fe27453b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nb73dd869d6bb47a5b865ee632fe27453b2 .
+<http://example.com/base/e/c> <http://example.com/ns#with> <http://example.com/base/c/c> .
+<http://example.com/base/c/c> <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "7" .
+_:nb73dd869d6bb47a5b865ee632fe27453b5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "8" .
+_:nb73dd869d6bb47a5b865ee632fe27453b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nb73dd869d6bb47a5b865ee632fe27453b4 .
+_:nb73dd869d6bb47a5b865ee632fe27453b6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+<http://example.com/base/e/a> <http://example.com/ns#with> <http://example.com/base/c/a> .
+_:nb73dd869d6bb47a5b865ee632fe27453b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "5" .
+<http://example.com/base/c/b> <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nb73dd869d6bb47a5b865ee632fe27453b3 .
+_:nb73dd869d6bb47a5b865ee632fe27453b4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "6" .
+_:nb73dd869d6bb47a5b865ee632fe27453b4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+_:nb73dd869d6bb47a5b865ee632fe27453b5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nb73dd869d6bb47a5b865ee632fe27453b6 .
+_:nb73dd869d6bb47a5b865ee632fe27453b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+_:nb73dd869d6bb47a5b865ee632fe27453b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
+_:nb73dd869d6bb47a5b865ee632fe27453b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" .
+<http://example.com/base/c/b> <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "4" .
+<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nb73dd869d6bb47a5b865ee632fe27453b1 .
+<http://example.com/base/c/c> <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nb73dd869d6bb47a5b865ee632fe27453b5 .
+_:nb73dd869d6bb47a5b865ee632fe27453b6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "9" .
+<http://example.com/base/e/b> <http://example.com/ns#with> <http://example.com/base/c/b> .
+<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
+
+
+

10. RMLTC-CC-0003-EB

+

Title: Allow the generation of empty bags

+

Description: Tests if the use of rml:allowEmptyListAndContainer yields an empty bag.

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0003-EB/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/>.
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+@prefix ex:  <http://example.com/ns#>.
+
+<http://example.com/base#TM> a rml:TriplesMap;
+    rml:logicalSource [
+        rml:source _:b738439 ;
+        rml:referenceFormulation rml:JSONPath ;
+        rml:iterator "$.*" ;
+    ] ;
+
+    rml:subjectMap [
+        rml:template "e/{$.id}" ;
+    ] ;
+
+    rml:predicateObjectMap [
+        rml:predicate ex:with ;
+        rml:objectMap [
+            rml:allowEmptyListAndContainer true ;
+            rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
+            rml:gatherAs rdf:Bag ;
+        ] ;
+    ] ;
+.
+
+_:b738439 a rml:RelativePathSource ;
+    rml:path "data.json" .
+
+

Output

+
_:nfecac3cfe48c4afa99539cc809138e96b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
+<http://example.com/base/e/a> <http://example.com/ns#with> _:nfecac3cfe48c4afa99539cc809138e96b1 .
+_:nfecac3cfe48c4afa99539cc809138e96b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
+_:nfecac3cfe48c4afa99539cc809138e96b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "1" .
+<http://example.com/base/e/b> <http://example.com/ns#with> _:nfecac3cfe48c4afa99539cc809138e96b2 .
+_:nfecac3cfe48c4afa99539cc809138e96b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "2" .
+_:nfecac3cfe48c4afa99539cc809138e96b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "3" .
+
+
+

11. RMLTC-CC-0003-EL

+

Title: Allow the generation of empty lists

+

Description: Tests if the use of rml:allowEmptyListAndContainer yields an empty list.

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0003-EL/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/>.
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+@prefix ex:  <http://example.com/ns#>.
+
+<http://example.com/base#TM> a rml:TriplesMap;
+    rml:logicalSource [
+        rml:source _:b738439 ;
+        rml:referenceFormulation rml:JSONPath ;
+        rml:iterator "$.*" ;
+    ] ;
+
+    rml:subjectMap [
+        rml:template "e/{$.id}" ;
+    ] ;
+
+    rml:predicateObjectMap [
+        rml:predicate ex:with ;
+        rml:objectMap [
+            rml:allowEmptyListAndContainer true ;
+            rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
+            rml:gatherAs rdf:List ;
+        ] ;
+    ] ;
+.
+
+_:b738439 a rml:RelativePathSource ;
+    rml:path "data.json" .
+
+

Output

+
_:n302eecc856b44ed5b76965d9be2f5213b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+<http://example.com/base/e/b> <http://example.com/ns#with> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+_:n302eecc856b44ed5b76965d9be2f5213b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n302eecc856b44ed5b76965d9be2f5213b3 .
+_:n302eecc856b44ed5b76965d9be2f5213b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
+_:n302eecc856b44ed5b76965d9be2f5213b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" .
+_:n302eecc856b44ed5b76965d9be2f5213b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n302eecc856b44ed5b76965d9be2f5213b2 .
+<http://example.com/base/e/a> <http://example.com/ns#with> _:n302eecc856b44ed5b76965d9be2f5213b1 .
+_:n302eecc856b44ed5b76965d9be2f5213b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
+
+
+

12. RMLTC-CC-0003-EL-BN

+

Title: Allow the generation of empty lists identified by blank node identifiers.

+

Description: Tests if the use of rml:allowEmptyListAndContainer yields an empty list. The lists are identified by a blank node identifier generated in the mapping.

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0003-EL-BN/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/>.
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+@prefix ex:  <http://example.com/ns#>.
+
+<http://example.com/base#TM> a rml:TriplesMap;
+    rml:logicalSource [
+        rml:source _:b738439 ;
+        rml:referenceFormulation rml:JSONPath ;
+        rml:iterator "$.*" ;
+    ] ;
+
+    rml:subjectMap [
+        rml:template "e/{$.id}" ;
+    ] ;
+
+    rml:predicateObjectMap [
+        rml:predicate ex:with ;
+        rml:objectMap [
+            rml:template "c/{$.id}" ; rml:termType rml:BlankNode ;
+            rml:allowEmptyListAndContainer true ;
+            rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
+            rml:gatherAs rdf:List ;
+        ] ;
+    ] ;
+.
+
+_:b738439 a rml:RelativePathSource ;
+    rml:path "data.json" .
+
+

Output

+
_:n302eecc856b44ed5b76965d9be2f5213b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+<http://example.com/base/e/b> <http://example.com/ns#with> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+_:n302eecc856b44ed5b76965d9be2f5213b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n302eecc856b44ed5b76965d9be2f5213b3 .
+_:n302eecc856b44ed5b76965d9be2f5213b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
+_:n302eecc856b44ed5b76965d9be2f5213b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" .
+_:n302eecc856b44ed5b76965d9be2f5213b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n302eecc856b44ed5b76965d9be2f5213b2 .
+<http://example.com/base/e/a> <http://example.com/ns#with> _:n302eecc856b44ed5b76965d9be2f5213b1 .
+_:n302eecc856b44ed5b76965d9be2f5213b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
+
+
+

13. RMLTC-CC-0003-EL-Named

+

Title: Allow the generation of empty lists identified by IRIs.

+

Description: Tests if the use of rml:allowEmptyListAndContainer yields an empty list. The lists are identified by a IRI generated in the mapping.

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0003-EL-Named/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/>.
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+@prefix ex:  <http://example.com/ns#>.
+
+<http://example.com/base#TM> a rml:TriplesMap;
+    rml:logicalSource [
+        rml:source _:b738439 ;
+        rml:referenceFormulation rml:JSONPath ;
+        rml:iterator "$.*" ;
+    ] ;
+
+    rml:subjectMap [
+        rml:template "e/{$.id}" ;
+    ] ;
+
+    rml:predicateObjectMap [
+        rml:predicate ex:with ;
+        rml:objectMap [
+            rml:template "c/{$.id}" ;
+            rml:allowEmptyListAndContainer true ;
+            rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
+            rml:gatherAs rdf:List ;
+        ] ;
+    ] ;
+.
+
+_:b738439 a rml:RelativePathSource ;
+    rml:path "data.json" .
+
+

Output

+
_:n302eecc856b44ed5b76965d9be2f5213b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+<http://example.com/base/e/b> <http://example.com/ns#with> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+_:n302eecc856b44ed5b76965d9be2f5213b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n302eecc856b44ed5b76965d9be2f5213b3 .
+_:n302eecc856b44ed5b76965d9be2f5213b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
+_:n302eecc856b44ed5b76965d9be2f5213b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" .
+<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n302eecc856b44ed5b76965d9be2f5213b2 .
+<http://example.com/base/e/a> <http://example.com/ns#with> <http://example.com/base/c/a> .
+<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
+
+
+

14. RMLTC-CC-0003-NEB

+

Title: Empty bags are not generated

+

Description: Tests if empty containers are not generated (expected default behavior).

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0003-NEB/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/>.
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+@prefix ex:  <http://example.com/ns#>.
+
+<http://example.com/base#TM> a rml:TriplesMap;
+    rml:logicalSource [
+        rml:source _:b738439 ;
+        rml:referenceFormulation rml:JSONPath ;
+        rml:iterator "$.*" ;
+    ] ;
+
+    rml:subjectMap [
+        rml:template "e/{$.id}" ;
+    ] ;
+
+    rml:predicateObjectMap [
+        rml:predicate ex:with ;
+        rml:objectMap [
+            rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
+            rml:gatherAs rdf:Bag ;
+        ] ;
+    ] ;
+.
+
+_:b738439 a rml:RelativePathSource ;
+    rml:path "data.json" .
+
+

Output

+
<http://example.com/base/e/a> <http://example.com/ns#with> _:n2bd72de9c571444081890e41009d92d4b1 .
+_:n2bd72de9c571444081890e41009d92d4b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "3" .
+_:n2bd72de9c571444081890e41009d92d4b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
+_:n2bd72de9c571444081890e41009d92d4b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "2" .
+_:n2bd72de9c571444081890e41009d92d4b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "1" .
+
+
+

15. RMLTC-CC-0003-NEL

+

Title: Empty lists are not generated

+

Description: Tests if empty lists are not generated (expected default behavior).

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0003-NEL/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/>.
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+@prefix ex:  <http://example.com/ns#>.
+
+<http://example.com/base#TM> a rml:TriplesMap;
+    rml:logicalSource [
+        rml:source _:b738439 ;
+        rml:referenceFormulation rml:JSONPath ;
+        rml:iterator "$.*" ;
+    ] ;
+
+    rml:subjectMap [
+        rml:template "e/{$.id}" ;
+    ] ;
+
+    rml:predicateObjectMap [
+        rml:predicate ex:with ;
+        rml:objectMap [
+            rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
+            rml:gatherAs rdf:List ;
+        ] ;
+    ] ;
+.
+
+_:b738439 a rml:RelativePathSource ;
+    rml:path "data.json" .
+
+

Output

+
_:n434c2c54e09e4a259604ba1188ce038fb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n434c2c54e09e4a259604ba1188ce038fb2 .
+_:n434c2c54e09e4a259604ba1188ce038fb3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+_:n434c2c54e09e4a259604ba1188ce038fb2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
+<http://example.com/base/e/a> <http://example.com/ns#with> _:n434c2c54e09e4a259604ba1188ce038fb1 .
+_:n434c2c54e09e4a259604ba1188ce038fb2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n434c2c54e09e4a259604ba1188ce038fb3 .
+_:n434c2c54e09e4a259604ba1188ce038fb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
+_:n434c2c54e09e4a259604ba1188ce038fb3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" .
+
+
+

16. RMLTC-CC-0003-NELb

+

Title: Empty lists are not generated II

+

Description: Tests if empty lists are not generated (expected default behavior). This test cases uses the predicate rml:allowEmptyListAndContainer.

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0003-NELb/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/>.
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+@prefix ex:  <http://example.com/ns#>.
+
+<http://example.com/base#TM> a rml:TriplesMap;
+    rml:logicalSource [
+        rml:source _:b738439 ;
+        rml:referenceFormulation rml:JSONPath ;
+        rml:iterator "$.*" ;
+    ] ;
+
+    rml:subjectMap [
+        rml:template "e/{$.id}" ;
+    ] ;
+
+    rml:predicateObjectMap [
+        rml:predicate ex:with ;
+        rml:objectMap [
+            rml:allowEmptyListAndContainer false ;
+            rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
+            rml:gatherAs rdf:List ;
+        ] ;
+    ] ;
+.
+
+_:b738439 a rml:RelativePathSource ;
+    rml:path "data.json" .
+
+

Output

+
_:n434c2c54e09e4a259604ba1188ce038fb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n434c2c54e09e4a259604ba1188ce038fb2 .
+_:n434c2c54e09e4a259604ba1188ce038fb3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+_:n434c2c54e09e4a259604ba1188ce038fb2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
+<http://example.com/base/e/a> <http://example.com/ns#with> _:n434c2c54e09e4a259604ba1188ce038fb1 .
+_:n434c2c54e09e4a259604ba1188ce038fb2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n434c2c54e09e4a259604ba1188ce038fb3 .
+_:n434c2c54e09e4a259604ba1188ce038fb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
+_:n434c2c54e09e4a259604ba1188ce038fb3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" .
+
+
+

17. RMLTC-CC-0004-SM1

+

Title: GatherMap in subject map (list)

+

Description: Tests if the use of a gather map in the subject map is supported. This test generates a list.

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0004-SM1/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/>.
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+@prefix ex:  <http://example.com/ns#>.
+
+<http://example.com/base#TM> a rml:TriplesMap;
+    rml:logicalSource [
+        rml:source _:b738439 ;
+        rml:referenceFormulation rml:JSONPath ;
+        rml:iterator "$.*" ;
+    ] ;
+
+    rml:subjectMap [
+        rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
+        rml:gatherAs rdf:List ;
+    ] ;
+
+    rml:predicateObjectMap [
+        rml:predicate ex:createdBy ;
+        rml:object ex:JohnDoe ;
+    ] ;
+.
+
+_:b738439 a rml:RelativePathSource ;
+    rml:path "data.json" .
+
+

Output

+
_:n302eecc856b44ed5b76965d9be2f5213b1 <http://example.com/ns#createdBy> <http://example.com/ns#JohnDoe> .
+_:n302eecc856b44ed5b76965d9be2f5213b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
+_:n302eecc856b44ed5b76965d9be2f5213b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n302eecc856b44ed5b76965d9be2f5213b2 .
+_:n302eecc856b44ed5b76965d9be2f5213b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
+_:n302eecc856b44ed5b76965d9be2f5213b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n302eecc856b44ed5b76965d9be2f5213b3 .
+_:n302eecc856b44ed5b76965d9be2f5213b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" .
+_:n302eecc856b44ed5b76965d9be2f5213b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+_:n1d393f12e993411498da676131f81ca4b1 <http://example.com/ns#createdBy> <http://example.com/ns#JohnDoe> .
+_:n1d393f12e993411498da676131f81ca4b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "4" .
+_:n1d393f12e993411498da676131f81ca4b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n1d393f12e993411498da676131f81ca4b2 .
+_:n1d393f12e993411498da676131f81ca4b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "5" .
+_:n1d393f12e993411498da676131f81ca4b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n1d393f12e993411498da676131f81ca4b3 .
+_:n1d393f12e993411498da676131f81ca4b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "6" .
+_:n1d393f12e993411498da676131f81ca4b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+
+
+

18. RMLTC-CC-0004-SM2

+

Title: GatherMap in subject map (list)

+

Description: Tests if the use of a gather map in the subject map is supported. This test has no predicate-object maps and no class declarations in the subject map. It still needs to generate triples as the lists consists of at least one cons-pair.

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0004-SM2/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/>.
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+@prefix ex:  <http://example.com/ns#>.
+
+<http://example.com/base#TM> a rml:TriplesMap;
+    rml:logicalSource [
+        rml:source _:b738439 ;
+        rml:referenceFormulation rml:JSONPath ;
+        rml:iterator "$.*" ;
+    ] ;
+
+    rml:subjectMap [
+        rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
+        rml:gatherAs rdf:List ;
+    ] ;
+.
+
+_:b738439 a rml:RelativePathSource ;
+    rml:path "data.json" .
+
+

Output

+
_:n302eecc856b44ed5b76965d9be2f5213b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
+_:n302eecc856b44ed5b76965d9be2f5213b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n302eecc856b44ed5b76965d9be2f5213b2 .
+_:n302eecc856b44ed5b76965d9be2f5213b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
+_:n302eecc856b44ed5b76965d9be2f5213b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n302eecc856b44ed5b76965d9be2f5213b3 .
+_:n302eecc856b44ed5b76965d9be2f5213b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" .
+_:n302eecc856b44ed5b76965d9be2f5213b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+_:n1d393f12e993411498da676131f81ca4b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "4" .
+_:n1d393f12e993411498da676131f81ca4b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n1d393f12e993411498da676131f81ca4b2 .
+_:n1d393f12e993411498da676131f81ca4b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "5" .
+_:n1d393f12e993411498da676131f81ca4b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n1d393f12e993411498da676131f81ca4b3 .
+_:n1d393f12e993411498da676131f81ca4b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "6" .
+_:n1d393f12e993411498da676131f81ca4b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+
+
+

19. RMLTC-CC-0004-SM3

+

Title: GatherMap in subject map (list)

+

Description: Tests if the use of a gather map in the subject map is supported. This test has no predicate-object maps and no class declarations in the subject map. Only one list needs to be generated as the other has no values and we only retain non-empty lists.

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0004-SM3/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/>.
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+@prefix ex:  <http://example.com/ns#>.
+
+<http://example.com/base#TM> a rml:TriplesMap;
+    rml:logicalSource [
+        rml:source _:b738439 ;
+        rml:referenceFormulation rml:JSONPath ;
+        rml:iterator "$.*" ;
+    ] ;
+
+    rml:subjectMap [
+        rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
+        rml:gatherAs rdf:List ;
+    ] ;
+.
+
+_:b738439 a rml:RelativePathSource ;
+    rml:path "data.json" .
+
+

Output

+
_:n648f8cf4c58149e8a0feea26fb2a5b5bb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
+_:n648f8cf4c58149e8a0feea26fb2a5b5bb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n648f8cf4c58149e8a0feea26fb2a5b5bb2 .
+_:n648f8cf4c58149e8a0feea26fb2a5b5bb3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" .
+_:n648f8cf4c58149e8a0feea26fb2a5b5bb2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n648f8cf4c58149e8a0feea26fb2a5b5bb3 .
+_:n648f8cf4c58149e8a0feea26fb2a5b5bb2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
+_:n648f8cf4c58149e8a0feea26fb2a5b5bb3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+
+
+

20. RMLTC-CC-0004-SM4

+

Title: GatherMap in subject map (bag)

+

Description: Tests if the use of a gather map in the subject map is supported. This test generates a bag.

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0004-SM4/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/>.
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+@prefix ex:  <http://example.com/ns#>.
+
+<http://example.com/base#TM> a rml:TriplesMap;
+    rml:logicalSource [
+        rml:source _:b738439 ;
+        rml:referenceFormulation rml:JSONPath ;
+        rml:iterator "$.*" ;
+    ] ;
+
+    rml:subjectMap [
+        rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
+        rml:gatherAs rdf:Bag ;
+    ] ;
+
+    rml:predicateObjectMap [
+        rml:predicate ex:createdBy ;
+        rml:object ex:JohnDoe ;
+    ] ;
+.
+
+_:b738439 a rml:RelativePathSource ;
+    rml:path "data.json" .
+
+

Output

+
_:n1d393f12e993411498da676131f81ca4b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "2" .
+_:n1d393f12e993411498da676131f81ca4b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "5" .
+_:n1d393f12e993411498da676131f81ca4b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "1" .
+_:n1d393f12e993411498da676131f81ca4b2 <http://example.com/ns#createdBy> <http://example.com/ns#JohnDoe> .
+_:n1d393f12e993411498da676131f81ca4b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
+_:n1d393f12e993411498da676131f81ca4b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "3" .
+_:n1d393f12e993411498da676131f81ca4b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "4" .
+_:n1d393f12e993411498da676131f81ca4b1 <http://example.com/ns#createdBy> <http://example.com/ns#JohnDoe> .
+_:n1d393f12e993411498da676131f81ca4b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
+_:n1d393f12e993411498da676131f81ca4b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "6" .
+
+
+

21. RMLTC-CC-0004-SM5

+

Title: GatherMap in subject map (bag)

+

Description: Tests if the use of a gather map in the subject map is supported. This test has no predicate-object maps and no class declarations in the subject map. It should generate a non-empty bag and an empty bag. The reason being that a container has at least one triple ; it's type (bag, seq, or alt).

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0004-SM5/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/>.
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+@prefix ex:  <http://example.com/ns#>.
+
+<http://example.com/base#TM> a rml:TriplesMap;
+    rml:logicalSource [
+        rml:source _:b738439 ;
+        rml:referenceFormulation rml:JSONPath ;
+        rml:iterator "$.*" ;
+    ] ;
+
+    rml:subjectMap [
+        rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
+        rml:gatherAs rdf:Bag ;
+    ] ;
+.
+
+_:b738439 a rml:RelativePathSource ;
+    rml:path "data.json" .
+
+

Output

+
_:ne32066984b71404a953025d001cd3cdfb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
+_:ne32066984b71404a953025d001cd3cdfb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "2" .
+_:ne32066984b71404a953025d001cd3cdfb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "1" .
+_:ne32066984b71404a953025d001cd3cdfb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "3" .
+
+
+

22. RMLTC-CC-0005-App1

+

Title: Append values of multiple term maps

+

Description: Tests appending of values from multiple term maps in an gather map. This test covers the case where all sets of values are non-empty.

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0005-App1/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/>.
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+@prefix ex:  <http://example.com/ns#>.
+
+<http://example.com/base#TM> a rml:TriplesMap;
+    rml:logicalSource [
+        rml:source _:b738439 ;
+        rml:referenceFormulation rml:JSONPath ;
+        rml:iterator "$.*" ;
+    ] ;
+
+    rml:subjectMap [
+        rml:template "e/{$.id}" ;
+    ] ;
+
+    rml:predicateObjectMap [
+        rml:predicate ex:with ;
+        rml:objectMap [
+            rml:gather ( [ rml:reference "$.v1.*" ; ] [ rml:reference "$.v2.*" ; ] ) ;
+            rml:gatherAs rdf:List ;
+        ] ;
+    ] ;
+.
+
+_:b738439 a rml:RelativePathSource ;
+    rml:path "data.json" .
+
+

Output

+
<http://example.com/base/e/a> <http://example.com/ns#with> _:n1ee4a5a2b1344422919d171ab2cd6c39b1 .
+_:n1ee4a5a2b1344422919d171ab2cd6c39b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
+_:n1ee4a5a2b1344422919d171ab2cd6c39b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n1ee4a5a2b1344422919d171ab2cd6c39b2 .
+_:n1ee4a5a2b1344422919d171ab2cd6c39b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
+_:n1ee4a5a2b1344422919d171ab2cd6c39b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n1ee4a5a2b1344422919d171ab2cd6c39b4 .
+_:n1ee4a5a2b1344422919d171ab2cd6c39b4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "a" .
+_:n1ee4a5a2b1344422919d171ab2cd6c39b4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n1ee4a5a2b1344422919d171ab2cd6c39b5 .
+_:n1ee4a5a2b1344422919d171ab2cd6c39b5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "b" .
+_:n1ee4a5a2b1344422919d171ab2cd6c39b5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+<http://example.com/base/e/b> <http://example.com/ns#with> _:n1ee4a5a2b1344422919d171ab2cd6c39b6 .
+_:n1ee4a5a2b1344422919d171ab2cd6c39b6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" .
+_:n1ee4a5a2b1344422919d171ab2cd6c39b6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n1ee4a5a2b1344422919d171ab2cd6c39b7 .
+_:n1ee4a5a2b1344422919d171ab2cd6c39b7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "4" .
+_:n1ee4a5a2b1344422919d171ab2cd6c39b7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n1ee4a5a2b1344422919d171ab2cd6c39b8 .
+_:n1ee4a5a2b1344422919d171ab2cd6c39b8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "c" .
+_:n1ee4a5a2b1344422919d171ab2cd6c39b8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+
+
+

23. RMLTC-CC-0005-App2

+

Title: Append values of multiple term maps

+

Description: Tests appending of values from multiple term maps in an iteration. In this example, one of the arrays is empty and the expected behavior is to concatinate a list with the empty list.

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0005-App2/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/>.
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+@prefix ex:  <http://example.com/ns#>.
+
+<http://example.com/base#TM> a rml:TriplesMap;
+    rml:logicalSource [
+        rml:source _:b738439 ;
+        rml:referenceFormulation rml:JSONPath ;
+        rml:iterator "$.*" ;
+    ] ;
+
+    rml:subjectMap [
+        rml:template "e/{$.id}" ;
+    ] ;
+
+    rml:predicateObjectMap [
+        rml:predicate ex:with ;
+        rml:objectMap [
+            rml:gather ( [ rml:reference "$.v1.*" ; ] [ rml:reference "$.v2.*" ; ] ) ;
+            rml:gatherAs rdf:List ;
+        ] ;
+    ] ;
+.
+
+_:b738439 a rml:RelativePathSource ;
+    rml:path "data.json" .
+
+

Output

+
_:n1d9b8ef217cb44f299a062d746116deab1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n1d9b8ef217cb44f299a062d746116deab2 .
+_:n1d9b8ef217cb44f299a062d746116deab5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "b" .
+_:n1d9b8ef217cb44f299a062d746116deab4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n1d9b8ef217cb44f299a062d746116deab5 .
+_:n1d9b8ef217cb44f299a062d746116deab3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n1d9b8ef217cb44f299a062d746116deab4 .
+_:n1d9b8ef217cb44f299a062d746116deab7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "5" .
+_:n1d9b8ef217cb44f299a062d746116deab2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
+_:n1d9b8ef217cb44f299a062d746116deab8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "6" .
+_:n1d9b8ef217cb44f299a062d746116deab8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+_:n1d9b8ef217cb44f299a062d746116deab3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" .
+_:n1d9b8ef217cb44f299a062d746116deab4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "a" .
+_:n1d9b8ef217cb44f299a062d746116deab5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+_:n1d9b8ef217cb44f299a062d746116deab2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n1d9b8ef217cb44f299a062d746116deab3 .
+_:n1d9b8ef217cb44f299a062d746116deab1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
+<http://example.com/base/e/a> <http://example.com/ns#with> _:n1d9b8ef217cb44f299a062d746116deab1 .
+<http://example.com/base/e/b> <http://example.com/ns#with> _:n1d9b8ef217cb44f299a062d746116deab6 .
+_:n1d9b8ef217cb44f299a062d746116deab7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n1d9b8ef217cb44f299a062d746116deab8 .
+_:n1d9b8ef217cb44f299a062d746116deab6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n1d9b8ef217cb44f299a062d746116deab7 .
+_:n1d9b8ef217cb44f299a062d746116deab6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "4" .
+
+
+

24. RMLTC-CC-0005-Car1

+

Title: Cartesian product of values from multiple term maps of a gather map.

+

Description: Tests generating the Cartesian product of values from multiple term maps in a gather map. This test covers the case where all sets of values are non-empty.

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0005-Car1/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/>.
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+@prefix ex:  <http://example.com/ns#>.
+
+<http://example.com/base#TM> a rml:TriplesMap;
+    rml:logicalSource [
+        rml:source _:b738439 ;
+        rml:referenceFormulation rml:JSONPath ;
+        rml:iterator "$.*" ;
+    ] ;
+
+    rml:subjectMap [
+        rml:template "e/{$.id}" ;
+    ] ;
+
+    rml:predicateObjectMap [
+        rml:predicate ex:with ;
+        rml:objectMap [
+            rml:gather ( [ rml:reference "$.v1.*" ; ] [ rml:reference "$.v2.*" ; ] ) ;
+            rml:gatherAs rdf:List ;
+            rml:strategy rml:cartesianProduct ;
+        ] ;
+    ] ;
+.
+
+_:b738439 a rml:RelativePathSource ;
+    rml:path "data.json" .
+
+

Output

+
<http://example.com/base/e/a> <http://example.com/ns#with> _:nfc398e5692654ca98dfb3fb5432d277cb1 .
+_:nfc398e5692654ca98dfb3fb5432d277cb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
+_:nfc398e5692654ca98dfb3fb5432d277cb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nfc398e5692654ca98dfb3fb5432d277cb2 .
+_:nfc398e5692654ca98dfb3fb5432d277cb2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+_:nfc398e5692654ca98dfb3fb5432d277cb2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "a" .
+
+<http://example.com/base/e/a> <http://example.com/ns#with> _:nfc398e5692654ca98dfb3fb5432d277cb3 .
+_:nfc398e5692654ca98dfb3fb5432d277cb3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
+_:nfc398e5692654ca98dfb3fb5432d277cb3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nfc398e5692654ca98dfb3fb5432d277cb4 .
+_:nfc398e5692654ca98dfb3fb5432d277cb4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "b" .
+_:nfc398e5692654ca98dfb3fb5432d277cb4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+
+<http://example.com/base/e/a> <http://example.com/ns#with> _:nfc398e5692654ca98dfb3fb5432d277cb5 .
+_:nfc398e5692654ca98dfb3fb5432d277cb5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
+_:nfc398e5692654ca98dfb3fb5432d277cb5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nfc398e5692654ca98dfb3fb5432d277cb6 .
+_:nfc398e5692654ca98dfb3fb5432d277cb6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "a" .
+_:nfc398e5692654ca98dfb3fb5432d277cb6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+
+<http://example.com/base/e/a> <http://example.com/ns#with> _:nfc398e5692654ca98dfb3fb5432d277cb7 .
+_:nfc398e5692654ca98dfb3fb5432d277cb7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
+_:nfc398e5692654ca98dfb3fb5432d277cb7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nfc398e5692654ca98dfb3fb5432d277cb8 .
+_:nfc398e5692654ca98dfb3fb5432d277cb8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "b" .
+_:nfc398e5692654ca98dfb3fb5432d277cb8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+
+<http://example.com/base/e/b> <http://example.com/ns#with> _:nfc398e5692654ca98dfb3fb5432d277cb9 .
+_:nfc398e5692654ca98dfb3fb5432d277cb9 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" .
+_:nfc398e5692654ca98dfb3fb5432d277cb9 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nfc398e5692654ca98dfb3fb5432d277cb10 .
+_:nfc398e5692654ca98dfb3fb5432d277cb10 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "c" .
+_:nfc398e5692654ca98dfb3fb5432d277cb10 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+
+<http://example.com/base/e/b> <http://example.com/ns#with> _:nfc398e5692654ca98dfb3fb5432d277cb11 .
+_:nfc398e5692654ca98dfb3fb5432d277cb11 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "4" .
+_:nfc398e5692654ca98dfb3fb5432d277cb11 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nfc398e5692654ca98dfb3fb5432d277cb12 .
+_:nfc398e5692654ca98dfb3fb5432d277cb12 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "c" .
+_:nfc398e5692654ca98dfb3fb5432d277cb12 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+
+
+

25. RMLTC-CC-0005-Car2

+

Title: Cartesian product of values from multiple term maps of a gather map.

+

Description: Tests generating the Cartesian product of values from multiple term maps in a gather map. This test covers the case where one of the sets is empty. The Cartesian product of a set with an empty set is empty. This entry should thus not yield a list.

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0005-Car2/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/>.
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+@prefix ex:  <http://example.com/ns#>.
+
+<http://example.com/base#TM> a rml:TriplesMap;
+    rml:logicalSource [
+        rml:source _:b738439 ;
+        rml:referenceFormulation rml:JSONPath ;
+        rml:iterator "$.*" ;
+    ] ;
+
+    rml:subjectMap [
+        rml:template "e/{$.id}" ;
+    ] ;
+
+    rml:predicateObjectMap [
+        rml:predicate ex:with ;
+        rml:objectMap [
+            rml:gather ( [ rml:reference "$.v1.*" ; ] [ rml:reference "$.v2.*" ; ] ) ;
+            rml:gatherAs rdf:List ;
+            rml:strategy rml:cartesianProduct ;
+        ] ;
+    ] ;
+.
+
+_:b738439 a rml:RelativePathSource ;
+    rml:path "data.json" .
+
+

Output

+
<http://example.com/base/e/a> <http://example.com/ns#with> _:nfc398e5692654ca98dfb3fb5432d277cb1 .
+_:nfc398e5692654ca98dfb3fb5432d277cb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
+_:nfc398e5692654ca98dfb3fb5432d277cb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nfc398e5692654ca98dfb3fb5432d277cb2 .
+_:nfc398e5692654ca98dfb3fb5432d277cb2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+_:nfc398e5692654ca98dfb3fb5432d277cb2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "a" .
+
+<http://example.com/base/e/a> <http://example.com/ns#with> _:nfc398e5692654ca98dfb3fb5432d277cb3 .
+_:nfc398e5692654ca98dfb3fb5432d277cb3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
+_:nfc398e5692654ca98dfb3fb5432d277cb3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nfc398e5692654ca98dfb3fb5432d277cb4 .
+_:nfc398e5692654ca98dfb3fb5432d277cb4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "b" .
+_:nfc398e5692654ca98dfb3fb5432d277cb4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+
+<http://example.com/base/e/a> <http://example.com/ns#with> _:nfc398e5692654ca98dfb3fb5432d277cb5 .
+_:nfc398e5692654ca98dfb3fb5432d277cb5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
+_:nfc398e5692654ca98dfb3fb5432d277cb5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nfc398e5692654ca98dfb3fb5432d277cb6 .
+_:nfc398e5692654ca98dfb3fb5432d277cb6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "a" .
+_:nfc398e5692654ca98dfb3fb5432d277cb6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+
+<http://example.com/base/e/a> <http://example.com/ns#with> _:nfc398e5692654ca98dfb3fb5432d277cb7 .
+_:nfc398e5692654ca98dfb3fb5432d277cb7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
+_:nfc398e5692654ca98dfb3fb5432d277cb7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nfc398e5692654ca98dfb3fb5432d277cb8 .
+_:nfc398e5692654ca98dfb3fb5432d277cb8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "b" .
+_:nfc398e5692654ca98dfb3fb5432d277cb8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+
+
+

26. RMLTC-CC-0006-IT0

+

Title: Gather values across iterations to create a collection.

+

Description: When no template, constant, or reference is given to a gather map, then each iteration yields a different collection.

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0006-IT0/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/>.
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+@prefix ex:  <http://example.com/ns#>.
+
+<http://example.com/base#TM> a rml:TriplesMap;
+    rml:logicalSource [
+        rml:source _:b738439 ;
+        rml:referenceFormulation rml:JSONPath ;
+        rml:iterator "$.*" ;
+    ] ;
+
+    rml:subjectMap [
+        rml:template "e/{$.id}" ;
+    ] ;
+
+    rml:predicateObjectMap [
+        rml:predicate ex:with ;
+        rml:objectMap [
+            rml:gather ( [ rml:reference "$.v1.*" ; ] ) ;
+            rml:gatherAs rdf:List ;
+        ] ;
+    ] ;
+.
+
+_:b738439 a rml:RelativePathSource ;
+    rml:path "data.json" .
+
+

Output

+
<http://example.com/base/e/a> <http://example.com/ns#with> _:n9d785cd672d3484cb5d9fd831e6dfc07b1 .
+_:n9d785cd672d3484cb5d9fd831e6dfc07b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
+_:n9d785cd672d3484cb5d9fd831e6dfc07b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n9d785cd672d3484cb5d9fd831e6dfc07b2 .
+_:n9d785cd672d3484cb5d9fd831e6dfc07b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
+_:n9d785cd672d3484cb5d9fd831e6dfc07b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+
+<http://example.com/base/e/b> <http://example.com/ns#with> _:n9d785cd672d3484cb5d9fd831e6dfc07b5 .
+_:n9d785cd672d3484cb5d9fd831e6dfc07b5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" .
+_:n9d785cd672d3484cb5d9fd831e6dfc07b5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n9d785cd672d3484cb5d9fd831e6dfc07b6 .
+_:n9d785cd672d3484cb5d9fd831e6dfc07b6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "4" .
+_:n9d785cd672d3484cb5d9fd831e6dfc07b6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+
+<http://example.com/base/e/a> <http://example.com/ns#with> _:n9d785cd672d3484cb5d9fd831e6dfc07b3 .
+_:n9d785cd672d3484cb5d9fd831e6dfc07b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "5" .
+_:n9d785cd672d3484cb5d9fd831e6dfc07b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n9d785cd672d3484cb5d9fd831e6dfc07b4 .
+_:n9d785cd672d3484cb5d9fd831e6dfc07b4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "6" .
+_:n9d785cd672d3484cb5d9fd831e6dfc07b4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+
+
+

27. RMLTC-CC-0006-IT1

+

Title: Gather values across iterations to create a collection.

+

Description: When using a template, constant, or reference for a gather map, this tests determines whether the values are correctly appended to the list. The natural order of the term maps inside the gather map as well as the iteration are respected. This test covers one term map in the gather map.

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0006-IT1/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/>.
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+@prefix ex:  <http://example.com/ns#>.
+
+<http://example.com/base#TM> a rml:TriplesMap;
+    rml:logicalSource [
+        rml:source _:b738439 ;
+        rml:referenceFormulation rml:JSONPath ;
+        rml:iterator "$.*" ;
+    ] ;
+
+    rml:subjectMap [
+        rml:template "e/{$.id}" ;
+    ] ;
+
+    rml:predicateObjectMap [
+        rml:predicate ex:with ;
+        rml:objectMap [
+            rml:template "c/{$.id}" ;
+            rml:gather ( [ rml:reference "$.v1.*" ; ] ) ;
+            rml:gatherAs rdf:List ;
+        ] ;
+    ] ;
+.
+
+_:b738439 a rml:RelativePathSource ;
+    rml:path "data.json" .
+
+

Output

+
<http://example.com/base/e/a> <http://example.com/ns#with> <http://example.com/base/c/a> .
+<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
+<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nab8f496caee443c5ac19ce3a109f4b22b1 .
+_:nab8f496caee443c5ac19ce3a109f4b22b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
+_:nab8f496caee443c5ac19ce3a109f4b22b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nab8f496caee443c5ac19ce3a109f4b22b2 .
+_:nab8f496caee443c5ac19ce3a109f4b22b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "5" .
+_:nab8f496caee443c5ac19ce3a109f4b22b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nab8f496caee443c5ac19ce3a109f4b22b3 .
+_:nab8f496caee443c5ac19ce3a109f4b22b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "6" .
+_:nab8f496caee443c5ac19ce3a109f4b22b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+
+<http://example.com/base/e/b> <http://example.com/ns#with> <http://example.com/base/c/b> .
+<http://example.com/base/c/b> <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" .
+<http://example.com/base/c/b> <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nab8f496caee443c5ac19ce3a109f4b22b4 .
+_:nab8f496caee443c5ac19ce3a109f4b22b4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "4" .
+_:nab8f496caee443c5ac19ce3a109f4b22b4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+
+
+

28. RMLTC-CC-0006-IT2

+

Title: Gather values across iterations to create a collection.

+

Description: When using a template, constant, or reference for a gather map, this tests determines whether the values are correctly appended to the list. The natural order of the term maps inside the gather map as well as the iteration are respected. This test covers two term maps in the gather map.

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0006-IT2/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/>.
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+@prefix ex:  <http://example.com/ns#>.
+
+<http://example.com/base#TM> a rml:TriplesMap;
+    rml:logicalSource [
+        rml:source _:b738439 ;
+        rml:referenceFormulation rml:JSONPath ;
+        rml:iterator "$.*" ;
+    ] ;
+
+    rml:subjectMap [
+        rml:template "e/{$.id}" ;
+    ] ;
+
+    rml:predicateObjectMap [
+        rml:predicate ex:with ;
+        rml:objectMap [
+            rml:template "c/{$.id}" ;
+            rml:gather ( [ rml:reference "$.v1.*" ; ] [ rml:reference "$.v2.*" ; ] ) ;
+            rml:gatherAs rdf:List ;
+        ] ;
+    ] ;
+.
+
+_:b738439 a rml:RelativePathSource ;
+    rml:path "data.json" .
+
+

Output

+
<http://example.com/base/e/a> <http://example.com/ns#with> <http://example.com/base/c/a> .
+<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
+<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n0cbb21ce98464358963007f95dc35c0ab1 .
+_:n0cbb21ce98464358963007f95dc35c0ab1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
+_:n0cbb21ce98464358963007f95dc35c0ab1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n0cbb21ce98464358963007f95dc35c0ab2 .
+_:n0cbb21ce98464358963007f95dc35c0ab2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "a" .
+_:n0cbb21ce98464358963007f95dc35c0ab2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n0cbb21ce98464358963007f95dc35c0ab3 .
+_:n0cbb21ce98464358963007f95dc35c0ab3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "b" .
+_:n0cbb21ce98464358963007f95dc35c0ab3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n0cbb21ce98464358963007f95dc35c0ab4 .
+_:n0cbb21ce98464358963007f95dc35c0ab4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "5" .
+_:n0cbb21ce98464358963007f95dc35c0ab4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n0cbb21ce98464358963007f95dc35c0ab5 .
+_:n0cbb21ce98464358963007f95dc35c0ab5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "6" .
+_:n0cbb21ce98464358963007f95dc35c0ab5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n0cbb21ce98464358963007f95dc35c0ab6 .
+_:n0cbb21ce98464358963007f95dc35c0ab6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "d" .
+_:n0cbb21ce98464358963007f95dc35c0ab6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n0cbb21ce98464358963007f95dc35c0ab7 .
+_:n0cbb21ce98464358963007f95dc35c0ab7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "e" .
+_:n0cbb21ce98464358963007f95dc35c0ab7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+
+<http://example.com/base/e/b> <http://example.com/ns#with> <http://example.com/base/c/b> .
+<http://example.com/base/c/b> <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" .
+<http://example.com/base/c/b> <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n0cbb21ce98464358963007f95dc35c0ab8 .
+_:n0cbb21ce98464358963007f95dc35c0ab8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "4" .
+_:n0cbb21ce98464358963007f95dc35c0ab8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n0cbb21ce98464358963007f95dc35c0ab9 .
+_:n0cbb21ce98464358963007f95dc35c0ab9 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "c" .
+_:n0cbb21ce98464358963007f95dc35c0ab9 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+
+
+

29. RMLTC-CC-0006-IT3

+

Title: Gather values across iterations to create a container.

+

Description: When no template, constant, or reference is given to a gather map, then each iteration yields a different container.

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0006-IT3/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/>.
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+@prefix ex:  <http://example.com/ns#>.
+
+<http://example.com/base#TM> a rml:TriplesMap;
+    rml:logicalSource [
+        rml:source _:b738439 ;
+        rml:referenceFormulation rml:JSONPath ;
+        rml:iterator "$.*" ;
+    ] ;
+
+    rml:subjectMap [
+        rml:template "e/{$.id}" ;
+    ] ;
+
+    rml:predicateObjectMap [
+        rml:predicate ex:with ;
+        rml:objectMap [
+            rml:gather ( [ rml:reference "$.v1.*" ; ] ) ;
+            rml:gatherAs rdf:Bag ;
+        ] ;
+    ] ;
+.
+
+_:b738439 a rml:RelativePathSource ;
+    rml:path "data.json" .
+
+

Output

+
<http://example.com/base/e/a> <http://example.com/ns#with> _:a .
+_:a <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
+_:a <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "1" .
+_:a <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "2" .
+
+<http://example.com/base/e/b> <http://example.com/ns#with> _:b .
+_:b <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
+_:b <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "3" .
+_:b <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "4" .
+
+<http://example.com/base/e/a> <http://example.com/ns#with> _:c .
+_:c <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
+_:c <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "5" .
+_:c <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "6" .
+
+
+

30. RMLTC-CC-0006-IT4

+

Title: Gather values across iterations to create a container.

+

Description: When using a template, constant, or reference for a gather map, this tests determines whether the values are correctly appended to the container. The natural order of the term maps inside the gather map as well as the iteration are respected. This test covers one term map in the gather map.

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0006-IT4/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/>.
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+@prefix ex:  <http://example.com/ns#>.
+
+<http://example.com/base#TM> a rml:TriplesMap;
+    rml:logicalSource [
+        rml:source _:b738439 ;
+        rml:referenceFormulation rml:JSONPath ;
+        rml:iterator "$.*" ;
+    ] ;
+
+    rml:subjectMap [
+        rml:template "e/{$.id}" ;
+    ] ;
+
+    rml:predicateObjectMap [
+        rml:predicate ex:with ;
+        rml:objectMap [
+            rml:template "c/{$.id}" ;
+            rml:gather ( [ rml:reference "$.v1.*" ; ] ) ;
+            rml:gatherAs rdf:Bag ;
+        ] ;
+    ] ;
+.
+
+_:b738439 a rml:RelativePathSource ;
+    rml:path "data.json" .
+
+

Output

+
<http://example.com/base/e/a> <http://example.com/ns#with> <http://example.com/base/c/a> .
+<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
+<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "1" .
+<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "2" .
+<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "5" .
+<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_4> "6" .
+
+<http://example.com/base/e/b> <http://example.com/ns#with> <http://example.com/base/c/b> .
+<http://example.com/base/c/b> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
+<http://example.com/base/c/b> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "3" .
+<http://example.com/base/c/b> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "4" .
+
+
+

31. RMLTC-CC-0006-IT5

+

Title: Gather values across iterations to create a container.

+

Description: When using a template, constant, or reference for a gather map, this tests determines whether the values are correctly appended to the container. The natural order of the term maps inside the gather map as well as the iteration are respected. This test covers two term maps in the gather map.

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0006-IT5/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/>.
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+@prefix ex:  <http://example.com/ns#>.
+
+<http://example.com/base#TM> a rml:TriplesMap;
+    rml:logicalSource [
+        rml:source _:b738439 ;
+        rml:referenceFormulation rml:JSONPath ;
+        rml:iterator "$.*" ;
+    ] ;
+
+    rml:subjectMap [
+        rml:template "e/{$.id}" ;
+    ] ;
+
+    rml:predicateObjectMap [
+        rml:predicate ex:with ;
+        rml:objectMap [
+            rml:template "c/{$.id}" ;
+            rml:gather ( [ rml:reference "$.v1.*" ; ] [ rml:reference "$.v2.*" ; ] ) ;
+            rml:gatherAs rdf:Bag ;
+        ] ;
+    ] ;
+.
+
+_:b738439 a rml:RelativePathSource ;
+    rml:path "data.json" .
+
+

Output

+
<http://example.com/base/e/a> <http://example.com/ns#with> <http://example.com/base/c/a> .
+<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
+<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "1" .
+<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "2" .
+<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "a" .
+<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_4> "b" .
+<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_5> "5" .
+<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_6> "6" .
+<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_7> "d" .
+<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_8> "e" .
+
+<http://example.com/base/e/b> <http://example.com/ns#with> <http://example.com/base/c/b> .
+<http://example.com/base/c/b> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
+<http://example.com/base/c/b> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "3" .
+<http://example.com/base/c/b> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "4" .
+<http://example.com/base/c/b> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "c" .
+
+
+

32. RMLTC-CC-0007-NES

+

Title: Nested gather maps

+

Description: Testing whether nested gather maps are created. The mapping should generate a list of bags.

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0007-NES/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/>.
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+@prefix ex:  <http://example.com/ns#>.
+
+<http://example.com/base#TM> a rml:TriplesMap;
+    rml:logicalSource [
+        rml:source _:b738439 ;
+        rml:referenceFormulation rml:JSONPath ;
+        rml:iterator "$.*" ;
+    ] ;
+
+    rml:subjectMap [
+        rml:template "e/{$.id}" ;
+    ] ;
+
+    rml:predicateObjectMap [
+        rml:predicate ex:with ;
+        rml:objectMap [
+            rml:gather (
+                [
+                    rml:gather ( [ rml:reference "$.v1.*" ; ] ) ;
+                    rml:gatherAs rdf:Bag ;
+                ]
+                [
+                    rml:gather ( [ rml:reference "$.v2.*" ; ] ) ;
+                    rml:gatherAs rdf:Bag ;
+                ]
+            ) ;
+            rml:gatherAs rdf:List ;
+        ] ;
+    ] ;
+.
+
+_:b738439 a rml:RelativePathSource ;
+    rml:path "data.json" .
+
+

Output

+
_:nab9af1206e584ab2afd457e8a605872cb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
+_:nab9af1206e584ab2afd457e8a605872cb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "1" .
+_:nab9af1206e584ab2afd457e8a605872cb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "2" .
+
+_:nab9af1206e584ab2afd457e8a605872cb2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
+_:nab9af1206e584ab2afd457e8a605872cb2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "a" .
+_:nab9af1206e584ab2afd457e8a605872cb2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "b" .
+
+_:nab9af1206e584ab2afd457e8a605872cb5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
+_:nab9af1206e584ab2afd457e8a605872cb5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "3" .
+_:nab9af1206e584ab2afd457e8a605872cb5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "4" .
+
+_:nab9af1206e584ab2afd457e8a605872cb6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
+_:nab9af1206e584ab2afd457e8a605872cb6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "c" .
+
+<http://example.com/base/e/a> <http://example.com/ns#with> _:nab9af1206e584ab2afd457e8a605872cb3 .
+_:nab9af1206e584ab2afd457e8a605872cb3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> _:nab9af1206e584ab2afd457e8a605872cb1 .
+_:nab9af1206e584ab2afd457e8a605872cb3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nab9af1206e584ab2afd457e8a605872cb4 .
+
+_:nab9af1206e584ab2afd457e8a605872cb4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> _:nab9af1206e584ab2afd457e8a605872cb2 .
+_:nab9af1206e584ab2afd457e8a605872cb4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+
+<http://example.com/base/e/b> <http://example.com/ns#with> _:nab9af1206e584ab2afd457e8a605872cb7 .
+_:nab9af1206e584ab2afd457e8a605872cb7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> _:nab9af1206e584ab2afd457e8a605872cb5 .
+_:nab9af1206e584ab2afd457e8a605872cb7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nab9af1206e584ab2afd457e8a605872cb8 .
+
+_:nab9af1206e584ab2afd457e8a605872cb8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> _:nab9af1206e584ab2afd457e8a605872cb6 .
+_:nab9af1206e584ab2afd457e8a605872cb8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+
+
+
+

33. RMLTC-CC-0008-ROMa

+

Title: Elements via reference object-map.

+

Description: Testing whether gather maps generate an RDF list whose members are generated by a referencing object-map.

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0008-ROMa/Friends.json

+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+
+_:b273446 a rml:RelativePathSource ;
+    rml:path "student.csv" .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap ;
+    rml:logicalSource [ a rml:LogicalSource ;
+            rml:referenceFormulation rml:CSV ;
+            rml:source _:b273446 ] ;
+            
+    rml:predicateObjectMap [ 
+        rml:objectMap [
+                rml:reference "ID" ; rml:termType rml:BlankNode ;
+                rml:gather ( 
+                    [ 
+                        rml:parentTriplesMap <http://example.com/base/TriplesMap1> ;
+                        rml:joinCondition [ rml:child "Sport" ; rml:parent "Sport" ] ;
+                    ] 
+                ) ;
+                rml:gatherAs rdf:List;
+            ] ;    
+        rml:predicate ex:sameSportAs 
+    ] ;
+
+    rml:subjectMap [ rml:template "http://example.com/Student/{ID}/{Name}" ] .
+
+

Output

+
_:genid1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> <http://example.com/Student/10/Venus%20Williams> .
+_:genid1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:genid2 .
+_:genid2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> <http://example.com/Student/20/Serena%20Williams> .
+_:genid2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+<http://example.com/Student/10/Venus%20Williams> <http://example.com/sameSportAs> _:genid1 .
+_:genid3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> <http://example.com/Student/10/Venus%20Williams> .
+_:genid3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:genid4 .
+_:genid4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> <http://example.com/Student/20/Serena%20Williams> .
+_:genid4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+<http://example.com/Student/20/Serena%20Williams> <http://example.com/sameSportAs> _:genid3 .
+_:genid5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> <http://example.com/Student/30/Loena%20Hendrickx> .
+_:genid5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+<http://example.com/Student/30/Loena%20Hendrickx> <http://example.com/sameSportAs> _:genid5 .
+
+
+

34. RMLTC-CC-0008-ROMb

+

Title: Elements via reference object-map with default join condition

+

Description: Testing whether gather maps generate an RDF list whose members are generated by a referencing object-map with a default join condition.

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0008-ROMb/Friends.json

+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+
+_:b273446 a rml:RelativePathSource ;
+    rml:path "student.csv" .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap ;
+    rml:logicalSource [ a rml:LogicalSource ;
+            rml:referenceFormulation rml:CSV ;
+            rml:source _:b273446 ] ;
+            
+    rml:predicateObjectMap [
+        rml:objectMap [
+            rml:reference "ID" ; rml:termType rml:BlankNode ;
+            rml:gather ( 
+                [ 
+                    rml:parentTriplesMap <http://example.com/base/TriplesMap1> ;
+                ] 
+            ) ;
+            rml:gatherAs rdf:List;
+        ] ;
+        rml:predicate ex:sameSportAs 
+    ] ;
+        
+    rml:subjectMap [ rml:template "http://example.com/Student/{ID}/{Name}" ] .
+
+
+

Output

+
_:genid1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> <http://example.com/Student/30/Loena%20Hendrickx> .
+_:genid1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+<http://example.com/Student/30/Loena%20Hendrickx> <http://example.com/sameSportAs> _:genid1 .
+_:genid2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> <http://example.com/Student/20/Serena%20Williams> .
+_:genid2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+<http://example.com/Student/20/Serena%20Williams> <http://example.com/sameSportAs> _:genid2 .
+_:genid3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> <http://example.com/Student/10/Venus%20Williams> .
+_:genid3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+<http://example.com/Student/10/Venus%20Williams> <http://example.com/sameSportAs> _:genid3 .
+
+
+

35. RMLTC-CC-0009-DUP-Bag

+

Title: Gather duplicate values in an RDF Bag

+

Description: Testing the expected behavior of multi-valued expression maps containing duplicate values when these expression maps are used in a gather map to create an RDF Bag.

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0009-DUP-Bag/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/>.
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+@prefix ex:  <http://example.com/ns#>.
+
+<http://example.com/base#TM> a rml:TriplesMap;
+    rml:logicalSource [
+        rml:source _:b738439 ;
+        rml:referenceFormulation rml:JSONPath ;
+        rml:iterator "$.*" ;
+    ] ;
+
+    rml:subjectMap [
+        rml:template "e/{$.id}" ;
+    ] ;
+
+    rml:predicateObjectMap [
+        rml:predicate ex:with ;
+        rml:objectMap [
+            rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
+            rml:gatherAs rdf:Bag ;
+        ] ;
+    ] ;
+.
+
+_:b738439 a rml:RelativePathSource ;
+    rml:path "data.json" .
+
+

Output

+
_:nc808fbd2e11a4baa939c61c8210b5909b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
+_:nc808fbd2e11a4baa939c61c8210b5909b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "2" .
+_:nc808fbd2e11a4baa939c61c8210b5909b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
+_:nc808fbd2e11a4baa939c61c8210b5909b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
+_:nc808fbd2e11a4baa939c61c8210b5909b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "9" .
+_:nc808fbd2e11a4baa939c61c8210b5909b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "1" .
+<http://example.com/base/e/b> <http://example.com/ns#with> _:nc808fbd2e11a4baa939c61c8210b5909b2 .
+_:nc808fbd2e11a4baa939c61c8210b5909b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "1" .
+<http://example.com/base/e/c> <http://example.com/ns#with> _:nc808fbd2e11a4baa939c61c8210b5909b3 .
+<http://example.com/base/e/a> <http://example.com/ns#with> _:nc808fbd2e11a4baa939c61c8210b5909b1 .
+_:nc808fbd2e11a4baa939c61c8210b5909b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "2" .
+_:nc808fbd2e11a4baa939c61c8210b5909b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "7" .
+_:nc808fbd2e11a4baa939c61c8210b5909b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "6" .
+_:nc808fbd2e11a4baa939c61c8210b5909b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "1" .
+_:nc808fbd2e11a4baa939c61c8210b5909b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "8" .
+
+
+

36. RMLTC-CC-0009-DUP-List

+

Title: Gather duplicate values in an RDF List

+

Description: Testing the expected behavior of multi-valued expression maps containing duplicate values when these expression maps are used in a gather map to create a list.

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0009-DUP-List/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/>.
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+@prefix ex:  <http://example.com/ns#>.
+
+<http://example.com/base#TM> a rml:TriplesMap;
+    rml:logicalSource [
+        rml:source _:b738439 ;
+        rml:referenceFormulation rml:JSONPath ;
+        rml:iterator "$.*" ;
+    ] ;
+
+    rml:subjectMap [
+        rml:template "e/{$.id}" ;
+    ] ;
+
+    rml:predicateObjectMap [
+        rml:predicate ex:with ;
+        rml:objectMap [
+            rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
+            rml:gatherAs rdf:List ;
+        ] ;
+    ] ;
+.
+
+_:b738439 a rml:RelativePathSource ;
+    rml:path "data.json" .
+
+

Output

+
<http://example.com/base/e/a> <http://example.com/ns#with> _:n988e0f11d19c486fa3b3255f94c9b3bab1 .
+_:n988e0f11d19c486fa3b3255f94c9b3bab1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
+_:n988e0f11d19c486fa3b3255f94c9b3bab1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n988e0f11d19c486fa3b3255f94c9b3bab2 .
+_:n988e0f11d19c486fa3b3255f94c9b3bab2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
+_:n988e0f11d19c486fa3b3255f94c9b3bab2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n988e0f11d19c486fa3b3255f94c9b3bab3 .
+_:n988e0f11d19c486fa3b3255f94c9b3bab3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
+_:n988e0f11d19c486fa3b3255f94c9b3bab3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+
+<http://example.com/base/e/b> <http://example.com/ns#with> _:n988e0f11d19c486fa3b3255f94c9b3bab4 .
+_:n988e0f11d19c486fa3b3255f94c9b3bab4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
+_:n988e0f11d19c486fa3b3255f94c9b3bab4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n988e0f11d19c486fa3b3255f94c9b3bab5 .
+_:n988e0f11d19c486fa3b3255f94c9b3bab5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
+_:n988e0f11d19c486fa3b3255f94c9b3bab5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n988e0f11d19c486fa3b3255f94c9b3bab6 .
+_:n988e0f11d19c486fa3b3255f94c9b3bab6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "6" .
+_:n988e0f11d19c486fa3b3255f94c9b3bab6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+
+<http://example.com/base/e/c> <http://example.com/ns#with> _:n988e0f11d19c486fa3b3255f94c9b3bab7 .
+_:n988e0f11d19c486fa3b3255f94c9b3bab7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "7" .
+_:n988e0f11d19c486fa3b3255f94c9b3bab7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n988e0f11d19c486fa3b3255f94c9b3bab8 .
+_:n988e0f11d19c486fa3b3255f94c9b3bab8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "8" .
+_:n988e0f11d19c486fa3b3255f94c9b3bab8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n988e0f11d19c486fa3b3255f94c9b3bab9 .
+_:n988e0f11d19c486fa3b3255f94c9b3bab9 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "9" .
+_:n988e0f11d19c486fa3b3255f94c9b3bab9 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+
+
+

37. RMLTC-CC-0010-Lista

+

Title: Combining graph maps and gather maps (graph map has a template and gather map does not)

+

Description: Tests the behavior of combining graph- and gather maps. In this example, a blank node for each list is expected.

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0010-Lista/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/>.
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+@prefix ex:  <http://example.com/ns#>.
+
+<http://example.com/base#TM> a rml:TriplesMap;
+    rml:logicalSource [
+        rml:source _:b738439 ;
+        rml:referenceFormulation rml:JSONPath ;
+        rml:iterator "$.*" ;
+    ] ;
+
+    rml:subjectMap [
+        rml:template "e/{$.id}" ;
+    ] ;
+
+    rml:predicateObjectMap [
+        rml:graphMap [ rml:template "g/{$.graph}" ; ] ;
+        rml:predicate ex:with ;
+        rml:objectMap [
+            rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
+            rml:gatherAs rdf:List ;
+        ] ;
+    ] ;
+.
+
+_:b738439 a rml:RelativePathSource ;
+    rml:path "data.json" .
+
+

Output

+
_:genid1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" <http://example.com/base/g/1> .
+_:genid1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> <http://example.com/base/g/1> .
+_:genid2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" <http://example.com/base/g/1> .
+_:genid2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> <http://example.com/base/g/1> .
+<http://example.com/base/e/a> <http://example.com/ns#with> _:genid1 <http://example.com/base/g/1> .
+<http://example.com/base/e/a> <http://example.com/ns#with> _:genid2 <http://example.com/base/g/1> .
+
+_:genidx1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" <http://example.com/base/g/2> .
+_:genidx1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> <http://example.com/base/g/2> .
+<http://example.com/base/e/a> <http://example.com/ns#with> _:genidx1 <http://example.com/base/g/2> .
+
+
+

38. RMLTC-CC-0010-Listb

+

Title: Combining graph maps and gather maps (both graph map and gather map have a template)

+

Description: Tests the behavior of combining graph- and gather maps. In this example, lists are concatinated in some named graphs via blank node identifiers constructed with templates.

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0010-Listb/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/>.
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+@prefix ex:  <http://example.com/ns#>.
+
+<http://example.com/base#TM> a rml:TriplesMap;
+    rml:logicalSource [
+        rml:source _:b738439 ;
+        rml:referenceFormulation rml:JSONPath ;
+        rml:iterator "$.*" ;
+    ] ;
+
+    rml:subjectMap [
+        rml:template "e/{$.id}" ;
+    ] ;
+
+    rml:predicateObjectMap [
+        rml:graphMap [ rml:template "g/{$.graph}" ; ] ;
+        rml:predicate ex:with ;
+        rml:objectMap [
+            rml:template "l/{$.id}" ; rml:termType rml:BlankNode ;
+            rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
+            rml:gatherAs rdf:List ;
+        ] ;
+    ] ;
+.
+
+_:b738439 a rml:RelativePathSource ;
+    rml:path "data.json" .
+
+

Output

+
_:genid1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" <http://example.com/base/g/1> .
+_:genid1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:genid2 <http://example.com/base/g/1> .
+_:genid2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" <http://example.com/base/g/1> .
+_:genid2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> <http://example.com/base/g/1> .
+<http://example.com/base/e/a> <http://example.com/ns#with> _:genid1 <http://example.com/base/g/1> .
+
+_:genidx1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" <http://example.com/base/g/2> .
+_:genidx1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> <http://example.com/base/g/2> .
+<http://example.com/base/e/a> <http://example.com/ns#with> _:genidx1 <http://example.com/base/g/2> .
+
+
+ + + + + \ No newline at end of file diff --git a/src/test/resources/rml-cc/list.sh b/src/test/resources/rml-cc/list.sh new file mode 100755 index 00000000..12c32031 --- /dev/null +++ b/src/test/resources/rml-cc/list.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +for i in RML*; do + echo "
" +done diff --git a/src/test/resources/rml-cc/make-metadata.py b/src/test/resources/rml-cc/make-metadata.py new file mode 100755 index 00000000..a2c46363 --- /dev/null +++ b/src/test/resources/rml-cc/make-metadata.py @@ -0,0 +1,209 @@ +#!/usr/bin/env python3 + +import os +import sys +import glob +import csv + +def get_title_description(testcase: str): + with open ('descriptions.csv') as csvfile: + reader = csv.reader(csvfile) + for row in reader: + if row[0] == testcase: + return row[1], row[2] + +def main(spec: str): + with open ('metadata.csv', 'w', newline='') as csvfile: + writer = csv.writer(csvfile) + writer.writerow(['ID', 'title', 'description', 'specification', + 'mapping', 'input_format1', 'input_format2', + 'input_format3', 'output_format1', 'output_format2', + 'output_format3', 'input1', 'input2', 'input3', + 'output1', 'output2', 'output3', 'error']) + for testcase in glob.glob('RML*'): + title, description = get_title_description(testcase) + error = 'false' + input1 = '' + input2 = '' + input3 = '' + input_format1 = '' + input_format2 = '' + input_format3 = '' + output1 = '' + output2 = '' + output3 = '' + output_format1 = '' + output_format2 = '' + output_format3 = '' + + # Input file + if os.path.exists(os.path.join(testcase, 'Friends.json')): + input1 = 'Friends.json' + input_format1 = 'application/json' + elif os.path.exists(os.path.join(testcase, 'Friends-UTF16.json')): + input1 = 'Friends-UTF16.json' + input_format1 = 'application/json' + elif os.path.exists(os.path.join(testcase, 'Friends.json.gz')): + input1 = 'Friends.json.gz' + input_format1 = 'application/gzip+json' + elif os.path.exists(os.path.join(testcase, 'Friends.json.zip')): + input1 = 'Friends.json.zip' + input_format1 = 'application/gzip+json' + elif os.path.exists(os.path.join(testcase, 'Friends.json.tar.xz')): + input1 = 'Friends.json.tar.xz' + input_format1 = 'application/tarxz+json' + elif os.path.exists(os.path.join(testcase, 'Friends.json.tar.gz')): + input1 = 'Friends.json.tar.gz' + input_format1 = 'application/targz+json' + elif os.path.exists(os.path.join(testcase, 'Friends-NULL.csv')): + input1 = 'Friends-NULL.csv' + input_format1 = 'text/csv' + elif os.path.exists(os.path.join(testcase, 'Friends-NULL2.csv')): + input1 = 'Friends-NULL2.csv' + input_format1 = 'text/csv' + elif os.path.exists(os.path.join(testcase, 'Friends.nt')): + input1 = 'Friends.nt' + input_format1 = 'application/n-triples' + elif os.path.exists(os.path.join(testcase, 'Friends.csv')): + input1 = 'Friends.csv' + input_format1 = 'text/csv' + elif os.path.exists(os.path.join(testcase, 'Friends.json')): + input1 = 'Friends.json' + input_format1 = 'application/json' + elif os.path.exists(os.path.join(testcase, 'Friends.xml')): + input1 = 'Friends.xml' + input_format1 = 'text/xml' + else: + input1 = f'http://w3id.org/rml/resources/rml-io/{testcase}/Friends.json' + input_format1 = 'application/json' + + # Mapping file + if os.path.exists(os.path.join(testcase, 'mapping.ttl')): + mapping_file = 'mapping.ttl' + else: + raise ValueError('Mapping file missing!') + + # Output files + if os.path.exists(os.path.join(testcase, 'default.nq')): + output1 = 'default.nq' + output_format1 = 'application/n-quads' + else: + raise NotImplementedError('output1 is not known, but required') + + if os.path.exists(os.path.join(testcase, 'dump1.nq')): + output2 = 'dump1.nq' + output_format2 = 'application/n-quads' + elif os.path.exists(os.path.join(testcase, 'dump1.nt')): + output2 = 'dump1.nt' + output_format2 = 'application/n-quads' + elif os.path.exists(os.path.join(testcase, 'dump1.n3')): + output2 = 'dump1.n3' + output_format2 = 'application/n-quads' + elif os.path.exists(os.path.join(testcase, 'dump1.jsonld')): + output2 = 'dump1.jsonld' + output_format2 = 'application/n-quads' + elif os.path.exists(os.path.join(testcase, 'dump1.rdfjson')): + output2 = 'dump1.rdfjson' + output_format2 = 'application/n-quads' + elif os.path.exists(os.path.join(testcase, 'dump1.rdfxml')): + output2 = 'dump1.rdfxml' + output_format2 = 'application/n-quads' + elif os.path.exists(os.path.join(testcase, 'dump1.ttl')): + output2 = 'dump1.ttl' + output_format2 = 'application/n-quads' + elif os.path.exists(os.path.join(testcase, 'dump1.nq.gz')): + output2 = 'dump1.nq.gz' + output_format2 = 'application/n-quads' + elif os.path.exists(os.path.join(testcase, 'dump1.nq.zip')): + output2 = 'dump1.nq.zip' + output_format2 = 'application/n-quads' + elif os.path.exists(os.path.join(testcase, 'dump1.nq.tar.xz')): + output2 = 'dump1.nq.tar.xz' + output_format2 = 'application/n-quads' + elif os.path.exists(os.path.join(testcase, 'dump1.nq.tar.gz')): + output2 = 'dump1.nq.tar.gz' + output_format2 = 'application/n-quads' + + if os.path.exists(os.path.join(testcase, 'dump2.nq')): + output3 = 'dump2.nq' + output_format3 = 'application/n-quads' + + writer.writerow([testcase, title, description, spec, mapping_file, + input_format1, input_format2, input_format3, + output_format1, output_format2, output_format3, + input1, input2, input3, output1, output2, + output3, error]) + lines = [] + # Title and description + lines.append(f'## {testcase}\n\n') + lines.append(f'**Title**: {title}\n\n') + lines.append(f'**Description**: {description}\n\n') + if error == 'true': + error_html = 'Yes' + else: + error_html = 'No' + lines.append(f'**Error expected?** {error_html}\n\n') + + # Input + inputCount = '' + + for index, i in enumerate([input1, input2, input3]): + if not i: + break + + if 'http://w3id.org/rml/resources' in i: + input_html = f'**Input{inputCount}**\n [{i}]({i})\n\n' + else: + try: + with open(os.path.join(testcase, i)) as f: + input_html = f'**Input{inputCount}**\n```\n{f.read()}\n```\n\n' + except UnicodeDecodeError: + try: + with open(os.path.join(testcase, i), encoding='utf-16') as f: + input_html = f'**Input{inputCount}**\n```\n{f.read()}\n```\n\n' + except UnicodeDecodeError: + input_html = f'**Input{inputCount}**\n `{i}`\n\n' + + lines.append(input_html) + inputCount = f' {index + 1}' + + # Mapping + with open(os.path.join(testcase, mapping_file)) as f: + mapping_html = f'**Mapping**\n```\n{f.read()}\n```\n\n' + lines.append(mapping_html) + + # Output + outputCount = '' + if output2 or output3: + outputCount = ' 1' + + for index, i in enumerate([output1, output2, output3]): + if not i: + break + + if 'http://w3id.org/rml/resources' in i: + output_html = f'**Output{outputCount}**\n [{i}]({i})\n\n' + else: + try: + with open(os.path.join(testcase, i)) as f: + output_html = f'**Output{outputCount}**\n```\n{f.read()}\n```\n\n' + except UnicodeDecodeError: + try: + with open(os.path.join(testcase, i), encoding='utf-16') as f: + output_html = f'**Output{outputCount}**\n```\n{f.read()}\n```\n\n' + except UnicodeDecodeError: + output_html = f'**Output{outputCount}**\n `{i}`\n\n' + + lines.append(output_html) + outputCount = f' {index + 2}' + + + with open(os.path.join(testcase, 'README.md'), 'w') as f: + f.writelines(lines) + + +if __name__ == '__main__': + if len(sys.argv) != 2: + print('Usage: ./make-metadata.py ') + sys.exit(1) + main(sys.argv[1]) diff --git a/src/test/resources/rml-cc/manifest.rml.ttl b/src/test/resources/rml-cc/manifest.rml.ttl new file mode 100644 index 00000000..0dd78573 --- /dev/null +++ b/src/test/resources/rml-cc/manifest.rml.ttl @@ -0,0 +1,267 @@ +@prefix xsd: . +@prefix dcterms: . +@prefix rml: . +@prefix rmltest: . +@prefix test: . +@base . + +# java -jar .\burp.jar -m manifest.rml.ttl -o manifest.ttl -b http://w3id.org/rml/cc/test/ + +_:source + rml:source [ + a rml:RelativePathSource ; + rml:path "metadata.csv" ; + rml:null ""; + ]; + rml:referenceFormulation rml:CSV; +. + +<#TriplesMapTestcase> + a rml:TriplesMap; + + rml:logicalSource _:source; + + rml:subjectMap [ + rml:reference "ID"; + rml:class test:TestCase; + ]; + + rml:predicateObjectMap [ + rml:predicate dcterms:identifier; + rml:objectMap [ + rml:reference "ID"; + ]; + ]; + + rml:predicateObjectMap [ + rml:predicate rmltest:hasError; + rml:objectMap [ + rml:reference "error"; + rml:datatype xsd:boolean; + ]; + ]; + + rml:predicateObjectMap [ + rml:predicate rmltest:mappingDocument; + rml:objectMap [ + rml:reference "mapping"; + ]; + ]; + + rml:predicateObjectMap [ + rml:predicate rmltest:input; + rml:objectMap [ a rml:RefObjectMap; + rml:parentTriplesMap <#TriplesMapInput1>; + rml:joinCondition [ + rml:child "ID"; + rml:parent "ID"; + ]; + ]; + ]; + + rml:predicateObjectMap [ + rml:predicate rmltest:input; + rml:objectMap [ a rml:RefObjectMap; + rml:parentTriplesMap <#TriplesMapInput2>; + rml:joinCondition [ + rml:child "ID"; + rml:parent "ID"; + ]; + ]; + ]; + + rml:predicateObjectMap [ + rml:predicate rmltest:input; + rml:objectMap [ a rml:RefObjectMap; + rml:parentTriplesMap <#TriplesMapInput3>; + rml:joinCondition [ + rml:child "ID"; + rml:parent "ID"; + ]; + ]; + ]; + + rml:predicateObjectMap [ + rml:predicate rmltest:output; + rml:objectMap [ a rml:RefObjectMap; + rml:parentTriplesMap <#TriplesMapOutput1>; + rml:joinCondition [ + rml:child "ID"; + rml:parent "ID"; + ]; + ]; + ]; + + rml:predicateObjectMap [ + rml:predicate rmltest:output; + rml:objectMap [ a rml:RefObjectMap; + rml:parentTriplesMap <#TriplesMapOutput2>; + rml:joinCondition [ + rml:child "ID"; + rml:parent "ID"; + ]; + ]; + ]; + + rml:predicateObjectMap [ + rml:predicate rmltest:output; + rml:objectMap [ a rml:RefObjectMap; + rml:parentTriplesMap <#TriplesMapOutput3>; + rml:joinCondition [ + rml:child "ID"; + rml:parent "ID"; + ]; + ]; + ]; +. + +<#TriplesMapInput1> + a rml:TriplesMap; + + rml:logicalSource _:source ; + + rml:subjectMap [ + rml:template "{ID}/input/{input1}"; + rml:class rmltest:Input; + ]; + + rml:predicateObjectMap [ + rml:predicate rmltest:input; + rml:objectMap [ + rml:reference "input1"; + ]; + ]; + + rml:predicateObjectMap [ + rml:predicate rmltest:inputFormat; + rml:objectMap [ + rml:reference "input_format1"; + ]; + ]; +. + +<#TriplesMapInput2> + a rml:TriplesMap; + + rml:logicalSource _:source; + + rml:subjectMap [ + rml:template "{ID}/input/{input2}"; + rml:class rmltest:Input; + ]; + + rml:predicateObjectMap [ + rml:predicate rmltest:input; + rml:objectMap [ + rml:reference "input2"; + ]; + ]; + + rml:predicateObjectMap [ + rml:predicate rmltest:inputFormat; + rml:objectMap [ + rml:reference "input_format2"; + ]; + ]; +. + +<#TriplesMapInput3> + a rml:TriplesMap; + + rml:logicalSource _:source; + + rml:subjectMap [ + rml:template "{ID}/input/{input3}"; + rml:class rmltest:Input; + ]; + + rml:predicateObjectMap [ + rml:predicate rmltest:input; + rml:objectMap [ + rml:reference "input3"; + ]; + ]; + + rml:predicateObjectMap [ + rml:predicate rmltest:inputFormat; + rml:objectMap [ + rml:reference "input_format3"; + ]; + ]; +. + +<#TriplesMapOutput1> + a rml:TriplesMap; + + rml:logicalSource _:source; + + rml:subjectMap [ + rml:template "{ID}/output/{output1}"; + rml:class rmltest:Output; + ]; + + rml:predicateObjectMap [ + rml:predicate rmltest:output; + rml:objectMap [ + rml:reference "output1"; + ]; + ]; + + rml:predicateObjectMap [ + rml:predicate rmltest:outputFormat; + rml:objectMap [ + rml:reference "output_format1"; + ]; + ]; +. + +<#TriplesMapOutput2> + a rml:TriplesMap; + + rml:logicalSource _:source; + + rml:subjectMap [ + rml:template "{ID}/output/{output2}"; + rml:class rmltest:Output; + ]; + + rml:predicateObjectMap [ + rml:predicate rmltest:output; + rml:objectMap [ + rml:reference "output2"; + ]; + ]; + + rml:predicateObjectMap [ + rml:predicate rmltest:outputFormat; + rml:objectMap [ + rml:reference "output_format2"; + ]; + ]; +. + +<#TriplesMapOutput3> + a rml:TriplesMap; + + rml:logicalSource _:source; + + rml:subjectMap [ + rml:template "{ID}/output/{output3}"; + rml:class rmltest:Output; + ]; + + rml:predicateObjectMap [ + rml:predicate rmltest:output; + rml:objectMap [ + rml:reference "output3"; + ]; + ]; + + rml:predicateObjectMap [ + rml:predicate rmltest:outputFormat; + rml:objectMap [ + rml:reference "output_format3"; + ]; + ]; +. + diff --git a/src/test/resources/rml-cc/manifest.ttl b/src/test/resources/rml-cc/manifest.ttl new file mode 100644 index 00000000..bd827a7f --- /dev/null +++ b/src/test/resources/rml-cc/manifest.ttl @@ -0,0 +1,420 @@ + . + "mapping.ttl" . + "false"^^ . + . + "RMLTC-CC-0006-IT0" . + . + "default.nq" . + "application/n-quads" . + . + "http://w3id.org/rml/resources/rml-io/RMLTC-CC-0005-App1/Friends.json" . + "application/json" . + . + "http://w3id.org/rml/resources/rml-io/RMLTC-CC-0004-SM1/Friends.json" . + "application/json" . + . + . + "mapping.ttl" . + "false"^^ . + . + "RMLTC-CC-0008-ROMb" . + . + "default.nq" . + "application/n-quads" . + . + "http://w3id.org/rml/resources/rml-io/RMLTC-CC-0005-Car1/Friends.json" . + "application/json" . + . + "http://w3id.org/rml/resources/rml-io/RMLTC-CC-0006-IT0/Friends.json" . + "application/json" . + . + "default.nq" . + "application/n-quads" . + . + "default.nq" . + "application/n-quads" . + . + . + "mapping.ttl" . + "false"^^ . + . + "RMLTC-CC-0010-Lista" . + . + . + "mapping.ttl" . + "false"^^ . + . + "RMLTC-CC-0006-IT1" . + . + "default.nq" . + "application/n-quads" . + . + . + "mapping.ttl" . + "false"^^ . + . + "RMLTC-CC-0002-List" . + . + "http://w3id.org/rml/resources/rml-io/RMLTC-CC-0007-NES/Friends.json" . + "application/json" . + . + "http://w3id.org/rml/resources/rml-io/RMLTC-CC-0004-SM4/Friends.json" . + "application/json" . + . + . + "mapping.ttl" . + "false"^^ . + . + "RMLTC-CC-0001-Bag" . + . + "default.nq" . + "application/n-quads" . + . + "default.nq" . + "application/n-quads" . + . + "http://w3id.org/rml/resources/rml-io/RMLTC-CC-0010-Listb/Friends.json" . + "application/json" . + . + . + "mapping.ttl" . + "false"^^ . + . + "RMLTC-CC-0003-EL-Named" . + . + . + "mapping.ttl" . + "false"^^ . + . + "RMLTC-CC-0005-App1" . + . + "default.nq" . + "application/n-quads" . + . + "http://w3id.org/rml/resources/rml-io/RMLTC-CC-0006-IT1/Friends.json" . + "application/json" . + . + "default.nq" . + "application/n-quads" . + . + . + "mapping.ttl" . + "false"^^ . + . + "RMLTC-CC-0004-SM1" . + . + "default.nq" . + "application/n-quads" . + . + "default.nq" . + "application/n-quads" . + . + "default.nq" . + "application/n-quads" . + . + "http://w3id.org/rml/resources/rml-io/RMLTC-CC-0008-ROMa/Friends.json" . + "application/json" . + . + . + "mapping.ttl" . + "false"^^ . + . + "RMLTC-CC-0003-NEL" . + . + "http://w3id.org/rml/resources/rml-io/RMLTC-CC-0003-EL/Friends.json" . + "application/json" . + . + . + "mapping.ttl" . + "false"^^ . + . + "RMLTC-CC-0003-NELb" . + . + . + "mapping.ttl" . + "false"^^ . + . + "RMLTC-CC-0010-Listb" . + . + . + "mapping.ttl" . + "false"^^ . + . + "RMLTC-CC-0006-IT2" . + . + "default.nq" . + "application/n-quads" . + . + "http://w3id.org/rml/resources/rml-io/RMLTC-CC-0006-IT4/Friends.json" . + "application/json" . + . + "http://w3id.org/rml/resources/rml-io/RMLTC-CC-0003-NELb/Friends.json" . + "application/json" . + . + . + "mapping.ttl" . + "false"^^ . + . + "RMLTC-CC-0009-DUP-Bag" . + . + . + "mapping.ttl" . + "false"^^ . + . + "RMLTC-CC-0001-Seq" . + . + . + "mapping.ttl" . + "false"^^ . + . + "RMLTC-CC-0002-Bag" . + . + "http://w3id.org/rml/resources/rml-io/RMLTC-CC-0001-Alt/Friends.json" . + "application/json" . + . + . + "mapping.ttl" . + "false"^^ . + . + "RMLTC-CC-0001-List" . + . + . + "mapping.ttl" . + "false"^^ . + . + "RMLTC-CC-0005-App2" . + . + "default.nq" . + "application/n-quads" . + . + "default.nq" . + "application/n-quads" . + . + "http://w3id.org/rml/resources/rml-io/RMLTC-CC-0001-List/Friends.json" . + "application/json" . + . + . + "mapping.ttl" . + "false"^^ . + . + "RMLTC-CC-0001-Alt" . + . + "default.nq" . + "application/n-quads" . + . + . + "mapping.ttl" . + "false"^^ . + . + "RMLTC-CC-0004-SM2" . + . + "default.nq" . + "application/n-quads" . + . + "default.nq" . + "application/n-quads" . + . + "http://w3id.org/rml/resources/rml-io/RMLTC-CC-0001-Seq/Friends.json" . + "application/json" . + . + "default.nq" . + "application/n-quads" . + . + . + "mapping.ttl" . + "false"^^ . + . + "RMLTC-CC-0007-NES" . + . + "http://w3id.org/rml/resources/rml-io/RMLTC-CC-0004-SM2/Friends.json" . + "application/json" . + . + . + "mapping.ttl" . + "false"^^ . + . + "RMLTC-CC-0009-DUP-List" . + . + . + "mapping.ttl" . + "false"^^ . + . + "RMLTC-CC-0003-EL" . + . + . + "mapping.ttl" . + "false"^^ . + . + "RMLTC-CC-0006-IT3" . + . + "default.nq" . + "application/n-quads" . + . + . + "mapping.ttl" . + "false"^^ . + . + "RMLTC-CC-0003-NEB" . + . + "http://w3id.org/rml/resources/rml-io/RMLTC-CC-0009-DUP-Bag/Friends.json" . + "application/json" . + . + . + "mapping.ttl" . + "false"^^ . + . + "RMLTC-CC-0005-Car1" . + . + "http://w3id.org/rml/resources/rml-io/RMLTC-CC-0003-EB/Friends.json" . + "application/json" . + . + "http://w3id.org/rml/resources/rml-io/RMLTC-CC-0004-SM5/Friends.json" . + "application/json" . + . + "default.nq" . + "application/n-quads" . + . + "http://w3id.org/rml/resources/rml-io/RMLTC-CC-0005-App2/Friends.json" . + "application/json" . + . + "http://w3id.org/rml/resources/rml-io/RMLTC-CC-0002-List/Friends.json" . + "application/json" . + . + "default.nq" . + "application/n-quads" . + . + "http://w3id.org/rml/resources/rml-io/RMLTC-CC-0006-IT2/Friends.json" . + "application/json" . + . + "default.nq" . + "application/n-quads" . + . + . + "mapping.ttl" . + "false"^^ . + . + "RMLTC-CC-0004-SM3" . + . + "default.nq" . + "application/n-quads" . + . + "http://w3id.org/rml/resources/rml-io/RMLTC-CC-0005-Car2/Friends.json" . + "application/json" . + . + "http://w3id.org/rml/resources/rml-io/RMLTC-CC-0003-NEB/Friends.json" . + "application/json" . + . + "default.nq" . + "application/n-quads" . + . + . + "mapping.ttl" . + "false"^^ . + . + "RMLTC-CC-0006-IT4" . + . + "default.nq" . + "application/n-quads" . + . + . + "mapping.ttl" . + "false"^^ . + . + "RMLTC-CC-0005-Car2" . + . + "http://w3id.org/rml/resources/rml-io/RMLTC-CC-0002-Bag/Friends.json" . + "application/json" . + . + "default.nq" . + "application/n-quads" . + . + "http://w3id.org/rml/resources/rml-io/RMLTC-CC-0006-IT5/Friends.json" . + "application/json" . + . + "default.nq" . + "application/n-quads" . + . + . + "mapping.ttl" . + "false"^^ . + . + "RMLTC-CC-0003-EB" . + . + "default.nq" . + "application/n-quads" . + . + "default.nq" . + "application/n-quads" . + . + . + "mapping.ttl" . + "false"^^ . + . + "RMLTC-CC-0004-SM4" . + . + "http://w3id.org/rml/resources/rml-io/RMLTC-CC-0009-DUP-List/Friends.json" . + "application/json" . + . + "http://w3id.org/rml/resources/rml-io/RMLTC-CC-0010-Lista/Friends.json" . + "application/json" . + . + "http://w3id.org/rml/resources/rml-io/RMLTC-CC-0008-ROMb/Friends.json" . + "application/json" . + . + "http://w3id.org/rml/resources/rml-io/RMLTC-CC-0004-SM3/Friends.json" . + "application/json" . + . + "default.nq" . + "application/n-quads" . + . + "default.nq" . + "application/n-quads" . + . + "default.nq" . + "application/n-quads" . + . + . + "mapping.ttl" . + "false"^^ . + . + "RMLTC-CC-0006-IT5" . + . + "http://w3id.org/rml/resources/rml-io/RMLTC-CC-0001-Bag/Friends.json" . + "application/json" . + . + "http://w3id.org/rml/resources/rml-io/RMLTC-CC-0003-EL-Named/Friends.json" . + "application/json" . + . + . + "mapping.ttl" . + "false"^^ . + . + "RMLTC-CC-0008-ROMa" . + . + "http://w3id.org/rml/resources/rml-io/RMLTC-CC-0003-EL-BN/Friends.json" . + "application/json" . + . + "http://w3id.org/rml/resources/rml-io/RMLTC-CC-0003-NEL/Friends.json" . + "application/json" . + . + "default.nq" . + "application/n-quads" . + . + . + "mapping.ttl" . + "false"^^ . + . + "RMLTC-CC-0003-EL-BN" . + . + "default.nq" . + "application/n-quads" . + . + . + "mapping.ttl" . + "false"^^ . + . + "RMLTC-CC-0004-SM5" . + . + "http://w3id.org/rml/resources/rml-io/RMLTC-CC-0006-IT3/Friends.json" . + "application/json" . + . diff --git a/src/test/resources/rml-cc/metadata.csv b/src/test/resources/rml-cc/metadata.csv new file mode 100644 index 00000000..919ffd53 --- /dev/null +++ b/src/test/resources/rml-cc/metadata.csv @@ -0,0 +1,36 @@ +ID,title,description,specification,mapping,input_format1,input_format2,input_format3,output_format1,output_format2,output_format3,input1,input2,input3,output1,output2,output3,error +RMLTC-CC-0001-Alt,Generate a rdf:Alt as an object,Tests if a rdf:Alt is generated as an object,http://w3id.org/rml/cc/spec,mapping.ttl,application/json,,,application/n-quads,,,http://w3id.org/rml/resources/rml-io/RMLTC-CC-0001-Alt/Friends.json,,,default.nq,,,false +RMLTC-CC-0001-Bag,Generate a rdf:Bag as an object,Tests if a rdf:Bag is generated as an object,http://w3id.org/rml/cc/spec,mapping.ttl,application/json,,,application/n-quads,,,http://w3id.org/rml/resources/rml-io/RMLTC-CC-0001-Bag/Friends.json,,,default.nq,,,false +RMLTC-CC-0001-List,Generate a rdf:List as an object,Tests if a rdf:List is generated as an object,http://w3id.org/rml/cc/spec,mapping.ttl,application/json,,,application/n-quads,,,http://w3id.org/rml/resources/rml-io/RMLTC-CC-0001-List/Friends.json,,,default.nq,,,false +RMLTC-CC-0001-Seq,Generate a rdf:Seq as an object,Tests if a rdf:Seq is generated as an object,http://w3id.org/rml/cc/spec,mapping.ttl,application/json,,,application/n-quads,,,http://w3id.org/rml/resources/rml-io/RMLTC-CC-0001-Seq/Friends.json,,,default.nq,,,false +RMLTC-CC-0002-Bag,Generate a named rdf:Bag as an object,Tests if a named rdf:Bag is generated as an object,http://w3id.org/rml/cc/spec,mapping.ttl,application/json,,,application/n-quads,,,http://w3id.org/rml/resources/rml-io/RMLTC-CC-0002-Bag/Friends.json,,,default.nq,,,false +RMLTC-CC-0002-List,Generate a named rdf:List as an object,Tests if a named rdf:List is generated as an object,http://w3id.org/rml/cc/spec,mapping.ttl,application/json,,,application/n-quads,,,http://w3id.org/rml/resources/rml-io/RMLTC-CC-0002-List/Friends.json,,,default.nq,,,false +RMLTC-CC-0003-EB,Allow the generation of empty bags,Tests if the use of rml:allowEmptyListAndContainer yields an empty bag.,http://w3id.org/rml/cc/spec,mapping.ttl,application/json,,,application/n-quads,,,http://w3id.org/rml/resources/rml-io/RMLTC-CC-0003-EB/Friends.json,,,default.nq,,,false +RMLTC-CC-0003-EL,Allow the generation of empty lists,Tests if the use of rml:allowEmptyListAndContainer yields an empty list.,http://w3id.org/rml/cc/spec,mapping.ttl,application/json,,,application/n-quads,,,http://w3id.org/rml/resources/rml-io/RMLTC-CC-0003-EL/Friends.json,,,default.nq,,,false +RMLTC-CC-0003-EL-BN,Allow the generation of empty lists identified by blank node identifiers.,Tests if the use of rml:allowEmptyListAndContainer yields an empty list. The lists are identified by a blank node identifier generated in the mapping.,http://w3id.org/rml/cc/spec,mapping.ttl,application/json,,,application/n-quads,,,http://w3id.org/rml/resources/rml-io/RMLTC-CC-0003-EL-BN/Friends.json,,,default.nq,,,false +RMLTC-CC-0003-EL-Named,Allow the generation of empty lists identified by IRIs.,Tests if the use of rml:allowEmptyListAndContainer yields an empty list. The lists are identified by a IRI generated in the mapping.,http://w3id.org/rml/cc/spec,mapping.ttl,application/json,,,application/n-quads,,,http://w3id.org/rml/resources/rml-io/RMLTC-CC-0003-EL-Named/Friends.json,,,default.nq,,,false +RMLTC-CC-0003-NEB,Empty bags are not generated,Tests if empty containers are not generated (expected default behavior).,http://w3id.org/rml/cc/spec,mapping.ttl,application/json,,,application/n-quads,,,http://w3id.org/rml/resources/rml-io/RMLTC-CC-0003-NEB/Friends.json,,,default.nq,,,false +RMLTC-CC-0003-NEL,Empty lists are not generated,Tests if empty lists are not generated (expected default behavior).,http://w3id.org/rml/cc/spec,mapping.ttl,application/json,,,application/n-quads,,,http://w3id.org/rml/resources/rml-io/RMLTC-CC-0003-NEL/Friends.json,,,default.nq,,,false +RMLTC-CC-0003-NELb,Empty lists are not generated II,Tests if empty lists are not generated (expected default behavior). This test cases uses the predicate rml:allowEmptyListAndContainer.,http://w3id.org/rml/cc/spec,mapping.ttl,application/json,,,application/n-quads,,,http://w3id.org/rml/resources/rml-io/RMLTC-CC-0003-NELb/Friends.json,,,default.nq,,,false +RMLTC-CC-0004-SM1,GatherMap in subject map (list),Tests if the use of a gather map in the subject map is supported. This test generates a list.,http://w3id.org/rml/cc/spec,mapping.ttl,application/json,,,application/n-quads,,,http://w3id.org/rml/resources/rml-io/RMLTC-CC-0004-SM1/Friends.json,,,default.nq,,,false +RMLTC-CC-0004-SM2,GatherMap in subject map (list),Tests if the use of a gather map in the subject map is supported. This test has no predicate-object maps and no class declarations in the subject map. It still needs to generate triples as the lists consists of at least one cons-pair.,http://w3id.org/rml/cc/spec,mapping.ttl,application/json,,,application/n-quads,,,http://w3id.org/rml/resources/rml-io/RMLTC-CC-0004-SM2/Friends.json,,,default.nq,,,false +RMLTC-CC-0004-SM3,GatherMap in subject map (list),Tests if the use of a gather map in the subject map is supported. This test has no predicate-object maps and no class declarations in the subject map. Only one list needs to be generated as the other has no values and we only retain non-empty lists. ,http://w3id.org/rml/cc/spec,mapping.ttl,application/json,,,application/n-quads,,,http://w3id.org/rml/resources/rml-io/RMLTC-CC-0004-SM3/Friends.json,,,default.nq,,,false +RMLTC-CC-0004-SM4,GatherMap in subject map (bag),Tests if the use of a gather map in the subject map is supported. This test generates a bag.,http://w3id.org/rml/cc/spec,mapping.ttl,application/json,,,application/n-quads,,,http://w3id.org/rml/resources/rml-io/RMLTC-CC-0004-SM4/Friends.json,,,default.nq,,,false +RMLTC-CC-0004-SM5,GatherMap in subject map (bag),"Tests if the use of a gather map in the subject map is supported. This test has no predicate-object maps and no class declarations in the subject map. It should generate a non-empty bag and an empty bag. The reason being that a container has at least one triple ; it's type (bag, seq, or alt).",http://w3id.org/rml/cc/spec,mapping.ttl,application/json,,,application/n-quads,,,http://w3id.org/rml/resources/rml-io/RMLTC-CC-0004-SM5/Friends.json,,,default.nq,,,false +RMLTC-CC-0005-App1,Append values of multiple term maps,Tests appending of values from multiple term maps in an gather map. This test covers the case where all sets of values are non-empty.,http://w3id.org/rml/cc/spec,mapping.ttl,application/json,,,application/n-quads,,,http://w3id.org/rml/resources/rml-io/RMLTC-CC-0005-App1/Friends.json,,,default.nq,,,false +RMLTC-CC-0005-App2,Append values of multiple term maps,"Tests appending of values from multiple term maps in an iteration. In this example, one of the arrays is empty and the expected behavior is to concatinate a list with the empty list.",http://w3id.org/rml/cc/spec,mapping.ttl,application/json,,,application/n-quads,,,http://w3id.org/rml/resources/rml-io/RMLTC-CC-0005-App2/Friends.json,,,default.nq,,,false +RMLTC-CC-0005-Car1,Cartesian product of values from multiple term maps of a gather map.,Tests generating the Cartesian product of values from multiple term maps in a gather map. This test covers the case where all sets of values are non-empty.,http://w3id.org/rml/cc/spec,mapping.ttl,application/json,,,application/n-quads,,,http://w3id.org/rml/resources/rml-io/RMLTC-CC-0005-Car1/Friends.json,,,default.nq,,,false +RMLTC-CC-0005-Car2,Cartesian product of values from multiple term maps of a gather map.,Tests generating the Cartesian product of values from multiple term maps in a gather map. This test covers the case where one of the sets is empty. The Cartesian product of a set with an empty set is empty. This entry should thus not yield a list.,http://w3id.org/rml/cc/spec,mapping.ttl,application/json,,,application/n-quads,,,http://w3id.org/rml/resources/rml-io/RMLTC-CC-0005-Car2/Friends.json,,,default.nq,,,false +RMLTC-CC-0006-IT0,Gather values across iterations to create a collection.,"When no template, constant, or reference is given to a gather map, then each iteration yields a different collection.",http://w3id.org/rml/cc/spec,mapping.ttl,application/json,,,application/n-quads,,,http://w3id.org/rml/resources/rml-io/RMLTC-CC-0006-IT0/Friends.json,,,default.nq,,,false +RMLTC-CC-0006-IT1,Gather values across iterations to create a collection.,"When using a template, constant, or reference for a gather map, this tests determines whether the values are correctly appended to the list. The natural order of the term maps inside the gather map as well as the iteration are respected. This test covers one term map in the gather map.",http://w3id.org/rml/cc/spec,mapping.ttl,application/json,,,application/n-quads,,,http://w3id.org/rml/resources/rml-io/RMLTC-CC-0006-IT1/Friends.json,,,default.nq,,,false +RMLTC-CC-0006-IT2,Gather values across iterations to create a collection.,"When using a template, constant, or reference for a gather map, this tests determines whether the values are correctly appended to the list. The natural order of the term maps inside the gather map as well as the iteration are respected. This test covers two term maps in the gather map.",http://w3id.org/rml/cc/spec,mapping.ttl,application/json,,,application/n-quads,,,http://w3id.org/rml/resources/rml-io/RMLTC-CC-0006-IT2/Friends.json,,,default.nq,,,false +RMLTC-CC-0006-IT3,Gather values across iterations to create a container.,"When no template, constant, or reference is given to a gather map, then each iteration yields a different container.",http://w3id.org/rml/cc/spec,mapping.ttl,application/json,,,application/n-quads,,,http://w3id.org/rml/resources/rml-io/RMLTC-CC-0006-IT3/Friends.json,,,default.nq,,,false +RMLTC-CC-0006-IT4,Gather values across iterations to create a container.,"When using a template, constant, or reference for a gather map, this tests determines whether the values are correctly appended to the container. The natural order of the term maps inside the gather map as well as the iteration are respected. This test covers one term map in the gather map.",http://w3id.org/rml/cc/spec,mapping.ttl,application/json,,,application/n-quads,,,http://w3id.org/rml/resources/rml-io/RMLTC-CC-0006-IT4/Friends.json,,,default.nq,,,false +RMLTC-CC-0006-IT5,Gather values across iterations to create a container.,"When using a template, constant, or reference for a gather map, this tests determines whether the values are correctly appended to the container. The natural order of the term maps inside the gather map as well as the iteration are respected. This test covers two term maps in the gather map.",http://w3id.org/rml/cc/spec,mapping.ttl,application/json,,,application/n-quads,,,http://w3id.org/rml/resources/rml-io/RMLTC-CC-0006-IT5/Friends.json,,,default.nq,,,false +RMLTC-CC-0007-NES,Nested gather maps,Testing whether nested gather maps are created. The mapping should generate a list of bags.,http://w3id.org/rml/cc/spec,mapping.ttl,application/json,,,application/n-quads,,,http://w3id.org/rml/resources/rml-io/RMLTC-CC-0007-NES/Friends.json,,,default.nq,,,false +RMLTC-CC-0008-ROMa,Elements via reference object-map.,Testing whether gather maps generate an RDF list whose members are generated by a referencing object-map.,http://w3id.org/rml/cc/spec,mapping.ttl,application/json,,,application/n-quads,,,http://w3id.org/rml/resources/rml-io/RMLTC-CC-0008-ROMa/Friends.json,,,default.nq,,,false +RMLTC-CC-0008-ROMb,Elements via reference object-map with default join condition,Testing whether gather maps generate an RDF list whose members are generated by a referencing object-map with a default join condition.,http://w3id.org/rml/cc/spec,mapping.ttl,application/json,,,application/n-quads,,,http://w3id.org/rml/resources/rml-io/RMLTC-CC-0008-ROMb/Friends.json,,,default.nq,,,false +RMLTC-CC-0009-DUP-Bag,Gather duplicate values in an RDF Bag,Testing the expected behavior of multi-valued expression maps containing duplicate values when these expression maps are used in a gather map to create an RDF Bag.,http://w3id.org/rml/cc/spec,mapping.ttl,application/json,,,application/n-quads,,,http://w3id.org/rml/resources/rml-io/RMLTC-CC-0009-DUP-Bag/Friends.json,,,default.nq,,,false +RMLTC-CC-0009-DUP-List,Gather duplicate values in an RDF List,Testing the expected behavior of multi-valued expression maps containing duplicate values when these expression maps are used in a gather map to create a list.,http://w3id.org/rml/cc/spec,mapping.ttl,application/json,,,application/n-quads,,,http://w3id.org/rml/resources/rml-io/RMLTC-CC-0009-DUP-List/Friends.json,,,default.nq,,,false +RMLTC-CC-0010-Lista,Combining graph maps and gather maps (graph map has a template and gather map does not),"Tests the behavior of combining graph- and gather maps. In this example, a blank node for each list is expected.",http://w3id.org/rml/cc/spec,mapping.ttl,application/json,,,application/n-quads,,,http://w3id.org/rml/resources/rml-io/RMLTC-CC-0010-Lista/Friends.json,,,default.nq,,,false +RMLTC-CC-0010-Listb,Combining graph maps and gather maps (both graph map and gather map have a template),"Tests the behavior of combining graph- and gather maps. In this example, lists are concatinated in some named graphs via blank node identifiers constructed with templates.",http://w3id.org/rml/cc/spec,mapping.ttl,application/json,,,application/n-quads,,,http://w3id.org/rml/resources/rml-io/RMLTC-CC-0010-Listb/Friends.json,,,default.nq,,,false diff --git a/src/test/resources/rml-cc/publish.js b/src/test/resources/rml-cc/publish.js new file mode 100644 index 00000000..a747165b --- /dev/null +++ b/src/test/resources/rml-cc/publish.js @@ -0,0 +1,59 @@ +/** + * Created by bjdmeest on 10/06/2016. + * Modified by Dylan Van Assche on 12/02/2021. + */ + +var fs = require('fs'); +var path = require('path'); + +var dateString = (new Date()).toISOString().split('T')[0].replace(/-/g, ''); + +try { + if (!fs.existsSync (path.resolve(__dirname, 'docs'))) { + fs.mkdirSync (path.resolve(__dirname, 'docs')); + } + fs.mkdirSync (path.resolve(__dirname, 'docs', dateString)); +} catch (e) { + +} + +var files = fs.readdirSync (path.resolve(__dirname, 'docs')); +var dirs = []; +for (var i = 0; i < files.length; i++) { + if (fs.lstatSync (path.resolve(__dirname, 'docs', files[i])).isDirectory()) { + dirs.push(files[i]); + } +} + +dirs.sort(); +dirs.reverse(); + +if (dirs[0] === "resources") { + dirs.splice (0, 1); +} + +if (dirs[0] === dateString) { + dirs.splice (0, 1); +} + +// First version, set previous version to this one +if (dirs.length == 0) { + dirs.push (dateString) +} + +var html = fs.readFileSync ('./rendered.html', 'utf8'); +html = html.replace (/%thisDate%/g, dateString); +html = html.replace (/%prevDate%/g, dirs[0]); +fs.writeFileSync (path.resolve (__dirname, 'docs', 'index.html'), html); +html = html.replace (/\.\/resources/g, '../resources'); +fs.writeFileSync (path.resolve(__dirname, 'docs', dateString, 'index.html'), html); + +// Copy assets +// fs.copyFileSync('Supergirl.xml', path.resolve(__dirname, 'docs', dateString, 'Supergirl.xml')) +// fs.copyFileSync('Supergirl.xml', path.resolve(__dirname, 'docs', 'Supergirl.xml')) +// fs.copyFileSync('Leverage.csv', path.resolve(__dirname, 'docs', dateString, 'Leverage.csv')) +// fs.copyFileSync('Leverage.csv', path.resolve(__dirname, 'docs', 'Leverage.csv')) +// fs.copyFileSync('Friends.json', path.resolve(__dirname, 'docs', dateString, 'Friends.json')) +// fs.copyFileSync('Friends.json', path.resolve(__dirname, 'docs', 'Friends.json')) +// fs.copyFileSync('DBPedia.csv', path.resolve(__dirname, 'docs', dateString, 'DBPedia.csv')) +// fs.copyFileSync('DBPedia.csv', path.resolve(__dirname, 'docs', 'DBPedia.csv')) diff --git a/src/test/resources/rml-cc/rendered.html b/src/test/resources/rml-cc/rendered.html new file mode 100644 index 00000000..2ad784eb --- /dev/null +++ b/src/test/resources/rml-cc/rendered.html @@ -0,0 +1,2544 @@ + + + + + + +RML-CC: Test Cases + + + + + + + + + + + + + + + + + + + +

Abstract

This document defines the RML-CC test cases to the determine the RML-CC specification conformance of tools.

+
+ +

Status of This Document

+ This specification was published by the + Knowledge Graph Construction Community Group. It is not a W3C Standard nor is it + on the W3C Standards Track. + + Please note that under the + W3C Community Contributor License Agreement (CLA) + there is a limited opt-out and other conditions apply. + + Learn more about + W3C Community and Business Groups. +

+ +

1. Introduction

+

This document defines the RML-CC test cases, consisting of a collection of test case documents (input and expected output). +The purpose of the test cases is to determine the conformance of tools that execute RML rules to the RML-CC specification.

+
+ +

2. Data model

+

The test cases are semantically described for re-usability and shareability following the W3C Test case description. +Each test:Testcase as the following properties:

+
    +
  • dcterms:identifier: unique ID of the test case.
  • +
  • rmltest:hasError: if an error of the RML Processor is expected or not.
  • +
  • rmltest:input: One or more input data of the test case.
  • +
  • rmltest:output: One or more output data of the test case.
  • +
  • rmltest:inputFormat: the input data format.
  • +
  • rmltest:outputFormat: the output data format.
  • +
  • rmltest:mappingDocument: the RML mapping rules in Turtle.
  • +
+
+ +

3. Test cases

+

This section describes the RML-CC test cases. These descriptions are also available as RDF. +The files are available on GitHub in the folder test-cases. +Each test case is contained in a single folder, containing three types of files:

+
    +
  • Zero or more files containing the data sources, in the case of JSON, XML, CSV, or containing the SQL statements to create the necessary tables, in the case of MySQL, PostgreSQL, and SQL Server.
  • +
  • One file with the RML rules, called mapping.ttl, in the Turtle format.
  • +
  • Zero or more files with the expected RDF. No file is provided if an error is expected that must halt the generation of the RDF because of an error.
  • +
+
+ + +

4. RMLTC-CC-0001-Alt

+

Title: Generate a rdf:Alt as an object

+

Description: Tests if a rdf:Alt is generated as an object

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0001-Alt/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/>.
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+@prefix ex:  <http://example.com/ns#>.
+
+<http://example.com/base#TM> a rml:TriplesMap;
+    rml:logicalSource [
+        rml:source _:b738439 ;
+        rml:referenceFormulation rml:JSONPath ;
+        rml:iterator "$.*" ;
+    ] ;
+
+    rml:subjectMap [
+        rml:template "e/{$.id}" ;
+    ] ;
+
+    rml:predicateObjectMap [
+        rml:predicate ex:with ;
+        rml:objectMap [
+            rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
+            rml:gatherAs rdf:Alt ;
+        ] ;
+    ] ;
+.
+
+_:b738439 a rml:RelativePathSource ;
+    rml:path "data.json" .
+
+

Output

+
<http://example.com/base/e/a> <http://example.com/ns#with> _:nc808fbd2e11a4baa939c61c8210b5909b1 .
+_:nc808fbd2e11a4baa939c61c8210b5909b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Alt> .
+_:nc808fbd2e11a4baa939c61c8210b5909b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "1" .
+_:nc808fbd2e11a4baa939c61c8210b5909b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "2" .
+_:nc808fbd2e11a4baa939c61c8210b5909b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "3" .
+
+<http://example.com/base/e/b> <http://example.com/ns#with> _:nc808fbd2e11a4baa939c61c8210b5909b2 .
+_:nc808fbd2e11a4baa939c61c8210b5909b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Alt> .
+_:nc808fbd2e11a4baa939c61c8210b5909b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "4" .
+_:nc808fbd2e11a4baa939c61c8210b5909b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "5" .
+_:nc808fbd2e11a4baa939c61c8210b5909b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "6" .
+
+<http://example.com/base/e/c> <http://example.com/ns#with> _:nc808fbd2e11a4baa939c61c8210b5909b3 .
+_:nc808fbd2e11a4baa939c61c8210b5909b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Alt> .
+_:nc808fbd2e11a4baa939c61c8210b5909b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "7" .
+_:nc808fbd2e11a4baa939c61c8210b5909b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "8" .
+_:nc808fbd2e11a4baa939c61c8210b5909b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "9" .
+
+
+

5. RMLTC-CC-0001-Bag

+

Title: Generate a rdf:Bag as an object

+

Description: Tests if a rdf:Bag is generated as an object

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0001-Bag/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/>.
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+@prefix ex:  <http://example.com/ns#>.
+
+<http://example.com/base#TM> a rml:TriplesMap;
+    rml:logicalSource [
+        rml:source _:b738439 ;
+        rml:referenceFormulation rml:JSONPath ;
+        rml:iterator "$.*" ;
+    ] ;
+
+    rml:subjectMap [
+        rml:template "e/{$.id}" ;
+    ] ;
+
+    rml:predicateObjectMap [
+        rml:predicate ex:with ;
+        rml:objectMap [
+            rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
+            rml:gatherAs rdf:Bag ;
+        ] ;
+    ] ;
+.
+
+_:b738439 a rml:RelativePathSource ;
+    rml:path "data.json" .
+
+

Output

+
_:nc808fbd2e11a4baa939c61c8210b5909b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
+_:nc808fbd2e11a4baa939c61c8210b5909b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "5" .
+_:nc808fbd2e11a4baa939c61c8210b5909b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
+_:nc808fbd2e11a4baa939c61c8210b5909b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
+_:nc808fbd2e11a4baa939c61c8210b5909b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "9" .
+_:nc808fbd2e11a4baa939c61c8210b5909b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "2" .
+<http://example.com/base/e/b> <http://example.com/ns#with> _:nc808fbd2e11a4baa939c61c8210b5909b2 .
+_:nc808fbd2e11a4baa939c61c8210b5909b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "1" .
+<http://example.com/base/e/c> <http://example.com/ns#with> _:nc808fbd2e11a4baa939c61c8210b5909b3 .
+<http://example.com/base/e/a> <http://example.com/ns#with> _:nc808fbd2e11a4baa939c61c8210b5909b1 .
+_:nc808fbd2e11a4baa939c61c8210b5909b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "4" .
+_:nc808fbd2e11a4baa939c61c8210b5909b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "7" .
+_:nc808fbd2e11a4baa939c61c8210b5909b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "6" .
+_:nc808fbd2e11a4baa939c61c8210b5909b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "3" .
+_:nc808fbd2e11a4baa939c61c8210b5909b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "8" .
+
+
+

6. RMLTC-CC-0001-List

+

Title: Generate a rdf:List as an object

+

Description: Tests if a rdf:List is generated as an object

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0001-List/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/>.
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+@prefix ex:  <http://example.com/ns#>.
+
+<http://example.com/base#TM> a rml:TriplesMap;
+    rml:logicalSource [
+        rml:source _:b738439 ;
+        rml:referenceFormulation rml:JSONPath ;
+        rml:iterator "$.*" ;
+    ] ;
+
+    rml:subjectMap [
+        rml:template "e/{$.id}" ;
+    ] ;
+
+    rml:predicateObjectMap [
+        rml:predicate ex:with ;
+        rml:objectMap [
+            rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
+            rml:gatherAs rdf:List ;
+        ] ;
+    ] ;
+.
+
+_:b738439 a rml:RelativePathSource ;
+    rml:path "data.json" .
+
+

Output

+
<http://example.com/base/e/a> <http://example.com/ns#with> _:n988e0f11d19c486fa3b3255f94c9b3bab1 .
+_:n988e0f11d19c486fa3b3255f94c9b3bab1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
+_:n988e0f11d19c486fa3b3255f94c9b3bab1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n988e0f11d19c486fa3b3255f94c9b3bab2 .
+_:n988e0f11d19c486fa3b3255f94c9b3bab2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
+_:n988e0f11d19c486fa3b3255f94c9b3bab2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n988e0f11d19c486fa3b3255f94c9b3bab3 .
+_:n988e0f11d19c486fa3b3255f94c9b3bab3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" .
+_:n988e0f11d19c486fa3b3255f94c9b3bab3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+
+<http://example.com/base/e/b> <http://example.com/ns#with> _:n988e0f11d19c486fa3b3255f94c9b3bab4 .
+_:n988e0f11d19c486fa3b3255f94c9b3bab4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "4" .
+_:n988e0f11d19c486fa3b3255f94c9b3bab4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n988e0f11d19c486fa3b3255f94c9b3bab5 .
+_:n988e0f11d19c486fa3b3255f94c9b3bab5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "5" .
+_:n988e0f11d19c486fa3b3255f94c9b3bab5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n988e0f11d19c486fa3b3255f94c9b3bab6 .
+_:n988e0f11d19c486fa3b3255f94c9b3bab6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "6" .
+_:n988e0f11d19c486fa3b3255f94c9b3bab6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+
+<http://example.com/base/e/c> <http://example.com/ns#with> _:n988e0f11d19c486fa3b3255f94c9b3bab7 .
+_:n988e0f11d19c486fa3b3255f94c9b3bab7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "7" .
+_:n988e0f11d19c486fa3b3255f94c9b3bab7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n988e0f11d19c486fa3b3255f94c9b3bab8 .
+_:n988e0f11d19c486fa3b3255f94c9b3bab8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "8" .
+_:n988e0f11d19c486fa3b3255f94c9b3bab8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n988e0f11d19c486fa3b3255f94c9b3bab9 .
+_:n988e0f11d19c486fa3b3255f94c9b3bab9 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "9" .
+_:n988e0f11d19c486fa3b3255f94c9b3bab9 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+
+
+

7. RMLTC-CC-0001-Seq

+

Title: Generate a rdf:Seq as an object

+

Description: Tests if a rdf:Seq is generated as an object

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0001-Seq/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/>.
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+@prefix ex:  <http://example.com/ns#>.
+
+<http://example.com/base#TM> a rml:TriplesMap;
+    rml:logicalSource [
+        rml:source _:b738439 ;
+        rml:referenceFormulation rml:JSONPath ;
+        rml:iterator "$.*" ;
+    ] ;
+
+    rml:subjectMap [
+        rml:template "e/{$.id}" ;
+    ] ;
+
+    rml:predicateObjectMap [
+        rml:predicate ex:with ;
+        rml:objectMap [
+            rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
+            rml:gatherAs rdf:Seq ;
+        ] ;
+    ] ;
+.
+
+_:b738439 a rml:RelativePathSource ;
+    rml:path "data.json" .
+
+

Output

+
_:nc808fbd2e11a4baa939c61c8210b5909b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Seq> .
+_:nc808fbd2e11a4baa939c61c8210b5909b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "5" .
+_:nc808fbd2e11a4baa939c61c8210b5909b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Seq> .
+_:nc808fbd2e11a4baa939c61c8210b5909b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Seq> .
+_:nc808fbd2e11a4baa939c61c8210b5909b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "9" .
+_:nc808fbd2e11a4baa939c61c8210b5909b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "2" .
+<http://example.com/base/e/b> <http://example.com/ns#with> _:nc808fbd2e11a4baa939c61c8210b5909b2 .
+_:nc808fbd2e11a4baa939c61c8210b5909b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "1" .
+<http://example.com/base/e/c> <http://example.com/ns#with> _:nc808fbd2e11a4baa939c61c8210b5909b3 .
+<http://example.com/base/e/a> <http://example.com/ns#with> _:nc808fbd2e11a4baa939c61c8210b5909b1 .
+_:nc808fbd2e11a4baa939c61c8210b5909b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "4" .
+_:nc808fbd2e11a4baa939c61c8210b5909b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "7" .
+_:nc808fbd2e11a4baa939c61c8210b5909b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "6" .
+_:nc808fbd2e11a4baa939c61c8210b5909b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "3" .
+_:nc808fbd2e11a4baa939c61c8210b5909b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "8" .
+
+
+

8. RMLTC-CC-0002-Bag

+

Title: Generate a named rdf:Bag as an object

+

Description: Tests if a named rdf:Bag is generated as an object

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0002-Bag/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/>.
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+@prefix ex:  <http://example.com/ns#>.
+
+<http://example.com/base#TM> a rml:TriplesMap;
+    rml:logicalSource [
+        rml:source _:b738439 ;
+        rml:referenceFormulation rml:JSONPath ;
+        rml:iterator "$.*" ;
+    ] ;
+
+    rml:subjectMap [
+        rml:template "e/{$.id}" ;
+    ] ;
+
+    rml:predicateObjectMap [
+        rml:predicate ex:with ;
+        rml:objectMap [
+            rml:template "c/{$.id}" ;
+            rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
+            rml:gatherAs rdf:Bag ;
+        ] ;
+    ] ;
+.
+
+_:b738439 a rml:RelativePathSource ;
+    rml:path "data.json" .
+
+

Output

+
<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
+<http://example.com/base/c/c> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "7" .
+<http://example.com/base/c/c> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "8" .
+<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "2" .
+<http://example.com/base/e/c> <http://example.com/ns#with> <http://example.com/base/c/c> .
+<http://example.com/base/c/c> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
+<http://example.com/base/c/b> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "6" .
+<http://example.com/base/e/a> <http://example.com/ns#with> <http://example.com/base/c/a> .
+<http://example.com/base/c/c> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "9" .
+<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "1" .
+<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "3" .
+<http://example.com/base/c/b> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "4" .
+<http://example.com/base/e/b> <http://example.com/ns#with> <http://example.com/base/c/b> .
+<http://example.com/base/c/b> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
+<http://example.com/base/c/b> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "5" .
+
+
+

9. RMLTC-CC-0002-List

+

Title: Generate a named rdf:List as an object

+

Description: Tests if a named rdf:List is generated as an object

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0002-List/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/>.
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+@prefix ex:  <http://example.com/ns#>.
+
+<http://example.com/base#TM> a rml:TriplesMap;
+    rml:logicalSource [
+        rml:source _:b738439 ;
+        rml:referenceFormulation rml:JSONPath ;
+        rml:iterator "$.*" ;
+    ] ;
+
+    rml:subjectMap [
+        rml:template "e/{$.id}" ;
+    ] ;
+
+    rml:predicateObjectMap [
+        rml:predicate ex:with ;
+        rml:objectMap [
+            rml:template "c/{$.id}" ;
+            rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
+            rml:gatherAs rdf:List ;
+        ] ;
+    ] ;
+.
+
+_:b738439 a rml:RelativePathSource ;
+    rml:path "data.json" .
+
+

Output

+
_:nb73dd869d6bb47a5b865ee632fe27453b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nb73dd869d6bb47a5b865ee632fe27453b2 .
+<http://example.com/base/e/c> <http://example.com/ns#with> <http://example.com/base/c/c> .
+<http://example.com/base/c/c> <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "7" .
+_:nb73dd869d6bb47a5b865ee632fe27453b5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "8" .
+_:nb73dd869d6bb47a5b865ee632fe27453b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nb73dd869d6bb47a5b865ee632fe27453b4 .
+_:nb73dd869d6bb47a5b865ee632fe27453b6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+<http://example.com/base/e/a> <http://example.com/ns#with> <http://example.com/base/c/a> .
+_:nb73dd869d6bb47a5b865ee632fe27453b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "5" .
+<http://example.com/base/c/b> <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nb73dd869d6bb47a5b865ee632fe27453b3 .
+_:nb73dd869d6bb47a5b865ee632fe27453b4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "6" .
+_:nb73dd869d6bb47a5b865ee632fe27453b4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+_:nb73dd869d6bb47a5b865ee632fe27453b5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nb73dd869d6bb47a5b865ee632fe27453b6 .
+_:nb73dd869d6bb47a5b865ee632fe27453b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+_:nb73dd869d6bb47a5b865ee632fe27453b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
+_:nb73dd869d6bb47a5b865ee632fe27453b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" .
+<http://example.com/base/c/b> <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "4" .
+<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nb73dd869d6bb47a5b865ee632fe27453b1 .
+<http://example.com/base/c/c> <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nb73dd869d6bb47a5b865ee632fe27453b5 .
+_:nb73dd869d6bb47a5b865ee632fe27453b6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "9" .
+<http://example.com/base/e/b> <http://example.com/ns#with> <http://example.com/base/c/b> .
+<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
+
+
+

10. RMLTC-CC-0003-EB

+

Title: Allow the generation of empty bags

+

Description: Tests if the use of rml:allowEmptyListAndContainer yields an empty bag.

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0003-EB/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/>.
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+@prefix ex:  <http://example.com/ns#>.
+
+<http://example.com/base#TM> a rml:TriplesMap;
+    rml:logicalSource [
+        rml:source _:b738439 ;
+        rml:referenceFormulation rml:JSONPath ;
+        rml:iterator "$.*" ;
+    ] ;
+
+    rml:subjectMap [
+        rml:template "e/{$.id}" ;
+    ] ;
+
+    rml:predicateObjectMap [
+        rml:predicate ex:with ;
+        rml:objectMap [
+            rml:allowEmptyListAndContainer true ;
+            rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
+            rml:gatherAs rdf:Bag ;
+        ] ;
+    ] ;
+.
+
+_:b738439 a rml:RelativePathSource ;
+    rml:path "data.json" .
+
+

Output

+
_:nfecac3cfe48c4afa99539cc809138e96b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
+<http://example.com/base/e/a> <http://example.com/ns#with> _:nfecac3cfe48c4afa99539cc809138e96b1 .
+_:nfecac3cfe48c4afa99539cc809138e96b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
+_:nfecac3cfe48c4afa99539cc809138e96b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "1" .
+<http://example.com/base/e/b> <http://example.com/ns#with> _:nfecac3cfe48c4afa99539cc809138e96b2 .
+_:nfecac3cfe48c4afa99539cc809138e96b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "2" .
+_:nfecac3cfe48c4afa99539cc809138e96b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "3" .
+
+
+

11. RMLTC-CC-0003-EL

+

Title: Allow the generation of empty lists

+

Description: Tests if the use of rml:allowEmptyListAndContainer yields an empty list.

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0003-EL/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/>.
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+@prefix ex:  <http://example.com/ns#>.
+
+<http://example.com/base#TM> a rml:TriplesMap;
+    rml:logicalSource [
+        rml:source _:b738439 ;
+        rml:referenceFormulation rml:JSONPath ;
+        rml:iterator "$.*" ;
+    ] ;
+
+    rml:subjectMap [
+        rml:template "e/{$.id}" ;
+    ] ;
+
+    rml:predicateObjectMap [
+        rml:predicate ex:with ;
+        rml:objectMap [
+            rml:allowEmptyListAndContainer true ;
+            rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
+            rml:gatherAs rdf:List ;
+        ] ;
+    ] ;
+.
+
+_:b738439 a rml:RelativePathSource ;
+    rml:path "data.json" .
+
+

Output

+
_:n302eecc856b44ed5b76965d9be2f5213b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+<http://example.com/base/e/b> <http://example.com/ns#with> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+_:n302eecc856b44ed5b76965d9be2f5213b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n302eecc856b44ed5b76965d9be2f5213b3 .
+_:n302eecc856b44ed5b76965d9be2f5213b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
+_:n302eecc856b44ed5b76965d9be2f5213b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" .
+_:n302eecc856b44ed5b76965d9be2f5213b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n302eecc856b44ed5b76965d9be2f5213b2 .
+<http://example.com/base/e/a> <http://example.com/ns#with> _:n302eecc856b44ed5b76965d9be2f5213b1 .
+_:n302eecc856b44ed5b76965d9be2f5213b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
+
+
+

12. RMLTC-CC-0003-EL-BN

+

Title: Allow the generation of empty lists identified by blank node identifiers.

+

Description: Tests if the use of rml:allowEmptyListAndContainer yields an empty list. The lists are identified by a blank node identifier generated in the mapping.

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0003-EL-BN/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/>.
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+@prefix ex:  <http://example.com/ns#>.
+
+<http://example.com/base#TM> a rml:TriplesMap;
+    rml:logicalSource [
+        rml:source _:b738439 ;
+        rml:referenceFormulation rml:JSONPath ;
+        rml:iterator "$.*" ;
+    ] ;
+
+    rml:subjectMap [
+        rml:template "e/{$.id}" ;
+    ] ;
+
+    rml:predicateObjectMap [
+        rml:predicate ex:with ;
+        rml:objectMap [
+            rml:template "c/{$.id}" ; rml:termType rml:BlankNode ;
+            rml:allowEmptyListAndContainer true ;
+            rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
+            rml:gatherAs rdf:List ;
+        ] ;
+    ] ;
+.
+
+_:b738439 a rml:RelativePathSource ;
+    rml:path "data.json" .
+
+

Output

+
_:n302eecc856b44ed5b76965d9be2f5213b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+<http://example.com/base/e/b> <http://example.com/ns#with> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+_:n302eecc856b44ed5b76965d9be2f5213b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n302eecc856b44ed5b76965d9be2f5213b3 .
+_:n302eecc856b44ed5b76965d9be2f5213b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
+_:n302eecc856b44ed5b76965d9be2f5213b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" .
+_:n302eecc856b44ed5b76965d9be2f5213b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n302eecc856b44ed5b76965d9be2f5213b2 .
+<http://example.com/base/e/a> <http://example.com/ns#with> _:n302eecc856b44ed5b76965d9be2f5213b1 .
+_:n302eecc856b44ed5b76965d9be2f5213b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
+
+
+

13. RMLTC-CC-0003-EL-Named

+

Title: Allow the generation of empty lists identified by IRIs.

+

Description: Tests if the use of rml:allowEmptyListAndContainer yields an empty list. The lists are identified by a IRI generated in the mapping.

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0003-EL-Named/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/>.
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+@prefix ex:  <http://example.com/ns#>.
+
+<http://example.com/base#TM> a rml:TriplesMap;
+    rml:logicalSource [
+        rml:source _:b738439 ;
+        rml:referenceFormulation rml:JSONPath ;
+        rml:iterator "$.*" ;
+    ] ;
+
+    rml:subjectMap [
+        rml:template "e/{$.id}" ;
+    ] ;
+
+    rml:predicateObjectMap [
+        rml:predicate ex:with ;
+        rml:objectMap [
+            rml:template "c/{$.id}" ;
+            rml:allowEmptyListAndContainer true ;
+            rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
+            rml:gatherAs rdf:List ;
+        ] ;
+    ] ;
+.
+
+_:b738439 a rml:RelativePathSource ;
+    rml:path "data.json" .
+
+

Output

+
_:n302eecc856b44ed5b76965d9be2f5213b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+<http://example.com/base/e/b> <http://example.com/ns#with> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+_:n302eecc856b44ed5b76965d9be2f5213b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n302eecc856b44ed5b76965d9be2f5213b3 .
+_:n302eecc856b44ed5b76965d9be2f5213b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
+_:n302eecc856b44ed5b76965d9be2f5213b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" .
+<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n302eecc856b44ed5b76965d9be2f5213b2 .
+<http://example.com/base/e/a> <http://example.com/ns#with> <http://example.com/base/c/a> .
+<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
+
+
+

14. RMLTC-CC-0003-NEB

+

Title: Empty bags are not generated

+

Description: Tests if empty containers are not generated (expected default behavior).

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0003-NEB/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/>.
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+@prefix ex:  <http://example.com/ns#>.
+
+<http://example.com/base#TM> a rml:TriplesMap;
+    rml:logicalSource [
+        rml:source _:b738439 ;
+        rml:referenceFormulation rml:JSONPath ;
+        rml:iterator "$.*" ;
+    ] ;
+
+    rml:subjectMap [
+        rml:template "e/{$.id}" ;
+    ] ;
+
+    rml:predicateObjectMap [
+        rml:predicate ex:with ;
+        rml:objectMap [
+            rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
+            rml:gatherAs rdf:Bag ;
+        ] ;
+    ] ;
+.
+
+_:b738439 a rml:RelativePathSource ;
+    rml:path "data.json" .
+
+

Output

+
<http://example.com/base/e/a> <http://example.com/ns#with> _:n2bd72de9c571444081890e41009d92d4b1 .
+_:n2bd72de9c571444081890e41009d92d4b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "3" .
+_:n2bd72de9c571444081890e41009d92d4b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
+_:n2bd72de9c571444081890e41009d92d4b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "2" .
+_:n2bd72de9c571444081890e41009d92d4b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "1" .
+
+
+

15. RMLTC-CC-0003-NEL

+

Title: Empty lists are not generated

+

Description: Tests if empty lists are not generated (expected default behavior).

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0003-NEL/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/>.
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+@prefix ex:  <http://example.com/ns#>.
+
+<http://example.com/base#TM> a rml:TriplesMap;
+    rml:logicalSource [
+        rml:source _:b738439 ;
+        rml:referenceFormulation rml:JSONPath ;
+        rml:iterator "$.*" ;
+    ] ;
+
+    rml:subjectMap [
+        rml:template "e/{$.id}" ;
+    ] ;
+
+    rml:predicateObjectMap [
+        rml:predicate ex:with ;
+        rml:objectMap [
+            rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
+            rml:gatherAs rdf:List ;
+        ] ;
+    ] ;
+.
+
+_:b738439 a rml:RelativePathSource ;
+    rml:path "data.json" .
+
+

Output

+
_:n434c2c54e09e4a259604ba1188ce038fb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n434c2c54e09e4a259604ba1188ce038fb2 .
+_:n434c2c54e09e4a259604ba1188ce038fb3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+_:n434c2c54e09e4a259604ba1188ce038fb2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
+<http://example.com/base/e/a> <http://example.com/ns#with> _:n434c2c54e09e4a259604ba1188ce038fb1 .
+_:n434c2c54e09e4a259604ba1188ce038fb2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n434c2c54e09e4a259604ba1188ce038fb3 .
+_:n434c2c54e09e4a259604ba1188ce038fb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
+_:n434c2c54e09e4a259604ba1188ce038fb3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" .
+
+
+

16. RMLTC-CC-0003-NELb

+

Title: Empty lists are not generated II

+

Description: Tests if empty lists are not generated (expected default behavior). This test cases uses the predicate rml:allowEmptyListAndContainer.

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0003-NELb/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/>.
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+@prefix ex:  <http://example.com/ns#>.
+
+<http://example.com/base#TM> a rml:TriplesMap;
+    rml:logicalSource [
+        rml:source _:b738439 ;
+        rml:referenceFormulation rml:JSONPath ;
+        rml:iterator "$.*" ;
+    ] ;
+
+    rml:subjectMap [
+        rml:template "e/{$.id}" ;
+    ] ;
+
+    rml:predicateObjectMap [
+        rml:predicate ex:with ;
+        rml:objectMap [
+            rml:allowEmptyListAndContainer false ;
+            rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
+            rml:gatherAs rdf:List ;
+        ] ;
+    ] ;
+.
+
+_:b738439 a rml:RelativePathSource ;
+    rml:path "data.json" .
+
+

Output

+
_:n434c2c54e09e4a259604ba1188ce038fb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n434c2c54e09e4a259604ba1188ce038fb2 .
+_:n434c2c54e09e4a259604ba1188ce038fb3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+_:n434c2c54e09e4a259604ba1188ce038fb2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
+<http://example.com/base/e/a> <http://example.com/ns#with> _:n434c2c54e09e4a259604ba1188ce038fb1 .
+_:n434c2c54e09e4a259604ba1188ce038fb2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n434c2c54e09e4a259604ba1188ce038fb3 .
+_:n434c2c54e09e4a259604ba1188ce038fb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
+_:n434c2c54e09e4a259604ba1188ce038fb3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" .
+
+
+

17. RMLTC-CC-0004-SM1

+

Title: GatherMap in subject map (list)

+

Description: Tests if the use of a gather map in the subject map is supported. This test generates a list.

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0004-SM1/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/>.
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+@prefix ex:  <http://example.com/ns#>.
+
+<http://example.com/base#TM> a rml:TriplesMap;
+    rml:logicalSource [
+        rml:source _:b738439 ;
+        rml:referenceFormulation rml:JSONPath ;
+        rml:iterator "$.*" ;
+    ] ;
+
+    rml:subjectMap [
+        rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
+        rml:gatherAs rdf:List ;
+    ] ;
+
+    rml:predicateObjectMap [
+        rml:predicate ex:createdBy ;
+        rml:object ex:JohnDoe ;
+    ] ;
+.
+
+_:b738439 a rml:RelativePathSource ;
+    rml:path "data.json" .
+
+

Output

+
_:n302eecc856b44ed5b76965d9be2f5213b1 <http://example.com/ns#createdBy> <http://example.com/ns#JohnDoe> .
+_:n302eecc856b44ed5b76965d9be2f5213b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
+_:n302eecc856b44ed5b76965d9be2f5213b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n302eecc856b44ed5b76965d9be2f5213b2 .
+_:n302eecc856b44ed5b76965d9be2f5213b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
+_:n302eecc856b44ed5b76965d9be2f5213b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n302eecc856b44ed5b76965d9be2f5213b3 .
+_:n302eecc856b44ed5b76965d9be2f5213b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" .
+_:n302eecc856b44ed5b76965d9be2f5213b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+_:n1d393f12e993411498da676131f81ca4b1 <http://example.com/ns#createdBy> <http://example.com/ns#JohnDoe> .
+_:n1d393f12e993411498da676131f81ca4b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "4" .
+_:n1d393f12e993411498da676131f81ca4b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n1d393f12e993411498da676131f81ca4b2 .
+_:n1d393f12e993411498da676131f81ca4b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "5" .
+_:n1d393f12e993411498da676131f81ca4b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n1d393f12e993411498da676131f81ca4b3 .
+_:n1d393f12e993411498da676131f81ca4b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "6" .
+_:n1d393f12e993411498da676131f81ca4b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+
+
+

18. RMLTC-CC-0004-SM2

+

Title: GatherMap in subject map (list)

+

Description: Tests if the use of a gather map in the subject map is supported. This test has no predicate-object maps and no class declarations in the subject map. It still needs to generate triples as the lists consists of at least one cons-pair.

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0004-SM2/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/>.
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+@prefix ex:  <http://example.com/ns#>.
+
+<http://example.com/base#TM> a rml:TriplesMap;
+    rml:logicalSource [
+        rml:source _:b738439 ;
+        rml:referenceFormulation rml:JSONPath ;
+        rml:iterator "$.*" ;
+    ] ;
+
+    rml:subjectMap [
+        rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
+        rml:gatherAs rdf:List ;
+    ] ;
+.
+
+_:b738439 a rml:RelativePathSource ;
+    rml:path "data.json" .
+
+

Output

+
_:n302eecc856b44ed5b76965d9be2f5213b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
+_:n302eecc856b44ed5b76965d9be2f5213b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n302eecc856b44ed5b76965d9be2f5213b2 .
+_:n302eecc856b44ed5b76965d9be2f5213b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
+_:n302eecc856b44ed5b76965d9be2f5213b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n302eecc856b44ed5b76965d9be2f5213b3 .
+_:n302eecc856b44ed5b76965d9be2f5213b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" .
+_:n302eecc856b44ed5b76965d9be2f5213b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+_:n1d393f12e993411498da676131f81ca4b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "4" .
+_:n1d393f12e993411498da676131f81ca4b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n1d393f12e993411498da676131f81ca4b2 .
+_:n1d393f12e993411498da676131f81ca4b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "5" .
+_:n1d393f12e993411498da676131f81ca4b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n1d393f12e993411498da676131f81ca4b3 .
+_:n1d393f12e993411498da676131f81ca4b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "6" .
+_:n1d393f12e993411498da676131f81ca4b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+
+
+

19. RMLTC-CC-0004-SM3

+

Title: GatherMap in subject map (list)

+

Description: Tests if the use of a gather map in the subject map is supported. This test has no predicate-object maps and no class declarations in the subject map. Only one list needs to be generated as the other has no values and we only retain non-empty lists.

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0004-SM3/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/>.
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+@prefix ex:  <http://example.com/ns#>.
+
+<http://example.com/base#TM> a rml:TriplesMap;
+    rml:logicalSource [
+        rml:source _:b738439 ;
+        rml:referenceFormulation rml:JSONPath ;
+        rml:iterator "$.*" ;
+    ] ;
+
+    rml:subjectMap [
+        rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
+        rml:gatherAs rdf:List ;
+    ] ;
+.
+
+_:b738439 a rml:RelativePathSource ;
+    rml:path "data.json" .
+
+

Output

+
_:n648f8cf4c58149e8a0feea26fb2a5b5bb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
+_:n648f8cf4c58149e8a0feea26fb2a5b5bb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n648f8cf4c58149e8a0feea26fb2a5b5bb2 .
+_:n648f8cf4c58149e8a0feea26fb2a5b5bb3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" .
+_:n648f8cf4c58149e8a0feea26fb2a5b5bb2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n648f8cf4c58149e8a0feea26fb2a5b5bb3 .
+_:n648f8cf4c58149e8a0feea26fb2a5b5bb2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
+_:n648f8cf4c58149e8a0feea26fb2a5b5bb3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+
+
+

20. RMLTC-CC-0004-SM4

+

Title: GatherMap in subject map (bag)

+

Description: Tests if the use of a gather map in the subject map is supported. This test generates a bag.

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0004-SM4/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/>.
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+@prefix ex:  <http://example.com/ns#>.
+
+<http://example.com/base#TM> a rml:TriplesMap;
+    rml:logicalSource [
+        rml:source _:b738439 ;
+        rml:referenceFormulation rml:JSONPath ;
+        rml:iterator "$.*" ;
+    ] ;
+
+    rml:subjectMap [
+        rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
+        rml:gatherAs rdf:Bag ;
+    ] ;
+
+    rml:predicateObjectMap [
+        rml:predicate ex:createdBy ;
+        rml:object ex:JohnDoe ;
+    ] ;
+.
+
+_:b738439 a rml:RelativePathSource ;
+    rml:path "data.json" .
+
+

Output

+
_:n1d393f12e993411498da676131f81ca4b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "2" .
+_:n1d393f12e993411498da676131f81ca4b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "5" .
+_:n1d393f12e993411498da676131f81ca4b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "1" .
+_:n1d393f12e993411498da676131f81ca4b2 <http://example.com/ns#createdBy> <http://example.com/ns#JohnDoe> .
+_:n1d393f12e993411498da676131f81ca4b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
+_:n1d393f12e993411498da676131f81ca4b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "3" .
+_:n1d393f12e993411498da676131f81ca4b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "4" .
+_:n1d393f12e993411498da676131f81ca4b1 <http://example.com/ns#createdBy> <http://example.com/ns#JohnDoe> .
+_:n1d393f12e993411498da676131f81ca4b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
+_:n1d393f12e993411498da676131f81ca4b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "6" .
+
+
+

21. RMLTC-CC-0004-SM5

+

Title: GatherMap in subject map (bag)

+

Description: Tests if the use of a gather map in the subject map is supported. This test has no predicate-object maps and no class declarations in the subject map. It should generate a non-empty bag and an empty bag. The reason being that a container has at least one triple ; it's type (bag, seq, or alt).

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0004-SM5/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/>.
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+@prefix ex:  <http://example.com/ns#>.
+
+<http://example.com/base#TM> a rml:TriplesMap;
+    rml:logicalSource [
+        rml:source _:b738439 ;
+        rml:referenceFormulation rml:JSONPath ;
+        rml:iterator "$.*" ;
+    ] ;
+
+    rml:subjectMap [
+        rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
+        rml:gatherAs rdf:Bag ;
+    ] ;
+.
+
+_:b738439 a rml:RelativePathSource ;
+    rml:path "data.json" .
+
+

Output

+
_:ne32066984b71404a953025d001cd3cdfb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
+_:ne32066984b71404a953025d001cd3cdfb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "2" .
+_:ne32066984b71404a953025d001cd3cdfb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "1" .
+_:ne32066984b71404a953025d001cd3cdfb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "3" .
+
+
+

22. RMLTC-CC-0005-App1

+

Title: Append values of multiple term maps

+

Description: Tests appending of values from multiple term maps in an gather map. This test covers the case where all sets of values are non-empty.

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0005-App1/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/>.
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+@prefix ex:  <http://example.com/ns#>.
+
+<http://example.com/base#TM> a rml:TriplesMap;
+    rml:logicalSource [
+        rml:source _:b738439 ;
+        rml:referenceFormulation rml:JSONPath ;
+        rml:iterator "$.*" ;
+    ] ;
+
+    rml:subjectMap [
+        rml:template "e/{$.id}" ;
+    ] ;
+
+    rml:predicateObjectMap [
+        rml:predicate ex:with ;
+        rml:objectMap [
+            rml:gather ( [ rml:reference "$.v1.*" ; ] [ rml:reference "$.v2.*" ; ] ) ;
+            rml:gatherAs rdf:List ;
+        ] ;
+    ] ;
+.
+
+_:b738439 a rml:RelativePathSource ;
+    rml:path "data.json" .
+
+

Output

+
<http://example.com/base/e/a> <http://example.com/ns#with> _:n1ee4a5a2b1344422919d171ab2cd6c39b1 .
+_:n1ee4a5a2b1344422919d171ab2cd6c39b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
+_:n1ee4a5a2b1344422919d171ab2cd6c39b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n1ee4a5a2b1344422919d171ab2cd6c39b2 .
+_:n1ee4a5a2b1344422919d171ab2cd6c39b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
+_:n1ee4a5a2b1344422919d171ab2cd6c39b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n1ee4a5a2b1344422919d171ab2cd6c39b4 .
+_:n1ee4a5a2b1344422919d171ab2cd6c39b4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "a" .
+_:n1ee4a5a2b1344422919d171ab2cd6c39b4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n1ee4a5a2b1344422919d171ab2cd6c39b5 .
+_:n1ee4a5a2b1344422919d171ab2cd6c39b5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "b" .
+_:n1ee4a5a2b1344422919d171ab2cd6c39b5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+<http://example.com/base/e/b> <http://example.com/ns#with> _:n1ee4a5a2b1344422919d171ab2cd6c39b6 .
+_:n1ee4a5a2b1344422919d171ab2cd6c39b6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" .
+_:n1ee4a5a2b1344422919d171ab2cd6c39b6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n1ee4a5a2b1344422919d171ab2cd6c39b7 .
+_:n1ee4a5a2b1344422919d171ab2cd6c39b7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "4" .
+_:n1ee4a5a2b1344422919d171ab2cd6c39b7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n1ee4a5a2b1344422919d171ab2cd6c39b8 .
+_:n1ee4a5a2b1344422919d171ab2cd6c39b8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "c" .
+_:n1ee4a5a2b1344422919d171ab2cd6c39b8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+
+
+

23. RMLTC-CC-0005-App2

+

Title: Append values of multiple term maps

+

Description: Tests appending of values from multiple term maps in an iteration. In this example, one of the arrays is empty and the expected behavior is to concatinate a list with the empty list.

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0005-App2/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/>.
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+@prefix ex:  <http://example.com/ns#>.
+
+<http://example.com/base#TM> a rml:TriplesMap;
+    rml:logicalSource [
+        rml:source _:b738439 ;
+        rml:referenceFormulation rml:JSONPath ;
+        rml:iterator "$.*" ;
+    ] ;
+
+    rml:subjectMap [
+        rml:template "e/{$.id}" ;
+    ] ;
+
+    rml:predicateObjectMap [
+        rml:predicate ex:with ;
+        rml:objectMap [
+            rml:gather ( [ rml:reference "$.v1.*" ; ] [ rml:reference "$.v2.*" ; ] ) ;
+            rml:gatherAs rdf:List ;
+        ] ;
+    ] ;
+.
+
+_:b738439 a rml:RelativePathSource ;
+    rml:path "data.json" .
+
+

Output

+
_:n1d9b8ef217cb44f299a062d746116deab1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n1d9b8ef217cb44f299a062d746116deab2 .
+_:n1d9b8ef217cb44f299a062d746116deab5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "b" .
+_:n1d9b8ef217cb44f299a062d746116deab4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n1d9b8ef217cb44f299a062d746116deab5 .
+_:n1d9b8ef217cb44f299a062d746116deab3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n1d9b8ef217cb44f299a062d746116deab4 .
+_:n1d9b8ef217cb44f299a062d746116deab7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "5" .
+_:n1d9b8ef217cb44f299a062d746116deab2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
+_:n1d9b8ef217cb44f299a062d746116deab8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "6" .
+_:n1d9b8ef217cb44f299a062d746116deab8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+_:n1d9b8ef217cb44f299a062d746116deab3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" .
+_:n1d9b8ef217cb44f299a062d746116deab4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "a" .
+_:n1d9b8ef217cb44f299a062d746116deab5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+_:n1d9b8ef217cb44f299a062d746116deab2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n1d9b8ef217cb44f299a062d746116deab3 .
+_:n1d9b8ef217cb44f299a062d746116deab1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
+<http://example.com/base/e/a> <http://example.com/ns#with> _:n1d9b8ef217cb44f299a062d746116deab1 .
+<http://example.com/base/e/b> <http://example.com/ns#with> _:n1d9b8ef217cb44f299a062d746116deab6 .
+_:n1d9b8ef217cb44f299a062d746116deab7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n1d9b8ef217cb44f299a062d746116deab8 .
+_:n1d9b8ef217cb44f299a062d746116deab6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n1d9b8ef217cb44f299a062d746116deab7 .
+_:n1d9b8ef217cb44f299a062d746116deab6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "4" .
+
+
+

24. RMLTC-CC-0005-Car1

+

Title: Cartesian product of values from multiple term maps of a gather map.

+

Description: Tests generating the Cartesian product of values from multiple term maps in a gather map. This test covers the case where all sets of values are non-empty.

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0005-Car1/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/>.
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+@prefix ex:  <http://example.com/ns#>.
+
+<http://example.com/base#TM> a rml:TriplesMap;
+    rml:logicalSource [
+        rml:source _:b738439 ;
+        rml:referenceFormulation rml:JSONPath ;
+        rml:iterator "$.*" ;
+    ] ;
+
+    rml:subjectMap [
+        rml:template "e/{$.id}" ;
+    ] ;
+
+    rml:predicateObjectMap [
+        rml:predicate ex:with ;
+        rml:objectMap [
+            rml:gather ( [ rml:reference "$.v1.*" ; ] [ rml:reference "$.v2.*" ; ] ) ;
+            rml:gatherAs rdf:List ;
+            rml:strategy rml:cartesianProduct ;
+        ] ;
+    ] ;
+.
+
+_:b738439 a rml:RelativePathSource ;
+    rml:path "data.json" .
+
+

Output

+
<http://example.com/base/e/a> <http://example.com/ns#with> _:nfc398e5692654ca98dfb3fb5432d277cb1 .
+_:nfc398e5692654ca98dfb3fb5432d277cb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
+_:nfc398e5692654ca98dfb3fb5432d277cb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nfc398e5692654ca98dfb3fb5432d277cb2 .
+_:nfc398e5692654ca98dfb3fb5432d277cb2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+_:nfc398e5692654ca98dfb3fb5432d277cb2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "a" .
+
+<http://example.com/base/e/a> <http://example.com/ns#with> _:nfc398e5692654ca98dfb3fb5432d277cb3 .
+_:nfc398e5692654ca98dfb3fb5432d277cb3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
+_:nfc398e5692654ca98dfb3fb5432d277cb3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nfc398e5692654ca98dfb3fb5432d277cb4 .
+_:nfc398e5692654ca98dfb3fb5432d277cb4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "b" .
+_:nfc398e5692654ca98dfb3fb5432d277cb4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+
+<http://example.com/base/e/a> <http://example.com/ns#with> _:nfc398e5692654ca98dfb3fb5432d277cb5 .
+_:nfc398e5692654ca98dfb3fb5432d277cb5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
+_:nfc398e5692654ca98dfb3fb5432d277cb5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nfc398e5692654ca98dfb3fb5432d277cb6 .
+_:nfc398e5692654ca98dfb3fb5432d277cb6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "a" .
+_:nfc398e5692654ca98dfb3fb5432d277cb6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+
+<http://example.com/base/e/a> <http://example.com/ns#with> _:nfc398e5692654ca98dfb3fb5432d277cb7 .
+_:nfc398e5692654ca98dfb3fb5432d277cb7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
+_:nfc398e5692654ca98dfb3fb5432d277cb7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nfc398e5692654ca98dfb3fb5432d277cb8 .
+_:nfc398e5692654ca98dfb3fb5432d277cb8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "b" .
+_:nfc398e5692654ca98dfb3fb5432d277cb8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+
+<http://example.com/base/e/b> <http://example.com/ns#with> _:nfc398e5692654ca98dfb3fb5432d277cb9 .
+_:nfc398e5692654ca98dfb3fb5432d277cb9 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" .
+_:nfc398e5692654ca98dfb3fb5432d277cb9 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nfc398e5692654ca98dfb3fb5432d277cb10 .
+_:nfc398e5692654ca98dfb3fb5432d277cb10 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "c" .
+_:nfc398e5692654ca98dfb3fb5432d277cb10 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+
+<http://example.com/base/e/b> <http://example.com/ns#with> _:nfc398e5692654ca98dfb3fb5432d277cb11 .
+_:nfc398e5692654ca98dfb3fb5432d277cb11 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "4" .
+_:nfc398e5692654ca98dfb3fb5432d277cb11 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nfc398e5692654ca98dfb3fb5432d277cb12 .
+_:nfc398e5692654ca98dfb3fb5432d277cb12 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "c" .
+_:nfc398e5692654ca98dfb3fb5432d277cb12 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+
+
+

25. RMLTC-CC-0005-Car2

+

Title: Cartesian product of values from multiple term maps of a gather map.

+

Description: Tests generating the Cartesian product of values from multiple term maps in a gather map. This test covers the case where one of the sets is empty. The Cartesian product of a set with an empty set is empty. This entry should thus not yield a list.

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0005-Car2/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/>.
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+@prefix ex:  <http://example.com/ns#>.
+
+<http://example.com/base#TM> a rml:TriplesMap;
+    rml:logicalSource [
+        rml:source _:b738439 ;
+        rml:referenceFormulation rml:JSONPath ;
+        rml:iterator "$.*" ;
+    ] ;
+
+    rml:subjectMap [
+        rml:template "e/{$.id}" ;
+    ] ;
+
+    rml:predicateObjectMap [
+        rml:predicate ex:with ;
+        rml:objectMap [
+            rml:gather ( [ rml:reference "$.v1.*" ; ] [ rml:reference "$.v2.*" ; ] ) ;
+            rml:gatherAs rdf:List ;
+            rml:strategy rml:cartesianProduct ;
+        ] ;
+    ] ;
+.
+
+_:b738439 a rml:RelativePathSource ;
+    rml:path "data.json" .
+
+

Output

+
<http://example.com/base/e/a> <http://example.com/ns#with> _:nfc398e5692654ca98dfb3fb5432d277cb1 .
+_:nfc398e5692654ca98dfb3fb5432d277cb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
+_:nfc398e5692654ca98dfb3fb5432d277cb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nfc398e5692654ca98dfb3fb5432d277cb2 .
+_:nfc398e5692654ca98dfb3fb5432d277cb2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+_:nfc398e5692654ca98dfb3fb5432d277cb2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "a" .
+
+<http://example.com/base/e/a> <http://example.com/ns#with> _:nfc398e5692654ca98dfb3fb5432d277cb3 .
+_:nfc398e5692654ca98dfb3fb5432d277cb3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
+_:nfc398e5692654ca98dfb3fb5432d277cb3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nfc398e5692654ca98dfb3fb5432d277cb4 .
+_:nfc398e5692654ca98dfb3fb5432d277cb4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "b" .
+_:nfc398e5692654ca98dfb3fb5432d277cb4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+
+<http://example.com/base/e/a> <http://example.com/ns#with> _:nfc398e5692654ca98dfb3fb5432d277cb5 .
+_:nfc398e5692654ca98dfb3fb5432d277cb5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
+_:nfc398e5692654ca98dfb3fb5432d277cb5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nfc398e5692654ca98dfb3fb5432d277cb6 .
+_:nfc398e5692654ca98dfb3fb5432d277cb6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "a" .
+_:nfc398e5692654ca98dfb3fb5432d277cb6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+
+<http://example.com/base/e/a> <http://example.com/ns#with> _:nfc398e5692654ca98dfb3fb5432d277cb7 .
+_:nfc398e5692654ca98dfb3fb5432d277cb7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
+_:nfc398e5692654ca98dfb3fb5432d277cb7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nfc398e5692654ca98dfb3fb5432d277cb8 .
+_:nfc398e5692654ca98dfb3fb5432d277cb8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "b" .
+_:nfc398e5692654ca98dfb3fb5432d277cb8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+
+
+

26. RMLTC-CC-0006-IT0

+

Title: Gather values across iterations to create a collection.

+

Description: When no template, constant, or reference is given to a gather map, then each iteration yields a different collection.

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0006-IT0/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/>.
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+@prefix ex:  <http://example.com/ns#>.
+
+<http://example.com/base#TM> a rml:TriplesMap;
+    rml:logicalSource [
+        rml:source _:b738439 ;
+        rml:referenceFormulation rml:JSONPath ;
+        rml:iterator "$.*" ;
+    ] ;
+
+    rml:subjectMap [
+        rml:template "e/{$.id}" ;
+    ] ;
+
+    rml:predicateObjectMap [
+        rml:predicate ex:with ;
+        rml:objectMap [
+            rml:gather ( [ rml:reference "$.v1.*" ; ] ) ;
+            rml:gatherAs rdf:List ;
+        ] ;
+    ] ;
+.
+
+_:b738439 a rml:RelativePathSource ;
+    rml:path "data.json" .
+
+

Output

+
<http://example.com/base/e/a> <http://example.com/ns#with> _:n9d785cd672d3484cb5d9fd831e6dfc07b1 .
+_:n9d785cd672d3484cb5d9fd831e6dfc07b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
+_:n9d785cd672d3484cb5d9fd831e6dfc07b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n9d785cd672d3484cb5d9fd831e6dfc07b2 .
+_:n9d785cd672d3484cb5d9fd831e6dfc07b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
+_:n9d785cd672d3484cb5d9fd831e6dfc07b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+
+<http://example.com/base/e/b> <http://example.com/ns#with> _:n9d785cd672d3484cb5d9fd831e6dfc07b5 .
+_:n9d785cd672d3484cb5d9fd831e6dfc07b5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" .
+_:n9d785cd672d3484cb5d9fd831e6dfc07b5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n9d785cd672d3484cb5d9fd831e6dfc07b6 .
+_:n9d785cd672d3484cb5d9fd831e6dfc07b6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "4" .
+_:n9d785cd672d3484cb5d9fd831e6dfc07b6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+
+<http://example.com/base/e/a> <http://example.com/ns#with> _:n9d785cd672d3484cb5d9fd831e6dfc07b3 .
+_:n9d785cd672d3484cb5d9fd831e6dfc07b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "5" .
+_:n9d785cd672d3484cb5d9fd831e6dfc07b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n9d785cd672d3484cb5d9fd831e6dfc07b4 .
+_:n9d785cd672d3484cb5d9fd831e6dfc07b4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "6" .
+_:n9d785cd672d3484cb5d9fd831e6dfc07b4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+
+
+

27. RMLTC-CC-0006-IT1

+

Title: Gather values across iterations to create a collection.

+

Description: When using a template, constant, or reference for a gather map, this tests determines whether the values are correctly appended to the list. The natural order of the term maps inside the gather map as well as the iteration are respected. This test covers one term map in the gather map.

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0006-IT1/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/>.
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+@prefix ex:  <http://example.com/ns#>.
+
+<http://example.com/base#TM> a rml:TriplesMap;
+    rml:logicalSource [
+        rml:source _:b738439 ;
+        rml:referenceFormulation rml:JSONPath ;
+        rml:iterator "$.*" ;
+    ] ;
+
+    rml:subjectMap [
+        rml:template "e/{$.id}" ;
+    ] ;
+
+    rml:predicateObjectMap [
+        rml:predicate ex:with ;
+        rml:objectMap [
+            rml:template "c/{$.id}" ;
+            rml:gather ( [ rml:reference "$.v1.*" ; ] ) ;
+            rml:gatherAs rdf:List ;
+        ] ;
+    ] ;
+.
+
+_:b738439 a rml:RelativePathSource ;
+    rml:path "data.json" .
+
+

Output

+
<http://example.com/base/e/a> <http://example.com/ns#with> <http://example.com/base/c/a> .
+<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
+<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nab8f496caee443c5ac19ce3a109f4b22b1 .
+_:nab8f496caee443c5ac19ce3a109f4b22b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
+_:nab8f496caee443c5ac19ce3a109f4b22b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nab8f496caee443c5ac19ce3a109f4b22b2 .
+_:nab8f496caee443c5ac19ce3a109f4b22b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "5" .
+_:nab8f496caee443c5ac19ce3a109f4b22b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nab8f496caee443c5ac19ce3a109f4b22b3 .
+_:nab8f496caee443c5ac19ce3a109f4b22b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "6" .
+_:nab8f496caee443c5ac19ce3a109f4b22b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+
+<http://example.com/base/e/b> <http://example.com/ns#with> <http://example.com/base/c/b> .
+<http://example.com/base/c/b> <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" .
+<http://example.com/base/c/b> <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nab8f496caee443c5ac19ce3a109f4b22b4 .
+_:nab8f496caee443c5ac19ce3a109f4b22b4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "4" .
+_:nab8f496caee443c5ac19ce3a109f4b22b4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+
+
+

28. RMLTC-CC-0006-IT2

+

Title: Gather values across iterations to create a collection.

+

Description: When using a template, constant, or reference for a gather map, this tests determines whether the values are correctly appended to the list. The natural order of the term maps inside the gather map as well as the iteration are respected. This test covers two term maps in the gather map.

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0006-IT2/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/>.
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+@prefix ex:  <http://example.com/ns#>.
+
+<http://example.com/base#TM> a rml:TriplesMap;
+    rml:logicalSource [
+        rml:source _:b738439 ;
+        rml:referenceFormulation rml:JSONPath ;
+        rml:iterator "$.*" ;
+    ] ;
+
+    rml:subjectMap [
+        rml:template "e/{$.id}" ;
+    ] ;
+
+    rml:predicateObjectMap [
+        rml:predicate ex:with ;
+        rml:objectMap [
+            rml:template "c/{$.id}" ;
+            rml:gather ( [ rml:reference "$.v1.*" ; ] [ rml:reference "$.v2.*" ; ] ) ;
+            rml:gatherAs rdf:List ;
+        ] ;
+    ] ;
+.
+
+_:b738439 a rml:RelativePathSource ;
+    rml:path "data.json" .
+
+

Output

+
<http://example.com/base/e/a> <http://example.com/ns#with> <http://example.com/base/c/a> .
+<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
+<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n0cbb21ce98464358963007f95dc35c0ab1 .
+_:n0cbb21ce98464358963007f95dc35c0ab1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
+_:n0cbb21ce98464358963007f95dc35c0ab1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n0cbb21ce98464358963007f95dc35c0ab2 .
+_:n0cbb21ce98464358963007f95dc35c0ab2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "a" .
+_:n0cbb21ce98464358963007f95dc35c0ab2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n0cbb21ce98464358963007f95dc35c0ab3 .
+_:n0cbb21ce98464358963007f95dc35c0ab3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "b" .
+_:n0cbb21ce98464358963007f95dc35c0ab3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n0cbb21ce98464358963007f95dc35c0ab4 .
+_:n0cbb21ce98464358963007f95dc35c0ab4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "5" .
+_:n0cbb21ce98464358963007f95dc35c0ab4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n0cbb21ce98464358963007f95dc35c0ab5 .
+_:n0cbb21ce98464358963007f95dc35c0ab5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "6" .
+_:n0cbb21ce98464358963007f95dc35c0ab5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n0cbb21ce98464358963007f95dc35c0ab6 .
+_:n0cbb21ce98464358963007f95dc35c0ab6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "d" .
+_:n0cbb21ce98464358963007f95dc35c0ab6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n0cbb21ce98464358963007f95dc35c0ab7 .
+_:n0cbb21ce98464358963007f95dc35c0ab7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "e" .
+_:n0cbb21ce98464358963007f95dc35c0ab7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+
+<http://example.com/base/e/b> <http://example.com/ns#with> <http://example.com/base/c/b> .
+<http://example.com/base/c/b> <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" .
+<http://example.com/base/c/b> <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n0cbb21ce98464358963007f95dc35c0ab8 .
+_:n0cbb21ce98464358963007f95dc35c0ab8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "4" .
+_:n0cbb21ce98464358963007f95dc35c0ab8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n0cbb21ce98464358963007f95dc35c0ab9 .
+_:n0cbb21ce98464358963007f95dc35c0ab9 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "c" .
+_:n0cbb21ce98464358963007f95dc35c0ab9 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+
+
+

29. RMLTC-CC-0006-IT3

+

Title: Gather values across iterations to create a container.

+

Description: When no template, constant, or reference is given to a gather map, then each iteration yields a different container.

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0006-IT3/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/>.
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+@prefix ex:  <http://example.com/ns#>.
+
+<http://example.com/base#TM> a rml:TriplesMap;
+    rml:logicalSource [
+        rml:source _:b738439 ;
+        rml:referenceFormulation rml:JSONPath ;
+        rml:iterator "$.*" ;
+    ] ;
+
+    rml:subjectMap [
+        rml:template "e/{$.id}" ;
+    ] ;
+
+    rml:predicateObjectMap [
+        rml:predicate ex:with ;
+        rml:objectMap [
+            rml:gather ( [ rml:reference "$.v1.*" ; ] ) ;
+            rml:gatherAs rdf:Bag ;
+        ] ;
+    ] ;
+.
+
+_:b738439 a rml:RelativePathSource ;
+    rml:path "data.json" .
+
+

Output

+
<http://example.com/base/e/a> <http://example.com/ns#with> _:a .
+_:a <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
+_:a <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "1" .
+_:a <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "2" .
+
+<http://example.com/base/e/b> <http://example.com/ns#with> _:b .
+_:b <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
+_:b <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "3" .
+_:b <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "4" .
+
+<http://example.com/base/e/a> <http://example.com/ns#with> _:c .
+_:c <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
+_:c <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "5" .
+_:c <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "6" .
+
+
+

30. RMLTC-CC-0006-IT4

+

Title: Gather values across iterations to create a container.

+

Description: When using a template, constant, or reference for a gather map, this tests determines whether the values are correctly appended to the container. The natural order of the term maps inside the gather map as well as the iteration are respected. This test covers one term map in the gather map.

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0006-IT4/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/>.
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+@prefix ex:  <http://example.com/ns#>.
+
+<http://example.com/base#TM> a rml:TriplesMap;
+    rml:logicalSource [
+        rml:source _:b738439 ;
+        rml:referenceFormulation rml:JSONPath ;
+        rml:iterator "$.*" ;
+    ] ;
+
+    rml:subjectMap [
+        rml:template "e/{$.id}" ;
+    ] ;
+
+    rml:predicateObjectMap [
+        rml:predicate ex:with ;
+        rml:objectMap [
+            rml:template "c/{$.id}" ;
+            rml:gather ( [ rml:reference "$.v1.*" ; ] ) ;
+            rml:gatherAs rdf:Bag ;
+        ] ;
+    ] ;
+.
+
+_:b738439 a rml:RelativePathSource ;
+    rml:path "data.json" .
+
+

Output

+
<http://example.com/base/e/a> <http://example.com/ns#with> <http://example.com/base/c/a> .
+<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
+<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "1" .
+<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "2" .
+<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "5" .
+<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_4> "6" .
+
+<http://example.com/base/e/b> <http://example.com/ns#with> <http://example.com/base/c/b> .
+<http://example.com/base/c/b> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
+<http://example.com/base/c/b> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "3" .
+<http://example.com/base/c/b> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "4" .
+
+
+

31. RMLTC-CC-0006-IT5

+

Title: Gather values across iterations to create a container.

+

Description: When using a template, constant, or reference for a gather map, this tests determines whether the values are correctly appended to the container. The natural order of the term maps inside the gather map as well as the iteration are respected. This test covers two term maps in the gather map.

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0006-IT5/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/>.
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+@prefix ex:  <http://example.com/ns#>.
+
+<http://example.com/base#TM> a rml:TriplesMap;
+    rml:logicalSource [
+        rml:source _:b738439 ;
+        rml:referenceFormulation rml:JSONPath ;
+        rml:iterator "$.*" ;
+    ] ;
+
+    rml:subjectMap [
+        rml:template "e/{$.id}" ;
+    ] ;
+
+    rml:predicateObjectMap [
+        rml:predicate ex:with ;
+        rml:objectMap [
+            rml:template "c/{$.id}" ;
+            rml:gather ( [ rml:reference "$.v1.*" ; ] [ rml:reference "$.v2.*" ; ] ) ;
+            rml:gatherAs rdf:Bag ;
+        ] ;
+    ] ;
+.
+
+_:b738439 a rml:RelativePathSource ;
+    rml:path "data.json" .
+
+

Output

+
<http://example.com/base/e/a> <http://example.com/ns#with> <http://example.com/base/c/a> .
+<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
+<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "1" .
+<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "2" .
+<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "a" .
+<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_4> "b" .
+<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_5> "5" .
+<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_6> "6" .
+<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_7> "d" .
+<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_8> "e" .
+
+<http://example.com/base/e/b> <http://example.com/ns#with> <http://example.com/base/c/b> .
+<http://example.com/base/c/b> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
+<http://example.com/base/c/b> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "3" .
+<http://example.com/base/c/b> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "4" .
+<http://example.com/base/c/b> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "c" .
+
+
+

32. RMLTC-CC-0007-NES

+

Title: Nested gather maps

+

Description: Testing whether nested gather maps are created. The mapping should generate a list of bags.

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0007-NES/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/>.
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+@prefix ex:  <http://example.com/ns#>.
+
+<http://example.com/base#TM> a rml:TriplesMap;
+    rml:logicalSource [
+        rml:source _:b738439 ;
+        rml:referenceFormulation rml:JSONPath ;
+        rml:iterator "$.*" ;
+    ] ;
+
+    rml:subjectMap [
+        rml:template "e/{$.id}" ;
+    ] ;
+
+    rml:predicateObjectMap [
+        rml:predicate ex:with ;
+        rml:objectMap [
+            rml:gather (
+                [
+                    rml:gather ( [ rml:reference "$.v1.*" ; ] ) ;
+                    rml:gatherAs rdf:Bag ;
+                ]
+                [
+                    rml:gather ( [ rml:reference "$.v2.*" ; ] ) ;
+                    rml:gatherAs rdf:Bag ;
+                ]
+            ) ;
+            rml:gatherAs rdf:List ;
+        ] ;
+    ] ;
+.
+
+_:b738439 a rml:RelativePathSource ;
+    rml:path "data.json" .
+
+

Output

+
_:nab9af1206e584ab2afd457e8a605872cb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
+_:nab9af1206e584ab2afd457e8a605872cb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "1" .
+_:nab9af1206e584ab2afd457e8a605872cb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "2" .
+
+_:nab9af1206e584ab2afd457e8a605872cb2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
+_:nab9af1206e584ab2afd457e8a605872cb2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "a" .
+_:nab9af1206e584ab2afd457e8a605872cb2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "b" .
+
+_:nab9af1206e584ab2afd457e8a605872cb5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
+_:nab9af1206e584ab2afd457e8a605872cb5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "3" .
+_:nab9af1206e584ab2afd457e8a605872cb5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "4" .
+
+_:nab9af1206e584ab2afd457e8a605872cb6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
+_:nab9af1206e584ab2afd457e8a605872cb6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "c" .
+
+<http://example.com/base/e/a> <http://example.com/ns#with> _:nab9af1206e584ab2afd457e8a605872cb3 .
+_:nab9af1206e584ab2afd457e8a605872cb3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> _:nab9af1206e584ab2afd457e8a605872cb1 .
+_:nab9af1206e584ab2afd457e8a605872cb3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nab9af1206e584ab2afd457e8a605872cb4 .
+
+_:nab9af1206e584ab2afd457e8a605872cb4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> _:nab9af1206e584ab2afd457e8a605872cb2 .
+_:nab9af1206e584ab2afd457e8a605872cb4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+
+<http://example.com/base/e/b> <http://example.com/ns#with> _:nab9af1206e584ab2afd457e8a605872cb7 .
+_:nab9af1206e584ab2afd457e8a605872cb7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> _:nab9af1206e584ab2afd457e8a605872cb5 .
+_:nab9af1206e584ab2afd457e8a605872cb7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nab9af1206e584ab2afd457e8a605872cb8 .
+
+_:nab9af1206e584ab2afd457e8a605872cb8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> _:nab9af1206e584ab2afd457e8a605872cb6 .
+_:nab9af1206e584ab2afd457e8a605872cb8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+
+
+
+

33. RMLTC-CC-0008-ROMa

+

Title: Elements via reference object-map.

+

Description: Testing whether gather maps generate an RDF list whose members are generated by a referencing object-map.

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0008-ROMa/Friends.json

+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+
+_:b273446 a rml:RelativePathSource ;
+    rml:path "student.csv" .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap ;
+    rml:logicalSource [ a rml:LogicalSource ;
+            rml:referenceFormulation rml:CSV ;
+            rml:source _:b273446 ] ;
+            
+    rml:predicateObjectMap [ 
+        rml:objectMap [
+                rml:reference "ID" ; rml:termType rml:BlankNode ;
+                rml:gather ( 
+                    [ 
+                        rml:parentTriplesMap <http://example.com/base/TriplesMap1> ;
+                        rml:joinCondition [ rml:child "Sport" ; rml:parent "Sport" ] ;
+                    ] 
+                ) ;
+                rml:gatherAs rdf:List;
+            ] ;    
+        rml:predicate ex:sameSportAs 
+    ] ;
+
+    rml:subjectMap [ rml:template "http://example.com/Student/{ID}/{Name}" ] .
+
+

Output

+
_:genid1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> <http://example.com/Student/10/Venus%20Williams> .
+_:genid1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:genid2 .
+_:genid2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> <http://example.com/Student/20/Serena%20Williams> .
+_:genid2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+<http://example.com/Student/10/Venus%20Williams> <http://example.com/sameSportAs> _:genid1 .
+_:genid3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> <http://example.com/Student/10/Venus%20Williams> .
+_:genid3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:genid4 .
+_:genid4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> <http://example.com/Student/20/Serena%20Williams> .
+_:genid4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+<http://example.com/Student/20/Serena%20Williams> <http://example.com/sameSportAs> _:genid3 .
+_:genid5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> <http://example.com/Student/30/Loena%20Hendrickx> .
+_:genid5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+<http://example.com/Student/30/Loena%20Hendrickx> <http://example.com/sameSportAs> _:genid5 .
+
+
+

34. RMLTC-CC-0008-ROMb

+

Title: Elements via reference object-map with default join condition

+

Description: Testing whether gather maps generate an RDF list whose members are generated by a referencing object-map with a default join condition.

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0008-ROMb/Friends.json

+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+
+_:b273446 a rml:RelativePathSource ;
+    rml:path "student.csv" .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap ;
+    rml:logicalSource [ a rml:LogicalSource ;
+            rml:referenceFormulation rml:CSV ;
+            rml:source _:b273446 ] ;
+            
+    rml:predicateObjectMap [
+        rml:objectMap [
+            rml:reference "ID" ; rml:termType rml:BlankNode ;
+            rml:gather ( 
+                [ 
+                    rml:parentTriplesMap <http://example.com/base/TriplesMap1> ;
+                ] 
+            ) ;
+            rml:gatherAs rdf:List;
+        ] ;
+        rml:predicate ex:sameSportAs 
+    ] ;
+        
+    rml:subjectMap [ rml:template "http://example.com/Student/{ID}/{Name}" ] .
+
+
+

Output

+
_:genid1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> <http://example.com/Student/30/Loena%20Hendrickx> .
+_:genid1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+<http://example.com/Student/30/Loena%20Hendrickx> <http://example.com/sameSportAs> _:genid1 .
+_:genid2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> <http://example.com/Student/20/Serena%20Williams> .
+_:genid2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+<http://example.com/Student/20/Serena%20Williams> <http://example.com/sameSportAs> _:genid2 .
+_:genid3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> <http://example.com/Student/10/Venus%20Williams> .
+_:genid3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+<http://example.com/Student/10/Venus%20Williams> <http://example.com/sameSportAs> _:genid3 .
+
+
+

35. RMLTC-CC-0009-DUP-Bag

+

Title: Gather duplicate values in an RDF Bag

+

Description: Testing the expected behavior of multi-valued expression maps containing duplicate values when these expression maps are used in a gather map to create an RDF Bag.

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0009-DUP-Bag/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/>.
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+@prefix ex:  <http://example.com/ns#>.
+
+<http://example.com/base#TM> a rml:TriplesMap;
+    rml:logicalSource [
+        rml:source _:b738439 ;
+        rml:referenceFormulation rml:JSONPath ;
+        rml:iterator "$.*" ;
+    ] ;
+
+    rml:subjectMap [
+        rml:template "e/{$.id}" ;
+    ] ;
+
+    rml:predicateObjectMap [
+        rml:predicate ex:with ;
+        rml:objectMap [
+            rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
+            rml:gatherAs rdf:Bag ;
+        ] ;
+    ] ;
+.
+
+_:b738439 a rml:RelativePathSource ;
+    rml:path "data.json" .
+
+

Output

+
_:nc808fbd2e11a4baa939c61c8210b5909b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
+_:nc808fbd2e11a4baa939c61c8210b5909b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "2" .
+_:nc808fbd2e11a4baa939c61c8210b5909b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
+_:nc808fbd2e11a4baa939c61c8210b5909b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
+_:nc808fbd2e11a4baa939c61c8210b5909b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "9" .
+_:nc808fbd2e11a4baa939c61c8210b5909b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "1" .
+<http://example.com/base/e/b> <http://example.com/ns#with> _:nc808fbd2e11a4baa939c61c8210b5909b2 .
+_:nc808fbd2e11a4baa939c61c8210b5909b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "1" .
+<http://example.com/base/e/c> <http://example.com/ns#with> _:nc808fbd2e11a4baa939c61c8210b5909b3 .
+<http://example.com/base/e/a> <http://example.com/ns#with> _:nc808fbd2e11a4baa939c61c8210b5909b1 .
+_:nc808fbd2e11a4baa939c61c8210b5909b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "2" .
+_:nc808fbd2e11a4baa939c61c8210b5909b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "7" .
+_:nc808fbd2e11a4baa939c61c8210b5909b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "6" .
+_:nc808fbd2e11a4baa939c61c8210b5909b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "1" .
+_:nc808fbd2e11a4baa939c61c8210b5909b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "8" .
+
+
+

36. RMLTC-CC-0009-DUP-List

+

Title: Gather duplicate values in an RDF List

+

Description: Testing the expected behavior of multi-valued expression maps containing duplicate values when these expression maps are used in a gather map to create a list.

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0009-DUP-List/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/>.
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+@prefix ex:  <http://example.com/ns#>.
+
+<http://example.com/base#TM> a rml:TriplesMap;
+    rml:logicalSource [
+        rml:source _:b738439 ;
+        rml:referenceFormulation rml:JSONPath ;
+        rml:iterator "$.*" ;
+    ] ;
+
+    rml:subjectMap [
+        rml:template "e/{$.id}" ;
+    ] ;
+
+    rml:predicateObjectMap [
+        rml:predicate ex:with ;
+        rml:objectMap [
+            rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
+            rml:gatherAs rdf:List ;
+        ] ;
+    ] ;
+.
+
+_:b738439 a rml:RelativePathSource ;
+    rml:path "data.json" .
+
+

Output

+
<http://example.com/base/e/a> <http://example.com/ns#with> _:n988e0f11d19c486fa3b3255f94c9b3bab1 .
+_:n988e0f11d19c486fa3b3255f94c9b3bab1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
+_:n988e0f11d19c486fa3b3255f94c9b3bab1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n988e0f11d19c486fa3b3255f94c9b3bab2 .
+_:n988e0f11d19c486fa3b3255f94c9b3bab2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
+_:n988e0f11d19c486fa3b3255f94c9b3bab2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n988e0f11d19c486fa3b3255f94c9b3bab3 .
+_:n988e0f11d19c486fa3b3255f94c9b3bab3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
+_:n988e0f11d19c486fa3b3255f94c9b3bab3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+
+<http://example.com/base/e/b> <http://example.com/ns#with> _:n988e0f11d19c486fa3b3255f94c9b3bab4 .
+_:n988e0f11d19c486fa3b3255f94c9b3bab4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
+_:n988e0f11d19c486fa3b3255f94c9b3bab4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n988e0f11d19c486fa3b3255f94c9b3bab5 .
+_:n988e0f11d19c486fa3b3255f94c9b3bab5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
+_:n988e0f11d19c486fa3b3255f94c9b3bab5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n988e0f11d19c486fa3b3255f94c9b3bab6 .
+_:n988e0f11d19c486fa3b3255f94c9b3bab6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "6" .
+_:n988e0f11d19c486fa3b3255f94c9b3bab6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+
+<http://example.com/base/e/c> <http://example.com/ns#with> _:n988e0f11d19c486fa3b3255f94c9b3bab7 .
+_:n988e0f11d19c486fa3b3255f94c9b3bab7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "7" .
+_:n988e0f11d19c486fa3b3255f94c9b3bab7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n988e0f11d19c486fa3b3255f94c9b3bab8 .
+_:n988e0f11d19c486fa3b3255f94c9b3bab8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "8" .
+_:n988e0f11d19c486fa3b3255f94c9b3bab8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n988e0f11d19c486fa3b3255f94c9b3bab9 .
+_:n988e0f11d19c486fa3b3255f94c9b3bab9 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "9" .
+_:n988e0f11d19c486fa3b3255f94c9b3bab9 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+
+
+

37. RMLTC-CC-0010-Lista

+

Title: Combining graph maps and gather maps (graph map has a template and gather map does not)

+

Description: Tests the behavior of combining graph- and gather maps. In this example, a blank node for each list is expected.

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0010-Lista/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/>.
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+@prefix ex:  <http://example.com/ns#>.
+
+<http://example.com/base#TM> a rml:TriplesMap;
+    rml:logicalSource [
+        rml:source _:b738439 ;
+        rml:referenceFormulation rml:JSONPath ;
+        rml:iterator "$.*" ;
+    ] ;
+
+    rml:subjectMap [
+        rml:template "e/{$.id}" ;
+    ] ;
+
+    rml:predicateObjectMap [
+        rml:graphMap [ rml:template "g/{$.graph}" ; ] ;
+        rml:predicate ex:with ;
+        rml:objectMap [
+            rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
+            rml:gatherAs rdf:List ;
+        ] ;
+    ] ;
+.
+
+_:b738439 a rml:RelativePathSource ;
+    rml:path "data.json" .
+
+

Output

+
_:genid1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" <http://example.com/base/g/1> .
+_:genid1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> <http://example.com/base/g/1> .
+_:genid2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" <http://example.com/base/g/1> .
+_:genid2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> <http://example.com/base/g/1> .
+<http://example.com/base/e/a> <http://example.com/ns#with> _:genid1 <http://example.com/base/g/1> .
+<http://example.com/base/e/a> <http://example.com/ns#with> _:genid2 <http://example.com/base/g/1> .
+
+_:genidx1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" <http://example.com/base/g/2> .
+_:genidx1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> <http://example.com/base/g/2> .
+<http://example.com/base/e/a> <http://example.com/ns#with> _:genidx1 <http://example.com/base/g/2> .
+
+
+

38. RMLTC-CC-0010-Listb

+

Title: Combining graph maps and gather maps (both graph map and gather map have a template)

+

Description: Tests the behavior of combining graph- and gather maps. In this example, lists are concatinated in some named graphs via blank node identifiers constructed with templates.

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTC-CC-0010-Listb/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/>.
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+@prefix ex:  <http://example.com/ns#>.
+
+<http://example.com/base#TM> a rml:TriplesMap;
+    rml:logicalSource [
+        rml:source _:b738439 ;
+        rml:referenceFormulation rml:JSONPath ;
+        rml:iterator "$.*" ;
+    ] ;
+
+    rml:subjectMap [
+        rml:template "e/{$.id}" ;
+    ] ;
+
+    rml:predicateObjectMap [
+        rml:graphMap [ rml:template "g/{$.graph}" ; ] ;
+        rml:predicate ex:with ;
+        rml:objectMap [
+            rml:template "l/{$.id}" ; rml:termType rml:BlankNode ;
+            rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
+            rml:gatherAs rdf:List ;
+        ] ;
+    ] ;
+.
+
+_:b738439 a rml:RelativePathSource ;
+    rml:path "data.json" .
+
+

Output

+
_:genid1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" <http://example.com/base/g/1> .
+_:genid1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:genid2 <http://example.com/base/g/1> .
+_:genid2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" <http://example.com/base/g/1> .
+_:genid2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> <http://example.com/base/g/1> .
+<http://example.com/base/e/a> <http://example.com/ns#with> _:genid1 <http://example.com/base/g/1> .
+
+_:genidx1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" <http://example.com/base/g/2> .
+_:genidx1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> <http://example.com/base/g/2> .
+<http://example.com/base/e/a> <http://example.com/ns#with> _:genidx1 <http://example.com/base/g/2> .
+
+
+ + + + + \ No newline at end of file diff --git a/src/test/resources/rml-cc/section/abstract.md b/src/test/resources/rml-cc/section/abstract.md new file mode 100644 index 00000000..7b13b046 --- /dev/null +++ b/src/test/resources/rml-cc/section/abstract.md @@ -0,0 +1 @@ +This document defines the RML-CC test cases to the determine the RML-CC specification conformance of tools. diff --git a/src/test/resources/rml-cc/section/data-model.md b/src/test/resources/rml-cc/section/data-model.md new file mode 100644 index 00000000..f4c3ad6a --- /dev/null +++ b/src/test/resources/rml-cc/section/data-model.md @@ -0,0 +1,12 @@ +# Data model + +The test cases are semantically described for re-usability and shareability following the [W3C Test case description](https://www.w3.org/2006/03/test-description). +Each `test:Testcase` as the following properties: + +- `dcterms:identifier`: unique ID of the test case. +- `rmltest:hasError`: if an error of the RML Processor is expected or not. +- `rmltest:input`: One or more input data of the test case. +- `rmltest:output`: One or more output data of the test case. +- `rmltest:inputFormat`: the input data format. +- `rmltest:outputFormat`: the output data format. +- `rmltest:mappingDocument`: the RML mapping rules in Turtle. diff --git a/src/test/resources/rml-cc/section/introduction.md b/src/test/resources/rml-cc/section/introduction.md new file mode 100644 index 00000000..55ab17e6 --- /dev/null +++ b/src/test/resources/rml-cc/section/introduction.md @@ -0,0 +1,4 @@ +# Introduction + +This document defines the RML-CC test cases, consisting of a collection of test case documents (input and expected output). +The purpose of the test cases is to determine the conformance of tools that execute RML rules to the RML-CC specification. diff --git a/src/test/resources/rml-cc/section/test-cases.md b/src/test/resources/rml-cc/section/test-cases.md new file mode 100644 index 00000000..7d81b94d --- /dev/null +++ b/src/test/resources/rml-cc/section/test-cases.md @@ -0,0 +1,10 @@ +# Test cases + +This section describes the RML-CC test cases. These descriptions are also available as RDF. +The files are available on [GitHub](https://github.com/kg-construct/rml-cc/tree/main/test-cases) in the folder `test-cases`. +Each test case is contained in a single folder, containing three types of files: + + - Zero or more files containing the data sources, in the case of JSON, XML, CSV, or containing the SQL statements to create the necessary tables, in the case of MySQL, PostgreSQL, and SQL Server. + - One file with the RML rules, called `mapping.ttl`, in the Turtle format. + - Zero or more files with the expected RDF. No file is provided if an error is expected that must halt the generation of the RDF because of an error. + diff --git a/src/test/resources/rml-core/README.md b/src/test/resources/rml-core/README.md new file mode 100644 index 00000000..831a6c76 --- /dev/null +++ b/src/test/resources/rml-core/README.md @@ -0,0 +1,9 @@ +# RML Core test cases + +Manifest of test cases can be generated as followed: + +1. Add the testcase description in `descriptions.csv` or fetch it from the Google spreadsheet. +2. Execute the `make-metadata.py` script: `python3 make-metadata.py http://w3id.org/rml/core/` +3. Generate the manifest with RMLMapper: `java -jar rmlmapper.jar -m manifest.rml.ttl -o manifest.ttl -s turtle` + + diff --git a/src/test/resources/rml-core/RMLTC0000-CSV/mapping.ttl b/src/test/resources/rml-core/RMLTC0000-CSV/mapping.ttl deleted file mode 100644 index 6e17117b..00000000 --- a/src/test/resources/rml-core/RMLTC0000-CSV/mapping.ttl +++ /dev/null @@ -1,20 +0,0 @@ -@prefix foaf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:referenceFormulation rml:CSV; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.csv" - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "Name" - ]; - rml:predicate foaf:name - ]; - rml:subjectMap [ - rml:template "http://example.com/{Name}" - ] . diff --git a/src/test/resources/rml-core/RMLTC0000-CSV/output.nq b/src/test/resources/rml-core/RMLTC0000-CSV/output.nq deleted file mode 100644 index ca0b9916..00000000 --- a/src/test/resources/rml-core/RMLTC0000-CSV/output.nq +++ /dev/null @@ -1 +0,0 @@ -# empty database diff --git a/src/test/resources/rml-core/RMLTC0000-CSV/student.csv b/src/test/resources/rml-core/RMLTC0000-CSV/student.csv deleted file mode 100644 index 70df60c1..00000000 --- a/src/test/resources/rml-core/RMLTC0000-CSV/student.csv +++ /dev/null @@ -1 +0,0 @@ -Name diff --git a/src/test/resources/rml-core/RMLTC0000-JSON/README.md b/src/test/resources/rml-core/RMLTC0000-JSON/README.md new file mode 100644 index 00000000..b8bc8015 --- /dev/null +++ b/src/test/resources/rml-core/RMLTC0000-JSON/README.md @@ -0,0 +1,50 @@ +## RMLTC0000-JSON + +**Title**: "one table, one column, zero rows" + +**Description**: "Tests if an empty table produces an empty RDF graph" + +**Default Base IRI**: http://example.com/ + +**Error expected?** No + +**Input** +``` +{ + "students": [] +} + +``` + +**Mapping** +``` +@prefix foaf: . +@prefix rml: . + + a rml:TriplesMap; + rml:logicalSource [ a rml:LogicalSource; + rml:iterator "$.students[*]"; + rml:referenceFormulation rml:JSONPath; + rml:source [ a rml:RelativePathSource; + rml:root rml:MappingDirectory; + rml:path "student.json" + ] + ]; + rml:predicateObjectMap [ + rml:objectMap [ + rml:reference "$.Name" + ]; + rml:predicate foaf:name + ]; + rml:subjectMap [ + rml:template "http://example.com/{$.Name}" + ] . + +``` + +**Output** +``` +# empty database + +``` + diff --git a/src/test/resources/rml-core/RMLTC0000-JSON/mapping.ttl b/src/test/resources/rml-core/RMLTC0000-JSON/mapping.ttl index 3c738425..41da352f 100644 --- a/src/test/resources/rml-core/RMLTC0000-JSON/mapping.ttl +++ b/src/test/resources/rml-core/RMLTC0000-JSON/mapping.ttl @@ -12,10 +12,10 @@ ]; rml:predicateObjectMap [ rml:objectMap [ - rml:reference "Name" + rml:reference "$.Name" ]; rml:predicate foaf:name ]; rml:subjectMap [ - rml:template "http://example.com/{Name}" + rml:template "http://example.com/{$.Name}" ] . diff --git a/src/test/resources/rml-core/RMLTC0000-MySQL/mapping.ttl b/src/test/resources/rml-core/RMLTC0000-MySQL/mapping.ttl deleted file mode 100644 index d0ae1084..00000000 --- a/src/test/resources/rml-core/RMLTC0000-MySQL/mapping.ttl +++ /dev/null @@ -1,25 +0,0 @@ -@prefix d2rq: . -@prefix foaf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source ; - rml:referenceFormulation rml:SQL2008Table; - rml:iterator "student" - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "Name" - ]; - rml:predicate foaf:name - ]; - rml:subjectMap [ - rml:template "http://example.com/{Name}" - ] . - - a d2rq:Database; - d2rq:jdbcDSN "CONNECTIONDSN"; - d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver"; - d2rq:password ""; - d2rq:username "root" . diff --git a/src/test/resources/rml-core/RMLTC0000-MySQL/output.nq b/src/test/resources/rml-core/RMLTC0000-MySQL/output.nq deleted file mode 100644 index ca0b9916..00000000 --- a/src/test/resources/rml-core/RMLTC0000-MySQL/output.nq +++ /dev/null @@ -1 +0,0 @@ -# empty database diff --git a/src/test/resources/rml-core/RMLTC0000-MySQL/resource.sql b/src/test/resources/rml-core/RMLTC0000-MySQL/resource.sql deleted file mode 100644 index 4f7db991..00000000 --- a/src/test/resources/rml-core/RMLTC0000-MySQL/resource.sql +++ /dev/null @@ -1,5 +0,0 @@ -USE test; -DROP TABLE IF EXISTS test.student; -CREATE TABLE student ( - Name VARCHAR(50) -); \ No newline at end of file diff --git a/src/test/resources/rml-core/RMLTC0000-PostgreSQL/mapping.ttl b/src/test/resources/rml-core/RMLTC0000-PostgreSQL/mapping.ttl deleted file mode 100644 index 8de32762..00000000 --- a/src/test/resources/rml-core/RMLTC0000-PostgreSQL/mapping.ttl +++ /dev/null @@ -1,25 +0,0 @@ -@prefix d2rq: . -@prefix foaf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source ; - rml:referenceFormulation rml:SQL2008Table; - rml:iterator "student" - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "Name" - ]; - rml:predicate foaf:name - ]; - rml:subjectMap [ - rml:template "http://example.com/{Name}" - ] . - - a d2rq:Database; - d2rq:jdbcDSN "CONNECTIONDSN"; - d2rq:jdbcDriver "org.postgresql.Driver"; - d2rq:password ""; - d2rq:username "postgres" . diff --git a/src/test/resources/rml-core/RMLTC0000-PostgreSQL/output.nq b/src/test/resources/rml-core/RMLTC0000-PostgreSQL/output.nq deleted file mode 100644 index ca0b9916..00000000 --- a/src/test/resources/rml-core/RMLTC0000-PostgreSQL/output.nq +++ /dev/null @@ -1 +0,0 @@ -# empty database diff --git a/src/test/resources/rml-core/RMLTC0000-PostgreSQL/resource.sql b/src/test/resources/rml-core/RMLTC0000-PostgreSQL/resource.sql deleted file mode 100644 index ea537fa7..00000000 --- a/src/test/resources/rml-core/RMLTC0000-PostgreSQL/resource.sql +++ /dev/null @@ -1,4 +0,0 @@ -DROP TABLE IF EXISTS student CASCADE ; -CREATE TABLE student ( - "Name" VARCHAR(50) -); \ No newline at end of file diff --git a/src/test/resources/rml-core/RMLTC0000-SPARQL/mapping.ttl b/src/test/resources/rml-core/RMLTC0000-SPARQL/mapping.ttl deleted file mode 100644 index fc910499..00000000 --- a/src/test/resources/rml-core/RMLTC0000-SPARQL/mapping.ttl +++ /dev/null @@ -1,28 +0,0 @@ -@prefix foaf: . -@prefix formats: . -@prefix rml: . -@prefix sd: . - - rml:logicalSource [ - rml:iterator """ - PREFIX rdfs: - SELECT ?name - WHERE { - ?name a rdfs:Literal . - } """; - rml:referenceFormulation formats:SPARQL_Results_JSON; - rml:source - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "name.value" - ]; - rml:predicate foaf:name - ]; - rml:subjectMap [ - rml:template "http://example.com/{name.value}" - ] . - - a sd:Service; - sd:endpoint ; - sd:supportedLanguage sd:SPARQL11Query . diff --git a/src/test/resources/rml-core/RMLTC0000-SPARQL/resource.ttl b/src/test/resources/rml-core/RMLTC0000-SPARQL/resource.ttl deleted file mode 100644 index 8b137891..00000000 --- a/src/test/resources/rml-core/RMLTC0000-SPARQL/resource.ttl +++ /dev/null @@ -1 +0,0 @@ - diff --git a/src/test/resources/rml-core/RMLTC0000-SQLServer/mapping.ttl b/src/test/resources/rml-core/RMLTC0000-SQLServer/mapping.ttl deleted file mode 100644 index 058c5756..00000000 --- a/src/test/resources/rml-core/RMLTC0000-SQLServer/mapping.ttl +++ /dev/null @@ -1,25 +0,0 @@ -@prefix d2rq: . -@prefix foaf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source ; - rml:referenceFormulation rml:SQL2008Table; - rml:iterator "student" - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "Name" - ]; - rml:predicate foaf:name - ]; - rml:subjectMap [ - rml:template "http://example.com/{Name}" - ] . - - a d2rq:Database; - d2rq:jdbcDSN "CONNECTIONDSN"; - d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver"; - d2rq:password "YourSTRONG!Passw0rd;"; - d2rq:username "sa" . diff --git a/src/test/resources/rml-core/RMLTC0000-SQLServer/output.nq b/src/test/resources/rml-core/RMLTC0000-SQLServer/output.nq deleted file mode 100644 index ca0b9916..00000000 --- a/src/test/resources/rml-core/RMLTC0000-SQLServer/output.nq +++ /dev/null @@ -1 +0,0 @@ -# empty database diff --git a/src/test/resources/rml-core/RMLTC0000-SQLServer/resource.sql b/src/test/resources/rml-core/RMLTC0000-SQLServer/resource.sql deleted file mode 100644 index a5df5fb8..00000000 --- a/src/test/resources/rml-core/RMLTC0000-SQLServer/resource.sql +++ /dev/null @@ -1,7 +0,0 @@ -USE TestDB; -EXEC sp_msforeachtable 'ALTER TABLE ? NOCHECK CONSTRAINT all' -EXEC sp_msforeachtable 'DROP TABLE ?' - -CREATE TABLE student ( - "Name" VARCHAR(50) -); diff --git a/src/test/resources/rml-core/RMLTC0000-XML/mapping.ttl b/src/test/resources/rml-core/RMLTC0000-XML/mapping.ttl deleted file mode 100644 index 2f1946f8..00000000 --- a/src/test/resources/rml-core/RMLTC0000-XML/mapping.ttl +++ /dev/null @@ -1,21 +0,0 @@ -@prefix foaf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator "/students/student"; - rml:referenceFormulation rml:XPath; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.xml" - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "Name" - ]; - rml:predicate foaf:name - ]; - rml:subjectMap [ - rml:template "http://example.com/{Name}" - ] . diff --git a/src/test/resources/rml-core/RMLTC0000-XML/output.nq b/src/test/resources/rml-core/RMLTC0000-XML/output.nq deleted file mode 100644 index ca0b9916..00000000 --- a/src/test/resources/rml-core/RMLTC0000-XML/output.nq +++ /dev/null @@ -1 +0,0 @@ -# empty database diff --git a/src/test/resources/rml-core/RMLTC0000-XML/student.xml b/src/test/resources/rml-core/RMLTC0000-XML/student.xml deleted file mode 100644 index c6bbef41..00000000 --- a/src/test/resources/rml-core/RMLTC0000-XML/student.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/src/test/resources/rml-core/RMLTC0001a-CSV/mapping.ttl b/src/test/resources/rml-core/RMLTC0001a-CSV/mapping.ttl deleted file mode 100644 index 6e17117b..00000000 --- a/src/test/resources/rml-core/RMLTC0001a-CSV/mapping.ttl +++ /dev/null @@ -1,20 +0,0 @@ -@prefix foaf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:referenceFormulation rml:CSV; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.csv" - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "Name" - ]; - rml:predicate foaf:name - ]; - rml:subjectMap [ - rml:template "http://example.com/{Name}" - ] . diff --git a/src/test/resources/rml-core/RMLTC0001a-CSV/output.nq b/src/test/resources/rml-core/RMLTC0001a-CSV/output.nq deleted file mode 100644 index 73f40ddf..00000000 --- a/src/test/resources/rml-core/RMLTC0001a-CSV/output.nq +++ /dev/null @@ -1,2 +0,0 @@ - "Venus" . - diff --git a/src/test/resources/rml-core/RMLTC0001a-CSV/student.csv b/src/test/resources/rml-core/RMLTC0001a-CSV/student.csv deleted file mode 100644 index 4e683bbe..00000000 --- a/src/test/resources/rml-core/RMLTC0001a-CSV/student.csv +++ /dev/null @@ -1,2 +0,0 @@ -Name -Venus diff --git a/src/test/resources/rml-core/RMLTC0001a-JSON/README.md b/src/test/resources/rml-core/RMLTC0001a-JSON/README.md new file mode 100644 index 00000000..a8181987 --- /dev/null +++ b/src/test/resources/rml-core/RMLTC0001a-JSON/README.md @@ -0,0 +1,53 @@ +## RMLTC0001a-JSON + +**Title**: "One column mapping, subject URI generation by using rml:template" + +**Description**: "Tests: (1) one column mapping; (2) subject URI generation by using rml:template; (3) one column to one property" + +**Default Base IRI**: http://example.com/ + +**Error expected?** No + +**Input** +``` +{ + "students": [{ + "Name":"Venus" + }] +} + +``` + +**Mapping** +``` +@prefix foaf: . +@prefix rml: . + + a rml:TriplesMap; + rml:logicalSource [ a rml:LogicalSource; + rml:iterator "$.students[*]"; + rml:referenceFormulation rml:JSONPath; + rml:source [ a rml:RelativePathSource; + rml:root rml:MappingDirectory; + rml:path "student.json" + ] + ]; + rml:predicateObjectMap [ + rml:objectMap [ + rml:reference "$.Name" + ]; + rml:predicate foaf:name + ]; + rml:subjectMap . + + rml:template "http://example.com/{$.Name}" . + +``` + +**Output** +``` + "Venus" . + + +``` + diff --git a/src/test/resources/rml-core/RMLTC0001a-JSON/mapping.ttl b/src/test/resources/rml-core/RMLTC0001a-JSON/mapping.ttl index 5eaa9c42..0a0f009a 100644 --- a/src/test/resources/rml-core/RMLTC0001a-JSON/mapping.ttl +++ b/src/test/resources/rml-core/RMLTC0001a-JSON/mapping.ttl @@ -12,10 +12,10 @@ ]; rml:predicateObjectMap [ rml:objectMap [ - rml:reference "Name" + rml:reference "$.Name" ]; rml:predicate foaf:name ]; rml:subjectMap . - rml:template "http://example.com/{Name}" . + rml:template "http://example.com/{$.Name}" . diff --git a/src/test/resources/rml-core/RMLTC0001a-MySQL/mapping.ttl b/src/test/resources/rml-core/RMLTC0001a-MySQL/mapping.ttl deleted file mode 100644 index d0ae1084..00000000 --- a/src/test/resources/rml-core/RMLTC0001a-MySQL/mapping.ttl +++ /dev/null @@ -1,25 +0,0 @@ -@prefix d2rq: . -@prefix foaf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source ; - rml:referenceFormulation rml:SQL2008Table; - rml:iterator "student" - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "Name" - ]; - rml:predicate foaf:name - ]; - rml:subjectMap [ - rml:template "http://example.com/{Name}" - ] . - - a d2rq:Database; - d2rq:jdbcDSN "CONNECTIONDSN"; - d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver"; - d2rq:password ""; - d2rq:username "root" . diff --git a/src/test/resources/rml-core/RMLTC0001a-MySQL/resource.sql b/src/test/resources/rml-core/RMLTC0001a-MySQL/resource.sql deleted file mode 100644 index b8e2a6c5..00000000 --- a/src/test/resources/rml-core/RMLTC0001a-MySQL/resource.sql +++ /dev/null @@ -1,6 +0,0 @@ -USE test; -DROP TABLE IF EXISTS test.student; -CREATE TABLE student ( - Name VARCHAR(50) -); -INSERT INTO student values ('Venus'); \ No newline at end of file diff --git a/src/test/resources/rml-core/RMLTC0001a-PostgreSQL/mapping.ttl b/src/test/resources/rml-core/RMLTC0001a-PostgreSQL/mapping.ttl deleted file mode 100644 index 8de32762..00000000 --- a/src/test/resources/rml-core/RMLTC0001a-PostgreSQL/mapping.ttl +++ /dev/null @@ -1,25 +0,0 @@ -@prefix d2rq: . -@prefix foaf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source ; - rml:referenceFormulation rml:SQL2008Table; - rml:iterator "student" - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "Name" - ]; - rml:predicate foaf:name - ]; - rml:subjectMap [ - rml:template "http://example.com/{Name}" - ] . - - a d2rq:Database; - d2rq:jdbcDSN "CONNECTIONDSN"; - d2rq:jdbcDriver "org.postgresql.Driver"; - d2rq:password ""; - d2rq:username "postgres" . diff --git a/src/test/resources/rml-core/RMLTC0001a-PostgreSQL/output.nq b/src/test/resources/rml-core/RMLTC0001a-PostgreSQL/output.nq deleted file mode 100644 index efbb5543..00000000 --- a/src/test/resources/rml-core/RMLTC0001a-PostgreSQL/output.nq +++ /dev/null @@ -1 +0,0 @@ - "Venus" . diff --git a/src/test/resources/rml-core/RMLTC0001a-PostgreSQL/resource.sql b/src/test/resources/rml-core/RMLTC0001a-PostgreSQL/resource.sql deleted file mode 100644 index 21c51c3f..00000000 --- a/src/test/resources/rml-core/RMLTC0001a-PostgreSQL/resource.sql +++ /dev/null @@ -1,5 +0,0 @@ -DROP TABLE IF EXISTS student CASCADE ; -CREATE TABLE student ( - "Name" VARCHAR(50) -); -INSERT INTO student values ('Venus'); diff --git a/src/test/resources/rml-core/RMLTC0001a-SPARQL/mapping.ttl b/src/test/resources/rml-core/RMLTC0001a-SPARQL/mapping.ttl deleted file mode 100644 index 879676f1..00000000 --- a/src/test/resources/rml-core/RMLTC0001a-SPARQL/mapping.ttl +++ /dev/null @@ -1,29 +0,0 @@ -@prefix foaf: . -@prefix formats: . -@prefix rml: . -@prefix sd: . - - rml:logicalSource [ - rml:iterator """ - PREFIX rdfs: - PREFIX foaf: - SELECT ?name - WHERE { - ?x foaf:name ?name . - } """; - rml:referenceFormulation formats:SPARQL_Results_JSON; - rml:source - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "name.value" - ]; - rml:predicate foaf:name - ]; - rml:subjectMap [ - rml:template "http://example.com/{name.value}" - ] . - - a sd:Service; - sd:endpoint ; - sd:supportedLanguage sd:SPARQL11Query . diff --git a/src/test/resources/rml-core/RMLTC0001a-SPARQL/output.nq b/src/test/resources/rml-core/RMLTC0001a-SPARQL/output.nq deleted file mode 100644 index efbb5543..00000000 --- a/src/test/resources/rml-core/RMLTC0001a-SPARQL/output.nq +++ /dev/null @@ -1 +0,0 @@ - "Venus" . diff --git a/src/test/resources/rml-core/RMLTC0001a-SPARQL/resource.ttl b/src/test/resources/rml-core/RMLTC0001a-SPARQL/resource.ttl deleted file mode 100644 index ac86df29..00000000 --- a/src/test/resources/rml-core/RMLTC0001a-SPARQL/resource.ttl +++ /dev/null @@ -1,4 +0,0 @@ -@prefix foaf: . - -[] foaf:name "Venus" . - diff --git a/src/test/resources/rml-core/RMLTC0001a-SQLServer/mapping.ttl b/src/test/resources/rml-core/RMLTC0001a-SQLServer/mapping.ttl deleted file mode 100644 index 058c5756..00000000 --- a/src/test/resources/rml-core/RMLTC0001a-SQLServer/mapping.ttl +++ /dev/null @@ -1,25 +0,0 @@ -@prefix d2rq: . -@prefix foaf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source ; - rml:referenceFormulation rml:SQL2008Table; - rml:iterator "student" - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "Name" - ]; - rml:predicate foaf:name - ]; - rml:subjectMap [ - rml:template "http://example.com/{Name}" - ] . - - a d2rq:Database; - d2rq:jdbcDSN "CONNECTIONDSN"; - d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver"; - d2rq:password "YourSTRONG!Passw0rd;"; - d2rq:username "sa" . diff --git a/src/test/resources/rml-core/RMLTC0001a-SQLServer/output.nq b/src/test/resources/rml-core/RMLTC0001a-SQLServer/output.nq deleted file mode 100644 index efbb5543..00000000 --- a/src/test/resources/rml-core/RMLTC0001a-SQLServer/output.nq +++ /dev/null @@ -1 +0,0 @@ - "Venus" . diff --git a/src/test/resources/rml-core/RMLTC0001a-SQLServer/resource.sql b/src/test/resources/rml-core/RMLTC0001a-SQLServer/resource.sql deleted file mode 100644 index 391b8d53..00000000 --- a/src/test/resources/rml-core/RMLTC0001a-SQLServer/resource.sql +++ /dev/null @@ -1,8 +0,0 @@ -USE TestDB; -EXEC sp_msforeachtable 'ALTER TABLE ? NOCHECK CONSTRAINT all' -EXEC sp_msforeachtable 'DROP TABLE ?' - -CREATE TABLE student ( - "Name" VARCHAR(50) -); -INSERT INTO student values ('Venus'); diff --git a/src/test/resources/rml-core/RMLTC0001a-XML/mapping.ttl b/src/test/resources/rml-core/RMLTC0001a-XML/mapping.ttl deleted file mode 100644 index 2f1946f8..00000000 --- a/src/test/resources/rml-core/RMLTC0001a-XML/mapping.ttl +++ /dev/null @@ -1,21 +0,0 @@ -@prefix foaf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator "/students/student"; - rml:referenceFormulation rml:XPath; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.xml" - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "Name" - ]; - rml:predicate foaf:name - ]; - rml:subjectMap [ - rml:template "http://example.com/{Name}" - ] . diff --git a/src/test/resources/rml-core/RMLTC0001a-XML/output.nq b/src/test/resources/rml-core/RMLTC0001a-XML/output.nq deleted file mode 100644 index 73f40ddf..00000000 --- a/src/test/resources/rml-core/RMLTC0001a-XML/output.nq +++ /dev/null @@ -1,2 +0,0 @@ - "Venus" . - diff --git a/src/test/resources/rml-core/RMLTC0001a-XML/student.xml b/src/test/resources/rml-core/RMLTC0001a-XML/student.xml deleted file mode 100644 index f104648b..00000000 --- a/src/test/resources/rml-core/RMLTC0001a-XML/student.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - Venus - - diff --git a/src/test/resources/rml-core/RMLTC0001b-CSV/mapping.ttl b/src/test/resources/rml-core/RMLTC0001b-CSV/mapping.ttl deleted file mode 100644 index 7457432a..00000000 --- a/src/test/resources/rml-core/RMLTC0001b-CSV/mapping.ttl +++ /dev/null @@ -1,21 +0,0 @@ -@prefix foaf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:referenceFormulation rml:CSV; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.csv" - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "Name" - ]; - rml:predicate foaf:name - ]; - rml:subjectMap [ - rml:template "{Name}"; - rml:termType rml:BlankNode - ] . diff --git a/src/test/resources/rml-core/RMLTC0001b-CSV/output.nq b/src/test/resources/rml-core/RMLTC0001b-CSV/output.nq deleted file mode 100644 index 082a16c0..00000000 --- a/src/test/resources/rml-core/RMLTC0001b-CSV/output.nq +++ /dev/null @@ -1,2 +0,0 @@ -_:Venus "Venus" . - diff --git a/src/test/resources/rml-core/RMLTC0001b-CSV/student.csv b/src/test/resources/rml-core/RMLTC0001b-CSV/student.csv deleted file mode 100644 index 4e683bbe..00000000 --- a/src/test/resources/rml-core/RMLTC0001b-CSV/student.csv +++ /dev/null @@ -1,2 +0,0 @@ -Name -Venus diff --git a/src/test/resources/rml-core/RMLTC0001b-JSON/README.md b/src/test/resources/rml-core/RMLTC0001b-JSON/README.md new file mode 100644 index 00000000..a2391102 --- /dev/null +++ b/src/test/resources/rml-core/RMLTC0001b-JSON/README.md @@ -0,0 +1,54 @@ +## RMLTC0001b-JSON + +**Title**: "One column mapping, generation of a BlankNode subject by using rml:termType" + +**Description**: "Tests: (1) one column mapping; (2) generation of a BlankNode subject by using rml:termType; (3) one column to one property" + +**Default Base IRI**: http://example.com/ + +**Error expected?** No + +**Input** +``` +{ + "students": [{ + "Name":"Venus" + }] +} + +``` + +**Mapping** +``` +@prefix foaf: . +@prefix rml: . + + a rml:TriplesMap; + rml:logicalSource [ a rml:LogicalSource; + rml:iterator "$.students[*]"; + rml:referenceFormulation rml:JSONPath; + rml:source [ a rml:RelativePathSource; + rml:root rml:MappingDirectory; + rml:path "student.json" + ] + ]; + rml:predicateObjectMap [ + rml:objectMap [ + rml:reference "$.Name" + ]; + rml:predicate foaf:name + ]; + rml:subjectMap [ + rml:template "{$.Name}"; + rml:termType rml:BlankNode + ] . + +``` + +**Output** +``` +_:Venus "Venus" . + + +``` + diff --git a/src/test/resources/rml-core/RMLTC0001b-JSON/mapping.ttl b/src/test/resources/rml-core/RMLTC0001b-JSON/mapping.ttl index 3527a427..5d0a5678 100644 --- a/src/test/resources/rml-core/RMLTC0001b-JSON/mapping.ttl +++ b/src/test/resources/rml-core/RMLTC0001b-JSON/mapping.ttl @@ -12,11 +12,11 @@ ]; rml:predicateObjectMap [ rml:objectMap [ - rml:reference "Name" + rml:reference "$.Name" ]; rml:predicate foaf:name ]; rml:subjectMap [ - rml:template "{Name}"; + rml:template "{$.Name}"; rml:termType rml:BlankNode ] . diff --git a/src/test/resources/rml-core/RMLTC0001b-MySQL/mapping.ttl b/src/test/resources/rml-core/RMLTC0001b-MySQL/mapping.ttl deleted file mode 100644 index 054eefd1..00000000 --- a/src/test/resources/rml-core/RMLTC0001b-MySQL/mapping.ttl +++ /dev/null @@ -1,25 +0,0 @@ -@prefix d2rq: . -@prefix foaf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator "SELECT Name FROM student"; - rml:referenceFormulation rml:SQL2008Query; - rml:source - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "Name" - ]; - rml:predicate foaf:name - ]; - rml:subjectMap [ - rml:template "http://example.com/{Name}" - ] . - - a d2rq:Database; - d2rq:jdbcDSN "CONNECTIONDSN"; - d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver"; - d2rq:password ""; - d2rq:username "root" . diff --git a/src/test/resources/rml-core/RMLTC0001b-MySQL/output.nq b/src/test/resources/rml-core/RMLTC0001b-MySQL/output.nq deleted file mode 100644 index efbb5543..00000000 --- a/src/test/resources/rml-core/RMLTC0001b-MySQL/output.nq +++ /dev/null @@ -1 +0,0 @@ - "Venus" . diff --git a/src/test/resources/rml-core/RMLTC0001b-MySQL/resource.sql b/src/test/resources/rml-core/RMLTC0001b-MySQL/resource.sql deleted file mode 100644 index 04afa4e1..00000000 --- a/src/test/resources/rml-core/RMLTC0001b-MySQL/resource.sql +++ /dev/null @@ -1,6 +0,0 @@ -USE test; -DROP TABLE IF EXISTS test.student; -CREATE TABLE student ( - Name VARCHAR(50) -); -INSERT INTO student values ('Venus'); diff --git a/src/test/resources/rml-core/RMLTC0001b-PostgreSQL/mapping.ttl b/src/test/resources/rml-core/RMLTC0001b-PostgreSQL/mapping.ttl deleted file mode 100644 index 43c823a3..00000000 --- a/src/test/resources/rml-core/RMLTC0001b-PostgreSQL/mapping.ttl +++ /dev/null @@ -1,25 +0,0 @@ -@prefix d2rq: . -@prefix foaf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator "SELECT Name FROM student"; - rml:referenceFormulation rml:SQL2008Query; - rml:source - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "name" - ]; - rml:predicate foaf:name - ]; - rml:subjectMap [ - rml:template "http://example.com/{name}" - ] . - - a d2rq:Database; - d2rq:jdbcDSN "CONNECTIONDSN"; - d2rq:jdbcDriver "org.postgresql.Driver"; - d2rq:password ""; - d2rq:username "postgres" . diff --git a/src/test/resources/rml-core/RMLTC0001b-PostgreSQL/output.nq b/src/test/resources/rml-core/RMLTC0001b-PostgreSQL/output.nq deleted file mode 100644 index efbb5543..00000000 --- a/src/test/resources/rml-core/RMLTC0001b-PostgreSQL/output.nq +++ /dev/null @@ -1 +0,0 @@ - "Venus" . diff --git a/src/test/resources/rml-core/RMLTC0001b-PostgreSQL/resource.sql b/src/test/resources/rml-core/RMLTC0001b-PostgreSQL/resource.sql deleted file mode 100644 index 601449ad..00000000 --- a/src/test/resources/rml-core/RMLTC0001b-PostgreSQL/resource.sql +++ /dev/null @@ -1,5 +0,0 @@ -DROP TABLE IF EXISTS student CASCADE ; -CREATE TABLE student ( - name VARCHAR(50) -); -INSERT INTO student values ('Venus'); diff --git a/src/test/resources/rml-core/RMLTC0001b-SPARQL/mapping.ttl b/src/test/resources/rml-core/RMLTC0001b-SPARQL/mapping.ttl deleted file mode 100644 index 879676f1..00000000 --- a/src/test/resources/rml-core/RMLTC0001b-SPARQL/mapping.ttl +++ /dev/null @@ -1,29 +0,0 @@ -@prefix foaf: . -@prefix formats: . -@prefix rml: . -@prefix sd: . - - rml:logicalSource [ - rml:iterator """ - PREFIX rdfs: - PREFIX foaf: - SELECT ?name - WHERE { - ?x foaf:name ?name . - } """; - rml:referenceFormulation formats:SPARQL_Results_JSON; - rml:source - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "name.value" - ]; - rml:predicate foaf:name - ]; - rml:subjectMap [ - rml:template "http://example.com/{name.value}" - ] . - - a sd:Service; - sd:endpoint ; - sd:supportedLanguage sd:SPARQL11Query . diff --git a/src/test/resources/rml-core/RMLTC0001b-SPARQL/output.nq b/src/test/resources/rml-core/RMLTC0001b-SPARQL/output.nq deleted file mode 100644 index efbb5543..00000000 --- a/src/test/resources/rml-core/RMLTC0001b-SPARQL/output.nq +++ /dev/null @@ -1 +0,0 @@ - "Venus" . diff --git a/src/test/resources/rml-core/RMLTC0001b-SPARQL/resource.ttl b/src/test/resources/rml-core/RMLTC0001b-SPARQL/resource.ttl deleted file mode 100644 index ac86df29..00000000 --- a/src/test/resources/rml-core/RMLTC0001b-SPARQL/resource.ttl +++ /dev/null @@ -1,4 +0,0 @@ -@prefix foaf: . - -[] foaf:name "Venus" . - diff --git a/src/test/resources/rml-core/RMLTC0001b-SQLServer/mapping.ttl b/src/test/resources/rml-core/RMLTC0001b-SQLServer/mapping.ttl deleted file mode 100644 index d790ebbc..00000000 --- a/src/test/resources/rml-core/RMLTC0001b-SQLServer/mapping.ttl +++ /dev/null @@ -1,25 +0,0 @@ -@prefix d2rq: . -@prefix foaf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator "SELECT Name FROM student"; - rml:referenceFormulation rml:SQL2008Query; - rml:source - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "Name" - ]; - rml:predicate foaf:name - ]; - rml:subjectMap [ - rml:template "http://example.com/{Name}" - ] . - - a d2rq:Database; - d2rq:jdbcDSN "CONNECTIONDSN"; - d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver"; - d2rq:password "YourSTRONG!Passw0rd;"; - d2rq:username "sa" . diff --git a/src/test/resources/rml-core/RMLTC0001b-SQLServer/output.nq b/src/test/resources/rml-core/RMLTC0001b-SQLServer/output.nq deleted file mode 100644 index efbb5543..00000000 --- a/src/test/resources/rml-core/RMLTC0001b-SQLServer/output.nq +++ /dev/null @@ -1 +0,0 @@ - "Venus" . diff --git a/src/test/resources/rml-core/RMLTC0001b-SQLServer/resource.sql b/src/test/resources/rml-core/RMLTC0001b-SQLServer/resource.sql deleted file mode 100644 index 391b8d53..00000000 --- a/src/test/resources/rml-core/RMLTC0001b-SQLServer/resource.sql +++ /dev/null @@ -1,8 +0,0 @@ -USE TestDB; -EXEC sp_msforeachtable 'ALTER TABLE ? NOCHECK CONSTRAINT all' -EXEC sp_msforeachtable 'DROP TABLE ?' - -CREATE TABLE student ( - "Name" VARCHAR(50) -); -INSERT INTO student values ('Venus'); diff --git a/src/test/resources/rml-core/RMLTC0001b-XML/mapping.ttl b/src/test/resources/rml-core/RMLTC0001b-XML/mapping.ttl deleted file mode 100644 index 39297bad..00000000 --- a/src/test/resources/rml-core/RMLTC0001b-XML/mapping.ttl +++ /dev/null @@ -1,22 +0,0 @@ -@prefix foaf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator "/students/student"; - rml:referenceFormulation rml:XPath; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.xml" - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "Name" - ]; - rml:predicate foaf:name - ]; - rml:subjectMap [ - rml:template "{Name}"; - rml:termType rml:BlankNode - ] . diff --git a/src/test/resources/rml-core/RMLTC0001b-XML/output.nq b/src/test/resources/rml-core/RMLTC0001b-XML/output.nq deleted file mode 100644 index 082a16c0..00000000 --- a/src/test/resources/rml-core/RMLTC0001b-XML/output.nq +++ /dev/null @@ -1,2 +0,0 @@ -_:Venus "Venus" . - diff --git a/src/test/resources/rml-core/RMLTC0001b-XML/student.xml b/src/test/resources/rml-core/RMLTC0001b-XML/student.xml deleted file mode 100644 index f104648b..00000000 --- a/src/test/resources/rml-core/RMLTC0001b-XML/student.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - Venus - - diff --git a/src/test/resources/rml-core/RMLTC0002a-CSV/mapping.ttl b/src/test/resources/rml-core/RMLTC0002a-CSV/mapping.ttl deleted file mode 100644 index 3f077d10..00000000 --- a/src/test/resources/rml-core/RMLTC0002a-CSV/mapping.ttl +++ /dev/null @@ -1,27 +0,0 @@ -@prefix ex: . -@prefix foaf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:referenceFormulation rml:CSV; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.csv" - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "ID" - ]; - rml:predicate ex:id - ], [ - rml:objectMap [ - rml:reference "Name" - ]; - rml:predicate foaf:name - ]; - rml:subjectMap [ - rml:class foaf:Person; - rml:template "http://example.com/{ID}/{Name}" - ] . diff --git a/src/test/resources/rml-core/RMLTC0002a-CSV/output.nq b/src/test/resources/rml-core/RMLTC0002a-CSV/output.nq deleted file mode 100644 index 174309a6..00000000 --- a/src/test/resources/rml-core/RMLTC0002a-CSV/output.nq +++ /dev/null @@ -1,4 +0,0 @@ - "Venus" . - "10" . - . - diff --git a/src/test/resources/rml-core/RMLTC0002a-CSV/student.csv b/src/test/resources/rml-core/RMLTC0002a-CSV/student.csv deleted file mode 100644 index df9d2d69..00000000 --- a/src/test/resources/rml-core/RMLTC0002a-CSV/student.csv +++ /dev/null @@ -1,2 +0,0 @@ -ID,Name -10,Venus diff --git a/src/test/resources/rml-core/RMLTC0002a-JSON/README.md b/src/test/resources/rml-core/RMLTC0002a-JSON/README.md new file mode 100644 index 00000000..fc9f8483 --- /dev/null +++ b/src/test/resources/rml-core/RMLTC0002a-JSON/README.md @@ -0,0 +1,63 @@ +## RMLTC0002a-JSON + +**Title**: "Two columns mapping, generation of a subject URI by the concatenation of two column values" + +**Description**: "Tests: (1) two column mapping, no primary key; (2) subject URI generated by the concatenation of two column values; (3) one column to one property" + +**Default Base IRI**: http://example.com/ + +**Error expected?** No + +**Input** +``` +{ + "students": [{ + "ID": 10, + "Name":"Venus" + }] +} + +``` + +**Mapping** +``` +@prefix ex: . +@prefix foaf: . +@prefix rml: . + + a rml:TriplesMap; + rml:logicalSource [ a rml:LogicalSource; + rml:iterator "$.students[*]"; + rml:referenceFormulation rml:JSONPath; + rml:source [ a rml:RelativePathSource; + rml:root rml:MappingDirectory; + rml:path "student.json" + ] + ]; + rml:predicateObjectMap [ + rml:objectMap [ + rml:reference "$.ID" + ]; + rml:predicate ex:id + ], [ + rml:objectMap [ + rml:reference "$.Name" + ]; + rml:predicate foaf:name + ]; + rml:subjectMap [ + rml:class foaf:Person; + rml:template "http://example.com/{$.ID}/{$.Name}" + ] . + +``` + +**Output** +``` + "Venus" . + "10"^^ . + . + + +``` + diff --git a/src/test/resources/rml-core/RMLTC0002a-JSON/mapping.ttl b/src/test/resources/rml-core/RMLTC0002a-JSON/mapping.ttl index 01e5cf26..7cee3d86 100644 --- a/src/test/resources/rml-core/RMLTC0002a-JSON/mapping.ttl +++ b/src/test/resources/rml-core/RMLTC0002a-JSON/mapping.ttl @@ -13,16 +13,16 @@ ]; rml:predicateObjectMap [ rml:objectMap [ - rml:reference "ID" + rml:reference "$.ID" ]; rml:predicate ex:id ], [ rml:objectMap [ - rml:reference "Name" + rml:reference "$.Name" ]; rml:predicate foaf:name ]; rml:subjectMap [ rml:class foaf:Person; - rml:template "http://example.com/{ID}/{Name}" + rml:template "http://example.com/{$.ID}/{$.Name}" ] . diff --git a/src/test/resources/rml-core/RMLTC0002a-JSON/output.nq b/src/test/resources/rml-core/RMLTC0002a-JSON/output.nq index 174309a6..cf274fb0 100644 --- a/src/test/resources/rml-core/RMLTC0002a-JSON/output.nq +++ b/src/test/resources/rml-core/RMLTC0002a-JSON/output.nq @@ -1,4 +1,4 @@ "Venus" . - "10" . + "10"^^ . . diff --git a/src/test/resources/rml-core/RMLTC0002a-MySQL/mapping.ttl b/src/test/resources/rml-core/RMLTC0002a-MySQL/mapping.ttl deleted file mode 100644 index a858a413..00000000 --- a/src/test/resources/rml-core/RMLTC0002a-MySQL/mapping.ttl +++ /dev/null @@ -1,32 +0,0 @@ -@prefix d2rq: . -@prefix ex: . -@prefix foaf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:referenceFormulation rml:SQL2008Table; - rml:source ; - rml:iterator "student" - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "ID" - ]; - rml:predicate ex:id - ], [ - rml:objectMap [ - rml:reference "Name" - ]; - rml:predicate foaf:name - ]; - rml:subjectMap [ - rml:class foaf:Person; - rml:template "http://example.com/{ID}/{Name}" - ] . - - a d2rq:Database; - d2rq:jdbcDSN "CONNECTIONDSN"; - d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver"; - d2rq:password ""; - d2rq:username "root" . diff --git a/src/test/resources/rml-core/RMLTC0002a-MySQL/output.nq b/src/test/resources/rml-core/RMLTC0002a-MySQL/output.nq deleted file mode 100644 index 224747a6..00000000 --- a/src/test/resources/rml-core/RMLTC0002a-MySQL/output.nq +++ /dev/null @@ -1,3 +0,0 @@ - "Venus" . - "10"^^ . - . diff --git a/src/test/resources/rml-core/RMLTC0002a-MySQL/resource.sql b/src/test/resources/rml-core/RMLTC0002a-MySQL/resource.sql deleted file mode 100644 index 3494b58f..00000000 --- a/src/test/resources/rml-core/RMLTC0002a-MySQL/resource.sql +++ /dev/null @@ -1,8 +0,0 @@ -USE test; -DROP TABLE IF EXISTS test.student; -CREATE TABLE student ( - ID INTEGER, - Name VARCHAR(50) -); -INSERT INTO student values ('10', 'Venus'); - diff --git a/src/test/resources/rml-core/RMLTC0002a-PostgreSQL/mapping.ttl b/src/test/resources/rml-core/RMLTC0002a-PostgreSQL/mapping.ttl deleted file mode 100644 index 7a5f9e9f..00000000 --- a/src/test/resources/rml-core/RMLTC0002a-PostgreSQL/mapping.ttl +++ /dev/null @@ -1,32 +0,0 @@ -@prefix d2rq: . -@prefix ex: . -@prefix foaf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:referenceFormulation rml:SQL2008Table; - rml:source ; - rml:iterator "student" - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "ID" - ]; - rml:predicate ex:id - ], [ - rml:objectMap [ - rml:reference "Name" - ]; - rml:predicate foaf:name - ]; - rml:subjectMap [ - rml:class foaf:Person; - rml:template "http://example.com/{ID}/{Name}" - ] . - - a d2rq:Database; - d2rq:jdbcDSN "CONNECTIONDSN"; - d2rq:jdbcDriver "org.postgresql.Driver"; - d2rq:password ""; - d2rq:username "postgres" . diff --git a/src/test/resources/rml-core/RMLTC0002a-PostgreSQL/output.nq b/src/test/resources/rml-core/RMLTC0002a-PostgreSQL/output.nq deleted file mode 100644 index 224747a6..00000000 --- a/src/test/resources/rml-core/RMLTC0002a-PostgreSQL/output.nq +++ /dev/null @@ -1,3 +0,0 @@ - "Venus" . - "10"^^ . - . diff --git a/src/test/resources/rml-core/RMLTC0002a-PostgreSQL/resource.sql b/src/test/resources/rml-core/RMLTC0002a-PostgreSQL/resource.sql deleted file mode 100644 index 2b4b5bea..00000000 --- a/src/test/resources/rml-core/RMLTC0002a-PostgreSQL/resource.sql +++ /dev/null @@ -1,7 +0,0 @@ -DROP TABLE IF EXISTS student CASCADE ; -CREATE TABLE student ( - "ID" INTEGER, - "Name" VARCHAR(50) -); -INSERT INTO student values ('10', 'Venus'); - diff --git a/src/test/resources/rml-core/RMLTC0002a-SPARQL/mapping.ttl b/src/test/resources/rml-core/RMLTC0002a-SPARQL/mapping.ttl deleted file mode 100644 index 27651887..00000000 --- a/src/test/resources/rml-core/RMLTC0002a-SPARQL/mapping.ttl +++ /dev/null @@ -1,38 +0,0 @@ -@prefix ex: . -@prefix foaf: . -@prefix formats: . -@prefix rml: . -@prefix sd: . - - rml:logicalSource [ - rml:iterator """ - PREFIX rdfs: - PREFIX foaf: - PREFIX rdf: - SELECT ?Name ?ID - WHERE { - ?x foaf:name ?Name ; - rdf:ID ?ID . - } """; - rml:referenceFormulation formats:SPARQL_Results_JSON; - rml:source - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "ID.value" - ]; - rml:predicate ex:id - ], [ - rml:objectMap [ - rml:reference "Name.value" - ]; - rml:predicate foaf:name - ]; - rml:subjectMap [ - rml:class foaf:Person; - rml:template "http://example.com/{ID.value}/{Name.value}" - ] . - - a sd:Service; - sd:endpoint ; - sd:supportedLanguage sd:SPARQL11Query . diff --git a/src/test/resources/rml-core/RMLTC0002a-SPARQL/output.nq b/src/test/resources/rml-core/RMLTC0002a-SPARQL/output.nq deleted file mode 100644 index ffbc3c4b..00000000 --- a/src/test/resources/rml-core/RMLTC0002a-SPARQL/output.nq +++ /dev/null @@ -1,3 +0,0 @@ - "Venus" . - "10" . - . diff --git a/src/test/resources/rml-core/RMLTC0002a-SPARQL/resource.ttl b/src/test/resources/rml-core/RMLTC0002a-SPARQL/resource.ttl deleted file mode 100644 index da1fb834..00000000 --- a/src/test/resources/rml-core/RMLTC0002a-SPARQL/resource.ttl +++ /dev/null @@ -1,6 +0,0 @@ -@prefix foaf: . -@prefix rdf: . - -[] rdf:ID "10" ; - foaf:name "Venus" . - diff --git a/src/test/resources/rml-core/RMLTC0002a-SQLServer/mapping.ttl b/src/test/resources/rml-core/RMLTC0002a-SQLServer/mapping.ttl deleted file mode 100644 index a54a2198..00000000 --- a/src/test/resources/rml-core/RMLTC0002a-SQLServer/mapping.ttl +++ /dev/null @@ -1,32 +0,0 @@ -@prefix d2rq: . -@prefix ex: . -@prefix foaf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:referenceFormulation rml:SQL2008Table; - rml:source ; - rml:iterator "student" - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "ID" - ]; - rml:predicate ex:id - ], [ - rml:objectMap [ - rml:reference "Name" - ]; - rml:predicate foaf:name - ]; - rml:subjectMap [ - rml:class foaf:Person; - rml:template "http://example.com/{ID}/{Name}" - ] . - - a d2rq:Database; - d2rq:jdbcDSN "CONNECTIONDSN"; - d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver"; - d2rq:password "YourSTRONG!Passw0rd;"; - d2rq:username "sa" . diff --git a/src/test/resources/rml-core/RMLTC0002a-SQLServer/output.nq b/src/test/resources/rml-core/RMLTC0002a-SQLServer/output.nq deleted file mode 100644 index 224747a6..00000000 --- a/src/test/resources/rml-core/RMLTC0002a-SQLServer/output.nq +++ /dev/null @@ -1,3 +0,0 @@ - "Venus" . - "10"^^ . - . diff --git a/src/test/resources/rml-core/RMLTC0002a-SQLServer/resource.sql b/src/test/resources/rml-core/RMLTC0002a-SQLServer/resource.sql deleted file mode 100644 index 45bd58c0..00000000 --- a/src/test/resources/rml-core/RMLTC0002a-SQLServer/resource.sql +++ /dev/null @@ -1,10 +0,0 @@ -USE TestDB; -EXEC sp_msforeachtable 'ALTER TABLE ? NOCHECK CONSTRAINT all' -EXEC sp_msforeachtable 'DROP TABLE ?' - -CREATE TABLE student ( - "ID" INTEGER, - "Name" VARCHAR(50) -); -INSERT INTO student ("ID", "Name") values (10, 'Venus'); - diff --git a/src/test/resources/rml-core/RMLTC0002a-XML/mapping.ttl b/src/test/resources/rml-core/RMLTC0002a-XML/mapping.ttl deleted file mode 100644 index 4609c397..00000000 --- a/src/test/resources/rml-core/RMLTC0002a-XML/mapping.ttl +++ /dev/null @@ -1,28 +0,0 @@ -@prefix ex: . -@prefix foaf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator "/students/student"; - rml:referenceFormulation rml:XPath; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.xml" - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "ID" - ]; - rml:predicate ex:id - ], [ - rml:objectMap [ - rml:reference "Name" - ]; - rml:predicate foaf:name - ]; - rml:subjectMap [ - rml:class foaf:Person; - rml:template "http://example.com/{ID}/{Name}" - ] . diff --git a/src/test/resources/rml-core/RMLTC0002a-XML/output.nq b/src/test/resources/rml-core/RMLTC0002a-XML/output.nq deleted file mode 100644 index 56b13be3..00000000 --- a/src/test/resources/rml-core/RMLTC0002a-XML/output.nq +++ /dev/null @@ -1,4 +0,0 @@ - "Venus" . - "10". - . - diff --git a/src/test/resources/rml-core/RMLTC0002a-XML/student.xml b/src/test/resources/rml-core/RMLTC0002a-XML/student.xml deleted file mode 100644 index b2a6a9ac..00000000 --- a/src/test/resources/rml-core/RMLTC0002a-XML/student.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - 10 - Venus - - diff --git a/src/test/resources/rml-core/RMLTC0002b-CSV/mapping.ttl b/src/test/resources/rml-core/RMLTC0002b-CSV/mapping.ttl deleted file mode 100644 index 586af8e5..00000000 --- a/src/test/resources/rml-core/RMLTC0002b-CSV/mapping.ttl +++ /dev/null @@ -1,21 +0,0 @@ -@prefix foaf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:referenceFormulation rml:CSV; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.csv" - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "Name" - ]; - rml:predicate foaf:name - ]; - rml:subjectMap [ - rml:template "students{ID}"; - rml:termType rml:BlankNode - ] . diff --git a/src/test/resources/rml-core/RMLTC0002b-CSV/output.nq b/src/test/resources/rml-core/RMLTC0002b-CSV/output.nq deleted file mode 100644 index be918d0b..00000000 --- a/src/test/resources/rml-core/RMLTC0002b-CSV/output.nq +++ /dev/null @@ -1,2 +0,0 @@ -_:students10 "Venus" . - diff --git a/src/test/resources/rml-core/RMLTC0002b-CSV/student.csv b/src/test/resources/rml-core/RMLTC0002b-CSV/student.csv deleted file mode 100644 index df9d2d69..00000000 --- a/src/test/resources/rml-core/RMLTC0002b-CSV/student.csv +++ /dev/null @@ -1,2 +0,0 @@ -ID,Name -10,Venus diff --git a/src/test/resources/rml-core/RMLTC0002b-JSON/README.md b/src/test/resources/rml-core/RMLTC0002b-JSON/README.md new file mode 100644 index 00000000..09891e2a --- /dev/null +++ b/src/test/resources/rml-core/RMLTC0002b-JSON/README.md @@ -0,0 +1,55 @@ +## RMLTC0002b-JSON + +**Title**: "Two columns mapping, generation of a BlankNode subject by using rml:template and rml:termType" + +**Description**: "Tests: (1) two column mapping, no primary key; (2) generation of a BlankNode subject by using rml:template; (3) one column to one property" + +**Default Base IRI**: http://example.com/ + +**Error expected?** No + +**Input** +``` +{ + "students": [{ + "ID": 10, + "Name":"Venus" + }] +} + +``` + +**Mapping** +``` +@prefix foaf: . +@prefix rml: . + + a rml:TriplesMap; + rml:logicalSource [ a rml:LogicalSource; + rml:iterator "$.students[*]"; + rml:referenceFormulation rml:JSONPath; + rml:source [ a rml:RelativePathSource; + rml:root rml:MappingDirectory; + rml:path "student.json" + ] + ]; + rml:predicateObjectMap [ + rml:objectMap [ + rml:reference "$.Name" + ]; + rml:predicate foaf:name + ]; + rml:subjectMap [ + rml:template "students{$.ID}"; + rml:termType rml:BlankNode + ] . + +``` + +**Output** +``` +_:students10 "Venus" . + + +``` + diff --git a/src/test/resources/rml-core/RMLTC0002b-JSON/mapping.ttl b/src/test/resources/rml-core/RMLTC0002b-JSON/mapping.ttl index 79061724..fb76dbc4 100644 --- a/src/test/resources/rml-core/RMLTC0002b-JSON/mapping.ttl +++ b/src/test/resources/rml-core/RMLTC0002b-JSON/mapping.ttl @@ -12,11 +12,11 @@ ]; rml:predicateObjectMap [ rml:objectMap [ - rml:reference "Name" + rml:reference "$.Name" ]; rml:predicate foaf:name ]; rml:subjectMap [ - rml:template "students{ID}"; + rml:template "students{$.ID}"; rml:termType rml:BlankNode ] . diff --git a/src/test/resources/rml-core/RMLTC0002b-MySQL/mapping.ttl b/src/test/resources/rml-core/RMLTC0002b-MySQL/mapping.ttl deleted file mode 100644 index e0c56e13..00000000 --- a/src/test/resources/rml-core/RMLTC0002b-MySQL/mapping.ttl +++ /dev/null @@ -1,26 +0,0 @@ -@prefix d2rq: . -@prefix foaf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:referenceFormulation rml:SQL2008Table; - rml:source ; - rml:iterator "student" - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "Name" - ]; - rml:predicate foaf:name - ]; - rml:subjectMap [ - rml:template "students{ID}"; - rml:termType rml:BlankNode - ] . - - a d2rq:Database; - d2rq:jdbcDSN "CONNECTIONDSN"; - d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver"; - d2rq:password ""; - d2rq:username "root" . diff --git a/src/test/resources/rml-core/RMLTC0002b-MySQL/output.nq b/src/test/resources/rml-core/RMLTC0002b-MySQL/output.nq deleted file mode 100644 index be918d0b..00000000 --- a/src/test/resources/rml-core/RMLTC0002b-MySQL/output.nq +++ /dev/null @@ -1,2 +0,0 @@ -_:students10 "Venus" . - diff --git a/src/test/resources/rml-core/RMLTC0002b-MySQL/resource.sql b/src/test/resources/rml-core/RMLTC0002b-MySQL/resource.sql deleted file mode 100644 index a68415ac..00000000 --- a/src/test/resources/rml-core/RMLTC0002b-MySQL/resource.sql +++ /dev/null @@ -1,7 +0,0 @@ -USE test; -DROP TABLE IF EXISTS test.student; -CREATE TABLE student ( - ID INTEGER, - Name VARCHAR(50) -); -INSERT INTO student values ('10', 'Venus'); diff --git a/src/test/resources/rml-core/RMLTC0002b-PostgreSQL/mapping.ttl b/src/test/resources/rml-core/RMLTC0002b-PostgreSQL/mapping.ttl deleted file mode 100644 index 0cb45551..00000000 --- a/src/test/resources/rml-core/RMLTC0002b-PostgreSQL/mapping.ttl +++ /dev/null @@ -1,26 +0,0 @@ -@prefix d2rq: . -@prefix foaf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:referenceFormulation rml:SQL2008Table; - rml:source ; - rml:iterator "student" - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "Name" - ]; - rml:predicate foaf:name - ]; - rml:subjectMap [ - rml:template "students{ID}"; - rml:termType rml:BlankNode - ] . - - a d2rq:Database; - d2rq:jdbcDSN "CONNECTIONDSN"; - d2rq:jdbcDriver "org.postgresql.Driver"; - d2rq:password ""; - d2rq:username "postgres" . diff --git a/src/test/resources/rml-core/RMLTC0002b-PostgreSQL/output.nq b/src/test/resources/rml-core/RMLTC0002b-PostgreSQL/output.nq deleted file mode 100644 index 407dd744..00000000 --- a/src/test/resources/rml-core/RMLTC0002b-PostgreSQL/output.nq +++ /dev/null @@ -1 +0,0 @@ -_:students10 "Venus" . diff --git a/src/test/resources/rml-core/RMLTC0002b-PostgreSQL/resource.sql b/src/test/resources/rml-core/RMLTC0002b-PostgreSQL/resource.sql deleted file mode 100644 index 80957756..00000000 --- a/src/test/resources/rml-core/RMLTC0002b-PostgreSQL/resource.sql +++ /dev/null @@ -1,6 +0,0 @@ -DROP TABLE IF EXISTS student CASCADE ; -CREATE TABLE student ( - "ID" INTEGER, - "Name" VARCHAR(50) -); -INSERT INTO student values ('10', 'Venus'); diff --git a/src/test/resources/rml-core/RMLTC0002b-SPARQL/mapping.ttl b/src/test/resources/rml-core/RMLTC0002b-SPARQL/mapping.ttl deleted file mode 100644 index e45c8b0e..00000000 --- a/src/test/resources/rml-core/RMLTC0002b-SPARQL/mapping.ttl +++ /dev/null @@ -1,32 +0,0 @@ -@prefix foaf: . -@prefix formats: . -@prefix rml: . -@prefix sd: . - - rml:logicalSource [ - rml:iterator """ - PREFIX rdfs: - PREFIX foaf: - PREFIX rdf: - SELECT ?Name ?ID - WHERE { - ?x foaf:name ?Name ; - rdf:ID ?ID . - } """; - rml:referenceFormulation formats:SPARQL_Results_JSON; - rml:source - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "Name.value" - ]; - rml:predicate foaf:name - ]; - rml:subjectMap [ - rml:template "students{ID.value}"; - rml:termType rml:BlankNode - ] . - - a sd:Service; - sd:endpoint ; - sd:supportedLanguage sd:SPARQL11Query . diff --git a/src/test/resources/rml-core/RMLTC0002b-SPARQL/output.nq b/src/test/resources/rml-core/RMLTC0002b-SPARQL/output.nq deleted file mode 100644 index 407dd744..00000000 --- a/src/test/resources/rml-core/RMLTC0002b-SPARQL/output.nq +++ /dev/null @@ -1 +0,0 @@ -_:students10 "Venus" . diff --git a/src/test/resources/rml-core/RMLTC0002b-SPARQL/resource.ttl b/src/test/resources/rml-core/RMLTC0002b-SPARQL/resource.ttl deleted file mode 100644 index da1fb834..00000000 --- a/src/test/resources/rml-core/RMLTC0002b-SPARQL/resource.ttl +++ /dev/null @@ -1,6 +0,0 @@ -@prefix foaf: . -@prefix rdf: . - -[] rdf:ID "10" ; - foaf:name "Venus" . - diff --git a/src/test/resources/rml-core/RMLTC0002b-SQLServer/mapping.ttl b/src/test/resources/rml-core/RMLTC0002b-SQLServer/mapping.ttl deleted file mode 100644 index 7e3c5e6e..00000000 --- a/src/test/resources/rml-core/RMLTC0002b-SQLServer/mapping.ttl +++ /dev/null @@ -1,26 +0,0 @@ -@prefix d2rq: . -@prefix foaf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:referenceFormulation rml:SQL2008Table; - rml:source ; - rml:iterator "student" - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "Name" - ]; - rml:predicate foaf:name - ]; - rml:subjectMap [ - rml:template "students{ID}"; - rml:termType rml:BlankNode - ] . - - a d2rq:Database; - d2rq:jdbcDSN "CONNECTIONDSN"; - d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver"; - d2rq:password "YourSTRONG!Passw0rd;"; - d2rq:username "sa" . diff --git a/src/test/resources/rml-core/RMLTC0002b-SQLServer/output.nq b/src/test/resources/rml-core/RMLTC0002b-SQLServer/output.nq deleted file mode 100644 index be918d0b..00000000 --- a/src/test/resources/rml-core/RMLTC0002b-SQLServer/output.nq +++ /dev/null @@ -1,2 +0,0 @@ -_:students10 "Venus" . - diff --git a/src/test/resources/rml-core/RMLTC0002b-SQLServer/resource.sql b/src/test/resources/rml-core/RMLTC0002b-SQLServer/resource.sql deleted file mode 100644 index 7403a330..00000000 --- a/src/test/resources/rml-core/RMLTC0002b-SQLServer/resource.sql +++ /dev/null @@ -1,9 +0,0 @@ -USE TestDB; -EXEC sp_msforeachtable 'ALTER TABLE ? NOCHECK CONSTRAINT all' -EXEC sp_msforeachtable 'DROP TABLE ?' - -CREATE TABLE student ( - "ID" INTEGER, - "Name" VARCHAR(50) -); -INSERT INTO student values ('10', 'Venus'); diff --git a/src/test/resources/rml-core/RMLTC0002b-XML/mapping.ttl b/src/test/resources/rml-core/RMLTC0002b-XML/mapping.ttl deleted file mode 100644 index 9c5dab63..00000000 --- a/src/test/resources/rml-core/RMLTC0002b-XML/mapping.ttl +++ /dev/null @@ -1,22 +0,0 @@ -@prefix foaf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator "/students/student"; - rml:referenceFormulation rml:XPath; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.xml" - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "Name" - ]; - rml:predicate foaf:name - ]; - rml:subjectMap [ - rml:template "students{ID}"; - rml:termType rml:BlankNode - ] . diff --git a/src/test/resources/rml-core/RMLTC0002b-XML/output.nq b/src/test/resources/rml-core/RMLTC0002b-XML/output.nq deleted file mode 100644 index be918d0b..00000000 --- a/src/test/resources/rml-core/RMLTC0002b-XML/output.nq +++ /dev/null @@ -1,2 +0,0 @@ -_:students10 "Venus" . - diff --git a/src/test/resources/rml-core/RMLTC0002b-XML/student.xml b/src/test/resources/rml-core/RMLTC0002b-XML/student.xml deleted file mode 100644 index b2a6a9ac..00000000 --- a/src/test/resources/rml-core/RMLTC0002b-XML/student.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - 10 - Venus - - diff --git a/src/test/resources/rml-core/RMLTC0002c-CSV/mapping.ttl b/src/test/resources/rml-core/RMLTC0002c-CSV/mapping.ttl deleted file mode 100644 index ba00bad1..00000000 --- a/src/test/resources/rml-core/RMLTC0002c-CSV/mapping.ttl +++ /dev/null @@ -1,20 +0,0 @@ -@prefix ex: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:referenceFormulation rml:CSV; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.csv" - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "IDs" - ]; - rml:predicate ex:id - ]; - rml:subjectMap [ - rml:template "http://example.com/{ID}/{Name}" - ] . diff --git a/src/test/resources/rml-core/RMLTC0002c-CSV/student.csv b/src/test/resources/rml-core/RMLTC0002c-CSV/student.csv deleted file mode 100644 index df9d2d69..00000000 --- a/src/test/resources/rml-core/RMLTC0002c-CSV/student.csv +++ /dev/null @@ -1,2 +0,0 @@ -ID,Name -10,Venus diff --git a/src/test/resources/rml-core/RMLTC0002c-MySQL/mapping.ttl b/src/test/resources/rml-core/RMLTC0002c-MySQL/mapping.ttl deleted file mode 100644 index 3b0d881b..00000000 --- a/src/test/resources/rml-core/RMLTC0002c-MySQL/mapping.ttl +++ /dev/null @@ -1,25 +0,0 @@ -@prefix d2rq: . -@prefix ex: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:referenceFormulation rml:SQL2008Table; - rml:source ; - rml:iterator "student" - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "IDs" - ]; - rml:predicate ex:id - ]; - rml:subjectMap [ - rml:template "http://example.com/{ID}/{Name}" - ] . - - a d2rq:Database; - d2rq:jdbcDSN "CONNECTIONDSN"; - d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver"; - d2rq:password ""; - d2rq:username "root" . diff --git a/src/test/resources/rml-core/RMLTC0002c-MySQL/resource.sql b/src/test/resources/rml-core/RMLTC0002c-MySQL/resource.sql deleted file mode 100644 index a68415ac..00000000 --- a/src/test/resources/rml-core/RMLTC0002c-MySQL/resource.sql +++ /dev/null @@ -1,7 +0,0 @@ -USE test; -DROP TABLE IF EXISTS test.student; -CREATE TABLE student ( - ID INTEGER, - Name VARCHAR(50) -); -INSERT INTO student values ('10', 'Venus'); diff --git a/src/test/resources/rml-core/RMLTC0002c-PostgreSQL/mapping.ttl b/src/test/resources/rml-core/RMLTC0002c-PostgreSQL/mapping.ttl deleted file mode 100644 index 397c267d..00000000 --- a/src/test/resources/rml-core/RMLTC0002c-PostgreSQL/mapping.ttl +++ /dev/null @@ -1,25 +0,0 @@ -@prefix d2rq: . -@prefix ex: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:referenceFormulation rml:SQL2008Table; - rml:source ; - rml:iterator "student" - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "IDs" - ]; - rml:predicate ex:id - ]; - rml:subjectMap [ - rml:template "http://example.com/{ID}/{Name}" - ] . - - a d2rq:Database; - d2rq:jdbcDSN "CONNECTIONDSN"; - d2rq:jdbcDriver "org.postgresql.Driver"; - d2rq:password ""; - d2rq:username "postgres" . diff --git a/src/test/resources/rml-core/RMLTC0002c-PostgreSQL/resource.sql b/src/test/resources/rml-core/RMLTC0002c-PostgreSQL/resource.sql deleted file mode 100644 index 80957756..00000000 --- a/src/test/resources/rml-core/RMLTC0002c-PostgreSQL/resource.sql +++ /dev/null @@ -1,6 +0,0 @@ -DROP TABLE IF EXISTS student CASCADE ; -CREATE TABLE student ( - "ID" INTEGER, - "Name" VARCHAR(50) -); -INSERT INTO student values ('10', 'Venus'); diff --git a/src/test/resources/rml-core/RMLTC0002c-SQLServer/mapping.ttl b/src/test/resources/rml-core/RMLTC0002c-SQLServer/mapping.ttl deleted file mode 100644 index c3b656d0..00000000 --- a/src/test/resources/rml-core/RMLTC0002c-SQLServer/mapping.ttl +++ /dev/null @@ -1,25 +0,0 @@ -@prefix d2rq: . -@prefix ex: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:referenceFormulation rml:SQL2008Table; - rml:source ; - rml:iterator "student" - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "IDs" - ]; - rml:predicate ex:id - ]; - rml:subjectMap [ - rml:template "http://example.com/{ID}/{Name}" - ] . - - a d2rq:Database; - d2rq:jdbcDSN "CONNECTIONDSN"; - d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver"; - d2rq:password "YourSTRONG!Passw0rd;"; - d2rq:username "sa" . diff --git a/src/test/resources/rml-core/RMLTC0002c-SQLServer/resource.sql b/src/test/resources/rml-core/RMLTC0002c-SQLServer/resource.sql deleted file mode 100644 index 7403a330..00000000 --- a/src/test/resources/rml-core/RMLTC0002c-SQLServer/resource.sql +++ /dev/null @@ -1,9 +0,0 @@ -USE TestDB; -EXEC sp_msforeachtable 'ALTER TABLE ? NOCHECK CONSTRAINT all' -EXEC sp_msforeachtable 'DROP TABLE ?' - -CREATE TABLE student ( - "ID" INTEGER, - "Name" VARCHAR(50) -); -INSERT INTO student values ('10', 'Venus'); diff --git a/src/test/resources/rml-core/RMLTC0002d-MySQL/mapping.ttl b/src/test/resources/rml-core/RMLTC0002d-MySQL/mapping.ttl deleted file mode 100644 index d4a2bb0f..00000000 --- a/src/test/resources/rml-core/RMLTC0002d-MySQL/mapping.ttl +++ /dev/null @@ -1,26 +0,0 @@ -@prefix d2rq: . -@prefix foaf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator "SELECT CONCAT('Student', ID) AS StudentId, ID, Name FROM student"; - rml:referenceFormulation rml:SQL2008Query; - rml:source - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "Name" - ]; - rml:predicate foaf:name - ]; - rml:subjectMap [ - rml:reference "StudentId"; - rml:termType rml:BlankNode - ] . - - a d2rq:Database; - d2rq:jdbcDSN "CONNECTIONDSN"; - d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver"; - d2rq:password ""; - d2rq:username "root" . diff --git a/src/test/resources/rml-core/RMLTC0002d-MySQL/output.nq b/src/test/resources/rml-core/RMLTC0002d-MySQL/output.nq deleted file mode 100644 index c9ce3cd7..00000000 --- a/src/test/resources/rml-core/RMLTC0002d-MySQL/output.nq +++ /dev/null @@ -1 +0,0 @@ -_:Student10 "Venus". diff --git a/src/test/resources/rml-core/RMLTC0002d-MySQL/resource.sql b/src/test/resources/rml-core/RMLTC0002d-MySQL/resource.sql deleted file mode 100644 index a68415ac..00000000 --- a/src/test/resources/rml-core/RMLTC0002d-MySQL/resource.sql +++ /dev/null @@ -1,7 +0,0 @@ -USE test; -DROP TABLE IF EXISTS test.student; -CREATE TABLE student ( - ID INTEGER, - Name VARCHAR(50) -); -INSERT INTO student values ('10', 'Venus'); diff --git a/src/test/resources/rml-core/RMLTC0002d-PostgreSQL/mapping.ttl b/src/test/resources/rml-core/RMLTC0002d-PostgreSQL/mapping.ttl deleted file mode 100644 index 2b20b148..00000000 --- a/src/test/resources/rml-core/RMLTC0002d-PostgreSQL/mapping.ttl +++ /dev/null @@ -1,26 +0,0 @@ -@prefix d2rq: . -@prefix foaf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator "SELECT ('Student' || ID) AS StudentId, ID, Name FROM student"; - rml:referenceFormulation rml:SQL2008Query; - rml:source - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "name" - ]; - rml:predicate foaf:name - ]; - rml:subjectMap [ - rml:reference "studentid"; - rml:termType rml:BlankNode - ] . - - a d2rq:Database; - d2rq:jdbcDSN "CONNECTIONDSN"; - d2rq:jdbcDriver "org.postgresql.Driver"; - d2rq:password ""; - d2rq:username "postgres" . diff --git a/src/test/resources/rml-core/RMLTC0002d-PostgreSQL/output.nq b/src/test/resources/rml-core/RMLTC0002d-PostgreSQL/output.nq deleted file mode 100644 index c9ce3cd7..00000000 --- a/src/test/resources/rml-core/RMLTC0002d-PostgreSQL/output.nq +++ /dev/null @@ -1 +0,0 @@ -_:Student10 "Venus". diff --git a/src/test/resources/rml-core/RMLTC0002d-PostgreSQL/resource.sql b/src/test/resources/rml-core/RMLTC0002d-PostgreSQL/resource.sql deleted file mode 100644 index b6377ea8..00000000 --- a/src/test/resources/rml-core/RMLTC0002d-PostgreSQL/resource.sql +++ /dev/null @@ -1,6 +0,0 @@ -DROP TABLE IF EXISTS student CASCADE ; -CREATE TABLE student ( - ID INTEGER, - Name VARCHAR(50) -); -INSERT INTO student values ('10', 'Venus'); diff --git a/src/test/resources/rml-core/RMLTC0002d-SQLServer/mapping.ttl b/src/test/resources/rml-core/RMLTC0002d-SQLServer/mapping.ttl deleted file mode 100644 index e7355d78..00000000 --- a/src/test/resources/rml-core/RMLTC0002d-SQLServer/mapping.ttl +++ /dev/null @@ -1,26 +0,0 @@ -@prefix d2rq: . -@prefix foaf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator "SELECT CONCAT('Student', ID) AS StudentId, ID, Name FROM student"; - rml:referenceFormulation rml:SQL2008Query; - rml:source - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "Name" - ]; - rml:predicate foaf:name - ]; - rml:subjectMap [ - rml:reference "StudentId"; - rml:termType rml:BlankNode - ] . - - a d2rq:Database; - d2rq:jdbcDSN "CONNECTIONDSN"; - d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver"; - d2rq:password "YourSTRONG!Passw0rd;"; - d2rq:username "sa" . diff --git a/src/test/resources/rml-core/RMLTC0002d-SQLServer/output.nq b/src/test/resources/rml-core/RMLTC0002d-SQLServer/output.nq deleted file mode 100644 index c9ce3cd7..00000000 --- a/src/test/resources/rml-core/RMLTC0002d-SQLServer/output.nq +++ /dev/null @@ -1 +0,0 @@ -_:Student10 "Venus". diff --git a/src/test/resources/rml-core/RMLTC0002d-SQLServer/resource.sql b/src/test/resources/rml-core/RMLTC0002d-SQLServer/resource.sql deleted file mode 100644 index 312631e3..00000000 --- a/src/test/resources/rml-core/RMLTC0002d-SQLServer/resource.sql +++ /dev/null @@ -1,9 +0,0 @@ -USE TestDB; -EXEC sp_msforeachtable 'ALTER TABLE ? NOCHECK CONSTRAINT all' -EXEC sp_msforeachtable 'DROP TABLE ?' - -CREATE TABLE student ( - ID INTEGER, - Name VARCHAR(50) -); -INSERT INTO student values ('10', 'Venus'); diff --git a/src/test/resources/rml-core/RMLTC0002e-CSV/mapping.ttl b/src/test/resources/rml-core/RMLTC0002e-CSV/mapping.ttl deleted file mode 100644 index 16ef1a14..00000000 --- a/src/test/resources/rml-core/RMLTC0002e-CSV/mapping.ttl +++ /dev/null @@ -1,20 +0,0 @@ -@prefix ex: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:referenceFormulation rml:CSV; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student2.csv" - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "IDs" - ]; - rml:predicate ex:id - ]; - rml:subjectMap [ - rml:template "http://example.com/{ID}/{Name}" - ] . diff --git a/src/test/resources/rml-core/RMLTC0002e-CSV/student.csv b/src/test/resources/rml-core/RMLTC0002e-CSV/student.csv deleted file mode 100644 index df9d2d69..00000000 --- a/src/test/resources/rml-core/RMLTC0002e-CSV/student.csv +++ /dev/null @@ -1,2 +0,0 @@ -ID,Name -10,Venus diff --git a/src/test/resources/rml-core/RMLTC0002e-JSON/README.md b/src/test/resources/rml-core/RMLTC0002e-JSON/README.md new file mode 100644 index 00000000..0324c94f --- /dev/null +++ b/src/test/resources/rml-core/RMLTC0002e-JSON/README.md @@ -0,0 +1,47 @@ +## RMLTC0002e-JSON + +**Title**: "Two columns mapping, an undefined rml:path" + +**Description**: "Tests the presence of an undefined rml:path" + +**Default Base IRI**: http://example.com/ + +**Error expected?** Yes + +**Input** +``` +{ + "students": [{ + "ID": 10, + "Name":"Venus" + }] +} + +``` + +**Mapping** +``` +@prefix ex: . +@prefix rml: . + + a rml:TriplesMap; + rml:logicalSource [ a rml:LogicalSource; + rml:iterator "$.students[*]"; + rml:referenceFormulation rml:JSONPath; + rml:source [ a rml:RelativePathSource; + rml:root rml:MappingDirectory; + rml:path "student2.json" + ] + ]; + rml:predicateObjectMap [ + rml:objectMap [ + rml:reference "$.IDs" + ]; + rml:predicate ex:id + ]; + rml:subjectMap [ + rml:template "http://example.com/{$.ID}/{$.Name}" + ] . + +``` + diff --git a/src/test/resources/rml-core/RMLTC0002e-JSON/mapping.ttl b/src/test/resources/rml-core/RMLTC0002e-JSON/mapping.ttl index d248fc23..5fff6df9 100644 --- a/src/test/resources/rml-core/RMLTC0002e-JSON/mapping.ttl +++ b/src/test/resources/rml-core/RMLTC0002e-JSON/mapping.ttl @@ -12,10 +12,10 @@ ]; rml:predicateObjectMap [ rml:objectMap [ - rml:reference "IDs" + rml:reference "$.IDs" ]; rml:predicate ex:id ]; rml:subjectMap [ - rml:template "http://example.com/{ID}/{Name}" + rml:template "http://example.com/{$.ID}/{$.Name}" ] . diff --git a/src/test/resources/rml-core/RMLTC0002e-MySQL/mapping.ttl b/src/test/resources/rml-core/RMLTC0002e-MySQL/mapping.ttl deleted file mode 100644 index 3243ff11..00000000 --- a/src/test/resources/rml-core/RMLTC0002e-MySQL/mapping.ttl +++ /dev/null @@ -1,25 +0,0 @@ -@prefix d2rq: . -@prefix ex: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:referenceFormulation rml:SQL2008Table; - rml:source ; - rml:iterator "\"Students\"" - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "IDs" - ]; - rml:predicate ex:id - ]; - rml:subjectMap [ - rml:template "http://example.com/{ID}/{Name}" - ] . - - a d2rq:Database; - d2rq:jdbcDSN "CONNECTIONDSN"; - d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver"; - d2rq:password ""; - d2rq:username "root" . diff --git a/src/test/resources/rml-core/RMLTC0002e-MySQL/resource.sql b/src/test/resources/rml-core/RMLTC0002e-MySQL/resource.sql deleted file mode 100644 index a68415ac..00000000 --- a/src/test/resources/rml-core/RMLTC0002e-MySQL/resource.sql +++ /dev/null @@ -1,7 +0,0 @@ -USE test; -DROP TABLE IF EXISTS test.student; -CREATE TABLE student ( - ID INTEGER, - Name VARCHAR(50) -); -INSERT INTO student values ('10', 'Venus'); diff --git a/src/test/resources/rml-core/RMLTC0002e-PostgreSQL/mapping.ttl b/src/test/resources/rml-core/RMLTC0002e-PostgreSQL/mapping.ttl deleted file mode 100644 index 8c5821d5..00000000 --- a/src/test/resources/rml-core/RMLTC0002e-PostgreSQL/mapping.ttl +++ /dev/null @@ -1,25 +0,0 @@ -@prefix d2rq: . -@prefix ex: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:referenceFormulation rml:SQL2008Table; - rml:source ; - rml:iterator "\"Students\"" - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "IDs" - ]; - rml:predicate ex:id - ]; - rml:subjectMap [ - rml:template "http://example.com/{ID}/{Name}" - ] . - - a d2rq:Database; - d2rq:jdbcDSN "CONNECTIONDSN"; - d2rq:jdbcDriver "org.postgresql.Driver"; - d2rq:password ""; - d2rq:username "postgres" . diff --git a/src/test/resources/rml-core/RMLTC0002e-PostgreSQL/resource.sql b/src/test/resources/rml-core/RMLTC0002e-PostgreSQL/resource.sql deleted file mode 100644 index 80957756..00000000 --- a/src/test/resources/rml-core/RMLTC0002e-PostgreSQL/resource.sql +++ /dev/null @@ -1,6 +0,0 @@ -DROP TABLE IF EXISTS student CASCADE ; -CREATE TABLE student ( - "ID" INTEGER, - "Name" VARCHAR(50) -); -INSERT INTO student values ('10', 'Venus'); diff --git a/src/test/resources/rml-core/RMLTC0002e-SQLServer/mapping.ttl b/src/test/resources/rml-core/RMLTC0002e-SQLServer/mapping.ttl deleted file mode 100644 index 7cd1f338..00000000 --- a/src/test/resources/rml-core/RMLTC0002e-SQLServer/mapping.ttl +++ /dev/null @@ -1,25 +0,0 @@ -@prefix d2rq: . -@prefix ex: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:referenceFormulation rml:SQL2008Table; - rml:source ; - rml:iterator "\"Students\"" - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "IDs" - ]; - rml:predicate ex:id - ]; - rml:subjectMap [ - rml:template "http://example.com/{ID}/{Name}" - ] . - - a d2rq:Database; - d2rq:jdbcDSN "CONNECTIONDSN"; - d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver"; - d2rq:password "YourSTRONG!Passw0rd;"; - d2rq:username "sa" . diff --git a/src/test/resources/rml-core/RMLTC0002e-SQLServer/resource.sql b/src/test/resources/rml-core/RMLTC0002e-SQLServer/resource.sql deleted file mode 100644 index 7403a330..00000000 --- a/src/test/resources/rml-core/RMLTC0002e-SQLServer/resource.sql +++ /dev/null @@ -1,9 +0,0 @@ -USE TestDB; -EXEC sp_msforeachtable 'ALTER TABLE ? NOCHECK CONSTRAINT all' -EXEC sp_msforeachtable 'DROP TABLE ?' - -CREATE TABLE student ( - "ID" INTEGER, - "Name" VARCHAR(50) -); -INSERT INTO student values ('10', 'Venus'); diff --git a/src/test/resources/rml-core/RMLTC0002e-XML/mapping.ttl b/src/test/resources/rml-core/RMLTC0002e-XML/mapping.ttl deleted file mode 100644 index 4a3a9503..00000000 --- a/src/test/resources/rml-core/RMLTC0002e-XML/mapping.ttl +++ /dev/null @@ -1,21 +0,0 @@ -@prefix ex: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator "/students/student"; - rml:referenceFormulation rml:XPath; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student2.xml" - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "IDs" - ]; - rml:predicate ex:id - ]; - rml:subjectMap [ - rml:template "http://example.com/{ID}/{Name}" - ] . diff --git a/src/test/resources/rml-core/RMLTC0002e-XML/student.xml b/src/test/resources/rml-core/RMLTC0002e-XML/student.xml deleted file mode 100644 index b2a6a9ac..00000000 --- a/src/test/resources/rml-core/RMLTC0002e-XML/student.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - 10 - Venus - - diff --git a/src/test/resources/rml-core/RMLTC0002f-MySQL/mapping.ttl b/src/test/resources/rml-core/RMLTC0002f-MySQL/mapping.ttl deleted file mode 100644 index 49ef282d..00000000 --- a/src/test/resources/rml-core/RMLTC0002f-MySQL/mapping.ttl +++ /dev/null @@ -1,32 +0,0 @@ -@prefix d2rq: . -@prefix ex: . -@prefix foaf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:referenceFormulation rml:SQL2008Table; - rml:source ; - rml:iterator "\"Student\"" - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "\"ID\"" - ]; - rml:predicate ex:id - ], [ - rml:objectMap [ - rml:reference "\"Name\"" - ]; - rml:predicate foaf:name - ]; - rml:subjectMap [ - rml:class foaf:Person; - rml:template "http://example.com/{\"ID\"}/{\"Name\"}" - ] . - - a d2rq:Database; - d2rq:jdbcDSN "CONNECTIONDSN"; - d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver"; - d2rq:password ""; - d2rq:username "root" . diff --git a/src/test/resources/rml-core/RMLTC0002f-MySQL/resource.sql b/src/test/resources/rml-core/RMLTC0002f-MySQL/resource.sql deleted file mode 100644 index 79b54978..00000000 --- a/src/test/resources/rml-core/RMLTC0002f-MySQL/resource.sql +++ /dev/null @@ -1,7 +0,0 @@ -USE test; -DROP TABLE IF EXISTS test.Student; -CREATE TABLE Student ( -ID INTEGER, -Name VARCHAR(15) -); -INSERT INTO Student (ID, Name) VALUES(10,'Venus'); diff --git a/src/test/resources/rml-core/RMLTC0002f-PostgreSQL/mapping.ttl b/src/test/resources/rml-core/RMLTC0002f-PostgreSQL/mapping.ttl deleted file mode 100644 index 49ef282d..00000000 --- a/src/test/resources/rml-core/RMLTC0002f-PostgreSQL/mapping.ttl +++ /dev/null @@ -1,32 +0,0 @@ -@prefix d2rq: . -@prefix ex: . -@prefix foaf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:referenceFormulation rml:SQL2008Table; - rml:source ; - rml:iterator "\"Student\"" - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "\"ID\"" - ]; - rml:predicate ex:id - ], [ - rml:objectMap [ - rml:reference "\"Name\"" - ]; - rml:predicate foaf:name - ]; - rml:subjectMap [ - rml:class foaf:Person; - rml:template "http://example.com/{\"ID\"}/{\"Name\"}" - ] . - - a d2rq:Database; - d2rq:jdbcDSN "CONNECTIONDSN"; - d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver"; - d2rq:password ""; - d2rq:username "root" . diff --git a/src/test/resources/rml-core/RMLTC0002f-PostgreSQL/resource.sql b/src/test/resources/rml-core/RMLTC0002f-PostgreSQL/resource.sql deleted file mode 100644 index 4359797c..00000000 --- a/src/test/resources/rml-core/RMLTC0002f-PostgreSQL/resource.sql +++ /dev/null @@ -1,6 +0,0 @@ -DROP TABLE IF EXISTS Student CASCADE; -CREATE TABLE Student ( -ID INTEGER, -Name VARCHAR(15) -); -INSERT INTO Student (ID, Name) VALUES(10,'Venus'); diff --git a/src/test/resources/rml-core/RMLTC0002f-SQLServer/mapping.ttl b/src/test/resources/rml-core/RMLTC0002f-SQLServer/mapping.ttl deleted file mode 100644 index 49ef282d..00000000 --- a/src/test/resources/rml-core/RMLTC0002f-SQLServer/mapping.ttl +++ /dev/null @@ -1,32 +0,0 @@ -@prefix d2rq: . -@prefix ex: . -@prefix foaf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:referenceFormulation rml:SQL2008Table; - rml:source ; - rml:iterator "\"Student\"" - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "\"ID\"" - ]; - rml:predicate ex:id - ], [ - rml:objectMap [ - rml:reference "\"Name\"" - ]; - rml:predicate foaf:name - ]; - rml:subjectMap [ - rml:class foaf:Person; - rml:template "http://example.com/{\"ID\"}/{\"Name\"}" - ] . - - a d2rq:Database; - d2rq:jdbcDSN "CONNECTIONDSN"; - d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver"; - d2rq:password ""; - d2rq:username "root" . diff --git a/src/test/resources/rml-core/RMLTC0002f-SQLServer/resource.sql b/src/test/resources/rml-core/RMLTC0002f-SQLServer/resource.sql deleted file mode 100644 index b9bad140..00000000 --- a/src/test/resources/rml-core/RMLTC0002f-SQLServer/resource.sql +++ /dev/null @@ -1,7 +0,0 @@ -USE TestDB; -DROP TABLE IF EXISTS TestDB.Student; -CREATE TABLE Student ( -ID INTEGER, -Name VARCHAR(15) -); -INSERT INTO Student (ID, Name) VALUES(10,'Venus'); diff --git a/src/test/resources/rml-core/RMLTC0002g-JSON/README.md b/src/test/resources/rml-core/RMLTC0002g-JSON/README.md new file mode 100644 index 00000000..512f5cb1 --- /dev/null +++ b/src/test/resources/rml-core/RMLTC0002g-JSON/README.md @@ -0,0 +1,47 @@ +## RMLTC0002g-JSON + +**Title**: "Two columns mapping, invalid JSONPath" + +**Description**: "Test the presence of an invalid JSONPath" + +**Default Base IRI**: http://example.com/ + +**Error expected?** Yes + +**Input** +``` +{ + "students": [{ + "ID": 10, + "Name":"Venus" + }] +} + +``` + +**Mapping** +``` +@prefix ex: . +@prefix rml: . + + a rml:TriplesMap; + rml:logicalSource [ a rml:LogicalSource; + rml:iterator "$.students[*]]"; + rml:referenceFormulation rml:JSONPath; + rml:source [ a rml:RelativePathSource; + rml:root rml:MappingDirectory; + rml:path "student2.json" + ] + ]; + rml:predicateObjectMap [ + rml:objectMap [ + rml:reference "$.IDs" + ]; + rml:predicate ex:id + ]; + rml:subjectMap [ + rml:template "http://example.com/{$.ID}/{$.Name}" + ] . + +``` + diff --git a/src/test/resources/rml-core/RMLTC0002g-JSON/mapping.ttl b/src/test/resources/rml-core/RMLTC0002g-JSON/mapping.ttl index 79665fa6..f13174c8 100644 --- a/src/test/resources/rml-core/RMLTC0002g-JSON/mapping.ttl +++ b/src/test/resources/rml-core/RMLTC0002g-JSON/mapping.ttl @@ -12,10 +12,10 @@ ]; rml:predicateObjectMap [ rml:objectMap [ - rml:reference "IDs" + rml:reference "$.IDs" ]; rml:predicate ex:id ]; rml:subjectMap [ - rml:template "http://example.com/{ID}/{Name}" + rml:template "http://example.com/{$.ID}/{$.Name}" ] . diff --git a/src/test/resources/rml-core/RMLTC0002g-MySQL/mapping.ttl b/src/test/resources/rml-core/RMLTC0002g-MySQL/mapping.ttl deleted file mode 100644 index 281f0f32..00000000 --- a/src/test/resources/rml-core/RMLTC0002g-MySQL/mapping.ttl +++ /dev/null @@ -1,25 +0,0 @@ -@prefix d2rq: . -@prefix ex: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator "SELECT kjnqsdjfbqsdjfmsdnfm FROM student"; - rml:referenceFormulation rml:SQL2008Query; - rml:source - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "IDs" - ]; - rml:predicate ex:id - ]; - rml:subjectMap [ - rml:template "http://example.com/{ID}/{Name}" - ] . - - a d2rq:Database; - d2rq:jdbcDSN "CONNECTIONDSN"; - d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver"; - d2rq:password ""; - d2rq:username "root" . diff --git a/src/test/resources/rml-core/RMLTC0002g-MySQL/resource.sql b/src/test/resources/rml-core/RMLTC0002g-MySQL/resource.sql deleted file mode 100644 index a68415ac..00000000 --- a/src/test/resources/rml-core/RMLTC0002g-MySQL/resource.sql +++ /dev/null @@ -1,7 +0,0 @@ -USE test; -DROP TABLE IF EXISTS test.student; -CREATE TABLE student ( - ID INTEGER, - Name VARCHAR(50) -); -INSERT INTO student values ('10', 'Venus'); diff --git a/src/test/resources/rml-core/RMLTC0002g-PostgreSQL/mapping.ttl b/src/test/resources/rml-core/RMLTC0002g-PostgreSQL/mapping.ttl deleted file mode 100644 index 8e015c41..00000000 --- a/src/test/resources/rml-core/RMLTC0002g-PostgreSQL/mapping.ttl +++ /dev/null @@ -1,25 +0,0 @@ -@prefix d2rq: . -@prefix ex: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator "SELECT kjnqsdjfbqsdjfmsdnfm FROM student"; - rml:referenceFormulation rml:SQL2008Query; - rml:source - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "IDs" - ]; - rml:predicate ex:id - ]; - rml:subjectMap [ - rml:template "http://example.com/{ID}/{Name}" - ] . - - a d2rq:Database; - d2rq:jdbcDSN "CONNECTIONDSN"; - d2rq:jdbcDriver "org.postgresql.Driver"; - d2rq:password ""; - d2rq:username "postgres" . diff --git a/src/test/resources/rml-core/RMLTC0002g-PostgreSQL/resource.sql b/src/test/resources/rml-core/RMLTC0002g-PostgreSQL/resource.sql deleted file mode 100644 index 80957756..00000000 --- a/src/test/resources/rml-core/RMLTC0002g-PostgreSQL/resource.sql +++ /dev/null @@ -1,6 +0,0 @@ -DROP TABLE IF EXISTS student CASCADE ; -CREATE TABLE student ( - "ID" INTEGER, - "Name" VARCHAR(50) -); -INSERT INTO student values ('10', 'Venus'); diff --git a/src/test/resources/rml-core/RMLTC0002g-SPARQL/mapping.ttl b/src/test/resources/rml-core/RMLTC0002g-SPARQL/mapping.ttl deleted file mode 100644 index f25aae7a..00000000 --- a/src/test/resources/rml-core/RMLTC0002g-SPARQL/mapping.ttl +++ /dev/null @@ -1,31 +0,0 @@ -@prefix ex: . -@prefix formats: . -@prefix rml: . -@prefix sd: . - - rml:logicalSource [ - rml:iterator """ - PREFIX rdfs: - PREFIX foaf: - PREFIX rdf: - SELECT qsdfqsdf sqdfqsdfsd ?Nsdfqs ame ?ID qmsndfknqskfmdnemznfmkznfmizmnknfmz - WHERE { - ?x foaf:name ?Name ; - rdf:ID ?ID . - } """; - rml:referenceFormulation formats:SPARQL_Results_JSON; - rml:source - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "IDs" - ]; - rml:predicate ex:id - ]; - rml:subjectMap [ - rml:template "http://example.com/{ID.value}/{Name.value}" - ] . - - a sd:Service; - sd:endpoint ; - sd:supportedLanguage sd:SPARQL11Query . diff --git a/src/test/resources/rml-core/RMLTC0002g-SPARQL/resource.ttl b/src/test/resources/rml-core/RMLTC0002g-SPARQL/resource.ttl deleted file mode 100644 index da1fb834..00000000 --- a/src/test/resources/rml-core/RMLTC0002g-SPARQL/resource.ttl +++ /dev/null @@ -1,6 +0,0 @@ -@prefix foaf: . -@prefix rdf: . - -[] rdf:ID "10" ; - foaf:name "Venus" . - diff --git a/src/test/resources/rml-core/RMLTC0002g-SQLServer/mapping.ttl b/src/test/resources/rml-core/RMLTC0002g-SQLServer/mapping.ttl deleted file mode 100644 index cc64991c..00000000 --- a/src/test/resources/rml-core/RMLTC0002g-SQLServer/mapping.ttl +++ /dev/null @@ -1,25 +0,0 @@ -@prefix d2rq: . -@prefix ex: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator "SELECT kjnqsdjfbqsdjfmsdnfm FROM student"; - rml:referenceFormulation rml:SQL2008Query; - rml:source - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "IDs" - ]; - rml:predicate ex:id - ]; - rml:subjectMap [ - rml:template "http://example.com/{ID}/{Name}" - ] . - - a d2rq:Database; - d2rq:jdbcDSN "CONNECTIONDSN"; - d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver"; - d2rq:password "YourSTRONG!Passw0rd;"; - d2rq:username "sa" . diff --git a/src/test/resources/rml-core/RMLTC0002g-SQLServer/resource.sql b/src/test/resources/rml-core/RMLTC0002g-SQLServer/resource.sql deleted file mode 100644 index 7403a330..00000000 --- a/src/test/resources/rml-core/RMLTC0002g-SQLServer/resource.sql +++ /dev/null @@ -1,9 +0,0 @@ -USE TestDB; -EXEC sp_msforeachtable 'ALTER TABLE ? NOCHECK CONSTRAINT all' -EXEC sp_msforeachtable 'DROP TABLE ?' - -CREATE TABLE student ( - "ID" INTEGER, - "Name" VARCHAR(50) -); -INSERT INTO student values ('10', 'Venus'); diff --git a/src/test/resources/rml-core/RMLTC0002h-MySQL/mapping.ttl b/src/test/resources/rml-core/RMLTC0002h-MySQL/mapping.ttl deleted file mode 100644 index 0ff414d9..00000000 --- a/src/test/resources/rml-core/RMLTC0002h-MySQL/mapping.ttl +++ /dev/null @@ -1,25 +0,0 @@ -@prefix d2rq: . -@prefix ex: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:iterator "SELECT Name, Name FROM student"; - rml:referenceFormulation rml:SQL2008Query; - rml:source - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "IDs" - ]; - rml:predicate ex:id - ]; - rml:subjectMap [ - rml:template "http://example.com/{ID}/{Name}" - ] . - - a d2rq:Database; - d2rq:jdbcDSN "CONNECTIONDSN"; - d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver"; - d2rq:password ""; - d2rq:username "root" . diff --git a/src/test/resources/rml-core/RMLTC0002h-MySQL/resource.sql b/src/test/resources/rml-core/RMLTC0002h-MySQL/resource.sql deleted file mode 100644 index a68415ac..00000000 --- a/src/test/resources/rml-core/RMLTC0002h-MySQL/resource.sql +++ /dev/null @@ -1,7 +0,0 @@ -USE test; -DROP TABLE IF EXISTS test.student; -CREATE TABLE student ( - ID INTEGER, - Name VARCHAR(50) -); -INSERT INTO student values ('10', 'Venus'); diff --git a/src/test/resources/rml-core/RMLTC0002h-PostgreSQL/mapping.ttl b/src/test/resources/rml-core/RMLTC0002h-PostgreSQL/mapping.ttl deleted file mode 100644 index 73e6431b..00000000 --- a/src/test/resources/rml-core/RMLTC0002h-PostgreSQL/mapping.ttl +++ /dev/null @@ -1,25 +0,0 @@ -@prefix d2rq: . -@prefix ex: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:iterator "SELECT Name, Name FROM student"; - rml:referenceFormulation rml:SQL2008Query; - rml:source - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "IDs" - ]; - rml:predicate ex:id - ]; - rml:subjectMap [ - rml:template "http://example.com/{ID}/{Name}" - ] . - - a d2rq:Database; - d2rq:jdbcDSN "CONNECTIONDSN"; - d2rq:jdbcDriver "org.postgresql.Driver"; - d2rq:password ""; - d2rq:username "postgres" . diff --git a/src/test/resources/rml-core/RMLTC0002h-PostgreSQL/resource.sql b/src/test/resources/rml-core/RMLTC0002h-PostgreSQL/resource.sql deleted file mode 100644 index 80957756..00000000 --- a/src/test/resources/rml-core/RMLTC0002h-PostgreSQL/resource.sql +++ /dev/null @@ -1,6 +0,0 @@ -DROP TABLE IF EXISTS student CASCADE ; -CREATE TABLE student ( - "ID" INTEGER, - "Name" VARCHAR(50) -); -INSERT INTO student values ('10', 'Venus'); diff --git a/src/test/resources/rml-core/RMLTC0002h-SPARQL/mapping.ttl b/src/test/resources/rml-core/RMLTC0002h-SPARQL/mapping.ttl deleted file mode 100644 index df7c0e87..00000000 --- a/src/test/resources/rml-core/RMLTC0002h-SPARQL/mapping.ttl +++ /dev/null @@ -1,30 +0,0 @@ -@prefix ex: . -@prefix formats: . -@prefix rml: . -@prefix sd: . - - rml:logicalSource [ - rml:iterator """ - PREFIX rdfs: - PREFIX foaf: - PREFIX rdf: - SELECT ?Name ?Name - WHERE { - ?x foaf:name ?Name ; - } """; - rml:referenceFormulation formats:SPARQL_Results_JSON; - rml:source - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "IDs" - ]; - rml:predicate ex:id - ]; - rml:subjectMap [ - rml:template "http://example.com/{ID.value}/{Name.value}" - ] . - - a sd:Service; - sd:endpoint ; - sd:supportedLanguage sd:SPARQL11Query . diff --git a/src/test/resources/rml-core/RMLTC0002h-SPARQL/resource.ttl b/src/test/resources/rml-core/RMLTC0002h-SPARQL/resource.ttl deleted file mode 100644 index da1fb834..00000000 --- a/src/test/resources/rml-core/RMLTC0002h-SPARQL/resource.ttl +++ /dev/null @@ -1,6 +0,0 @@ -@prefix foaf: . -@prefix rdf: . - -[] rdf:ID "10" ; - foaf:name "Venus" . - diff --git a/src/test/resources/rml-core/RMLTC0002h-SQLServer/mapping.ttl b/src/test/resources/rml-core/RMLTC0002h-SQLServer/mapping.ttl deleted file mode 100644 index d232dd56..00000000 --- a/src/test/resources/rml-core/RMLTC0002h-SQLServer/mapping.ttl +++ /dev/null @@ -1,25 +0,0 @@ -@prefix d2rq: . -@prefix ex: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:iterator "SELECT Name, Name FROM student"; - rml:referenceFormulation rml:SQL2008Query; - rml:source - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "IDs" - ]; - rml:predicate ex:id - ]; - rml:subjectMap [ - rml:template "http://example.com/{ID}/{Name}" - ] . - - a d2rq:Database; - d2rq:jdbcDSN "CONNECTIONDSN"; - d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver"; - d2rq:password "YourSTRONG!Passw0rd;"; - d2rq:username "sa" . diff --git a/src/test/resources/rml-core/RMLTC0002h-SQLServer/resource.sql b/src/test/resources/rml-core/RMLTC0002h-SQLServer/resource.sql deleted file mode 100644 index 1673b883..00000000 --- a/src/test/resources/rml-core/RMLTC0002h-SQLServer/resource.sql +++ /dev/null @@ -1,8 +0,0 @@ -USE TestDB; -EXEC sp_msforeachtable 'ALTER TABLE ? NOCHECK CONSTRAINT all' -EXEC sp_msforeachtable 'DROP TABLE ?' -CREATE TABLE student ( - "ID" INTEGER, - "Name" VARCHAR(50) -); -INSERT INTO student values ('10', 'Venus'); diff --git a/src/test/resources/rml-core/RMLTC0002i-MySQL/mapping.ttl b/src/test/resources/rml-core/RMLTC0002i-MySQL/mapping.ttl deleted file mode 100644 index 0c3186b7..00000000 --- a/src/test/resources/rml-core/RMLTC0002i-MySQL/mapping.ttl +++ /dev/null @@ -1,25 +0,0 @@ -@prefix d2rq: . -@prefix ex: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:iterator "SELECT Name FROM student"; - rml:referenceFormulation rml:SQL2008Query; - rml:source - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "IDs" - ]; - rml:predicate ex:id - ]; - rml:subjectMap [ - rml:template "http://example.com/{ID}/{Name}" - ] . - - a d2rq:Database; - d2rq:jdbcDSN "CONNECTIONDSN"; - d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver"; - d2rq:password ""; - d2rq:username "root" . diff --git a/src/test/resources/rml-core/RMLTC0002i-MySQL/resource.sql b/src/test/resources/rml-core/RMLTC0002i-MySQL/resource.sql deleted file mode 100644 index a68415ac..00000000 --- a/src/test/resources/rml-core/RMLTC0002i-MySQL/resource.sql +++ /dev/null @@ -1,7 +0,0 @@ -USE test; -DROP TABLE IF EXISTS test.student; -CREATE TABLE student ( - ID INTEGER, - Name VARCHAR(50) -); -INSERT INTO student values ('10', 'Venus'); diff --git a/src/test/resources/rml-core/RMLTC0002i-PostgreSQL/mapping.ttl b/src/test/resources/rml-core/RMLTC0002i-PostgreSQL/mapping.ttl deleted file mode 100644 index 59e2fa5e..00000000 --- a/src/test/resources/rml-core/RMLTC0002i-PostgreSQL/mapping.ttl +++ /dev/null @@ -1,25 +0,0 @@ -@prefix d2rq: . -@prefix ex: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:iterator "SELECT Name FROM student"; - rml:referenceFormulation rml:SQL2008Query; - rml:source - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "IDs" - ]; - rml:predicate ex:id - ]; - rml:subjectMap [ - rml:template "http://example.com/{ID}/{Name}" - ] . - - a d2rq:Database; - d2rq:jdbcDSN "CONNECTIONDSN"; - d2rq:jdbcDriver "org.postgresql.Driver"; - d2rq:password ""; - d2rq:username "postgres" . diff --git a/src/test/resources/rml-core/RMLTC0002i-PostgreSQL/resource.sql b/src/test/resources/rml-core/RMLTC0002i-PostgreSQL/resource.sql deleted file mode 100644 index 80957756..00000000 --- a/src/test/resources/rml-core/RMLTC0002i-PostgreSQL/resource.sql +++ /dev/null @@ -1,6 +0,0 @@ -DROP TABLE IF EXISTS student CASCADE ; -CREATE TABLE student ( - "ID" INTEGER, - "Name" VARCHAR(50) -); -INSERT INTO student values ('10', 'Venus'); diff --git a/src/test/resources/rml-core/RMLTC0002i-SQLServer/mapping.ttl b/src/test/resources/rml-core/RMLTC0002i-SQLServer/mapping.ttl deleted file mode 100644 index 0cbaf16f..00000000 --- a/src/test/resources/rml-core/RMLTC0002i-SQLServer/mapping.ttl +++ /dev/null @@ -1,25 +0,0 @@ -@prefix d2rq: . -@prefix ex: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:iterator "SELECT Name FROM student"; - rml:referenceFormulation rml:SQL2008Query; - rml:source - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "IDs" - ]; - rml:predicate ex:id - ]; - rml:subjectMap [ - rml:template "http://example.com/{ID}/{Name}" - ] . - - a d2rq:Database; - d2rq:jdbcDSN "CONNECTIONDSN"; - d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver"; - d2rq:password "YourSTRONG!Passw0rd;"; - d2rq:username "sa" . diff --git a/src/test/resources/rml-core/RMLTC0002i-SQLServer/resource.sql b/src/test/resources/rml-core/RMLTC0002i-SQLServer/resource.sql deleted file mode 100644 index 7403a330..00000000 --- a/src/test/resources/rml-core/RMLTC0002i-SQLServer/resource.sql +++ /dev/null @@ -1,9 +0,0 @@ -USE TestDB; -EXEC sp_msforeachtable 'ALTER TABLE ? NOCHECK CONSTRAINT all' -EXEC sp_msforeachtable 'DROP TABLE ?' - -CREATE TABLE student ( - "ID" INTEGER, - "Name" VARCHAR(50) -); -INSERT INTO student values ('10', 'Venus'); diff --git a/src/test/resources/rml-core/RMLTC0002j-MySQL/mapping.ttl b/src/test/resources/rml-core/RMLTC0002j-MySQL/mapping.ttl deleted file mode 100644 index c691b7eb..00000000 --- a/src/test/resources/rml-core/RMLTC0002j-MySQL/mapping.ttl +++ /dev/null @@ -1,25 +0,0 @@ -@prefix d2rq: . -@prefix ex: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:iterator "SELECT NoColumnName, Name FROM student"; - rml:referenceFormulation rml:SQL2008Query; - rml:source - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "IDs" - ]; - rml:predicate ex:id - ]; - rml:subjectMap [ - rml:template "http://example.com/{ID}/{Name}" - ] . - - a d2rq:Database; - d2rq:jdbcDSN "CONNECTIONDSN"; - d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver"; - d2rq:password ""; - d2rq:username "root" . diff --git a/src/test/resources/rml-core/RMLTC0002j-MySQL/resource.sql b/src/test/resources/rml-core/RMLTC0002j-MySQL/resource.sql deleted file mode 100644 index a68415ac..00000000 --- a/src/test/resources/rml-core/RMLTC0002j-MySQL/resource.sql +++ /dev/null @@ -1,7 +0,0 @@ -USE test; -DROP TABLE IF EXISTS test.student; -CREATE TABLE student ( - ID INTEGER, - Name VARCHAR(50) -); -INSERT INTO student values ('10', 'Venus'); diff --git a/src/test/resources/rml-core/RMLTC0002j-PostgreSQL/mapping.ttl b/src/test/resources/rml-core/RMLTC0002j-PostgreSQL/mapping.ttl deleted file mode 100644 index 170765ed..00000000 --- a/src/test/resources/rml-core/RMLTC0002j-PostgreSQL/mapping.ttl +++ /dev/null @@ -1,25 +0,0 @@ -@prefix d2rq: . -@prefix ex: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:iterator "SELECT NoColumnName, Name FROM student"; - rml:referenceFormulation rml:SQL2008Query; - rml:source - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "IDs" - ]; - rml:predicate ex:id - ]; - rml:subjectMap [ - rml:template "http://example.com/{ID}/{Name}" - ] . - - a d2rq:Database; - d2rq:jdbcDSN "CONNECTIONDSN"; - d2rq:jdbcDriver "org.postgresql.Driver"; - d2rq:password ""; - d2rq:username "postgres" . diff --git a/src/test/resources/rml-core/RMLTC0002j-PostgreSQL/resource.sql b/src/test/resources/rml-core/RMLTC0002j-PostgreSQL/resource.sql deleted file mode 100644 index 80957756..00000000 --- a/src/test/resources/rml-core/RMLTC0002j-PostgreSQL/resource.sql +++ /dev/null @@ -1,6 +0,0 @@ -DROP TABLE IF EXISTS student CASCADE ; -CREATE TABLE student ( - "ID" INTEGER, - "Name" VARCHAR(50) -); -INSERT INTO student values ('10', 'Venus'); diff --git a/src/test/resources/rml-core/RMLTC0002j-SQLServer/mapping.ttl b/src/test/resources/rml-core/RMLTC0002j-SQLServer/mapping.ttl deleted file mode 100644 index 0cf92cf3..00000000 --- a/src/test/resources/rml-core/RMLTC0002j-SQLServer/mapping.ttl +++ /dev/null @@ -1,25 +0,0 @@ -@prefix d2rq: . -@prefix ex: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:iterator "SELECT NoColumnName, Name FROM student"; - rml:referenceFormulation rml:SQL2008Query; - rml:source - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "IDs" - ]; - rml:predicate ex:id - ]; - rml:subjectMap [ - rml:template "http://example.com/{ID}/{Name}" - ] . - - a d2rq:Database; - d2rq:jdbcDSN "CONNECTIONDSN"; - d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver"; - d2rq:password "YourSTRONG!Passw0rd;"; - d2rq:username "sa" . diff --git a/src/test/resources/rml-core/RMLTC0002j-SQLServer/resource.sql b/src/test/resources/rml-core/RMLTC0002j-SQLServer/resource.sql deleted file mode 100644 index 7403a330..00000000 --- a/src/test/resources/rml-core/RMLTC0002j-SQLServer/resource.sql +++ /dev/null @@ -1,9 +0,0 @@ -USE TestDB; -EXEC sp_msforeachtable 'ALTER TABLE ? NOCHECK CONSTRAINT all' -EXEC sp_msforeachtable 'DROP TABLE ?' - -CREATE TABLE student ( - "ID" INTEGER, - "Name" VARCHAR(50) -); -INSERT INTO student values ('10', 'Venus'); diff --git a/src/test/resources/rml-core/RMLTC0003a-MySQL/mapping.ttl b/src/test/resources/rml-core/RMLTC0003a-MySQL/mapping.ttl deleted file mode 100644 index bb5ea67a..00000000 --- a/src/test/resources/rml-core/RMLTC0003a-MySQL/mapping.ttl +++ /dev/null @@ -1,25 +0,0 @@ -@prefix d2rq: . -@prefix ex: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:iterator "SELECT FirstName, LastName FROM student"; - rml:referenceFormulation rml:SQL2008Query; - rml:source - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "IDs" - ]; - rml:predicate ex:id - ]; - rml:subjectMap [ - rml:template "http://example.com/{ID}/{Name}" - ] . - - a d2rq:Database; - d2rq:jdbcDSN "CONNECTIONDSN"; - d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver"; - d2rq:password ""; - d2rq:username "root" . diff --git a/src/test/resources/rml-core/RMLTC0003a-MySQL/resource.sql b/src/test/resources/rml-core/RMLTC0003a-MySQL/resource.sql deleted file mode 100644 index 6a1a3f3e..00000000 --- a/src/test/resources/rml-core/RMLTC0003a-MySQL/resource.sql +++ /dev/null @@ -1,8 +0,0 @@ -USE test; -DROP TABLE IF EXISTS test.student; -CREATE TABLE student ( - ID INTEGER, - FirstName VARCHAR(50), - LastName VARCHAR(50) -); -INSERT INTO student values ('10', 'Venus', 'Williams'); diff --git a/src/test/resources/rml-core/RMLTC0003a-PostgreSQL/mapping.ttl b/src/test/resources/rml-core/RMLTC0003a-PostgreSQL/mapping.ttl deleted file mode 100644 index 69f4c6a6..00000000 --- a/src/test/resources/rml-core/RMLTC0003a-PostgreSQL/mapping.ttl +++ /dev/null @@ -1,25 +0,0 @@ -@prefix d2rq: . -@prefix ex: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:iterator "SELECT FirstName, LastName FROM student"; - rml:referenceFormulation rml:SQL2008Query; - rml:source - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "IDs" - ]; - rml:predicate ex:id - ]; - rml:subjectMap [ - rml:template "http://example.com/{ID}/{Name}" - ] . - - a d2rq:Database; - d2rq:jdbcDSN "CONNECTIONDSN"; - d2rq:jdbcDriver "org.postgresql.Driver"; - d2rq:password ""; - d2rq:username "postgres" . diff --git a/src/test/resources/rml-core/RMLTC0003a-PostgreSQL/resource.sql b/src/test/resources/rml-core/RMLTC0003a-PostgreSQL/resource.sql deleted file mode 100644 index 339e52c6..00000000 --- a/src/test/resources/rml-core/RMLTC0003a-PostgreSQL/resource.sql +++ /dev/null @@ -1,7 +0,0 @@ -DROP TABLE IF EXISTS student CASCADE ; -CREATE TABLE student ( - "ID" INTEGER, - "FirstName" VARCHAR(50), - "LastName" VARCHAR(50) -); -INSERT INTO student values ('10', 'Venus', 'Williams'); diff --git a/src/test/resources/rml-core/RMLTC0003a-SQLServer/mapping.ttl b/src/test/resources/rml-core/RMLTC0003a-SQLServer/mapping.ttl deleted file mode 100644 index b6120db4..00000000 --- a/src/test/resources/rml-core/RMLTC0003a-SQLServer/mapping.ttl +++ /dev/null @@ -1,25 +0,0 @@ -@prefix d2rq: . -@prefix ex: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:iterator "SELECT FirstName, LastName FROM student"; - rml:referenceFormulation rml:SQL2008Query; - rml:source - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "IDs" - ]; - rml:predicate ex:id - ]; - rml:subjectMap [ - rml:template "http://example.com/{ID}/{Name}" - ] . - - a d2rq:Database; - d2rq:jdbcDSN "CONNECTIONDSN"; - d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver"; - d2rq:password "YourSTRONG!Passw0rd;"; - d2rq:username "sa" . diff --git a/src/test/resources/rml-core/RMLTC0003a-SQLServer/resource.sql b/src/test/resources/rml-core/RMLTC0003a-SQLServer/resource.sql deleted file mode 100644 index 13f10776..00000000 --- a/src/test/resources/rml-core/RMLTC0003a-SQLServer/resource.sql +++ /dev/null @@ -1,10 +0,0 @@ -USE TestDB; -EXEC sp_msforeachtable 'ALTER TABLE ? NOCHECK CONSTRAINT all' -EXEC sp_msforeachtable 'DROP TABLE ?' - -CREATE TABLE student ( - "ID" INTEGER, - "FirstName" VARCHAR(50), - "LastName" VARCHAR(50) -); -INSERT INTO student values ('10', 'Venus', 'Williams'); diff --git a/src/test/resources/rml-core/RMLTC0003b-MySQL/mapping.ttl b/src/test/resources/rml-core/RMLTC0003b-MySQL/mapping.ttl deleted file mode 100644 index 3b68c9b5..00000000 --- a/src/test/resources/rml-core/RMLTC0003b-MySQL/mapping.ttl +++ /dev/null @@ -1,26 +0,0 @@ -@prefix d2rq: . -@prefix foaf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:iterator "SELECT ID, LastName, CONCAT(`FirstName`, '', `LastName`) as Name FROM student"; - rml:referenceFormulation rml:SQL2008Query; - rml:source - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "Name"; - rml:termType rml:Literal - ]; - rml:predicate foaf:name - ]; - rml:subjectMap [ - rml:template "http://example.com/{ID}/{LastName}" - ] . - - a d2rq:Database; - d2rq:jdbcDSN "CONNECTIONDSN"; - d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver"; - d2rq:password ""; - d2rq:username "root" . diff --git a/src/test/resources/rml-core/RMLTC0003b-MySQL/output.nq b/src/test/resources/rml-core/RMLTC0003b-MySQL/output.nq deleted file mode 100644 index 4ba0d6f1..00000000 --- a/src/test/resources/rml-core/RMLTC0003b-MySQL/output.nq +++ /dev/null @@ -1 +0,0 @@ - "VenusWilliams" . \ No newline at end of file diff --git a/src/test/resources/rml-core/RMLTC0003b-MySQL/resource.sql b/src/test/resources/rml-core/RMLTC0003b-MySQL/resource.sql deleted file mode 100644 index 6a1a3f3e..00000000 --- a/src/test/resources/rml-core/RMLTC0003b-MySQL/resource.sql +++ /dev/null @@ -1,8 +0,0 @@ -USE test; -DROP TABLE IF EXISTS test.student; -CREATE TABLE student ( - ID INTEGER, - FirstName VARCHAR(50), - LastName VARCHAR(50) -); -INSERT INTO student values ('10', 'Venus', 'Williams'); diff --git a/src/test/resources/rml-core/RMLTC0003b-PostgreSQL/mapping.ttl b/src/test/resources/rml-core/RMLTC0003b-PostgreSQL/mapping.ttl deleted file mode 100644 index 12ae8dd6..00000000 --- a/src/test/resources/rml-core/RMLTC0003b-PostgreSQL/mapping.ttl +++ /dev/null @@ -1,26 +0,0 @@ -@prefix d2rq: . -@prefix foaf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:iterator "SELECT id, lastname, concat_ws(firstname, '', lastname) as name FROM student"; - rml:referenceFormulation rml:SQL2008Query; - rml:source - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "name"; - rml:termType rml:Literal - ]; - rml:predicate foaf:name - ]; - rml:subjectMap [ - rml:template "http://example.com/{id}/{lastname}" - ] . - - a d2rq:Database; - d2rq:jdbcDSN "CONNECTIONDSN"; - d2rq:jdbcDriver "org.postgresql.Driver"; - d2rq:password ""; - d2rq:username "postgres" . diff --git a/src/test/resources/rml-core/RMLTC0003b-PostgreSQL/output.nq b/src/test/resources/rml-core/RMLTC0003b-PostgreSQL/output.nq deleted file mode 100644 index 4ba0d6f1..00000000 --- a/src/test/resources/rml-core/RMLTC0003b-PostgreSQL/output.nq +++ /dev/null @@ -1 +0,0 @@ - "VenusWilliams" . \ No newline at end of file diff --git a/src/test/resources/rml-core/RMLTC0003b-PostgreSQL/resource.sql b/src/test/resources/rml-core/RMLTC0003b-PostgreSQL/resource.sql deleted file mode 100644 index c9b85352..00000000 --- a/src/test/resources/rml-core/RMLTC0003b-PostgreSQL/resource.sql +++ /dev/null @@ -1,7 +0,0 @@ -DROP TABLE IF EXISTS student CASCADE ; -CREATE TABLE student ( - id INTEGER, - firstname VARCHAR(50), - lastname VARCHAR(50) -); -INSERT INTO student values ('10', 'Venus', 'Williams'); diff --git a/src/test/resources/rml-core/RMLTC0003b-SQLServer/mapping.ttl b/src/test/resources/rml-core/RMLTC0003b-SQLServer/mapping.ttl deleted file mode 100644 index ff4018ea..00000000 --- a/src/test/resources/rml-core/RMLTC0003b-SQLServer/mapping.ttl +++ /dev/null @@ -1,26 +0,0 @@ -@prefix d2rq: . -@prefix foaf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:iterator "SELECT ID, LastName, concat_ws(FirstName, '', LastName) as Name FROM student"; - rml:referenceFormulation rml:SQL2008Query; - rml:source - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "Name"; - rml:termType rml:Literal - ]; - rml:predicate foaf:name - ]; - rml:subjectMap [ - rml:template "http://example.com/{ID}/{LastName}" - ] . - - a d2rq:Database; - d2rq:jdbcDSN "CONNECTIONDSN"; - d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver"; - d2rq:password "YourSTRONG!Passw0rd;"; - d2rq:username "sa" . diff --git a/src/test/resources/rml-core/RMLTC0003b-SQLServer/output.nq b/src/test/resources/rml-core/RMLTC0003b-SQLServer/output.nq deleted file mode 100644 index 4ba0d6f1..00000000 --- a/src/test/resources/rml-core/RMLTC0003b-SQLServer/output.nq +++ /dev/null @@ -1 +0,0 @@ - "VenusWilliams" . \ No newline at end of file diff --git a/src/test/resources/rml-core/RMLTC0003b-SQLServer/resource.sql b/src/test/resources/rml-core/RMLTC0003b-SQLServer/resource.sql deleted file mode 100644 index 13f10776..00000000 --- a/src/test/resources/rml-core/RMLTC0003b-SQLServer/resource.sql +++ /dev/null @@ -1,10 +0,0 @@ -USE TestDB; -EXEC sp_msforeachtable 'ALTER TABLE ? NOCHECK CONSTRAINT all' -EXEC sp_msforeachtable 'DROP TABLE ?' - -CREATE TABLE student ( - "ID" INTEGER, - "FirstName" VARCHAR(50), - "LastName" VARCHAR(50) -); -INSERT INTO student values ('10', 'Venus', 'Williams'); diff --git a/src/test/resources/rml-core/RMLTC0003c-CSV/mapping.ttl b/src/test/resources/rml-core/RMLTC0003c-CSV/mapping.ttl deleted file mode 100644 index e0a70f33..00000000 --- a/src/test/resources/rml-core/RMLTC0003c-CSV/mapping.ttl +++ /dev/null @@ -1,21 +0,0 @@ -@prefix foaf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:referenceFormulation rml:CSV; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.csv" - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:template "{FirstName} {LastName}"; - rml:termType rml:Literal - ]; - rml:predicate foaf:name - ]; - rml:subjectMap [ - rml:template "http://example.com/Student{ID}" - ] . diff --git a/src/test/resources/rml-core/RMLTC0003c-CSV/output.nq b/src/test/resources/rml-core/RMLTC0003c-CSV/output.nq deleted file mode 100644 index 180f90c2..00000000 --- a/src/test/resources/rml-core/RMLTC0003c-CSV/output.nq +++ /dev/null @@ -1 +0,0 @@ - "Venus Williams" . diff --git a/src/test/resources/rml-core/RMLTC0003c-CSV/student.csv b/src/test/resources/rml-core/RMLTC0003c-CSV/student.csv deleted file mode 100644 index 1851cef9..00000000 --- a/src/test/resources/rml-core/RMLTC0003c-CSV/student.csv +++ /dev/null @@ -1,2 +0,0 @@ -ID,FirstName,LastName -10,Venus,Williams diff --git a/src/test/resources/rml-core/RMLTC0003c-JSON/README.md b/src/test/resources/rml-core/RMLTC0003c-JSON/README.md new file mode 100644 index 00000000..722070b0 --- /dev/null +++ b/src/test/resources/rml-core/RMLTC0003c-JSON/README.md @@ -0,0 +1,55 @@ +## RMLTC0003c-JSON + +**Title**: "Three columns mapping, by using a rml:template to produce literal" + +**Description**: "Tests: (1) three column mapping; and (2) the use of rml:template to produce literal" + +**Default Base IRI**: http://example.com/ + +**Error expected?** No + +**Input** +``` +{ + "students": [{ + "ID": 10, + "FirstName":"Venus", + "LastName":"Williams" + }] +} + +``` + +**Mapping** +``` +@prefix foaf: . +@prefix rml: . + + a rml:TriplesMap; + rml:logicalSource [ a rml:LogicalSource; + rml:iterator "$.students[*]"; + rml:referenceFormulation rml:JSONPath; + rml:source [ a rml:RelativePathSource; + rml:root rml:MappingDirectory; + rml:path "student.json" + ] + ]; + rml:predicateObjectMap [ + rml:objectMap [ + rml:template "{$.FirstName} {$.LastName}"; + rml:termType rml:Literal + ]; + rml:predicate foaf:name + ]; + rml:subjectMap [ + rml:template "http://example.com/Student{$.ID}" + ] . + +``` + +**Output** +``` + "Venus Williams" . + +``` + diff --git a/src/test/resources/rml-core/RMLTC0003c-JSON/mapping.ttl b/src/test/resources/rml-core/RMLTC0003c-JSON/mapping.ttl index 482bcf9c..0b42150f 100644 --- a/src/test/resources/rml-core/RMLTC0003c-JSON/mapping.ttl +++ b/src/test/resources/rml-core/RMLTC0003c-JSON/mapping.ttl @@ -12,11 +12,11 @@ ]; rml:predicateObjectMap [ rml:objectMap [ - rml:template "{FirstName} {LastName}"; + rml:template "{$.FirstName} {$.LastName}"; rml:termType rml:Literal ]; rml:predicate foaf:name ]; rml:subjectMap [ - rml:template "http://example.com/Student{ID}" + rml:template "http://example.com/Student{$.ID}" ] . diff --git a/src/test/resources/rml-core/RMLTC0003c-MySQL/mapping.ttl b/src/test/resources/rml-core/RMLTC0003c-MySQL/mapping.ttl deleted file mode 100644 index c9d5d266..00000000 --- a/src/test/resources/rml-core/RMLTC0003c-MySQL/mapping.ttl +++ /dev/null @@ -1,26 +0,0 @@ -@prefix d2rq: . -@prefix foaf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source ; - rml:referenceFormulation rml:SQL2008Table; - rml:iterator "student" - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:template "{FirstName} {LastName}"; - rml:termType rml:Literal - ]; - rml:predicate foaf:name - ]; - rml:subjectMap [ - rml:template "http://example.com/Student{ID}" - ] . - - a d2rq:Database; - d2rq:jdbcDSN "CONNECTIONDSN"; - d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver"; - d2rq:password ""; - d2rq:username "root" . diff --git a/src/test/resources/rml-core/RMLTC0003c-MySQL/output.nq b/src/test/resources/rml-core/RMLTC0003c-MySQL/output.nq deleted file mode 100644 index 180f90c2..00000000 --- a/src/test/resources/rml-core/RMLTC0003c-MySQL/output.nq +++ /dev/null @@ -1 +0,0 @@ - "Venus Williams" . diff --git a/src/test/resources/rml-core/RMLTC0003c-MySQL/resource.sql b/src/test/resources/rml-core/RMLTC0003c-MySQL/resource.sql deleted file mode 100644 index 0135d051..00000000 --- a/src/test/resources/rml-core/RMLTC0003c-MySQL/resource.sql +++ /dev/null @@ -1,9 +0,0 @@ -USE test; -DROP TABLE IF EXISTS test.student; - -CREATE TABLE student ( - ID INTEGER, - FirstName VARCHAR(50), - LastName VARCHAR(50) -); -INSERT INTO student values ('10', 'Venus', 'Williams'); diff --git a/src/test/resources/rml-core/RMLTC0003c-PostgreSQL/mapping.ttl b/src/test/resources/rml-core/RMLTC0003c-PostgreSQL/mapping.ttl deleted file mode 100644 index d4c7bea0..00000000 --- a/src/test/resources/rml-core/RMLTC0003c-PostgreSQL/mapping.ttl +++ /dev/null @@ -1,26 +0,0 @@ -@prefix d2rq: . -@prefix foaf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source ; - rml:referenceFormulation rml:SQL2008Table; - rml:iterator "student" - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:template "{FirstName} {LastName}"; - rml:termType rml:Literal - ]; - rml:predicate foaf:name - ]; - rml:subjectMap [ - rml:template "http://example.com/Student{ID}" - ] . - - a d2rq:Database; - d2rq:jdbcDSN "CONNECTIONDSN"; - d2rq:jdbcDriver "org.postgresql.Driver"; - d2rq:password ""; - d2rq:username "postgres" . diff --git a/src/test/resources/rml-core/RMLTC0003c-PostgreSQL/output.nq b/src/test/resources/rml-core/RMLTC0003c-PostgreSQL/output.nq deleted file mode 100644 index 180f90c2..00000000 --- a/src/test/resources/rml-core/RMLTC0003c-PostgreSQL/output.nq +++ /dev/null @@ -1 +0,0 @@ - "Venus Williams" . diff --git a/src/test/resources/rml-core/RMLTC0003c-PostgreSQL/resource.sql b/src/test/resources/rml-core/RMLTC0003c-PostgreSQL/resource.sql deleted file mode 100644 index 339e52c6..00000000 --- a/src/test/resources/rml-core/RMLTC0003c-PostgreSQL/resource.sql +++ /dev/null @@ -1,7 +0,0 @@ -DROP TABLE IF EXISTS student CASCADE ; -CREATE TABLE student ( - "ID" INTEGER, - "FirstName" VARCHAR(50), - "LastName" VARCHAR(50) -); -INSERT INTO student values ('10', 'Venus', 'Williams'); diff --git a/src/test/resources/rml-core/RMLTC0003c-SPARQL/mapping.ttl b/src/test/resources/rml-core/RMLTC0003c-SPARQL/mapping.ttl deleted file mode 100644 index 3e576f26..00000000 --- a/src/test/resources/rml-core/RMLTC0003c-SPARQL/mapping.ttl +++ /dev/null @@ -1,33 +0,0 @@ -@prefix foaf: . -@prefix formats: . -@prefix rml: . -@prefix sd: . - - rml:logicalSource [ - rml:iterator """ - PREFIX rdfs: - PREFIX foaf: - PREFIX rdf: - SELECT ?FirstName ?LastName ?ID - WHERE { - ?x foaf:firstName ?FirstName ; - foaf:lastName ?LastName ; - rdf:ID ?ID . - } """; - rml:referenceFormulation formats:SPARQL_Results_JSON; - rml:source - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:template "{FirstName.value} {LastName.value}"; - rml:termType rml:Literal - ]; - rml:predicate foaf:name - ]; - rml:subjectMap [ - rml:template "http://example.com/Student{ID.value}" - ] . - - a sd:Service; - sd:endpoint ; - sd:supportedLanguage sd:SPARQL11Query . diff --git a/src/test/resources/rml-core/RMLTC0003c-SPARQL/output.nq b/src/test/resources/rml-core/RMLTC0003c-SPARQL/output.nq deleted file mode 100644 index 180f90c2..00000000 --- a/src/test/resources/rml-core/RMLTC0003c-SPARQL/output.nq +++ /dev/null @@ -1 +0,0 @@ - "Venus Williams" . diff --git a/src/test/resources/rml-core/RMLTC0003c-SPARQL/resource.ttl b/src/test/resources/rml-core/RMLTC0003c-SPARQL/resource.ttl deleted file mode 100644 index f4a7ed47..00000000 --- a/src/test/resources/rml-core/RMLTC0003c-SPARQL/resource.ttl +++ /dev/null @@ -1,7 +0,0 @@ -@prefix foaf: . -@prefix rdf: . - -[] rdf:ID "10" ; - foaf:firstName "Venus" ; - foaf:lastName "Williams" . - diff --git a/src/test/resources/rml-core/RMLTC0003c-SQLServer/mapping.ttl b/src/test/resources/rml-core/RMLTC0003c-SQLServer/mapping.ttl deleted file mode 100644 index 8b4b1bb6..00000000 --- a/src/test/resources/rml-core/RMLTC0003c-SQLServer/mapping.ttl +++ /dev/null @@ -1,26 +0,0 @@ -@prefix d2rq: . -@prefix foaf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source ; - rml:referenceFormulation rml:SQL2008Table; - rml:iterator "student" - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:template "{FirstName} {LastName}"; - rml:termType rml:Literal - ]; - rml:predicate foaf:name - ]; - rml:subjectMap [ - rml:template "http://example.com/Student{ID}" - ] . - - a d2rq:Database; - d2rq:jdbcDSN "CONNECTIONDSN"; - d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver"; - d2rq:password "YourSTRONG!Passw0rd;"; - d2rq:username "sa" . diff --git a/src/test/resources/rml-core/RMLTC0003c-SQLServer/output.nq b/src/test/resources/rml-core/RMLTC0003c-SQLServer/output.nq deleted file mode 100644 index 180f90c2..00000000 --- a/src/test/resources/rml-core/RMLTC0003c-SQLServer/output.nq +++ /dev/null @@ -1 +0,0 @@ - "Venus Williams" . diff --git a/src/test/resources/rml-core/RMLTC0003c-SQLServer/resource.sql b/src/test/resources/rml-core/RMLTC0003c-SQLServer/resource.sql deleted file mode 100644 index 13f10776..00000000 --- a/src/test/resources/rml-core/RMLTC0003c-SQLServer/resource.sql +++ /dev/null @@ -1,10 +0,0 @@ -USE TestDB; -EXEC sp_msforeachtable 'ALTER TABLE ? NOCHECK CONSTRAINT all' -EXEC sp_msforeachtable 'DROP TABLE ?' - -CREATE TABLE student ( - "ID" INTEGER, - "FirstName" VARCHAR(50), - "LastName" VARCHAR(50) -); -INSERT INTO student values ('10', 'Venus', 'Williams'); diff --git a/src/test/resources/rml-core/RMLTC0003c-XML/mapping.ttl b/src/test/resources/rml-core/RMLTC0003c-XML/mapping.ttl deleted file mode 100644 index 87372229..00000000 --- a/src/test/resources/rml-core/RMLTC0003c-XML/mapping.ttl +++ /dev/null @@ -1,22 +0,0 @@ -@prefix foaf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator "/students/student"; - rml:referenceFormulation rml:XPath; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.xml" - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:template "{FirstName} {LastName}"; - rml:termType rml:Literal - ]; - rml:predicate foaf:name - ]; - rml:subjectMap [ - rml:template "http://example.com/Student{ID}" - ] . diff --git a/src/test/resources/rml-core/RMLTC0003c-XML/output.nq b/src/test/resources/rml-core/RMLTC0003c-XML/output.nq deleted file mode 100644 index 180f90c2..00000000 --- a/src/test/resources/rml-core/RMLTC0003c-XML/output.nq +++ /dev/null @@ -1 +0,0 @@ - "Venus Williams" . diff --git a/src/test/resources/rml-core/RMLTC0003c-XML/student.xml b/src/test/resources/rml-core/RMLTC0003c-XML/student.xml deleted file mode 100644 index 44eab80f..00000000 --- a/src/test/resources/rml-core/RMLTC0003c-XML/student.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - 10 - Venus - Williams - - diff --git a/src/test/resources/rml-core/RMLTC0004a-CSV/mapping.ttl b/src/test/resources/rml-core/RMLTC0004a-CSV/mapping.ttl deleted file mode 100644 index e2fd7725..00000000 --- a/src/test/resources/rml-core/RMLTC0004a-CSV/mapping.ttl +++ /dev/null @@ -1,41 +0,0 @@ -@prefix ex: . -@prefix foaf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:referenceFormulation rml:CSV; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student_sport.csv" - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "Student" - ]; - rml:predicate foaf:name - ]; - rml:subjectMap [ - rml:class ex:Student; - rml:template "http://example.com/{Student}" - ] . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:referenceFormulation rml:CSV; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student_sport.csv" - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "Sport" - ]; - rml:predicate foaf:name - ]; - rml:subjectMap [ - rml:class ex:Sport; - rml:template "http://example.com/{Sport}" - ] . diff --git a/src/test/resources/rml-core/RMLTC0004a-CSV/output.nq b/src/test/resources/rml-core/RMLTC0004a-CSV/output.nq deleted file mode 100644 index 164ca8ba..00000000 --- a/src/test/resources/rml-core/RMLTC0004a-CSV/output.nq +++ /dev/null @@ -1,5 +0,0 @@ - "Venus" . - . - "Tennis" . - . - diff --git a/src/test/resources/rml-core/RMLTC0004a-CSV/student_sport.csv b/src/test/resources/rml-core/RMLTC0004a-CSV/student_sport.csv deleted file mode 100644 index 3c88eaa3..00000000 --- a/src/test/resources/rml-core/RMLTC0004a-CSV/student_sport.csv +++ /dev/null @@ -1,2 +0,0 @@ -Student,Sport -Venus,Tennis diff --git a/src/test/resources/rml-core/RMLTC0004a-JSON/README.md b/src/test/resources/rml-core/RMLTC0004a-JSON/README.md new file mode 100644 index 00000000..9930094b --- /dev/null +++ b/src/test/resources/rml-core/RMLTC0004a-JSON/README.md @@ -0,0 +1,79 @@ +## RMLTC0004a-JSON + +**Title**: "Two column mapping, from one row table to two different triples" + +**Description**: "Tests: (1) two column mapping, (2) subject URI generated by a column value; (3) from one row table to two different triples (4) typing by using rml:class" + +**Default Base IRI**: http://example.com/ + +**Error expected?** No + +**Input** +``` +{ + "students": [{ + "Student": "Venus", + "Sport":"Tennis" + }] +} + +``` + +**Mapping** +``` +@prefix ex: . +@prefix foaf: . +@prefix rml: . + + a rml:TriplesMap; + rml:logicalSource [ a rml:LogicalSource; + rml:iterator "$.students[*]"; + rml:referenceFormulation rml:JSONPath; + rml:source [ a rml:RelativePathSource; + rml:root rml:MappingDirectory; + rml:path "student_sport.json" + ] + ]; + rml:predicateObjectMap [ + rml:objectMap [ + rml:reference "$.Student" + ]; + rml:predicate foaf:name + ]; + rml:subjectMap [ + rml:class ex:Student; + rml:template "http://example.com/{$.Student}" + ] . + + a rml:TriplesMap; + rml:logicalSource [ a rml:LogicalSource; + rml:iterator "$.students[*]"; + rml:referenceFormulation rml:JSONPath; + rml:source [ a rml:RelativePathSource; + rml:root rml:MappingDirectory; + rml:path "student_sport.json" + ] + ]; + rml:predicateObjectMap [ + rml:objectMap [ + rml:reference "$.Sport" + ]; + rml:predicate foaf:name + ]; + rml:subjectMap [ + rml:class ex:Sport; + rml:template "http://example.com/{$.Sport}" + ] . + +``` + +**Output** +``` + "Venus" . + . + "Tennis" . + . + + +``` + diff --git a/src/test/resources/rml-core/RMLTC0004a-JSON/mapping.ttl b/src/test/resources/rml-core/RMLTC0004a-JSON/mapping.ttl index bc212d7f..ff87cbc9 100644 --- a/src/test/resources/rml-core/RMLTC0004a-JSON/mapping.ttl +++ b/src/test/resources/rml-core/RMLTC0004a-JSON/mapping.ttl @@ -13,13 +13,13 @@ ]; rml:predicateObjectMap [ rml:objectMap [ - rml:reference "Student" + rml:reference "$.Student" ]; rml:predicate foaf:name ]; rml:subjectMap [ rml:class ex:Student; - rml:template "http://example.com/{Student}" + rml:template "http://example.com/{$.Student}" ] . a rml:TriplesMap; @@ -33,11 +33,11 @@ ]; rml:predicateObjectMap [ rml:objectMap [ - rml:reference "Sport" + rml:reference "$.Sport" ]; rml:predicate foaf:name ]; rml:subjectMap [ rml:class ex:Sport; - rml:template "http://example.com/{Sport}" + rml:template "http://example.com/{$.Sport}" ] . diff --git a/src/test/resources/rml-core/RMLTC0004a-MySQL/mapping.ttl b/src/test/resources/rml-core/RMLTC0004a-MySQL/mapping.ttl deleted file mode 100644 index 51eaa9f7..00000000 --- a/src/test/resources/rml-core/RMLTC0004a-MySQL/mapping.ttl +++ /dev/null @@ -1,44 +0,0 @@ -@prefix d2rq: . -@prefix ex: . -@prefix foaf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source ; - rml:referenceFormulation rml:SQL2008Table; - rml:iterator "student_sport" - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "Student" - ]; - rml:predicate foaf:name - ]; - rml:subjectMap [ - rml:class ex:Student; - rml:template "http://example.com/{Student}" - ] . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source ; - rml:referenceFormulation rml:SQL2008Table; - rml:iterator "student_sport" - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "Sport" - ]; - rml:predicate foaf:name - ]; - rml:subjectMap [ - rml:class ex:Sport; - rml:template "http://example.com/{Sport}" - ] . - - a d2rq:Database; - d2rq:jdbcDSN "CONNECTIONDSN"; - d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver"; - d2rq:password ""; - d2rq:username "root" . diff --git a/src/test/resources/rml-core/RMLTC0004a-MySQL/output.nq b/src/test/resources/rml-core/RMLTC0004a-MySQL/output.nq deleted file mode 100644 index 164ca8ba..00000000 --- a/src/test/resources/rml-core/RMLTC0004a-MySQL/output.nq +++ /dev/null @@ -1,5 +0,0 @@ - "Venus" . - . - "Tennis" . - . - diff --git a/src/test/resources/rml-core/RMLTC0004a-MySQL/resource.sql b/src/test/resources/rml-core/RMLTC0004a-MySQL/resource.sql deleted file mode 100644 index a98ea0fa..00000000 --- a/src/test/resources/rml-core/RMLTC0004a-MySQL/resource.sql +++ /dev/null @@ -1,8 +0,0 @@ -USE test; -DROP TABLE IF EXISTS test.student_sport; - -CREATE TABLE student_sport ( - Student VARCHAR(50), - Sport VARCHAR(50) -); -INSERT INTO student_sport values ('Venus', 'Tennis'); diff --git a/src/test/resources/rml-core/RMLTC0004a-MySQL/student_sport.csv b/src/test/resources/rml-core/RMLTC0004a-MySQL/student_sport.csv deleted file mode 100644 index 3c88eaa3..00000000 --- a/src/test/resources/rml-core/RMLTC0004a-MySQL/student_sport.csv +++ /dev/null @@ -1,2 +0,0 @@ -Student,Sport -Venus,Tennis diff --git a/src/test/resources/rml-core/RMLTC0004a-PostgreSQL/mapping.ttl b/src/test/resources/rml-core/RMLTC0004a-PostgreSQL/mapping.ttl deleted file mode 100644 index b1f8ac41..00000000 --- a/src/test/resources/rml-core/RMLTC0004a-PostgreSQL/mapping.ttl +++ /dev/null @@ -1,44 +0,0 @@ -@prefix d2rq: . -@prefix ex: . -@prefix foaf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source ; - rml:referenceFormulation rml:SQL2008Table; - rml:iterator "student_sport" - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "Student" - ]; - rml:predicate foaf:name - ]; - rml:subjectMap [ - rml:class ex:Student; - rml:template "http://example.com/{Student}" - ] . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source ; - rml:referenceFormulation rml:SQL2008Table; - rml:iterator "student_sport" - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "Sport" - ]; - rml:predicate foaf:name - ]; - rml:subjectMap [ - rml:class ex:Sport; - rml:template "http://example.com/{Sport}" - ] . - - a d2rq:Database; - d2rq:jdbcDSN "CONNECTIONDSN"; - d2rq:jdbcDriver "org.postgresql.Driver"; - d2rq:password ""; - d2rq:username "postgres" . diff --git a/src/test/resources/rml-core/RMLTC0004a-PostgreSQL/output.nq b/src/test/resources/rml-core/RMLTC0004a-PostgreSQL/output.nq deleted file mode 100644 index ab10283d..00000000 --- a/src/test/resources/rml-core/RMLTC0004a-PostgreSQL/output.nq +++ /dev/null @@ -1,4 +0,0 @@ - "Venus" . - . - "Tennis" . - . diff --git a/src/test/resources/rml-core/RMLTC0004a-PostgreSQL/resource.sql b/src/test/resources/rml-core/RMLTC0004a-PostgreSQL/resource.sql deleted file mode 100644 index e3fbd520..00000000 --- a/src/test/resources/rml-core/RMLTC0004a-PostgreSQL/resource.sql +++ /dev/null @@ -1,7 +0,0 @@ -DROP TABLE IF EXISTS student_sport; - -CREATE TABLE student_sport ( - "Student" VARCHAR(50), - "Sport" VARCHAR(50) -); -INSERT INTO student_sport values ('Venus', 'Tennis'); diff --git a/src/test/resources/rml-core/RMLTC0004a-PostgreSQL/student_sport.csv b/src/test/resources/rml-core/RMLTC0004a-PostgreSQL/student_sport.csv deleted file mode 100644 index 3c88eaa3..00000000 --- a/src/test/resources/rml-core/RMLTC0004a-PostgreSQL/student_sport.csv +++ /dev/null @@ -1,2 +0,0 @@ -Student,Sport -Venus,Tennis diff --git a/src/test/resources/rml-core/RMLTC0004a-SPARQL/mapping.ttl b/src/test/resources/rml-core/RMLTC0004a-SPARQL/mapping.ttl deleted file mode 100644 index 5053c863..00000000 --- a/src/test/resources/rml-core/RMLTC0004a-SPARQL/mapping.ttl +++ /dev/null @@ -1,66 +0,0 @@ -@prefix ex: . -@prefix foaf: . -@prefix formats: . -@prefix rml: . -@prefix sd: . - -ex:TriplesMap1 a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator """ - PREFIX rdfs: - PREFIX foaf: - PREFIX rdf: - SELECT ?Student - WHERE { - ?x a ; - foaf:name ?Student . - } """; - rml:referenceFormulation formats:SPARQL_Results_JSON; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "Student.value" - ]; - rml:predicate foaf:name - ]; - rml:subjectMap [ - rml:class ex:Student; - rml:template "http://example.com/{Student.value}" - ] . - -ex:TriplesMap2 a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator """ - PREFIX rdfs: - PREFIX foaf: - PREFIX rdf: - SELECT ?Sport - WHERE { - ?x a ; - ?sportObject . - ?sportObject foaf:name ?Sport . - } """; - rml:referenceFormulation formats:SPARQL_Results_JSON; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "Sport.value" - ]; - rml:predicate foaf:name - ]; - rml:subjectMap [ - rml:class ex:Sport; - rml:template "http://example.com/{Sport.value}" - ] . - - a sd:Service; - sd:endpoint ; - sd:supportedLanguage sd:SPARQL11Query . diff --git a/src/test/resources/rml-core/RMLTC0004a-SPARQL/output.nq b/src/test/resources/rml-core/RMLTC0004a-SPARQL/output.nq deleted file mode 100644 index ab10283d..00000000 --- a/src/test/resources/rml-core/RMLTC0004a-SPARQL/output.nq +++ /dev/null @@ -1,4 +0,0 @@ - "Venus" . - . - "Tennis" . - . diff --git a/src/test/resources/rml-core/RMLTC0004a-SPARQL/resource.ttl b/src/test/resources/rml-core/RMLTC0004a-SPARQL/resource.ttl deleted file mode 100644 index 8435fe0c..00000000 --- a/src/test/resources/rml-core/RMLTC0004a-SPARQL/resource.ttl +++ /dev/null @@ -1,8 +0,0 @@ -@prefix foaf: . -@prefix ns1: . - -[] a ns1:Student ; - ns1:plays [ a ns1:Sport ; - foaf:name "Tennis" ] ; - foaf:name "Venus" . - diff --git a/src/test/resources/rml-core/RMLTC0004a-SQLServer/mapping.ttl b/src/test/resources/rml-core/RMLTC0004a-SQLServer/mapping.ttl deleted file mode 100644 index 8df779a1..00000000 --- a/src/test/resources/rml-core/RMLTC0004a-SQLServer/mapping.ttl +++ /dev/null @@ -1,44 +0,0 @@ -@prefix d2rq: . -@prefix ex: . -@prefix foaf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source ; - rml:referenceFormulation rml:SQL2008Table; - rml:iterator "student_sport" - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "Student" - ]; - rml:predicate foaf:name - ]; - rml:subjectMap [ - rml:class ex:Student; - rml:template "http://example.com/{Student}" - ] . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source ; - rml:referenceFormulation rml:SQL2008Table; - rml:iterator "student_sport" - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "Sport" - ]; - rml:predicate foaf:name - ]; - rml:subjectMap [ - rml:class ex:Sport; - rml:template "http://example.com/{Sport}" - ] . - - a d2rq:Database; - d2rq:jdbcDSN "CONNECTIONDSN"; - d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver"; - d2rq:password "YourSTRONG!Passw0rd;"; - d2rq:username "sa" . diff --git a/src/test/resources/rml-core/RMLTC0004a-SQLServer/output.nq b/src/test/resources/rml-core/RMLTC0004a-SQLServer/output.nq deleted file mode 100644 index 164ca8ba..00000000 --- a/src/test/resources/rml-core/RMLTC0004a-SQLServer/output.nq +++ /dev/null @@ -1,5 +0,0 @@ - "Venus" . - . - "Tennis" . - . - diff --git a/src/test/resources/rml-core/RMLTC0004a-SQLServer/resource.sql b/src/test/resources/rml-core/RMLTC0004a-SQLServer/resource.sql deleted file mode 100644 index 6424aeaa..00000000 --- a/src/test/resources/rml-core/RMLTC0004a-SQLServer/resource.sql +++ /dev/null @@ -1,7 +0,0 @@ -USE TestDB; -DROP TABLE IF EXISTS student_sport; -CREATE TABLE student_sport ( - "Student" VARCHAR(50), - "Sport" VARCHAR(50) -); -INSERT INTO student_sport values ('Venus', 'Tennis'); diff --git a/src/test/resources/rml-core/RMLTC0004a-SQLServer/student_sport.csv b/src/test/resources/rml-core/RMLTC0004a-SQLServer/student_sport.csv deleted file mode 100644 index 3c88eaa3..00000000 --- a/src/test/resources/rml-core/RMLTC0004a-SQLServer/student_sport.csv +++ /dev/null @@ -1,2 +0,0 @@ -Student,Sport -Venus,Tennis diff --git a/src/test/resources/rml-core/RMLTC0004a-XML/mapping.ttl b/src/test/resources/rml-core/RMLTC0004a-XML/mapping.ttl deleted file mode 100644 index 9ccb70fa..00000000 --- a/src/test/resources/rml-core/RMLTC0004a-XML/mapping.ttl +++ /dev/null @@ -1,43 +0,0 @@ -@prefix ex: . -@prefix foaf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator "/students/student"; - rml:referenceFormulation rml:XPath; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student_sport.xml" - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "Student" - ]; - rml:predicate foaf:name - ]; - rml:subjectMap [ - rml:class ex:Student; - rml:template "http://example.com/{Student}" - ] . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator "/students/student"; - rml:referenceFormulation rml:XPath; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student_sport.xml" - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "Sport" - ]; - rml:predicate foaf:name - ]; - rml:subjectMap [ - rml:class ex:Sport; - rml:template "http://example.com/{Sport}" - ] . diff --git a/src/test/resources/rml-core/RMLTC0004a-XML/output.nq b/src/test/resources/rml-core/RMLTC0004a-XML/output.nq deleted file mode 100644 index 164ca8ba..00000000 --- a/src/test/resources/rml-core/RMLTC0004a-XML/output.nq +++ /dev/null @@ -1,5 +0,0 @@ - "Venus" . - . - "Tennis" . - . - diff --git a/src/test/resources/rml-core/RMLTC0004a-XML/student_sport.xml b/src/test/resources/rml-core/RMLTC0004a-XML/student_sport.xml deleted file mode 100644 index 73b448c3..00000000 --- a/src/test/resources/rml-core/RMLTC0004a-XML/student_sport.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - Venus - Tennis - - diff --git a/src/test/resources/rml-core/RMLTC0004b-CSV/mapping.ttl b/src/test/resources/rml-core/RMLTC0004b-CSV/mapping.ttl deleted file mode 100644 index b34afb2e..00000000 --- a/src/test/resources/rml-core/RMLTC0004b-CSV/mapping.ttl +++ /dev/null @@ -1,21 +0,0 @@ -@prefix foaf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:referenceFormulation rml:CSV; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.csv" - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "Name" - ]; - rml:predicate foaf:name - ]; - rml:subjectMap [ - rml:template "http://example.com/{Name}"; - rml:termType rml:Literal - ] . diff --git a/src/test/resources/rml-core/RMLTC0004b-CSV/student.csv b/src/test/resources/rml-core/RMLTC0004b-CSV/student.csv deleted file mode 100644 index 4e683bbe..00000000 --- a/src/test/resources/rml-core/RMLTC0004b-CSV/student.csv +++ /dev/null @@ -1,2 +0,0 @@ -Name -Venus diff --git a/src/test/resources/rml-core/RMLTC0004b-JSON/README.md b/src/test/resources/rml-core/RMLTC0004b-JSON/README.md new file mode 100644 index 00000000..447cd83e --- /dev/null +++ b/src/test/resources/rml-core/RMLTC0004b-JSON/README.md @@ -0,0 +1,47 @@ +## RMLTC0004b-JSON + +**Title**: "One column mapping, presence of rml:termType rml:Literal on rml:subjectMap" + +**Description**: "Tests: (1) one column mapping (2) the presence of rml:termType rml:Literal on rml:subjectMap, which is invalid" + +**Default Base IRI**: http://example.com/ + +**Error expected?** Yes + +**Input** +``` +{ + "students": [{ + "Name":"Venus" + }] +} + +``` + +**Mapping** +``` +@prefix foaf: . +@prefix rml: . + + a rml:TriplesMap; + rml:logicalSource [ a rml:LogicalSource; + rml:iterator "$.students[*]"; + rml:referenceFormulation rml:JSONPath; + rml:source [ a rml:RelativePathSource; + rml:root rml:MappingDirectory; + rml:path "student.json" + ] + ]; + rml:predicateObjectMap [ + rml:objectMap [ + rml:reference "$.Name" + ]; + rml:predicate foaf:name + ]; + rml:subjectMap [ + rml:template "http://example.com/{$.Name}"; + rml:termType rml:Literal + ] . + +``` + diff --git a/src/test/resources/rml-core/RMLTC0004b-JSON/mapping.ttl b/src/test/resources/rml-core/RMLTC0004b-JSON/mapping.ttl index 6a0624ef..36480e52 100644 --- a/src/test/resources/rml-core/RMLTC0004b-JSON/mapping.ttl +++ b/src/test/resources/rml-core/RMLTC0004b-JSON/mapping.ttl @@ -12,11 +12,11 @@ ]; rml:predicateObjectMap [ rml:objectMap [ - rml:reference "Name" + rml:reference "$.Name" ]; rml:predicate foaf:name ]; rml:subjectMap [ - rml:template "http://example.com/{Name}"; + rml:template "http://example.com/{$.Name}"; rml:termType rml:Literal ] . diff --git a/src/test/resources/rml-core/RMLTC0004b-MySQL/mapping.ttl b/src/test/resources/rml-core/RMLTC0004b-MySQL/mapping.ttl deleted file mode 100644 index 0214c8a7..00000000 --- a/src/test/resources/rml-core/RMLTC0004b-MySQL/mapping.ttl +++ /dev/null @@ -1,26 +0,0 @@ -@prefix d2rq: . -@prefix foaf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source ; - rml:referenceFormulation rml:SQL2008Table; - rml:iterator "student" - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "Name" - ]; - rml:predicate foaf:name - ]; - rml:subjectMap [ - rml:template "http://example.com/{Name}"; - rml:termType rml:Literal - ] . - - a d2rq:Database; - d2rq:jdbcDSN "CONNECTIONDSN"; - d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver"; - d2rq:password ""; - d2rq:username "root" . diff --git a/src/test/resources/rml-core/RMLTC0004b-MySQL/resource.sql b/src/test/resources/rml-core/RMLTC0004b-MySQL/resource.sql deleted file mode 100644 index 04afa4e1..00000000 --- a/src/test/resources/rml-core/RMLTC0004b-MySQL/resource.sql +++ /dev/null @@ -1,6 +0,0 @@ -USE test; -DROP TABLE IF EXISTS test.student; -CREATE TABLE student ( - Name VARCHAR(50) -); -INSERT INTO student values ('Venus'); diff --git a/src/test/resources/rml-core/RMLTC0004b-PostgreSQL/mapping.ttl b/src/test/resources/rml-core/RMLTC0004b-PostgreSQL/mapping.ttl deleted file mode 100644 index 7e30b9e2..00000000 --- a/src/test/resources/rml-core/RMLTC0004b-PostgreSQL/mapping.ttl +++ /dev/null @@ -1,26 +0,0 @@ -@prefix d2rq: . -@prefix foaf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source ; - rml:referenceFormulation rml:SQL2008Table; - rml:iterator "student" - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "Name" - ]; - rml:predicate foaf:name - ]; - rml:subjectMap [ - rml:template "http://example.com/{Name}"; - rml:termType rml:Literal - ] . - - a d2rq:Database; - d2rq:jdbcDSN "CONNECTIONDSN"; - d2rq:jdbcDriver "org.postgresql.Driver"; - d2rq:password ""; - d2rq:username "postgres" . diff --git a/src/test/resources/rml-core/RMLTC0004b-PostgreSQL/resource.sql b/src/test/resources/rml-core/RMLTC0004b-PostgreSQL/resource.sql deleted file mode 100644 index 67e5510f..00000000 --- a/src/test/resources/rml-core/RMLTC0004b-PostgreSQL/resource.sql +++ /dev/null @@ -1,5 +0,0 @@ -DROP TABLE IF EXISTS student; -CREATE TABLE student ( - "Name" VARCHAR(50) -); -INSERT INTO student values ('Venus'); diff --git a/src/test/resources/rml-core/RMLTC0004b-SPARQL/mapping.ttl b/src/test/resources/rml-core/RMLTC0004b-SPARQL/mapping.ttl deleted file mode 100644 index e425cb50..00000000 --- a/src/test/resources/rml-core/RMLTC0004b-SPARQL/mapping.ttl +++ /dev/null @@ -1,36 +0,0 @@ -@prefix ex: . -@prefix foaf: . -@prefix formats: . -@prefix rml: . -@prefix sd: . - -ex:TriplesMap1 a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator """ - PREFIX rdfs: - PREFIX foaf: - PREFIX rdf: - SELECT ?Name - WHERE { - ?x foaf:name ?Name . - } """; - rml:referenceFormulation formats:SPARQL_Results_JSON; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "Name.value" - ]; - rml:predicate foaf:name - ]; - rml:subjectMap [ - rml:template "http://example.com/{Name.value}"; - rml:termType rml:Literal - ] . - - a sd:Service; - sd:endpoint ; - sd:supportedLanguage sd:SPARQL11Query . diff --git a/src/test/resources/rml-core/RMLTC0004b-SPARQL/resource.ttl b/src/test/resources/rml-core/RMLTC0004b-SPARQL/resource.ttl deleted file mode 100644 index ac86df29..00000000 --- a/src/test/resources/rml-core/RMLTC0004b-SPARQL/resource.ttl +++ /dev/null @@ -1,4 +0,0 @@ -@prefix foaf: . - -[] foaf:name "Venus" . - diff --git a/src/test/resources/rml-core/RMLTC0004b-SQLServer/mapping.ttl b/src/test/resources/rml-core/RMLTC0004b-SQLServer/mapping.ttl deleted file mode 100644 index f652128d..00000000 --- a/src/test/resources/rml-core/RMLTC0004b-SQLServer/mapping.ttl +++ /dev/null @@ -1,26 +0,0 @@ -@prefix d2rq: . -@prefix foaf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source ; - rml:referenceFormulation rml:SQL2008Table; - rml:iterator "student" - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "Name" - ]; - rml:predicate foaf:name - ]; - rml:subjectMap [ - rml:template "http://example.com/{Name}"; - rml:termType rml:Literal - ] . - - a d2rq:Database; - d2rq:jdbcDSN "CONNECTIONDSN"; - d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver"; - d2rq:password "YourSTRONG!Passw0rd;"; - d2rq:username "sa" . diff --git a/src/test/resources/rml-core/RMLTC0004b-SQLServer/resource.sql b/src/test/resources/rml-core/RMLTC0004b-SQLServer/resource.sql deleted file mode 100644 index f38006ab..00000000 --- a/src/test/resources/rml-core/RMLTC0004b-SQLServer/resource.sql +++ /dev/null @@ -1,6 +0,0 @@ -USE TestDB; -DROP TABLE IF EXISTS student; -CREATE TABLE student ( - "Name" VARCHAR(50) -); -INSERT INTO student values ('Venus'); diff --git a/src/test/resources/rml-core/RMLTC0004b-XML/mapping.ttl b/src/test/resources/rml-core/RMLTC0004b-XML/mapping.ttl deleted file mode 100644 index 6423cf78..00000000 --- a/src/test/resources/rml-core/RMLTC0004b-XML/mapping.ttl +++ /dev/null @@ -1,22 +0,0 @@ -@prefix foaf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator "/students/student"; - rml:referenceFormulation rml:XPath; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.xml" - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "Name" - ]; - rml:predicate foaf:name - ]; - rml:subjectMap [ - rml:template "http://example.com/{Name}"; - rml:termType rml:Literal - ] . diff --git a/src/test/resources/rml-core/RMLTC0004b-XML/student.xml b/src/test/resources/rml-core/RMLTC0004b-XML/student.xml deleted file mode 100644 index f104648b..00000000 --- a/src/test/resources/rml-core/RMLTC0004b-XML/student.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - Venus - - diff --git a/src/test/resources/rml-core/RMLTC0005a-CSV/ious.csv b/src/test/resources/rml-core/RMLTC0005a-CSV/ious.csv deleted file mode 100644 index 49ce65ff..00000000 --- a/src/test/resources/rml-core/RMLTC0005a-CSV/ious.csv +++ /dev/null @@ -1,4 +0,0 @@ -fname,lname,amount -Bob,Smith,30.0E0 -Sue,Jones,20.0E0 -Bob,Smith,30.0E0 diff --git a/src/test/resources/rml-core/RMLTC0005a-CSV/mapping.ttl b/src/test/resources/rml-core/RMLTC0005a-CSV/mapping.ttl deleted file mode 100644 index 4b90b2ea..00000000 --- a/src/test/resources/rml-core/RMLTC0005a-CSV/mapping.ttl +++ /dev/null @@ -1,22 +0,0 @@ -@prefix ex: . -@prefix foaf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:referenceFormulation rml:CSV; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "ious.csv" - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "amount" - ]; - rml:predicate ex:owes - ]; - rml:subjectMap [ - rml:class foaf:Person; - rml:template "http://example.com/{fname};{lname}" - ] . diff --git a/src/test/resources/rml-core/RMLTC0005a-CSV/output.nq b/src/test/resources/rml-core/RMLTC0005a-CSV/output.nq deleted file mode 100644 index 64e91da4..00000000 --- a/src/test/resources/rml-core/RMLTC0005a-CSV/output.nq +++ /dev/null @@ -1,5 +0,0 @@ - . - "30.0E0" . - . - "20.0E0" . - diff --git a/src/test/resources/rml-core/RMLTC0005a-JSON/README.md b/src/test/resources/rml-core/RMLTC0005a-JSON/README.md new file mode 100644 index 00000000..a796f16a --- /dev/null +++ b/src/test/resources/rml-core/RMLTC0005a-JSON/README.md @@ -0,0 +1,72 @@ +## RMLTC0005a-JSON + +**Title**: "Typing of resources" + +**Description**: "Tests the typing of resources" + +**Default Base IRI**: http://example.com/ + +**Error expected?** No + +**Input** +``` +{ + "persons": [ + { + "fname": "Bob", + "lname": "Smith", + "amount": "30.0E0" + }, + { + "fname": "Sue", + "lname": "Jones", + "amount": "20.0E0" + }, + { + "fname": "Bob", + "lname": "Smith", + "amount": "30.0E0" + } + ] +} + +``` + +**Mapping** +``` +@prefix ex: . +@prefix foaf: . +@prefix rml: . + + a rml:TriplesMap; + rml:logicalSource [ a rml:LogicalSource; + rml:iterator "$.persons[*]"; + rml:referenceFormulation rml:JSONPath; + rml:source [ a rml:RelativePathSource; + rml:root rml:MappingDirectory; + rml:path "ious.json" + ] + ]; + rml:predicateObjectMap [ + rml:objectMap [ + rml:reference "$.amount" + ]; + rml:predicate ex:owes + ]; + rml:subjectMap [ + rml:class foaf:Person; + rml:template "http://example.com/{$.fname};{$.lname}" + ] . + +``` + +**Output** +``` + . + "30.0E0" . + . + "20.0E0" . + + +``` + diff --git a/src/test/resources/rml-core/RMLTC0005a-JSON/mapping.ttl b/src/test/resources/rml-core/RMLTC0005a-JSON/mapping.ttl index 9232cb2b..d692582e 100644 --- a/src/test/resources/rml-core/RMLTC0005a-JSON/mapping.ttl +++ b/src/test/resources/rml-core/RMLTC0005a-JSON/mapping.ttl @@ -13,11 +13,11 @@ ]; rml:predicateObjectMap [ rml:objectMap [ - rml:reference "amount" + rml:reference "$.amount" ]; rml:predicate ex:owes ]; rml:subjectMap [ rml:class foaf:Person; - rml:template "http://example.com/{fname};{lname}" + rml:template "http://example.com/{$.fname};{$.lname}" ] . diff --git a/src/test/resources/rml-core/RMLTC0005a-MySQL/mapping.ttl b/src/test/resources/rml-core/RMLTC0005a-MySQL/mapping.ttl deleted file mode 100644 index e34e5337..00000000 --- a/src/test/resources/rml-core/RMLTC0005a-MySQL/mapping.ttl +++ /dev/null @@ -1,27 +0,0 @@ -@prefix d2rq: . -@prefix ex: . -@prefix foaf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source ; - rml:referenceFormulation rml:SQL2008Table; - rml:iterator "IOUs" - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "amount" - ]; - rml:predicate ex:owes - ]; - rml:subjectMap [ - rml:class foaf:Person; - rml:template "http://example.com/{fname};{lname}" - ] . - - a d2rq:Database; - d2rq:jdbcDSN "CONNECTIONDSN"; - d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver"; - d2rq:password ""; - d2rq:username "root" . diff --git a/src/test/resources/rml-core/RMLTC0005a-MySQL/output.nq b/src/test/resources/rml-core/RMLTC0005a-MySQL/output.nq deleted file mode 100644 index 30bc4b1d..00000000 --- a/src/test/resources/rml-core/RMLTC0005a-MySQL/output.nq +++ /dev/null @@ -1,5 +0,0 @@ - . - "3.0E1"^^ . - . - "2.0E1"^^ . - diff --git a/src/test/resources/rml-core/RMLTC0005a-MySQL/resource.sql b/src/test/resources/rml-core/RMLTC0005a-MySQL/resource.sql deleted file mode 100644 index bad6cddf..00000000 --- a/src/test/resources/rml-core/RMLTC0005a-MySQL/resource.sql +++ /dev/null @@ -1,9 +0,0 @@ -USE test; -DROP TABLE IF EXISTS test.IOUs; -CREATE TABLE IOUs ( - fname VARCHAR(20), - lname VARCHAR(20), - amount FLOAT); -INSERT INTO IOUs (fname, lname, amount) VALUES ('Bob', 'Smith', 30); -INSERT INTO IOUs (fname, lname, amount) VALUES ('Sue', 'Jones', 20); -INSERT INTO IOUs (fname, lname, amount) VALUES ('Bob', 'Smith', 30); diff --git a/src/test/resources/rml-core/RMLTC0005a-PostgreSQL/mapping.ttl b/src/test/resources/rml-core/RMLTC0005a-PostgreSQL/mapping.ttl deleted file mode 100644 index f929dda4..00000000 --- a/src/test/resources/rml-core/RMLTC0005a-PostgreSQL/mapping.ttl +++ /dev/null @@ -1,27 +0,0 @@ -@prefix d2rq: . -@prefix ex: . -@prefix foaf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source ; - rml:referenceFormulation rml:SQL2008Table; - rml:iterator "IOUs" - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "amount" - ]; - rml:predicate ex:owes - ]; - rml:subjectMap [ - rml:class foaf:Person; - rml:template "http://example.com/{fname};{lname}" - ] . - - a d2rq:Database; - d2rq:jdbcDSN "CONNECTIONDSN"; - d2rq:jdbcDriver "org.postgresql.Driver"; - d2rq:password ""; - d2rq:username "postgres" . diff --git a/src/test/resources/rml-core/RMLTC0005a-PostgreSQL/output.nq b/src/test/resources/rml-core/RMLTC0005a-PostgreSQL/output.nq deleted file mode 100644 index 30bc4b1d..00000000 --- a/src/test/resources/rml-core/RMLTC0005a-PostgreSQL/output.nq +++ /dev/null @@ -1,5 +0,0 @@ - . - "3.0E1"^^ . - . - "2.0E1"^^ . - diff --git a/src/test/resources/rml-core/RMLTC0005a-PostgreSQL/resource.sql b/src/test/resources/rml-core/RMLTC0005a-PostgreSQL/resource.sql deleted file mode 100644 index 32767803..00000000 --- a/src/test/resources/rml-core/RMLTC0005a-PostgreSQL/resource.sql +++ /dev/null @@ -1,8 +0,0 @@ -DROP TABLE IF EXISTS IOUs; -CREATE TABLE IOUs ( - fname VARCHAR(20), - lname VARCHAR(20), - amount FLOAT); -INSERT INTO IOUs (fname, lname, amount) VALUES ('Bob', 'Smith', 30); -INSERT INTO IOUs (fname, lname, amount) VALUES ('Sue', 'Jones', 20); -INSERT INTO IOUs (fname, lname, amount) VALUES ('Bob', 'Smith', 30); diff --git a/src/test/resources/rml-core/RMLTC0005a-SQLServer/mapping.ttl b/src/test/resources/rml-core/RMLTC0005a-SQLServer/mapping.ttl deleted file mode 100644 index 95579a1c..00000000 --- a/src/test/resources/rml-core/RMLTC0005a-SQLServer/mapping.ttl +++ /dev/null @@ -1,27 +0,0 @@ -@prefix d2rq: . -@prefix ex: . -@prefix foaf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source ; - rml:referenceFormulation rml:SQL2008Table; - rml:iterator "IOUs" - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "amount" - ]; - rml:predicate ex:owes - ]; - rml:subjectMap [ - rml:class foaf:Person; - rml:template "http://example.com/{fname};{lname}" - ] . - - a d2rq:Database; - d2rq:jdbcDSN "CONNECTIONDSN"; - d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver"; - d2rq:password "YourSTRONG!Passw0rd;"; - d2rq:username "sa" . diff --git a/src/test/resources/rml-core/RMLTC0005a-SQLServer/output.nq b/src/test/resources/rml-core/RMLTC0005a-SQLServer/output.nq deleted file mode 100644 index 30bc4b1d..00000000 --- a/src/test/resources/rml-core/RMLTC0005a-SQLServer/output.nq +++ /dev/null @@ -1,5 +0,0 @@ - . - "3.0E1"^^ . - . - "2.0E1"^^ . - diff --git a/src/test/resources/rml-core/RMLTC0005a-SQLServer/resource.sql b/src/test/resources/rml-core/RMLTC0005a-SQLServer/resource.sql deleted file mode 100644 index 64a717bb..00000000 --- a/src/test/resources/rml-core/RMLTC0005a-SQLServer/resource.sql +++ /dev/null @@ -1,10 +0,0 @@ -USE TestDB; -DROP TABLE IF EXISTS IOUs; - -CREATE TABLE IOUs ( - fname VARCHAR(20), - lname VARCHAR(20), - amount FLOAT); -INSERT INTO IOUs (fname, lname, amount) VALUES ('Bob', 'Smith', 30); -INSERT INTO IOUs (fname, lname, amount) VALUES ('Sue', 'Jones', 20); -INSERT INTO IOUs (fname, lname, amount) VALUES ('Bob', 'Smith', 30); diff --git a/src/test/resources/rml-core/RMLTC0005a-XML/ious.xml b/src/test/resources/rml-core/RMLTC0005a-XML/ious.xml deleted file mode 100644 index 83fe72a2..00000000 --- a/src/test/resources/rml-core/RMLTC0005a-XML/ious.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - Bob - Smith - 30.0E0 - - - Sue - Jones - 20.0E0 - - - Bob - Smith - 30.0E0 - - diff --git a/src/test/resources/rml-core/RMLTC0005a-XML/mapping.ttl b/src/test/resources/rml-core/RMLTC0005a-XML/mapping.ttl deleted file mode 100644 index 9c0e0c4d..00000000 --- a/src/test/resources/rml-core/RMLTC0005a-XML/mapping.ttl +++ /dev/null @@ -1,23 +0,0 @@ -@prefix ex: . -@prefix foaf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator "/persons/person"; - rml:referenceFormulation rml:XPath; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "ious.xml" - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "amount" - ]; - rml:predicate ex:owes - ]; - rml:subjectMap [ - rml:class foaf:Person; - rml:template "http://example.com/{fname};{lname}" - ] . diff --git a/src/test/resources/rml-core/RMLTC0005a-XML/output.nq b/src/test/resources/rml-core/RMLTC0005a-XML/output.nq deleted file mode 100644 index 64e91da4..00000000 --- a/src/test/resources/rml-core/RMLTC0005a-XML/output.nq +++ /dev/null @@ -1,5 +0,0 @@ - . - "30.0E0" . - . - "20.0E0" . - diff --git a/src/test/resources/rml-core/RMLTC0005b-MySQL/mapping.ttl b/src/test/resources/rml-core/RMLTC0005b-MySQL/mapping.ttl deleted file mode 100644 index dd7f2618..00000000 --- a/src/test/resources/rml-core/RMLTC0005b-MySQL/mapping.ttl +++ /dev/null @@ -1,36 +0,0 @@ -@prefix d2rq: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source ; - rml:referenceFormulation rml:SQL2008Table; - rml:iterator "IOUs" - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "fname" - ]; - rml:predicate - ], [ - rml:objectMap [ - rml:reference "lname" - ]; - rml:predicate - ], [ - rml:objectMap [ - rml:reference "amount" - ]; - rml:predicate - ]; - rml:subjectMap [ - rml:class ; - rml:template "{fname}_{lname}"; - rml:termType rml:BlankNode - ] . - - a d2rq:Database; - d2rq:jdbcDSN "CONNECTIONDSN"; - d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver"; - d2rq:password ""; - d2rq:username "root" . diff --git a/src/test/resources/rml-core/RMLTC0005b-MySQL/output.nq b/src/test/resources/rml-core/RMLTC0005b-MySQL/output.nq deleted file mode 100644 index e9744d9a..00000000 --- a/src/test/resources/rml-core/RMLTC0005b-MySQL/output.nq +++ /dev/null @@ -1,9 +0,0 @@ -_:Bob_Smith . -_:Bob_Smith "Bob" . -_:Bob_Smith "Smith" . -_:Bob_Smith "3.0E1"^^ . -_:Sue_Jones . -_:Sue_Jones "Sue" . -_:Sue_Jones "Jones" . -_:Sue_Jones "2.0E1"^^ . - diff --git a/src/test/resources/rml-core/RMLTC0005b-MySQL/resource.sql b/src/test/resources/rml-core/RMLTC0005b-MySQL/resource.sql deleted file mode 100644 index bad6cddf..00000000 --- a/src/test/resources/rml-core/RMLTC0005b-MySQL/resource.sql +++ /dev/null @@ -1,9 +0,0 @@ -USE test; -DROP TABLE IF EXISTS test.IOUs; -CREATE TABLE IOUs ( - fname VARCHAR(20), - lname VARCHAR(20), - amount FLOAT); -INSERT INTO IOUs (fname, lname, amount) VALUES ('Bob', 'Smith', 30); -INSERT INTO IOUs (fname, lname, amount) VALUES ('Sue', 'Jones', 20); -INSERT INTO IOUs (fname, lname, amount) VALUES ('Bob', 'Smith', 30); diff --git a/src/test/resources/rml-core/RMLTC0005b-PostgreSQL/mapping.ttl b/src/test/resources/rml-core/RMLTC0005b-PostgreSQL/mapping.ttl deleted file mode 100644 index a5796754..00000000 --- a/src/test/resources/rml-core/RMLTC0005b-PostgreSQL/mapping.ttl +++ /dev/null @@ -1,36 +0,0 @@ -@prefix d2rq: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source ; - rml:referenceFormulation rml:SQL2008Table; - rml:iterator "IOUs" - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "fname" - ]; - rml:predicate - ], [ - rml:objectMap [ - rml:reference "lname" - ]; - rml:predicate - ], [ - rml:objectMap [ - rml:reference "amount" - ]; - rml:predicate - ]; - rml:subjectMap [ - rml:class ; - rml:template "{fname}_{lname}"; - rml:termType rml:BlankNode - ] . - - a d2rq:Database; - d2rq:jdbcDSN "CONNECTIONDSN"; - d2rq:jdbcDriver "org.postgresql.Driver"; - d2rq:password ""; - d2rq:username "postgres" . diff --git a/src/test/resources/rml-core/RMLTC0005b-PostgreSQL/output.nq b/src/test/resources/rml-core/RMLTC0005b-PostgreSQL/output.nq deleted file mode 100644 index e9744d9a..00000000 --- a/src/test/resources/rml-core/RMLTC0005b-PostgreSQL/output.nq +++ /dev/null @@ -1,9 +0,0 @@ -_:Bob_Smith . -_:Bob_Smith "Bob" . -_:Bob_Smith "Smith" . -_:Bob_Smith "3.0E1"^^ . -_:Sue_Jones . -_:Sue_Jones "Sue" . -_:Sue_Jones "Jones" . -_:Sue_Jones "2.0E1"^^ . - diff --git a/src/test/resources/rml-core/RMLTC0005b-PostgreSQL/resource.sql b/src/test/resources/rml-core/RMLTC0005b-PostgreSQL/resource.sql deleted file mode 100644 index 32767803..00000000 --- a/src/test/resources/rml-core/RMLTC0005b-PostgreSQL/resource.sql +++ /dev/null @@ -1,8 +0,0 @@ -DROP TABLE IF EXISTS IOUs; -CREATE TABLE IOUs ( - fname VARCHAR(20), - lname VARCHAR(20), - amount FLOAT); -INSERT INTO IOUs (fname, lname, amount) VALUES ('Bob', 'Smith', 30); -INSERT INTO IOUs (fname, lname, amount) VALUES ('Sue', 'Jones', 20); -INSERT INTO IOUs (fname, lname, amount) VALUES ('Bob', 'Smith', 30); diff --git a/src/test/resources/rml-core/RMLTC0005b-SQLServer/mapping.ttl b/src/test/resources/rml-core/RMLTC0005b-SQLServer/mapping.ttl deleted file mode 100644 index 50a859f7..00000000 --- a/src/test/resources/rml-core/RMLTC0005b-SQLServer/mapping.ttl +++ /dev/null @@ -1,36 +0,0 @@ -@prefix d2rq: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source ; - rml:referenceFormulation rml:SQL2008Table; - rml:iterator "IOUs" - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "fname" - ]; - rml:predicate - ], [ - rml:objectMap [ - rml:reference "lname" - ]; - rml:predicate - ], [ - rml:objectMap [ - rml:reference "amount" - ]; - rml:predicate - ]; - rml:subjectMap [ - rml:class ; - rml:template "{fname}_{lname}"; - rml:termType rml:BlankNode - ] . - - a d2rq:Database; - d2rq:jdbcDSN "CONNECTIONDSN"; - d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver"; - d2rq:password "YourSTRONG!Passw0rd;"; - d2rq:username "sa" . diff --git a/src/test/resources/rml-core/RMLTC0005b-SQLServer/output.nq b/src/test/resources/rml-core/RMLTC0005b-SQLServer/output.nq deleted file mode 100644 index e9744d9a..00000000 --- a/src/test/resources/rml-core/RMLTC0005b-SQLServer/output.nq +++ /dev/null @@ -1,9 +0,0 @@ -_:Bob_Smith . -_:Bob_Smith "Bob" . -_:Bob_Smith "Smith" . -_:Bob_Smith "3.0E1"^^ . -_:Sue_Jones . -_:Sue_Jones "Sue" . -_:Sue_Jones "Jones" . -_:Sue_Jones "2.0E1"^^ . - diff --git a/src/test/resources/rml-core/RMLTC0005b-SQLServer/resource.sql b/src/test/resources/rml-core/RMLTC0005b-SQLServer/resource.sql deleted file mode 100644 index 660f8c86..00000000 --- a/src/test/resources/rml-core/RMLTC0005b-SQLServer/resource.sql +++ /dev/null @@ -1,9 +0,0 @@ -USE TestDB; -DROP TABLE IF EXISTS IOUs; -CREATE TABLE IOUs ( - fname VARCHAR(20), - lname VARCHAR(20), - amount FLOAT); -INSERT INTO IOUs (fname, lname, amount) VALUES ('Bob', 'Smith', 30); -INSERT INTO IOUs (fname, lname, amount) VALUES ('Sue', 'Jones', 20); -INSERT INTO IOUs (fname, lname, amount) VALUES ('Bob', 'Smith', 30); diff --git a/src/test/resources/rml-core/RMLTC0006a-CSV/mapping.ttl b/src/test/resources/rml-core/RMLTC0006a-CSV/mapping.ttl deleted file mode 100644 index 47582add..00000000 --- a/src/test/resources/rml-core/RMLTC0006a-CSV/mapping.ttl +++ /dev/null @@ -1,25 +0,0 @@ -@prefix ex: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:referenceFormulation rml:CSV; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.csv" - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:constant "Bad Student" - ]; - rml:predicateMap [ - rml:constant ex:description - ] - ]; - rml:subjectMap [ - rml:constant ex:BadStudent; - rml:graphMap [ - rml:constant - ] - ] . diff --git a/src/test/resources/rml-core/RMLTC0006a-CSV/output.nq b/src/test/resources/rml-core/RMLTC0006a-CSV/output.nq deleted file mode 100644 index 4e6fd3ef..00000000 --- a/src/test/resources/rml-core/RMLTC0006a-CSV/output.nq +++ /dev/null @@ -1 +0,0 @@ - "Bad Student" . \ No newline at end of file diff --git a/src/test/resources/rml-core/RMLTC0006a-CSV/student.csv b/src/test/resources/rml-core/RMLTC0006a-CSV/student.csv deleted file mode 100644 index 1851cef9..00000000 --- a/src/test/resources/rml-core/RMLTC0006a-CSV/student.csv +++ /dev/null @@ -1,2 +0,0 @@ -ID,FirstName,LastName -10,Venus,Williams diff --git a/src/test/resources/rml-core/RMLTC0006a-JSON/README.md b/src/test/resources/rml-core/RMLTC0006a-JSON/README.md new file mode 100644 index 00000000..c901da55 --- /dev/null +++ b/src/test/resources/rml-core/RMLTC0006a-JSON/README.md @@ -0,0 +1,58 @@ +## RMLTC0006a-JSON + +**Title**: "Use of rml:constant in rml:subjectMap, rml:predicateMap, rml:objectMap and rml:graphMap" + +**Description**: "Tests the use of rml:constant in rml:subjectMap, rml:predicateMap, rml:objectMap and rml:graphMap" + +**Default Base IRI**: http://example.com/ + +**Error expected?** No + +**Input** +``` +{ + "students": [{ + "ID": 10, + "FirstName":"Venus", + "LastName":"Williams" + }] +} + +``` + +**Mapping** +``` +@prefix ex: . +@prefix rml: . + + a rml:TriplesMap; + rml:logicalSource [ a rml:LogicalSource; + rml:iterator "$.students[*]"; + rml:referenceFormulation rml:JSONPath; + rml:source [ a rml:RelativePathSource; + rml:root rml:MappingDirectory; + rml:path "student.json" + ] + ]; + rml:predicateObjectMap [ + rml:objectMap [ + rml:constant "Bad Student" + ]; + rml:predicateMap [ + rml:constant ex:description + ] + ]; + rml:subjectMap [ + rml:constant ex:BadStudent; + rml:graphMap [ + rml:constant + ] + ] . + +``` + +**Output** +``` + "Bad Student" . +``` + diff --git a/src/test/resources/rml-core/RMLTC0006a-MySQL/mapping.ttl b/src/test/resources/rml-core/RMLTC0006a-MySQL/mapping.ttl deleted file mode 100644 index b793aa7a..00000000 --- a/src/test/resources/rml-core/RMLTC0006a-MySQL/mapping.ttl +++ /dev/null @@ -1,30 +0,0 @@ -@prefix d2rq: . -@prefix ex: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source ; - rml:referenceFormulation rml:SQL2008Table; - rml:iterator "student" - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:constant "Bad Student" - ]; - rml:predicateMap [ - rml:constant ex:description - ] - ]; - rml:subjectMap [ - rml:constant ex:BadStudent; - rml:graphMap [ - rml:constant - ] - ] . - - a d2rq:Database; - d2rq:jdbcDSN "CONNECTIONDSN"; - d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver"; - d2rq:password ""; - d2rq:username "root" . diff --git a/src/test/resources/rml-core/RMLTC0006a-MySQL/output.nq b/src/test/resources/rml-core/RMLTC0006a-MySQL/output.nq deleted file mode 100644 index 4e6fd3ef..00000000 --- a/src/test/resources/rml-core/RMLTC0006a-MySQL/output.nq +++ /dev/null @@ -1 +0,0 @@ - "Bad Student" . \ No newline at end of file diff --git a/src/test/resources/rml-core/RMLTC0006a-MySQL/resource.sql b/src/test/resources/rml-core/RMLTC0006a-MySQL/resource.sql deleted file mode 100644 index 0135d051..00000000 --- a/src/test/resources/rml-core/RMLTC0006a-MySQL/resource.sql +++ /dev/null @@ -1,9 +0,0 @@ -USE test; -DROP TABLE IF EXISTS test.student; - -CREATE TABLE student ( - ID INTEGER, - FirstName VARCHAR(50), - LastName VARCHAR(50) -); -INSERT INTO student values ('10', 'Venus', 'Williams'); diff --git a/src/test/resources/rml-core/RMLTC0006a-PostgreSQL/mapping.ttl b/src/test/resources/rml-core/RMLTC0006a-PostgreSQL/mapping.ttl deleted file mode 100644 index 2a8f540d..00000000 --- a/src/test/resources/rml-core/RMLTC0006a-PostgreSQL/mapping.ttl +++ /dev/null @@ -1,30 +0,0 @@ -@prefix d2rq: . -@prefix ex: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source ; - rml:referenceFormulation rml:SQL2008Table; - rml:iterator "student" - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:constant "Bad Student" - ]; - rml:predicateMap [ - rml:constant ex:description - ] - ]; - rml:subjectMap [ - rml:constant ex:BadStudent; - rml:graphMap [ - rml:constant - ] - ] . - - a d2rq:Database; - d2rq:jdbcDSN "CONNECTIONDSN"; - d2rq:jdbcDriver "org.postgresql.Driver"; - d2rq:password ""; - d2rq:username "postgres" . diff --git a/src/test/resources/rml-core/RMLTC0006a-PostgreSQL/output.nq b/src/test/resources/rml-core/RMLTC0006a-PostgreSQL/output.nq deleted file mode 100644 index 4e6fd3ef..00000000 --- a/src/test/resources/rml-core/RMLTC0006a-PostgreSQL/output.nq +++ /dev/null @@ -1 +0,0 @@ - "Bad Student" . \ No newline at end of file diff --git a/src/test/resources/rml-core/RMLTC0006a-PostgreSQL/resource.sql b/src/test/resources/rml-core/RMLTC0006a-PostgreSQL/resource.sql deleted file mode 100644 index b5c63bc3..00000000 --- a/src/test/resources/rml-core/RMLTC0006a-PostgreSQL/resource.sql +++ /dev/null @@ -1,8 +0,0 @@ -DROP TABLE IF EXISTS student; - -CREATE TABLE student ( - "ID" INTEGER, - "FirstName" VARCHAR(50), - "LastName" VARCHAR(50) -); -INSERT INTO student values ('10', 'Venus', 'Williams'); diff --git a/src/test/resources/rml-core/RMLTC0006a-SPARQL/mapping.ttl b/src/test/resources/rml-core/RMLTC0006a-SPARQL/mapping.ttl deleted file mode 100644 index b6820692..00000000 --- a/src/test/resources/rml-core/RMLTC0006a-SPARQL/mapping.ttl +++ /dev/null @@ -1,39 +0,0 @@ -@prefix ex: . -@prefix formats: . -@prefix rml: . -@prefix sd: . - -ex:TriplesMap1 a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator """ - PREFIX rdfs: - PREFIX foaf: - PREFIX rdf: - SELECT ?BadStudent ?LastName ?ID - WHERE { - - } """; - rml:referenceFormulation formats:SPARQL_Results_JSON; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:constant "Bad Student" - ]; - rml:predicateMap [ - rml:constant ex:description - ] - ]; - rml:subjectMap [ - rml:constant ex:BadStudent; - rml:graphMap [ - rml:constant - ] - ] . - - a sd:Service; - sd:endpoint ; - sd:supportedLanguage sd:SPARQL11Query . diff --git a/src/test/resources/rml-core/RMLTC0006a-SPARQL/output.nq b/src/test/resources/rml-core/RMLTC0006a-SPARQL/output.nq deleted file mode 100644 index 4e6fd3ef..00000000 --- a/src/test/resources/rml-core/RMLTC0006a-SPARQL/output.nq +++ /dev/null @@ -1 +0,0 @@ - "Bad Student" . \ No newline at end of file diff --git a/src/test/resources/rml-core/RMLTC0006a-SPARQL/resource.ttl b/src/test/resources/rml-core/RMLTC0006a-SPARQL/resource.ttl deleted file mode 100644 index f4a7ed47..00000000 --- a/src/test/resources/rml-core/RMLTC0006a-SPARQL/resource.ttl +++ /dev/null @@ -1,7 +0,0 @@ -@prefix foaf: . -@prefix rdf: . - -[] rdf:ID "10" ; - foaf:firstName "Venus" ; - foaf:lastName "Williams" . - diff --git a/src/test/resources/rml-core/RMLTC0006a-SQLServer/mapping.ttl b/src/test/resources/rml-core/RMLTC0006a-SQLServer/mapping.ttl deleted file mode 100644 index 00e232f7..00000000 --- a/src/test/resources/rml-core/RMLTC0006a-SQLServer/mapping.ttl +++ /dev/null @@ -1,30 +0,0 @@ -@prefix d2rq: . -@prefix ex: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source ; - rml:referenceFormulation rml:SQL2008Table; - rml:iterator "student" - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:constant "Bad Student" - ]; - rml:predicateMap [ - rml:constant ex:description - ] - ]; - rml:subjectMap [ - rml:constant ex:BadStudent; - rml:graphMap [ - rml:constant - ] - ] . - - a d2rq:Database; - d2rq:jdbcDSN "CONNECTIONDSN"; - d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver"; - d2rq:password "YourSTRONG!Passw0rd;"; - d2rq:username "sa" . diff --git a/src/test/resources/rml-core/RMLTC0006a-SQLServer/output.nq b/src/test/resources/rml-core/RMLTC0006a-SQLServer/output.nq deleted file mode 100644 index 4e6fd3ef..00000000 --- a/src/test/resources/rml-core/RMLTC0006a-SQLServer/output.nq +++ /dev/null @@ -1 +0,0 @@ - "Bad Student" . \ No newline at end of file diff --git a/src/test/resources/rml-core/RMLTC0006a-SQLServer/resource.sql b/src/test/resources/rml-core/RMLTC0006a-SQLServer/resource.sql deleted file mode 100644 index 976627c7..00000000 --- a/src/test/resources/rml-core/RMLTC0006a-SQLServer/resource.sql +++ /dev/null @@ -1,8 +0,0 @@ -USE TestDB; -DROP TABLE IF EXISTS student; -CREATE TABLE student ( - "ID" INTEGER, - "FirstName" VARCHAR(50), - "LastName" VARCHAR(50) -); -INSERT INTO student values ('10', 'Venus', 'Williams'); diff --git a/src/test/resources/rml-core/RMLTC0006a-XML/mapping.ttl b/src/test/resources/rml-core/RMLTC0006a-XML/mapping.ttl deleted file mode 100644 index 2f08a03b..00000000 --- a/src/test/resources/rml-core/RMLTC0006a-XML/mapping.ttl +++ /dev/null @@ -1,26 +0,0 @@ -@prefix ex: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator "/students/student"; - rml:referenceFormulation rml:XPath; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.xml" - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:constant "Bad Student" - ]; - rml:predicateMap [ - rml:constant ex:description - ] - ]; - rml:subjectMap [ - rml:constant ex:BadStudent; - rml:graphMap [ - rml:constant - ] - ] . diff --git a/src/test/resources/rml-core/RMLTC0006a-XML/output.nq b/src/test/resources/rml-core/RMLTC0006a-XML/output.nq deleted file mode 100644 index 4e6fd3ef..00000000 --- a/src/test/resources/rml-core/RMLTC0006a-XML/output.nq +++ /dev/null @@ -1 +0,0 @@ - "Bad Student" . \ No newline at end of file diff --git a/src/test/resources/rml-core/RMLTC0006a-XML/student.xml b/src/test/resources/rml-core/RMLTC0006a-XML/student.xml deleted file mode 100644 index 44eab80f..00000000 --- a/src/test/resources/rml-core/RMLTC0006a-XML/student.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - 10 - Venus - Williams - - diff --git a/src/test/resources/rml-core/RMLTC0007a-CSV/mapping.ttl b/src/test/resources/rml-core/RMLTC0007a-CSV/mapping.ttl deleted file mode 100644 index 0c4bf5c7..00000000 --- a/src/test/resources/rml-core/RMLTC0007a-CSV/mapping.ttl +++ /dev/null @@ -1,19 +0,0 @@ -@prefix foaf: . -@prefix rdf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:referenceFormulation rml:CSV; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.csv" - ] - ]; - rml:predicateObjectMap [ - rml:object foaf:Person; - rml:predicate rdf:type - ]; - rml:subjectMap [ - rml:template "http://example.com/Student/{ID}/{FirstName}" - ] . diff --git a/src/test/resources/rml-core/RMLTC0007a-CSV/output.nq b/src/test/resources/rml-core/RMLTC0007a-CSV/output.nq deleted file mode 100644 index 76f87f89..00000000 --- a/src/test/resources/rml-core/RMLTC0007a-CSV/output.nq +++ /dev/null @@ -1,2 +0,0 @@ - . - diff --git a/src/test/resources/rml-core/RMLTC0007a-CSV/student.csv b/src/test/resources/rml-core/RMLTC0007a-CSV/student.csv deleted file mode 100644 index 1851cef9..00000000 --- a/src/test/resources/rml-core/RMLTC0007a-CSV/student.csv +++ /dev/null @@ -1,2 +0,0 @@ -ID,FirstName,LastName -10,Venus,Williams diff --git a/src/test/resources/rml-core/RMLTC0007a-JSON/README.md b/src/test/resources/rml-core/RMLTC0007a-JSON/README.md new file mode 100644 index 00000000..54b13a37 --- /dev/null +++ b/src/test/resources/rml-core/RMLTC0007a-JSON/README.md @@ -0,0 +1,54 @@ +## RMLTC0007a-JSON + +**Title**: "Typing resources by relying on rdf:type predicate" + +**Description**: "Tests the typing resources by relying on rdf:type predicate" + +**Default Base IRI**: http://example.com/ + +**Error expected?** No + +**Input** +``` +{ + "students": [{ + "ID": 10, + "FirstName":"Venus", + "LastName":"Williams" + }] +} + +``` + +**Mapping** +``` +@prefix foaf: . +@prefix rdf: . +@prefix rml: . + + a rml:TriplesMap; + rml:logicalSource [ a rml:LogicalSource; + rml:iterator "$.students[*]"; + rml:referenceFormulation rml:JSONPath; + rml:source [ a rml:RelativePathSource; + rml:root rml:MappingDirectory; + rml:path "student.json" + ] + ]; + rml:predicateObjectMap [ + rml:object foaf:Person; + rml:predicate rdf:type + ]; + rml:subjectMap [ + rml:template "http://example.com/Student/{$.ID}/{$.FirstName}" + ] . + +``` + +**Output** +``` + . + + +``` + diff --git a/src/test/resources/rml-core/RMLTC0007a-JSON/mapping.ttl b/src/test/resources/rml-core/RMLTC0007a-JSON/mapping.ttl index 79fd925f..ac7b148b 100644 --- a/src/test/resources/rml-core/RMLTC0007a-JSON/mapping.ttl +++ b/src/test/resources/rml-core/RMLTC0007a-JSON/mapping.ttl @@ -16,5 +16,5 @@ rml:predicate rdf:type ]; rml:subjectMap [ - rml:template "http://example.com/Student/{ID}/{FirstName}" + rml:template "http://example.com/Student/{$.ID}/{$.FirstName}" ] . diff --git a/src/test/resources/rml-core/RMLTC0007a-MySQL/mapping.ttl b/src/test/resources/rml-core/RMLTC0007a-MySQL/mapping.ttl deleted file mode 100644 index db739fa2..00000000 --- a/src/test/resources/rml-core/RMLTC0007a-MySQL/mapping.ttl +++ /dev/null @@ -1,24 +0,0 @@ -@prefix d2rq: . -@prefix foaf: . -@prefix rdf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source ; - rml:referenceFormulation rml:SQL2008Table; - rml:iterator "student" - ]; - rml:predicateObjectMap [ - rml:object foaf:Person; - rml:predicate rdf:type - ]; - rml:subjectMap [ - rml:template "http://example.com/Student/{ID}/{FirstName}" - ] . - - a d2rq:Database; - d2rq:jdbcDSN "CONNECTIONDSN"; - d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver"; - d2rq:password ""; - d2rq:username "root" . diff --git a/src/test/resources/rml-core/RMLTC0007a-MySQL/output.nq b/src/test/resources/rml-core/RMLTC0007a-MySQL/output.nq deleted file mode 100644 index 76f87f89..00000000 --- a/src/test/resources/rml-core/RMLTC0007a-MySQL/output.nq +++ /dev/null @@ -1,2 +0,0 @@ - . - diff --git a/src/test/resources/rml-core/RMLTC0007a-MySQL/resource.sql b/src/test/resources/rml-core/RMLTC0007a-MySQL/resource.sql deleted file mode 100644 index 0135d051..00000000 --- a/src/test/resources/rml-core/RMLTC0007a-MySQL/resource.sql +++ /dev/null @@ -1,9 +0,0 @@ -USE test; -DROP TABLE IF EXISTS test.student; - -CREATE TABLE student ( - ID INTEGER, - FirstName VARCHAR(50), - LastName VARCHAR(50) -); -INSERT INTO student values ('10', 'Venus', 'Williams'); diff --git a/src/test/resources/rml-core/RMLTC0007a-PostgreSQL/mapping.ttl b/src/test/resources/rml-core/RMLTC0007a-PostgreSQL/mapping.ttl deleted file mode 100644 index af254a4e..00000000 --- a/src/test/resources/rml-core/RMLTC0007a-PostgreSQL/mapping.ttl +++ /dev/null @@ -1,24 +0,0 @@ -@prefix d2rq: . -@prefix foaf: . -@prefix rdf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source ; - rml:referenceFormulation rml:SQL2008Table; - rml:iterator "student" - ]; - rml:predicateObjectMap [ - rml:object foaf:Person; - rml:predicate rdf:type - ]; - rml:subjectMap [ - rml:template "http://example.com/Student/{ID}/{FirstName}" - ] . - - a d2rq:Database; - d2rq:jdbcDSN "CONNECTIONDSN"; - d2rq:jdbcDriver "org.postgresql.Driver"; - d2rq:password ""; - d2rq:username "postgres" . diff --git a/src/test/resources/rml-core/RMLTC0007a-PostgreSQL/output.nq b/src/test/resources/rml-core/RMLTC0007a-PostgreSQL/output.nq deleted file mode 100644 index 76f87f89..00000000 --- a/src/test/resources/rml-core/RMLTC0007a-PostgreSQL/output.nq +++ /dev/null @@ -1,2 +0,0 @@ - . - diff --git a/src/test/resources/rml-core/RMLTC0007a-PostgreSQL/resource.sql b/src/test/resources/rml-core/RMLTC0007a-PostgreSQL/resource.sql deleted file mode 100644 index b5c63bc3..00000000 --- a/src/test/resources/rml-core/RMLTC0007a-PostgreSQL/resource.sql +++ /dev/null @@ -1,8 +0,0 @@ -DROP TABLE IF EXISTS student; - -CREATE TABLE student ( - "ID" INTEGER, - "FirstName" VARCHAR(50), - "LastName" VARCHAR(50) -); -INSERT INTO student values ('10', 'Venus', 'Williams'); diff --git a/src/test/resources/rml-core/RMLTC0007a-SPARQL/mapping.ttl b/src/test/resources/rml-core/RMLTC0007a-SPARQL/mapping.ttl deleted file mode 100644 index 42b09838..00000000 --- a/src/test/resources/rml-core/RMLTC0007a-SPARQL/mapping.ttl +++ /dev/null @@ -1,31 +0,0 @@ -@prefix foaf: . -@prefix formats: . -@prefix rdf: . -@prefix rml: . -@prefix sd: . - - rml:logicalSource [ - rml:iterator """ - PREFIX rdfs: - PREFIX foaf: - PREFIX rdf: - SELECT ?FirstName ?LastName ?ID - WHERE { - ?x foaf:firstName ?FirstName ; - foaf:lastName ?LastName ; - rdf:ID ?ID . - } """; - rml:referenceFormulation formats:SPARQL_Results_JSON; - rml:source - ]; - rml:predicateObjectMap [ - rml:object foaf:Person; - rml:predicate rdf:type - ]; - rml:subjectMap [ - rml:template "http://example.com/Student/{ID.value}/{FirstName.value}" - ] . - - a sd:Service; - sd:endpoint ; - sd:supportedLanguage sd:SPARQL11Query . diff --git a/src/test/resources/rml-core/RMLTC0007a-SPARQL/output.nq b/src/test/resources/rml-core/RMLTC0007a-SPARQL/output.nq deleted file mode 100644 index 76f87f89..00000000 --- a/src/test/resources/rml-core/RMLTC0007a-SPARQL/output.nq +++ /dev/null @@ -1,2 +0,0 @@ - . - diff --git a/src/test/resources/rml-core/RMLTC0007a-SPARQL/resource.ttl b/src/test/resources/rml-core/RMLTC0007a-SPARQL/resource.ttl deleted file mode 100644 index f4a7ed47..00000000 --- a/src/test/resources/rml-core/RMLTC0007a-SPARQL/resource.ttl +++ /dev/null @@ -1,7 +0,0 @@ -@prefix foaf: . -@prefix rdf: . - -[] rdf:ID "10" ; - foaf:firstName "Venus" ; - foaf:lastName "Williams" . - diff --git a/src/test/resources/rml-core/RMLTC0007a-SQLServer/mapping.ttl b/src/test/resources/rml-core/RMLTC0007a-SQLServer/mapping.ttl deleted file mode 100644 index 8d4b6cc7..00000000 --- a/src/test/resources/rml-core/RMLTC0007a-SQLServer/mapping.ttl +++ /dev/null @@ -1,24 +0,0 @@ -@prefix d2rq: . -@prefix foaf: . -@prefix rdf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source ; - rml:referenceFormulation rml:SQL2008Table; - rml:iterator "student" - ]; - rml:predicateObjectMap [ - rml:object foaf:Person; - rml:predicate rdf:type - ]; - rml:subjectMap [ - rml:template "http://example.com/Student/{ID}/{FirstName}" - ] . - - a d2rq:Database; - d2rq:jdbcDSN "CONNECTIONDSN"; - d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver"; - d2rq:password "YourSTRONG!Passw0rd;"; - d2rq:username "sa" . diff --git a/src/test/resources/rml-core/RMLTC0007a-SQLServer/output.nq b/src/test/resources/rml-core/RMLTC0007a-SQLServer/output.nq deleted file mode 100644 index 76f87f89..00000000 --- a/src/test/resources/rml-core/RMLTC0007a-SQLServer/output.nq +++ /dev/null @@ -1,2 +0,0 @@ - . - diff --git a/src/test/resources/rml-core/RMLTC0007a-SQLServer/resource.sql b/src/test/resources/rml-core/RMLTC0007a-SQLServer/resource.sql deleted file mode 100644 index 976627c7..00000000 --- a/src/test/resources/rml-core/RMLTC0007a-SQLServer/resource.sql +++ /dev/null @@ -1,8 +0,0 @@ -USE TestDB; -DROP TABLE IF EXISTS student; -CREATE TABLE student ( - "ID" INTEGER, - "FirstName" VARCHAR(50), - "LastName" VARCHAR(50) -); -INSERT INTO student values ('10', 'Venus', 'Williams'); diff --git a/src/test/resources/rml-core/RMLTC0007a-XML/mapping.ttl b/src/test/resources/rml-core/RMLTC0007a-XML/mapping.ttl deleted file mode 100644 index 90686dfc..00000000 --- a/src/test/resources/rml-core/RMLTC0007a-XML/mapping.ttl +++ /dev/null @@ -1,20 +0,0 @@ -@prefix foaf: . -@prefix rdf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator "/students/student"; - rml:referenceFormulation rml:XPath; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.xml" - ] - ]; - rml:predicateObjectMap [ - rml:object foaf:Person; - rml:predicate rdf:type - ]; - rml:subjectMap [ - rml:template "http://example.com/Student/{ID}/{FirstName}" - ] . diff --git a/src/test/resources/rml-core/RMLTC0007a-XML/output.nq b/src/test/resources/rml-core/RMLTC0007a-XML/output.nq deleted file mode 100644 index 76f87f89..00000000 --- a/src/test/resources/rml-core/RMLTC0007a-XML/output.nq +++ /dev/null @@ -1,2 +0,0 @@ - . - diff --git a/src/test/resources/rml-core/RMLTC0007a-XML/student.xml b/src/test/resources/rml-core/RMLTC0007a-XML/student.xml deleted file mode 100644 index 44eab80f..00000000 --- a/src/test/resources/rml-core/RMLTC0007a-XML/student.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - 10 - Venus - Williams - - diff --git a/src/test/resources/rml-core/RMLTC0007b-CSV/mapping.ttl b/src/test/resources/rml-core/RMLTC0007b-CSV/mapping.ttl deleted file mode 100644 index 038756a4..00000000 --- a/src/test/resources/rml-core/RMLTC0007b-CSV/mapping.ttl +++ /dev/null @@ -1,26 +0,0 @@ -@prefix ex: . -@prefix foaf: . -@prefix rdf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:referenceFormulation rml:CSV; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.csv" - ] - ]; - rml:predicateObjectMap [ - rml:object foaf:Person; - rml:predicate rdf:type - ], [ - rml:objectMap [ - rml:reference "FirstName" - ]; - rml:predicate foaf:name - ]; - rml:subjectMap [ - rml:graph ex:PersonGraph; - rml:template "http://example.com/Student/{ID}/{FirstName}" - ] . diff --git a/src/test/resources/rml-core/RMLTC0007b-CSV/output.nq b/src/test/resources/rml-core/RMLTC0007b-CSV/output.nq deleted file mode 100644 index 5c4eb261..00000000 --- a/src/test/resources/rml-core/RMLTC0007b-CSV/output.nq +++ /dev/null @@ -1,3 +0,0 @@ - "Venus" . - . - diff --git a/src/test/resources/rml-core/RMLTC0007b-CSV/student.csv b/src/test/resources/rml-core/RMLTC0007b-CSV/student.csv deleted file mode 100644 index 1851cef9..00000000 --- a/src/test/resources/rml-core/RMLTC0007b-CSV/student.csv +++ /dev/null @@ -1,2 +0,0 @@ -ID,FirstName,LastName -10,Venus,Williams diff --git a/src/test/resources/rml-core/RMLTC0007b-JSON/README.md b/src/test/resources/rml-core/RMLTC0007b-JSON/README.md new file mode 100644 index 00000000..e4e921e8 --- /dev/null +++ b/src/test/resources/rml-core/RMLTC0007b-JSON/README.md @@ -0,0 +1,62 @@ +## RMLTC0007b-JSON + +**Title**: "Assigning triples to Named Graphs" + +**Description**: "Tests the generation of triples to a named graph" + +**Default Base IRI**: http://example.com/ + +**Error expected?** No + +**Input** +``` +{ + "students": [{ + "ID": 10, + "FirstName":"Venus", + "LastName":"Williams" + }] +} + +``` + +**Mapping** +``` +@prefix ex: . +@prefix foaf: . +@prefix rdf: . +@prefix rml: . + + a rml:TriplesMap; + rml:logicalSource [ a rml:LogicalSource; + rml:iterator "$.students[*]"; + rml:referenceFormulation rml:JSONPath; + rml:source [ a rml:RelativePathSource; + rml:root rml:MappingDirectory; + rml:path "student.json" + ] + ]; + rml:predicateObjectMap [ + rml:object foaf:Person; + rml:predicate rdf:type + ], [ + rml:objectMap [ + rml:reference "$.FirstName" + ]; + rml:predicate foaf:name + ]; + rml:subjectMap [ + rml:graph ex:PersonGraph; + rml:template "http://example.com/Student/{$.ID}/{$.FirstName}" + ] . + +``` + +**Output** +``` + "Venus" . + . + + +``` + diff --git a/src/test/resources/rml-core/RMLTC0007b-JSON/mapping.ttl b/src/test/resources/rml-core/RMLTC0007b-JSON/mapping.ttl index 2f6423e5..d9043524 100644 --- a/src/test/resources/rml-core/RMLTC0007b-JSON/mapping.ttl +++ b/src/test/resources/rml-core/RMLTC0007b-JSON/mapping.ttl @@ -17,11 +17,11 @@ rml:predicate rdf:type ], [ rml:objectMap [ - rml:reference "FirstName" + rml:reference "$.FirstName" ]; rml:predicate foaf:name ]; rml:subjectMap [ rml:graph ex:PersonGraph; - rml:template "http://example.com/Student/{ID}/{FirstName}" + rml:template "http://example.com/Student/{$.ID}/{$.FirstName}" ] . diff --git a/src/test/resources/rml-core/RMLTC0007b-MySQL/mapping.ttl b/src/test/resources/rml-core/RMLTC0007b-MySQL/mapping.ttl deleted file mode 100644 index 7af7a434..00000000 --- a/src/test/resources/rml-core/RMLTC0007b-MySQL/mapping.ttl +++ /dev/null @@ -1,31 +0,0 @@ -@prefix d2rq: . -@prefix ex: . -@prefix foaf: . -@prefix rdf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source ; - rml:referenceFormulation rml:SQL2008Table; - rml:iterator "student" - ]; - rml:predicateObjectMap [ - rml:object foaf:Person; - rml:predicate rdf:type - ], [ - rml:objectMap [ - rml:reference "FirstName" - ]; - rml:predicate foaf:name - ]; - rml:subjectMap [ - rml:graph ex:PersonGraph; - rml:template "http://example.com/Student/{ID}/{FirstName}" - ] . - - a d2rq:Database; - d2rq:jdbcDSN "CONNECTIONDSN"; - d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver"; - d2rq:password ""; - d2rq:username "root" . diff --git a/src/test/resources/rml-core/RMLTC0007b-MySQL/output.nq b/src/test/resources/rml-core/RMLTC0007b-MySQL/output.nq deleted file mode 100644 index 5c4eb261..00000000 --- a/src/test/resources/rml-core/RMLTC0007b-MySQL/output.nq +++ /dev/null @@ -1,3 +0,0 @@ - "Venus" . - . - diff --git a/src/test/resources/rml-core/RMLTC0007b-MySQL/resource.sql b/src/test/resources/rml-core/RMLTC0007b-MySQL/resource.sql deleted file mode 100644 index 0135d051..00000000 --- a/src/test/resources/rml-core/RMLTC0007b-MySQL/resource.sql +++ /dev/null @@ -1,9 +0,0 @@ -USE test; -DROP TABLE IF EXISTS test.student; - -CREATE TABLE student ( - ID INTEGER, - FirstName VARCHAR(50), - LastName VARCHAR(50) -); -INSERT INTO student values ('10', 'Venus', 'Williams'); diff --git a/src/test/resources/rml-core/RMLTC0007b-PostgreSQL/mapping.ttl b/src/test/resources/rml-core/RMLTC0007b-PostgreSQL/mapping.ttl deleted file mode 100644 index cf2eea01..00000000 --- a/src/test/resources/rml-core/RMLTC0007b-PostgreSQL/mapping.ttl +++ /dev/null @@ -1,31 +0,0 @@ -@prefix d2rq: . -@prefix ex: . -@prefix foaf: . -@prefix rdf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source ; - rml:referenceFormulation rml:SQL2008Table; - rml:iterator "student" - ]; - rml:predicateObjectMap [ - rml:object foaf:Person; - rml:predicate rdf:type - ], [ - rml:objectMap [ - rml:reference "FirstName" - ]; - rml:predicate foaf:name - ]; - rml:subjectMap [ - rml:graph ex:PersonGraph; - rml:template "http://example.com/Student/{ID}/{FirstName}" - ] . - - a d2rq:Database; - d2rq:jdbcDSN "CONNECTIONDSN"; - d2rq:jdbcDriver "org.postgresql.Driver"; - d2rq:password ""; - d2rq:username "postgres" . diff --git a/src/test/resources/rml-core/RMLTC0007b-PostgreSQL/output.nq b/src/test/resources/rml-core/RMLTC0007b-PostgreSQL/output.nq deleted file mode 100644 index 5c4eb261..00000000 --- a/src/test/resources/rml-core/RMLTC0007b-PostgreSQL/output.nq +++ /dev/null @@ -1,3 +0,0 @@ - "Venus" . - . - diff --git a/src/test/resources/rml-core/RMLTC0007b-PostgreSQL/resource.sql b/src/test/resources/rml-core/RMLTC0007b-PostgreSQL/resource.sql deleted file mode 100644 index b5c63bc3..00000000 --- a/src/test/resources/rml-core/RMLTC0007b-PostgreSQL/resource.sql +++ /dev/null @@ -1,8 +0,0 @@ -DROP TABLE IF EXISTS student; - -CREATE TABLE student ( - "ID" INTEGER, - "FirstName" VARCHAR(50), - "LastName" VARCHAR(50) -); -INSERT INTO student values ('10', 'Venus', 'Williams'); diff --git a/src/test/resources/rml-core/RMLTC0007b-SPARQL/mapping.ttl b/src/test/resources/rml-core/RMLTC0007b-SPARQL/mapping.ttl deleted file mode 100644 index 77045f25..00000000 --- a/src/test/resources/rml-core/RMLTC0007b-SPARQL/mapping.ttl +++ /dev/null @@ -1,38 +0,0 @@ -@prefix ex: . -@prefix foaf: . -@prefix formats: . -@prefix rdf: . -@prefix rml: . -@prefix sd: . - - rml:logicalSource [ - rml:iterator """ - PREFIX rdfs: - PREFIX foaf: - PREFIX rdf: - SELECT ?FirstName ?LastName ?ID - WHERE { - ?x foaf:firstName ?FirstName ; - foaf:lastName ?LastName ; - rdf:ID ?ID . - } """; - rml:referenceFormulation formats:SPARQL_Results_JSON; - rml:source - ]; - rml:predicateObjectMap [ - rml:object foaf:Person; - rml:predicate rdf:type - ], [ - rml:objectMap [ - rml:reference "FirstName.value" - ]; - rml:predicate foaf:name - ]; - rml:subjectMap [ - rml:graph ex:PersonGraph; - rml:template "http://example.com/Student/{ID.value}/{FirstName.value}" - ] . - - a sd:Service; - sd:endpoint ; - sd:supportedLanguage sd:SPARQL11Query . diff --git a/src/test/resources/rml-core/RMLTC0007b-SPARQL/output.nq b/src/test/resources/rml-core/RMLTC0007b-SPARQL/output.nq deleted file mode 100644 index 5c4eb261..00000000 --- a/src/test/resources/rml-core/RMLTC0007b-SPARQL/output.nq +++ /dev/null @@ -1,3 +0,0 @@ - "Venus" . - . - diff --git a/src/test/resources/rml-core/RMLTC0007b-SPARQL/resource.ttl b/src/test/resources/rml-core/RMLTC0007b-SPARQL/resource.ttl deleted file mode 100644 index f4a7ed47..00000000 --- a/src/test/resources/rml-core/RMLTC0007b-SPARQL/resource.ttl +++ /dev/null @@ -1,7 +0,0 @@ -@prefix foaf: . -@prefix rdf: . - -[] rdf:ID "10" ; - foaf:firstName "Venus" ; - foaf:lastName "Williams" . - diff --git a/src/test/resources/rml-core/RMLTC0007b-SQLServer/mapping.ttl b/src/test/resources/rml-core/RMLTC0007b-SQLServer/mapping.ttl deleted file mode 100644 index 95fad185..00000000 --- a/src/test/resources/rml-core/RMLTC0007b-SQLServer/mapping.ttl +++ /dev/null @@ -1,31 +0,0 @@ -@prefix d2rq: . -@prefix ex: . -@prefix foaf: . -@prefix rdf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source ; - rml:referenceFormulation rml:SQL2008Table; - rml:iterator "student" - ]; - rml:predicateObjectMap [ - rml:object foaf:Person; - rml:predicate rdf:type - ], [ - rml:objectMap [ - rml:reference "FirstName" - ]; - rml:predicate foaf:name - ]; - rml:subjectMap [ - rml:graph ex:PersonGraph; - rml:template "http://example.com/Student/{ID}/{FirstName}" - ] . - - a d2rq:Database; - d2rq:jdbcDSN "CONNECTIONDSN"; - d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver"; - d2rq:password "YourSTRONG!Passw0rd;"; - d2rq:username "sa" . diff --git a/src/test/resources/rml-core/RMLTC0007b-SQLServer/output.nq b/src/test/resources/rml-core/RMLTC0007b-SQLServer/output.nq deleted file mode 100644 index 5c4eb261..00000000 --- a/src/test/resources/rml-core/RMLTC0007b-SQLServer/output.nq +++ /dev/null @@ -1,3 +0,0 @@ - "Venus" . - . - diff --git a/src/test/resources/rml-core/RMLTC0007b-SQLServer/resource.sql b/src/test/resources/rml-core/RMLTC0007b-SQLServer/resource.sql deleted file mode 100644 index 976627c7..00000000 --- a/src/test/resources/rml-core/RMLTC0007b-SQLServer/resource.sql +++ /dev/null @@ -1,8 +0,0 @@ -USE TestDB; -DROP TABLE IF EXISTS student; -CREATE TABLE student ( - "ID" INTEGER, - "FirstName" VARCHAR(50), - "LastName" VARCHAR(50) -); -INSERT INTO student values ('10', 'Venus', 'Williams'); diff --git a/src/test/resources/rml-core/RMLTC0007b-XML/mapping.ttl b/src/test/resources/rml-core/RMLTC0007b-XML/mapping.ttl deleted file mode 100644 index 7e3adee1..00000000 --- a/src/test/resources/rml-core/RMLTC0007b-XML/mapping.ttl +++ /dev/null @@ -1,27 +0,0 @@ -@prefix ex: . -@prefix foaf: . -@prefix rdf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator "/students/student"; - rml:referenceFormulation rml:XPath; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.xml" - ] - ]; - rml:predicateObjectMap [ - rml:object foaf:Person; - rml:predicate rdf:type - ], [ - rml:objectMap [ - rml:reference "FirstName" - ]; - rml:predicate foaf:name - ]; - rml:subjectMap [ - rml:graph ex:PersonGraph; - rml:template "http://example.com/Student/{ID}/{FirstName}" - ] . diff --git a/src/test/resources/rml-core/RMLTC0007b-XML/output.nq b/src/test/resources/rml-core/RMLTC0007b-XML/output.nq deleted file mode 100644 index 5c4eb261..00000000 --- a/src/test/resources/rml-core/RMLTC0007b-XML/output.nq +++ /dev/null @@ -1,3 +0,0 @@ - "Venus" . - . - diff --git a/src/test/resources/rml-core/RMLTC0007b-XML/student.xml b/src/test/resources/rml-core/RMLTC0007b-XML/student.xml deleted file mode 100644 index 44eab80f..00000000 --- a/src/test/resources/rml-core/RMLTC0007b-XML/student.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - 10 - Venus - Williams - - diff --git a/src/test/resources/rml-core/RMLTC0007c-CSV/mapping.ttl b/src/test/resources/rml-core/RMLTC0007c-CSV/mapping.ttl deleted file mode 100644 index 172bab17..00000000 --- a/src/test/resources/rml-core/RMLTC0007c-CSV/mapping.ttl +++ /dev/null @@ -1,27 +0,0 @@ -@prefix ex: . -@prefix foaf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:referenceFormulation rml:CSV; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.csv" - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "ID" - ]; - rml:predicate ex:id - ], [ - rml:objectMap [ - rml:reference "FirstName" - ]; - rml:predicate foaf:name - ]; - rml:subjectMap [ - rml:class ex:Student, foaf:Person; - rml:template "http://example.com/Student/{ID}/{FirstName}" - ] . diff --git a/src/test/resources/rml-core/RMLTC0007c-CSV/output.nq b/src/test/resources/rml-core/RMLTC0007c-CSV/output.nq deleted file mode 100644 index fb4d7fe2..00000000 --- a/src/test/resources/rml-core/RMLTC0007c-CSV/output.nq +++ /dev/null @@ -1,5 +0,0 @@ - "Venus" . - "10" . - . - . - diff --git a/src/test/resources/rml-core/RMLTC0007c-CSV/student.csv b/src/test/resources/rml-core/RMLTC0007c-CSV/student.csv deleted file mode 100644 index 1851cef9..00000000 --- a/src/test/resources/rml-core/RMLTC0007c-CSV/student.csv +++ /dev/null @@ -1,2 +0,0 @@ -ID,FirstName,LastName -10,Venus,Williams diff --git a/src/test/resources/rml-core/RMLTC0007c-JSON/README.md b/src/test/resources/rml-core/RMLTC0007c-JSON/README.md new file mode 100644 index 00000000..7d4dab80 --- /dev/null +++ b/src/test/resources/rml-core/RMLTC0007c-JSON/README.md @@ -0,0 +1,65 @@ +## RMLTC0007c-JSON + +**Title**: "One row mapping, using rml:class" + +**Description**: "Tests subjectmap with more than one class IRIs, rml:class" + +**Default Base IRI**: http://example.com/ + +**Error expected?** No + +**Input** +``` +{ + "students": [{ + "ID": 10, + "FirstName":"Venus", + "LastName":"Williams" + }] +} + +``` + +**Mapping** +``` +@prefix ex: . +@prefix foaf: . +@prefix rml: . + + a rml:TriplesMap; + rml:logicalSource [ a rml:LogicalSource; + rml:iterator "$.students[*]"; + rml:referenceFormulation rml:JSONPath; + rml:source [ a rml:RelativePathSource; + rml:root rml:MappingDirectory; + rml:path "student.json" + ] + ]; + rml:predicateObjectMap [ + rml:objectMap [ + rml:reference "$.ID" + ]; + rml:predicate ex:id + ], [ + rml:objectMap [ + rml:reference "$.FirstName" + ]; + rml:predicate foaf:name + ]; + rml:subjectMap [ + rml:class ex:Student, foaf:Person; + rml:template "http://example.com/Student/{$.ID}/{$.FirstName}" + ] . + +``` + +**Output** +``` + "Venus" . + "10"^^ . + . + . + + +``` + diff --git a/src/test/resources/rml-core/RMLTC0007c-JSON/mapping.ttl b/src/test/resources/rml-core/RMLTC0007c-JSON/mapping.ttl index 4e1aee0b..65764100 100644 --- a/src/test/resources/rml-core/RMLTC0007c-JSON/mapping.ttl +++ b/src/test/resources/rml-core/RMLTC0007c-JSON/mapping.ttl @@ -13,16 +13,16 @@ ]; rml:predicateObjectMap [ rml:objectMap [ - rml:reference "ID" + rml:reference "$.ID" ]; rml:predicate ex:id ], [ rml:objectMap [ - rml:reference "FirstName" + rml:reference "$.FirstName" ]; rml:predicate foaf:name ]; rml:subjectMap [ rml:class ex:Student, foaf:Person; - rml:template "http://example.com/Student/{ID}/{FirstName}" + rml:template "http://example.com/Student/{$.ID}/{$.FirstName}" ] . diff --git a/src/test/resources/rml-core/RMLTC0007c-JSON/output.nq b/src/test/resources/rml-core/RMLTC0007c-JSON/output.nq index fb4d7fe2..ae78ddfb 100644 --- a/src/test/resources/rml-core/RMLTC0007c-JSON/output.nq +++ b/src/test/resources/rml-core/RMLTC0007c-JSON/output.nq @@ -1,5 +1,5 @@ "Venus" . - "10" . + "10"^^ . . . diff --git a/src/test/resources/rml-core/RMLTC0007c-MySQL/mapping.ttl b/src/test/resources/rml-core/RMLTC0007c-MySQL/mapping.ttl deleted file mode 100644 index 82326cd6..00000000 --- a/src/test/resources/rml-core/RMLTC0007c-MySQL/mapping.ttl +++ /dev/null @@ -1,32 +0,0 @@ -@prefix d2rq: . -@prefix ex: . -@prefix foaf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source ; - rml:referenceFormulation rml:SQL2008Table; - rml:iterator "student" - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "ID" - ]; - rml:predicate ex:id - ], [ - rml:objectMap [ - rml:reference "FirstName" - ]; - rml:predicate foaf:name - ]; - rml:subjectMap [ - rml:class ex:Student, foaf:Person; - rml:template "http://example.com/Student/{ID}/{FirstName}" - ] . - - a d2rq:Database; - d2rq:jdbcDSN "CONNECTIONDSN"; - d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver"; - d2rq:password ""; - d2rq:username "root" . diff --git a/src/test/resources/rml-core/RMLTC0007c-MySQL/output.nq b/src/test/resources/rml-core/RMLTC0007c-MySQL/output.nq deleted file mode 100644 index ae78ddfb..00000000 --- a/src/test/resources/rml-core/RMLTC0007c-MySQL/output.nq +++ /dev/null @@ -1,5 +0,0 @@ - "Venus" . - "10"^^ . - . - . - diff --git a/src/test/resources/rml-core/RMLTC0007c-MySQL/resource.sql b/src/test/resources/rml-core/RMLTC0007c-MySQL/resource.sql deleted file mode 100644 index 0135d051..00000000 --- a/src/test/resources/rml-core/RMLTC0007c-MySQL/resource.sql +++ /dev/null @@ -1,9 +0,0 @@ -USE test; -DROP TABLE IF EXISTS test.student; - -CREATE TABLE student ( - ID INTEGER, - FirstName VARCHAR(50), - LastName VARCHAR(50) -); -INSERT INTO student values ('10', 'Venus', 'Williams'); diff --git a/src/test/resources/rml-core/RMLTC0007c-PostgreSQL/mapping.ttl b/src/test/resources/rml-core/RMLTC0007c-PostgreSQL/mapping.ttl deleted file mode 100644 index 9d146a37..00000000 --- a/src/test/resources/rml-core/RMLTC0007c-PostgreSQL/mapping.ttl +++ /dev/null @@ -1,32 +0,0 @@ -@prefix d2rq: . -@prefix ex: . -@prefix foaf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source ; - rml:referenceFormulation rml:SQL2008Table; - rml:iterator "student" - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "ID" - ]; - rml:predicate ex:id - ], [ - rml:objectMap [ - rml:reference "FirstName" - ]; - rml:predicate foaf:name - ]; - rml:subjectMap [ - rml:class ex:Student, foaf:Person; - rml:template "http://example.com/Student/{ID}/{FirstName}" - ] . - - a d2rq:Database; - d2rq:jdbcDSN "CONNECTIONDSN"; - d2rq:jdbcDriver "org.postgresql.Driver"; - d2rq:password ""; - d2rq:username "postgres" . diff --git a/src/test/resources/rml-core/RMLTC0007c-PostgreSQL/output.nq b/src/test/resources/rml-core/RMLTC0007c-PostgreSQL/output.nq deleted file mode 100644 index ae78ddfb..00000000 --- a/src/test/resources/rml-core/RMLTC0007c-PostgreSQL/output.nq +++ /dev/null @@ -1,5 +0,0 @@ - "Venus" . - "10"^^ . - . - . - diff --git a/src/test/resources/rml-core/RMLTC0007c-PostgreSQL/resource.sql b/src/test/resources/rml-core/RMLTC0007c-PostgreSQL/resource.sql deleted file mode 100644 index b5c63bc3..00000000 --- a/src/test/resources/rml-core/RMLTC0007c-PostgreSQL/resource.sql +++ /dev/null @@ -1,8 +0,0 @@ -DROP TABLE IF EXISTS student; - -CREATE TABLE student ( - "ID" INTEGER, - "FirstName" VARCHAR(50), - "LastName" VARCHAR(50) -); -INSERT INTO student values ('10', 'Venus', 'Williams'); diff --git a/src/test/resources/rml-core/RMLTC0007c-SPARQL/mapping.ttl b/src/test/resources/rml-core/RMLTC0007c-SPARQL/mapping.ttl deleted file mode 100644 index 478c50f8..00000000 --- a/src/test/resources/rml-core/RMLTC0007c-SPARQL/mapping.ttl +++ /dev/null @@ -1,34 +0,0 @@ -@prefix ex: . -@prefix foaf: . -@prefix formats: . -@prefix rml: . -@prefix sd: . - - rml:logicalSource [ - rml:iterator """ - PREFIX rdfs: - PREFIX foaf: - PREFIX rdf: - SELECT ?FirstName ?LastName ?ID - WHERE { - ?x foaf:firstName ?FirstName ; - foaf:lastName ?LastName ; - rdf:ID ?ID . - } """; - rml:referenceFormulation formats:SPARQL_Results_JSON; - rml:source - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "FirstName.value" - ]; - rml:predicate foaf:name - ]; - rml:subjectMap [ - rml:class ex:Student, foaf:Person; - rml:template "http://example.com/Student/{ID.value}/{FirstName.value}" - ] . - - a sd:Service; - sd:endpoint ; - sd:supportedLanguage sd:SPARQL11Query . diff --git a/src/test/resources/rml-core/RMLTC0007c-SPARQL/output.nq b/src/test/resources/rml-core/RMLTC0007c-SPARQL/output.nq deleted file mode 100644 index 84570f21..00000000 --- a/src/test/resources/rml-core/RMLTC0007c-SPARQL/output.nq +++ /dev/null @@ -1,4 +0,0 @@ - "Venus" . - . - . - diff --git a/src/test/resources/rml-core/RMLTC0007c-SPARQL/resource.ttl b/src/test/resources/rml-core/RMLTC0007c-SPARQL/resource.ttl deleted file mode 100644 index f4a7ed47..00000000 --- a/src/test/resources/rml-core/RMLTC0007c-SPARQL/resource.ttl +++ /dev/null @@ -1,7 +0,0 @@ -@prefix foaf: . -@prefix rdf: . - -[] rdf:ID "10" ; - foaf:firstName "Venus" ; - foaf:lastName "Williams" . - diff --git a/src/test/resources/rml-core/RMLTC0007c-SQLServer/mapping.ttl b/src/test/resources/rml-core/RMLTC0007c-SQLServer/mapping.ttl deleted file mode 100644 index 66f13465..00000000 --- a/src/test/resources/rml-core/RMLTC0007c-SQLServer/mapping.ttl +++ /dev/null @@ -1,32 +0,0 @@ -@prefix d2rq: . -@prefix ex: . -@prefix foaf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source ; - rml:referenceFormulation rml:SQL2008Table; - rml:iterator "student" - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "ID" - ]; - rml:predicate ex:id - ], [ - rml:objectMap [ - rml:reference "FirstName" - ]; - rml:predicate foaf:name - ]; - rml:subjectMap [ - rml:class ex:Student, foaf:Person; - rml:template "http://example.com/Student/{ID}/{FirstName}" - ] . - - a d2rq:Database; - d2rq:jdbcDSN "CONNECTIONDSN"; - d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver"; - d2rq:password "YourSTRONG!Passw0rd;"; - d2rq:username "sa" . diff --git a/src/test/resources/rml-core/RMLTC0007c-SQLServer/output.nq b/src/test/resources/rml-core/RMLTC0007c-SQLServer/output.nq deleted file mode 100644 index ae78ddfb..00000000 --- a/src/test/resources/rml-core/RMLTC0007c-SQLServer/output.nq +++ /dev/null @@ -1,5 +0,0 @@ - "Venus" . - "10"^^ . - . - . - diff --git a/src/test/resources/rml-core/RMLTC0007c-SQLServer/resource.sql b/src/test/resources/rml-core/RMLTC0007c-SQLServer/resource.sql deleted file mode 100644 index 976627c7..00000000 --- a/src/test/resources/rml-core/RMLTC0007c-SQLServer/resource.sql +++ /dev/null @@ -1,8 +0,0 @@ -USE TestDB; -DROP TABLE IF EXISTS student; -CREATE TABLE student ( - "ID" INTEGER, - "FirstName" VARCHAR(50), - "LastName" VARCHAR(50) -); -INSERT INTO student values ('10', 'Venus', 'Williams'); diff --git a/src/test/resources/rml-core/RMLTC0007c-XML/mapping.ttl b/src/test/resources/rml-core/RMLTC0007c-XML/mapping.ttl deleted file mode 100644 index 511b917d..00000000 --- a/src/test/resources/rml-core/RMLTC0007c-XML/mapping.ttl +++ /dev/null @@ -1,28 +0,0 @@ -@prefix ex: . -@prefix foaf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator "/students/student"; - rml:referenceFormulation rml:XPath; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.xml" - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "ID" - ]; - rml:predicate ex:id - ], [ - rml:objectMap [ - rml:reference "FirstName" - ]; - rml:predicate foaf:name - ]; - rml:subjectMap [ - rml:class ex:Student, foaf:Person; - rml:template "http://example.com/Student/{ID}/{FirstName}" - ] . diff --git a/src/test/resources/rml-core/RMLTC0007c-XML/output.nq b/src/test/resources/rml-core/RMLTC0007c-XML/output.nq deleted file mode 100644 index fb4d7fe2..00000000 --- a/src/test/resources/rml-core/RMLTC0007c-XML/output.nq +++ /dev/null @@ -1,5 +0,0 @@ - "Venus" . - "10" . - . - . - diff --git a/src/test/resources/rml-core/RMLTC0007c-XML/student.xml b/src/test/resources/rml-core/RMLTC0007c-XML/student.xml deleted file mode 100644 index 44eab80f..00000000 --- a/src/test/resources/rml-core/RMLTC0007c-XML/student.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - 10 - Venus - Williams - - diff --git a/src/test/resources/rml-core/RMLTC0007d-CSV/mapping.ttl b/src/test/resources/rml-core/RMLTC0007d-CSV/mapping.ttl deleted file mode 100644 index ebce721d..00000000 --- a/src/test/resources/rml-core/RMLTC0007d-CSV/mapping.ttl +++ /dev/null @@ -1,33 +0,0 @@ -@prefix ex: . -@prefix foaf: . -@prefix rdf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:referenceFormulation rml:CSV; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.csv" - ] - ]; - rml:predicateObjectMap [ - rml:object foaf:Person; - rml:predicate rdf:type - ], [ - rml:object ex:Student; - rml:predicate rdf:type - ], [ - rml:objectMap [ - rml:reference "ID" - ]; - rml:predicate ex:id - ], [ - rml:objectMap [ - rml:reference "FirstName" - ]; - rml:predicate foaf:name - ]; - rml:subjectMap [ - rml:template "http://example.com/Student/{ID}/{FirstName}" - ] . diff --git a/src/test/resources/rml-core/RMLTC0007d-CSV/output.nq b/src/test/resources/rml-core/RMLTC0007d-CSV/output.nq deleted file mode 100644 index 2f24266d..00000000 --- a/src/test/resources/rml-core/RMLTC0007d-CSV/output.nq +++ /dev/null @@ -1,5 +0,0 @@ - "Venus" . - "10" . - . - . - diff --git a/src/test/resources/rml-core/RMLTC0007d-CSV/student.csv b/src/test/resources/rml-core/RMLTC0007d-CSV/student.csv deleted file mode 100644 index 1851cef9..00000000 --- a/src/test/resources/rml-core/RMLTC0007d-CSV/student.csv +++ /dev/null @@ -1,2 +0,0 @@ -ID,FirstName,LastName -10,Venus,Williams diff --git a/src/test/resources/rml-core/RMLTC0007d-JSON/README.md b/src/test/resources/rml-core/RMLTC0007d-JSON/README.md new file mode 100644 index 00000000..94042941 --- /dev/null +++ b/src/test/resources/rml-core/RMLTC0007d-JSON/README.md @@ -0,0 +1,71 @@ +## RMLTC0007d-JSON + +**Title**: "One column mapping, specifying an rml:predicateObjectMap with rdf:type" + +**Description**: "Tests subjectmap with an alternative of having rml:class, i.e., by specifying an rml:predicateObjectMap with predicate rdf:type" + +**Default Base IRI**: http://example.com/ + +**Error expected?** No + +**Input** +``` +{ + "students": [{ + "ID": 10, + "FirstName":"Venus", + "LastName":"Williams" + }] +} + +``` + +**Mapping** +``` +@prefix ex: . +@prefix foaf: . +@prefix rdf: . +@prefix rml: . + + a rml:TriplesMap; + rml:logicalSource [ a rml:LogicalSource; + rml:iterator "$.students[*]"; + rml:referenceFormulation rml:JSONPath; + rml:source [ a rml:RelativePathSource; + rml:root rml:MappingDirectory; + rml:path "student.json" + ] + ]; + rml:predicateObjectMap [ + rml:object foaf:Person; + rml:predicate rdf:type + ], [ + rml:object ex:Student; + rml:predicate rdf:type + ], [ + rml:objectMap [ + rml:reference "$.ID" + ]; + rml:predicate ex:id + ], [ + rml:objectMap [ + rml:reference "$.FirstName" + ]; + rml:predicate foaf:name + ]; + rml:subjectMap [ + rml:template "http://example.com/Student/{$.ID}/{$.FirstName}" + ] . + +``` + +**Output** +``` + "Venus" . + "10"^^ . + . + . + + +``` + diff --git a/src/test/resources/rml-core/RMLTC0007d-JSON/mapping.ttl b/src/test/resources/rml-core/RMLTC0007d-JSON/mapping.ttl index 86eff9fe..fe8e475a 100644 --- a/src/test/resources/rml-core/RMLTC0007d-JSON/mapping.ttl +++ b/src/test/resources/rml-core/RMLTC0007d-JSON/mapping.ttl @@ -20,15 +20,15 @@ rml:predicate rdf:type ], [ rml:objectMap [ - rml:reference "ID" + rml:reference "$.ID" ]; rml:predicate ex:id ], [ rml:objectMap [ - rml:reference "FirstName" + rml:reference "$.FirstName" ]; rml:predicate foaf:name ]; rml:subjectMap [ - rml:template "http://example.com/Student/{ID}/{FirstName}" + rml:template "http://example.com/Student/{$.ID}/{$.FirstName}" ] . diff --git a/src/test/resources/rml-core/RMLTC0007d-JSON/output.nq b/src/test/resources/rml-core/RMLTC0007d-JSON/output.nq index 2f24266d..2232abdb 100644 --- a/src/test/resources/rml-core/RMLTC0007d-JSON/output.nq +++ b/src/test/resources/rml-core/RMLTC0007d-JSON/output.nq @@ -1,5 +1,5 @@ "Venus" . - "10" . + "10"^^ . . . diff --git a/src/test/resources/rml-core/RMLTC0007d-MySQL/mapping.ttl b/src/test/resources/rml-core/RMLTC0007d-MySQL/mapping.ttl deleted file mode 100644 index 5712c9cc..00000000 --- a/src/test/resources/rml-core/RMLTC0007d-MySQL/mapping.ttl +++ /dev/null @@ -1,38 +0,0 @@ -@prefix d2rq: . -@prefix ex: . -@prefix foaf: . -@prefix rdf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source ; - rml:referenceFormulation rml:SQL2008Table; - rml:iterator "student" - ]; - rml:predicateObjectMap [ - rml:object foaf:Person; - rml:predicate rdf:type - ], [ - rml:object ex:Student; - rml:predicate rdf:type - ], [ - rml:objectMap [ - rml:reference "ID" - ]; - rml:predicate ex:id - ], [ - rml:objectMap [ - rml:reference "FirstName" - ]; - rml:predicate foaf:name - ]; - rml:subjectMap [ - rml:template "http://example.com/Student/{ID}/{FirstName}" - ] . - - a d2rq:Database; - d2rq:jdbcDSN "CONNECTIONDSN"; - d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver"; - d2rq:password ""; - d2rq:username "root" . diff --git a/src/test/resources/rml-core/RMLTC0007d-MySQL/output.nq b/src/test/resources/rml-core/RMLTC0007d-MySQL/output.nq deleted file mode 100644 index ae78ddfb..00000000 --- a/src/test/resources/rml-core/RMLTC0007d-MySQL/output.nq +++ /dev/null @@ -1,5 +0,0 @@ - "Venus" . - "10"^^ . - . - . - diff --git a/src/test/resources/rml-core/RMLTC0007d-MySQL/resource.sql b/src/test/resources/rml-core/RMLTC0007d-MySQL/resource.sql deleted file mode 100644 index 0135d051..00000000 --- a/src/test/resources/rml-core/RMLTC0007d-MySQL/resource.sql +++ /dev/null @@ -1,9 +0,0 @@ -USE test; -DROP TABLE IF EXISTS test.student; - -CREATE TABLE student ( - ID INTEGER, - FirstName VARCHAR(50), - LastName VARCHAR(50) -); -INSERT INTO student values ('10', 'Venus', 'Williams'); diff --git a/src/test/resources/rml-core/RMLTC0007d-PostgreSQL/mapping.ttl b/src/test/resources/rml-core/RMLTC0007d-PostgreSQL/mapping.ttl deleted file mode 100644 index f05bf2ed..00000000 --- a/src/test/resources/rml-core/RMLTC0007d-PostgreSQL/mapping.ttl +++ /dev/null @@ -1,38 +0,0 @@ -@prefix d2rq: . -@prefix ex: . -@prefix foaf: . -@prefix rdf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source ; - rml:referenceFormulation rml:SQL2008Table; - rml:iterator "student" - ]; - rml:predicateObjectMap [ - rml:object foaf:Person; - rml:predicate rdf:type - ], [ - rml:object ex:Student; - rml:predicate rdf:type - ], [ - rml:objectMap [ - rml:reference "ID" - ]; - rml:predicate ex:id - ], [ - rml:objectMap [ - rml:reference "FirstName" - ]; - rml:predicate foaf:name - ]; - rml:subjectMap [ - rml:template "http://example.com/Student/{ID}/{FirstName}" - ] . - - a d2rq:Database; - d2rq:jdbcDSN "CONNECTIONDSN"; - d2rq:jdbcDriver "org.postgresql.Driver"; - d2rq:password ""; - d2rq:username "postgres" . diff --git a/src/test/resources/rml-core/RMLTC0007d-PostgreSQL/output.nq b/src/test/resources/rml-core/RMLTC0007d-PostgreSQL/output.nq deleted file mode 100644 index ae78ddfb..00000000 --- a/src/test/resources/rml-core/RMLTC0007d-PostgreSQL/output.nq +++ /dev/null @@ -1,5 +0,0 @@ - "Venus" . - "10"^^ . - . - . - diff --git a/src/test/resources/rml-core/RMLTC0007d-PostgreSQL/resource.sql b/src/test/resources/rml-core/RMLTC0007d-PostgreSQL/resource.sql deleted file mode 100644 index b5c63bc3..00000000 --- a/src/test/resources/rml-core/RMLTC0007d-PostgreSQL/resource.sql +++ /dev/null @@ -1,8 +0,0 @@ -DROP TABLE IF EXISTS student; - -CREATE TABLE student ( - "ID" INTEGER, - "FirstName" VARCHAR(50), - "LastName" VARCHAR(50) -); -INSERT INTO student values ('10', 'Venus', 'Williams'); diff --git a/src/test/resources/rml-core/RMLTC0007d-SPARQL/mapping.ttl b/src/test/resources/rml-core/RMLTC0007d-SPARQL/mapping.ttl deleted file mode 100644 index 1cac4f47..00000000 --- a/src/test/resources/rml-core/RMLTC0007d-SPARQL/mapping.ttl +++ /dev/null @@ -1,40 +0,0 @@ -@prefix ex: . -@prefix foaf: . -@prefix formats: . -@prefix rdf: . -@prefix rml: . -@prefix sd: . - - rml:logicalSource [ - rml:iterator """ - PREFIX rdfs: - PREFIX foaf: - PREFIX rdf: - SELECT ?FirstName ?LastName ?ID - WHERE { - ?x foaf:firstName ?FirstName ; - foaf:lastName ?LastName ; - rdf:ID ?ID . - } """; - rml:referenceFormulation formats:SPARQL_Results_JSON; - rml:source - ]; - rml:predicateObjectMap [ - rml:object foaf:Person; - rml:predicate rdf:type - ], [ - rml:object ex:Student; - rml:predicate rdf:type - ], [ - rml:objectMap [ - rml:reference "FirstName.value" - ]; - rml:predicate foaf:name - ]; - rml:subjectMap [ - rml:template "http://example.com/Student/{ID.value}/{FirstName.value}" - ] . - - a sd:Service; - sd:endpoint ; - sd:supportedLanguage sd:SPARQL11Query . diff --git a/src/test/resources/rml-core/RMLTC0007d-SPARQL/output.nq b/src/test/resources/rml-core/RMLTC0007d-SPARQL/output.nq deleted file mode 100644 index 84570f21..00000000 --- a/src/test/resources/rml-core/RMLTC0007d-SPARQL/output.nq +++ /dev/null @@ -1,4 +0,0 @@ - "Venus" . - . - . - diff --git a/src/test/resources/rml-core/RMLTC0007d-SPARQL/resource.ttl b/src/test/resources/rml-core/RMLTC0007d-SPARQL/resource.ttl deleted file mode 100644 index f4a7ed47..00000000 --- a/src/test/resources/rml-core/RMLTC0007d-SPARQL/resource.ttl +++ /dev/null @@ -1,7 +0,0 @@ -@prefix foaf: . -@prefix rdf: . - -[] rdf:ID "10" ; - foaf:firstName "Venus" ; - foaf:lastName "Williams" . - diff --git a/src/test/resources/rml-core/RMLTC0007d-SQLServer/mapping.ttl b/src/test/resources/rml-core/RMLTC0007d-SQLServer/mapping.ttl deleted file mode 100644 index 8849b336..00000000 --- a/src/test/resources/rml-core/RMLTC0007d-SQLServer/mapping.ttl +++ /dev/null @@ -1,38 +0,0 @@ -@prefix d2rq: . -@prefix ex: . -@prefix foaf: . -@prefix rdf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source ; - rml:referenceFormulation rml:SQL2008Table; - rml:iterator "student" - ]; - rml:predicateObjectMap [ - rml:object foaf:Person; - rml:predicate rdf:type - ], [ - rml:object ex:Student; - rml:predicate rdf:type - ], [ - rml:objectMap [ - rml:reference "ID" - ]; - rml:predicate ex:id - ], [ - rml:objectMap [ - rml:reference "FirstName" - ]; - rml:predicate foaf:name - ]; - rml:subjectMap [ - rml:template "http://example.com/Student/{ID}/{FirstName}" - ] . - - a d2rq:Database; - d2rq:jdbcDSN "CONNECTIONDSN"; - d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver"; - d2rq:password "YourSTRONG!Passw0rd;"; - d2rq:username "sa" . diff --git a/src/test/resources/rml-core/RMLTC0007d-SQLServer/output.nq b/src/test/resources/rml-core/RMLTC0007d-SQLServer/output.nq deleted file mode 100644 index ae78ddfb..00000000 --- a/src/test/resources/rml-core/RMLTC0007d-SQLServer/output.nq +++ /dev/null @@ -1,5 +0,0 @@ - "Venus" . - "10"^^ . - . - . - diff --git a/src/test/resources/rml-core/RMLTC0007d-SQLServer/resource.sql b/src/test/resources/rml-core/RMLTC0007d-SQLServer/resource.sql deleted file mode 100644 index 976627c7..00000000 --- a/src/test/resources/rml-core/RMLTC0007d-SQLServer/resource.sql +++ /dev/null @@ -1,8 +0,0 @@ -USE TestDB; -DROP TABLE IF EXISTS student; -CREATE TABLE student ( - "ID" INTEGER, - "FirstName" VARCHAR(50), - "LastName" VARCHAR(50) -); -INSERT INTO student values ('10', 'Venus', 'Williams'); diff --git a/src/test/resources/rml-core/RMLTC0007d-XML/mapping.ttl b/src/test/resources/rml-core/RMLTC0007d-XML/mapping.ttl deleted file mode 100644 index 2de8b887..00000000 --- a/src/test/resources/rml-core/RMLTC0007d-XML/mapping.ttl +++ /dev/null @@ -1,34 +0,0 @@ -@prefix ex: . -@prefix foaf: . -@prefix rdf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator "/students/student"; - rml:referenceFormulation rml:XPath; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.xml" - ] - ]; - rml:predicateObjectMap [ - rml:object foaf:Person; - rml:predicate rdf:type - ], [ - rml:object ex:Student; - rml:predicate rdf:type - ], [ - rml:objectMap [ - rml:reference "ID" - ]; - rml:predicate ex:id - ], [ - rml:objectMap [ - rml:reference "FirstName" - ]; - rml:predicate foaf:name - ]; - rml:subjectMap [ - rml:template "http://example.com/Student/{ID}/{FirstName}" - ] . diff --git a/src/test/resources/rml-core/RMLTC0007d-XML/output.nq b/src/test/resources/rml-core/RMLTC0007d-XML/output.nq deleted file mode 100644 index 2f24266d..00000000 --- a/src/test/resources/rml-core/RMLTC0007d-XML/output.nq +++ /dev/null @@ -1,5 +0,0 @@ - "Venus" . - "10" . - . - . - diff --git a/src/test/resources/rml-core/RMLTC0007d-XML/student.xml b/src/test/resources/rml-core/RMLTC0007d-XML/student.xml deleted file mode 100644 index 44eab80f..00000000 --- a/src/test/resources/rml-core/RMLTC0007d-XML/student.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - 10 - Venus - Williams - - diff --git a/src/test/resources/rml-core/RMLTC0007e-CSV/mapping.ttl b/src/test/resources/rml-core/RMLTC0007e-CSV/mapping.ttl deleted file mode 100644 index 8de7095d..00000000 --- a/src/test/resources/rml-core/RMLTC0007e-CSV/mapping.ttl +++ /dev/null @@ -1,28 +0,0 @@ -@prefix ex: . -@prefix foaf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:referenceFormulation rml:CSV; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.csv" - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "ID" - ]; - rml:predicate ex:id - ], [ - rml:objectMap [ - rml:reference "Name" - ]; - rml:predicate foaf:name - ]; - rml:subjectMap [ - rml:class foaf:Person; - rml:graph ex:PersonGraph; - rml:template "http://example.com/Student/{ID}/{Name}" - ] . diff --git a/src/test/resources/rml-core/RMLTC0007e-CSV/output.nq b/src/test/resources/rml-core/RMLTC0007e-CSV/output.nq deleted file mode 100644 index 4cbaaf55..00000000 --- a/src/test/resources/rml-core/RMLTC0007e-CSV/output.nq +++ /dev/null @@ -1,4 +0,0 @@ - "10" . - "Venus" . - . - diff --git a/src/test/resources/rml-core/RMLTC0007e-CSV/student.csv b/src/test/resources/rml-core/RMLTC0007e-CSV/student.csv deleted file mode 100644 index df9d2d69..00000000 --- a/src/test/resources/rml-core/RMLTC0007e-CSV/student.csv +++ /dev/null @@ -1,2 +0,0 @@ -ID,Name -10,Venus diff --git a/src/test/resources/rml-core/RMLTC0007e-JSON/README.md b/src/test/resources/rml-core/RMLTC0007e-JSON/README.md new file mode 100644 index 00000000..d4a1458b --- /dev/null +++ b/src/test/resources/rml-core/RMLTC0007e-JSON/README.md @@ -0,0 +1,64 @@ +## RMLTC0007e-JSON + +**Title**: "One column mapping, using rml:graphMap and rml:class" + +**Description**: "Tests subjectmap with rml:graphMap and rml:class" + +**Default Base IRI**: http://example.com/ + +**Error expected?** No + +**Input** +``` +{ + "students": [{ + "ID": 10, + "Name":"Venus" + }] +} + +``` + +**Mapping** +``` +@prefix ex: . +@prefix foaf: . +@prefix rml: . + + a rml:TriplesMap; + rml:logicalSource [ a rml:LogicalSource; + rml:iterator "$.students[*]"; + rml:referenceFormulation rml:JSONPath; + rml:source [ a rml:RelativePathSource; + rml:root rml:MappingDirectory; + rml:path "student.json" + ] + ]; + rml:predicateObjectMap [ + rml:objectMap [ + rml:reference "$.ID" + ]; + rml:predicate ex:id + ], [ + rml:objectMap [ + rml:reference "$.Name" + ]; + rml:predicate foaf:name + ]; + rml:subjectMap [ + rml:class foaf:Person; + rml:graph ex:PersonGraph; + rml:template "http://example.com/Student/{$.ID}/{$.Name}" + ] . + +``` + +**Output** +``` + "10"^^ . + "Venus" . + . + + +``` + diff --git a/src/test/resources/rml-core/RMLTC0007e-JSON/mapping.ttl b/src/test/resources/rml-core/RMLTC0007e-JSON/mapping.ttl index 44b814a3..19e307c7 100644 --- a/src/test/resources/rml-core/RMLTC0007e-JSON/mapping.ttl +++ b/src/test/resources/rml-core/RMLTC0007e-JSON/mapping.ttl @@ -13,17 +13,17 @@ ]; rml:predicateObjectMap [ rml:objectMap [ - rml:reference "ID" + rml:reference "$.ID" ]; rml:predicate ex:id ], [ rml:objectMap [ - rml:reference "Name" + rml:reference "$.Name" ]; rml:predicate foaf:name ]; rml:subjectMap [ rml:class foaf:Person; rml:graph ex:PersonGraph; - rml:template "http://example.com/Student/{ID}/{Name}" + rml:template "http://example.com/Student/{$.ID}/{$.Name}" ] . diff --git a/src/test/resources/rml-core/RMLTC0007e-JSON/output.nq b/src/test/resources/rml-core/RMLTC0007e-JSON/output.nq index 4cbaaf55..c5ea4c49 100644 --- a/src/test/resources/rml-core/RMLTC0007e-JSON/output.nq +++ b/src/test/resources/rml-core/RMLTC0007e-JSON/output.nq @@ -1,4 +1,4 @@ - "10" . + "10"^^ . "Venus" . . diff --git a/src/test/resources/rml-core/RMLTC0007e-MySQL/mapping.ttl b/src/test/resources/rml-core/RMLTC0007e-MySQL/mapping.ttl deleted file mode 100644 index c051b269..00000000 --- a/src/test/resources/rml-core/RMLTC0007e-MySQL/mapping.ttl +++ /dev/null @@ -1,33 +0,0 @@ -@prefix d2rq: . -@prefix ex: . -@prefix foaf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source ; - rml:referenceFormulation rml:SQL2008Table; - rml:iterator "student" - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "ID" - ]; - rml:predicate ex:id - ], [ - rml:objectMap [ - rml:reference "FirstName" - ]; - rml:predicate foaf:name - ]; - rml:subjectMap [ - rml:class foaf:Person; - rml:graph ex:PersonGraph; - rml:template "http://example.com/Student/{ID}/{FirstName}" - ] . - - a d2rq:Database; - d2rq:jdbcDSN "CONNECTIONDSN"; - d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver"; - d2rq:password ""; - d2rq:username "root" . diff --git a/src/test/resources/rml-core/RMLTC0007e-MySQL/output.nq b/src/test/resources/rml-core/RMLTC0007e-MySQL/output.nq deleted file mode 100644 index c5ea4c49..00000000 --- a/src/test/resources/rml-core/RMLTC0007e-MySQL/output.nq +++ /dev/null @@ -1,4 +0,0 @@ - "10"^^ . - "Venus" . - . - diff --git a/src/test/resources/rml-core/RMLTC0007e-MySQL/resource.sql b/src/test/resources/rml-core/RMLTC0007e-MySQL/resource.sql deleted file mode 100644 index 0135d051..00000000 --- a/src/test/resources/rml-core/RMLTC0007e-MySQL/resource.sql +++ /dev/null @@ -1,9 +0,0 @@ -USE test; -DROP TABLE IF EXISTS test.student; - -CREATE TABLE student ( - ID INTEGER, - FirstName VARCHAR(50), - LastName VARCHAR(50) -); -INSERT INTO student values ('10', 'Venus', 'Williams'); diff --git a/src/test/resources/rml-core/RMLTC0007e-PostgreSQL/mapping.ttl b/src/test/resources/rml-core/RMLTC0007e-PostgreSQL/mapping.ttl deleted file mode 100644 index 93f0b13a..00000000 --- a/src/test/resources/rml-core/RMLTC0007e-PostgreSQL/mapping.ttl +++ /dev/null @@ -1,33 +0,0 @@ -@prefix d2rq: . -@prefix ex: . -@prefix foaf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source ; - rml:referenceFormulation rml:SQL2008Table; - rml:iterator "student" - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "ID" - ]; - rml:predicate ex:id - ], [ - rml:objectMap [ - rml:reference "FirstName" - ]; - rml:predicate foaf:name - ]; - rml:subjectMap [ - rml:class foaf:Person; - rml:graph ex:PersonGraph; - rml:template "http://example.com/Student/{ID}/{FirstName}" - ] . - - a d2rq:Database; - d2rq:jdbcDSN "CONNECTIONDSN"; - d2rq:jdbcDriver "org.postgresql.Driver"; - d2rq:password ""; - d2rq:username "postgres" . diff --git a/src/test/resources/rml-core/RMLTC0007e-PostgreSQL/output.nq b/src/test/resources/rml-core/RMLTC0007e-PostgreSQL/output.nq deleted file mode 100644 index c5ea4c49..00000000 --- a/src/test/resources/rml-core/RMLTC0007e-PostgreSQL/output.nq +++ /dev/null @@ -1,4 +0,0 @@ - "10"^^ . - "Venus" . - . - diff --git a/src/test/resources/rml-core/RMLTC0007e-PostgreSQL/resource.sql b/src/test/resources/rml-core/RMLTC0007e-PostgreSQL/resource.sql deleted file mode 100644 index b5c63bc3..00000000 --- a/src/test/resources/rml-core/RMLTC0007e-PostgreSQL/resource.sql +++ /dev/null @@ -1,8 +0,0 @@ -DROP TABLE IF EXISTS student; - -CREATE TABLE student ( - "ID" INTEGER, - "FirstName" VARCHAR(50), - "LastName" VARCHAR(50) -); -INSERT INTO student values ('10', 'Venus', 'Williams'); diff --git a/src/test/resources/rml-core/RMLTC0007e-SPARQL/mapping.ttl b/src/test/resources/rml-core/RMLTC0007e-SPARQL/mapping.ttl deleted file mode 100644 index 4e362e6f..00000000 --- a/src/test/resources/rml-core/RMLTC0007e-SPARQL/mapping.ttl +++ /dev/null @@ -1,29 +0,0 @@ -@prefix ex: . -@prefix foaf: . -@prefix formats: . -@prefix rml: . -@prefix sd: . - - rml:logicalSource [ - rml:iterator """ - PREFIX rdfs: - PREFIX foaf: - PREFIX rdf: - SELECT ?FirstName ?LastName ?ID - WHERE { - ?x foaf:firstName ?FirstName ; - foaf:lastName ?LastName ; - rdf:ID ?ID . - } """; - rml:referenceFormulation formats:SPARQL_Results_JSON; - rml:source - ]; - rml:subjectMap [ - rml:class foaf:Person; - rml:graph ex:PersonGraph; - rml:template "http://example.com/Student/{ID.value}/{FirstName.value}" - ] . - - a sd:Service; - sd:endpoint ; - sd:supportedLanguage sd:SPARQL11Query . diff --git a/src/test/resources/rml-core/RMLTC0007e-SPARQL/output.nq b/src/test/resources/rml-core/RMLTC0007e-SPARQL/output.nq deleted file mode 100644 index 1548749b..00000000 --- a/src/test/resources/rml-core/RMLTC0007e-SPARQL/output.nq +++ /dev/null @@ -1,2 +0,0 @@ - . - diff --git a/src/test/resources/rml-core/RMLTC0007e-SPARQL/resource.ttl b/src/test/resources/rml-core/RMLTC0007e-SPARQL/resource.ttl deleted file mode 100644 index f4a7ed47..00000000 --- a/src/test/resources/rml-core/RMLTC0007e-SPARQL/resource.ttl +++ /dev/null @@ -1,7 +0,0 @@ -@prefix foaf: . -@prefix rdf: . - -[] rdf:ID "10" ; - foaf:firstName "Venus" ; - foaf:lastName "Williams" . - diff --git a/src/test/resources/rml-core/RMLTC0007e-SQLServer/mapping.ttl b/src/test/resources/rml-core/RMLTC0007e-SQLServer/mapping.ttl deleted file mode 100644 index 37de1347..00000000 --- a/src/test/resources/rml-core/RMLTC0007e-SQLServer/mapping.ttl +++ /dev/null @@ -1,33 +0,0 @@ -@prefix d2rq: . -@prefix ex: . -@prefix foaf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source ; - rml:referenceFormulation rml:SQL2008Table; - rml:iterator "student" - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "ID" - ]; - rml:predicate ex:id - ], [ - rml:objectMap [ - rml:reference "FirstName" - ]; - rml:predicate foaf:name - ]; - rml:subjectMap [ - rml:class foaf:Person; - rml:graph ex:PersonGraph; - rml:template "http://example.com/Student/{ID}/{FirstName}" - ] . - - a d2rq:Database; - d2rq:jdbcDSN "CONNECTIONDSN"; - d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver"; - d2rq:password "YourSTRONG!Passw0rd;"; - d2rq:username "sa" . diff --git a/src/test/resources/rml-core/RMLTC0007e-SQLServer/output.nq b/src/test/resources/rml-core/RMLTC0007e-SQLServer/output.nq deleted file mode 100644 index c5ea4c49..00000000 --- a/src/test/resources/rml-core/RMLTC0007e-SQLServer/output.nq +++ /dev/null @@ -1,4 +0,0 @@ - "10"^^ . - "Venus" . - . - diff --git a/src/test/resources/rml-core/RMLTC0007e-SQLServer/resource.sql b/src/test/resources/rml-core/RMLTC0007e-SQLServer/resource.sql deleted file mode 100644 index 976627c7..00000000 --- a/src/test/resources/rml-core/RMLTC0007e-SQLServer/resource.sql +++ /dev/null @@ -1,8 +0,0 @@ -USE TestDB; -DROP TABLE IF EXISTS student; -CREATE TABLE student ( - "ID" INTEGER, - "FirstName" VARCHAR(50), - "LastName" VARCHAR(50) -); -INSERT INTO student values ('10', 'Venus', 'Williams'); diff --git a/src/test/resources/rml-core/RMLTC0007e-XML/mapping.ttl b/src/test/resources/rml-core/RMLTC0007e-XML/mapping.ttl deleted file mode 100644 index 58a876d4..00000000 --- a/src/test/resources/rml-core/RMLTC0007e-XML/mapping.ttl +++ /dev/null @@ -1,29 +0,0 @@ -@prefix ex: . -@prefix foaf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator "/students/student"; - rml:referenceFormulation rml:XPath; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.xml" - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "ID" - ]; - rml:predicate ex:id - ], [ - rml:objectMap [ - rml:reference "Name" - ]; - rml:predicate foaf:name - ]; - rml:subjectMap [ - rml:class foaf:Person; - rml:graph ex:PersonGraph; - rml:template "http://example.com/Student/{ID}/{Name}" - ] . diff --git a/src/test/resources/rml-core/RMLTC0007e-XML/output.nq b/src/test/resources/rml-core/RMLTC0007e-XML/output.nq deleted file mode 100644 index 4cbaaf55..00000000 --- a/src/test/resources/rml-core/RMLTC0007e-XML/output.nq +++ /dev/null @@ -1,4 +0,0 @@ - "10" . - "Venus" . - . - diff --git a/src/test/resources/rml-core/RMLTC0007e-XML/student.xml b/src/test/resources/rml-core/RMLTC0007e-XML/student.xml deleted file mode 100644 index b2a6a9ac..00000000 --- a/src/test/resources/rml-core/RMLTC0007e-XML/student.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - 10 - Venus - - diff --git a/src/test/resources/rml-core/RMLTC0007f-CSV/mapping.ttl b/src/test/resources/rml-core/RMLTC0007f-CSV/mapping.ttl deleted file mode 100644 index 1160c8bf..00000000 --- a/src/test/resources/rml-core/RMLTC0007f-CSV/mapping.ttl +++ /dev/null @@ -1,31 +0,0 @@ -@prefix ex: . -@prefix foaf: . -@prefix rdf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:referenceFormulation rml:CSV; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.csv" - ] - ]; - rml:predicateObjectMap [ - rml:object foaf:Person; - rml:predicate rdf:type - ], [ - rml:objectMap [ - rml:reference "ID" - ]; - rml:predicate ex:id - ], [ - rml:objectMap [ - rml:reference "FirstName" - ]; - rml:predicate foaf:name - ]; - rml:subjectMap [ - rml:graph ex:PersonGraph; - rml:template "http://example.com/Student/{ID}/{FirstName}" - ] . diff --git a/src/test/resources/rml-core/RMLTC0007f-CSV/output.nq b/src/test/resources/rml-core/RMLTC0007f-CSV/output.nq deleted file mode 100644 index d4694d78..00000000 --- a/src/test/resources/rml-core/RMLTC0007f-CSV/output.nq +++ /dev/null @@ -1,4 +0,0 @@ - . - "Venus" . - "10" . - diff --git a/src/test/resources/rml-core/RMLTC0007f-CSV/student.csv b/src/test/resources/rml-core/RMLTC0007f-CSV/student.csv deleted file mode 100644 index 1851cef9..00000000 --- a/src/test/resources/rml-core/RMLTC0007f-CSV/student.csv +++ /dev/null @@ -1,2 +0,0 @@ -ID,FirstName,LastName -10,Venus,Williams diff --git a/src/test/resources/rml-core/RMLTC0007f-JSON/README.md b/src/test/resources/rml-core/RMLTC0007f-JSON/README.md new file mode 100644 index 00000000..f9cff3b4 --- /dev/null +++ b/src/test/resources/rml-core/RMLTC0007f-JSON/README.md @@ -0,0 +1,68 @@ +## RMLTC0007f-JSON + +**Title**: "One column mapping, using rml:graphMap and specifying an rml:predicateObjectMap with rdf:type" + +**Description**: "Tests subjectmap with rml:graphMap and specifying an rml:predicateObjectMap with predicate rdf:type" + +**Default Base IRI**: http://example.com/ + +**Error expected?** No + +**Input** +``` +{ + "students": [{ + "ID": 10, + "FirstName":"Venus", + "LastName":"Williams" + }] +} + +``` + +**Mapping** +``` +@prefix ex: . +@prefix foaf: . +@prefix rdf: . +@prefix rml: . + + a rml:TriplesMap; + rml:logicalSource [ a rml:LogicalSource; + rml:iterator "$.students[*]"; + rml:referenceFormulation rml:JSONPath; + rml:source [ a rml:RelativePathSource; + rml:root rml:MappingDirectory; + rml:path "student.json" + ] + ]; + rml:predicateObjectMap [ + rml:object foaf:Person; + rml:predicate rdf:type + ], [ + rml:objectMap [ + rml:reference "$.ID" + ]; + rml:predicate ex:id + ], [ + rml:objectMap [ + rml:reference "$.FirstName" + ]; + rml:predicate foaf:name + ]; + rml:subjectMap [ + rml:graph ex:PersonGraph; + rml:template "http://example.com/Student/{$.ID}/{$.FirstName}" + ] . + +``` + +**Output** +``` + . + "Venus" . + "10"^^ . + + +``` + diff --git a/src/test/resources/rml-core/RMLTC0007f-JSON/mapping.ttl b/src/test/resources/rml-core/RMLTC0007f-JSON/mapping.ttl index 838a06b0..8dd905cf 100644 --- a/src/test/resources/rml-core/RMLTC0007f-JSON/mapping.ttl +++ b/src/test/resources/rml-core/RMLTC0007f-JSON/mapping.ttl @@ -17,16 +17,16 @@ rml:predicate rdf:type ], [ rml:objectMap [ - rml:reference "ID" + rml:reference "$.ID" ]; rml:predicate ex:id ], [ rml:objectMap [ - rml:reference "FirstName" + rml:reference "$.FirstName" ]; rml:predicate foaf:name ]; rml:subjectMap [ rml:graph ex:PersonGraph; - rml:template "http://example.com/Student/{ID}/{FirstName}" + rml:template "http://example.com/Student/{$.ID}/{$.FirstName}" ] . diff --git a/src/test/resources/rml-core/RMLTC0007f-JSON/output.nq b/src/test/resources/rml-core/RMLTC0007f-JSON/output.nq index d4694d78..fb6a536c 100644 --- a/src/test/resources/rml-core/RMLTC0007f-JSON/output.nq +++ b/src/test/resources/rml-core/RMLTC0007f-JSON/output.nq @@ -1,4 +1,4 @@ . "Venus" . - "10" . + "10"^^ . diff --git a/src/test/resources/rml-core/RMLTC0007f-MySQL/mapping.ttl b/src/test/resources/rml-core/RMLTC0007f-MySQL/mapping.ttl deleted file mode 100644 index cb5ce945..00000000 --- a/src/test/resources/rml-core/RMLTC0007f-MySQL/mapping.ttl +++ /dev/null @@ -1,36 +0,0 @@ -@prefix d2rq: . -@prefix ex: . -@prefix foaf: . -@prefix rdf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source ; - rml:referenceFormulation rml:SQL2008Table; - rml:iterator "student" - ]; - rml:predicateObjectMap [ - rml:object foaf:Person; - rml:predicate rdf:type - ], [ - rml:objectMap [ - rml:reference "ID" - ]; - rml:predicate ex:id - ], [ - rml:objectMap [ - rml:reference "FirstName" - ]; - rml:predicate foaf:name - ]; - rml:subjectMap [ - rml:graph ex:PersonGraph; - rml:template "http://example.com/Student/{ID}/{FirstName}" - ] . - - a d2rq:Database; - d2rq:jdbcDSN "CONNECTIONDSN"; - d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver"; - d2rq:password ""; - d2rq:username "root" . diff --git a/src/test/resources/rml-core/RMLTC0007f-MySQL/output.nq b/src/test/resources/rml-core/RMLTC0007f-MySQL/output.nq deleted file mode 100644 index fb6a536c..00000000 --- a/src/test/resources/rml-core/RMLTC0007f-MySQL/output.nq +++ /dev/null @@ -1,4 +0,0 @@ - . - "Venus" . - "10"^^ . - diff --git a/src/test/resources/rml-core/RMLTC0007f-MySQL/resource.sql b/src/test/resources/rml-core/RMLTC0007f-MySQL/resource.sql deleted file mode 100644 index 0135d051..00000000 --- a/src/test/resources/rml-core/RMLTC0007f-MySQL/resource.sql +++ /dev/null @@ -1,9 +0,0 @@ -USE test; -DROP TABLE IF EXISTS test.student; - -CREATE TABLE student ( - ID INTEGER, - FirstName VARCHAR(50), - LastName VARCHAR(50) -); -INSERT INTO student values ('10', 'Venus', 'Williams'); diff --git a/src/test/resources/rml-core/RMLTC0007f-PostgreSQL/mapping.ttl b/src/test/resources/rml-core/RMLTC0007f-PostgreSQL/mapping.ttl deleted file mode 100644 index 67b94e7e..00000000 --- a/src/test/resources/rml-core/RMLTC0007f-PostgreSQL/mapping.ttl +++ /dev/null @@ -1,36 +0,0 @@ -@prefix d2rq: . -@prefix ex: . -@prefix foaf: . -@prefix rdf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source ; - rml:referenceFormulation rml:SQL2008Table; - rml:iterator "student" - ]; - rml:predicateObjectMap [ - rml:object foaf:Person; - rml:predicate rdf:type - ], [ - rml:objectMap [ - rml:reference "ID" - ]; - rml:predicate ex:id - ], [ - rml:objectMap [ - rml:reference "FirstName" - ]; - rml:predicate foaf:name - ]; - rml:subjectMap [ - rml:graph ex:PersonGraph; - rml:template "http://example.com/Student/{ID}/{FirstName}" - ] . - - a d2rq:Database; - d2rq:jdbcDSN "CONNECTIONDSN"; - d2rq:jdbcDriver "org.postgresql.Driver"; - d2rq:password ""; - d2rq:username "postgres" . diff --git a/src/test/resources/rml-core/RMLTC0007f-PostgreSQL/output.nq b/src/test/resources/rml-core/RMLTC0007f-PostgreSQL/output.nq deleted file mode 100644 index fb6a536c..00000000 --- a/src/test/resources/rml-core/RMLTC0007f-PostgreSQL/output.nq +++ /dev/null @@ -1,4 +0,0 @@ - . - "Venus" . - "10"^^ . - diff --git a/src/test/resources/rml-core/RMLTC0007f-PostgreSQL/resource.sql b/src/test/resources/rml-core/RMLTC0007f-PostgreSQL/resource.sql deleted file mode 100644 index b5c63bc3..00000000 --- a/src/test/resources/rml-core/RMLTC0007f-PostgreSQL/resource.sql +++ /dev/null @@ -1,8 +0,0 @@ -DROP TABLE IF EXISTS student; - -CREATE TABLE student ( - "ID" INTEGER, - "FirstName" VARCHAR(50), - "LastName" VARCHAR(50) -); -INSERT INTO student values ('10', 'Venus', 'Williams'); diff --git a/src/test/resources/rml-core/RMLTC0007f-SPARQL/mapping.ttl b/src/test/resources/rml-core/RMLTC0007f-SPARQL/mapping.ttl deleted file mode 100644 index 26318a46..00000000 --- a/src/test/resources/rml-core/RMLTC0007f-SPARQL/mapping.ttl +++ /dev/null @@ -1,33 +0,0 @@ -@prefix ex: . -@prefix foaf: . -@prefix formats: . -@prefix rdf: . -@prefix rml: . -@prefix sd: . - - rml:logicalSource [ - rml:iterator """ - PREFIX rdfs: - PREFIX foaf: - PREFIX rdf: - SELECT ?FirstName ?LastName ?ID - WHERE { - ?x foaf:firstName ?FirstName ; - foaf:lastName ?LastName ; - rdf:ID ?ID . - } """; - rml:referenceFormulation formats:SPARQL_Results_JSON; - rml:source - ]; - rml:predicateObjectMap [ - rml:object foaf:Person; - rml:predicate rdf:type - ]; - rml:subjectMap [ - rml:graph ex:PersonGraph; - rml:template "http://example.com/Student/{ID.value}/{FirstName.value}" - ] . - - a sd:Service; - sd:endpoint ; - sd:supportedLanguage sd:SPARQL11Query . diff --git a/src/test/resources/rml-core/RMLTC0007f-SPARQL/output.nq b/src/test/resources/rml-core/RMLTC0007f-SPARQL/output.nq deleted file mode 100644 index 1548749b..00000000 --- a/src/test/resources/rml-core/RMLTC0007f-SPARQL/output.nq +++ /dev/null @@ -1,2 +0,0 @@ - . - diff --git a/src/test/resources/rml-core/RMLTC0007f-SPARQL/resource.ttl b/src/test/resources/rml-core/RMLTC0007f-SPARQL/resource.ttl deleted file mode 100644 index f4a7ed47..00000000 --- a/src/test/resources/rml-core/RMLTC0007f-SPARQL/resource.ttl +++ /dev/null @@ -1,7 +0,0 @@ -@prefix foaf: . -@prefix rdf: . - -[] rdf:ID "10" ; - foaf:firstName "Venus" ; - foaf:lastName "Williams" . - diff --git a/src/test/resources/rml-core/RMLTC0007f-SQLServer/mapping.ttl b/src/test/resources/rml-core/RMLTC0007f-SQLServer/mapping.ttl deleted file mode 100644 index 61e58591..00000000 --- a/src/test/resources/rml-core/RMLTC0007f-SQLServer/mapping.ttl +++ /dev/null @@ -1,36 +0,0 @@ -@prefix d2rq: . -@prefix ex: . -@prefix foaf: . -@prefix rdf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source ; - rml:referenceFormulation rml:SQL2008Table; - rml:iterator "student" - ]; - rml:predicateObjectMap [ - rml:object foaf:Person; - rml:predicate rdf:type - ], [ - rml:objectMap [ - rml:reference "ID" - ]; - rml:predicate ex:id - ], [ - rml:objectMap [ - rml:reference "FirstName" - ]; - rml:predicate foaf:name - ]; - rml:subjectMap [ - rml:graph ex:PersonGraph; - rml:template "http://example.com/Student/{ID}/{FirstName}" - ] . - - a d2rq:Database; - d2rq:jdbcDSN "CONNECTIONDSN"; - d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver"; - d2rq:password "YourSTRONG!Passw0rd;"; - d2rq:username "sa" . diff --git a/src/test/resources/rml-core/RMLTC0007f-SQLServer/output.nq b/src/test/resources/rml-core/RMLTC0007f-SQLServer/output.nq deleted file mode 100644 index fb6a536c..00000000 --- a/src/test/resources/rml-core/RMLTC0007f-SQLServer/output.nq +++ /dev/null @@ -1,4 +0,0 @@ - . - "Venus" . - "10"^^ . - diff --git a/src/test/resources/rml-core/RMLTC0007f-SQLServer/resource.sql b/src/test/resources/rml-core/RMLTC0007f-SQLServer/resource.sql deleted file mode 100644 index 976627c7..00000000 --- a/src/test/resources/rml-core/RMLTC0007f-SQLServer/resource.sql +++ /dev/null @@ -1,8 +0,0 @@ -USE TestDB; -DROP TABLE IF EXISTS student; -CREATE TABLE student ( - "ID" INTEGER, - "FirstName" VARCHAR(50), - "LastName" VARCHAR(50) -); -INSERT INTO student values ('10', 'Venus', 'Williams'); diff --git a/src/test/resources/rml-core/RMLTC0007f-XML/mapping.ttl b/src/test/resources/rml-core/RMLTC0007f-XML/mapping.ttl deleted file mode 100644 index b9ccf20e..00000000 --- a/src/test/resources/rml-core/RMLTC0007f-XML/mapping.ttl +++ /dev/null @@ -1,32 +0,0 @@ -@prefix ex: . -@prefix foaf: . -@prefix rdf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator "/students/student"; - rml:referenceFormulation rml:XPath; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.xml" - ] - ]; - rml:predicateObjectMap [ - rml:object foaf:Person; - rml:predicate rdf:type - ], [ - rml:objectMap [ - rml:reference "ID" - ]; - rml:predicate ex:id - ], [ - rml:objectMap [ - rml:reference "FirstName" - ]; - rml:predicate foaf:name - ]; - rml:subjectMap [ - rml:graph ex:PersonGraph; - rml:template "http://example.com/Student/{ID}/{FirstName}" - ] . diff --git a/src/test/resources/rml-core/RMLTC0007f-XML/output.nq b/src/test/resources/rml-core/RMLTC0007f-XML/output.nq deleted file mode 100644 index d4694d78..00000000 --- a/src/test/resources/rml-core/RMLTC0007f-XML/output.nq +++ /dev/null @@ -1,4 +0,0 @@ - . - "Venus" . - "10" . - diff --git a/src/test/resources/rml-core/RMLTC0007f-XML/student.xml b/src/test/resources/rml-core/RMLTC0007f-XML/student.xml deleted file mode 100644 index 44eab80f..00000000 --- a/src/test/resources/rml-core/RMLTC0007f-XML/student.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - 10 - Venus - Williams - - diff --git a/src/test/resources/rml-core/RMLTC0007g-CSV/mapping.ttl b/src/test/resources/rml-core/RMLTC0007g-CSV/mapping.ttl deleted file mode 100644 index 07641fdd..00000000 --- a/src/test/resources/rml-core/RMLTC0007g-CSV/mapping.ttl +++ /dev/null @@ -1,21 +0,0 @@ -@prefix foaf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:referenceFormulation rml:CSV; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.csv" - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "FirstName" - ]; - rml:predicate foaf:name - ]; - rml:subjectMap [ - rml:graph rml:defaultGraph; - rml:template "http://example.com/Student/{ID}/{FirstName}" - ] . diff --git a/src/test/resources/rml-core/RMLTC0007g-CSV/output.nq b/src/test/resources/rml-core/RMLTC0007g-CSV/output.nq deleted file mode 100644 index 6c29bcce..00000000 --- a/src/test/resources/rml-core/RMLTC0007g-CSV/output.nq +++ /dev/null @@ -1,2 +0,0 @@ - "Venus" . - diff --git a/src/test/resources/rml-core/RMLTC0007g-CSV/student.csv b/src/test/resources/rml-core/RMLTC0007g-CSV/student.csv deleted file mode 100644 index 1851cef9..00000000 --- a/src/test/resources/rml-core/RMLTC0007g-CSV/student.csv +++ /dev/null @@ -1,2 +0,0 @@ -ID,FirstName,LastName -10,Venus,Williams diff --git a/src/test/resources/rml-core/RMLTC0007g-JSON/README.md b/src/test/resources/rml-core/RMLTC0007g-JSON/README.md new file mode 100644 index 00000000..bc7e645b --- /dev/null +++ b/src/test/resources/rml-core/RMLTC0007g-JSON/README.md @@ -0,0 +1,56 @@ +## RMLTC0007g-JSON + +**Title**: "Assigning triples to the default graph" + +**Description**: "Tests the generation of triples to the default graph" + +**Default Base IRI**: http://example.com/ + +**Error expected?** No + +**Input** +``` +{ + "students": [{ + "ID": 10, + "FirstName":"Venus", + "LastName":"Williams" + }] +} + +``` + +**Mapping** +``` +@prefix foaf: . +@prefix rml: . + + a rml:TriplesMap; + rml:logicalSource [ a rml:LogicalSource; + rml:iterator "$.students[*]"; + rml:referenceFormulation rml:JSONPath; + rml:source [ a rml:RelativePathSource; + rml:root rml:MappingDirectory; + rml:path "student.json" + ] + ]; + rml:predicateObjectMap [ + rml:objectMap [ + rml:reference "$.FirstName" + ]; + rml:predicate foaf:name + ]; + rml:subjectMap [ + rml:graph rml:defaultGraph; + rml:template "http://example.com/Student/{$.ID}/{$.FirstName}" + ] . + +``` + +**Output** +``` + "Venus" . + + +``` + diff --git a/src/test/resources/rml-core/RMLTC0007g-JSON/mapping.ttl b/src/test/resources/rml-core/RMLTC0007g-JSON/mapping.ttl index 3d6fb710..bfacef74 100644 --- a/src/test/resources/rml-core/RMLTC0007g-JSON/mapping.ttl +++ b/src/test/resources/rml-core/RMLTC0007g-JSON/mapping.ttl @@ -12,11 +12,11 @@ ]; rml:predicateObjectMap [ rml:objectMap [ - rml:reference "FirstName" + rml:reference "$.FirstName" ]; rml:predicate foaf:name ]; rml:subjectMap [ rml:graph rml:defaultGraph; - rml:template "http://example.com/Student/{ID}/{FirstName}" + rml:template "http://example.com/Student/{$.ID}/{$.FirstName}" ] . diff --git a/src/test/resources/rml-core/RMLTC0007g-MySQL/mapping.ttl b/src/test/resources/rml-core/RMLTC0007g-MySQL/mapping.ttl deleted file mode 100644 index 95cf92ac..00000000 --- a/src/test/resources/rml-core/RMLTC0007g-MySQL/mapping.ttl +++ /dev/null @@ -1,26 +0,0 @@ -@prefix d2rq: . -@prefix foaf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source ; - rml:referenceFormulation rml:SQL2008Table; - rml:iterator "student" - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "FirstName" - ]; - rml:predicate foaf:name - ]; - rml:subjectMap [ - rml:graph rml:defaultGraph; - rml:template "http://example.com/Student/{ID}/{FirstName}" - ] . - - a d2rq:Database; - d2rq:jdbcDSN "CONNECTIONDSN"; - d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver"; - d2rq:password ""; - d2rq:username "root" . diff --git a/src/test/resources/rml-core/RMLTC0007g-MySQL/output.nq b/src/test/resources/rml-core/RMLTC0007g-MySQL/output.nq deleted file mode 100644 index 6c29bcce..00000000 --- a/src/test/resources/rml-core/RMLTC0007g-MySQL/output.nq +++ /dev/null @@ -1,2 +0,0 @@ - "Venus" . - diff --git a/src/test/resources/rml-core/RMLTC0007g-MySQL/resource.sql b/src/test/resources/rml-core/RMLTC0007g-MySQL/resource.sql deleted file mode 100644 index 0135d051..00000000 --- a/src/test/resources/rml-core/RMLTC0007g-MySQL/resource.sql +++ /dev/null @@ -1,9 +0,0 @@ -USE test; -DROP TABLE IF EXISTS test.student; - -CREATE TABLE student ( - ID INTEGER, - FirstName VARCHAR(50), - LastName VARCHAR(50) -); -INSERT INTO student values ('10', 'Venus', 'Williams'); diff --git a/src/test/resources/rml-core/RMLTC0007g-PostgreSQL/mapping.ttl b/src/test/resources/rml-core/RMLTC0007g-PostgreSQL/mapping.ttl deleted file mode 100644 index bb47312d..00000000 --- a/src/test/resources/rml-core/RMLTC0007g-PostgreSQL/mapping.ttl +++ /dev/null @@ -1,26 +0,0 @@ -@prefix d2rq: . -@prefix foaf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source ; - rml:referenceFormulation rml:SQL2008Table; - rml:iterator "student" - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "FirstName" - ]; - rml:predicate foaf:name - ]; - rml:subjectMap [ - rml:graph rml:defaultGraph; - rml:template "http://example.com/Student/{ID}/{FirstName}" - ] . - - a d2rq:Database; - d2rq:jdbcDSN "CONNECTIONDSN"; - d2rq:jdbcDriver "org.postgresql.Driver"; - d2rq:password ""; - d2rq:username "postgres" . diff --git a/src/test/resources/rml-core/RMLTC0007g-PostgreSQL/output.nq b/src/test/resources/rml-core/RMLTC0007g-PostgreSQL/output.nq deleted file mode 100644 index 6c29bcce..00000000 --- a/src/test/resources/rml-core/RMLTC0007g-PostgreSQL/output.nq +++ /dev/null @@ -1,2 +0,0 @@ - "Venus" . - diff --git a/src/test/resources/rml-core/RMLTC0007g-PostgreSQL/resource.sql b/src/test/resources/rml-core/RMLTC0007g-PostgreSQL/resource.sql deleted file mode 100644 index b5c63bc3..00000000 --- a/src/test/resources/rml-core/RMLTC0007g-PostgreSQL/resource.sql +++ /dev/null @@ -1,8 +0,0 @@ -DROP TABLE IF EXISTS student; - -CREATE TABLE student ( - "ID" INTEGER, - "FirstName" VARCHAR(50), - "LastName" VARCHAR(50) -); -INSERT INTO student values ('10', 'Venus', 'Williams'); diff --git a/src/test/resources/rml-core/RMLTC0007g-SPARQL/mapping.ttl b/src/test/resources/rml-core/RMLTC0007g-SPARQL/mapping.ttl deleted file mode 100644 index 09958b72..00000000 --- a/src/test/resources/rml-core/RMLTC0007g-SPARQL/mapping.ttl +++ /dev/null @@ -1,33 +0,0 @@ -@prefix foaf: . -@prefix formats: . -@prefix rml: . -@prefix sd: . - - rml:logicalSource [ - rml:iterator """ - PREFIX rdfs: - PREFIX foaf: - PREFIX rdf: - SELECT ?FirstName ?LastName ?ID - WHERE { - ?x foaf:firstName ?FirstName ; - foaf:lastName ?LastName ; - rdf:ID ?ID . - } """; - rml:referenceFormulation formats:SPARQL_Results_JSON; - rml:source - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "FirstName.value" - ]; - rml:predicate foaf:name - ]; - rml:subjectMap [ - rml:graph rml:defaultGraph; - rml:template "http://example.com/Student/{ID.value}/{FirstName.value}" - ] . - - a sd:Service; - sd:endpoint ; - sd:supportedLanguage sd:SPARQL11Query . diff --git a/src/test/resources/rml-core/RMLTC0007g-SPARQL/output.nq b/src/test/resources/rml-core/RMLTC0007g-SPARQL/output.nq deleted file mode 100644 index 6c29bcce..00000000 --- a/src/test/resources/rml-core/RMLTC0007g-SPARQL/output.nq +++ /dev/null @@ -1,2 +0,0 @@ - "Venus" . - diff --git a/src/test/resources/rml-core/RMLTC0007g-SPARQL/resource.ttl b/src/test/resources/rml-core/RMLTC0007g-SPARQL/resource.ttl deleted file mode 100644 index f4a7ed47..00000000 --- a/src/test/resources/rml-core/RMLTC0007g-SPARQL/resource.ttl +++ /dev/null @@ -1,7 +0,0 @@ -@prefix foaf: . -@prefix rdf: . - -[] rdf:ID "10" ; - foaf:firstName "Venus" ; - foaf:lastName "Williams" . - diff --git a/src/test/resources/rml-core/RMLTC0007g-SQLServer/mapping.ttl b/src/test/resources/rml-core/RMLTC0007g-SQLServer/mapping.ttl deleted file mode 100644 index 0cb0116a..00000000 --- a/src/test/resources/rml-core/RMLTC0007g-SQLServer/mapping.ttl +++ /dev/null @@ -1,26 +0,0 @@ -@prefix d2rq: . -@prefix foaf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source ; - rml:referenceFormulation rml:SQL2008Table; - rml:iterator "student" - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "FirstName" - ]; - rml:predicate foaf:name - ]; - rml:subjectMap [ - rml:graph rml:defaultGraph; - rml:template "http://example.com/Student/{ID}/{FirstName}" - ] . - - a d2rq:Database; - d2rq:jdbcDSN "CONNECTIONDSN"; - d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver"; - d2rq:password "YourSTRONG!Passw0rd;"; - d2rq:username "sa" . diff --git a/src/test/resources/rml-core/RMLTC0007g-SQLServer/output.nq b/src/test/resources/rml-core/RMLTC0007g-SQLServer/output.nq deleted file mode 100644 index 6c29bcce..00000000 --- a/src/test/resources/rml-core/RMLTC0007g-SQLServer/output.nq +++ /dev/null @@ -1,2 +0,0 @@ - "Venus" . - diff --git a/src/test/resources/rml-core/RMLTC0007g-SQLServer/resource.sql b/src/test/resources/rml-core/RMLTC0007g-SQLServer/resource.sql deleted file mode 100644 index 976627c7..00000000 --- a/src/test/resources/rml-core/RMLTC0007g-SQLServer/resource.sql +++ /dev/null @@ -1,8 +0,0 @@ -USE TestDB; -DROP TABLE IF EXISTS student; -CREATE TABLE student ( - "ID" INTEGER, - "FirstName" VARCHAR(50), - "LastName" VARCHAR(50) -); -INSERT INTO student values ('10', 'Venus', 'Williams'); diff --git a/src/test/resources/rml-core/RMLTC0007g-XML/mapping.ttl b/src/test/resources/rml-core/RMLTC0007g-XML/mapping.ttl deleted file mode 100644 index 942a30b4..00000000 --- a/src/test/resources/rml-core/RMLTC0007g-XML/mapping.ttl +++ /dev/null @@ -1,22 +0,0 @@ -@prefix foaf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator "/students/student"; - rml:referenceFormulation rml:XPath; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.xml" - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "FirstName" - ]; - rml:predicate foaf:name - ]; - rml:subjectMap [ - rml:graph rml:defaultGraph; - rml:template "http://example.com/Student/{ID}/{FirstName}" - ] . diff --git a/src/test/resources/rml-core/RMLTC0007g-XML/output.nq b/src/test/resources/rml-core/RMLTC0007g-XML/output.nq deleted file mode 100644 index 6c29bcce..00000000 --- a/src/test/resources/rml-core/RMLTC0007g-XML/output.nq +++ /dev/null @@ -1,2 +0,0 @@ - "Venus" . - diff --git a/src/test/resources/rml-core/RMLTC0007g-XML/student.xml b/src/test/resources/rml-core/RMLTC0007g-XML/student.xml deleted file mode 100644 index 44eab80f..00000000 --- a/src/test/resources/rml-core/RMLTC0007g-XML/student.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - 10 - Venus - Williams - - diff --git a/src/test/resources/rml-core/RMLTC0007h-CSV/mapping.ttl b/src/test/resources/rml-core/RMLTC0007h-CSV/mapping.ttl deleted file mode 100644 index 6be1b2bc..00000000 --- a/src/test/resources/rml-core/RMLTC0007h-CSV/mapping.ttl +++ /dev/null @@ -1,24 +0,0 @@ -@prefix foaf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:referenceFormulation rml:CSV; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.csv" - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "Name" - ]; - rml:predicate foaf:name - ]; - rml:subjectMap [ - rml:graphMap [ - rml:reference "Name"; - rml:termType rml:Literal - ]; - rml:template "http://example.com/Student/{ID}/{FirstName}" - ] . diff --git a/src/test/resources/rml-core/RMLTC0007h-CSV/student.csv b/src/test/resources/rml-core/RMLTC0007h-CSV/student.csv deleted file mode 100644 index 1851cef9..00000000 --- a/src/test/resources/rml-core/RMLTC0007h-CSV/student.csv +++ /dev/null @@ -1,2 +0,0 @@ -ID,FirstName,LastName -10,Venus,Williams diff --git a/src/test/resources/rml-core/RMLTC0007h-JSON/README.md b/src/test/resources/rml-core/RMLTC0007h-JSON/README.md new file mode 100644 index 00000000..acb63958 --- /dev/null +++ b/src/test/resources/rml-core/RMLTC0007h-JSON/README.md @@ -0,0 +1,52 @@ +## RMLTC0007h-JSON + +**Title**: "Assigning triples to a non-IRI named graph" + +**Description**: "Tests the generation of triples to a non-IRI named graph, which is an error" + +**Default Base IRI**: http://example.com/ + +**Error expected?** Yes + +**Input** +``` +{ + "students": [{ + "ID": 10, + "FirstName":"Venus", + "LastName":"Williams" + }] +} + +``` + +**Mapping** +``` +@prefix foaf: . +@prefix rml: . + + a rml:TriplesMap; + rml:logicalSource [ a rml:LogicalSource; + rml:iterator "$.students[*]"; + rml:referenceFormulation rml:JSONPath; + rml:source [ a rml:RelativePathSource; + rml:root rml:MappingDirectory; + rml:path "student.json" + ] + ]; + rml:predicateObjectMap [ + rml:objectMap [ + rml:reference "$.FirstName" + ]; + rml:predicate foaf:name + ]; + rml:subjectMap [ + rml:graphMap [ + rml:reference "$.ID"; + rml:termType rml:Literal + ]; + rml:template "http://example.com/Student/{$.ID}/{$.FirstName}" + ] . + +``` + diff --git a/src/test/resources/rml-core/RMLTC0007h-JSON/mapping.ttl b/src/test/resources/rml-core/RMLTC0007h-JSON/mapping.ttl index b85c1fc5..c79dd6ed 100644 --- a/src/test/resources/rml-core/RMLTC0007h-JSON/mapping.ttl +++ b/src/test/resources/rml-core/RMLTC0007h-JSON/mapping.ttl @@ -12,14 +12,14 @@ ]; rml:predicateObjectMap [ rml:objectMap [ - rml:reference "Name" + rml:reference "$.FirstName" ]; rml:predicate foaf:name ]; rml:subjectMap [ rml:graphMap [ - rml:reference "Name"; + rml:reference "$.ID"; rml:termType rml:Literal ]; - rml:template "http://example.com/Student/{ID}/{FirstName}" + rml:template "http://example.com/Student/{$.ID}/{$.FirstName}" ] . diff --git a/src/test/resources/rml-core/RMLTC0007h-MySQL/mapping.ttl b/src/test/resources/rml-core/RMLTC0007h-MySQL/mapping.ttl deleted file mode 100644 index 3d622a90..00000000 --- a/src/test/resources/rml-core/RMLTC0007h-MySQL/mapping.ttl +++ /dev/null @@ -1,29 +0,0 @@ -@prefix d2rq: . -@prefix foaf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source ; - rml:referenceFormulation rml:SQL2008Table; - rml:iterator "student" - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "Name" - ]; - rml:predicate foaf:name - ]; - rml:subjectMap [ - rml:graphMap [ - rml:reference "Name"; - rml:termType rml:Literal - ]; - rml:template "http://example.com/Student/{ID}/{FirstName}" - ] . - - a d2rq:Database; - d2rq:jdbcDSN "CONNECTIONDSN"; - d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver"; - d2rq:password ""; - d2rq:username "root" . diff --git a/src/test/resources/rml-core/RMLTC0007h-MySQL/resource.sql b/src/test/resources/rml-core/RMLTC0007h-MySQL/resource.sql deleted file mode 100644 index 0135d051..00000000 --- a/src/test/resources/rml-core/RMLTC0007h-MySQL/resource.sql +++ /dev/null @@ -1,9 +0,0 @@ -USE test; -DROP TABLE IF EXISTS test.student; - -CREATE TABLE student ( - ID INTEGER, - FirstName VARCHAR(50), - LastName VARCHAR(50) -); -INSERT INTO student values ('10', 'Venus', 'Williams'); diff --git a/src/test/resources/rml-core/RMLTC0007h-PostgreSQL/mapping.ttl b/src/test/resources/rml-core/RMLTC0007h-PostgreSQL/mapping.ttl deleted file mode 100644 index 2fb1fa99..00000000 --- a/src/test/resources/rml-core/RMLTC0007h-PostgreSQL/mapping.ttl +++ /dev/null @@ -1,29 +0,0 @@ -@prefix d2rq: . -@prefix foaf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source ; - rml:referenceFormulation rml:SQL2008Table; - rml:iterator "student" - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "Name" - ]; - rml:predicate foaf:name - ]; - rml:subjectMap [ - rml:graphMap [ - rml:reference "Name"; - rml:termType rml:Literal - ]; - rml:template "http://example.com/Student/{ID}/{FirstName}" - ] . - - a d2rq:Database; - d2rq:jdbcDSN "CONNECTIONDSN"; - d2rq:jdbcDriver "org.postgresql.Driver"; - d2rq:password ""; - d2rq:username "postgres" . diff --git a/src/test/resources/rml-core/RMLTC0007h-PostgreSQL/resource.sql b/src/test/resources/rml-core/RMLTC0007h-PostgreSQL/resource.sql deleted file mode 100644 index b5c63bc3..00000000 --- a/src/test/resources/rml-core/RMLTC0007h-PostgreSQL/resource.sql +++ /dev/null @@ -1,8 +0,0 @@ -DROP TABLE IF EXISTS student; - -CREATE TABLE student ( - "ID" INTEGER, - "FirstName" VARCHAR(50), - "LastName" VARCHAR(50) -); -INSERT INTO student values ('10', 'Venus', 'Williams'); diff --git a/src/test/resources/rml-core/RMLTC0007h-SPARQL/mapping.ttl b/src/test/resources/rml-core/RMLTC0007h-SPARQL/mapping.ttl deleted file mode 100644 index e323fc9a..00000000 --- a/src/test/resources/rml-core/RMLTC0007h-SPARQL/mapping.ttl +++ /dev/null @@ -1,36 +0,0 @@ -@prefix foaf: . -@prefix formats: . -@prefix rml: . -@prefix sd: . - - rml:logicalSource [ - rml:iterator """ - PREFIX rdfs: - PREFIX foaf: - PREFIX rdf: - SELECT ?FirstName ?LastName ?ID - WHERE { - ?x foaf:firstName ?FirstName ; - foaf:lastName ?LastName ; - rdf:ID ?ID . - } """; - rml:referenceFormulation formats:SPARQL_Results_JSON; - rml:source - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "Name.value" - ]; - rml:predicate foaf:name - ]; - rml:subjectMap [ - rml:graphMap [ - rml:reference "Name"; - rml:termType rml:Literal - ]; - rml:template "http://example.com/Student/{ID.value}/{FirstName.value}" - ] . - - a sd:Service; - sd:endpoint ; - sd:supportedLanguage sd:SPARQL11Query . diff --git a/src/test/resources/rml-core/RMLTC0007h-SPARQL/resource.ttl b/src/test/resources/rml-core/RMLTC0007h-SPARQL/resource.ttl deleted file mode 100644 index f4a7ed47..00000000 --- a/src/test/resources/rml-core/RMLTC0007h-SPARQL/resource.ttl +++ /dev/null @@ -1,7 +0,0 @@ -@prefix foaf: . -@prefix rdf: . - -[] rdf:ID "10" ; - foaf:firstName "Venus" ; - foaf:lastName "Williams" . - diff --git a/src/test/resources/rml-core/RMLTC0007h-SQLServer/mapping.ttl b/src/test/resources/rml-core/RMLTC0007h-SQLServer/mapping.ttl deleted file mode 100644 index 976ef9d6..00000000 --- a/src/test/resources/rml-core/RMLTC0007h-SQLServer/mapping.ttl +++ /dev/null @@ -1,29 +0,0 @@ -@prefix d2rq: . -@prefix foaf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source ; - rml:referenceFormulation rml:SQL2008Table; - rml:iterator "student" - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "Name" - ]; - rml:predicate foaf:name - ]; - rml:subjectMap [ - rml:graphMap [ - rml:reference "Name"; - rml:termType rml:Literal - ]; - rml:template "http://example.com/Student/{ID}/{FirstName}" - ] . - - a d2rq:Database; - d2rq:jdbcDSN "CONNECTIONDSN"; - d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver"; - d2rq:password "YourSTRONG!Passw0rd;"; - d2rq:username "sa" . diff --git a/src/test/resources/rml-core/RMLTC0007h-SQLServer/resource.sql b/src/test/resources/rml-core/RMLTC0007h-SQLServer/resource.sql deleted file mode 100644 index 976627c7..00000000 --- a/src/test/resources/rml-core/RMLTC0007h-SQLServer/resource.sql +++ /dev/null @@ -1,8 +0,0 @@ -USE TestDB; -DROP TABLE IF EXISTS student; -CREATE TABLE student ( - "ID" INTEGER, - "FirstName" VARCHAR(50), - "LastName" VARCHAR(50) -); -INSERT INTO student values ('10', 'Venus', 'Williams'); diff --git a/src/test/resources/rml-core/RMLTC0007h-XML/mapping.ttl b/src/test/resources/rml-core/RMLTC0007h-XML/mapping.ttl deleted file mode 100644 index 6288a1e5..00000000 --- a/src/test/resources/rml-core/RMLTC0007h-XML/mapping.ttl +++ /dev/null @@ -1,25 +0,0 @@ -@prefix foaf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator "/students/student"; - rml:referenceFormulation rml:XPath; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.xml" - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "Name" - ]; - rml:predicate foaf:name - ]; - rml:subjectMap [ - rml:graphMap [ - rml:reference "Name"; - rml:termType rml:Literal - ]; - rml:template "http://example.com/Student/{ID}/{FirstName}" - ] . diff --git a/src/test/resources/rml-core/RMLTC0007h-XML/student.xml b/src/test/resources/rml-core/RMLTC0007h-XML/student.xml deleted file mode 100644 index 44eab80f..00000000 --- a/src/test/resources/rml-core/RMLTC0007h-XML/student.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - 10 - Venus - Williams - - diff --git a/src/test/resources/rml-core/RMLTC0008a-CSV/mapping.ttl b/src/test/resources/rml-core/RMLTC0008a-CSV/mapping.ttl deleted file mode 100644 index 0764fee6..00000000 --- a/src/test/resources/rml-core/RMLTC0008a-CSV/mapping.ttl +++ /dev/null @@ -1,38 +0,0 @@ -@prefix ex: . -@prefix foaf: . -@prefix rdf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:referenceFormulation rml:CSV; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.csv" - ] - ]; - rml:predicateObjectMap [ - rml:object foaf:Person; - rml:predicate rdf:type - ], [ - rml:objectMap [ - rml:reference "ID" - ]; - rml:predicate ex:id - ], [ - rml:objectMap [ - rml:reference "Name" - ]; - rml:predicate foaf:name - ], [ - rml:objectMap [ - rml:reference "Sport" - ]; - rml:predicate ex:Sport - ]; - rml:subjectMap [ - rml:graphMap [ - rml:template "http://example.com/graph/Student/{ID}/{Name}" - ]; - rml:template "http://example.com/Student/{ID}/{Name}" - ] . diff --git a/src/test/resources/rml-core/RMLTC0008a-CSV/output.nq b/src/test/resources/rml-core/RMLTC0008a-CSV/output.nq deleted file mode 100644 index 2856ef24..00000000 --- a/src/test/resources/rml-core/RMLTC0008a-CSV/output.nq +++ /dev/null @@ -1,5 +0,0 @@ - . - "Venus Williams" . - "10" . - "Tennis" . - diff --git a/src/test/resources/rml-core/RMLTC0008a-CSV/student.csv b/src/test/resources/rml-core/RMLTC0008a-CSV/student.csv deleted file mode 100644 index fb130b76..00000000 --- a/src/test/resources/rml-core/RMLTC0008a-CSV/student.csv +++ /dev/null @@ -1,2 +0,0 @@ -ID,Name,Sport -10,Venus Williams,Tennis diff --git a/src/test/resources/rml-core/RMLTC0008a-JSON/README.md b/src/test/resources/rml-core/RMLTC0008a-JSON/README.md new file mode 100644 index 00000000..a0841468 --- /dev/null +++ b/src/test/resources/rml-core/RMLTC0008a-JSON/README.md @@ -0,0 +1,76 @@ +## RMLTC0008a-JSON + +**Title**: "Generation of triples to a target graph by using rml:graphMap and rml:template" + +**Description**: "Test that results of the mapping can be directed to a target graph by using rml:graphMap and rml:template" + +**Default Base IRI**: http://example.com/ + +**Error expected?** No + +**Input** +``` +{ + "students": [{ + "ID": 10, + "Name":"Venus Williams", + "Sport": "Tennis" + }] +} + +``` + +**Mapping** +``` +@prefix ex: . +@prefix foaf: . +@prefix rdf: . +@prefix rml: . + + a rml:TriplesMap; + rml:logicalSource [ a rml:LogicalSource; + rml:iterator "$.students[*]"; + rml:referenceFormulation rml:JSONPath; + rml:source [ a rml:RelativePathSource; + rml:root rml:MappingDirectory; + rml:path "student.json" + ] + ]; + rml:predicateObjectMap [ + rml:object foaf:Person; + rml:predicate rdf:type + ], [ + rml:objectMap [ + rml:reference "$.ID" + ]; + rml:predicate ex:id + ], [ + rml:objectMap [ + rml:reference "$.Name" + ]; + rml:predicate foaf:name + ], [ + rml:objectMap [ + rml:reference "$.Sport" + ]; + rml:predicate ex:Sport + ]; + rml:subjectMap [ + rml:graphMap [ + rml:template "http://example.com/graph/Student/{$.ID}/{$.Name}" + ]; + rml:template "http://example.com/Student/{$.ID}/{$.Name}" + ] . + +``` + +**Output** +``` + . + "Venus Williams" . + "10" . + "Tennis" . + + +``` + diff --git a/src/test/resources/rml-core/RMLTC0008a-JSON/mapping.ttl b/src/test/resources/rml-core/RMLTC0008a-JSON/mapping.ttl index 235fc633..c12600ca 100644 --- a/src/test/resources/rml-core/RMLTC0008a-JSON/mapping.ttl +++ b/src/test/resources/rml-core/RMLTC0008a-JSON/mapping.ttl @@ -17,23 +17,23 @@ rml:predicate rdf:type ], [ rml:objectMap [ - rml:reference "ID" + rml:reference "$.ID" ]; rml:predicate ex:id ], [ rml:objectMap [ - rml:reference "Name" + rml:reference "$.Name" ]; rml:predicate foaf:name ], [ rml:objectMap [ - rml:reference "Sport" + rml:reference "$.Sport" ]; rml:predicate ex:Sport ]; rml:subjectMap [ rml:graphMap [ - rml:template "http://example.com/graph/Student/{ID}/{Name}" + rml:template "http://example.com/graph/Student/{$.ID}/{$.Name}" ]; - rml:template "http://example.com/Student/{ID}/{Name}" + rml:template "http://example.com/Student/{$.ID}/{$.Name}" ] . diff --git a/src/test/resources/rml-core/RMLTC0008a-MySQL/mapping.ttl b/src/test/resources/rml-core/RMLTC0008a-MySQL/mapping.ttl deleted file mode 100644 index dbe815e6..00000000 --- a/src/test/resources/rml-core/RMLTC0008a-MySQL/mapping.ttl +++ /dev/null @@ -1,43 +0,0 @@ -@prefix d2rq: . -@prefix ex: . -@prefix foaf: . -@prefix rdf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source ; - rml:referenceFormulation rml:SQL2008Table; - rml:iterator "student" - ]; - rml:predicateObjectMap [ - rml:object foaf:Person; - rml:predicate rdf:type - ], [ - rml:objectMap [ - rml:reference "ID" - ]; - rml:predicate ex:id - ], [ - rml:objectMap [ - rml:reference "Name" - ]; - rml:predicate foaf:name - ], [ - rml:objectMap [ - rml:reference "Sport" - ]; - rml:predicate ex:Sport - ]; - rml:subjectMap [ - rml:graphMap [ - rml:template "http://example.com/graph/Student/{ID}/{Name}" - ]; - rml:template "http://example.com/Student/{ID}/{Name}" - ] . - - a d2rq:Database; - d2rq:jdbcDSN "CONNECTIONDSN"; - d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver"; - d2rq:password ""; - d2rq:username "root" . diff --git a/src/test/resources/rml-core/RMLTC0008a-MySQL/output.nq b/src/test/resources/rml-core/RMLTC0008a-MySQL/output.nq deleted file mode 100644 index 8c3c01f8..00000000 --- a/src/test/resources/rml-core/RMLTC0008a-MySQL/output.nq +++ /dev/null @@ -1,6 +0,0 @@ - . - "Venus Williams" . - "10"^^ . - "Tennis" . - - diff --git a/src/test/resources/rml-core/RMLTC0008a-MySQL/resource.sql b/src/test/resources/rml-core/RMLTC0008a-MySQL/resource.sql deleted file mode 100644 index 31e00260..00000000 --- a/src/test/resources/rml-core/RMLTC0008a-MySQL/resource.sql +++ /dev/null @@ -1,9 +0,0 @@ -USE test; -DROP TABLE IF EXISTS test.student; - -CREATE TABLE student ( - ID INTEGER, - Name VARCHAR(50), - Sport VARCHAR(50) -); -INSERT INTO student values ('10', 'Venus Williams', 'Tennis'); diff --git a/src/test/resources/rml-core/RMLTC0008a-PostgreSQL/mapping.ttl b/src/test/resources/rml-core/RMLTC0008a-PostgreSQL/mapping.ttl deleted file mode 100644 index f84e0538..00000000 --- a/src/test/resources/rml-core/RMLTC0008a-PostgreSQL/mapping.ttl +++ /dev/null @@ -1,43 +0,0 @@ -@prefix d2rq: . -@prefix ex: . -@prefix foaf: . -@prefix rdf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source ; - rml:referenceFormulation rml:SQL2008Table; - rml:iterator "student" - ]; - rml:predicateObjectMap [ - rml:object foaf:Person; - rml:predicate rdf:type - ], [ - rml:objectMap [ - rml:reference "ID" - ]; - rml:predicate ex:id - ], [ - rml:objectMap [ - rml:reference "Name" - ]; - rml:predicate foaf:name - ], [ - rml:objectMap [ - rml:reference "Sport" - ]; - rml:predicate ex:Sport - ]; - rml:subjectMap [ - rml:graphMap [ - rml:template "http://example.com/graph/Student/{ID}/{Name}" - ]; - rml:template "http://example.com/Student/{ID}/{Name}" - ] . - - a d2rq:Database; - d2rq:jdbcDSN "CONNECTIONDSN"; - d2rq:jdbcDriver "org.postgresql.Driver"; - d2rq:password ""; - d2rq:username "postgres" . diff --git a/src/test/resources/rml-core/RMLTC0008a-PostgreSQL/output.nq b/src/test/resources/rml-core/RMLTC0008a-PostgreSQL/output.nq deleted file mode 100644 index 8c3c01f8..00000000 --- a/src/test/resources/rml-core/RMLTC0008a-PostgreSQL/output.nq +++ /dev/null @@ -1,6 +0,0 @@ - . - "Venus Williams" . - "10"^^ . - "Tennis" . - - diff --git a/src/test/resources/rml-core/RMLTC0008a-PostgreSQL/resource.sql b/src/test/resources/rml-core/RMLTC0008a-PostgreSQL/resource.sql deleted file mode 100644 index 3ad893a6..00000000 --- a/src/test/resources/rml-core/RMLTC0008a-PostgreSQL/resource.sql +++ /dev/null @@ -1,8 +0,0 @@ -DROP TABLE IF EXISTS student; - -CREATE TABLE student ( - "ID" INTEGER, - "Name" VARCHAR(50), - "Sport" VARCHAR(50) -); -INSERT INTO student values ('10', 'Venus Williams', 'Tennis'); diff --git a/src/test/resources/rml-core/RMLTC0008a-SPARQL/mapping.ttl b/src/test/resources/rml-core/RMLTC0008a-SPARQL/mapping.ttl deleted file mode 100644 index 97d3504b..00000000 --- a/src/test/resources/rml-core/RMLTC0008a-SPARQL/mapping.ttl +++ /dev/null @@ -1,51 +0,0 @@ -@prefix ex: . -@prefix foaf: . -@prefix formats: . -@prefix rdf: . -@prefix rml: . -@prefix sd: . - - rml:logicalSource [ - rml:iterator """ - PREFIX rdfs: - PREFIX foaf: - PREFIX rdf: - SELECT ?Name ?Sport ?ID - WHERE { - ?x foaf:name ?Name ; - rdf:ID ?ID ; - ?sportObject . - ?sportObject foaf:name ?Sport . - } """; - rml:referenceFormulation formats:SPARQL_Results_JSON; - rml:source - ]; - rml:predicateObjectMap [ - rml:object foaf:Person; - rml:predicate rdf:type - ], [ - rml:objectMap [ - rml:reference "ID.value" - ]; - rml:predicate ex:id - ], [ - rml:objectMap [ - rml:reference "Name.value" - ]; - rml:predicate foaf:name - ], [ - rml:objectMap [ - rml:reference "Sport.value" - ]; - rml:predicate ex:Sport - ]; - rml:subjectMap [ - rml:graphMap [ - rml:template "http://example.com/graph/Student/{ID.value}/{Name.value}" - ]; - rml:template "http://example.com/Student/{ID.value}/{Name.value}" - ] . - - a sd:Service; - sd:endpoint ; - sd:supportedLanguage sd:SPARQL11Query . diff --git a/src/test/resources/rml-core/RMLTC0008a-SPARQL/output.nq b/src/test/resources/rml-core/RMLTC0008a-SPARQL/output.nq deleted file mode 100644 index 2856ef24..00000000 --- a/src/test/resources/rml-core/RMLTC0008a-SPARQL/output.nq +++ /dev/null @@ -1,5 +0,0 @@ - . - "Venus Williams" . - "10" . - "Tennis" . - diff --git a/src/test/resources/rml-core/RMLTC0008a-SPARQL/resource.ttl b/src/test/resources/rml-core/RMLTC0008a-SPARQL/resource.ttl deleted file mode 100644 index e7007e36..00000000 --- a/src/test/resources/rml-core/RMLTC0008a-SPARQL/resource.ttl +++ /dev/null @@ -1,9 +0,0 @@ -@prefix foaf: . -@prefix ns1: . -@prefix rdf: . - -[] ns1:plays [ a ns1:Sport ; - foaf:name "Tennis" ] ; - rdf:ID "10" ; - foaf:name "Venus Williams" . - diff --git a/src/test/resources/rml-core/RMLTC0008a-SQLServer/mapping.ttl b/src/test/resources/rml-core/RMLTC0008a-SQLServer/mapping.ttl deleted file mode 100644 index e0220849..00000000 --- a/src/test/resources/rml-core/RMLTC0008a-SQLServer/mapping.ttl +++ /dev/null @@ -1,43 +0,0 @@ -@prefix d2rq: . -@prefix ex: . -@prefix foaf: . -@prefix rdf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source ; - rml:referenceFormulation rml:SQL2008Table; - rml:iterator "student" - ]; - rml:predicateObjectMap [ - rml:object foaf:Person; - rml:predicate rdf:type - ], [ - rml:objectMap [ - rml:reference "ID" - ]; - rml:predicate ex:id - ], [ - rml:objectMap [ - rml:reference "Name" - ]; - rml:predicate foaf:name - ], [ - rml:objectMap [ - rml:reference "Sport" - ]; - rml:predicate ex:Sport - ]; - rml:subjectMap [ - rml:graphMap [ - rml:template "http://example.com/graph/Student/{ID}/{Name}" - ]; - rml:template "http://example.com/Student/{ID}/{Name}" - ] . - - a d2rq:Database; - d2rq:jdbcDSN "CONNECTIONDSN"; - d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver"; - d2rq:password "YourSTRONG!Passw0rd;"; - d2rq:username "sa" . diff --git a/src/test/resources/rml-core/RMLTC0008a-SQLServer/output.nq b/src/test/resources/rml-core/RMLTC0008a-SQLServer/output.nq deleted file mode 100644 index 8c3c01f8..00000000 --- a/src/test/resources/rml-core/RMLTC0008a-SQLServer/output.nq +++ /dev/null @@ -1,6 +0,0 @@ - . - "Venus Williams" . - "10"^^ . - "Tennis" . - - diff --git a/src/test/resources/rml-core/RMLTC0008a-SQLServer/resource.sql b/src/test/resources/rml-core/RMLTC0008a-SQLServer/resource.sql deleted file mode 100644 index e9b41d95..00000000 --- a/src/test/resources/rml-core/RMLTC0008a-SQLServer/resource.sql +++ /dev/null @@ -1,8 +0,0 @@ -USE TestDB; -DROP TABLE IF EXISTS student; -CREATE TABLE student ( - "ID" INTEGER, - "Name" VARCHAR(50), - "Sport" VARCHAR(50) -); -INSERT INTO student values ('10', 'Venus Williams', 'Tennis'); diff --git a/src/test/resources/rml-core/RMLTC0008a-XML/mapping.ttl b/src/test/resources/rml-core/RMLTC0008a-XML/mapping.ttl deleted file mode 100644 index e9f3ac3f..00000000 --- a/src/test/resources/rml-core/RMLTC0008a-XML/mapping.ttl +++ /dev/null @@ -1,39 +0,0 @@ -@prefix ex: . -@prefix foaf: . -@prefix rdf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator "/students/student"; - rml:referenceFormulation rml:XPath; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.xml" - ] - ]; - rml:predicateObjectMap [ - rml:object foaf:Person; - rml:predicate rdf:type - ], [ - rml:objectMap [ - rml:reference "ID" - ]; - rml:predicate ex:id - ], [ - rml:objectMap [ - rml:reference "Name" - ]; - rml:predicate foaf:name - ], [ - rml:objectMap [ - rml:reference "Sport" - ]; - rml:predicate ex:Sport - ]; - rml:subjectMap [ - rml:graphMap [ - rml:template "http://example.com/graph/Student/{ID}/{Name}" - ]; - rml:template "http://example.com/Student/{ID}/{Name}" - ] . diff --git a/src/test/resources/rml-core/RMLTC0008a-XML/output.nq b/src/test/resources/rml-core/RMLTC0008a-XML/output.nq deleted file mode 100644 index 2856ef24..00000000 --- a/src/test/resources/rml-core/RMLTC0008a-XML/output.nq +++ /dev/null @@ -1,5 +0,0 @@ - . - "Venus Williams" . - "10" . - "Tennis" . - diff --git a/src/test/resources/rml-core/RMLTC0008a-XML/student.xml b/src/test/resources/rml-core/RMLTC0008a-XML/student.xml deleted file mode 100644 index 9ae75cc8..00000000 --- a/src/test/resources/rml-core/RMLTC0008a-XML/student.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - 10 - Venus Williams - Tennis - - diff --git a/src/test/resources/rml-core/RMLTC0008b-CSV/mapping.ttl b/src/test/resources/rml-core/RMLTC0008b-CSV/mapping.ttl deleted file mode 100644 index f6dc834f..00000000 --- a/src/test/resources/rml-core/RMLTC0008b-CSV/mapping.ttl +++ /dev/null @@ -1,53 +0,0 @@ -@prefix activity: . -@prefix ex: . -@prefix foaf: . -@prefix rdf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:referenceFormulation rml:CSV; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.csv" - ] - ]; - rml:predicateObjectMap [ - rml:objectMap ; - rml:predicate ex:Sport - ], [ - rml:object foaf:Person; - rml:predicate rdf:type - ], [ - rml:objectMap [ - rml:reference "ID" - ]; - rml:predicate ex:id - ], [ - rml:objectMap [ - rml:reference "Name" - ]; - rml:predicate foaf:name - ]; - rml:subjectMap [ - rml:template "http://example.com/Student/{ID}/{Name}" - ] . - - a rml:RefObjectMap; - rml:parentTriplesMap . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:referenceFormulation rml:CSV; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.csv" - ] - ]; - rml:predicateObjectMap [ - rml:object activity:Sport; - rml:predicate rdf:type - ]; - rml:subjectMap [ - rml:template "http://example.com/{Sport}" - ] . diff --git a/src/test/resources/rml-core/RMLTC0008b-CSV/output.nq b/src/test/resources/rml-core/RMLTC0008b-CSV/output.nq deleted file mode 100644 index 7742ae45..00000000 --- a/src/test/resources/rml-core/RMLTC0008b-CSV/output.nq +++ /dev/null @@ -1,7 +0,0 @@ - . - "Venus Williams" . - "10" . - . - . - - diff --git a/src/test/resources/rml-core/RMLTC0008b-CSV/student.csv b/src/test/resources/rml-core/RMLTC0008b-CSV/student.csv deleted file mode 100644 index fb130b76..00000000 --- a/src/test/resources/rml-core/RMLTC0008b-CSV/student.csv +++ /dev/null @@ -1,2 +0,0 @@ -ID,Name,Sport -10,Venus Williams,Tennis diff --git a/src/test/resources/rml-core/RMLTC0008b-JSON/README.md b/src/test/resources/rml-core/RMLTC0008b-JSON/README.md new file mode 100644 index 00000000..8e3e8ed1 --- /dev/null +++ b/src/test/resources/rml-core/RMLTC0008b-JSON/README.md @@ -0,0 +1,94 @@ +## RMLTC0008b-JSON + +**Title**: "Generation of triples referencing object map" + +**Description**: "Tests the mapping specification referencing object map without join" + +**Default Base IRI**: http://example.com/ + +**Error expected?** No + +**Input** +``` +{ + "students": [{ + "ID": 10, + "Name":"Venus Williams", + "Sport": "Tennis" + }] +} + +``` + +**Mapping** +``` +@prefix activity: . +@prefix ex: . +@prefix foaf: . +@prefix rdf: . +@prefix rml: . + + a rml:TriplesMap; + rml:logicalSource [ a rml:LogicalSource; + rml:iterator "$.students[*]"; + rml:referenceFormulation rml:JSONPath; + rml:source [ a rml:RelativePathSource; + rml:root rml:MappingDirectory; + rml:path "student.json" + ] + ]; + rml:predicateObjectMap [ + rml:objectMap ; + rml:predicate ex:Sport + ], [ + rml:object foaf:Person; + rml:predicate rdf:type + ], [ + rml:objectMap [ + rml:reference "$.ID" + ]; + rml:predicate ex:id + ], [ + rml:objectMap [ + rml:reference "$.Name" + ]; + rml:predicate foaf:name + ]; + rml:subjectMap [ + rml:template "http://example.com/Student/{$.ID}/{$.Name}" + ] . + + a rml:RefObjectMap; + rml:parentTriplesMap . + + a rml:TriplesMap; + rml:logicalSource [ a rml:LogicalSource; + rml:iterator "$.students[*]"; + rml:referenceFormulation rml:JSONPath; + rml:source [ a rml:RelativePathSource; + rml:root rml:MappingDirectory; + rml:path "student.json" + ] + ]; + rml:predicateObjectMap [ + rml:object activity:Sport; + rml:predicate rdf:type + ]; + rml:subjectMap [ + rml:template "http://example.com/{$.Sport}" + ] . + +``` + +**Output** +``` + . + "Venus Williams" . + "10"^^ . + . + . + + + +``` + diff --git a/src/test/resources/rml-core/RMLTC0008b-JSON/mapping.ttl b/src/test/resources/rml-core/RMLTC0008b-JSON/mapping.ttl index 81ebfe7d..9aba67e8 100644 --- a/src/test/resources/rml-core/RMLTC0008b-JSON/mapping.ttl +++ b/src/test/resources/rml-core/RMLTC0008b-JSON/mapping.ttl @@ -21,17 +21,17 @@ rml:predicate rdf:type ], [ rml:objectMap [ - rml:reference "ID" + rml:reference "$.ID" ]; rml:predicate ex:id ], [ rml:objectMap [ - rml:reference "Name" + rml:reference "$.Name" ]; rml:predicate foaf:name ]; rml:subjectMap [ - rml:template "http://example.com/Student/{ID}/{Name}" + rml:template "http://example.com/Student/{$.ID}/{$.Name}" ] . a rml:RefObjectMap; @@ -51,5 +51,5 @@ rml:predicate rdf:type ]; rml:subjectMap [ - rml:template "http://example.com/{Sport}" + rml:template "http://example.com/{$.Sport}" ] . diff --git a/src/test/resources/rml-core/RMLTC0008b-JSON/output.nq b/src/test/resources/rml-core/RMLTC0008b-JSON/output.nq index 7742ae45..a2678fac 100644 --- a/src/test/resources/rml-core/RMLTC0008b-JSON/output.nq +++ b/src/test/resources/rml-core/RMLTC0008b-JSON/output.nq @@ -1,6 +1,6 @@ . "Venus Williams" . - "10" . + "10"^^ . . . diff --git a/src/test/resources/rml-core/RMLTC0008b-MySQL/mapping.ttl b/src/test/resources/rml-core/RMLTC0008b-MySQL/mapping.ttl deleted file mode 100644 index 0b2c01af..00000000 --- a/src/test/resources/rml-core/RMLTC0008b-MySQL/mapping.ttl +++ /dev/null @@ -1,56 +0,0 @@ -@prefix activity: . -@prefix d2rq: . -@prefix ex: . -@prefix foaf: . -@prefix rdf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source ; - rml:referenceFormulation rml:SQL2008Table; - rml:iterator "student" - ]; - rml:predicateObjectMap [ - rml:objectMap ; - rml:predicate ex:Sport - ], [ - rml:object foaf:Person; - rml:predicate rdf:type - ], [ - rml:objectMap [ - rml:reference "ID" - ]; - rml:predicate ex:id - ], [ - rml:objectMap [ - rml:reference "Name" - ]; - rml:predicate foaf:name - ]; - rml:subjectMap [ - rml:template "http://example.com/Student/{ID}/{Name}" - ] . - - a rml:RefObjectMap; - rml:parentTriplesMap . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source ; - rml:referenceFormulation rml:SQL2008Table; - rml:iterator "student" - ]; - rml:predicateObjectMap [ - rml:object activity:Sport; - rml:predicate rdf:type - ]; - rml:subjectMap [ - rml:template "http://example.com/{Sport}" - ] . - - a d2rq:Database; - d2rq:jdbcDSN "CONNECTIONDSN"; - d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver"; - d2rq:password ""; - d2rq:username "root" . diff --git a/src/test/resources/rml-core/RMLTC0008b-MySQL/output.nq b/src/test/resources/rml-core/RMLTC0008b-MySQL/output.nq deleted file mode 100644 index 9271c2c5..00000000 --- a/src/test/resources/rml-core/RMLTC0008b-MySQL/output.nq +++ /dev/null @@ -1,7 +0,0 @@ - . - "Venus Williams" . - "10"^^ . - . - . - - diff --git a/src/test/resources/rml-core/RMLTC0008b-MySQL/resource.sql b/src/test/resources/rml-core/RMLTC0008b-MySQL/resource.sql deleted file mode 100644 index 31e00260..00000000 --- a/src/test/resources/rml-core/RMLTC0008b-MySQL/resource.sql +++ /dev/null @@ -1,9 +0,0 @@ -USE test; -DROP TABLE IF EXISTS test.student; - -CREATE TABLE student ( - ID INTEGER, - Name VARCHAR(50), - Sport VARCHAR(50) -); -INSERT INTO student values ('10', 'Venus Williams', 'Tennis'); diff --git a/src/test/resources/rml-core/RMLTC0008b-PostgreSQL/mapping.ttl b/src/test/resources/rml-core/RMLTC0008b-PostgreSQL/mapping.ttl deleted file mode 100644 index 0a068c2e..00000000 --- a/src/test/resources/rml-core/RMLTC0008b-PostgreSQL/mapping.ttl +++ /dev/null @@ -1,56 +0,0 @@ -@prefix activity: . -@prefix d2rq: . -@prefix ex: . -@prefix foaf: . -@prefix rdf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source ; - rml:referenceFormulation rml:SQL2008Table; - rml:iterator "student" - ]; - rml:predicateObjectMap [ - rml:objectMap ; - rml:predicate ex:Sport - ], [ - rml:object foaf:Person; - rml:predicate rdf:type - ], [ - rml:objectMap [ - rml:reference "ID" - ]; - rml:predicate ex:id - ], [ - rml:objectMap [ - rml:reference "Name" - ]; - rml:predicate foaf:name - ]; - rml:subjectMap [ - rml:template "http://example.com/Student/{ID}/{Name}" - ] . - - a rml:RefObjectMap; - rml:parentTriplesMap . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source ; - rml:referenceFormulation rml:SQL2008Table; - rml:iterator "student" - ]; - rml:predicateObjectMap [ - rml:object activity:Sport; - rml:predicate rdf:type - ]; - rml:subjectMap [ - rml:template "http://example.com/{Sport}" - ] . - - a d2rq:Database; - d2rq:jdbcDSN "CONNECTIONDSN"; - d2rq:jdbcDriver "org.postgresql.Driver"; - d2rq:password ""; - d2rq:username "postgres" . diff --git a/src/test/resources/rml-core/RMLTC0008b-PostgreSQL/output.nq b/src/test/resources/rml-core/RMLTC0008b-PostgreSQL/output.nq deleted file mode 100644 index 9271c2c5..00000000 --- a/src/test/resources/rml-core/RMLTC0008b-PostgreSQL/output.nq +++ /dev/null @@ -1,7 +0,0 @@ - . - "Venus Williams" . - "10"^^ . - . - . - - diff --git a/src/test/resources/rml-core/RMLTC0008b-PostgreSQL/resource.sql b/src/test/resources/rml-core/RMLTC0008b-PostgreSQL/resource.sql deleted file mode 100644 index 3ad893a6..00000000 --- a/src/test/resources/rml-core/RMLTC0008b-PostgreSQL/resource.sql +++ /dev/null @@ -1,8 +0,0 @@ -DROP TABLE IF EXISTS student; - -CREATE TABLE student ( - "ID" INTEGER, - "Name" VARCHAR(50), - "Sport" VARCHAR(50) -); -INSERT INTO student values ('10', 'Venus Williams', 'Tennis'); diff --git a/src/test/resources/rml-core/RMLTC0008b-SPARQL/mapping.ttl b/src/test/resources/rml-core/RMLTC0008b-SPARQL/mapping.ttl deleted file mode 100644 index 35ffb33c..00000000 --- a/src/test/resources/rml-core/RMLTC0008b-SPARQL/mapping.ttl +++ /dev/null @@ -1,77 +0,0 @@ -@prefix activity: . -@prefix ex: . -@prefix foaf: . -@prefix formats: . -@prefix rdf: . -@prefix rml: . -@prefix sd: . - -ex:TriplesMap1 a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator """ - PREFIX rdfs: - PREFIX foaf: - PREFIX rdf: - SELECT ?Name ?ID - WHERE { - ?x foaf:name ?Name ; - rdf:ID ?ID ; - } """; - rml:referenceFormulation formats:SPARQL_Results_JSON; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path - ] - ]; - rml:predicateObjectMap [ - rml:objectMap ex:RefObjectMap1; - rml:predicate ex:Sport - ], [ - rml:object foaf:Person; - rml:predicate rdf:type - ], [ - rml:objectMap [ - rml:reference "ID.value" - ]; - rml:predicate ex:id - ], [ - rml:objectMap [ - rml:reference "Name.value" - ]; - rml:predicate foaf:name - ]; - rml:subjectMap [ - rml:template "http://example.com/Student/{ID.value}/{Name.value}" - ] . - -ex:RefObjectMap1 a rml:RefObjectMap; - rml:parentTriplesMap ex:TriplesMap2 . - -ex:TriplesMap2 a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator """ - PREFIX rdfs: - PREFIX foaf: - PREFIX rdf: - SELECT ?Sport - WHERE { - ?x a . - ?x foaf:name ?Sport . - } """; - rml:referenceFormulation formats:SPARQL_Results_JSON; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path - ] - ]; - rml:predicateObjectMap [ - rml:object activity:Sport; - rml:predicate rdf:type - ]; - rml:subjectMap [ - rml:template "http://example.com/{Sport.value}" - ] . - - a sd:Service; - sd:endpoint ; - sd:supportedLanguage sd:SPARQL11Query . diff --git a/src/test/resources/rml-core/RMLTC0008b-SPARQL/output.nq b/src/test/resources/rml-core/RMLTC0008b-SPARQL/output.nq deleted file mode 100644 index 7742ae45..00000000 --- a/src/test/resources/rml-core/RMLTC0008b-SPARQL/output.nq +++ /dev/null @@ -1,7 +0,0 @@ - . - "Venus Williams" . - "10" . - . - . - - diff --git a/src/test/resources/rml-core/RMLTC0008b-SPARQL/resource.ttl b/src/test/resources/rml-core/RMLTC0008b-SPARQL/resource.ttl deleted file mode 100644 index e7007e36..00000000 --- a/src/test/resources/rml-core/RMLTC0008b-SPARQL/resource.ttl +++ /dev/null @@ -1,9 +0,0 @@ -@prefix foaf: . -@prefix ns1: . -@prefix rdf: . - -[] ns1:plays [ a ns1:Sport ; - foaf:name "Tennis" ] ; - rdf:ID "10" ; - foaf:name "Venus Williams" . - diff --git a/src/test/resources/rml-core/RMLTC0008b-SQLServer/mapping.ttl b/src/test/resources/rml-core/RMLTC0008b-SQLServer/mapping.ttl deleted file mode 100644 index 08c9aab6..00000000 --- a/src/test/resources/rml-core/RMLTC0008b-SQLServer/mapping.ttl +++ /dev/null @@ -1,56 +0,0 @@ -@prefix activity: . -@prefix d2rq: . -@prefix ex: . -@prefix foaf: . -@prefix rdf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source ; - rml:referenceFormulation rml:SQL2008Table; - rml:iterator "student" - ]; - rml:predicateObjectMap [ - rml:objectMap ; - rml:predicate ex:Sport - ], [ - rml:object foaf:Person; - rml:predicate rdf:type - ], [ - rml:objectMap [ - rml:reference "ID" - ]; - rml:predicate ex:id - ], [ - rml:objectMap [ - rml:reference "Name" - ]; - rml:predicate foaf:name - ]; - rml:subjectMap [ - rml:template "http://example.com/Student/{ID}/{Name}" - ] . - - a rml:RefObjectMap; - rml:parentTriplesMap . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source ; - rml:referenceFormulation rml:SQL2008Table; - rml:iterator "student" - ]; - rml:predicateObjectMap [ - rml:object activity:Sport; - rml:predicate rdf:type - ]; - rml:subjectMap [ - rml:template "http://example.com/{Sport}" - ] . - - a d2rq:Database; - d2rq:jdbcDSN "CONNECTIONDSN"; - d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver"; - d2rq:password "YourSTRONG!Passw0rd;"; - d2rq:username "sa" . diff --git a/src/test/resources/rml-core/RMLTC0008b-SQLServer/output.nq b/src/test/resources/rml-core/RMLTC0008b-SQLServer/output.nq deleted file mode 100644 index 9271c2c5..00000000 --- a/src/test/resources/rml-core/RMLTC0008b-SQLServer/output.nq +++ /dev/null @@ -1,7 +0,0 @@ - . - "Venus Williams" . - "10"^^ . - . - . - - diff --git a/src/test/resources/rml-core/RMLTC0008b-SQLServer/resource.sql b/src/test/resources/rml-core/RMLTC0008b-SQLServer/resource.sql deleted file mode 100644 index e9b41d95..00000000 --- a/src/test/resources/rml-core/RMLTC0008b-SQLServer/resource.sql +++ /dev/null @@ -1,8 +0,0 @@ -USE TestDB; -DROP TABLE IF EXISTS student; -CREATE TABLE student ( - "ID" INTEGER, - "Name" VARCHAR(50), - "Sport" VARCHAR(50) -); -INSERT INTO student values ('10', 'Venus Williams', 'Tennis'); diff --git a/src/test/resources/rml-core/RMLTC0008b-XML/mapping.ttl b/src/test/resources/rml-core/RMLTC0008b-XML/mapping.ttl deleted file mode 100644 index ae1f2f5f..00000000 --- a/src/test/resources/rml-core/RMLTC0008b-XML/mapping.ttl +++ /dev/null @@ -1,55 +0,0 @@ -@prefix activity: . -@prefix ex: . -@prefix foaf: . -@prefix rdf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator "/students/student"; - rml:referenceFormulation rml:XPath; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.xml" - ] - ]; - rml:predicateObjectMap [ - rml:objectMap ; - rml:predicate ex:Sport - ], [ - rml:object foaf:Person; - rml:predicate rdf:type - ], [ - rml:objectMap [ - rml:reference "ID" - ]; - rml:predicate ex:id - ], [ - rml:objectMap [ - rml:reference "Name" - ]; - rml:predicate foaf:name - ]; - rml:subjectMap [ - rml:template "http://example.com/Student/{ID}/{Name}" - ] . - - a rml:RefObjectMap; - rml:parentTriplesMap . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator "/students/student"; - rml:referenceFormulation rml:XPath; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.xml" - ] - ]; - rml:predicateObjectMap [ - rml:object activity:Sport; - rml:predicate rdf:type - ]; - rml:subjectMap [ - rml:template "http://example.com/{Sport}" - ] . diff --git a/src/test/resources/rml-core/RMLTC0008b-XML/output.nq b/src/test/resources/rml-core/RMLTC0008b-XML/output.nq deleted file mode 100644 index 7742ae45..00000000 --- a/src/test/resources/rml-core/RMLTC0008b-XML/output.nq +++ /dev/null @@ -1,7 +0,0 @@ - . - "Venus Williams" . - "10" . - . - . - - diff --git a/src/test/resources/rml-core/RMLTC0008b-XML/student.xml b/src/test/resources/rml-core/RMLTC0008b-XML/student.xml deleted file mode 100644 index 9ae75cc8..00000000 --- a/src/test/resources/rml-core/RMLTC0008b-XML/student.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - 10 - Venus Williams - Tennis - - diff --git a/src/test/resources/rml-core/RMLTC0008c-CSV/mapping.ttl b/src/test/resources/rml-core/RMLTC0008c-CSV/mapping.ttl deleted file mode 100644 index 1dd7e877..00000000 --- a/src/test/resources/rml-core/RMLTC0008c-CSV/mapping.ttl +++ /dev/null @@ -1,21 +0,0 @@ -@prefix ex: . -@prefix foaf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:referenceFormulation rml:CSV; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.csv" - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "Name" - ]; - rml:predicate ex:name, foaf:name - ]; - rml:subjectMap [ - rml:template "http://example.com/Student/{ID}/{Name}" - ] . diff --git a/src/test/resources/rml-core/RMLTC0008c-CSV/output.nq b/src/test/resources/rml-core/RMLTC0008c-CSV/output.nq deleted file mode 100644 index d36f700c..00000000 --- a/src/test/resources/rml-core/RMLTC0008c-CSV/output.nq +++ /dev/null @@ -1,3 +0,0 @@ - "Venus Williams" . - "Venus Williams" . - diff --git a/src/test/resources/rml-core/RMLTC0008c-CSV/student.csv b/src/test/resources/rml-core/RMLTC0008c-CSV/student.csv deleted file mode 100644 index fb130b76..00000000 --- a/src/test/resources/rml-core/RMLTC0008c-CSV/student.csv +++ /dev/null @@ -1,2 +0,0 @@ -ID,Name,Sport -10,Venus Williams,Tennis diff --git a/src/test/resources/rml-core/RMLTC0008c-JSON/README.md b/src/test/resources/rml-core/RMLTC0008c-JSON/README.md new file mode 100644 index 00000000..fd07d456 --- /dev/null +++ b/src/test/resources/rml-core/RMLTC0008c-JSON/README.md @@ -0,0 +1,57 @@ +## RMLTC0008c-JSON + +**Title**: "Generation of triples by using multiple predicateMaps within a rml:predicateObjectMap" + +**Description**: "Tests the generation of triples by using multiple predicateMaps within a rml:predicateObjectMap" + +**Default Base IRI**: http://example.com/ + +**Error expected?** No + +**Input** +``` +{ + "students": [{ + "ID": 10, + "Name":"Venus Williams", + "Sport": "Tennis" + }] +} + +``` + +**Mapping** +``` +@prefix ex: . +@prefix foaf: . +@prefix rml: . + + a rml:TriplesMap; + rml:logicalSource [ a rml:LogicalSource; + rml:iterator "$.students[*]"; + rml:referenceFormulation rml:JSONPath; + rml:source [ a rml:RelativePathSource; + rml:root rml:MappingDirectory; + rml:path "student.json" + ] + ]; + rml:predicateObjectMap [ + rml:objectMap [ + rml:reference "$.Name" + ]; + rml:predicate ex:name, foaf:name + ]; + rml:subjectMap [ + rml:template "http://example.com/Student/{$.ID}/{$.Name}" + ] . + +``` + +**Output** +``` + "Venus Williams" . + "Venus Williams" . + + +``` + diff --git a/src/test/resources/rml-core/RMLTC0008c-JSON/mapping.ttl b/src/test/resources/rml-core/RMLTC0008c-JSON/mapping.ttl index 3fa6f387..a610a24c 100644 --- a/src/test/resources/rml-core/RMLTC0008c-JSON/mapping.ttl +++ b/src/test/resources/rml-core/RMLTC0008c-JSON/mapping.ttl @@ -13,10 +13,10 @@ ]; rml:predicateObjectMap [ rml:objectMap [ - rml:reference "Name" + rml:reference "$.Name" ]; rml:predicate ex:name, foaf:name ]; rml:subjectMap [ - rml:template "http://example.com/Student/{ID}/{Name}" + rml:template "http://example.com/Student/{$.ID}/{$.Name}" ] . diff --git a/src/test/resources/rml-core/RMLTC0008c-MySQL/mapping.ttl b/src/test/resources/rml-core/RMLTC0008c-MySQL/mapping.ttl deleted file mode 100644 index e4467dba..00000000 --- a/src/test/resources/rml-core/RMLTC0008c-MySQL/mapping.ttl +++ /dev/null @@ -1,26 +0,0 @@ -@prefix d2rq: . -@prefix ex: . -@prefix foaf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source ; - rml:referenceFormulation rml:SQL2008Table; - rml:iterator "student" - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "Name" - ]; - rml:predicate ex:name, foaf:name - ]; - rml:subjectMap [ - rml:template "http://example.com/Student/{ID}/{Name}" - ] . - - a d2rq:Database; - d2rq:jdbcDSN "CONNECTIONDSN"; - d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver"; - d2rq:password ""; - d2rq:username "root" . diff --git a/src/test/resources/rml-core/RMLTC0008c-MySQL/output.nq b/src/test/resources/rml-core/RMLTC0008c-MySQL/output.nq deleted file mode 100644 index d36f700c..00000000 --- a/src/test/resources/rml-core/RMLTC0008c-MySQL/output.nq +++ /dev/null @@ -1,3 +0,0 @@ - "Venus Williams" . - "Venus Williams" . - diff --git a/src/test/resources/rml-core/RMLTC0008c-MySQL/resource.sql b/src/test/resources/rml-core/RMLTC0008c-MySQL/resource.sql deleted file mode 100644 index 31e00260..00000000 --- a/src/test/resources/rml-core/RMLTC0008c-MySQL/resource.sql +++ /dev/null @@ -1,9 +0,0 @@ -USE test; -DROP TABLE IF EXISTS test.student; - -CREATE TABLE student ( - ID INTEGER, - Name VARCHAR(50), - Sport VARCHAR(50) -); -INSERT INTO student values ('10', 'Venus Williams', 'Tennis'); diff --git a/src/test/resources/rml-core/RMLTC0008c-PostgreSQL/mapping.ttl b/src/test/resources/rml-core/RMLTC0008c-PostgreSQL/mapping.ttl deleted file mode 100644 index 21bc9fbd..00000000 --- a/src/test/resources/rml-core/RMLTC0008c-PostgreSQL/mapping.ttl +++ /dev/null @@ -1,26 +0,0 @@ -@prefix d2rq: . -@prefix ex: . -@prefix foaf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source ; - rml:referenceFormulation rml:SQL2008Table; - rml:iterator "student" - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "Name" - ]; - rml:predicate ex:name, foaf:name - ]; - rml:subjectMap [ - rml:template "http://example.com/Student/{ID}/{Name}" - ] . - - a d2rq:Database; - d2rq:jdbcDSN "CONNECTIONDSN"; - d2rq:jdbcDriver "org.postgresql.Driver"; - d2rq:password ""; - d2rq:username "postgres" . diff --git a/src/test/resources/rml-core/RMLTC0008c-PostgreSQL/output.nq b/src/test/resources/rml-core/RMLTC0008c-PostgreSQL/output.nq deleted file mode 100644 index d36f700c..00000000 --- a/src/test/resources/rml-core/RMLTC0008c-PostgreSQL/output.nq +++ /dev/null @@ -1,3 +0,0 @@ - "Venus Williams" . - "Venus Williams" . - diff --git a/src/test/resources/rml-core/RMLTC0008c-PostgreSQL/resource.sql b/src/test/resources/rml-core/RMLTC0008c-PostgreSQL/resource.sql deleted file mode 100644 index 3ad893a6..00000000 --- a/src/test/resources/rml-core/RMLTC0008c-PostgreSQL/resource.sql +++ /dev/null @@ -1,8 +0,0 @@ -DROP TABLE IF EXISTS student; - -CREATE TABLE student ( - "ID" INTEGER, - "Name" VARCHAR(50), - "Sport" VARCHAR(50) -); -INSERT INTO student values ('10', 'Venus Williams', 'Tennis'); diff --git a/src/test/resources/rml-core/RMLTC0008c-SPARQL/mapping.ttl b/src/test/resources/rml-core/RMLTC0008c-SPARQL/mapping.ttl deleted file mode 100644 index 54f6196f..00000000 --- a/src/test/resources/rml-core/RMLTC0008c-SPARQL/mapping.ttl +++ /dev/null @@ -1,36 +0,0 @@ -@prefix ex: . -@prefix foaf: . -@prefix formats: . -@prefix rml: . -@prefix sd: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator """ - PREFIX rdfs: - PREFIX foaf: - PREFIX rdf: - SELECT ?Name ?ID - WHERE { - ?x foaf:name ?Name ; - rdf:ID ?ID ; - } """; - rml:referenceFormulation formats:SPARQL_Results_JSON; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "Name.value" - ]; - rml:predicate ex:name, foaf:name - ]; - rml:subjectMap [ - rml:template "http://example.com/Student/{ID.value}/{Name.value}" - ] . - - a sd:Service; - sd:endpoint ; - sd:supportedLanguage sd:SPARQL11Query . diff --git a/src/test/resources/rml-core/RMLTC0008c-SPARQL/output.nq b/src/test/resources/rml-core/RMLTC0008c-SPARQL/output.nq deleted file mode 100644 index d36f700c..00000000 --- a/src/test/resources/rml-core/RMLTC0008c-SPARQL/output.nq +++ /dev/null @@ -1,3 +0,0 @@ - "Venus Williams" . - "Venus Williams" . - diff --git a/src/test/resources/rml-core/RMLTC0008c-SPARQL/resource.ttl b/src/test/resources/rml-core/RMLTC0008c-SPARQL/resource.ttl deleted file mode 100644 index e7007e36..00000000 --- a/src/test/resources/rml-core/RMLTC0008c-SPARQL/resource.ttl +++ /dev/null @@ -1,9 +0,0 @@ -@prefix foaf: . -@prefix ns1: . -@prefix rdf: . - -[] ns1:plays [ a ns1:Sport ; - foaf:name "Tennis" ] ; - rdf:ID "10" ; - foaf:name "Venus Williams" . - diff --git a/src/test/resources/rml-core/RMLTC0008c-SQLServer/mapping.ttl b/src/test/resources/rml-core/RMLTC0008c-SQLServer/mapping.ttl deleted file mode 100644 index add0e4ae..00000000 --- a/src/test/resources/rml-core/RMLTC0008c-SQLServer/mapping.ttl +++ /dev/null @@ -1,26 +0,0 @@ -@prefix d2rq: . -@prefix ex: . -@prefix foaf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source ; - rml:referenceFormulation rml:SQL2008Table; - rml:iterator "student" - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "Name" - ]; - rml:predicate ex:name, foaf:name - ]; - rml:subjectMap [ - rml:template "http://example.com/Student/{ID}/{Name}" - ] . - - a d2rq:Database; - d2rq:jdbcDSN "CONNECTIONDSN"; - d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver"; - d2rq:password "YourSTRONG!Passw0rd;"; - d2rq:username "sa" . diff --git a/src/test/resources/rml-core/RMLTC0008c-SQLServer/output.nq b/src/test/resources/rml-core/RMLTC0008c-SQLServer/output.nq deleted file mode 100644 index d36f700c..00000000 --- a/src/test/resources/rml-core/RMLTC0008c-SQLServer/output.nq +++ /dev/null @@ -1,3 +0,0 @@ - "Venus Williams" . - "Venus Williams" . - diff --git a/src/test/resources/rml-core/RMLTC0008c-SQLServer/resource.sql b/src/test/resources/rml-core/RMLTC0008c-SQLServer/resource.sql deleted file mode 100644 index e9b41d95..00000000 --- a/src/test/resources/rml-core/RMLTC0008c-SQLServer/resource.sql +++ /dev/null @@ -1,8 +0,0 @@ -USE TestDB; -DROP TABLE IF EXISTS student; -CREATE TABLE student ( - "ID" INTEGER, - "Name" VARCHAR(50), - "Sport" VARCHAR(50) -); -INSERT INTO student values ('10', 'Venus Williams', 'Tennis'); diff --git a/src/test/resources/rml-core/RMLTC0008c-XML/mapping.ttl b/src/test/resources/rml-core/RMLTC0008c-XML/mapping.ttl deleted file mode 100644 index 188d69e8..00000000 --- a/src/test/resources/rml-core/RMLTC0008c-XML/mapping.ttl +++ /dev/null @@ -1,22 +0,0 @@ -@prefix ex: . -@prefix foaf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator "/students/student"; - rml:referenceFormulation rml:XPath; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.xml" - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "Name" - ]; - rml:predicate ex:name, foaf:name - ]; - rml:subjectMap [ - rml:template "http://example.com/Student/{ID}/{Name}" - ] . diff --git a/src/test/resources/rml-core/RMLTC0008c-XML/output.nq b/src/test/resources/rml-core/RMLTC0008c-XML/output.nq deleted file mode 100644 index d36f700c..00000000 --- a/src/test/resources/rml-core/RMLTC0008c-XML/output.nq +++ /dev/null @@ -1,3 +0,0 @@ - "Venus Williams" . - "Venus Williams" . - diff --git a/src/test/resources/rml-core/RMLTC0008c-XML/student.xml b/src/test/resources/rml-core/RMLTC0008c-XML/student.xml deleted file mode 100644 index 9ae75cc8..00000000 --- a/src/test/resources/rml-core/RMLTC0008c-XML/student.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - 10 - Venus Williams - Tennis - - diff --git a/src/test/resources/rml-core/RMLTC0009a-CSV/mapping.ttl b/src/test/resources/rml-core/RMLTC0009a-CSV/mapping.ttl deleted file mode 100644 index 560934a1..00000000 --- a/src/test/resources/rml-core/RMLTC0009a-CSV/mapping.ttl +++ /dev/null @@ -1,48 +0,0 @@ -@prefix foaf: . -@prefix rdfs: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:referenceFormulation rml:CSV; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.csv" - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "Name" - ]; - rml:predicate foaf:name - ], [ - rml:objectMap [ a rml:RefObjectMap; - rml:joinCondition [ - rml:child "Sport"; - rml:parent "ID" - ]; - rml:parentTriplesMap - ]; - rml:predicate - ]; - rml:subjectMap [ - rml:template "http://example.com/resource/student_{ID}" - ] . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:referenceFormulation rml:CSV; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "sport.csv" - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "Name" - ]; - rml:predicate rdfs:label - ]; - rml:subjectMap [ - rml:template "http://example.com/resource/sport_{ID}" - ] . diff --git a/src/test/resources/rml-core/RMLTC0009a-CSV/output.nq b/src/test/resources/rml-core/RMLTC0009a-CSV/output.nq deleted file mode 100644 index b0b89f8b..00000000 --- a/src/test/resources/rml-core/RMLTC0009a-CSV/output.nq +++ /dev/null @@ -1,4 +0,0 @@ - "Venus Williams" . - "Demi Moore" . - "Tennis" . - . diff --git a/src/test/resources/rml-core/RMLTC0009a-CSV/sport.csv b/src/test/resources/rml-core/RMLTC0009a-CSV/sport.csv deleted file mode 100644 index 800f4446..00000000 --- a/src/test/resources/rml-core/RMLTC0009a-CSV/sport.csv +++ /dev/null @@ -1,2 +0,0 @@ -ID,Name -100,Tennis diff --git a/src/test/resources/rml-core/RMLTC0009a-CSV/student.csv b/src/test/resources/rml-core/RMLTC0009a-CSV/student.csv deleted file mode 100644 index 1ed4c175..00000000 --- a/src/test/resources/rml-core/RMLTC0009a-CSV/student.csv +++ /dev/null @@ -1,3 +0,0 @@ -ID,Sport,Name -10,100,Venus Williams -20,,Demi Moore diff --git a/src/test/resources/rml-core/RMLTC0009a-JSON/README.md b/src/test/resources/rml-core/RMLTC0009a-JSON/README.md new file mode 100644 index 00000000..6bb9aef6 --- /dev/null +++ b/src/test/resources/rml-core/RMLTC0009a-JSON/README.md @@ -0,0 +1,105 @@ +## RMLTC0009a-JSON + +**Title**: "Generation of triples from foreign key relations" + +**Description**: "Test foreign key relationships among logical tables" + +**Default Base IRI**: http://example.com/ + +**Error expected?** No + +**Input** +``` +{ + "students" : [ + { + "ID": 10, + "Sport": 100, + "Name": "Venus Williams" + }, + { + "ID": 20, + "Name": "Demi Moore" + } + ] +} + +``` + +**Input 1** +``` +{ + "sports": [ + { + "ID": 100, + "Name": "Tennis" + } + ] +} + +``` + +**Mapping** +``` +@prefix foaf: . +@prefix rdfs: . +@prefix rml: . + + a rml:TriplesMap; + rml:logicalSource [ a rml:LogicalSource; + rml:iterator "$.students[*]"; + rml:referenceFormulation rml:JSONPath; + rml:source [ a rml:RelativePathSource; + rml:root rml:MappingDirectory; + rml:path "student.json" + ] + ]; + rml:predicateObjectMap [ + rml:objectMap [ + rml:reference "$.Name" + ]; + rml:predicate foaf:name + ], [ + rml:objectMap [ a rml:RefObjectMap; + rml:joinCondition [ + rml:child "$.Sport"; + rml:parent "$.ID" + ]; + rml:parentTriplesMap + ]; + rml:predicate + ]; + rml:subjectMap [ + rml:template "http://example.com/resource/student_{$.ID}" + ] . + + a rml:TriplesMap; + rml:logicalSource [ a rml:LogicalSource; + rml:iterator "$.sports[*]"; + rml:referenceFormulation rml:JSONPath; + rml:source [ a rml:RelativePathSource; + rml:root rml:MappingDirectory; + rml:path "sport.json" + ] + ]; + rml:predicateObjectMap [ + rml:objectMap [ + rml:reference "$.Name" + ]; + rml:predicate rdfs:label + ]; + rml:subjectMap [ + rml:template "http://example.com/resource/sport_{$.ID}" + ] . + +``` + +**Output** +``` + "Venus Williams" . + "Demi Moore" . + "Tennis" . + . + +``` + diff --git a/src/test/resources/rml-core/RMLTC0009a-JSON/mapping.ttl b/src/test/resources/rml-core/RMLTC0009a-JSON/mapping.ttl index 906ab93e..596bd136 100644 --- a/src/test/resources/rml-core/RMLTC0009a-JSON/mapping.ttl +++ b/src/test/resources/rml-core/RMLTC0009a-JSON/mapping.ttl @@ -13,21 +13,21 @@ ]; rml:predicateObjectMap [ rml:objectMap [ - rml:reference "Name" + rml:reference "$.Name" ]; rml:predicate foaf:name ], [ rml:objectMap [ a rml:RefObjectMap; rml:joinCondition [ - rml:child "Sport"; - rml:parent "ID" + rml:child "$.Sport"; + rml:parent "$.ID" ]; rml:parentTriplesMap ]; rml:predicate ]; rml:subjectMap [ - rml:template "http://example.com/resource/student_{ID}" + rml:template "http://example.com/resource/student_{$.ID}" ] . a rml:TriplesMap; @@ -41,10 +41,10 @@ ]; rml:predicateObjectMap [ rml:objectMap [ - rml:reference "Name" + rml:reference "$.Name" ]; rml:predicate rdfs:label ]; rml:subjectMap [ - rml:template "http://example.com/resource/sport_{ID}" + rml:template "http://example.com/resource/sport_{$.ID}" ] . diff --git a/src/test/resources/rml-core/RMLTC0009a-MySQL/mapping.ttl b/src/test/resources/rml-core/RMLTC0009a-MySQL/mapping.ttl deleted file mode 100644 index 6de77ad5..00000000 --- a/src/test/resources/rml-core/RMLTC0009a-MySQL/mapping.ttl +++ /dev/null @@ -1,51 +0,0 @@ -@prefix d2rq: . -@prefix foaf: . -@prefix rdfs: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source ; - rml:referenceFormulation rml:SQL2008Table; - rml:iterator "student" - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "Name" - ]; - rml:predicate foaf:name - ], [ - rml:objectMap [ a rml:RefObjectMap; - rml:joinCondition [ - rml:child "Sport"; - rml:parent "ID" - ]; - rml:parentTriplesMap - ]; - rml:predicate - ]; - rml:subjectMap [ - rml:template "http://example.com/resource/student_{ID}" - ] . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source ; - rml:referenceFormulation rml:SQL2008Table; - rml:iterator "sport" - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "Name" - ]; - rml:predicate rdfs:label - ]; - rml:subjectMap [ - rml:template "http://example.com/resource/sport_{ID}" - ] . - - a d2rq:Database; - d2rq:jdbcDSN "CONNECTIONDSN"; - d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver"; - d2rq:password ""; - d2rq:username "root" . diff --git a/src/test/resources/rml-core/RMLTC0009a-MySQL/output.nq b/src/test/resources/rml-core/RMLTC0009a-MySQL/output.nq deleted file mode 100644 index b0b89f8b..00000000 --- a/src/test/resources/rml-core/RMLTC0009a-MySQL/output.nq +++ /dev/null @@ -1,4 +0,0 @@ - "Venus Williams" . - "Demi Moore" . - "Tennis" . - . diff --git a/src/test/resources/rml-core/RMLTC0009a-MySQL/resource.sql b/src/test/resources/rml-core/RMLTC0009a-MySQL/resource.sql deleted file mode 100644 index 6775e444..00000000 --- a/src/test/resources/rml-core/RMLTC0009a-MySQL/resource.sql +++ /dev/null @@ -1,18 +0,0 @@ -USE test; -DROP TABLE IF EXISTS test.student; - -CREATE TABLE student ( - ID INTEGER, - Sport VARCHAR(50), - Name VARCHAR(50) -); -INSERT INTO student values ('10', '100', 'Venus Williams'); -INSERT INTO student values ('20', NULL , 'Demi Moore'); - -DROP TABLE IF EXISTS test.sport; - -CREATE TABLE sport ( - ID INTEGER, - Name VARCHAR(50) -); -INSERT INTO sport values ('100', 'Tennis'); diff --git a/src/test/resources/rml-core/RMLTC0009a-PostgreSQL/mapping.ttl b/src/test/resources/rml-core/RMLTC0009a-PostgreSQL/mapping.ttl deleted file mode 100644 index b2be3662..00000000 --- a/src/test/resources/rml-core/RMLTC0009a-PostgreSQL/mapping.ttl +++ /dev/null @@ -1,51 +0,0 @@ -@prefix d2rq: . -@prefix foaf: . -@prefix rdfs: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source ; - rml:referenceFormulation rml:SQL2008Table; - rml:iterator "student" - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "Name" - ]; - rml:predicate foaf:name - ], [ - rml:objectMap [ a rml:RefObjectMap; - rml:joinCondition [ - rml:child "Sport"; - rml:parent "ID" - ]; - rml:parentTriplesMap - ]; - rml:predicate - ]; - rml:subjectMap [ - rml:template "http://example.com/resource/student_{ID}" - ] . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source ; - rml:referenceFormulation rml:SQL2008Table; - rml:iterator "sport" - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "Name" - ]; - rml:predicate rdfs:label - ]; - rml:subjectMap [ - rml:template "http://example.com/resource/sport_{ID}" - ] . - - a d2rq:Database; - d2rq:jdbcDSN "CONNECTIONDSN"; - d2rq:jdbcDriver "org.postgresql.Driver"; - d2rq:password ""; - d2rq:username "postgres" . diff --git a/src/test/resources/rml-core/RMLTC0009a-PostgreSQL/note.md b/src/test/resources/rml-core/RMLTC0009a-PostgreSQL/note.md deleted file mode 100644 index 7c87bd86..00000000 --- a/src/test/resources/rml-core/RMLTC0009a-PostgreSQL/note.md +++ /dev/null @@ -1,4 +0,0 @@ -## Change note - -Changes `Sport.ID` column from `INTEGER` to `VARCHAR` since postgres does not support joining on -columns of different types. diff --git a/src/test/resources/rml-core/RMLTC0009a-PostgreSQL/output.nq b/src/test/resources/rml-core/RMLTC0009a-PostgreSQL/output.nq deleted file mode 100644 index b0b89f8b..00000000 --- a/src/test/resources/rml-core/RMLTC0009a-PostgreSQL/output.nq +++ /dev/null @@ -1,4 +0,0 @@ - "Venus Williams" . - "Demi Moore" . - "Tennis" . - . diff --git a/src/test/resources/rml-core/RMLTC0009a-PostgreSQL/resource.sql b/src/test/resources/rml-core/RMLTC0009a-PostgreSQL/resource.sql deleted file mode 100644 index 0f674565..00000000 --- a/src/test/resources/rml-core/RMLTC0009a-PostgreSQL/resource.sql +++ /dev/null @@ -1,17 +0,0 @@ -DROP TABLE IF EXISTS student; - -CREATE TABLE student ( - "ID" INTEGER, - "Sport" VARCHAR(50), - "Name" VARCHAR(50) -); -INSERT INTO student values ('10', '100', 'Venus Williams'); -INSERT INTO student values ('20', NULL , 'Demi Moore'); - -DROP TABLE IF EXISTS sport; - -CREATE TABLE sport ( - "ID" VARCHAR(50), - "Name" VARCHAR(50) -); -INSERT INTO sport values ('100', 'Tennis'); diff --git a/src/test/resources/rml-core/RMLTC0009a-SPARQL/mapping.ttl b/src/test/resources/rml-core/RMLTC0009a-SPARQL/mapping.ttl deleted file mode 100644 index 907d5e2a..00000000 --- a/src/test/resources/rml-core/RMLTC0009a-SPARQL/mapping.ttl +++ /dev/null @@ -1,79 +0,0 @@ -@prefix foaf: . -@prefix formats: . -@prefix rdfs: . -@prefix rml: . -@prefix sd: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator """ - PREFIX rdfs: - PREFIX foaf: - PREFIX rdf: - SELECT ?Name ?ID ?Sport - WHERE { - ?x foaf:name ?Name ; - rdf:ID ?ID ; - ?sportObject . - OPTIONAL { ?sportObject a ; - rdf:ID ?Sport . } - } """; - rml:referenceFormulation formats:SPARQL_Results_JSON; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "Name.value" - ]; - rml:predicate foaf:name - ], [ - rml:objectMap [ a rml:RefObjectMap; - rml:joinCondition [ - rml:child "Sport"; - rml:parent "ID" - ]; - rml:parentTriplesMap - ]; - rml:predicate - ]; - rml:subjectMap [ - rml:template "http://example.com/resource/student_{ID.value}" - ] . - - a sd:Service; - sd:endpoint ; - sd:supportedLanguage sd:SPARQL11Query . - - a sd:Service; - sd:endpoint ; - sd:supportedLanguage sd:SPARQL11Query . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator """ - PREFIX rdfs: - PREFIX foaf: - PREFIX rdf: - SELECT ?ID ?Name - WHERE { - ?x foaf:name ?Name ; - rdf:ID ?ID ; - } """; - rml:referenceFormulation formats:SPARQL_Results_JSON; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "Name.value" - ]; - rml:predicate rdfs:label - ]; - rml:subjectMap [ - rml:template "http://example.com/resource/sport_{ID.value}" - ] . diff --git a/src/test/resources/rml-core/RMLTC0009a-SPARQL/output.nq b/src/test/resources/rml-core/RMLTC0009a-SPARQL/output.nq deleted file mode 100644 index b0b89f8b..00000000 --- a/src/test/resources/rml-core/RMLTC0009a-SPARQL/output.nq +++ /dev/null @@ -1,4 +0,0 @@ - "Venus Williams" . - "Demi Moore" . - "Tennis" . - . diff --git a/src/test/resources/rml-core/RMLTC0009a-SPARQL/resource1.ttl b/src/test/resources/rml-core/RMLTC0009a-SPARQL/resource1.ttl deleted file mode 100644 index 676bdb38..00000000 --- a/src/test/resources/rml-core/RMLTC0009a-SPARQL/resource1.ttl +++ /dev/null @@ -1,13 +0,0 @@ -@prefix foaf: . -@prefix ns1: . -@prefix rdf: . - -[] ns1:plays [ a ns1:Sport ; - rdf:ID "100" ] ; - rdf:ID "10" ; - foaf:name "Venus Williams" . - -[] ns1:plays [ a ns1:Sport ] ; - rdf:ID "20" ; - foaf:name "Demi Moore" . - diff --git a/src/test/resources/rml-core/RMLTC0009a-SPARQL/resource2.ttl b/src/test/resources/rml-core/RMLTC0009a-SPARQL/resource2.ttl deleted file mode 100644 index d69ef52e..00000000 --- a/src/test/resources/rml-core/RMLTC0009a-SPARQL/resource2.ttl +++ /dev/null @@ -1,6 +0,0 @@ -@prefix foaf: . -@prefix rdf: . - -[] rdf:ID "100" ; - foaf:name "Tennis" . - diff --git a/src/test/resources/rml-core/RMLTC0009a-SQLServer/mapping.ttl b/src/test/resources/rml-core/RMLTC0009a-SQLServer/mapping.ttl deleted file mode 100644 index bb76cc7b..00000000 --- a/src/test/resources/rml-core/RMLTC0009a-SQLServer/mapping.ttl +++ /dev/null @@ -1,51 +0,0 @@ -@prefix d2rq: . -@prefix foaf: . -@prefix rdfs: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source ; - rml:referenceFormulation rml:SQL2008Table; - rml:iterator "student" - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "Name" - ]; - rml:predicate foaf:name - ], [ - rml:objectMap [ a rml:RefObjectMap; - rml:joinCondition [ - rml:child "Sport"; - rml:parent "ID" - ]; - rml:parentTriplesMap - ]; - rml:predicate - ]; - rml:subjectMap [ - rml:template "http://example.com/resource/student_{ID}" - ] . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source ; - rml:referenceFormulation rml:SQL2008Table; - rml:iterator "sport" - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "Name" - ]; - rml:predicate rdfs:label - ]; - rml:subjectMap [ - rml:template "http://example.com/resource/sport_{ID}" - ] . - - a d2rq:Database; - d2rq:jdbcDSN "CONNECTIONDSN"; - d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver"; - d2rq:password "YourSTRONG!Passw0rd;"; - d2rq:username "sa" . diff --git a/src/test/resources/rml-core/RMLTC0009a-SQLServer/output.nq b/src/test/resources/rml-core/RMLTC0009a-SQLServer/output.nq deleted file mode 100644 index b0b89f8b..00000000 --- a/src/test/resources/rml-core/RMLTC0009a-SQLServer/output.nq +++ /dev/null @@ -1,4 +0,0 @@ - "Venus Williams" . - "Demi Moore" . - "Tennis" . - . diff --git a/src/test/resources/rml-core/RMLTC0009a-SQLServer/resource.sql b/src/test/resources/rml-core/RMLTC0009a-SQLServer/resource.sql deleted file mode 100644 index 2b79a5d4..00000000 --- a/src/test/resources/rml-core/RMLTC0009a-SQLServer/resource.sql +++ /dev/null @@ -1,17 +0,0 @@ -USE TestDB; -DROP TABLE IF EXISTS student; -CREATE TABLE student ( - "ID" INTEGER, - "Sport" VARCHAR(50), - "Name" VARCHAR(50) -); -INSERT INTO student values ('10', '100', 'Venus Williams'); -INSERT INTO student values ('20', NULL , 'Demi Moore'); - -DROP TABLE IF EXISTS sport; - -CREATE TABLE sport ( - "ID" INTEGER, - "Name" VARCHAR(50) -); -INSERT INTO sport values ('100', 'Tennis'); diff --git a/src/test/resources/rml-core/RMLTC0009a-XML/mapping.ttl b/src/test/resources/rml-core/RMLTC0009a-XML/mapping.ttl deleted file mode 100644 index 675df8ee..00000000 --- a/src/test/resources/rml-core/RMLTC0009a-XML/mapping.ttl +++ /dev/null @@ -1,50 +0,0 @@ -@prefix foaf: . -@prefix rdfs: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator "/students/student"; - rml:referenceFormulation rml:XPath; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.xml" - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "Name" - ]; - rml:predicate foaf:name - ], [ - rml:objectMap [ a rml:RefObjectMap; - rml:joinCondition [ - rml:child "Sport"; - rml:parent "ID" - ]; - rml:parentTriplesMap - ]; - rml:predicate - ]; - rml:subjectMap [ - rml:template "http://example.com/resource/student_{ID}" - ] . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator "/sports/sport"; - rml:referenceFormulation rml:XPath; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "sport.xml" - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "Name" - ]; - rml:predicate rdfs:label - ]; - rml:subjectMap [ - rml:template "http://example.com/resource/sport_{ID}" - ] . diff --git a/src/test/resources/rml-core/RMLTC0009a-XML/output.nq b/src/test/resources/rml-core/RMLTC0009a-XML/output.nq deleted file mode 100644 index b0b89f8b..00000000 --- a/src/test/resources/rml-core/RMLTC0009a-XML/output.nq +++ /dev/null @@ -1,4 +0,0 @@ - "Venus Williams" . - "Demi Moore" . - "Tennis" . - . diff --git a/src/test/resources/rml-core/RMLTC0009a-XML/sport.xml b/src/test/resources/rml-core/RMLTC0009a-XML/sport.xml deleted file mode 100644 index 1c02bdb8..00000000 --- a/src/test/resources/rml-core/RMLTC0009a-XML/sport.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - 100 - Tennis - - diff --git a/src/test/resources/rml-core/RMLTC0009a-XML/student.xml b/src/test/resources/rml-core/RMLTC0009a-XML/student.xml deleted file mode 100644 index a66c01aa..00000000 --- a/src/test/resources/rml-core/RMLTC0009a-XML/student.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - 10 - Venus Williams - 100 - - - 20 - Demi Moore - - diff --git a/src/test/resources/rml-core/RMLTC0009b-CSV/mapping.ttl b/src/test/resources/rml-core/RMLTC0009b-CSV/mapping.ttl deleted file mode 100644 index 10635ed6..00000000 --- a/src/test/resources/rml-core/RMLTC0009b-CSV/mapping.ttl +++ /dev/null @@ -1,54 +0,0 @@ -@prefix foaf: . -@prefix rdfs: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:referenceFormulation rml:CSV; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.csv" - ] - ]; - rml:predicateObjectMap [ - rml:graph ; - rml:objectMap [ - rml:reference "Name" - ]; - rml:predicate foaf:name - ], [ - rml:graph ; - rml:objectMap [ a rml:RefObjectMap; - rml:joinCondition [ - rml:child "Sport"; - rml:parent "ID" - ]; - rml:parentTriplesMap - ]; - rml:predicate - ]; - rml:subjectMap [ - rml:class ; - rml:graph ; - rml:template "http://example.com/resource/student_{ID}" - ] . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:referenceFormulation rml:CSV; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "sport.csv" - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "Name" - ]; - rml:predicate rdfs:label - ]; - rml:subjectMap [ - rml:class ; - rml:graph ; - rml:template "http://example.com/resource/sport_{ID}" - ] . diff --git a/src/test/resources/rml-core/RMLTC0009b-CSV/output.nq b/src/test/resources/rml-core/RMLTC0009b-CSV/output.nq deleted file mode 100644 index aef6b08c..00000000 --- a/src/test/resources/rml-core/RMLTC0009b-CSV/output.nq +++ /dev/null @@ -1,8 +0,0 @@ - . - "Venus Williams" . - . - "Demi Moore" . - . - "Tennis" . - . - . diff --git a/src/test/resources/rml-core/RMLTC0009b-CSV/sport.csv b/src/test/resources/rml-core/RMLTC0009b-CSV/sport.csv deleted file mode 100644 index 800f4446..00000000 --- a/src/test/resources/rml-core/RMLTC0009b-CSV/sport.csv +++ /dev/null @@ -1,2 +0,0 @@ -ID,Name -100,Tennis diff --git a/src/test/resources/rml-core/RMLTC0009b-CSV/student.csv b/src/test/resources/rml-core/RMLTC0009b-CSV/student.csv deleted file mode 100644 index 1ed4c175..00000000 --- a/src/test/resources/rml-core/RMLTC0009b-CSV/student.csv +++ /dev/null @@ -1,3 +0,0 @@ -ID,Sport,Name -10,100,Venus Williams -20,,Demi Moore diff --git a/src/test/resources/rml-core/RMLTC0009b-JSON/README.md b/src/test/resources/rml-core/RMLTC0009b-JSON/README.md new file mode 100644 index 00000000..051d9bb5 --- /dev/null +++ b/src/test/resources/rml-core/RMLTC0009b-JSON/README.md @@ -0,0 +1,115 @@ +## RMLTC0009b-JSON + +**Title**: "Generation of triples to multiple graphs" + +**Description**: "Test that results from distinct parts of the mapping can be directed to different target graphs." + +**Default Base IRI**: http://example.com/ + +**Error expected?** No + +**Input** +``` +{ + "students" : [ + { + "ID": 10, + "Sport": 100, + "Name": "Venus Williams" + }, + { + "ID": 20, + "Name": "Demi Moore" + } + ] +} + +``` + +**Input 1** +``` +{ + "sports": [ + { + "ID": 100, + "Name": "Tennis" + } + ] +} + +``` + +**Mapping** +``` +@prefix foaf: . +@prefix rdfs: . +@prefix rml: . + + a rml:TriplesMap; + rml:logicalSource [ a rml:LogicalSource; + rml:iterator "$.students[*]"; + rml:referenceFormulation rml:JSONPath; + rml:source [ a rml:RelativePathSource; + rml:root rml:MappingDirectory; + rml:path "student.json" + ] + ]; + rml:predicateObjectMap [ + rml:graph ; + rml:objectMap [ + rml:reference "$.Name" + ]; + rml:predicate foaf:name + ], [ + rml:graph ; + rml:objectMap [ a rml:RefObjectMap; + rml:joinCondition [ + rml:child "$.Sport"; + rml:parent "$.ID" + ]; + rml:parentTriplesMap + ]; + rml:predicate + ]; + rml:subjectMap [ + rml:class ; + rml:graph ; + rml:template "http://example.com/resource/student_{$.ID}" + ] . + + a rml:TriplesMap; + rml:logicalSource [ a rml:LogicalSource; + rml:iterator "$.sports[*]"; + rml:referenceFormulation rml:JSONPath; + rml:source [ a rml:RelativePathSource; + rml:root rml:MappingDirectory; + rml:path "sport.json" + ] + ]; + rml:predicateObjectMap [ + rml:objectMap [ + rml:reference "$.Name" + ]; + rml:predicate rdfs:label + ]; + rml:subjectMap [ + rml:class ; + rml:graph ; + rml:template "http://example.com/resource/sport_{$.ID}" + ] . + +``` + +**Output** +``` + . + "Venus Williams" . + . + "Demi Moore" . + . + "Tennis" . + . + . + +``` + diff --git a/src/test/resources/rml-core/RMLTC0009b-JSON/mapping.ttl b/src/test/resources/rml-core/RMLTC0009b-JSON/mapping.ttl index 026676d6..4a12b17f 100644 --- a/src/test/resources/rml-core/RMLTC0009b-JSON/mapping.ttl +++ b/src/test/resources/rml-core/RMLTC0009b-JSON/mapping.ttl @@ -14,15 +14,15 @@ rml:predicateObjectMap [ rml:graph ; rml:objectMap [ - rml:reference "Name" + rml:reference "$.Name" ]; rml:predicate foaf:name ], [ rml:graph ; rml:objectMap [ a rml:RefObjectMap; rml:joinCondition [ - rml:child "Sport"; - rml:parent "ID" + rml:child "$.Sport"; + rml:parent "$.ID" ]; rml:parentTriplesMap ]; @@ -31,7 +31,7 @@ rml:subjectMap [ rml:class ; rml:graph ; - rml:template "http://example.com/resource/student_{ID}" + rml:template "http://example.com/resource/student_{$.ID}" ] . a rml:TriplesMap; @@ -45,12 +45,12 @@ ]; rml:predicateObjectMap [ rml:objectMap [ - rml:reference "Name" + rml:reference "$.Name" ]; rml:predicate rdfs:label ]; rml:subjectMap [ rml:class ; rml:graph ; - rml:template "http://example.com/resource/sport_{ID}" + rml:template "http://example.com/resource/sport_{$.ID}" ] . diff --git a/src/test/resources/rml-core/RMLTC0009b-MySQL/mapping.ttl b/src/test/resources/rml-core/RMLTC0009b-MySQL/mapping.ttl deleted file mode 100644 index 26e61b51..00000000 --- a/src/test/resources/rml-core/RMLTC0009b-MySQL/mapping.ttl +++ /dev/null @@ -1,57 +0,0 @@ -@prefix d2rq: . -@prefix foaf: . -@prefix rdfs: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source ; - rml:referenceFormulation rml:SQL2008Table; - rml:iterator "student" - ]; - rml:predicateObjectMap [ - rml:graph ; - rml:objectMap [ - rml:reference "Name" - ]; - rml:predicate foaf:name - ], [ - rml:graph ; - rml:objectMap [ a rml:RefObjectMap; - rml:joinCondition [ - rml:child "Sport"; - rml:parent "ID" - ]; - rml:parentTriplesMap - ]; - rml:predicate - ]; - rml:subjectMap [ - rml:class ; - rml:graph ; - rml:template "http://example.com/resource/student_{ID}" - ] . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source ; - rml:referenceFormulation rml:SQL2008Table; - rml:iterator "sport" - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "Name" - ]; - rml:predicate rdfs:label - ]; - rml:subjectMap [ - rml:class ; - rml:graph ; - rml:template "http://example.com/resource/sport_{ID}" - ] . - - a d2rq:Database; - d2rq:jdbcDSN "CONNECTIONDSN"; - d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver"; - d2rq:password ""; - d2rq:username "root" . diff --git a/src/test/resources/rml-core/RMLTC0009b-MySQL/output.nq b/src/test/resources/rml-core/RMLTC0009b-MySQL/output.nq deleted file mode 100644 index aef6b08c..00000000 --- a/src/test/resources/rml-core/RMLTC0009b-MySQL/output.nq +++ /dev/null @@ -1,8 +0,0 @@ - . - "Venus Williams" . - . - "Demi Moore" . - . - "Tennis" . - . - . diff --git a/src/test/resources/rml-core/RMLTC0009b-MySQL/resource.sql b/src/test/resources/rml-core/RMLTC0009b-MySQL/resource.sql deleted file mode 100644 index 18cb6cd9..00000000 --- a/src/test/resources/rml-core/RMLTC0009b-MySQL/resource.sql +++ /dev/null @@ -1,18 +0,0 @@ -USE test; -DROP TABLE IF EXISTS test.student; - -CREATE TABLE student ( - ID INTEGER, - Sport VARCHAR(50), - Name VARCHAR(50) -); -INSERT INTO student values ('10', '100', 'Venus Williams'); -INSERT INTO student values ('20', NULL, 'Demi Moore'); - -DROP TABLE IF EXISTS test.sport; - -CREATE TABLE sport ( - ID INTEGER, - Name VARCHAR(50) -); -INSERT INTO sport values ('100', 'Tennis'); diff --git a/src/test/resources/rml-core/RMLTC0009b-PostgreSQL/mapping.ttl b/src/test/resources/rml-core/RMLTC0009b-PostgreSQL/mapping.ttl deleted file mode 100644 index b04272f3..00000000 --- a/src/test/resources/rml-core/RMLTC0009b-PostgreSQL/mapping.ttl +++ /dev/null @@ -1,57 +0,0 @@ -@prefix d2rq: . -@prefix foaf: . -@prefix rdfs: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source ; - rml:referenceFormulation rml:SQL2008Table; - rml:iterator "student" - ]; - rml:predicateObjectMap [ - rml:graph ; - rml:objectMap [ - rml:reference "Name" - ]; - rml:predicate foaf:name - ], [ - rml:graph ; - rml:objectMap [ a rml:RefObjectMap; - rml:joinCondition [ - rml:child "Sport"; - rml:parent "ID" - ]; - rml:parentTriplesMap - ]; - rml:predicate - ]; - rml:subjectMap [ - rml:class ; - rml:graph ; - rml:template "http://example.com/resource/student_{ID}" - ] . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source ; - rml:referenceFormulation rml:SQL2008Table; - rml:iterator "sport" - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "Name" - ]; - rml:predicate rdfs:label - ]; - rml:subjectMap [ - rml:class ; - rml:graph ; - rml:template "http://example.com/resource/sport_{ID}" - ] . - - a d2rq:Database; - d2rq:jdbcDSN "CONNECTIONDSN"; - d2rq:jdbcDriver "org.postgresql.Driver"; - d2rq:password ""; - d2rq:username "postgres" . diff --git a/src/test/resources/rml-core/RMLTC0009b-PostgreSQL/note.md b/src/test/resources/rml-core/RMLTC0009b-PostgreSQL/note.md deleted file mode 100644 index 7c87bd86..00000000 --- a/src/test/resources/rml-core/RMLTC0009b-PostgreSQL/note.md +++ /dev/null @@ -1,4 +0,0 @@ -## Change note - -Changes `Sport.ID` column from `INTEGER` to `VARCHAR` since postgres does not support joining on -columns of different types. diff --git a/src/test/resources/rml-core/RMLTC0009b-PostgreSQL/output.nq b/src/test/resources/rml-core/RMLTC0009b-PostgreSQL/output.nq deleted file mode 100644 index aef6b08c..00000000 --- a/src/test/resources/rml-core/RMLTC0009b-PostgreSQL/output.nq +++ /dev/null @@ -1,8 +0,0 @@ - . - "Venus Williams" . - . - "Demi Moore" . - . - "Tennis" . - . - . diff --git a/src/test/resources/rml-core/RMLTC0009b-PostgreSQL/resource.sql b/src/test/resources/rml-core/RMLTC0009b-PostgreSQL/resource.sql deleted file mode 100644 index be021479..00000000 --- a/src/test/resources/rml-core/RMLTC0009b-PostgreSQL/resource.sql +++ /dev/null @@ -1,17 +0,0 @@ -DROP TABLE IF EXISTS student; - -CREATE TABLE student ( - "ID" INTEGER, - "Sport" VARCHAR(50), - "Name" VARCHAR(50) -); -INSERT INTO student values ('10', '100', 'Venus Williams'); -INSERT INTO student values ('20', NULL, 'Demi Moore'); - -DROP TABLE IF EXISTS sport; - -CREATE TABLE sport ( - "ID" VARCHAR(50), - "Name" VARCHAR(50) -); -INSERT INTO sport values ('100', 'Tennis'); diff --git a/src/test/resources/rml-core/RMLTC0009b-SPARQL/mapping.ttl b/src/test/resources/rml-core/RMLTC0009b-SPARQL/mapping.ttl deleted file mode 100644 index 18ce4dc3..00000000 --- a/src/test/resources/rml-core/RMLTC0009b-SPARQL/mapping.ttl +++ /dev/null @@ -1,85 +0,0 @@ -@prefix foaf: . -@prefix formats: . -@prefix rdfs: . -@prefix rml: . -@prefix sd: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator """ - PREFIX rdfs: - PREFIX foaf: - PREFIX rdf: - SELECT ?Name ?ID ?Sport - WHERE { - ?x foaf:name ?Name ; - rdf:ID ?ID ; - ?sportObject . - OPTIONAL { ?sportObject a ; - rdf:ID ?Sport . } - } """; - rml:referenceFormulation formats:SPARQL_Results_JSON; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path - ] - ]; - rml:predicateObjectMap [ - rml:graph ; - rml:objectMap [ - rml:reference "Name.value" - ]; - rml:predicate foaf:name - ], [ - rml:graph ; - rml:objectMap [ a rml:RefObjectMap; - rml:joinCondition [ - rml:child "Sport.value"; - rml:parent "ID.value" - ]; - rml:parentTriplesMap - ]; - rml:predicate - ]; - rml:subjectMap [ - rml:class ; - rml:graph ; - rml:template "http://example.com/resource/student_{ID.value}" - ] . - - a sd:Service; - sd:endpoint ; - sd:supportedLanguage sd:SPARQL11Query . - - a sd:Service; - sd:endpoint ; - sd:supportedLanguage sd:SPARQL11Query . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator """ - PREFIX rdfs: - PREFIX foaf: - PREFIX rdf: - SELECT ?ID ?Name - WHERE { - ?x foaf:name ?Name ; - rdf:ID ?ID ; - } """; - rml:referenceFormulation formats:SPARQL_Results_JSON; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "Name.value" - ]; - rml:predicate rdfs:label - ]; - rml:subjectMap [ - rml:class ; - rml:graph ; - rml:template "http://example.com/resource/sport_{ID.value}" - ] . diff --git a/src/test/resources/rml-core/RMLTC0009b-SPARQL/output.nq b/src/test/resources/rml-core/RMLTC0009b-SPARQL/output.nq deleted file mode 100644 index aef6b08c..00000000 --- a/src/test/resources/rml-core/RMLTC0009b-SPARQL/output.nq +++ /dev/null @@ -1,8 +0,0 @@ - . - "Venus Williams" . - . - "Demi Moore" . - . - "Tennis" . - . - . diff --git a/src/test/resources/rml-core/RMLTC0009b-SPARQL/resource1.ttl b/src/test/resources/rml-core/RMLTC0009b-SPARQL/resource1.ttl deleted file mode 100644 index 676bdb38..00000000 --- a/src/test/resources/rml-core/RMLTC0009b-SPARQL/resource1.ttl +++ /dev/null @@ -1,13 +0,0 @@ -@prefix foaf: . -@prefix ns1: . -@prefix rdf: . - -[] ns1:plays [ a ns1:Sport ; - rdf:ID "100" ] ; - rdf:ID "10" ; - foaf:name "Venus Williams" . - -[] ns1:plays [ a ns1:Sport ] ; - rdf:ID "20" ; - foaf:name "Demi Moore" . - diff --git a/src/test/resources/rml-core/RMLTC0009b-SPARQL/resource2.ttl b/src/test/resources/rml-core/RMLTC0009b-SPARQL/resource2.ttl deleted file mode 100644 index d69ef52e..00000000 --- a/src/test/resources/rml-core/RMLTC0009b-SPARQL/resource2.ttl +++ /dev/null @@ -1,6 +0,0 @@ -@prefix foaf: . -@prefix rdf: . - -[] rdf:ID "100" ; - foaf:name "Tennis" . - diff --git a/src/test/resources/rml-core/RMLTC0009b-SQLServer/mapping.ttl b/src/test/resources/rml-core/RMLTC0009b-SQLServer/mapping.ttl deleted file mode 100644 index fb79327e..00000000 --- a/src/test/resources/rml-core/RMLTC0009b-SQLServer/mapping.ttl +++ /dev/null @@ -1,57 +0,0 @@ -@prefix d2rq: . -@prefix foaf: . -@prefix rdfs: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source ; - rml:referenceFormulation rml:SQL2008Table; - rml:iterator "student" - ]; - rml:predicateObjectMap [ - rml:graph ; - rml:objectMap [ - rml:reference "Name" - ]; - rml:predicate foaf:name - ], [ - rml:graph ; - rml:objectMap [ a rml:RefObjectMap; - rml:joinCondition [ - rml:child "Sport"; - rml:parent "ID" - ]; - rml:parentTriplesMap - ]; - rml:predicate - ]; - rml:subjectMap [ - rml:class ; - rml:graph ; - rml:template "http://example.com/resource/student_{ID}" - ] . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source ; - rml:referenceFormulation rml:SQL2008Table; - rml:iterator "sport" - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "Name" - ]; - rml:predicate rdfs:label - ]; - rml:subjectMap [ - rml:class ; - rml:graph ; - rml:template "http://example.com/resource/sport_{ID}" - ] . - - a d2rq:Database; - d2rq:jdbcDSN "CONNECTIONDSN"; - d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver"; - d2rq:password "YourSTRONG!Passw0rd;"; - d2rq:username "sa" . diff --git a/src/test/resources/rml-core/RMLTC0009b-SQLServer/output.nq b/src/test/resources/rml-core/RMLTC0009b-SQLServer/output.nq deleted file mode 100644 index aef6b08c..00000000 --- a/src/test/resources/rml-core/RMLTC0009b-SQLServer/output.nq +++ /dev/null @@ -1,8 +0,0 @@ - . - "Venus Williams" . - . - "Demi Moore" . - . - "Tennis" . - . - . diff --git a/src/test/resources/rml-core/RMLTC0009b-SQLServer/resource.sql b/src/test/resources/rml-core/RMLTC0009b-SQLServer/resource.sql deleted file mode 100644 index ac6eca67..00000000 --- a/src/test/resources/rml-core/RMLTC0009b-SQLServer/resource.sql +++ /dev/null @@ -1,18 +0,0 @@ -USE TestDB; -DROP TABLE IF EXISTS student; - -CREATE TABLE student ( - "ID" INTEGER, - "Sport" VARCHAR(50), - "Name" VARCHAR(50) -); -INSERT INTO student values ('10', '100', 'Venus Williams'); -INSERT INTO student values ('20', NULL, 'Demi Moore'); - -DROP TABLE IF EXISTS sport; - -CREATE TABLE sport ( - "ID" INTEGER, - "Name" VARCHAR(50) -); -INSERT INTO sport values ('100', 'Tennis'); diff --git a/src/test/resources/rml-core/RMLTC0009b-XML/mapping.ttl b/src/test/resources/rml-core/RMLTC0009b-XML/mapping.ttl deleted file mode 100644 index 010b4c72..00000000 --- a/src/test/resources/rml-core/RMLTC0009b-XML/mapping.ttl +++ /dev/null @@ -1,56 +0,0 @@ -@prefix foaf: . -@prefix rdfs: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator "/students/student"; - rml:referenceFormulation rml:XPath; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.xml" - ] - ]; - rml:predicateObjectMap [ - rml:graph ; - rml:objectMap [ - rml:reference "Name" - ]; - rml:predicate foaf:name - ], [ - rml:graph ; - rml:objectMap [ a rml:RefObjectMap; - rml:joinCondition [ - rml:child "Sport"; - rml:parent "ID" - ]; - rml:parentTriplesMap - ]; - rml:predicate - ]; - rml:subjectMap [ - rml:class ; - rml:graph ; - rml:template "http://example.com/resource/student_{ID}" - ] . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator "/sports/sport"; - rml:referenceFormulation rml:XPath; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "sport.xml" - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "Name" - ]; - rml:predicate rdfs:label - ]; - rml:subjectMap [ - rml:class ; - rml:graph ; - rml:template "http://example.com/resource/sport_{ID}" - ] . diff --git a/src/test/resources/rml-core/RMLTC0009b-XML/output.nq b/src/test/resources/rml-core/RMLTC0009b-XML/output.nq deleted file mode 100644 index aef6b08c..00000000 --- a/src/test/resources/rml-core/RMLTC0009b-XML/output.nq +++ /dev/null @@ -1,8 +0,0 @@ - . - "Venus Williams" . - . - "Demi Moore" . - . - "Tennis" . - . - . diff --git a/src/test/resources/rml-core/RMLTC0009b-XML/sport.xml b/src/test/resources/rml-core/RMLTC0009b-XML/sport.xml deleted file mode 100644 index 1c02bdb8..00000000 --- a/src/test/resources/rml-core/RMLTC0009b-XML/sport.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - 100 - Tennis - - diff --git a/src/test/resources/rml-core/RMLTC0009b-XML/student.xml b/src/test/resources/rml-core/RMLTC0009b-XML/student.xml deleted file mode 100644 index a66c01aa..00000000 --- a/src/test/resources/rml-core/RMLTC0009b-XML/student.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - 10 - Venus Williams - 100 - - - 20 - Demi Moore - - diff --git a/src/test/resources/rml-core/RMLTC0009c-MySQL/mapping.ttl b/src/test/resources/rml-core/RMLTC0009c-MySQL/mapping.ttl deleted file mode 100644 index d91b6e5a..00000000 --- a/src/test/resources/rml-core/RMLTC0009c-MySQL/mapping.ttl +++ /dev/null @@ -1,29 +0,0 @@ -@prefix d2rq: . -@prefix foaf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator """ - SELECT Name, COUNT(Sport) - FROM Student - GROUP BY Name - """; - rml:source ; - rml:referenceFormulation rml:SQL2008Query - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "Name" - ]; - rml:predicate foaf:name - ]; - rml:subjectMap [ - rml:template "http://example.com/resource/student_{Name}" - ] . - - a d2rq:Database; - d2rq:jdbcDSN "CONNECTIONDSN"; - d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver"; - d2rq:password ""; - d2rq:username "root" . diff --git a/src/test/resources/rml-core/RMLTC0009c-MySQL/output.nq b/src/test/resources/rml-core/RMLTC0009c-MySQL/output.nq deleted file mode 100644 index f789cbf8..00000000 --- a/src/test/resources/rml-core/RMLTC0009c-MySQL/output.nq +++ /dev/null @@ -1,4 +0,0 @@ - "Venus Williams" . - "Demi Moore" . - - diff --git a/src/test/resources/rml-core/RMLTC0009c-MySQL/resource.sql b/src/test/resources/rml-core/RMLTC0009c-MySQL/resource.sql deleted file mode 100644 index 4076cd0f..00000000 --- a/src/test/resources/rml-core/RMLTC0009c-MySQL/resource.sql +++ /dev/null @@ -1,21 +0,0 @@ -USE test; -DROP TABLE IF EXISTS test.Sport; -DROP TABLE IF EXISTS test.Student; - -CREATE TABLE Sport ( -ID integer, -Name varchar (50), -PRIMARY KEY (ID) -); - -CREATE TABLE Student ( -ID integer, -Name varchar(50), -Sport integer, -PRIMARY KEY (ID), -FOREIGN KEY(Sport) REFERENCES Sport(ID) -); - -INSERT INTO Sport (ID, Name) VALUES (100,'Tennis'); -INSERT INTO Student (ID, Name, Sport) VALUES (10,'Venus Williams', 100); -INSERT INTO Student (ID, Name, Sport) VALUES (20,'Demi Moore', NULL); diff --git a/src/test/resources/rml-core/RMLTC0009c-PostgreSQL/mapping.ttl b/src/test/resources/rml-core/RMLTC0009c-PostgreSQL/mapping.ttl deleted file mode 100644 index ac18f544..00000000 --- a/src/test/resources/rml-core/RMLTC0009c-PostgreSQL/mapping.ttl +++ /dev/null @@ -1,29 +0,0 @@ -@prefix d2rq: . -@prefix foaf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator """ - SELECT Name, COUNT(Sport) - FROM Student - GROUP BY Name - """; - rml:source ; - rml:referenceFormulation rml:SQL2008Query - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "name" - ]; - rml:predicate foaf:name - ]; - rml:subjectMap [ - rml:template "http://example.com/resource/student_{name}" - ] . - - a d2rq:Database; - d2rq:jdbcDSN "CONNECTIONDSN"; - d2rq:jdbcDriver "org.postgresql.Driver"; - d2rq:password ""; - d2rq:username "postgres" . diff --git a/src/test/resources/rml-core/RMLTC0009c-PostgreSQL/output.nq b/src/test/resources/rml-core/RMLTC0009c-PostgreSQL/output.nq deleted file mode 100644 index f789cbf8..00000000 --- a/src/test/resources/rml-core/RMLTC0009c-PostgreSQL/output.nq +++ /dev/null @@ -1,4 +0,0 @@ - "Venus Williams" . - "Demi Moore" . - - diff --git a/src/test/resources/rml-core/RMLTC0009c-PostgreSQL/resource.sql b/src/test/resources/rml-core/RMLTC0009c-PostgreSQL/resource.sql deleted file mode 100644 index 068f4d87..00000000 --- a/src/test/resources/rml-core/RMLTC0009c-PostgreSQL/resource.sql +++ /dev/null @@ -1,20 +0,0 @@ -DROP TABLE IF EXISTS Sport; -DROP TABLE IF EXISTS Student; - -CREATE TABLE Sport ( -ID integer, -Name varchar (50), -PRIMARY KEY (ID) -); - -CREATE TABLE Student ( -ID integer, -Name varchar(50), -Sport integer, -PRIMARY KEY (ID), -FOREIGN KEY(Sport) REFERENCES Sport(ID) -); - -INSERT INTO Sport (ID, Name) VALUES (100,'Tennis'); -INSERT INTO Student (ID, Name, Sport) VALUES (10,'Venus Williams', 100); -INSERT INTO Student (ID, Name, Sport) VALUES (20,'Demi Moore', NULL); diff --git a/src/test/resources/rml-core/RMLTC0009c-SQLServer/mapping.ttl b/src/test/resources/rml-core/RMLTC0009c-SQLServer/mapping.ttl deleted file mode 100644 index 23c4f1dd..00000000 --- a/src/test/resources/rml-core/RMLTC0009c-SQLServer/mapping.ttl +++ /dev/null @@ -1,29 +0,0 @@ -@prefix d2rq: . -@prefix foaf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator """ - SELECT Name, COUNT(Sport) - FROM Student - GROUP BY Name - """; - rml:source ; - rml:referenceFormulation rml:SQL2008Query - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "Name" - ]; - rml:predicate foaf:name - ]; - rml:subjectMap [ - rml:template "http://example.com/resource/student_{Name}" - ] . - - a d2rq:Database; - d2rq:jdbcDSN "CONNECTIONDSN"; - d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver"; - d2rq:password "YourSTRONG!Passw0rd;"; - d2rq:username "sa" . diff --git a/src/test/resources/rml-core/RMLTC0009c-SQLServer/output.nq b/src/test/resources/rml-core/RMLTC0009c-SQLServer/output.nq deleted file mode 100644 index f789cbf8..00000000 --- a/src/test/resources/rml-core/RMLTC0009c-SQLServer/output.nq +++ /dev/null @@ -1,4 +0,0 @@ - "Venus Williams" . - "Demi Moore" . - - diff --git a/src/test/resources/rml-core/RMLTC0009c-SQLServer/resource.sql b/src/test/resources/rml-core/RMLTC0009c-SQLServer/resource.sql deleted file mode 100644 index e23c539d..00000000 --- a/src/test/resources/rml-core/RMLTC0009c-SQLServer/resource.sql +++ /dev/null @@ -1,21 +0,0 @@ -USE TestDB; -DROP TABLE IF EXISTS Sport; -DROP TABLE IF EXISTS Student; - -CREATE TABLE Sport ( -ID integer, -Name varchar (50), -PRIMARY KEY (ID) -); - -CREATE TABLE Student ( -ID integer, -Name varchar(50), -Sport integer, -PRIMARY KEY (ID), -FOREIGN KEY(Sport) REFERENCES Sport(ID) -); - -INSERT INTO Sport (ID, Name) VALUES (100,'Tennis'); -INSERT INTO Student (ID, Name, Sport) VALUES (10,'Venus Williams', 100); -INSERT INTO Student (ID, Name, Sport) VALUES (20,'Demi Moore', NULL); diff --git a/src/test/resources/rml-core/RMLTC0009d-MySQL/mapping.ttl b/src/test/resources/rml-core/RMLTC0009d-MySQL/mapping.ttl deleted file mode 100644 index ce5b8cd7..00000000 --- a/src/test/resources/rml-core/RMLTC0009d-MySQL/mapping.ttl +++ /dev/null @@ -1,35 +0,0 @@ -@prefix d2rq: . -@prefix ex: . -@prefix foaf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator """ - SELECT Name, COUNT(Sport) as SPORTCOUNT - FROM Student - GROUP BY Name - """; - rml:source ; - rml:referenceFormulation rml:SQL2008Query - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "Name" - ]; - rml:predicate foaf:name - ], [ - rml:objectMap [ - rml:reference "SPORTCOUNT" - ]; - rml:predicate ex:numSport - ]; - rml:subjectMap [ - rml:template "http://example.com/resource/student_{Name}" - ] . - - a d2rq:Database; - d2rq:jdbcDSN "CONNECTIONDSN"; - d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver"; - d2rq:password ""; - d2rq:username "root" . diff --git a/src/test/resources/rml-core/RMLTC0009d-MySQL/output.nq b/src/test/resources/rml-core/RMLTC0009d-MySQL/output.nq deleted file mode 100644 index 9ecd9fc2..00000000 --- a/src/test/resources/rml-core/RMLTC0009d-MySQL/output.nq +++ /dev/null @@ -1,7 +0,0 @@ - "Venus Williams" . - "1"^^ . - "Demi Moore" . - "0"^^ . - - - diff --git a/src/test/resources/rml-core/RMLTC0009d-MySQL/resource.sql b/src/test/resources/rml-core/RMLTC0009d-MySQL/resource.sql deleted file mode 100644 index a5947eb9..00000000 --- a/src/test/resources/rml-core/RMLTC0009d-MySQL/resource.sql +++ /dev/null @@ -1,21 +0,0 @@ -USE test; -DROP TABLE IF EXISTS test.Student; -DROP TABLE IF EXISTS test.Sport; - -CREATE TABLE Sport ( -ID integer, -Name varchar (50), -PRIMARY KEY (ID) -); - -CREATE TABLE Student ( -ID integer, -Name varchar(50), -Sport integer, -PRIMARY KEY (ID), -FOREIGN KEY(Sport) REFERENCES Sport(ID) -); - -INSERT INTO Sport (ID, Name) VALUES (100,'Tennis'); -INSERT INTO Student (ID, Name, Sport) VALUES (10,'Venus Williams', 100); -INSERT INTO Student (ID, Name, Sport) VALUES (20,'Demi Moore', NULL); diff --git a/src/test/resources/rml-core/RMLTC0009d-PostgreSQL/mapping.ttl b/src/test/resources/rml-core/RMLTC0009d-PostgreSQL/mapping.ttl deleted file mode 100644 index a701020d..00000000 --- a/src/test/resources/rml-core/RMLTC0009d-PostgreSQL/mapping.ttl +++ /dev/null @@ -1,35 +0,0 @@ -@prefix d2rq: . -@prefix ex: . -@prefix foaf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator """ - SELECT Name, COUNT(Sport) as SPORTCOUNT - FROM Student - GROUP BY Name - """; - rml:source ; - rml:referenceFormulation rml:SQL2008Query - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "name" - ]; - rml:predicate foaf:name - ], [ - rml:objectMap [ - rml:reference "sportcount" - ]; - rml:predicate ex:numSport - ]; - rml:subjectMap [ - rml:template "http://example.com/resource/student_{name}" - ] . - - a d2rq:Database; - d2rq:jdbcDSN "CONNECTIONDSN"; - d2rq:jdbcDriver "org.postgresql.Driver"; - d2rq:password ""; - d2rq:username "postgres" . diff --git a/src/test/resources/rml-core/RMLTC0009d-PostgreSQL/output.nq b/src/test/resources/rml-core/RMLTC0009d-PostgreSQL/output.nq deleted file mode 100644 index 9ecd9fc2..00000000 --- a/src/test/resources/rml-core/RMLTC0009d-PostgreSQL/output.nq +++ /dev/null @@ -1,7 +0,0 @@ - "Venus Williams" . - "1"^^ . - "Demi Moore" . - "0"^^ . - - - diff --git a/src/test/resources/rml-core/RMLTC0009d-PostgreSQL/resource.sql b/src/test/resources/rml-core/RMLTC0009d-PostgreSQL/resource.sql deleted file mode 100644 index d8ba9270..00000000 --- a/src/test/resources/rml-core/RMLTC0009d-PostgreSQL/resource.sql +++ /dev/null @@ -1,20 +0,0 @@ -DROP TABLE IF EXISTS Student; -DROP TABLE IF EXISTS Sport; - -CREATE TABLE Sport ( -ID integer, -Name varchar (50), -PRIMARY KEY (ID) -); - -CREATE TABLE Student ( -ID integer, -Name varchar(50), -Sport integer, -PRIMARY KEY (ID), -FOREIGN KEY(Sport) REFERENCES Sport(ID) -); - -INSERT INTO Sport (ID, Name) VALUES (100,'Tennis'); -INSERT INTO Student (ID, Name, Sport) VALUES (10,'Venus Williams', 100); -INSERT INTO Student (ID, Name, Sport) VALUES (20,'Demi Moore', NULL); diff --git a/src/test/resources/rml-core/RMLTC0009d-SQLServer/mapping.ttl b/src/test/resources/rml-core/RMLTC0009d-SQLServer/mapping.ttl deleted file mode 100644 index e50b0333..00000000 --- a/src/test/resources/rml-core/RMLTC0009d-SQLServer/mapping.ttl +++ /dev/null @@ -1,35 +0,0 @@ -@prefix d2rq: . -@prefix ex: . -@prefix foaf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator """ - SELECT Name, COUNT(Sport) as SPORTCOUNT - FROM Student - GROUP BY Name - """; - rml:source ; - rml:referenceFormulation rml:SQL2008Query - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "Name" - ]; - rml:predicate foaf:name - ], [ - rml:objectMap [ - rml:reference "SPORTCOUNT" - ]; - rml:predicate ex:numSport - ]; - rml:subjectMap [ - rml:template "http://example.com/resource/student_{Name}" - ] . - - a d2rq:Database; - d2rq:jdbcDSN "CONNECTIONDSN"; - d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver"; - d2rq:password "YourSTRONG!Passw0rd;"; - d2rq:username "sa" . diff --git a/src/test/resources/rml-core/RMLTC0009d-SQLServer/output.nq b/src/test/resources/rml-core/RMLTC0009d-SQLServer/output.nq deleted file mode 100644 index 9ecd9fc2..00000000 --- a/src/test/resources/rml-core/RMLTC0009d-SQLServer/output.nq +++ /dev/null @@ -1,7 +0,0 @@ - "Venus Williams" . - "1"^^ . - "Demi Moore" . - "0"^^ . - - - diff --git a/src/test/resources/rml-core/RMLTC0009d-SQLServer/resource.sql b/src/test/resources/rml-core/RMLTC0009d-SQLServer/resource.sql deleted file mode 100644 index ad1775c0..00000000 --- a/src/test/resources/rml-core/RMLTC0009d-SQLServer/resource.sql +++ /dev/null @@ -1,21 +0,0 @@ -USE TestDB; -DROP TABLE IF EXISTS Student; -DROP TABLE IF EXISTS Sport; - -CREATE TABLE Sport ( -ID integer, -Name varchar (50), -PRIMARY KEY (ID) -); - -CREATE TABLE Student ( -ID integer, -Name varchar(50), -Sport integer, -PRIMARY KEY (ID), -FOREIGN KEY(Sport) REFERENCES Sport(ID) -); - -INSERT INTO Sport (ID, Name) VALUES (100,'Tennis'); -INSERT INTO Student (ID, Name, Sport) VALUES (10,'Venus Williams', 100); -INSERT INTO Student (ID, Name, Sport) VALUES (20,'Demi Moore', NULL); diff --git a/src/test/resources/rml-core/RMLTC0010a-CSV/country_info.csv b/src/test/resources/rml-core/RMLTC0010a-CSV/country_info.csv deleted file mode 100644 index 67082bbd..00000000 --- a/src/test/resources/rml-core/RMLTC0010a-CSV/country_info.csv +++ /dev/null @@ -1,4 +0,0 @@ -Country Code,Name,ISO 3166 -1,"Bolivia, Plurinational State of",BO -2,"Ireland",IE -3,"Saint Martin (French part)",MF diff --git a/src/test/resources/rml-core/RMLTC0010a-CSV/mapping.ttl b/src/test/resources/rml-core/RMLTC0010a-CSV/mapping.ttl deleted file mode 100644 index c1b0e5ce..00000000 --- a/src/test/resources/rml-core/RMLTC0010a-CSV/mapping.ttl +++ /dev/null @@ -1,20 +0,0 @@ -@prefix ex: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:referenceFormulation rml:CSV; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "country_info.csv" - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "Name" - ]; - rml:predicate ex:name - ]; - rml:subjectMap [ - rml:template "http://example.com/{Country Code}" - ] . diff --git a/src/test/resources/rml-core/RMLTC0010a-CSV/output.nq b/src/test/resources/rml-core/RMLTC0010a-CSV/output.nq deleted file mode 100644 index 29911d6f..00000000 --- a/src/test/resources/rml-core/RMLTC0010a-CSV/output.nq +++ /dev/null @@ -1,4 +0,0 @@ - "Bolivia, Plurinational State of" . - "Ireland" . - "Saint Martin (French part)" . - diff --git a/src/test/resources/rml-core/RMLTC0010a-JSON/README.md b/src/test/resources/rml-core/RMLTC0010a-JSON/README.md new file mode 100644 index 00000000..f465982b --- /dev/null +++ b/src/test/resources/rml-core/RMLTC0010a-JSON/README.md @@ -0,0 +1,65 @@ +## RMLTC0010a-JSON + +**Title**: "Template with table column with blank space" + +**Description**: "Tests a template with blank space in column value" + +**Default Base IRI**: http://example.com/ + +**Error expected?** No + +**Input** +``` +{ + "countries": [{ + "Country Code": 1, + "Name":"Bolivia, Plurinational State of", + "ISO 3166": "BO" + }, { + "Country Code": 2, + "Name":"Ireland", + "ISO 3166": "IE" + }, { + "Country Code": 3, + "Name":"Saint Martin (French part)", + "ISO 3166": "MF" + }] +} + +``` + +**Mapping** +``` +@prefix ex: . +@prefix rml: . + + a rml:TriplesMap; + rml:logicalSource [ a rml:LogicalSource; + rml:iterator "$.countries[*]"; + rml:referenceFormulation rml:JSONPath; + rml:source [ a rml:RelativePathSource; + rml:root rml:MappingDirectory; + rml:path "country_info.json" + ] + ]; + rml:predicateObjectMap [ + rml:objectMap [ + rml:reference "$.Name" + ]; + rml:predicate ex:name + ]; + rml:subjectMap [ + rml:template "http://example.com/{$.['Country Code']}" + ] . + +``` + +**Output** +``` + "Bolivia, Plurinational State of" . + "Ireland" . + "Saint Martin (French part)" . + + +``` + diff --git a/src/test/resources/rml-core/RMLTC0010a-JSON/mapping.ttl b/src/test/resources/rml-core/RMLTC0010a-JSON/mapping.ttl index 68e3dd35..370edb7c 100644 --- a/src/test/resources/rml-core/RMLTC0010a-JSON/mapping.ttl +++ b/src/test/resources/rml-core/RMLTC0010a-JSON/mapping.ttl @@ -12,7 +12,7 @@ ]; rml:predicateObjectMap [ rml:objectMap [ - rml:reference "Name" + rml:reference "$.Name" ]; rml:predicate ex:name ]; diff --git a/src/test/resources/rml-core/RMLTC0010a-MySQL/mapping.ttl b/src/test/resources/rml-core/RMLTC0010a-MySQL/mapping.ttl deleted file mode 100644 index 27735605..00000000 --- a/src/test/resources/rml-core/RMLTC0010a-MySQL/mapping.ttl +++ /dev/null @@ -1,25 +0,0 @@ -@prefix d2rq: . -@prefix ex: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source ; - rml:referenceFormulation rml:SQL2008Table; - rml:iterator "country_info" - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "Name" - ]; - rml:predicate ex:name - ]; - rml:subjectMap [ - rml:template "http://example.com/{Country Code}" - ] . - - a d2rq:Database; - d2rq:jdbcDSN "CONNECTIONDSN"; - d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver"; - d2rq:password ""; - d2rq:username "root" . diff --git a/src/test/resources/rml-core/RMLTC0010a-MySQL/output.nq b/src/test/resources/rml-core/RMLTC0010a-MySQL/output.nq deleted file mode 100644 index 29911d6f..00000000 --- a/src/test/resources/rml-core/RMLTC0010a-MySQL/output.nq +++ /dev/null @@ -1,4 +0,0 @@ - "Bolivia, Plurinational State of" . - "Ireland" . - "Saint Martin (French part)" . - diff --git a/src/test/resources/rml-core/RMLTC0010a-MySQL/resource.sql b/src/test/resources/rml-core/RMLTC0010a-MySQL/resource.sql deleted file mode 100644 index 7a7aa74f..00000000 --- a/src/test/resources/rml-core/RMLTC0010a-MySQL/resource.sql +++ /dev/null @@ -1,11 +0,0 @@ -USE test; -DROP TABLE IF EXISTS test.country_info; - -CREATE TABLE country_info ( - `Country Code` INTEGER, - Name VARCHAR(100), - `ISO 3166` VARCHAR(10) -); -INSERT INTO country_info values ('1', 'Bolivia, Plurinational State of', 'BO'); -INSERT INTO country_info values ('2', 'Ireland', 'IE'); -INSERT INTO country_info values ('3', 'Saint Martin (French part)', 'MF'); diff --git a/src/test/resources/rml-core/RMLTC0010a-PostgreSQL/mapping.ttl b/src/test/resources/rml-core/RMLTC0010a-PostgreSQL/mapping.ttl deleted file mode 100644 index 2c3734eb..00000000 --- a/src/test/resources/rml-core/RMLTC0010a-PostgreSQL/mapping.ttl +++ /dev/null @@ -1,25 +0,0 @@ -@prefix d2rq: . -@prefix ex: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source ; - rml:referenceFormulation rml:SQL2008Table; - rml:iterator "country_info" - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "Name" - ]; - rml:predicate ex:name - ]; - rml:subjectMap [ - rml:template "http://example.com/{Country Code}" - ] . - - a d2rq:Database; - d2rq:jdbcDSN "CONNECTIONDSN"; - d2rq:jdbcDriver "org.postgresql.Driver"; - d2rq:password ""; - d2rq:username "postgres" . diff --git a/src/test/resources/rml-core/RMLTC0010a-PostgreSQL/output.nq b/src/test/resources/rml-core/RMLTC0010a-PostgreSQL/output.nq deleted file mode 100644 index 29911d6f..00000000 --- a/src/test/resources/rml-core/RMLTC0010a-PostgreSQL/output.nq +++ /dev/null @@ -1,4 +0,0 @@ - "Bolivia, Plurinational State of" . - "Ireland" . - "Saint Martin (French part)" . - diff --git a/src/test/resources/rml-core/RMLTC0010a-PostgreSQL/resource.sql b/src/test/resources/rml-core/RMLTC0010a-PostgreSQL/resource.sql deleted file mode 100644 index 12f1652d..00000000 --- a/src/test/resources/rml-core/RMLTC0010a-PostgreSQL/resource.sql +++ /dev/null @@ -1,10 +0,0 @@ -DROP TABLE IF EXISTS country_info; - -CREATE TABLE country_info ( - "Country Code" INTEGER, - "Name" VARCHAR(100), - "ISO 3166" VARCHAR(10) -); -INSERT INTO country_info values ('1', 'Bolivia, Plurinational State of', 'BO'); -INSERT INTO country_info values ('2', 'Ireland', 'IE'); -INSERT INTO country_info values ('3', 'Saint Martin (French part)', 'MF'); diff --git a/src/test/resources/rml-core/RMLTC0010a-SQLServer/mapping.ttl b/src/test/resources/rml-core/RMLTC0010a-SQLServer/mapping.ttl deleted file mode 100644 index fdca61f9..00000000 --- a/src/test/resources/rml-core/RMLTC0010a-SQLServer/mapping.ttl +++ /dev/null @@ -1,25 +0,0 @@ -@prefix d2rq: . -@prefix ex: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source ; - rml:referenceFormulation rml:SQL2008Table; - rml:iterator "country_info" - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "Name" - ]; - rml:predicate ex:name - ]; - rml:subjectMap [ - rml:template "http://example.com/{Country Code}" - ] . - - a d2rq:Database; - d2rq:jdbcDSN "CONNECTIONDSN"; - d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver"; - d2rq:password "YourSTRONG!Passw0rd;"; - d2rq:username "sa" . diff --git a/src/test/resources/rml-core/RMLTC0010a-SQLServer/output.nq b/src/test/resources/rml-core/RMLTC0010a-SQLServer/output.nq deleted file mode 100644 index 29911d6f..00000000 --- a/src/test/resources/rml-core/RMLTC0010a-SQLServer/output.nq +++ /dev/null @@ -1,4 +0,0 @@ - "Bolivia, Plurinational State of" . - "Ireland" . - "Saint Martin (French part)" . - diff --git a/src/test/resources/rml-core/RMLTC0010a-SQLServer/resource.sql b/src/test/resources/rml-core/RMLTC0010a-SQLServer/resource.sql deleted file mode 100644 index 8c20c7bc..00000000 --- a/src/test/resources/rml-core/RMLTC0010a-SQLServer/resource.sql +++ /dev/null @@ -1,11 +0,0 @@ -USE TestDB; -DROP TABLE IF EXISTS country_info; - -CREATE TABLE country_info ( - "Country Code" INTEGER, - "Name" VARCHAR(100), - "ISO 3166" VARCHAR(10) -); -INSERT INTO country_info values ('1', 'Bolivia, Plurinational State of', 'BO'); -INSERT INTO country_info values ('2', 'Ireland', 'IE'); -INSERT INTO country_info values ('3', 'Saint Martin (French part)', 'MF'); diff --git a/src/test/resources/rml-core/RMLTC0010b-CSV/country_info.csv b/src/test/resources/rml-core/RMLTC0010b-CSV/country_info.csv deleted file mode 100644 index c550dbf5..00000000 --- a/src/test/resources/rml-core/RMLTC0010b-CSV/country_info.csv +++ /dev/null @@ -1,4 +0,0 @@ -Country Code,Name,ISO 3166 -1,"Bolivia, Plurinational State of",BO -2,Ireland,IE -3,"Saint Martin (French part)",MF diff --git a/src/test/resources/rml-core/RMLTC0010b-CSV/mapping.ttl b/src/test/resources/rml-core/RMLTC0010b-CSV/mapping.ttl deleted file mode 100644 index c425b43e..00000000 --- a/src/test/resources/rml-core/RMLTC0010b-CSV/mapping.ttl +++ /dev/null @@ -1,20 +0,0 @@ -@prefix ex: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:referenceFormulation rml:CSV; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "country_info.csv" - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "Name" - ]; - rml:predicate ex:name - ]; - rml:subjectMap [ - rml:template "http://example.com/{Country Code}/{Name}" - ] . diff --git a/src/test/resources/rml-core/RMLTC0010b-CSV/output.nq b/src/test/resources/rml-core/RMLTC0010b-CSV/output.nq deleted file mode 100644 index c92a08b0..00000000 --- a/src/test/resources/rml-core/RMLTC0010b-CSV/output.nq +++ /dev/null @@ -1,4 +0,0 @@ - "Bolivia, Plurinational State of" . - "Ireland" . - "Saint Martin (French part)" . - diff --git a/src/test/resources/rml-core/RMLTC0010b-JSON/README.md b/src/test/resources/rml-core/RMLTC0010b-JSON/README.md new file mode 100644 index 00000000..a91ee546 --- /dev/null +++ b/src/test/resources/rml-core/RMLTC0010b-JSON/README.md @@ -0,0 +1,65 @@ +## RMLTC0010b-JSON + +**Title**: "Template with table columns with special chars" + +**Description**: "Tests a template with special chars in column value" + +**Default Base IRI**: http://example.com/ + +**Error expected?** No + +**Input** +``` +{ + "countries": [{ + "Country Code": 1, + "Name":"Bolivia, Plurinational State of", + "ISO 3166": "BO" + }, { + "Country Code": 2, + "Name":"Ireland", + "ISO 3166": "IE" + }, { + "Country Code": 3, + "Name":"Saint Martin (French part)", + "ISO 3166": "MF" + }] +} + +``` + +**Mapping** +``` +@prefix ex: . +@prefix rml: . + + a rml:TriplesMap; + rml:logicalSource [ a rml:LogicalSource; + rml:iterator "$.countries[*]"; + rml:referenceFormulation rml:JSONPath; + rml:source [ a rml:RelativePathSource; + rml:root rml:MappingDirectory; + rml:path "country_info.json" + ] + ]; + rml:predicateObjectMap [ + rml:objectMap [ + rml:reference "$.Name" + ]; + rml:predicate ex:name + ]; + rml:subjectMap [ + rml:template "http://example.com/{$.['Country Code']}/{$.Name}" + ] . + +``` + +**Output** +``` + "Bolivia, Plurinational State of" . + "Ireland" . + "Saint Martin (French part)" . + + +``` + diff --git a/src/test/resources/rml-core/RMLTC0010b-JSON/mapping.ttl b/src/test/resources/rml-core/RMLTC0010b-JSON/mapping.ttl index 60f6394e..1f9f4db6 100644 --- a/src/test/resources/rml-core/RMLTC0010b-JSON/mapping.ttl +++ b/src/test/resources/rml-core/RMLTC0010b-JSON/mapping.ttl @@ -12,10 +12,10 @@ ]; rml:predicateObjectMap [ rml:objectMap [ - rml:reference "Name" + rml:reference "$.Name" ]; rml:predicate ex:name ]; rml:subjectMap [ - rml:template "http://example.com/{$.['Country Code']}/{Name}" + rml:template "http://example.com/{$.['Country Code']}/{$.Name}" ] . diff --git a/src/test/resources/rml-core/RMLTC0010b-MySQL/mapping.ttl b/src/test/resources/rml-core/RMLTC0010b-MySQL/mapping.ttl deleted file mode 100644 index 4f3f48c8..00000000 --- a/src/test/resources/rml-core/RMLTC0010b-MySQL/mapping.ttl +++ /dev/null @@ -1,25 +0,0 @@ -@prefix d2rq: . -@prefix ex: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source ; - rml:referenceFormulation rml:SQL2008Table; - rml:iterator "country_info" - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "Name" - ]; - rml:predicate ex:name - ]; - rml:subjectMap [ - rml:template "http://example.com/{Country Code}/{Name}" - ] . - - a d2rq:Database; - d2rq:jdbcDSN "CONNECTIONDSN"; - d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver"; - d2rq:password ""; - d2rq:username "root" . diff --git a/src/test/resources/rml-core/RMLTC0010b-MySQL/output.nq b/src/test/resources/rml-core/RMLTC0010b-MySQL/output.nq deleted file mode 100644 index c92a08b0..00000000 --- a/src/test/resources/rml-core/RMLTC0010b-MySQL/output.nq +++ /dev/null @@ -1,4 +0,0 @@ - "Bolivia, Plurinational State of" . - "Ireland" . - "Saint Martin (French part)" . - diff --git a/src/test/resources/rml-core/RMLTC0010b-MySQL/resource.sql b/src/test/resources/rml-core/RMLTC0010b-MySQL/resource.sql deleted file mode 100644 index 7a7aa74f..00000000 --- a/src/test/resources/rml-core/RMLTC0010b-MySQL/resource.sql +++ /dev/null @@ -1,11 +0,0 @@ -USE test; -DROP TABLE IF EXISTS test.country_info; - -CREATE TABLE country_info ( - `Country Code` INTEGER, - Name VARCHAR(100), - `ISO 3166` VARCHAR(10) -); -INSERT INTO country_info values ('1', 'Bolivia, Plurinational State of', 'BO'); -INSERT INTO country_info values ('2', 'Ireland', 'IE'); -INSERT INTO country_info values ('3', 'Saint Martin (French part)', 'MF'); diff --git a/src/test/resources/rml-core/RMLTC0010b-PostgreSQL/mapping.ttl b/src/test/resources/rml-core/RMLTC0010b-PostgreSQL/mapping.ttl deleted file mode 100644 index 195c6fb6..00000000 --- a/src/test/resources/rml-core/RMLTC0010b-PostgreSQL/mapping.ttl +++ /dev/null @@ -1,25 +0,0 @@ -@prefix d2rq: . -@prefix ex: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source ; - rml:referenceFormulation rml:SQL2008Table; - rml:iterator "country_info" - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "Name" - ]; - rml:predicate ex:name - ]; - rml:subjectMap [ - rml:template "http://example.com/{Country Code}/{Name}" - ] . - - a d2rq:Database; - d2rq:jdbcDSN "CONNECTIONDSN"; - d2rq:jdbcDriver "org.postgresql.Driver"; - d2rq:password ""; - d2rq:username "postgres" . diff --git a/src/test/resources/rml-core/RMLTC0010b-PostgreSQL/output.nq b/src/test/resources/rml-core/RMLTC0010b-PostgreSQL/output.nq deleted file mode 100644 index c92a08b0..00000000 --- a/src/test/resources/rml-core/RMLTC0010b-PostgreSQL/output.nq +++ /dev/null @@ -1,4 +0,0 @@ - "Bolivia, Plurinational State of" . - "Ireland" . - "Saint Martin (French part)" . - diff --git a/src/test/resources/rml-core/RMLTC0010b-PostgreSQL/resource.sql b/src/test/resources/rml-core/RMLTC0010b-PostgreSQL/resource.sql deleted file mode 100644 index 12f1652d..00000000 --- a/src/test/resources/rml-core/RMLTC0010b-PostgreSQL/resource.sql +++ /dev/null @@ -1,10 +0,0 @@ -DROP TABLE IF EXISTS country_info; - -CREATE TABLE country_info ( - "Country Code" INTEGER, - "Name" VARCHAR(100), - "ISO 3166" VARCHAR(10) -); -INSERT INTO country_info values ('1', 'Bolivia, Plurinational State of', 'BO'); -INSERT INTO country_info values ('2', 'Ireland', 'IE'); -INSERT INTO country_info values ('3', 'Saint Martin (French part)', 'MF'); diff --git a/src/test/resources/rml-core/RMLTC0010b-SQLServer/mapping.ttl b/src/test/resources/rml-core/RMLTC0010b-SQLServer/mapping.ttl deleted file mode 100644 index f925e352..00000000 --- a/src/test/resources/rml-core/RMLTC0010b-SQLServer/mapping.ttl +++ /dev/null @@ -1,25 +0,0 @@ -@prefix d2rq: . -@prefix ex: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source ; - rml:referenceFormulation rml:SQL2008Table; - rml:iterator "country_info" - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "Name" - ]; - rml:predicate ex:name - ]; - rml:subjectMap [ - rml:template "http://example.com/{Country Code}/{Name}" - ] . - - a d2rq:Database; - d2rq:jdbcDSN "CONNECTIONDSN"; - d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver"; - d2rq:password "YourSTRONG!Passw0rd;"; - d2rq:username "sa" . diff --git a/src/test/resources/rml-core/RMLTC0010b-SQLServer/output.nq b/src/test/resources/rml-core/RMLTC0010b-SQLServer/output.nq deleted file mode 100644 index c92a08b0..00000000 --- a/src/test/resources/rml-core/RMLTC0010b-SQLServer/output.nq +++ /dev/null @@ -1,4 +0,0 @@ - "Bolivia, Plurinational State of" . - "Ireland" . - "Saint Martin (French part)" . - diff --git a/src/test/resources/rml-core/RMLTC0010b-SQLServer/resource.sql b/src/test/resources/rml-core/RMLTC0010b-SQLServer/resource.sql deleted file mode 100644 index 8c20c7bc..00000000 --- a/src/test/resources/rml-core/RMLTC0010b-SQLServer/resource.sql +++ /dev/null @@ -1,11 +0,0 @@ -USE TestDB; -DROP TABLE IF EXISTS country_info; - -CREATE TABLE country_info ( - "Country Code" INTEGER, - "Name" VARCHAR(100), - "ISO 3166" VARCHAR(10) -); -INSERT INTO country_info values ('1', 'Bolivia, Plurinational State of', 'BO'); -INSERT INTO country_info values ('2', 'Ireland', 'IE'); -INSERT INTO country_info values ('3', 'Saint Martin (French part)', 'MF'); diff --git a/src/test/resources/rml-core/RMLTC0010b-XML/country_info.xml b/src/test/resources/rml-core/RMLTC0010b-XML/country_info.xml deleted file mode 100644 index c47aa6ab..00000000 --- a/src/test/resources/rml-core/RMLTC0010b-XML/country_info.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - 1 - Bolivia, Plurinational State of - BO - - - 2 - Ireland - IE - - - 3 - Saint Martin (French part) - MF - - - diff --git a/src/test/resources/rml-core/RMLTC0010b-XML/mapping.ttl b/src/test/resources/rml-core/RMLTC0010b-XML/mapping.ttl deleted file mode 100644 index 44a0ce2d..00000000 --- a/src/test/resources/rml-core/RMLTC0010b-XML/mapping.ttl +++ /dev/null @@ -1,21 +0,0 @@ -@prefix ex: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator "/countries/country"; - rml:referenceFormulation rml:XPath; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "country_info.xml" - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "Name" - ]; - rml:predicate ex:name - ]; - rml:subjectMap [ - rml:template "http://example.com/{CountryCode}/{Name}" - ] . diff --git a/src/test/resources/rml-core/RMLTC0010b-XML/output.nq b/src/test/resources/rml-core/RMLTC0010b-XML/output.nq deleted file mode 100644 index c92a08b0..00000000 --- a/src/test/resources/rml-core/RMLTC0010b-XML/output.nq +++ /dev/null @@ -1,4 +0,0 @@ - "Bolivia, Plurinational State of" . - "Ireland" . - "Saint Martin (French part)" . - diff --git a/src/test/resources/rml-core/RMLTC0010c-CSV/country_info.csv b/src/test/resources/rml-core/RMLTC0010c-CSV/country_info.csv deleted file mode 100644 index 2d42678e..00000000 --- a/src/test/resources/rml-core/RMLTC0010c-CSV/country_info.csv +++ /dev/null @@ -1,4 +0,0 @@ -Country Code,Name,ISO 3166 -1,"Bolivia, Plurinational State of",BO -2,Ireland,IE -3,Saint Martin (French part),MF diff --git a/src/test/resources/rml-core/RMLTC0010c-CSV/mapping.ttl b/src/test/resources/rml-core/RMLTC0010c-CSV/mapping.ttl deleted file mode 100644 index 715bbf2a..00000000 --- a/src/test/resources/rml-core/RMLTC0010c-CSV/mapping.ttl +++ /dev/null @@ -1,21 +0,0 @@ -@prefix ex: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:referenceFormulation rml:CSV; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "country_info.csv" - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:template "\\{\\{\\{ {ISO 3166} \\}\\}\\}"; - rml:termType rml:Literal - ]; - rml:predicate ex:code - ]; - rml:subjectMap [ - rml:template "http://example.com/{Country Code}/{Name}" - ] . diff --git a/src/test/resources/rml-core/RMLTC0010c-CSV/output.nq b/src/test/resources/rml-core/RMLTC0010c-CSV/output.nq deleted file mode 100644 index 5c7e1080..00000000 --- a/src/test/resources/rml-core/RMLTC0010c-CSV/output.nq +++ /dev/null @@ -1,4 +0,0 @@ - "{{{ BO }}}" . - "{{{ IE }}}" . - "{{{ MF }}}" . - diff --git a/src/test/resources/rml-core/RMLTC0010c-JSON/README.md b/src/test/resources/rml-core/RMLTC0010c-JSON/README.md new file mode 100644 index 00000000..62298579 --- /dev/null +++ b/src/test/resources/rml-core/RMLTC0010c-JSON/README.md @@ -0,0 +1,66 @@ +## RMLTC0010c-JSON + +**Title**: "Template with table columns with special chars and backslashes" + +**Description**: "Tests a template with special chars in reference value and backslash escapes in string templates" + +**Default Base IRI**: http://example.com/ + +**Error expected?** No + +**Input** +``` +{ + "countries": [{ + "Country Code": 1, + "Name":"Bolivia, Plurinational State of", + "ISO 3166": "BO" + }, { + "Country Code": 2, + "Name":"Ireland", + "ISO 3166": "IE" + }, { + "Country Code": 3, + "Name":"Saint Martin (French part)", + "ISO 3166": "MF" + }] +} + +``` + +**Mapping** +``` +@prefix ex: . +@prefix rml: . + + a rml:TriplesMap; + rml:logicalSource [ a rml:LogicalSource; + rml:iterator "$.countries[*]"; + rml:referenceFormulation rml:JSONPath; + rml:source [ a rml:RelativePathSource; + rml:root rml:MappingDirectory; + rml:path "country_info.json" + ] + ]; + rml:predicateObjectMap [ + rml:predicate ex:code; + rml:objectMap [ + rml:template "\\{\\{\\{ {$.['ISO 3166']} \\}\\}\\}"; + rml:termType rml:Literal + ] + ]; + rml:subjectMap [ + rml:template "http://example.com/{$.['Country Code']}/{$.Name}" + ] . + +``` + +**Output** +``` + "{{{ BO }}}" . + "{{{ IE }}}" . + "{{{ MF }}}" . + + +``` + diff --git a/src/test/resources/rml-core/RMLTC0010c-JSON/mapping.ttl b/src/test/resources/rml-core/RMLTC0010c-JSON/mapping.ttl index 67e61d6e..fb1afc8d 100644 --- a/src/test/resources/rml-core/RMLTC0010c-JSON/mapping.ttl +++ b/src/test/resources/rml-core/RMLTC0010c-JSON/mapping.ttl @@ -18,5 +18,5 @@ ] ]; rml:subjectMap [ - rml:template "http://example.com/{$.['Country Code']}/{Name}" + rml:template "http://example.com/{$.['Country Code']}/{$.Name}" ] . diff --git a/src/test/resources/rml-core/RMLTC0010c-MySQL/mapping.ttl b/src/test/resources/rml-core/RMLTC0010c-MySQL/mapping.ttl deleted file mode 100644 index 76afab7e..00000000 --- a/src/test/resources/rml-core/RMLTC0010c-MySQL/mapping.ttl +++ /dev/null @@ -1,26 +0,0 @@ -@prefix d2rq: . -@prefix ex: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source ; - rml:referenceFormulation rml:SQL2008Table; - rml:iterator "country_info" - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:template "\\{\\{\\{ {ISO 3166} \\}\\}\\}"; - rml:termType rml:Literal - ]; - rml:predicate ex:code - ]; - rml:subjectMap [ - rml:template "http://example.com/{Country Code}/{Name}" - ] . - - a d2rq:Database; - d2rq:jdbcDSN "CONNECTIONDSN"; - d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver"; - d2rq:password ""; - d2rq:username "root" . diff --git a/src/test/resources/rml-core/RMLTC0010c-MySQL/output.nq b/src/test/resources/rml-core/RMLTC0010c-MySQL/output.nq deleted file mode 100644 index 5c7e1080..00000000 --- a/src/test/resources/rml-core/RMLTC0010c-MySQL/output.nq +++ /dev/null @@ -1,4 +0,0 @@ - "{{{ BO }}}" . - "{{{ IE }}}" . - "{{{ MF }}}" . - diff --git a/src/test/resources/rml-core/RMLTC0010c-MySQL/resource.sql b/src/test/resources/rml-core/RMLTC0010c-MySQL/resource.sql deleted file mode 100644 index 7a7aa74f..00000000 --- a/src/test/resources/rml-core/RMLTC0010c-MySQL/resource.sql +++ /dev/null @@ -1,11 +0,0 @@ -USE test; -DROP TABLE IF EXISTS test.country_info; - -CREATE TABLE country_info ( - `Country Code` INTEGER, - Name VARCHAR(100), - `ISO 3166` VARCHAR(10) -); -INSERT INTO country_info values ('1', 'Bolivia, Plurinational State of', 'BO'); -INSERT INTO country_info values ('2', 'Ireland', 'IE'); -INSERT INTO country_info values ('3', 'Saint Martin (French part)', 'MF'); diff --git a/src/test/resources/rml-core/RMLTC0010c-PostgreSQL/mapping.ttl b/src/test/resources/rml-core/RMLTC0010c-PostgreSQL/mapping.ttl deleted file mode 100644 index 932ed73c..00000000 --- a/src/test/resources/rml-core/RMLTC0010c-PostgreSQL/mapping.ttl +++ /dev/null @@ -1,26 +0,0 @@ -@prefix d2rq: . -@prefix ex: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source ; - rml:referenceFormulation rml:SQL2008Table; - rml:iterator "country_info" - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:template "\\{\\{\\{ {ISO 3166} \\}\\}\\}"; - rml:termType rml:Literal - ]; - rml:predicate ex:code - ]; - rml:subjectMap [ - rml:template "http://example.com/{Country Code}/{Name}" - ] . - - a d2rq:Database; - d2rq:jdbcDSN "CONNECTIONDSN"; - d2rq:jdbcDriver "org.postgresql.Driver"; - d2rq:password ""; - d2rq:username "postgres" . diff --git a/src/test/resources/rml-core/RMLTC0010c-PostgreSQL/output.nq b/src/test/resources/rml-core/RMLTC0010c-PostgreSQL/output.nq deleted file mode 100644 index 5c7e1080..00000000 --- a/src/test/resources/rml-core/RMLTC0010c-PostgreSQL/output.nq +++ /dev/null @@ -1,4 +0,0 @@ - "{{{ BO }}}" . - "{{{ IE }}}" . - "{{{ MF }}}" . - diff --git a/src/test/resources/rml-core/RMLTC0010c-PostgreSQL/resource.sql b/src/test/resources/rml-core/RMLTC0010c-PostgreSQL/resource.sql deleted file mode 100644 index 12f1652d..00000000 --- a/src/test/resources/rml-core/RMLTC0010c-PostgreSQL/resource.sql +++ /dev/null @@ -1,10 +0,0 @@ -DROP TABLE IF EXISTS country_info; - -CREATE TABLE country_info ( - "Country Code" INTEGER, - "Name" VARCHAR(100), - "ISO 3166" VARCHAR(10) -); -INSERT INTO country_info values ('1', 'Bolivia, Plurinational State of', 'BO'); -INSERT INTO country_info values ('2', 'Ireland', 'IE'); -INSERT INTO country_info values ('3', 'Saint Martin (French part)', 'MF'); diff --git a/src/test/resources/rml-core/RMLTC0010c-SQLServer/mapping.ttl b/src/test/resources/rml-core/RMLTC0010c-SQLServer/mapping.ttl deleted file mode 100644 index 8a72f22a..00000000 --- a/src/test/resources/rml-core/RMLTC0010c-SQLServer/mapping.ttl +++ /dev/null @@ -1,26 +0,0 @@ -@prefix d2rq: . -@prefix ex: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source ; - rml:referenceFormulation rml:SQL2008Table; - rml:iterator "country_info" - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:template "\\{\\{\\{ {ISO 3166} \\}\\}\\}"; - rml:termType rml:Literal - ]; - rml:predicate ex:code - ]; - rml:subjectMap [ - rml:template "http://example.com/{Country Code}/{Name}" - ] . - - a d2rq:Database; - d2rq:jdbcDSN "CONNECTIONDSN"; - d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver"; - d2rq:password "YourSTRONG!Passw0rd;"; - d2rq:username "sa" . diff --git a/src/test/resources/rml-core/RMLTC0010c-SQLServer/output.nq b/src/test/resources/rml-core/RMLTC0010c-SQLServer/output.nq deleted file mode 100644 index 5c7e1080..00000000 --- a/src/test/resources/rml-core/RMLTC0010c-SQLServer/output.nq +++ /dev/null @@ -1,4 +0,0 @@ - "{{{ BO }}}" . - "{{{ IE }}}" . - "{{{ MF }}}" . - diff --git a/src/test/resources/rml-core/RMLTC0010c-SQLServer/resource.sql b/src/test/resources/rml-core/RMLTC0010c-SQLServer/resource.sql deleted file mode 100644 index 8c20c7bc..00000000 --- a/src/test/resources/rml-core/RMLTC0010c-SQLServer/resource.sql +++ /dev/null @@ -1,11 +0,0 @@ -USE TestDB; -DROP TABLE IF EXISTS country_info; - -CREATE TABLE country_info ( - "Country Code" INTEGER, - "Name" VARCHAR(100), - "ISO 3166" VARCHAR(10) -); -INSERT INTO country_info values ('1', 'Bolivia, Plurinational State of', 'BO'); -INSERT INTO country_info values ('2', 'Ireland', 'IE'); -INSERT INTO country_info values ('3', 'Saint Martin (French part)', 'MF'); diff --git a/src/test/resources/rml-core/RMLTC0010c-XML/country_info.xml b/src/test/resources/rml-core/RMLTC0010c-XML/country_info.xml deleted file mode 100644 index c47aa6ab..00000000 --- a/src/test/resources/rml-core/RMLTC0010c-XML/country_info.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - 1 - Bolivia, Plurinational State of - BO - - - 2 - Ireland - IE - - - 3 - Saint Martin (French part) - MF - - - diff --git a/src/test/resources/rml-core/RMLTC0010c-XML/mapping.ttl b/src/test/resources/rml-core/RMLTC0010c-XML/mapping.ttl deleted file mode 100644 index 4ecb5718..00000000 --- a/src/test/resources/rml-core/RMLTC0010c-XML/mapping.ttl +++ /dev/null @@ -1,22 +0,0 @@ -@prefix ex: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator "/countries/country"; - rml:referenceFormulation rml:XPath; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "country_info.xml" - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:template "\\{\\{\\{ {ISO3166} \\}\\}\\}"; - rml:termType rml:Literal - ]; - rml:predicate ex:code - ]; - rml:subjectMap [ - rml:template "http://example.com/{CountryCode}/{Name}" - ] . diff --git a/src/test/resources/rml-core/RMLTC0010c-XML/output.nq b/src/test/resources/rml-core/RMLTC0010c-XML/output.nq deleted file mode 100644 index 5c7e1080..00000000 --- a/src/test/resources/rml-core/RMLTC0010c-XML/output.nq +++ /dev/null @@ -1,4 +0,0 @@ - "{{{ BO }}}" . - "{{{ IE }}}" . - "{{{ MF }}}" . - diff --git a/src/test/resources/rml-core/RMLTC0011a-MySQL/mapping.ttl b/src/test/resources/rml-core/RMLTC0011a-MySQL/mapping.ttl deleted file mode 100644 index b99f63b0..00000000 --- a/src/test/resources/rml-core/RMLTC0011a-MySQL/mapping.ttl +++ /dev/null @@ -1,72 +0,0 @@ -@prefix d2rq: . -@prefix ex: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator """ - SELECT Student.ID as ID, - Student.FirstName as FirstName, - Student.LastName as LastName, - Sport.Description as Description, - Sport.ID as Sport_ID - FROM Student,Sport,Student_Sport - WHERE Student.ID = Student_Sport.ID_Student - AND Sport.ID = Student_Sport.ID_Sport; - """; - rml:referenceFormulation rml:SQL2008Query; - rml:source - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "ID" - ]; - rml:predicate ex:id - ], [ - rml:objectMap [ - rml:reference "FirstName" - ]; - rml:predicate ex:firstName - ], [ - rml:objectMap [ - rml:reference "LastName" - ]; - rml:predicate ex:lastName - ], [ - rml:objectMap [ - rml:template "http://example.com/{Sport_ID}/{Description}" - ]; - rml:predicate ex:plays - ]; - rml:subjectMap [ - rml:template "http://example.com/{ID}/{FirstName};{LastName}" - ] . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator """ - SELECT * FROM Sport; - """; - rml:referenceFormulation rml:SQL2008Query; - rml:source - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "ID" - ]; - rml:predicate ex:id - ], [ - rml:objectMap [ - rml:reference "Description" - ]; - rml:predicate ex:description - ]; - rml:subjectMap [ - rml:template "http://example.com/{ID}/{Description}" - ] . - - a d2rq:Database; - d2rq:jdbcDSN "CONNECTIONDSN"; - d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver"; - d2rq:password ""; - d2rq:username "root" . diff --git a/src/test/resources/rml-core/RMLTC0011a-MySQL/output.nq b/src/test/resources/rml-core/RMLTC0011a-MySQL/output.nq deleted file mode 100644 index 8d0bda97..00000000 --- a/src/test/resources/rml-core/RMLTC0011a-MySQL/output.nq +++ /dev/null @@ -1,20 +0,0 @@ - "Tennis" . - "110"^^ . - . - "Williams" . - "Venus" . - "10"^^ . - "Football" . - "111"^^ . - . - "Villa" . - "David" . - "12"^^ . - "Formula1" . - "112"^^ . - "Alonso" . - "Fernando" . - "11"^^ . - . - . - diff --git a/src/test/resources/rml-core/RMLTC0011a-MySQL/resource.sql b/src/test/resources/rml-core/RMLTC0011a-MySQL/resource.sql deleted file mode 100644 index d5806a68..00000000 --- a/src/test/resources/rml-core/RMLTC0011a-MySQL/resource.sql +++ /dev/null @@ -1,36 +0,0 @@ -USE test; -SET FOREIGN_KEY_CHECKS = 0; -DROP TABLE IF EXISTS test.Student_Sport; -DROP TABLE IF EXISTS test.Sport; -DROP TABLE IF EXISTS test.Student; -SET FOREIGN_KEY_CHECKS = 1; - -CREATE TABLE Student ( -ID integer PRIMARY KEY, -FirstName varchar(50), -LastName varchar(50) -); -CREATE TABLE Sport ( -ID integer PRIMARY KEY, -Description varchar(50) -); -CREATE TABLE Student_Sport ( -ID_Student integer, -ID_Sport integer, -PRIMARY KEY (ID_Student,ID_Sport), -FOREIGN KEY (ID_Student) REFERENCES Student(ID), -FOREIGN KEY (ID_Sport) REFERENCES Sport(ID) -); - -INSERT INTO Student (ID,FirstName,LastName) VALUES (10,'Venus', 'Williams'); -INSERT INTO Student (ID,FirstName,LastName) VALUES (11,'Fernando', 'Alonso'); -INSERT INTO Student (ID,FirstName,LastName) VALUES (12,'David', 'Villa'); - -INSERT INTO Sport (ID, Description) VALUES (110,'Tennis'); -INSERT INTO Sport (ID, Description) VALUES (111,'Football'); -INSERT INTO Sport (ID, Description) VALUES (112,'Formula1'); - -INSERT INTO Student_Sport (ID_Student, ID_Sport) VALUES (10,110); -INSERT INTO Student_Sport (ID_Student, ID_Sport) VALUES (11,111); -INSERT INTO Student_Sport (ID_Student, ID_Sport) VALUES (11,112); -INSERT INTO Student_Sport (ID_Student, ID_Sport) VALUES (12,111); diff --git a/src/test/resources/rml-core/RMLTC0011a-PostgreSQL/mapping.ttl b/src/test/resources/rml-core/RMLTC0011a-PostgreSQL/mapping.ttl deleted file mode 100644 index 00faefd1..00000000 --- a/src/test/resources/rml-core/RMLTC0011a-PostgreSQL/mapping.ttl +++ /dev/null @@ -1,72 +0,0 @@ -@prefix d2rq: . -@prefix ex: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator """ - SELECT Student.ID as ID, - Student.FirstName as FirstName, - Student.LastName as LastName, - Sport.Description as Description, - Sport.ID as Sport_ID - FROM Student,Sport,Student_Sport - WHERE Student.ID = Student_Sport.ID_Student - AND Sport.ID = Student_Sport.ID_Sport; - """; - rml:referenceFormulation rml:SQL2008Query; - rml:source - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "id" - ]; - rml:predicate ex:id - ], [ - rml:objectMap [ - rml:reference "firstname" - ]; - rml:predicate ex:firstName - ], [ - rml:objectMap [ - rml:reference "lastname" - ]; - rml:predicate ex:lastName - ], [ - rml:objectMap [ - rml:template "http://example.com/{sport_id}/{description}" - ]; - rml:predicate ex:plays - ]; - rml:subjectMap [ - rml:template "http://example.com/{id}/{firstname};{lastname}" - ] . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator """ - SELECT * FROM Sport ; - """; - rml:referenceFormulation rml:SQL2008Query; - rml:source - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "id" - ]; - rml:predicate ex:id - ], [ - rml:objectMap [ - rml:reference "description" - ]; - rml:predicate ex:description - ]; - rml:subjectMap [ - rml:template "http://example.com/{id}/{description}" - ] . - - a d2rq:Database; - d2rq:jdbcDSN "CONNECTIONDSN"; - d2rq:jdbcDriver "org.postgresql.Driver"; - d2rq:password ""; - d2rq:username "postgres" . diff --git a/src/test/resources/rml-core/RMLTC0011a-PostgreSQL/output.nq b/src/test/resources/rml-core/RMLTC0011a-PostgreSQL/output.nq deleted file mode 100644 index 8d0bda97..00000000 --- a/src/test/resources/rml-core/RMLTC0011a-PostgreSQL/output.nq +++ /dev/null @@ -1,20 +0,0 @@ - "Tennis" . - "110"^^ . - . - "Williams" . - "Venus" . - "10"^^ . - "Football" . - "111"^^ . - . - "Villa" . - "David" . - "12"^^ . - "Formula1" . - "112"^^ . - "Alonso" . - "Fernando" . - "11"^^ . - . - . - diff --git a/src/test/resources/rml-core/RMLTC0011a-PostgreSQL/resource.sql b/src/test/resources/rml-core/RMLTC0011a-PostgreSQL/resource.sql deleted file mode 100644 index a256aa31..00000000 --- a/src/test/resources/rml-core/RMLTC0011a-PostgreSQL/resource.sql +++ /dev/null @@ -1,33 +0,0 @@ -DROP TABLE IF EXISTS Student_Sport; -DROP TABLE IF EXISTS Sport CASCADE; -DROP TABLE IF EXISTS Student; - -CREATE TABLE Student ( -ID integer PRIMARY KEY, -FirstName varchar(50), -LastName varchar(50) -); -CREATE TABLE Sport ( -ID integer PRIMARY KEY, -Description varchar(50) -); -CREATE TABLE Student_Sport ( -ID_Student integer, -ID_Sport integer, -PRIMARY KEY (ID_Student,ID_Sport), -FOREIGN KEY (ID_Student) REFERENCES Student(ID), -FOREIGN KEY (ID_Sport) REFERENCES Sport(ID) -); - -INSERT INTO Student (ID,FirstName,LastName) VALUES (10,'Venus', 'Williams'); -INSERT INTO Student (ID,FirstName,LastName) VALUES (11,'Fernando', 'Alonso'); -INSERT INTO Student (ID,FirstName,LastName) VALUES (12,'David', 'Villa'); - -INSERT INTO Sport (ID, Description) VALUES (110,'Tennis'); -INSERT INTO Sport (ID, Description) VALUES (111,'Football'); -INSERT INTO Sport (ID, Description) VALUES (112,'Formula1'); - -INSERT INTO Student_Sport (ID_Student, ID_Sport) VALUES (10,110); -INSERT INTO Student_Sport (ID_Student, ID_Sport) VALUES (11,111); -INSERT INTO Student_Sport (ID_Student, ID_Sport) VALUES (11,112); -INSERT INTO Student_Sport (ID_Student, ID_Sport) VALUES (12,111); diff --git a/src/test/resources/rml-core/RMLTC0011a-SQLServer/mapping.ttl b/src/test/resources/rml-core/RMLTC0011a-SQLServer/mapping.ttl deleted file mode 100644 index 1f3daafb..00000000 --- a/src/test/resources/rml-core/RMLTC0011a-SQLServer/mapping.ttl +++ /dev/null @@ -1,72 +0,0 @@ -@prefix d2rq: . -@prefix ex: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator """ - SELECT Student.ID as ID, - Student.FirstName as FirstName, - Student.LastName as LastName, - Sport.Description as Description, - Sport.ID as Sport_ID - FROM Student,Sport,Student_Sport - WHERE Student.ID = Student_Sport.ID_Student - AND Sport.ID = Student_Sport.ID_Sport; - """; - rml:referenceFormulation rml:SQL2008Query; - rml:source - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "ID" - ]; - rml:predicate ex:id - ], [ - rml:objectMap [ - rml:reference "FirstName" - ]; - rml:predicate ex:firstName - ], [ - rml:objectMap [ - rml:reference "LastName" - ]; - rml:predicate ex:lastName - ], [ - rml:objectMap [ - rml:template "http://example.com/{Sport_ID}/{Description}" - ]; - rml:predicate ex:plays - ]; - rml:subjectMap [ - rml:template "http://example.com/{ID}/{FirstName};{LastName}" - ] . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator """ - SELECT * FROM Sport ; - """; - rml:referenceFormulation rml:SQL2008Query; - rml:source - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "ID" - ]; - rml:predicate ex:id - ], [ - rml:objectMap [ - rml:reference "Description" - ]; - rml:predicate ex:description - ]; - rml:subjectMap [ - rml:template "http://example.com/{ID}/{Description}" - ] . - - a d2rq:Database; - d2rq:jdbcDSN "CONNECTIONDSN"; - d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver"; - d2rq:password "YourSTRONG!Passw0rd;"; - d2rq:username "sa" . diff --git a/src/test/resources/rml-core/RMLTC0011a-SQLServer/output.nq b/src/test/resources/rml-core/RMLTC0011a-SQLServer/output.nq deleted file mode 100644 index 8d0bda97..00000000 --- a/src/test/resources/rml-core/RMLTC0011a-SQLServer/output.nq +++ /dev/null @@ -1,20 +0,0 @@ - "Tennis" . - "110"^^ . - . - "Williams" . - "Venus" . - "10"^^ . - "Football" . - "111"^^ . - . - "Villa" . - "David" . - "12"^^ . - "Formula1" . - "112"^^ . - "Alonso" . - "Fernando" . - "11"^^ . - . - . - diff --git a/src/test/resources/rml-core/RMLTC0011a-SQLServer/resource.sql b/src/test/resources/rml-core/RMLTC0011a-SQLServer/resource.sql deleted file mode 100644 index 0002c8ec..00000000 --- a/src/test/resources/rml-core/RMLTC0011a-SQLServer/resource.sql +++ /dev/null @@ -1,33 +0,0 @@ -USE TestDB; -EXEC sp_msforeachtable 'ALTER TABLE ? NOCHECK CONSTRAINT all' -EXEC sp_msforeachtable 'DROP TABLE ?' - -CREATE TABLE Student ( -ID integer PRIMARY KEY, -FirstName varchar(50), -LastName varchar(50) -); -CREATE TABLE Sport ( -ID integer PRIMARY KEY, -Description varchar(50) -); -CREATE TABLE Student_Sport ( -ID_Student integer, -ID_Sport integer, -PRIMARY KEY (ID_Student,ID_Sport), -FOREIGN KEY (ID_Student) REFERENCES Student(ID), -FOREIGN KEY (ID_Sport) REFERENCES Sport(ID) -); - -INSERT INTO Student (ID,FirstName,LastName) VALUES (10,'Venus', 'Williams'); -INSERT INTO Student (ID,FirstName,LastName) VALUES (11,'Fernando', 'Alonso'); -INSERT INTO Student (ID,FirstName,LastName) VALUES (12,'David', 'Villa'); - -INSERT INTO Sport (ID, Description) VALUES (110,'Tennis'); -INSERT INTO Sport (ID, Description) VALUES (111,'Football'); -INSERT INTO Sport (ID, Description) VALUES (112,'Formula1'); - -INSERT INTO Student_Sport (ID_Student, ID_Sport) VALUES (10,110); -INSERT INTO Student_Sport (ID_Student, ID_Sport) VALUES (11,111); -INSERT INTO Student_Sport (ID_Student, ID_Sport) VALUES (11,112); -INSERT INTO Student_Sport (ID_Student, ID_Sport) VALUES (12,111); diff --git a/src/test/resources/rml-core/RMLTC0011b-CSV/mapping.ttl b/src/test/resources/rml-core/RMLTC0011b-CSV/mapping.ttl deleted file mode 100644 index c2f079c6..00000000 --- a/src/test/resources/rml-core/RMLTC0011b-CSV/mapping.ttl +++ /dev/null @@ -1,66 +0,0 @@ -@prefix ex: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:referenceFormulation rml:CSV; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student_sport.csv" - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:template "http://example.com/sport/{ID_Sport}" - ]; - rml:predicate ex:plays - ]; - rml:subjectMap [ - rml:template "http://example.com/student/{ID_Student}" - ] . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:referenceFormulation rml:CSV; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.csv" - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "FirstName" - ]; - rml:predicate ex:firstName - ], [ - rml:objectMap [ - rml:reference "LastName" - ]; - rml:predicate ex:lastName - ]; - rml:subjectMap [ - rml:template "http://example.com/student/{ID}" - ] . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:referenceFormulation rml:CSV; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "sport.csv" - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "Description" - ]; - rml:predicate ex:description - ], [ - rml:objectMap [ - rml:reference "ID" - ]; - rml:predicate ex:id - ]; - rml:subjectMap [ - rml:template "http://example.com/sport/{ID}" - ] . diff --git a/src/test/resources/rml-core/RMLTC0011b-CSV/output.nq b/src/test/resources/rml-core/RMLTC0011b-CSV/output.nq deleted file mode 100644 index d2759cec..00000000 --- a/src/test/resources/rml-core/RMLTC0011b-CSV/output.nq +++ /dev/null @@ -1,17 +0,0 @@ - "Williams" . - "Venus" . - "Villa" . - "David" . - "Alonso" . - "Fernando" . - "Tennis" . - "110" . - "Football" . - "111" . - "Formula1" . - "112" . - . - . - . - . - diff --git a/src/test/resources/rml-core/RMLTC0011b-CSV/sport.csv b/src/test/resources/rml-core/RMLTC0011b-CSV/sport.csv deleted file mode 100644 index 98446d06..00000000 --- a/src/test/resources/rml-core/RMLTC0011b-CSV/sport.csv +++ /dev/null @@ -1,4 +0,0 @@ -ID,Description -110,Tennis -111,Football -112,Formula1 diff --git a/src/test/resources/rml-core/RMLTC0011b-CSV/student.csv b/src/test/resources/rml-core/RMLTC0011b-CSV/student.csv deleted file mode 100644 index acf08c28..00000000 --- a/src/test/resources/rml-core/RMLTC0011b-CSV/student.csv +++ /dev/null @@ -1,4 +0,0 @@ -ID,FirstName,LastName -10,Venus,Williams -11,Fernando,Alonso -12,David,Villa diff --git a/src/test/resources/rml-core/RMLTC0011b-CSV/student_sport.csv b/src/test/resources/rml-core/RMLTC0011b-CSV/student_sport.csv deleted file mode 100644 index 381e9213..00000000 --- a/src/test/resources/rml-core/RMLTC0011b-CSV/student_sport.csv +++ /dev/null @@ -1,5 +0,0 @@ -ID_Student,ID_Sport -10,110 -11,111 -11,112 -12,111 diff --git a/src/test/resources/rml-core/RMLTC0011b-JSON/README.md b/src/test/resources/rml-core/RMLTC0011b-JSON/README.md new file mode 100644 index 00000000..8df6890d --- /dev/null +++ b/src/test/resources/rml-core/RMLTC0011b-JSON/README.md @@ -0,0 +1,143 @@ +## RMLTC0011b-JSON + +**Title**: "M to M relation, by using an additional Triples Map" + +**Description**: "Tests, M to M relations, by using an additional Triples Map" + +**Default Base IRI**: http://example.com/ + +**Error expected?** No + +**Input** +``` +{ + "students": [ + {"ID":10, "FirstName":"Venus", "LastName":"Williams"}, + {"ID":11, "FirstName":"Fernando", "LastName":"Alonso"}, + {"ID":12, "FirstName":"David", "LastName":"Villa"} + ] +} + +``` + +**Input 1** +``` +{ + "sports": [ + {"ID":110, "Description":"Tennis"}, + {"ID":111, "Description":"Football"}, + {"ID":112, "Description":"Formula1"} + ] +} + +``` + +**Input 2** +``` +{ + "links": [ + {"ID_Student":10, "ID_Sport":110}, + {"ID_Student":11, "ID_Sport":111}, + {"ID_Student":11, "ID_Sport":112}, + {"ID_Student":12, "ID_Sport":111} + ] +} + +``` + +**Mapping** +``` +@prefix ex: . +@prefix rml: . + + a rml:TriplesMap; + rml:logicalSource [ a rml:LogicalSource; + rml:iterator "$.links[*]"; + rml:referenceFormulation rml:JSONPath; + rml:source [ a rml:RelativePathSource; + rml:root rml:MappingDirectory; + rml:path "student_sport.json" + ] + ]; + rml:predicateObjectMap [ + rml:objectMap [ + rml:template "http://example.com/sport/{$.ID_Sport}" + ]; + rml:predicate ex:plays + ]; + rml:subjectMap [ + rml:template "http://example.com/student/{$.ID_Student}" + ] . + + a rml:TriplesMap; + rml:logicalSource [ a rml:LogicalSource; + rml:iterator "$.students[*]"; + rml:referenceFormulation rml:JSONPath; + rml:source [ a rml:RelativePathSource; + rml:root rml:MappingDirectory; + rml:path "student.json" + ] + ]; + rml:predicateObjectMap [ + rml:objectMap [ + rml:reference "$.FirstName" + ]; + rml:predicate ex:firstName + ], [ + rml:objectMap [ + rml:reference "$.LastName" + ]; + rml:predicate ex:lastName + ]; + rml:subjectMap [ + rml:template "http://example.com/student/{$.ID}" + ] . + + a rml:TriplesMap; + rml:logicalSource [ a rml:LogicalSource; + rml:iterator "$.sports[*]"; + rml:referenceFormulation rml:JSONPath; + rml:source [ a rml:RelativePathSource; + rml:root rml:MappingDirectory; + rml:path "sport.json" + ] + ]; + rml:predicateObjectMap [ + rml:objectMap [ + rml:reference "$.Description" + ]; + rml:predicate ex:description + ], [ + rml:objectMap [ + rml:reference "$.ID" + ]; + rml:predicate ex:id + ]; + rml:subjectMap [ + rml:template "http://example.com/sport/{$.ID}" + ] . + +``` + +**Output** +``` + "Williams" . + "Venus" . + "Villa" . + "David" . + "Alonso" . + "Fernando" . + "Tennis" . + "110"^^ . + "Football" . + "111"^^ . + "Formula1" . + "112"^^ . + . + . + . + . + + +``` + diff --git a/src/test/resources/rml-core/RMLTC0011b-JSON/mapping.ttl b/src/test/resources/rml-core/RMLTC0011b-JSON/mapping.ttl index 17da3046..29ba8387 100644 --- a/src/test/resources/rml-core/RMLTC0011b-JSON/mapping.ttl +++ b/src/test/resources/rml-core/RMLTC0011b-JSON/mapping.ttl @@ -12,12 +12,12 @@ ]; rml:predicateObjectMap [ rml:objectMap [ - rml:template "http://example.com/sport/{ID_Sport}" + rml:template "http://example.com/sport/{$.ID_Sport}" ]; rml:predicate ex:plays ]; rml:subjectMap [ - rml:template "http://example.com/student/{ID_Student}" + rml:template "http://example.com/student/{$.ID_Student}" ] . a rml:TriplesMap; @@ -31,17 +31,17 @@ ]; rml:predicateObjectMap [ rml:objectMap [ - rml:reference "FirstName" + rml:reference "$.FirstName" ]; rml:predicate ex:firstName ], [ rml:objectMap [ - rml:reference "LastName" + rml:reference "$.LastName" ]; rml:predicate ex:lastName ]; rml:subjectMap [ - rml:template "http://example.com/student/{ID}" + rml:template "http://example.com/student/{$.ID}" ] . a rml:TriplesMap; @@ -55,15 +55,15 @@ ]; rml:predicateObjectMap [ rml:objectMap [ - rml:reference "Description" + rml:reference "$.Description" ]; rml:predicate ex:description ], [ rml:objectMap [ - rml:reference "ID" + rml:reference "$.ID" ]; rml:predicate ex:id ]; rml:subjectMap [ - rml:template "http://example.com/sport/{ID}" + rml:template "http://example.com/sport/{$.ID}" ] . diff --git a/src/test/resources/rml-core/RMLTC0011b-JSON/output.nq b/src/test/resources/rml-core/RMLTC0011b-JSON/output.nq index d2759cec..6a82565e 100644 --- a/src/test/resources/rml-core/RMLTC0011b-JSON/output.nq +++ b/src/test/resources/rml-core/RMLTC0011b-JSON/output.nq @@ -5,11 +5,11 @@ "Alonso" . "Fernando" . "Tennis" . - "110" . + "110"^^ . "Football" . - "111" . + "111"^^ . "Formula1" . - "112" . + "112"^^ . . . . diff --git a/src/test/resources/rml-core/RMLTC0011b-MySQL/mapping.ttl b/src/test/resources/rml-core/RMLTC0011b-MySQL/mapping.ttl deleted file mode 100644 index c2c696bc..00000000 --- a/src/test/resources/rml-core/RMLTC0011b-MySQL/mapping.ttl +++ /dev/null @@ -1,67 +0,0 @@ -@prefix d2rq: . -@prefix ex: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source ; - rml:referenceFormulation rml:SQL2008Table; - rml:iterator "student_sport" - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:template "http://example.com/sport/{ID_Sport}" - ]; - rml:predicate ex:plays - ]; - rml:subjectMap [ - rml:template "http://example.com/student/{ID_Student}" - ] . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source ; - rml:referenceFormulation rml:SQL2008Table; - rml:iterator "student" - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "FirstName" - ]; - rml:predicate ex:firstName - ], [ - rml:objectMap [ - rml:reference "LastName" - ]; - rml:predicate ex:lastName - ]; - rml:subjectMap [ - rml:template "http://example.com/student/{ID}" - ] . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source ; - rml:referenceFormulation rml:SQL2008Table; - rml:iterator "sport" - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "Description" - ]; - rml:predicate ex:description - ], [ - rml:objectMap [ - rml:reference "ID" - ]; - rml:predicate ex:id - ]; - rml:subjectMap [ - rml:template "http://example.com/sport/{ID}" - ] . - - a d2rq:Database; - d2rq:jdbcDSN "CONNECTIONDSN"; - d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver"; - d2rq:password ""; - d2rq:username "root" . diff --git a/src/test/resources/rml-core/RMLTC0011b-MySQL/output.nq b/src/test/resources/rml-core/RMLTC0011b-MySQL/output.nq deleted file mode 100644 index 6a82565e..00000000 --- a/src/test/resources/rml-core/RMLTC0011b-MySQL/output.nq +++ /dev/null @@ -1,17 +0,0 @@ - "Williams" . - "Venus" . - "Villa" . - "David" . - "Alonso" . - "Fernando" . - "Tennis" . - "110"^^ . - "Football" . - "111"^^ . - "Formula1" . - "112"^^ . - . - . - . - . - diff --git a/src/test/resources/rml-core/RMLTC0011b-MySQL/resource.sql b/src/test/resources/rml-core/RMLTC0011b-MySQL/resource.sql deleted file mode 100644 index 5e3ce10b..00000000 --- a/src/test/resources/rml-core/RMLTC0011b-MySQL/resource.sql +++ /dev/null @@ -1,34 +0,0 @@ -USE test; -SET FOREIGN_KEY_CHECKS = 0; -DROP TABLE IF EXISTS test.student_sport; -DROP TABLE IF EXISTS test.student; -DROP TABLE IF EXISTS test.sport; -SET FOREIGN_KEY_CHECKS = 1; - -CREATE TABLE sport ( - ID INTEGER, - Description VARCHAR(200) -); -INSERT INTO sport values ('110','Tennis'); -INSERT INTO sport values ('111','Football'); -INSERT INTO sport values ('112','Formula1'); - - -CREATE TABLE student ( - ID INTEGER, - FirstName VARCHAR(200), - LastName VARCHAR(200) -); -INSERT INTO student values ('10','Venus','Williams'); -INSERT INTO student values ('11','Fernando','Alonso'); -INSERT INTO student values ('12','David','Villa'); - - -CREATE TABLE student_sport ( - ID_Student INTEGER, - ID_Sport INTEGER -); -INSERT INTO student_sport values ('10', '110'); -INSERT INTO student_sport values ('11','111'); -INSERT INTO student_sport values ('11','112'); -INSERT INTO student_sport values ('12','111'); diff --git a/src/test/resources/rml-core/RMLTC0011b-PostgreSQL/mapping.ttl b/src/test/resources/rml-core/RMLTC0011b-PostgreSQL/mapping.ttl deleted file mode 100644 index 6accd44c..00000000 --- a/src/test/resources/rml-core/RMLTC0011b-PostgreSQL/mapping.ttl +++ /dev/null @@ -1,67 +0,0 @@ -@prefix d2rq: . -@prefix ex: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source ; - rml:referenceFormulation rml:SQL2008Table; - rml:iterator "student_sport" - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:template "http://example.com/sport/{id_sport}" - ]; - rml:predicate ex:plays - ]; - rml:subjectMap [ - rml:template "http://example.com/student/{id_student}" - ] . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source ; - rml:referenceFormulation rml:SQL2008Table; - rml:iterator "student" - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "firstname" - ]; - rml:predicate ex:firstName - ], [ - rml:objectMap [ - rml:reference "lastname" - ]; - rml:predicate ex:lastName - ]; - rml:subjectMap [ - rml:template "http://example.com/student/{id}" - ] . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source ; - rml:referenceFormulation rml:SQL2008Table; - rml:iterator "sport" - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "description" - ]; - rml:predicate ex:description - ], [ - rml:objectMap [ - rml:reference "id" - ]; - rml:predicate ex:id - ]; - rml:subjectMap [ - rml:template "http://example.com/sport/{id}" - ] . - - a d2rq:Database; - d2rq:jdbcDSN "CONNECTIONDSN"; - d2rq:jdbcDriver "org.postgresql.Driver"; - d2rq:password ""; - d2rq:username "postgres" . diff --git a/src/test/resources/rml-core/RMLTC0011b-PostgreSQL/output.nq b/src/test/resources/rml-core/RMLTC0011b-PostgreSQL/output.nq deleted file mode 100644 index 6a82565e..00000000 --- a/src/test/resources/rml-core/RMLTC0011b-PostgreSQL/output.nq +++ /dev/null @@ -1,17 +0,0 @@ - "Williams" . - "Venus" . - "Villa" . - "David" . - "Alonso" . - "Fernando" . - "Tennis" . - "110"^^ . - "Football" . - "111"^^ . - "Formula1" . - "112"^^ . - . - . - . - . - diff --git a/src/test/resources/rml-core/RMLTC0011b-PostgreSQL/resource.sql b/src/test/resources/rml-core/RMLTC0011b-PostgreSQL/resource.sql deleted file mode 100644 index acdc4aa1..00000000 --- a/src/test/resources/rml-core/RMLTC0011b-PostgreSQL/resource.sql +++ /dev/null @@ -1,31 +0,0 @@ -DROP TABLE IF EXISTS student_sport; -DROP TABLE IF EXISTS student; -DROP TABLE IF EXISTS sport; - -CREATE TABLE sport ( - ID INTEGER, - Description VARCHAR(200) -); -INSERT INTO sport values ('110','Tennis'); -INSERT INTO sport values ('111','Football'); -INSERT INTO sport values ('112','Formula1'); - - -CREATE TABLE student ( - ID INTEGER, - FirstName VARCHAR(200), - LastName VARCHAR(200) -); -INSERT INTO student values ('10','Venus','Williams'); -INSERT INTO student values ('11','Fernando','Alonso'); -INSERT INTO student values ('12','David','Villa'); - - -CREATE TABLE student_sport ( - ID_Student INTEGER, - ID_Sport INTEGER -); -INSERT INTO student_sport values ('10', '110'); -INSERT INTO student_sport values ('11','111'); -INSERT INTO student_sport values ('11','112'); -INSERT INTO student_sport values ('12','111'); diff --git a/src/test/resources/rml-core/RMLTC0011b-SQLServer/mapping.ttl b/src/test/resources/rml-core/RMLTC0011b-SQLServer/mapping.ttl deleted file mode 100644 index 192a0032..00000000 --- a/src/test/resources/rml-core/RMLTC0011b-SQLServer/mapping.ttl +++ /dev/null @@ -1,67 +0,0 @@ -@prefix d2rq: . -@prefix ex: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source ; - rml:referenceFormulation rml:SQL2008Table; - rml:iterator "student_sport" - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:template "http://example.com/sport/{ID_Sport}" - ]; - rml:predicate ex:plays - ]; - rml:subjectMap [ - rml:template "http://example.com/student/{ID_Student}" - ] . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source ; - rml:referenceFormulation rml:SQL2008Table; - rml:iterator "student" - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "FirstName" - ]; - rml:predicate ex:firstName - ], [ - rml:objectMap [ - rml:reference "LastName" - ]; - rml:predicate ex:lastName - ]; - rml:subjectMap [ - rml:template "http://example.com/student/{ID}" - ] . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source ; - rml:referenceFormulation rml:SQL2008Table; - rml:iterator "sport" - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "Description" - ]; - rml:predicate ex:description - ], [ - rml:objectMap [ - rml:reference "ID" - ]; - rml:predicate ex:id - ]; - rml:subjectMap [ - rml:template "http://example.com/sport/{ID}" - ] . - - a d2rq:Database; - d2rq:jdbcDSN "CONNECTIONDSN"; - d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver"; - d2rq:password "YourSTRONG!Passw0rd;"; - d2rq:username "sa" . diff --git a/src/test/resources/rml-core/RMLTC0011b-SQLServer/output.nq b/src/test/resources/rml-core/RMLTC0011b-SQLServer/output.nq deleted file mode 100644 index 6a82565e..00000000 --- a/src/test/resources/rml-core/RMLTC0011b-SQLServer/output.nq +++ /dev/null @@ -1,17 +0,0 @@ - "Williams" . - "Venus" . - "Villa" . - "David" . - "Alonso" . - "Fernando" . - "Tennis" . - "110"^^ . - "Football" . - "111"^^ . - "Formula1" . - "112"^^ . - . - . - . - . - diff --git a/src/test/resources/rml-core/RMLTC0011b-SQLServer/resource.sql b/src/test/resources/rml-core/RMLTC0011b-SQLServer/resource.sql deleted file mode 100644 index d7644c70..00000000 --- a/src/test/resources/rml-core/RMLTC0011b-SQLServer/resource.sql +++ /dev/null @@ -1,32 +0,0 @@ -USE TestDB; -DROP TABLE IF EXISTS student_sport; -DROP TABLE IF EXISTS student; -DROP TABLE IF EXISTS sport; - -CREATE TABLE sport ( - ID INTEGER, - Description VARCHAR(200) -); -INSERT INTO sport values ('110','Tennis'); -INSERT INTO sport values ('111','Football'); -INSERT INTO sport values ('112','Formula1'); - - -CREATE TABLE student ( - ID INTEGER, - FirstName VARCHAR(200), - LastName VARCHAR(200) -); -INSERT INTO student values ('10','Venus','Williams'); -INSERT INTO student values ('11','Fernando','Alonso'); -INSERT INTO student values ('12','David','Villa'); - - -CREATE TABLE student_sport ( - ID_Student INTEGER, - ID_Sport INTEGER -); -INSERT INTO student_sport values ('10', '110'); -INSERT INTO student_sport values ('11','111'); -INSERT INTO student_sport values ('11','112'); -INSERT INTO student_sport values ('12','111'); diff --git a/src/test/resources/rml-core/RMLTC0011b-XML/mapping.ttl b/src/test/resources/rml-core/RMLTC0011b-XML/mapping.ttl deleted file mode 100644 index decc7ad2..00000000 --- a/src/test/resources/rml-core/RMLTC0011b-XML/mapping.ttl +++ /dev/null @@ -1,69 +0,0 @@ -@prefix ex: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator "/links/link"; - rml:referenceFormulation rml:XPath; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student_sport.xml" - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:template "http://example.com/sport/{ID_Sport}" - ]; - rml:predicate ex:plays - ]; - rml:subjectMap [ - rml:template "http://example.com/student/{ID_Student}" - ] . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator "/Students/Student"; - rml:referenceFormulation rml:XPath; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.xml" - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "FirstName" - ]; - rml:predicate ex:firstName - ], [ - rml:objectMap [ - rml:reference "LastName" - ]; - rml:predicate ex:lastName - ]; - rml:subjectMap [ - rml:template "http://example.com/student/{ID}" - ] . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator "/Sports/Sport"; - rml:referenceFormulation rml:XPath; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "sport.xml" - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "Description" - ]; - rml:predicate ex:description - ], [ - rml:objectMap [ - rml:reference "ID" - ]; - rml:predicate ex:id - ]; - rml:subjectMap [ - rml:template "http://example.com/sport/{ID}" - ] . diff --git a/src/test/resources/rml-core/RMLTC0011b-XML/output.nq b/src/test/resources/rml-core/RMLTC0011b-XML/output.nq deleted file mode 100644 index d2759cec..00000000 --- a/src/test/resources/rml-core/RMLTC0011b-XML/output.nq +++ /dev/null @@ -1,17 +0,0 @@ - "Williams" . - "Venus" . - "Villa" . - "David" . - "Alonso" . - "Fernando" . - "Tennis" . - "110" . - "Football" . - "111" . - "Formula1" . - "112" . - . - . - . - . - diff --git a/src/test/resources/rml-core/RMLTC0011b-XML/sport.xml b/src/test/resources/rml-core/RMLTC0011b-XML/sport.xml deleted file mode 100644 index a44806ba..00000000 --- a/src/test/resources/rml-core/RMLTC0011b-XML/sport.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - 110 - Tennis - - - 111 - Football - - - 112 - Formula1 - - diff --git a/src/test/resources/rml-core/RMLTC0011b-XML/student.xml b/src/test/resources/rml-core/RMLTC0011b-XML/student.xml deleted file mode 100644 index 8d0a2ccd..00000000 --- a/src/test/resources/rml-core/RMLTC0011b-XML/student.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - 10 - Venus - Williams - - - 11 - Fernando - Alonso - - - 12 - David - Villa - - diff --git a/src/test/resources/rml-core/RMLTC0011b-XML/student_sport.xml b/src/test/resources/rml-core/RMLTC0011b-XML/student_sport.xml deleted file mode 100644 index 3eeb2e92..00000000 --- a/src/test/resources/rml-core/RMLTC0011b-XML/student_sport.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - 10 - 110 - - - 11 - 111 - - - 11 - 112 - - - 12 - 111 - - diff --git a/src/test/resources/rml-core/RMLTC0012a-CSV/mapping.ttl b/src/test/resources/rml-core/RMLTC0012a-CSV/mapping.ttl deleted file mode 100644 index 6500c2d7..00000000 --- a/src/test/resources/rml-core/RMLTC0012a-CSV/mapping.ttl +++ /dev/null @@ -1,28 +0,0 @@ -@prefix ex: . -@prefix foaf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:referenceFormulation rml:CSV; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "persons.csv" - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:template "{fname} {lname}"; - rml:termType rml:Literal - ]; - rml:predicate foaf:name - ], [ - rml:objectMap [ - rml:reference "amount" - ]; - rml:predicate ex:amount - ]; - rml:subjectMap [ - rml:template "{fname}{lname}{amount}"; - rml:termType rml:BlankNode - ] . diff --git a/src/test/resources/rml-core/RMLTC0012a-CSV/output.nq b/src/test/resources/rml-core/RMLTC0012a-CSV/output.nq deleted file mode 100644 index 7f9ce194..00000000 --- a/src/test/resources/rml-core/RMLTC0012a-CSV/output.nq +++ /dev/null @@ -1,5 +0,0 @@ -_:BobSmith30 "30" . -_:BobSmith30 "Bob Smith" . -_:SueJones20 "20" . -_:SueJones20 "Sue Jones" . - diff --git a/src/test/resources/rml-core/RMLTC0012a-CSV/persons.csv b/src/test/resources/rml-core/RMLTC0012a-CSV/persons.csv deleted file mode 100644 index 6d1909d9..00000000 --- a/src/test/resources/rml-core/RMLTC0012a-CSV/persons.csv +++ /dev/null @@ -1,4 +0,0 @@ -fname,lname,amount -Bob,Smith,30 -Sue,Jones,20 -Bob,Smith,30 diff --git a/src/test/resources/rml-core/RMLTC0012a-JSON/README.md b/src/test/resources/rml-core/RMLTC0012a-JSON/README.md new file mode 100644 index 00000000..95239e9c --- /dev/null +++ b/src/test/resources/rml-core/RMLTC0012a-JSON/README.md @@ -0,0 +1,66 @@ +## RMLTC0012a-JSON + +**Title**: "Blank node referencing multiple columns" + +**Description**: "Tests that blank nodes can be generated by referencing multiple columns" + +**Default Base IRI**: http://example.com/ + +**Error expected?** No + +**Input** +``` +{ + "persons": [ + {"fname":"Bob","lname":"Smith","amount":30}, + {"fname":"Sue","lname":"Jones","amount":20}, + {"fname":"Bob","lname":"Smith","amount":30} + ] +} + +``` + +**Mapping** +``` +@prefix ex: . +@prefix foaf: . +@prefix rml: . + + a rml:TriplesMap; + rml:logicalSource [ a rml:LogicalSource; + rml:iterator "$.persons[*]"; + rml:referenceFormulation rml:JSONPath; + rml:source [ a rml:RelativePathSource; + rml:root rml:MappingDirectory; + rml:path "persons.json" + ] + ]; + rml:predicateObjectMap [ + rml:objectMap [ + rml:template "{$.fname} {$.lname}"; + rml:termType rml:Literal + ]; + rml:predicate foaf:name + ], [ + rml:objectMap [ + rml:reference "$.amount" + ]; + rml:predicate ex:amount + ]; + rml:subjectMap [ + rml:template "{$.fname}{$.lname}{$.amount}"; + rml:termType rml:BlankNode + ] . + +``` + +**Output** +``` +_:BobSmith30 "30"^^ . +_:BobSmith30 "Bob Smith" . +_:SueJones20 "20"^^ . +_:SueJones20 "Sue Jones" . + + +``` + diff --git a/src/test/resources/rml-core/RMLTC0012a-JSON/mapping.ttl b/src/test/resources/rml-core/RMLTC0012a-JSON/mapping.ttl index 3db1ba6f..7caeb4cf 100644 --- a/src/test/resources/rml-core/RMLTC0012a-JSON/mapping.ttl +++ b/src/test/resources/rml-core/RMLTC0012a-JSON/mapping.ttl @@ -13,17 +13,17 @@ ]; rml:predicateObjectMap [ rml:objectMap [ - rml:template "{fname} {lname}"; + rml:template "{$.fname} {$.lname}"; rml:termType rml:Literal ]; rml:predicate foaf:name ], [ rml:objectMap [ - rml:reference "amount" + rml:reference "$.amount" ]; rml:predicate ex:amount ]; rml:subjectMap [ - rml:template "{fname}{lname}{amount}"; + rml:template "{$.fname}{$.lname}{$.amount}"; rml:termType rml:BlankNode ] . diff --git a/src/test/resources/rml-core/RMLTC0012a-JSON/output.nq b/src/test/resources/rml-core/RMLTC0012a-JSON/output.nq index 7f9ce194..62818b4c 100644 --- a/src/test/resources/rml-core/RMLTC0012a-JSON/output.nq +++ b/src/test/resources/rml-core/RMLTC0012a-JSON/output.nq @@ -1,5 +1,5 @@ -_:BobSmith30 "30" . +_:BobSmith30 "30"^^ . _:BobSmith30 "Bob Smith" . -_:SueJones20 "20" . +_:SueJones20 "20"^^ . _:SueJones20 "Sue Jones" . diff --git a/src/test/resources/rml-core/RMLTC0012a-MySQL/mapping.ttl b/src/test/resources/rml-core/RMLTC0012a-MySQL/mapping.ttl deleted file mode 100644 index c038ff8d..00000000 --- a/src/test/resources/rml-core/RMLTC0012a-MySQL/mapping.ttl +++ /dev/null @@ -1,33 +0,0 @@ -@prefix d2rq: . -@prefix ex: . -@prefix foaf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source ; - rml:referenceFormulation rml:SQL2008Table; - rml:iterator "IOUs" - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:template "{fname} {lname}"; - rml:termType rml:Literal - ]; - rml:predicate foaf:name - ], [ - rml:objectMap [ - rml:reference "amount" - ]; - rml:predicate ex:amount - ]; - rml:subjectMap [ - rml:template "{fname}_{lname}_{amount}"; - rml:termType rml:BlankNode - ] . - - a d2rq:Database; - d2rq:jdbcDSN "CONNECTIONDSN"; - d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver"; - d2rq:password ""; - d2rq:username "root" . diff --git a/src/test/resources/rml-core/RMLTC0012a-MySQL/output.nq b/src/test/resources/rml-core/RMLTC0012a-MySQL/output.nq deleted file mode 100644 index 10e4040a..00000000 --- a/src/test/resources/rml-core/RMLTC0012a-MySQL/output.nq +++ /dev/null @@ -1,5 +0,0 @@ -_:Bob_Smith_30 "30"^^ . -_:Bob_Smith_30 "Bob Smith" . -_:Sue_Jones_20 "20"^^ . -_:Sue_Jones_20 "Sue Jones" . - diff --git a/src/test/resources/rml-core/RMLTC0012a-MySQL/resource.sql b/src/test/resources/rml-core/RMLTC0012a-MySQL/resource.sql deleted file mode 100644 index 34ace06d..00000000 --- a/src/test/resources/rml-core/RMLTC0012a-MySQL/resource.sql +++ /dev/null @@ -1,19 +0,0 @@ -USE test; -DROP TABLE IF EXISTS test.IOUs; -DROP TABLE IF EXISTS test.Lives; - -CREATE TABLE IOUs ( - fname VARCHAR(20), - lname VARCHAR(20), - amount INT); -/* We replaced DOUBLE with INT, because the datatype conversion is different across databases, and this test case is not relevant to that aspect */ -INSERT INTO IOUs (fname, lname, amount) VALUES ('Bob', 'Smith', 30); -INSERT INTO IOUs (fname, lname, amount) VALUES ('Sue', 'Jones', 20); -INSERT INTO IOUs (fname, lname, amount) VALUES ('Bob', 'Smith', 30); -CREATE TABLE Lives ( - fname VARCHAR(20), - lname VARCHAR(20), - city VARCHAR(20)); -INSERT INTO Lives (fname, lname, city) VALUES ('Bob', 'Smith', 'London'); -INSERT INTO Lives (fname, lname, city) VALUES ('Sue', 'Jones', 'Madrid'); -INSERT INTO Lives (fname, lname, city) VALUES ('Bob', 'Smith', 'London'); diff --git a/src/test/resources/rml-core/RMLTC0012a-PostgreSQL/mapping.ttl b/src/test/resources/rml-core/RMLTC0012a-PostgreSQL/mapping.ttl deleted file mode 100644 index e126236d..00000000 --- a/src/test/resources/rml-core/RMLTC0012a-PostgreSQL/mapping.ttl +++ /dev/null @@ -1,33 +0,0 @@ -@prefix d2rq: . -@prefix ex: . -@prefix foaf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source ; - rml:referenceFormulation rml:SQL2008Table; - rml:iterator "IOUs" - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:template "{fname} {lname}"; - rml:termType rml:Literal - ]; - rml:predicate foaf:name - ], [ - rml:objectMap [ - rml:reference "amount" - ]; - rml:predicate ex:amount - ]; - rml:subjectMap [ - rml:template "{fname}_{lname}_{amount}"; - rml:termType rml:BlankNode - ] . - - a d2rq:Database; - d2rq:jdbcDSN "CONNECTIONDSN"; - d2rq:jdbcDriver "org.postgresql.Driver"; - d2rq:password ""; - d2rq:username "postgres" . diff --git a/src/test/resources/rml-core/RMLTC0012a-PostgreSQL/output.nq b/src/test/resources/rml-core/RMLTC0012a-PostgreSQL/output.nq deleted file mode 100644 index 10e4040a..00000000 --- a/src/test/resources/rml-core/RMLTC0012a-PostgreSQL/output.nq +++ /dev/null @@ -1,5 +0,0 @@ -_:Bob_Smith_30 "30"^^ . -_:Bob_Smith_30 "Bob Smith" . -_:Sue_Jones_20 "20"^^ . -_:Sue_Jones_20 "Sue Jones" . - diff --git a/src/test/resources/rml-core/RMLTC0012a-PostgreSQL/resource.sql b/src/test/resources/rml-core/RMLTC0012a-PostgreSQL/resource.sql deleted file mode 100644 index af98da75..00000000 --- a/src/test/resources/rml-core/RMLTC0012a-PostgreSQL/resource.sql +++ /dev/null @@ -1,17 +0,0 @@ -DROP TABLE IF EXISTS IOUs; -DROP TABLE IF EXISTS Lives; - -CREATE TABLE IOUs ( - fname VARCHAR(20), - lname VARCHAR(20), - amount INT); -INSERT INTO IOUs (fname, lname, amount) VALUES ('Bob', 'Smith', 30); -INSERT INTO IOUs (fname, lname, amount) VALUES ('Sue', 'Jones', 20); -INSERT INTO IOUs (fname, lname, amount) VALUES ('Bob', 'Smith', 30); -CREATE TABLE Lives ( - fname VARCHAR(20), - lname VARCHAR(20), - city VARCHAR(20)); -INSERT INTO Lives (fname, lname, city) VALUES ('Bob', 'Smith', 'London'); -INSERT INTO Lives (fname, lname, city) VALUES ('Sue', 'Jones', 'Madrid'); -INSERT INTO Lives (fname, lname, city) VALUES ('Bob', 'Smith', 'London'); diff --git a/src/test/resources/rml-core/RMLTC0012a-SPARQL/mapping.ttl b/src/test/resources/rml-core/RMLTC0012a-SPARQL/mapping.ttl deleted file mode 100644 index 65c6092f..00000000 --- a/src/test/resources/rml-core/RMLTC0012a-SPARQL/mapping.ttl +++ /dev/null @@ -1,40 +0,0 @@ -@prefix ex: . -@prefix foaf: . -@prefix formats: . -@prefix rml: . -@prefix sd: . - - rml:logicalSource [ - rml:iterator """ - PREFIX rdfs: - PREFIX foaf: - PREFIX rdf: - SELECT ?fname ?lname ?amount - WHERE { - ?x foaf:firstName ?fname ; - foaf:lastName ?lname ; - ?amount . - } """; - rml:referenceFormulation formats:SPARQL_Results_JSON; - rml:source - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:template "{fname.value} {lname.value}"; - rml:termType rml:Literal - ]; - rml:predicate foaf:name - ], [ - rml:objectMap [ - rml:reference "amount.value" - ]; - rml:predicate ex:amount - ]; - rml:subjectMap [ - rml:template "{fname.value}{lname.value}{amount.value}"; - rml:termType rml:BlankNode - ] . - - a sd:Service; - sd:endpoint ; - sd:supportedLanguage sd:SPARQL11Query . diff --git a/src/test/resources/rml-core/RMLTC0012a-SPARQL/output.nq b/src/test/resources/rml-core/RMLTC0012a-SPARQL/output.nq deleted file mode 100644 index 7f9ce194..00000000 --- a/src/test/resources/rml-core/RMLTC0012a-SPARQL/output.nq +++ /dev/null @@ -1,5 +0,0 @@ -_:BobSmith30 "30" . -_:BobSmith30 "Bob Smith" . -_:SueJones20 "20" . -_:SueJones20 "Sue Jones" . - diff --git a/src/test/resources/rml-core/RMLTC0012a-SPARQL/resource.ttl b/src/test/resources/rml-core/RMLTC0012a-SPARQL/resource.ttl deleted file mode 100644 index 142bb85c..00000000 --- a/src/test/resources/rml-core/RMLTC0012a-SPARQL/resource.ttl +++ /dev/null @@ -1,15 +0,0 @@ -@prefix foaf: . -@prefix ns1: . - -[] ns1:amount "30" ; - foaf:firstName "Bob" ; - foaf:lastName "Smith" . - -[] ns1:amount "20" ; - foaf:firstName "Sue" ; - foaf:lastName "Jones" . - -[] ns1:amount "30" ; - foaf:firstName "Bob" ; - foaf:lastName "Smith" . - diff --git a/src/test/resources/rml-core/RMLTC0012a-SQLServer/mapping.ttl b/src/test/resources/rml-core/RMLTC0012a-SQLServer/mapping.ttl deleted file mode 100644 index be494b3a..00000000 --- a/src/test/resources/rml-core/RMLTC0012a-SQLServer/mapping.ttl +++ /dev/null @@ -1,33 +0,0 @@ -@prefix d2rq: . -@prefix ex: . -@prefix foaf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source ; - rml:referenceFormulation rml:SQL2008Table; - rml:iterator "IOUs" - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:template "{fname} {lname}"; - rml:termType rml:Literal - ]; - rml:predicate foaf:name - ], [ - rml:objectMap [ - rml:reference "amount" - ]; - rml:predicate ex:amount - ]; - rml:subjectMap [ - rml:template "{fname}_{lname}_{amount}"; - rml:termType rml:BlankNode - ] . - - a d2rq:Database; - d2rq:jdbcDSN "CONNECTIONDSN"; - d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver"; - d2rq:password "YourSTRONG!Passw0rd;"; - d2rq:username "sa" . diff --git a/src/test/resources/rml-core/RMLTC0012a-SQLServer/output.nq b/src/test/resources/rml-core/RMLTC0012a-SQLServer/output.nq deleted file mode 100644 index 10e4040a..00000000 --- a/src/test/resources/rml-core/RMLTC0012a-SQLServer/output.nq +++ /dev/null @@ -1,5 +0,0 @@ -_:Bob_Smith_30 "30"^^ . -_:Bob_Smith_30 "Bob Smith" . -_:Sue_Jones_20 "20"^^ . -_:Sue_Jones_20 "Sue Jones" . - diff --git a/src/test/resources/rml-core/RMLTC0012a-SQLServer/resource.sql b/src/test/resources/rml-core/RMLTC0012a-SQLServer/resource.sql deleted file mode 100644 index fecf09a9..00000000 --- a/src/test/resources/rml-core/RMLTC0012a-SQLServer/resource.sql +++ /dev/null @@ -1,19 +0,0 @@ -USE TestDB; -DROP TABLE IF EXISTS IOUs; -DROP TABLE IF EXISTS Lives; - -CREATE TABLE IOUs ( - fname VARCHAR(20), - lname VARCHAR(20), - amount INT); -/* We replaced DOUBLE with INT, because the datatype conversion is different across databases, and this test case is not relevant to that aspect */ -INSERT INTO IOUs (fname, lname, amount) VALUES ('Bob', 'Smith', 30); -INSERT INTO IOUs (fname, lname, amount) VALUES ('Sue', 'Jones', 20); -INSERT INTO IOUs (fname, lname, amount) VALUES ('Bob', 'Smith', 30); -CREATE TABLE Lives ( - fname VARCHAR(20), - lname VARCHAR(20), - city VARCHAR(20)); -INSERT INTO Lives (fname, lname, city) VALUES ('Bob', 'Smith', 'London'); -INSERT INTO Lives (fname, lname, city) VALUES ('Sue', 'Jones', 'Madrid'); -INSERT INTO Lives (fname, lname, city) VALUES ('Bob', 'Smith', 'London'); diff --git a/src/test/resources/rml-core/RMLTC0012a-XML/mapping.ttl b/src/test/resources/rml-core/RMLTC0012a-XML/mapping.ttl deleted file mode 100644 index cedf2559..00000000 --- a/src/test/resources/rml-core/RMLTC0012a-XML/mapping.ttl +++ /dev/null @@ -1,29 +0,0 @@ -@prefix ex: . -@prefix foaf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator "/Persons/Person"; - rml:referenceFormulation rml:XPath; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "persons.xml" - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:template "{fname} {lname}"; - rml:termType rml:Literal - ]; - rml:predicate foaf:name - ], [ - rml:objectMap [ - rml:reference "amount" - ]; - rml:predicate ex:amount - ]; - rml:subjectMap [ - rml:template "{fname}{lname}{amount}"; - rml:termType rml:BlankNode - ] . diff --git a/src/test/resources/rml-core/RMLTC0012a-XML/output.nq b/src/test/resources/rml-core/RMLTC0012a-XML/output.nq deleted file mode 100644 index 7f9ce194..00000000 --- a/src/test/resources/rml-core/RMLTC0012a-XML/output.nq +++ /dev/null @@ -1,5 +0,0 @@ -_:BobSmith30 "30" . -_:BobSmith30 "Bob Smith" . -_:SueJones20 "20" . -_:SueJones20 "Sue Jones" . - diff --git a/src/test/resources/rml-core/RMLTC0012a-XML/persons.xml b/src/test/resources/rml-core/RMLTC0012a-XML/persons.xml deleted file mode 100644 index 775d21eb..00000000 --- a/src/test/resources/rml-core/RMLTC0012a-XML/persons.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - Bob - Smith - 30 - - - Sue - Jones - 20 - - - Bob - Smith - 30 - - diff --git a/src/test/resources/rml-core/RMLTC0012b-CSV/lives.csv b/src/test/resources/rml-core/RMLTC0012b-CSV/lives.csv deleted file mode 100644 index d82b0a3a..00000000 --- a/src/test/resources/rml-core/RMLTC0012b-CSV/lives.csv +++ /dev/null @@ -1,4 +0,0 @@ -fname,lname,city -Bob,Smith,London -Sue,Jones,Madrid -Bob,Smith,London diff --git a/src/test/resources/rml-core/RMLTC0012b-CSV/mapping.ttl b/src/test/resources/rml-core/RMLTC0012b-CSV/mapping.ttl deleted file mode 100644 index 1b55acb8..00000000 --- a/src/test/resources/rml-core/RMLTC0012b-CSV/mapping.ttl +++ /dev/null @@ -1,42 +0,0 @@ -@prefix ex: . -@prefix foaf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:referenceFormulation rml:CSV; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "persons.csv" - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:template "{fname} {lname}"; - rml:termType rml:Literal - ]; - rml:predicate foaf:name - ]; - rml:subjectMap [ - rml:template "{fname}{lname}"; - rml:termType rml:BlankNode - ] . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:referenceFormulation rml:CSV; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "lives.csv" - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "city" - ]; - rml:predicate ex:city - ]; - rml:subjectMap [ - rml:template "{fname}{lname}"; - rml:termType rml:BlankNode - ] . diff --git a/src/test/resources/rml-core/RMLTC0012b-CSV/output.nq b/src/test/resources/rml-core/RMLTC0012b-CSV/output.nq deleted file mode 100644 index 0d556bbd..00000000 --- a/src/test/resources/rml-core/RMLTC0012b-CSV/output.nq +++ /dev/null @@ -1,5 +0,0 @@ -_:BobSmith "London" . -_:BobSmith "Bob Smith" . -_:SueJones "Madrid" . -_:SueJones "Sue Jones" . - diff --git a/src/test/resources/rml-core/RMLTC0012b-CSV/persons.csv b/src/test/resources/rml-core/RMLTC0012b-CSV/persons.csv deleted file mode 100644 index 6d1909d9..00000000 --- a/src/test/resources/rml-core/RMLTC0012b-CSV/persons.csv +++ /dev/null @@ -1,4 +0,0 @@ -fname,lname,amount -Bob,Smith,30 -Sue,Jones,20 -Bob,Smith,30 diff --git a/src/test/resources/rml-core/RMLTC0012b-JSON/README.md b/src/test/resources/rml-core/RMLTC0012b-JSON/README.md new file mode 100644 index 00000000..8f51b221 --- /dev/null +++ b/src/test/resources/rml-core/RMLTC0012b-JSON/README.md @@ -0,0 +1,93 @@ +## RMLTC0012b-JSON + +**Title**: "Duplicate tuples generate same blank node" + +**Description**: "Tests that blank nodes with same identifier and in the same graph but generated by different logical rows are considered equivalent." + +**Default Base IRI**: http://example.com/ + +**Error expected?** No + +**Input** +``` +{ + "lives": [ + {"fname":"Bob","lname":"Smith","city":"London"}, + {"fname":"Sue","lname":"Jones","city":"Madrid"}, + {"fname":"Bob","lname":"Smith","city":"London"} + ] +} + +``` + +**Input 1** +``` +{ + "persons": [ + {"fname":"Bob","lname":"Smith","amount":30}, + {"fname":"Sue","lname":"Jones","amount":20}, + {"fname":"Bob","lname":"Smith","amount":30} + ] +} + +``` + +**Mapping** +``` +@prefix ex: . +@prefix foaf: . +@prefix rml: . + + a rml:TriplesMap; + rml:logicalSource [ a rml:LogicalSource; + rml:iterator "$.persons[*]"; + rml:referenceFormulation rml:JSONPath; + rml:source [ a rml:RelativePathSource; + rml:root rml:MappingDirectory; + rml:path "persons.json" + ] + ]; + rml:predicateObjectMap [ + rml:objectMap [ + rml:template "{$.fname} {$.lname}"; + rml:termType rml:Literal + ]; + rml:predicate foaf:name + ]; + rml:subjectMap [ + rml:template "{$.fname}{$.lname}"; + rml:termType rml:BlankNode + ] . + + a rml:TriplesMap; + rml:logicalSource [ a rml:LogicalSource; + rml:iterator "$.lives[*]"; + rml:referenceFormulation rml:JSONPath; + rml:source [ a rml:RelativePathSource; + rml:root rml:MappingDirectory; + rml:path "lives.json" + ] + ]; + rml:predicateObjectMap [ + rml:objectMap [ + rml:reference "$.city" + ]; + rml:predicate ex:city + ]; + rml:subjectMap [ + rml:template "{$.fname}{$.lname}"; + rml:termType rml:BlankNode + ] . + +``` + +**Output** +``` +_:BobSmith "London" . +_:BobSmith "Bob Smith" . +_:SueJones "Madrid" . +_:SueJones "Sue Jones" . + + +``` + diff --git a/src/test/resources/rml-core/RMLTC0012b-JSON/mapping.ttl b/src/test/resources/rml-core/RMLTC0012b-JSON/mapping.ttl index c0cf0407..82aa3b30 100644 --- a/src/test/resources/rml-core/RMLTC0012b-JSON/mapping.ttl +++ b/src/test/resources/rml-core/RMLTC0012b-JSON/mapping.ttl @@ -13,13 +13,13 @@ ]; rml:predicateObjectMap [ rml:objectMap [ - rml:template "{fname} {lname}"; + rml:template "{$.fname} {$.lname}"; rml:termType rml:Literal ]; rml:predicate foaf:name ]; rml:subjectMap [ - rml:template "{fname}{lname}"; + rml:template "{$.fname}{$.lname}"; rml:termType rml:BlankNode ] . @@ -34,11 +34,11 @@ ]; rml:predicateObjectMap [ rml:objectMap [ - rml:reference "city" + rml:reference "$.city" ]; rml:predicate ex:city ]; rml:subjectMap [ - rml:template "{fname}{lname}"; + rml:template "{$.fname}{$.lname}"; rml:termType rml:BlankNode ] . diff --git a/src/test/resources/rml-core/RMLTC0012b-MySQL/mapping.ttl b/src/test/resources/rml-core/RMLTC0012b-MySQL/mapping.ttl deleted file mode 100644 index 985da040..00000000 --- a/src/test/resources/rml-core/RMLTC0012b-MySQL/mapping.ttl +++ /dev/null @@ -1,45 +0,0 @@ -@prefix d2rq: . -@prefix ex: . -@prefix foaf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source ; - rml:referenceFormulation rml:SQL2008Table; - rml:iterator "persons" - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:template "{fname} {lname}"; - rml:termType rml:Literal - ]; - rml:predicate foaf:name - ]; - rml:subjectMap [ - rml:template "{fname}{lname}"; - rml:termType rml:BlankNode - ] . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source ; - rml:referenceFormulation rml:SQL2008Table; - rml:iterator "lives" - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "city" - ]; - rml:predicate ex:city - ]; - rml:subjectMap [ - rml:template "{fname}{lname}"; - rml:termType rml:BlankNode - ] . - - a d2rq:Database; - d2rq:jdbcDSN "CONNECTIONDSN"; - d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver"; - d2rq:password ""; - d2rq:username "root" . diff --git a/src/test/resources/rml-core/RMLTC0012b-MySQL/output.nq b/src/test/resources/rml-core/RMLTC0012b-MySQL/output.nq deleted file mode 100644 index 0d556bbd..00000000 --- a/src/test/resources/rml-core/RMLTC0012b-MySQL/output.nq +++ /dev/null @@ -1,5 +0,0 @@ -_:BobSmith "London" . -_:BobSmith "Bob Smith" . -_:SueJones "Madrid" . -_:SueJones "Sue Jones" . - diff --git a/src/test/resources/rml-core/RMLTC0012b-MySQL/resource.sql b/src/test/resources/rml-core/RMLTC0012b-MySQL/resource.sql deleted file mode 100644 index 29ad8c68..00000000 --- a/src/test/resources/rml-core/RMLTC0012b-MySQL/resource.sql +++ /dev/null @@ -1,22 +0,0 @@ -USE test; -DROP TABLE IF EXISTS test.persons; - -CREATE TABLE persons ( - fname VARCHAR(200), - lname VARCHAR(200), - amount INTEGER -); -INSERT INTO persons values ('Bob','Smith','30'); -INSERT INTO persons values ('Sue','Jones','20'); -INSERT INTO persons values ('Bob','Smith','30'); - -DROP TABLE IF EXISTS test.lives; - -CREATE TABLE lives ( - fname VARCHAR(200), - lname VARCHAR(200), - city VARCHAR(200) -); -INSERT INTO lives values ('Bob','Smith','London'); -INSERT INTO lives values ('Sue','Jones','Madrid'); -INSERT INTO lives values ('Bob','Smith','London'); diff --git a/src/test/resources/rml-core/RMLTC0012b-PostgreSQL/mapping.ttl b/src/test/resources/rml-core/RMLTC0012b-PostgreSQL/mapping.ttl deleted file mode 100644 index 54534022..00000000 --- a/src/test/resources/rml-core/RMLTC0012b-PostgreSQL/mapping.ttl +++ /dev/null @@ -1,45 +0,0 @@ -@prefix d2rq: . -@prefix ex: . -@prefix foaf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source ; - rml:referenceFormulation rml:SQL2008Table; - rml:iterator "persons" - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:template "{fname} {lname}"; - rml:termType rml:Literal - ]; - rml:predicate foaf:name - ]; - rml:subjectMap [ - rml:template "{fname}{lname}"; - rml:termType rml:BlankNode - ] . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source ; - rml:referenceFormulation rml:SQL2008Table; - rml:iterator "lives" - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "city" - ]; - rml:predicate ex:city - ]; - rml:subjectMap [ - rml:template "{fname}{lname}"; - rml:termType rml:BlankNode - ] . - - a d2rq:Database; - d2rq:jdbcDSN "CONNECTIONDSN"; - d2rq:jdbcDriver "org.postgresql.Driver"; - d2rq:password ""; - d2rq:username "postgres" . diff --git a/src/test/resources/rml-core/RMLTC0012b-PostgreSQL/output.nq b/src/test/resources/rml-core/RMLTC0012b-PostgreSQL/output.nq deleted file mode 100644 index 0d556bbd..00000000 --- a/src/test/resources/rml-core/RMLTC0012b-PostgreSQL/output.nq +++ /dev/null @@ -1,5 +0,0 @@ -_:BobSmith "London" . -_:BobSmith "Bob Smith" . -_:SueJones "Madrid" . -_:SueJones "Sue Jones" . - diff --git a/src/test/resources/rml-core/RMLTC0012b-PostgreSQL/resource.sql b/src/test/resources/rml-core/RMLTC0012b-PostgreSQL/resource.sql deleted file mode 100644 index 2761bf68..00000000 --- a/src/test/resources/rml-core/RMLTC0012b-PostgreSQL/resource.sql +++ /dev/null @@ -1,21 +0,0 @@ -DROP TABLE IF EXISTS persons; - -CREATE TABLE persons ( - "fname" VARCHAR(200), - "lname" VARCHAR(200), - "amount" INTEGER -); -INSERT INTO persons values ('Bob','Smith','30'); -INSERT INTO persons values ('Sue','Jones','20'); -INSERT INTO persons values ('Bob','Smith','30'); - -DROP TABLE IF EXISTS lives; - -CREATE TABLE lives ( - "fname" VARCHAR(200), - "lname" VARCHAR(200), - "city" VARCHAR(200) -); -INSERT INTO lives values ('Bob','Smith','London'); -INSERT INTO lives values ('Sue','Jones','Madrid'); -INSERT INTO lives values ('Bob','Smith','London'); diff --git a/src/test/resources/rml-core/RMLTC0012b-SPARQL/mapping.ttl b/src/test/resources/rml-core/RMLTC0012b-SPARQL/mapping.ttl deleted file mode 100644 index f36eec4d..00000000 --- a/src/test/resources/rml-core/RMLTC0012b-SPARQL/mapping.ttl +++ /dev/null @@ -1,71 +0,0 @@ -@prefix ex: . -@prefix foaf: . -@prefix formats: . -@prefix rml: . -@prefix sd: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator """ - PREFIX rdfs: - PREFIX foaf: - PREFIX rdf: - SELECT ?fname ?lname - WHERE { - ?x foaf:firstName ?fname ; - foaf:lastName ?lname ; - } """; - rml:referenceFormulation formats:SPARQL_Results_JSON; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:template "{fname.value} {lname.value}"; - rml:termType rml:Literal - ]; - rml:predicate foaf:name - ]; - rml:subjectMap [ - rml:template "{fname.value}{lname.value}"; - rml:termType rml:BlankNode - ] . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator """ - PREFIX rdfs: - PREFIX foaf: - PREFIX rdf: - SELECT ?city ?fname ?lname - WHERE { - ?x foaf:firstName ?fname ; - foaf:lastName ?lname ; - ?city . - } """; - rml:referenceFormulation formats:SPARQL_Results_JSON; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "city.value" - ]; - rml:predicate ex:city - ]; - rml:subjectMap [ - rml:template "{fname.value}{lname.value}"; - rml:termType rml:BlankNode - ] . - - a sd:Service; - sd:endpoint ; - sd:supportedLanguage sd:SPARQL11Query . - - a sd:Service; - sd:endpoint ; - sd:supportedLanguage sd:SPARQL11Query . diff --git a/src/test/resources/rml-core/RMLTC0012b-SPARQL/output.nq b/src/test/resources/rml-core/RMLTC0012b-SPARQL/output.nq deleted file mode 100644 index 0d556bbd..00000000 --- a/src/test/resources/rml-core/RMLTC0012b-SPARQL/output.nq +++ /dev/null @@ -1,5 +0,0 @@ -_:BobSmith "London" . -_:BobSmith "Bob Smith" . -_:SueJones "Madrid" . -_:SueJones "Sue Jones" . - diff --git a/src/test/resources/rml-core/RMLTC0012b-SPARQL/resource1.ttl b/src/test/resources/rml-core/RMLTC0012b-SPARQL/resource1.ttl deleted file mode 100644 index 142bb85c..00000000 --- a/src/test/resources/rml-core/RMLTC0012b-SPARQL/resource1.ttl +++ /dev/null @@ -1,15 +0,0 @@ -@prefix foaf: . -@prefix ns1: . - -[] ns1:amount "30" ; - foaf:firstName "Bob" ; - foaf:lastName "Smith" . - -[] ns1:amount "20" ; - foaf:firstName "Sue" ; - foaf:lastName "Jones" . - -[] ns1:amount "30" ; - foaf:firstName "Bob" ; - foaf:lastName "Smith" . - diff --git a/src/test/resources/rml-core/RMLTC0012b-SPARQL/resource2.ttl b/src/test/resources/rml-core/RMLTC0012b-SPARQL/resource2.ttl deleted file mode 100644 index 5991d1f7..00000000 --- a/src/test/resources/rml-core/RMLTC0012b-SPARQL/resource2.ttl +++ /dev/null @@ -1,15 +0,0 @@ -@prefix foaf: . -@prefix ns1: . - -[] ns1:city "London" ; - foaf:firstName "Bob" ; - foaf:lastName "Smith" . - -[] ns1:city "Madrid" ; - foaf:firstName "Sue" ; - foaf:lastName "Jones" . - -[] ns1:city "London" ; - foaf:firstName "Bob" ; - foaf:lastName "Smith" . - diff --git a/src/test/resources/rml-core/RMLTC0012b-SQLServer/mapping.ttl b/src/test/resources/rml-core/RMLTC0012b-SQLServer/mapping.ttl deleted file mode 100644 index dea61d54..00000000 --- a/src/test/resources/rml-core/RMLTC0012b-SQLServer/mapping.ttl +++ /dev/null @@ -1,45 +0,0 @@ -@prefix d2rq: . -@prefix ex: . -@prefix foaf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source ; - rml:referenceFormulation rml:SQL2008Table; - rml:iterator "persons" - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:template "{fname} {lname}"; - rml:termType rml:Literal - ]; - rml:predicate foaf:name - ]; - rml:subjectMap [ - rml:template "{fname}{lname}"; - rml:termType rml:BlankNode - ] . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source ; - rml:referenceFormulation rml:SQL2008Table; - rml:iterator "lives" - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "city" - ]; - rml:predicate ex:city - ]; - rml:subjectMap [ - rml:template "{fname}{lname}"; - rml:termType rml:BlankNode - ] . - - a d2rq:Database; - d2rq:jdbcDSN "CONNECTIONDSN"; - d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver"; - d2rq:password "YourSTRONG!Passw0rd;"; - d2rq:username "sa" . diff --git a/src/test/resources/rml-core/RMLTC0012b-SQLServer/output.nq b/src/test/resources/rml-core/RMLTC0012b-SQLServer/output.nq deleted file mode 100644 index 0d556bbd..00000000 --- a/src/test/resources/rml-core/RMLTC0012b-SQLServer/output.nq +++ /dev/null @@ -1,5 +0,0 @@ -_:BobSmith "London" . -_:BobSmith "Bob Smith" . -_:SueJones "Madrid" . -_:SueJones "Sue Jones" . - diff --git a/src/test/resources/rml-core/RMLTC0012b-SQLServer/resource.sql b/src/test/resources/rml-core/RMLTC0012b-SQLServer/resource.sql deleted file mode 100644 index 03379770..00000000 --- a/src/test/resources/rml-core/RMLTC0012b-SQLServer/resource.sql +++ /dev/null @@ -1,22 +0,0 @@ -USE TestDB; -DROP TABLE IF EXISTS persons; - -CREATE TABLE persons ( - "fname" VARCHAR(200), - "lname" VARCHAR(200), - "amount" INTEGER -); -INSERT INTO persons values ('Bob','Smith','30'); -INSERT INTO persons values ('Sue','Jones','20'); -INSERT INTO persons values ('Bob','Smith','30'); - -DROP TABLE IF EXISTS lives; - -CREATE TABLE lives ( - "fname" VARCHAR(200), - "lname" VARCHAR(200), - "city" VARCHAR(200) -); -INSERT INTO lives values ('Bob','Smith','London'); -INSERT INTO lives values ('Sue','Jones','Madrid'); -INSERT INTO lives values ('Bob','Smith','London'); diff --git a/src/test/resources/rml-core/RMLTC0012b-XML/lives.xml b/src/test/resources/rml-core/RMLTC0012b-XML/lives.xml deleted file mode 100644 index f72fc8be..00000000 --- a/src/test/resources/rml-core/RMLTC0012b-XML/lives.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - Bob - Smith - London - - - Sue - Jones - Madrid - - - Bob - Smith - London - - diff --git a/src/test/resources/rml-core/RMLTC0012b-XML/mapping.ttl b/src/test/resources/rml-core/RMLTC0012b-XML/mapping.ttl deleted file mode 100644 index 4b614e06..00000000 --- a/src/test/resources/rml-core/RMLTC0012b-XML/mapping.ttl +++ /dev/null @@ -1,44 +0,0 @@ -@prefix ex: . -@prefix foaf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator "/Persons/Person"; - rml:referenceFormulation rml:XPath; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "persons.xml" - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:template "{fname} {lname}"; - rml:termType rml:Literal - ]; - rml:predicate foaf:name - ]; - rml:subjectMap [ - rml:template "{fname}{lname}"; - rml:termType rml:BlankNode - ] . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator "/Lives/Live"; - rml:referenceFormulation rml:XPath; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "lives.xml" - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "city" - ]; - rml:predicate ex:city - ]; - rml:subjectMap [ - rml:template "{fname}{lname}"; - rml:termType rml:BlankNode - ] . diff --git a/src/test/resources/rml-core/RMLTC0012b-XML/output.nq b/src/test/resources/rml-core/RMLTC0012b-XML/output.nq deleted file mode 100644 index 0d556bbd..00000000 --- a/src/test/resources/rml-core/RMLTC0012b-XML/output.nq +++ /dev/null @@ -1,5 +0,0 @@ -_:BobSmith "London" . -_:BobSmith "Bob Smith" . -_:SueJones "Madrid" . -_:SueJones "Sue Jones" . - diff --git a/src/test/resources/rml-core/RMLTC0012b-XML/persons.xml b/src/test/resources/rml-core/RMLTC0012b-XML/persons.xml deleted file mode 100644 index 775d21eb..00000000 --- a/src/test/resources/rml-core/RMLTC0012b-XML/persons.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - Bob - Smith - 30 - - - Sue - Jones - 20 - - - Bob - Smith - 30 - - diff --git a/src/test/resources/rml-core/RMLTC0012c-CSV/mapping.ttl b/src/test/resources/rml-core/RMLTC0012c-CSV/mapping.ttl deleted file mode 100644 index 4bf23e7e..00000000 --- a/src/test/resources/rml-core/RMLTC0012c-CSV/mapping.ttl +++ /dev/null @@ -1,24 +0,0 @@ -@prefix ex: . -@prefix foaf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:referenceFormulation rml:CSV; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "persons.csv" - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:template "{fname} {lname}"; - rml:termType rml:Literal - ]; - rml:predicate foaf:name - ], [ - rml:objectMap [ - rml:reference "amount" - ]; - rml:predicate ex:amount - ] . diff --git a/src/test/resources/rml-core/RMLTC0012c-CSV/persons.csv b/src/test/resources/rml-core/RMLTC0012c-CSV/persons.csv deleted file mode 100644 index 6d1909d9..00000000 --- a/src/test/resources/rml-core/RMLTC0012c-CSV/persons.csv +++ /dev/null @@ -1,4 +0,0 @@ -fname,lname,amount -Bob,Smith,30 -Sue,Jones,20 -Bob,Smith,30 diff --git a/src/test/resources/rml-core/RMLTC0012c-JSON/README.md b/src/test/resources/rml-core/RMLTC0012c-JSON/README.md new file mode 100644 index 00000000..c65174cf --- /dev/null +++ b/src/test/resources/rml-core/RMLTC0012c-JSON/README.md @@ -0,0 +1,52 @@ +## RMLTC0012c-JSON + +**Title**: "TriplesMap without subjectMap" + +**Description**: "Tests a RML with missing information, TriplesMap without subjectMap." + +**Default Base IRI**: http://example.com/ + +**Error expected?** Yes + +**Input** +``` +{ + "persons": [ + {"fname":"Bob","lname":"Smith","amount":30}, + {"fname":"Sue","lname":"Jones","amount":20}, + {"fname":"Bob","lname":"Smith","amount":30} + ] +} + +``` + +**Mapping** +``` +@prefix ex: . +@prefix foaf: . +@prefix rml: . + + a rml:TriplesMap; + rml:logicalSource [ a rml:LogicalSource; + rml:iterator "$.persons[*]"; + rml:referenceFormulation rml:JSONPath; + rml:source [ a rml:RelativePathSource; + rml:root rml:MappingDirectory; + rml:path "persons.json" + ] + ]; + rml:predicateObjectMap [ + rml:objectMap [ + rml:template "{$.fname} {$.lname}"; + rml:termType rml:Literal + ]; + rml:predicate foaf:name + ], [ + rml:objectMap [ + rml:reference "$.amount" + ]; + rml:predicate ex:amount + ] . + +``` + diff --git a/src/test/resources/rml-core/RMLTC0012c-JSON/mapping.ttl b/src/test/resources/rml-core/RMLTC0012c-JSON/mapping.ttl index 56cd3473..c458a4aa 100644 --- a/src/test/resources/rml-core/RMLTC0012c-JSON/mapping.ttl +++ b/src/test/resources/rml-core/RMLTC0012c-JSON/mapping.ttl @@ -13,13 +13,13 @@ ]; rml:predicateObjectMap [ rml:objectMap [ - rml:template "{fname} {lname}"; + rml:template "{$.fname} {$.lname}"; rml:termType rml:Literal ]; rml:predicate foaf:name ], [ rml:objectMap [ - rml:reference "amount" + rml:reference "$.amount" ]; rml:predicate ex:amount ] . diff --git a/src/test/resources/rml-core/RMLTC0012c-MySQL/mapping.ttl b/src/test/resources/rml-core/RMLTC0012c-MySQL/mapping.ttl deleted file mode 100644 index be18c725..00000000 --- a/src/test/resources/rml-core/RMLTC0012c-MySQL/mapping.ttl +++ /dev/null @@ -1,29 +0,0 @@ -@prefix d2rq: . -@prefix ex: . -@prefix foaf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source ; - rml:referenceFormulation rml:SQL2008Table; - rml:iterator "IOUs" - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:template "{fname} {lname}"; - rml:termType rml:Literal - ]; - rml:predicate foaf:name - ], [ - rml:objectMap [ - rml:reference "amount" - ]; - rml:predicate ex:amount - ] . - - a d2rq:Database; - d2rq:jdbcDSN "CONNECTIONDSN"; - d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver"; - d2rq:password ""; - d2rq:username "root" . diff --git a/src/test/resources/rml-core/RMLTC0012c-MySQL/resource.sql b/src/test/resources/rml-core/RMLTC0012c-MySQL/resource.sql deleted file mode 100644 index 718792c7..00000000 --- a/src/test/resources/rml-core/RMLTC0012c-MySQL/resource.sql +++ /dev/null @@ -1,19 +0,0 @@ -USE test; -DROP TABLE IF EXISTS test.IOUs; -DROP TABLE IF EXISTS test.Lives; - -CREATE TABLE IOUs ( - fname VARCHAR(20), - lname VARCHAR(20), - amount FLOAT); -INSERT INTO IOUs (fname, lname, amount) VALUES ('Bob', 'Smith', 30); -INSERT INTO IOUs (fname, lname, amount) VALUES ('Sue', 'Jones', 20); -INSERT INTO IOUs (fname, lname, amount) VALUES ('Bob', 'Smith', 30); - -CREATE TABLE Lives ( - fname VARCHAR(20), - lname VARCHAR(20), - city VARCHAR(20)); -INSERT INTO Lives (fname, lname, city) VALUES ('Bob', 'Smith', 'London'); -INSERT INTO Lives (fname, lname, city) VALUES ('Sue', 'Jones', 'Madrid'); -INSERT INTO Lives (fname, lname, city) VALUES ('Bob', 'Smith', 'London'); diff --git a/src/test/resources/rml-core/RMLTC0012c-PostgreSQL/mapping.ttl b/src/test/resources/rml-core/RMLTC0012c-PostgreSQL/mapping.ttl deleted file mode 100644 index c09a8c04..00000000 --- a/src/test/resources/rml-core/RMLTC0012c-PostgreSQL/mapping.ttl +++ /dev/null @@ -1,29 +0,0 @@ -@prefix d2rq: . -@prefix ex: . -@prefix foaf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source ; - rml:referenceFormulation rml:SQL2008Table; - rml:iterator "IOUs" - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:template "{fname} {lname}"; - rml:termType rml:Literal - ]; - rml:predicate foaf:name - ], [ - rml:objectMap [ - rml:reference "amount" - ]; - rml:predicate ex:amount - ] . - - a d2rq:Database; - d2rq:jdbcDSN "CONNECTIONDSN"; - d2rq:jdbcDriver "org.postgresql.Driver"; - d2rq:password "password"; - d2rq:username "postgres" . diff --git a/src/test/resources/rml-core/RMLTC0012c-PostgreSQL/resource.sql b/src/test/resources/rml-core/RMLTC0012c-PostgreSQL/resource.sql deleted file mode 100644 index 46e386f7..00000000 --- a/src/test/resources/rml-core/RMLTC0012c-PostgreSQL/resource.sql +++ /dev/null @@ -1,18 +0,0 @@ -DROP TABLE IF EXISTS IOUs; -DROP TABLE IF EXISTS Lives; - -CREATE TABLE IOUs ( - fname VARCHAR(20), - lname VARCHAR(20), - amount FLOAT); -INSERT INTO IOUs (fname, lname, amount) VALUES ('Bob', 'Smith', 30); -INSERT INTO IOUs (fname, lname, amount) VALUES ('Sue', 'Jones', 20); -INSERT INTO IOUs (fname, lname, amount) VALUES ('Bob', 'Smith', 30); - -CREATE TABLE Lives ( - fname VARCHAR(20), - lname VARCHAR(20), - city VARCHAR(20)); -INSERT INTO Lives (fname, lname, city) VALUES ('Bob', 'Smith', 'London'); -INSERT INTO Lives (fname, lname, city) VALUES ('Sue', 'Jones', 'Madrid'); -INSERT INTO Lives (fname, lname, city) VALUES ('Bob', 'Smith', 'London'); diff --git a/src/test/resources/rml-core/RMLTC0012c-SQLServer/mapping.ttl b/src/test/resources/rml-core/RMLTC0012c-SQLServer/mapping.ttl deleted file mode 100644 index e6ae399d..00000000 --- a/src/test/resources/rml-core/RMLTC0012c-SQLServer/mapping.ttl +++ /dev/null @@ -1,29 +0,0 @@ -@prefix d2rq: . -@prefix ex: . -@prefix foaf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source ; - rml:referenceFormulation rml:SQL2008Table; - rml:iterator "IOUs" - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:template "{fname} {lname}"; - rml:termType rml:Literal - ]; - rml:predicate foaf:name - ], [ - rml:objectMap [ - rml:reference "amount" - ]; - rml:predicate ex:amount - ] . - - a d2rq:Database; - d2rq:jdbcDSN "CONNECTIONDSN"; - d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver"; - d2rq:password "YourSTRONG!Passw0rd;"; - d2rq:username "sa" . diff --git a/src/test/resources/rml-core/RMLTC0012c-SQLServer/resource.sql b/src/test/resources/rml-core/RMLTC0012c-SQLServer/resource.sql deleted file mode 100644 index 8fab5e6f..00000000 --- a/src/test/resources/rml-core/RMLTC0012c-SQLServer/resource.sql +++ /dev/null @@ -1,19 +0,0 @@ -USE TestDB; -DROP TABLE IF EXISTS IOUs; -DROP TABLE IF EXISTS Lives; - -CREATE TABLE IOUs ( - fname VARCHAR(20), - lname VARCHAR(20), - amount FLOAT); -INSERT INTO IOUs (fname, lname, amount) VALUES ('Bob', 'Smith', 30); -INSERT INTO IOUs (fname, lname, amount) VALUES ('Sue', 'Jones', 20); -INSERT INTO IOUs (fname, lname, amount) VALUES ('Bob', 'Smith', 30); - -CREATE TABLE Lives ( - fname VARCHAR(20), - lname VARCHAR(20), - city VARCHAR(20)); -INSERT INTO Lives (fname, lname, city) VALUES ('Bob', 'Smith', 'London'); -INSERT INTO Lives (fname, lname, city) VALUES ('Sue', 'Jones', 'Madrid'); -INSERT INTO Lives (fname, lname, city) VALUES ('Bob', 'Smith', 'London'); diff --git a/src/test/resources/rml-core/RMLTC0012c-XML/mapping.ttl b/src/test/resources/rml-core/RMLTC0012c-XML/mapping.ttl deleted file mode 100644 index 70f35312..00000000 --- a/src/test/resources/rml-core/RMLTC0012c-XML/mapping.ttl +++ /dev/null @@ -1,25 +0,0 @@ -@prefix ex: . -@prefix foaf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator "/Persons/Person"; - rml:referenceFormulation rml:XPath; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "persons.json" - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:template "{fname} {lname}"; - rml:termType rml:Literal - ]; - rml:predicate foaf:name - ], [ - rml:objectMap [ - rml:reference "amount" - ]; - rml:predicate ex:amount - ] . diff --git a/src/test/resources/rml-core/RMLTC0012c-XML/persons.xml b/src/test/resources/rml-core/RMLTC0012c-XML/persons.xml deleted file mode 100644 index 411760a1..00000000 --- a/src/test/resources/rml-core/RMLTC0012c-XML/persons.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - Bob - Smith> - 30 - - - Sue - Jones> - 20 - - - Bob - Smith> - 30 - - diff --git a/src/test/resources/rml-core/RMLTC0012d-CSV/mapping.ttl b/src/test/resources/rml-core/RMLTC0012d-CSV/mapping.ttl deleted file mode 100644 index ba324ed2..00000000 --- a/src/test/resources/rml-core/RMLTC0012d-CSV/mapping.ttl +++ /dev/null @@ -1,31 +0,0 @@ -@prefix ex: . -@prefix foaf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:referenceFormulation rml:CSV; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "persons.csv" - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:template "{fname} {lname}"; - rml:termType rml:Literal - ]; - rml:predicate foaf:name - ], [ - rml:objectMap [ - rml:reference "amount" - ]; - rml:predicate ex:amount - ]; - rml:subjectMap [ - rml:template "{fname}_{lname}_{amount}"; - rml:termType rml:BlankNode - ], [ - rml:template "{amount}_{fname}_{lname}"; - rml:termType rml:BlankNode - ] . diff --git a/src/test/resources/rml-core/RMLTC0012d-CSV/persons.csv b/src/test/resources/rml-core/RMLTC0012d-CSV/persons.csv deleted file mode 100644 index 6d1909d9..00000000 --- a/src/test/resources/rml-core/RMLTC0012d-CSV/persons.csv +++ /dev/null @@ -1,4 +0,0 @@ -fname,lname,amount -Bob,Smith,30 -Sue,Jones,20 -Bob,Smith,30 diff --git a/src/test/resources/rml-core/RMLTC0012d-JSON/README.md b/src/test/resources/rml-core/RMLTC0012d-JSON/README.md new file mode 100644 index 00000000..3b3dfa90 --- /dev/null +++ b/src/test/resources/rml-core/RMLTC0012d-JSON/README.md @@ -0,0 +1,59 @@ +## RMLTC0012d-JSON + +**Title**: "TriplesMap with two subjectMap" + +**Description**: "Tests a RML with wrong information, TriplesMap with two subjectMap." + +**Default Base IRI**: http://example.com/ + +**Error expected?** Yes + +**Input** +``` +{ + "persons": [ + {"fname":"Bob","lname":"Smith","amount":30}, + {"fname":"Sue","lname":"Jones","amount":20}, + {"fname":"Bob","lname":"Smith","amount":30} + ] +} + +``` + +**Mapping** +``` +@prefix ex: . +@prefix foaf: . +@prefix rml: . + + a rml:TriplesMap; + rml:logicalSource [ a rml:LogicalSource; + rml:iterator "$.persons[*]"; + rml:referenceFormulation rml:JSONPath; + rml:source [ a rml:RelativePathSource; + rml:root rml:MappingDirectory; + rml:path "persons.json" + ] + ]; + rml:predicateObjectMap [ + rml:objectMap [ + rml:template "{$.fname} {$.lname}"; + rml:termType rml:Literal + ]; + rml:predicate foaf:name + ], [ + rml:objectMap [ + rml:reference "$.amount" + ]; + rml:predicate ex:amount + ]; + rml:subjectMap [ + rml:template "{$.fname}_{$.lname}_{$.amount}"; + rml:termType rml:BlankNode + ], [ + rml:template "{$.amount}_{$.fname}_{$.lname}"; + rml:termType rml:BlankNode + ] . + +``` + diff --git a/src/test/resources/rml-core/RMLTC0012d-JSON/mapping.ttl b/src/test/resources/rml-core/RMLTC0012d-JSON/mapping.ttl index 442cb705..a8baa088 100644 --- a/src/test/resources/rml-core/RMLTC0012d-JSON/mapping.ttl +++ b/src/test/resources/rml-core/RMLTC0012d-JSON/mapping.ttl @@ -13,20 +13,20 @@ ]; rml:predicateObjectMap [ rml:objectMap [ - rml:template "{fname} {lname}"; + rml:template "{$.fname} {$.lname}"; rml:termType rml:Literal ]; rml:predicate foaf:name ], [ rml:objectMap [ - rml:reference "amount" + rml:reference "$.amount" ]; rml:predicate ex:amount ]; rml:subjectMap [ - rml:template "{fname}_{lname}_{amount}"; + rml:template "{$.fname}_{$.lname}_{$.amount}"; rml:termType rml:BlankNode ], [ - rml:template "{amount}_{fname}_{lname}"; + rml:template "{$.amount}_{$.fname}_{$.lname}"; rml:termType rml:BlankNode ] . diff --git a/src/test/resources/rml-core/RMLTC0012d-MySQL/mapping.ttl b/src/test/resources/rml-core/RMLTC0012d-MySQL/mapping.ttl deleted file mode 100644 index cc24cc7d..00000000 --- a/src/test/resources/rml-core/RMLTC0012d-MySQL/mapping.ttl +++ /dev/null @@ -1,27 +0,0 @@ -@prefix d2rq: . -@prefix ex: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source ; - rml:referenceFormulation rml:SQL2008Table; - rml:iterator "IOUs" - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "amount" - ]; - rml:predicate ex:amount - ]; - rml:subjectMap [ - rml:template "{fname}_{lname}_{amount}" - ], [ - rml:template "{amount}_{fname}_{lname}" - ] . - - a d2rq:Database; - d2rq:jdbcDSN "CONNECTIONDSN"; - d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver"; - d2rq:password ""; - d2rq:username "root" . diff --git a/src/test/resources/rml-core/RMLTC0012d-MySQL/resource.sql b/src/test/resources/rml-core/RMLTC0012d-MySQL/resource.sql deleted file mode 100644 index 718792c7..00000000 --- a/src/test/resources/rml-core/RMLTC0012d-MySQL/resource.sql +++ /dev/null @@ -1,19 +0,0 @@ -USE test; -DROP TABLE IF EXISTS test.IOUs; -DROP TABLE IF EXISTS test.Lives; - -CREATE TABLE IOUs ( - fname VARCHAR(20), - lname VARCHAR(20), - amount FLOAT); -INSERT INTO IOUs (fname, lname, amount) VALUES ('Bob', 'Smith', 30); -INSERT INTO IOUs (fname, lname, amount) VALUES ('Sue', 'Jones', 20); -INSERT INTO IOUs (fname, lname, amount) VALUES ('Bob', 'Smith', 30); - -CREATE TABLE Lives ( - fname VARCHAR(20), - lname VARCHAR(20), - city VARCHAR(20)); -INSERT INTO Lives (fname, lname, city) VALUES ('Bob', 'Smith', 'London'); -INSERT INTO Lives (fname, lname, city) VALUES ('Sue', 'Jones', 'Madrid'); -INSERT INTO Lives (fname, lname, city) VALUES ('Bob', 'Smith', 'London'); diff --git a/src/test/resources/rml-core/RMLTC0012d-PostgreSQL/mapping.ttl b/src/test/resources/rml-core/RMLTC0012d-PostgreSQL/mapping.ttl deleted file mode 100644 index c8aa2a07..00000000 --- a/src/test/resources/rml-core/RMLTC0012d-PostgreSQL/mapping.ttl +++ /dev/null @@ -1,27 +0,0 @@ -@prefix d2rq: . -@prefix ex: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source ; - rml:referenceFormulation rml:SQL2008Table; - rml:iterator "IOUs" - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "amount" - ]; - rml:predicate ex:amount - ]; - rml:subjectMap [ - rml:template "{fname}_{lname}_{amount}" - ], [ - rml:template "{amount}_{fname}_{lname}" - ] . - - a d2rq:Database; - d2rq:jdbcDSN "CONNECTIONDSN"; - d2rq:jdbcDriver "org.postgresql.Driver"; - d2rq:password "password"; - d2rq:username "postgres" . diff --git a/src/test/resources/rml-core/RMLTC0012d-PostgreSQL/resource.sql b/src/test/resources/rml-core/RMLTC0012d-PostgreSQL/resource.sql deleted file mode 100644 index 46e386f7..00000000 --- a/src/test/resources/rml-core/RMLTC0012d-PostgreSQL/resource.sql +++ /dev/null @@ -1,18 +0,0 @@ -DROP TABLE IF EXISTS IOUs; -DROP TABLE IF EXISTS Lives; - -CREATE TABLE IOUs ( - fname VARCHAR(20), - lname VARCHAR(20), - amount FLOAT); -INSERT INTO IOUs (fname, lname, amount) VALUES ('Bob', 'Smith', 30); -INSERT INTO IOUs (fname, lname, amount) VALUES ('Sue', 'Jones', 20); -INSERT INTO IOUs (fname, lname, amount) VALUES ('Bob', 'Smith', 30); - -CREATE TABLE Lives ( - fname VARCHAR(20), - lname VARCHAR(20), - city VARCHAR(20)); -INSERT INTO Lives (fname, lname, city) VALUES ('Bob', 'Smith', 'London'); -INSERT INTO Lives (fname, lname, city) VALUES ('Sue', 'Jones', 'Madrid'); -INSERT INTO Lives (fname, lname, city) VALUES ('Bob', 'Smith', 'London'); diff --git a/src/test/resources/rml-core/RMLTC0012d-SQLServer/mapping.ttl b/src/test/resources/rml-core/RMLTC0012d-SQLServer/mapping.ttl deleted file mode 100644 index 3d923cad..00000000 --- a/src/test/resources/rml-core/RMLTC0012d-SQLServer/mapping.ttl +++ /dev/null @@ -1,27 +0,0 @@ -@prefix d2rq: . -@prefix ex: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source ; - rml:referenceFormulation rml:SQL2008Table; - rml:iterator "IOUs" - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "amount" - ]; - rml:predicate ex:amount - ]; - rml:subjectMap [ - rml:template "{fname}_{lname}_{amount}" - ], [ - rml:template "{amount}_{fname}_{lname}" - ] . - - a d2rq:Database; - d2rq:jdbcDSN "CONNECTIONDSN"; - d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver"; - d2rq:password "YourSTRONG!Passw0rd;"; - d2rq:username "sa" . diff --git a/src/test/resources/rml-core/RMLTC0012d-SQLServer/resource.sql b/src/test/resources/rml-core/RMLTC0012d-SQLServer/resource.sql deleted file mode 100644 index 8fab5e6f..00000000 --- a/src/test/resources/rml-core/RMLTC0012d-SQLServer/resource.sql +++ /dev/null @@ -1,19 +0,0 @@ -USE TestDB; -DROP TABLE IF EXISTS IOUs; -DROP TABLE IF EXISTS Lives; - -CREATE TABLE IOUs ( - fname VARCHAR(20), - lname VARCHAR(20), - amount FLOAT); -INSERT INTO IOUs (fname, lname, amount) VALUES ('Bob', 'Smith', 30); -INSERT INTO IOUs (fname, lname, amount) VALUES ('Sue', 'Jones', 20); -INSERT INTO IOUs (fname, lname, amount) VALUES ('Bob', 'Smith', 30); - -CREATE TABLE Lives ( - fname VARCHAR(20), - lname VARCHAR(20), - city VARCHAR(20)); -INSERT INTO Lives (fname, lname, city) VALUES ('Bob', 'Smith', 'London'); -INSERT INTO Lives (fname, lname, city) VALUES ('Sue', 'Jones', 'Madrid'); -INSERT INTO Lives (fname, lname, city) VALUES ('Bob', 'Smith', 'London'); diff --git a/src/test/resources/rml-core/RMLTC0012d-XML/mapping.ttl b/src/test/resources/rml-core/RMLTC0012d-XML/mapping.ttl deleted file mode 100644 index 9af658b5..00000000 --- a/src/test/resources/rml-core/RMLTC0012d-XML/mapping.ttl +++ /dev/null @@ -1,32 +0,0 @@ -@prefix ex: . -@prefix foaf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator "/Persons/Person"; - rml:referenceFormulation rml:XPath; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "persons.xml" - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:template "{fname} {lname}"; - rml:termType rml:Literal - ]; - rml:predicate foaf:name - ], [ - rml:objectMap [ - rml:reference "amount" - ]; - rml:predicate ex:amount - ]; - rml:subjectMap [ - rml:template "{fname}_{lname}_{amount}"; - rml:termType rml:BlankNode - ], [ - rml:template "{amount}_{fname}_{lname}"; - rml:termType rml:BlankNode - ] . diff --git a/src/test/resources/rml-core/RMLTC0012d-XML/persons.xml b/src/test/resources/rml-core/RMLTC0012d-XML/persons.xml deleted file mode 100644 index 775d21eb..00000000 --- a/src/test/resources/rml-core/RMLTC0012d-XML/persons.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - Bob - Smith - 30 - - - Sue - Jones - 20 - - - Bob - Smith - 30 - - diff --git a/src/test/resources/rml-core/RMLTC0012e-MySQL/mapping.ttl b/src/test/resources/rml-core/RMLTC0012e-MySQL/mapping.ttl deleted file mode 100644 index 9f3c7ca4..00000000 --- a/src/test/resources/rml-core/RMLTC0012e-MySQL/mapping.ttl +++ /dev/null @@ -1,69 +0,0 @@ -@prefix d2rq: . -@prefix rdf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source ; - rml:referenceFormulation rml:SQL2008Table; - rml:iterator "IOUs" - ]; - rml:predicateObjectMap [ - rml:object ; - rml:predicate rdf:type - ], [ - rml:objectMap [ - rml:reference "fname" - ]; - rml:predicate - ], [ - rml:objectMap [ - rml:reference "lname" - ]; - rml:predicate - ], [ - rml:objectMap [ - rml:reference "amount" - ]; - rml:predicate - ]; - rml:subjectMap [ - rml:template "{fname}_{lname}_{amount}"; - rml:termType rml:BlankNode - ] . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source ; - rml:referenceFormulation rml:SQL2008Table; - rml:iterator "Lives" - ]; - rml:predicateObjectMap [ - rml:object ; - rml:predicate rdf:type - ], [ - rml:objectMap [ - rml:reference "fname" - ]; - rml:predicate - ], [ - rml:objectMap [ - rml:reference "lname" - ]; - rml:predicate - ], [ - rml:objectMap [ - rml:reference "city" - ]; - rml:predicate - ]; - rml:subjectMap [ - rml:template "{fname}_{lname}_{city}"; - rml:termType rml:BlankNode - ] . - - a d2rq:Database; - d2rq:jdbcDSN "CONNECTIONDSN"; - d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver"; - d2rq:password ""; - d2rq:username "root" . diff --git a/src/test/resources/rml-core/RMLTC0012e-MySQL/output.nq b/src/test/resources/rml-core/RMLTC0012e-MySQL/output.nq deleted file mode 100644 index a09639da..00000000 --- a/src/test/resources/rml-core/RMLTC0012e-MySQL/output.nq +++ /dev/null @@ -1,18 +0,0 @@ -_:Bob_Smith_30 . -_:Bob_Smith_30 "Bob" . -_:Bob_Smith_30 "Smith" . -_:Bob_Smith_30 "3.0E1"^^ . -_:Sue_Jones_20 . -_:Sue_Jones_20 "Sue" . -_:Sue_Jones_20 "Jones" . -_:Sue_Jones_20 "2.0E1"^^ . -_:Bob_Smith_London . -_:Bob_Smith_London "Bob" . -_:Bob_Smith_London "Smith" . -_:Bob_Smith_London "London" . -_:Sue_Jones_Madrid . -_:Sue_Jones_Madrid "Sue" . -_:Sue_Jones_Madrid "Jones" . -_:Sue_Jones_Madrid "Madrid" . - - diff --git a/src/test/resources/rml-core/RMLTC0012e-MySQL/resource.sql b/src/test/resources/rml-core/RMLTC0012e-MySQL/resource.sql deleted file mode 100644 index 718792c7..00000000 --- a/src/test/resources/rml-core/RMLTC0012e-MySQL/resource.sql +++ /dev/null @@ -1,19 +0,0 @@ -USE test; -DROP TABLE IF EXISTS test.IOUs; -DROP TABLE IF EXISTS test.Lives; - -CREATE TABLE IOUs ( - fname VARCHAR(20), - lname VARCHAR(20), - amount FLOAT); -INSERT INTO IOUs (fname, lname, amount) VALUES ('Bob', 'Smith', 30); -INSERT INTO IOUs (fname, lname, amount) VALUES ('Sue', 'Jones', 20); -INSERT INTO IOUs (fname, lname, amount) VALUES ('Bob', 'Smith', 30); - -CREATE TABLE Lives ( - fname VARCHAR(20), - lname VARCHAR(20), - city VARCHAR(20)); -INSERT INTO Lives (fname, lname, city) VALUES ('Bob', 'Smith', 'London'); -INSERT INTO Lives (fname, lname, city) VALUES ('Sue', 'Jones', 'Madrid'); -INSERT INTO Lives (fname, lname, city) VALUES ('Bob', 'Smith', 'London'); diff --git a/src/test/resources/rml-core/RMLTC0012e-PostgreSQL/mapping.ttl b/src/test/resources/rml-core/RMLTC0012e-PostgreSQL/mapping.ttl deleted file mode 100644 index b143e99e..00000000 --- a/src/test/resources/rml-core/RMLTC0012e-PostgreSQL/mapping.ttl +++ /dev/null @@ -1,69 +0,0 @@ -@prefix d2rq: . -@prefix rdf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source ; - rml:referenceFormulation rml:SQL2008Table; - rml:iterator "IOUs" - ]; - rml:predicateObjectMap [ - rml:object ; - rml:predicate rdf:type - ], [ - rml:objectMap [ - rml:reference "fname" - ]; - rml:predicate - ], [ - rml:objectMap [ - rml:reference "lname" - ]; - rml:predicate - ], [ - rml:objectMap [ - rml:reference "amount" - ]; - rml:predicate - ]; - rml:subjectMap [ - rml:template "{fname}_{lname}_{amount}"; - rml:termType rml:BlankNode - ] . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source ; - rml:referenceFormulation rml:SQL2008Table; - rml:iterator "Lives" - ]; - rml:predicateObjectMap [ - rml:object ; - rml:predicate rdf:type - ], [ - rml:objectMap [ - rml:reference "fname" - ]; - rml:predicate - ], [ - rml:objectMap [ - rml:reference "lname" - ]; - rml:predicate - ], [ - rml:objectMap [ - rml:reference "city" - ]; - rml:predicate - ]; - rml:subjectMap [ - rml:template "{fname}_{lname}_{city}"; - rml:termType rml:BlankNode - ] . - - a d2rq:Database; - d2rq:jdbcDSN "CONNECTIONDSN"; - d2rq:jdbcDriver "org.postgresql.Driver"; - d2rq:password ""; - d2rq:username "postgres" . diff --git a/src/test/resources/rml-core/RMLTC0012e-PostgreSQL/output.nq b/src/test/resources/rml-core/RMLTC0012e-PostgreSQL/output.nq deleted file mode 100644 index a09639da..00000000 --- a/src/test/resources/rml-core/RMLTC0012e-PostgreSQL/output.nq +++ /dev/null @@ -1,18 +0,0 @@ -_:Bob_Smith_30 . -_:Bob_Smith_30 "Bob" . -_:Bob_Smith_30 "Smith" . -_:Bob_Smith_30 "3.0E1"^^ . -_:Sue_Jones_20 . -_:Sue_Jones_20 "Sue" . -_:Sue_Jones_20 "Jones" . -_:Sue_Jones_20 "2.0E1"^^ . -_:Bob_Smith_London . -_:Bob_Smith_London "Bob" . -_:Bob_Smith_London "Smith" . -_:Bob_Smith_London "London" . -_:Sue_Jones_Madrid . -_:Sue_Jones_Madrid "Sue" . -_:Sue_Jones_Madrid "Jones" . -_:Sue_Jones_Madrid "Madrid" . - - diff --git a/src/test/resources/rml-core/RMLTC0012e-PostgreSQL/resource.sql b/src/test/resources/rml-core/RMLTC0012e-PostgreSQL/resource.sql deleted file mode 100644 index 46e386f7..00000000 --- a/src/test/resources/rml-core/RMLTC0012e-PostgreSQL/resource.sql +++ /dev/null @@ -1,18 +0,0 @@ -DROP TABLE IF EXISTS IOUs; -DROP TABLE IF EXISTS Lives; - -CREATE TABLE IOUs ( - fname VARCHAR(20), - lname VARCHAR(20), - amount FLOAT); -INSERT INTO IOUs (fname, lname, amount) VALUES ('Bob', 'Smith', 30); -INSERT INTO IOUs (fname, lname, amount) VALUES ('Sue', 'Jones', 20); -INSERT INTO IOUs (fname, lname, amount) VALUES ('Bob', 'Smith', 30); - -CREATE TABLE Lives ( - fname VARCHAR(20), - lname VARCHAR(20), - city VARCHAR(20)); -INSERT INTO Lives (fname, lname, city) VALUES ('Bob', 'Smith', 'London'); -INSERT INTO Lives (fname, lname, city) VALUES ('Sue', 'Jones', 'Madrid'); -INSERT INTO Lives (fname, lname, city) VALUES ('Bob', 'Smith', 'London'); diff --git a/src/test/resources/rml-core/RMLTC0012e-SQLServer/mapping.ttl b/src/test/resources/rml-core/RMLTC0012e-SQLServer/mapping.ttl deleted file mode 100644 index 3c5aa10a..00000000 --- a/src/test/resources/rml-core/RMLTC0012e-SQLServer/mapping.ttl +++ /dev/null @@ -1,69 +0,0 @@ -@prefix d2rq: . -@prefix rdf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source ; - rml:referenceFormulation rml:SQL2008Table; - rml:iterator "IOUs" - ]; - rml:predicateObjectMap [ - rml:object ; - rml:predicate rdf:type - ], [ - rml:objectMap [ - rml:reference "fname" - ]; - rml:predicate - ], [ - rml:objectMap [ - rml:reference "lname" - ]; - rml:predicate - ], [ - rml:objectMap [ - rml:reference "amount" - ]; - rml:predicate - ]; - rml:subjectMap [ - rml:template "{fname}_{lname}_{amount}"; - rml:termType rml:BlankNode - ] . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source ; - rml:referenceFormulation rml:SQL2008Table; - rml:iterator "Lives" - ]; - rml:predicateObjectMap [ - rml:object ; - rml:predicate rdf:type - ], [ - rml:objectMap [ - rml:reference "fname" - ]; - rml:predicate - ], [ - rml:objectMap [ - rml:reference "lname" - ]; - rml:predicate - ], [ - rml:objectMap [ - rml:reference "city" - ]; - rml:predicate - ]; - rml:subjectMap [ - rml:template "{fname}_{lname}_{city}"; - rml:termType rml:BlankNode - ] . - - a d2rq:Database; - d2rq:jdbcDSN "CONNECTIONDSN"; - d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver"; - d2rq:password "YourSTRONG!Passw0rd;"; - d2rq:username "sa" . diff --git a/src/test/resources/rml-core/RMLTC0012e-SQLServer/output.nq b/src/test/resources/rml-core/RMLTC0012e-SQLServer/output.nq deleted file mode 100644 index a09639da..00000000 --- a/src/test/resources/rml-core/RMLTC0012e-SQLServer/output.nq +++ /dev/null @@ -1,18 +0,0 @@ -_:Bob_Smith_30 . -_:Bob_Smith_30 "Bob" . -_:Bob_Smith_30 "Smith" . -_:Bob_Smith_30 "3.0E1"^^ . -_:Sue_Jones_20 . -_:Sue_Jones_20 "Sue" . -_:Sue_Jones_20 "Jones" . -_:Sue_Jones_20 "2.0E1"^^ . -_:Bob_Smith_London . -_:Bob_Smith_London "Bob" . -_:Bob_Smith_London "Smith" . -_:Bob_Smith_London "London" . -_:Sue_Jones_Madrid . -_:Sue_Jones_Madrid "Sue" . -_:Sue_Jones_Madrid "Jones" . -_:Sue_Jones_Madrid "Madrid" . - - diff --git a/src/test/resources/rml-core/RMLTC0012e-SQLServer/resource.sql b/src/test/resources/rml-core/RMLTC0012e-SQLServer/resource.sql deleted file mode 100644 index 8fab5e6f..00000000 --- a/src/test/resources/rml-core/RMLTC0012e-SQLServer/resource.sql +++ /dev/null @@ -1,19 +0,0 @@ -USE TestDB; -DROP TABLE IF EXISTS IOUs; -DROP TABLE IF EXISTS Lives; - -CREATE TABLE IOUs ( - fname VARCHAR(20), - lname VARCHAR(20), - amount FLOAT); -INSERT INTO IOUs (fname, lname, amount) VALUES ('Bob', 'Smith', 30); -INSERT INTO IOUs (fname, lname, amount) VALUES ('Sue', 'Jones', 20); -INSERT INTO IOUs (fname, lname, amount) VALUES ('Bob', 'Smith', 30); - -CREATE TABLE Lives ( - fname VARCHAR(20), - lname VARCHAR(20), - city VARCHAR(20)); -INSERT INTO Lives (fname, lname, city) VALUES ('Bob', 'Smith', 'London'); -INSERT INTO Lives (fname, lname, city) VALUES ('Sue', 'Jones', 'Madrid'); -INSERT INTO Lives (fname, lname, city) VALUES ('Bob', 'Smith', 'London'); diff --git a/src/test/resources/rml-core/RMLTC0013a-JSON/README.md b/src/test/resources/rml-core/RMLTC0013a-JSON/README.md new file mode 100644 index 00000000..8a42b808 --- /dev/null +++ b/src/test/resources/rml-core/RMLTC0013a-JSON/README.md @@ -0,0 +1,53 @@ +## RMLTC0013a-JSON + +**Title**: "Null value in JSON file" + +**Description**: "Tests if null values in JSON files are handled correctly." + +**Default Base IRI**: http://example.com/ + +**Error expected?** No + +**Input** +``` +{ + "persons": [ + {"ID":"1","Name":"Alice","DateOfBirth":null}, + {"ID":"2","Name":"Bob","DateOfBirth":"September, 2010"} + ] +} + +``` + +**Mapping** +``` +@prefix ex: . +@prefix rml: . + + a rml:TriplesMap; + rml:logicalSource [ a rml:LogicalSource; + rml:iterator "$.persons[*]"; + rml:referenceFormulation rml:JSONPath; + rml:source [ a rml:RelativePathSource; + rml:root rml:MappingDirectory; + rml:path "persons.json" + ] + ]; + rml:predicateObjectMap [ + rml:objectMap [ + rml:reference "$.DateOfBirth" + ]; + rml:predicate ex:BirthDay + ]; + rml:subjectMap [ + rml:template "http://example.com/Person/{$.ID}/{$.Name}/{$.DateOfBirth}" + ] . + +``` + +**Output** +``` + "September, 2010" . + +``` + diff --git a/src/test/resources/rml-core/RMLTC0013a-JSON/mapping.ttl b/src/test/resources/rml-core/RMLTC0013a-JSON/mapping.ttl index 92a69509..c1bd8ddc 100644 --- a/src/test/resources/rml-core/RMLTC0013a-JSON/mapping.ttl +++ b/src/test/resources/rml-core/RMLTC0013a-JSON/mapping.ttl @@ -12,10 +12,10 @@ ]; rml:predicateObjectMap [ rml:objectMap [ - rml:reference "DateOfBirth" + rml:reference "$.DateOfBirth" ]; rml:predicate ex:BirthDay ]; rml:subjectMap [ - rml:template "http://example.com/Person/{ID}/{Name}/{DateOfBirth}" + rml:template "http://example.com/Person/{$.ID}/{$.Name}/{$.DateOfBirth}" ] . diff --git a/src/test/resources/rml-core/RMLTC0013a-MySQL/mapping.ttl b/src/test/resources/rml-core/RMLTC0013a-MySQL/mapping.ttl deleted file mode 100644 index eadfe810..00000000 --- a/src/test/resources/rml-core/RMLTC0013a-MySQL/mapping.ttl +++ /dev/null @@ -1,25 +0,0 @@ -@prefix d2rq: . -@prefix ex: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source ; - rml:referenceFormulation rml:SQL2008Table; - rml:iterator "Person" - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "DateOfBirth" - ]; - rml:predicate ex:BirthDay - ]; - rml:subjectMap [ - rml:template "http://example.com/Person/{ID}/{Name}/{DateOfBirth}" - ] . - - a d2rq:Database; - d2rq:jdbcDSN "CONNECTIONDSN"; - d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver"; - d2rq:password ""; - d2rq:username "root" . diff --git a/src/test/resources/rml-core/RMLTC0013a-MySQL/output.nq b/src/test/resources/rml-core/RMLTC0013a-MySQL/output.nq deleted file mode 100644 index 4b1bf1fa..00000000 --- a/src/test/resources/rml-core/RMLTC0013a-MySQL/output.nq +++ /dev/null @@ -1,3 +0,0 @@ - "September, 2010" . - - diff --git a/src/test/resources/rml-core/RMLTC0013a-MySQL/resource.sql b/src/test/resources/rml-core/RMLTC0013a-MySQL/resource.sql deleted file mode 100644 index 616495e9..00000000 --- a/src/test/resources/rml-core/RMLTC0013a-MySQL/resource.sql +++ /dev/null @@ -1,12 +0,0 @@ -USE test; -DROP TABLE IF EXISTS test.Person; - -CREATE TABLE Person ( -ID integer, -Name varchar(50), -DateOfBirth varchar(50), -PRIMARY KEY (ID) -); -INSERT INTO Person (ID, Name, DateOfBirth) VALUES (1,'Alice', NULL); -INSERT INTO Person (ID, Name, DateOfBirth) VALUES (2,'Bob', 'September, 2010'); - diff --git a/src/test/resources/rml-core/RMLTC0013a-PostgreSQL/mapping.ttl b/src/test/resources/rml-core/RMLTC0013a-PostgreSQL/mapping.ttl deleted file mode 100644 index 93d6f35b..00000000 --- a/src/test/resources/rml-core/RMLTC0013a-PostgreSQL/mapping.ttl +++ /dev/null @@ -1,25 +0,0 @@ -@prefix d2rq: . -@prefix ex: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source ; - rml:referenceFormulation rml:SQL2008Table; - rml:iterator "Person" - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "DateOfBirth" - ]; - rml:predicate ex:BirthDay - ]; - rml:subjectMap [ - rml:template "http://example.com/Person/{ID}/{Name}/{DateOfBirth}" - ] . - - a d2rq:Database; - d2rq:jdbcDSN "CONNECTIONDSN"; - d2rq:jdbcDriver "org.postgresql.Driver"; - d2rq:password ""; - d2rq:username "postgres" . diff --git a/src/test/resources/rml-core/RMLTC0013a-PostgreSQL/note.md b/src/test/resources/rml-core/RMLTC0013a-PostgreSQL/note.md deleted file mode 100644 index 026df640..00000000 --- a/src/test/resources/rml-core/RMLTC0013a-PostgreSQL/note.md +++ /dev/null @@ -1,3 +0,0 @@ -## Change note - -Changed resource.sql to use quotes for column identifiers to use case-sensitive references. diff --git a/src/test/resources/rml-core/RMLTC0013a-PostgreSQL/output.nq b/src/test/resources/rml-core/RMLTC0013a-PostgreSQL/output.nq deleted file mode 100644 index 4b1bf1fa..00000000 --- a/src/test/resources/rml-core/RMLTC0013a-PostgreSQL/output.nq +++ /dev/null @@ -1,3 +0,0 @@ - "September, 2010" . - - diff --git a/src/test/resources/rml-core/RMLTC0013a-PostgreSQL/resource.sql b/src/test/resources/rml-core/RMLTC0013a-PostgreSQL/resource.sql deleted file mode 100644 index 03a372d2..00000000 --- a/src/test/resources/rml-core/RMLTC0013a-PostgreSQL/resource.sql +++ /dev/null @@ -1,11 +0,0 @@ -DROP TABLE IF EXISTS Person; - -CREATE TABLE Person ( -"ID" integer, -"Name" varchar(50), -"DateOfBirth" varchar(50), -PRIMARY KEY ("ID") -); -INSERT INTO Person ("ID", "Name", "DateOfBirth") VALUES (1,'Alice', NULL); -INSERT INTO Person ("ID", "Name", "DateOfBirth") VALUES (2,'Bob', 'September, 2010'); - diff --git a/src/test/resources/rml-core/RMLTC0013a-SQLServer/mapping.ttl b/src/test/resources/rml-core/RMLTC0013a-SQLServer/mapping.ttl deleted file mode 100644 index f198ea56..00000000 --- a/src/test/resources/rml-core/RMLTC0013a-SQLServer/mapping.ttl +++ /dev/null @@ -1,25 +0,0 @@ -@prefix d2rq: . -@prefix ex: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source ; - rml:referenceFormulation rml:SQL2008Table; - rml:iterator "Person" - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "DateOfBirth" - ]; - rml:predicate ex:BirthDay - ]; - rml:subjectMap [ - rml:template "http://example.com/Person/{ID}/{Name}/{DateOfBirth}" - ] . - - a d2rq:Database; - d2rq:jdbcDSN "CONNECTIONDSN"; - d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver"; - d2rq:password "YourSTRONG!Passw0rd;"; - d2rq:username "sa" . diff --git a/src/test/resources/rml-core/RMLTC0013a-SQLServer/output.nq b/src/test/resources/rml-core/RMLTC0013a-SQLServer/output.nq deleted file mode 100644 index 4b1bf1fa..00000000 --- a/src/test/resources/rml-core/RMLTC0013a-SQLServer/output.nq +++ /dev/null @@ -1,3 +0,0 @@ - "September, 2010" . - - diff --git a/src/test/resources/rml-core/RMLTC0013a-SQLServer/resource.sql b/src/test/resources/rml-core/RMLTC0013a-SQLServer/resource.sql deleted file mode 100644 index dd278769..00000000 --- a/src/test/resources/rml-core/RMLTC0013a-SQLServer/resource.sql +++ /dev/null @@ -1,12 +0,0 @@ -USE TestDB; -DROP TABLE IF EXISTS Person; - -CREATE TABLE Person ( -ID integer, -Name varchar(50), -DateOfBirth varchar(50), -PRIMARY KEY (ID) -); -INSERT INTO Person (ID, Name, DateOfBirth) VALUES (1,'Alice', NULL); -INSERT INTO Person (ID, Name, DateOfBirth) VALUES (2,'Bob', 'September, 2010'); - diff --git a/src/test/resources/rml-core/RMLTC0014d-MySQL/mapping.ttl b/src/test/resources/rml-core/RMLTC0014d-MySQL/mapping.ttl deleted file mode 100644 index 7377f7b4..00000000 --- a/src/test/resources/rml-core/RMLTC0014d-MySQL/mapping.ttl +++ /dev/null @@ -1,31 +0,0 @@ -@prefix d2rq: . -@prefix ex: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator """ - SELECT EMP.*, (CASE job - WHEN 'CLERK' THEN 'general-office' - WHEN 'NIGHTGUARD' THEN 'security' - WHEN 'ENGINEER' THEN 'engineering' - END) AS ROLE FROM EMP - """; - rml:source ; - rml:referenceFormulation rml:SQL2008Query - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:template "http://data.example.com/roles/{ROLE}" - ]; - rml:predicate ex:role - ]; - rml:subjectMap [ - rml:template "http://data.example.com/employee/{empno}" - ] . - - a d2rq:Database; - d2rq:jdbcDSN "CONNECTIONDSN"; - d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver"; - d2rq:password ""; - d2rq:username "root" . diff --git a/src/test/resources/rml-core/RMLTC0014d-MySQL/output.nq b/src/test/resources/rml-core/RMLTC0014d-MySQL/output.nq deleted file mode 100644 index a1025c8a..00000000 --- a/src/test/resources/rml-core/RMLTC0014d-MySQL/output.nq +++ /dev/null @@ -1 +0,0 @@ - . diff --git a/src/test/resources/rml-core/RMLTC0014d-MySQL/resource.sql b/src/test/resources/rml-core/RMLTC0014d-MySQL/resource.sql deleted file mode 100644 index bd5eb080..00000000 --- a/src/test/resources/rml-core/RMLTC0014d-MySQL/resource.sql +++ /dev/null @@ -1,25 +0,0 @@ -USE test; -DROP TABLE IF EXISTS test.DEPT; -DROP TABLE IF EXISTS test.EMP; -DROP TABLE IF EXISTS test.LIKES; - -CREATE TABLE DEPT ( - deptno INTEGER UNIQUE, - dname VARCHAR(30), - loc VARCHAR(100)); -INSERT INTO DEPT (deptno, dname, loc) VALUES (10, 'APPSERVER', 'NEW YORK'); - -CREATE TABLE EMP ( - empno INTEGER PRIMARY KEY, - ename VARCHAR(100), - job VARCHAR(30), - deptno INTEGER REFERENCES DEPT (deptno), - etype VARCHAR(30)); -INSERT INTO EMP (empno, ename, job, deptno, etype ) VALUES (7369, 'SMITH', 'CLERK', 10, 'PART_TIME'); - -CREATE TABLE LIKES ( - id INTEGER, - likeType VARCHAR(30), - likedObj VARCHAR(100)); -INSERT INTO LIKES (id, likeType, likedObj) VALUES (7369, 'Playing', 'Soccer'); -INSERT INTO LIKES (id, likeType, likedObj) VALUES (7369, 'Watching', 'Basketball'); diff --git a/src/test/resources/rml-core/RMLTC0014d-PostgreSQL/mapping.ttl b/src/test/resources/rml-core/RMLTC0014d-PostgreSQL/mapping.ttl deleted file mode 100644 index 27108093..00000000 --- a/src/test/resources/rml-core/RMLTC0014d-PostgreSQL/mapping.ttl +++ /dev/null @@ -1,31 +0,0 @@ -@prefix d2rq: . -@prefix ex: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator """ - SELECT EMP.*, (CASE job - WHEN 'CLERK' THEN 'general-office' - WHEN 'NIGHTGUARD' THEN 'security' - WHEN 'ENGINEER' THEN 'engineering' - END) AS ROLE FROM EMP - """; - rml:source ; - rml:referenceFormulation rml:SQL2008Query - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:template "http://data.example.com/roles/{role}" - ]; - rml:predicate ex:role - ]; - rml:subjectMap [ - rml:template "http://data.example.com/employee/{empno}" - ] . - - a d2rq:Database; - d2rq:jdbcDSN "CONNECTIONDSN"; - d2rq:jdbcDriver "org.postgresql.Driver"; - d2rq:password ""; - d2rq:username "postgres" . diff --git a/src/test/resources/rml-core/RMLTC0014d-PostgreSQL/output.nq b/src/test/resources/rml-core/RMLTC0014d-PostgreSQL/output.nq deleted file mode 100644 index a1025c8a..00000000 --- a/src/test/resources/rml-core/RMLTC0014d-PostgreSQL/output.nq +++ /dev/null @@ -1 +0,0 @@ - . diff --git a/src/test/resources/rml-core/RMLTC0014d-PostgreSQL/resource.sql b/src/test/resources/rml-core/RMLTC0014d-PostgreSQL/resource.sql deleted file mode 100644 index 84570225..00000000 --- a/src/test/resources/rml-core/RMLTC0014d-PostgreSQL/resource.sql +++ /dev/null @@ -1,24 +0,0 @@ -DROP TABLE IF EXISTS LIKES; -DROP TABLE IF EXISTS EMP; -DROP TABLE IF EXISTS DEPT; - -CREATE TABLE DEPT ( - deptno INTEGER UNIQUE, - dname VARCHAR(30), - loc VARCHAR(100)); -INSERT INTO DEPT (deptno, dname, loc) VALUES (10, 'APPSERVER', 'NEW YORK'); - -CREATE TABLE EMP ( - empno INTEGER PRIMARY KEY, - ename VARCHAR(100), - job VARCHAR(30), - deptno INTEGER REFERENCES DEPT (deptno), - etype VARCHAR(30)); -INSERT INTO EMP (empno, ename, job, deptno, etype ) VALUES (7369, 'SMITH', 'CLERK', 10, 'PART_TIME'); - -CREATE TABLE LIKES ( - id INTEGER, - likeType VARCHAR(30), - likedObj VARCHAR(100)); -INSERT INTO LIKES (id, likeType, likedObj) VALUES (7369, 'Playing', 'Soccer'); -INSERT INTO LIKES (id, likeType, likedObj) VALUES (7369, 'Watching', 'Basketball'); diff --git a/src/test/resources/rml-core/RMLTC0014d-SQLServer/mapping.ttl b/src/test/resources/rml-core/RMLTC0014d-SQLServer/mapping.ttl deleted file mode 100644 index 64f797ae..00000000 --- a/src/test/resources/rml-core/RMLTC0014d-SQLServer/mapping.ttl +++ /dev/null @@ -1,31 +0,0 @@ -@prefix d2rq: . -@prefix ex: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator """ - SELECT EMP.*, (CASE job - WHEN 'CLERK' THEN 'general-office' - WHEN 'NIGHTGUARD' THEN 'security' - WHEN 'ENGINEER' THEN 'engineering' - END) AS ROLE FROM EMP - """; - rml:source ; - rml:referenceFormulation rml:SQL2008Query - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:template "http://data.example.com/roles/{ROLE}" - ]; - rml:predicate ex:role - ]; - rml:subjectMap [ - rml:template "http://data.example.com/employee/{empno}" - ] . - - a d2rq:Database; - d2rq:jdbcDSN "CONNECTIONDSN"; - d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver"; - d2rq:password "YourSTRONG!Passw0rd;"; - d2rq:username "sa" . diff --git a/src/test/resources/rml-core/RMLTC0014d-SQLServer/output.nq b/src/test/resources/rml-core/RMLTC0014d-SQLServer/output.nq deleted file mode 100644 index a1025c8a..00000000 --- a/src/test/resources/rml-core/RMLTC0014d-SQLServer/output.nq +++ /dev/null @@ -1 +0,0 @@ - . diff --git a/src/test/resources/rml-core/RMLTC0014d-SQLServer/resource.sql b/src/test/resources/rml-core/RMLTC0014d-SQLServer/resource.sql deleted file mode 100644 index d39327c0..00000000 --- a/src/test/resources/rml-core/RMLTC0014d-SQLServer/resource.sql +++ /dev/null @@ -1,24 +0,0 @@ -USE TestDB; -EXEC sp_msforeachtable 'ALTER TABLE ? NOCHECK CONSTRAINT all' -EXEC sp_msforeachtable 'DROP TABLE ?' - -CREATE TABLE DEPT ( - deptno INTEGER UNIQUE, - dname VARCHAR(30), - loc VARCHAR(100)); -INSERT INTO DEPT (deptno, dname, loc) VALUES (10, 'APPSERVER', 'NEW YORK'); - -CREATE TABLE EMP ( - empno INTEGER PRIMARY KEY, - ename VARCHAR(100), - job VARCHAR(30), - deptno INTEGER REFERENCES DEPT (deptno), - etype VARCHAR(30)); -INSERT INTO EMP (empno, ename, job, deptno, etype ) VALUES (7369, 'SMITH', 'CLERK', 10, 'PART_TIME'); - -CREATE TABLE LIKES ( - id INTEGER, - likeType VARCHAR(30), - likedObj VARCHAR(100)); -INSERT INTO LIKES (id, likeType, likedObj) VALUES (7369, 'Playing', 'Soccer'); -INSERT INTO LIKES (id, likeType, likedObj) VALUES (7369, 'Watching', 'Basketball'); diff --git a/src/test/resources/rml-core/RMLTC0015a-CSV/country_en.csv b/src/test/resources/rml-core/RMLTC0015a-CSV/country_en.csv deleted file mode 100644 index 4dd0aa39..00000000 --- a/src/test/resources/rml-core/RMLTC0015a-CSV/country_en.csv +++ /dev/null @@ -1,3 +0,0 @@ -Code,Name -BO,"Bolivia, Plurinational State of" -IE,Ireland diff --git a/src/test/resources/rml-core/RMLTC0015a-CSV/country_es.csv b/src/test/resources/rml-core/RMLTC0015a-CSV/country_es.csv deleted file mode 100644 index 63d50851..00000000 --- a/src/test/resources/rml-core/RMLTC0015a-CSV/country_es.csv +++ /dev/null @@ -1,3 +0,0 @@ -Code,Name -BO,"Estado Plurinacional de Bolivia" -IE,Irlanda diff --git a/src/test/resources/rml-core/RMLTC0015a-CSV/mapping.ttl b/src/test/resources/rml-core/RMLTC0015a-CSV/mapping.ttl deleted file mode 100644 index 61d558f6..00000000 --- a/src/test/resources/rml-core/RMLTC0015a-CSV/mapping.ttl +++ /dev/null @@ -1,40 +0,0 @@ -@prefix rdfs: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:referenceFormulation rml:CSV; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "country_en.csv" - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:language "en"; - rml:reference "Name" - ]; - rml:predicate rdfs:label - ]; - rml:subjectMap [ - rml:template "http://example.com/{Code}" - ] . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:referenceFormulation rml:CSV; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "country_es.csv" - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:language "es"; - rml:reference "Name" - ]; - rml:predicate rdfs:label - ]; - rml:subjectMap [ - rml:template "http://example.com/{Code}" - ] . diff --git a/src/test/resources/rml-core/RMLTC0015a-CSV/output.nq b/src/test/resources/rml-core/RMLTC0015a-CSV/output.nq deleted file mode 100644 index a80dd6a3..00000000 --- a/src/test/resources/rml-core/RMLTC0015a-CSV/output.nq +++ /dev/null @@ -1,6 +0,0 @@ - "Bolivia, Plurinational State of"@en . - "Estado Plurinacional de Bolivia"@es . - "Ireland"@en . - "Irlanda"@es . - - diff --git a/src/test/resources/rml-core/RMLTC0015a-JSON/README.md b/src/test/resources/rml-core/RMLTC0015a-JSON/README.md new file mode 100644 index 00000000..89812126 --- /dev/null +++ b/src/test/resources/rml-core/RMLTC0015a-JSON/README.md @@ -0,0 +1,79 @@ +## RMLTC0015a-JSON + +**Title**: "Generation of language tags from a table with language information" + +**Description**: "Generation of language tags from a table with language information" + +**Default Base IRI**: http://example.com/ + +**Error expected?** No + +**Input** +``` +{ + "countries": [ + {"Code": "BO", "Name": "Estado Plurinacional de Bolivia"}, + {"Code": "IE", "Name": "Irlanda"} + ] +} + +``` + +**Mapping** +``` +@prefix rdfs: . +@prefix rml: . + + a rml:TriplesMap; + rml:logicalSource [ a rml:LogicalSource; + rml:iterator "$.countries[*]"; + rml:referenceFormulation rml:JSONPath; + rml:source [ a rml:RelativePathSource; + rml:root rml:MappingDirectory; + rml:path "country_en.json" + ] + ]; + rml:predicateObjectMap [ + rml:objectMap [ + rml:language "en"; + rml:reference "$.Name" + ]; + rml:predicate rdfs:label + ]; + rml:subjectMap [ + rml:template "http://example.com/{$.Code}" + ] . + + a rml:TriplesMap; + rml:logicalSource [ a rml:LogicalSource; + rml:iterator "$.countries[*]"; + rml:referenceFormulation rml:JSONPath; + rml:source [ a rml:RelativePathSource; + rml:root rml:MappingDirectory; + rml:path "country_es.json" + ] + ]; + rml:predicateObjectMap [ + rml:objectMap [ + rml:language "es"; + rml:reference "$.Name" + ]; + rml:predicate rdfs:label + ]; + rml:subjectMap [ + rml:template "http://example.com/{$.Code}" + ] . + +``` + +**Output** +``` + "Bolivia, Plurinational State of"@en . + "Estado Plurinacional de Bolivia"@es . + "Ireland"@en . + "Irlanda"@es . + + + +``` + diff --git a/src/test/resources/rml-core/RMLTC0015a-JSON/mapping.ttl b/src/test/resources/rml-core/RMLTC0015a-JSON/mapping.ttl index a9e90bfb..4c3a5035 100644 --- a/src/test/resources/rml-core/RMLTC0015a-JSON/mapping.ttl +++ b/src/test/resources/rml-core/RMLTC0015a-JSON/mapping.ttl @@ -13,12 +13,12 @@ rml:predicateObjectMap [ rml:objectMap [ rml:language "en"; - rml:reference "Name" + rml:reference "$.Name" ]; rml:predicate rdfs:label ]; rml:subjectMap [ - rml:template "http://example.com/{Code}" + rml:template "http://example.com/{$.Code}" ] . a rml:TriplesMap; @@ -33,10 +33,10 @@ rml:predicateObjectMap [ rml:objectMap [ rml:language "es"; - rml:reference "Name" + rml:reference "$.Name" ]; rml:predicate rdfs:label ]; rml:subjectMap [ - rml:template "http://example.com/{Code}" + rml:template "http://example.com/{$.Code}" ] . diff --git a/src/test/resources/rml-core/RMLTC0015a-MySQL/mapping.ttl b/src/test/resources/rml-core/RMLTC0015a-MySQL/mapping.ttl deleted file mode 100644 index a09b514a..00000000 --- a/src/test/resources/rml-core/RMLTC0015a-MySQL/mapping.ttl +++ /dev/null @@ -1,51 +0,0 @@ -@prefix d2rq: . -@prefix rdfs: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator """ - SELECT Code, Name, Lan - FROM Country - WHERE Lan = 'EN'; - """; - rml:source ; - rml:referenceFormulation rml:SQL2008Query - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:language "en"; - rml:reference "Name" - ]; - rml:predicate rdfs:label - ]; - rml:subjectMap [ - rml:template "http://example.com/{Code}" - ] . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator """ - SELECT Code, Name, Lan - FROM Country - WHERE Lan = 'ES'; - """; - rml:source ; - rml:referenceFormulation rml:SQL2008Query - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:language "es"; - rml:reference "Name" - ]; - rml:predicate rdfs:label - ]; - rml:subjectMap [ - rml:template "http://example.com/{Code}" - ] . - - a d2rq:Database; - d2rq:jdbcDSN "CONNECTIONDSN"; - d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver"; - d2rq:password ""; - d2rq:username "root" . diff --git a/src/test/resources/rml-core/RMLTC0015a-MySQL/output.nq b/src/test/resources/rml-core/RMLTC0015a-MySQL/output.nq deleted file mode 100644 index a80dd6a3..00000000 --- a/src/test/resources/rml-core/RMLTC0015a-MySQL/output.nq +++ /dev/null @@ -1,6 +0,0 @@ - "Bolivia, Plurinational State of"@en . - "Estado Plurinacional de Bolivia"@es . - "Ireland"@en . - "Irlanda"@es . - - diff --git a/src/test/resources/rml-core/RMLTC0015a-MySQL/resource.sql b/src/test/resources/rml-core/RMLTC0015a-MySQL/resource.sql deleted file mode 100644 index 52a4c88e..00000000 --- a/src/test/resources/rml-core/RMLTC0015a-MySQL/resource.sql +++ /dev/null @@ -1,13 +0,0 @@ -USE test; -DROP TABLE IF EXISTS test.Country; - -CREATE TABLE Country ( - Code VARCHAR(2), - Name VARCHAR(100), - Lan VARCHAR(10), - PRIMARY KEY (Code,Lan) -); -INSERT INTO Country (Code, Name, Lan) VALUES ('BO', 'Bolivia, Plurinational State of', 'EN'); -INSERT INTO Country (Code, Name, Lan) VALUES ('BO', 'Estado Plurinacional de Bolivia', 'ES'); -INSERT INTO Country (Code, Name, Lan) VALUES ('IE', 'Ireland', 'EN'); -INSERT INTO Country (Code, Name, Lan) VALUES ('IE', 'Irlanda', 'ES'); diff --git a/src/test/resources/rml-core/RMLTC0015a-PostgreSQL/mapping.ttl b/src/test/resources/rml-core/RMLTC0015a-PostgreSQL/mapping.ttl deleted file mode 100644 index a25b190b..00000000 --- a/src/test/resources/rml-core/RMLTC0015a-PostgreSQL/mapping.ttl +++ /dev/null @@ -1,51 +0,0 @@ -@prefix d2rq: . -@prefix rdfs: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator """ - SELECT Code, Name, Lan - FROM Country - WHERE Lan = 'EN'; - """; - rml:source ; - rml:referenceFormulation rml:SQL2008Query - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:language "en"; - rml:reference "name" - ]; - rml:predicate rdfs:label - ]; - rml:subjectMap [ - rml:template "http://example.com/{code}" - ] . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator """ - SELECT Code, Name, Lan - FROM Country - WHERE Lan = 'ES'; - """; - rml:source ; - rml:referenceFormulation rml:SQL2008Query - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:language "es"; - rml:reference "name" - ]; - rml:predicate rdfs:label - ]; - rml:subjectMap [ - rml:template "http://example.com/{code}" - ] . - - a d2rq:Database; - d2rq:jdbcDSN "CONNECTIONDSN"; - d2rq:jdbcDriver "org.postgresql.Driver"; - d2rq:password ""; - d2rq:username "postgres" . diff --git a/src/test/resources/rml-core/RMLTC0015a-PostgreSQL/output.nq b/src/test/resources/rml-core/RMLTC0015a-PostgreSQL/output.nq deleted file mode 100644 index a80dd6a3..00000000 --- a/src/test/resources/rml-core/RMLTC0015a-PostgreSQL/output.nq +++ /dev/null @@ -1,6 +0,0 @@ - "Bolivia, Plurinational State of"@en . - "Estado Plurinacional de Bolivia"@es . - "Ireland"@en . - "Irlanda"@es . - - diff --git a/src/test/resources/rml-core/RMLTC0015a-PostgreSQL/resource.sql b/src/test/resources/rml-core/RMLTC0015a-PostgreSQL/resource.sql deleted file mode 100644 index 5640c8f8..00000000 --- a/src/test/resources/rml-core/RMLTC0015a-PostgreSQL/resource.sql +++ /dev/null @@ -1,12 +0,0 @@ -DROP TABLE IF EXISTS Country; - -CREATE TABLE Country ( - Code VARCHAR(2), - Name VARCHAR(100), - Lan VARCHAR(10), - PRIMARY KEY (Code,Lan) -); -INSERT INTO Country (Code, Name, Lan) VALUES ('BO', 'Bolivia, Plurinational State of', 'EN'); -INSERT INTO Country (Code, Name, Lan) VALUES ('BO', 'Estado Plurinacional de Bolivia', 'ES'); -INSERT INTO Country (Code, Name, Lan) VALUES ('IE', 'Ireland', 'EN'); -INSERT INTO Country (Code, Name, Lan) VALUES ('IE', 'Irlanda', 'ES'); diff --git a/src/test/resources/rml-core/RMLTC0015a-SQLServer/mapping.ttl b/src/test/resources/rml-core/RMLTC0015a-SQLServer/mapping.ttl deleted file mode 100644 index ceca9dad..00000000 --- a/src/test/resources/rml-core/RMLTC0015a-SQLServer/mapping.ttl +++ /dev/null @@ -1,51 +0,0 @@ -@prefix d2rq: . -@prefix rdfs: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator """ - SELECT Code, Name, Lan - FROM Country - WHERE Lan = 'EN'; - """; - rml:source ; - rml:referenceFormulation rml:SQL2008Query - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:language "en"; - rml:reference "Name" - ]; - rml:predicate rdfs:label - ]; - rml:subjectMap [ - rml:template "http://example.com/{Code}" - ] . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator """ - SELECT \"Code\", \"Name\", \"Lan\" - FROM \"Country\" - WHERE \"Lan\" = 'ES'; - """; - rml:source ; - rml:referenceFormulation rml:SQL2008Query - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:language "es"; - rml:reference "Name" - ]; - rml:predicate rdfs:label - ]; - rml:subjectMap [ - rml:template "http://example.com/{Code}" - ] . - - a d2rq:Database; - d2rq:jdbcDSN "CONNECTIONDSN"; - d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver"; - d2rq:password "YourSTRONG!Passw0rd;"; - d2rq:username "sa" . diff --git a/src/test/resources/rml-core/RMLTC0015a-SQLServer/output.nq b/src/test/resources/rml-core/RMLTC0015a-SQLServer/output.nq deleted file mode 100644 index a80dd6a3..00000000 --- a/src/test/resources/rml-core/RMLTC0015a-SQLServer/output.nq +++ /dev/null @@ -1,6 +0,0 @@ - "Bolivia, Plurinational State of"@en . - "Estado Plurinacional de Bolivia"@es . - "Ireland"@en . - "Irlanda"@es . - - diff --git a/src/test/resources/rml-core/RMLTC0015a-SQLServer/resource.sql b/src/test/resources/rml-core/RMLTC0015a-SQLServer/resource.sql deleted file mode 100644 index a0a684ef..00000000 --- a/src/test/resources/rml-core/RMLTC0015a-SQLServer/resource.sql +++ /dev/null @@ -1,13 +0,0 @@ -USE TestDB; -DROP TABLE IF EXISTS Country; - -CREATE TABLE Country ( - Code VARCHAR(2), - Name VARCHAR(100), - Lan VARCHAR(10), - PRIMARY KEY (Code,Lan) -); -INSERT INTO Country (Code, Name, Lan) VALUES ('BO', 'Bolivia, Plurinational State of', 'EN'); -INSERT INTO Country (Code, Name, Lan) VALUES ('BO', 'Estado Plurinacional de Bolivia', 'ES'); -INSERT INTO Country (Code, Name, Lan) VALUES ('IE', 'Ireland', 'EN'); -INSERT INTO Country (Code, Name, Lan) VALUES ('IE', 'Irlanda', 'ES'); diff --git a/src/test/resources/rml-core/RMLTC0015a-XML/country_en.xml b/src/test/resources/rml-core/RMLTC0015a-XML/country_en.xml deleted file mode 100644 index be754f17..00000000 --- a/src/test/resources/rml-core/RMLTC0015a-XML/country_en.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - BOBolivia, Plurinational State of - IEIreland - diff --git a/src/test/resources/rml-core/RMLTC0015a-XML/country_es.xml b/src/test/resources/rml-core/RMLTC0015a-XML/country_es.xml deleted file mode 100644 index 62bb8e4a..00000000 --- a/src/test/resources/rml-core/RMLTC0015a-XML/country_es.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - BOEstado Plurinacional de Bolivia - IEIrlanda - diff --git a/src/test/resources/rml-core/RMLTC0015a-XML/mapping.ttl b/src/test/resources/rml-core/RMLTC0015a-XML/mapping.ttl deleted file mode 100644 index 68f671ee..00000000 --- a/src/test/resources/rml-core/RMLTC0015a-XML/mapping.ttl +++ /dev/null @@ -1,42 +0,0 @@ -@prefix rdfs: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator "/countries/country"; - rml:referenceFormulation rml:XPath; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "country_en.xml" - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:language "en"; - rml:reference "Name" - ]; - rml:predicate rdfs:label - ]; - rml:subjectMap [ - rml:template "http://example.com/{Code}" - ] . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator "/countries/country"; - rml:referenceFormulation rml:XPath; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "country_es.xml" - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:language "es"; - rml:reference "Name" - ]; - rml:predicate rdfs:label - ]; - rml:subjectMap [ - rml:template "http://example.com/{Code}" - ] . diff --git a/src/test/resources/rml-core/RMLTC0015a-XML/output.nq b/src/test/resources/rml-core/RMLTC0015a-XML/output.nq deleted file mode 100644 index a80dd6a3..00000000 --- a/src/test/resources/rml-core/RMLTC0015a-XML/output.nq +++ /dev/null @@ -1,6 +0,0 @@ - "Bolivia, Plurinational State of"@en . - "Estado Plurinacional de Bolivia"@es . - "Ireland"@en . - "Irlanda"@es . - - diff --git a/src/test/resources/rml-core/RMLTC0015b-CSV/country_en.csv b/src/test/resources/rml-core/RMLTC0015b-CSV/country_en.csv deleted file mode 100644 index 4dd0aa39..00000000 --- a/src/test/resources/rml-core/RMLTC0015b-CSV/country_en.csv +++ /dev/null @@ -1,3 +0,0 @@ -Code,Name -BO,"Bolivia, Plurinational State of" -IE,Ireland diff --git a/src/test/resources/rml-core/RMLTC0015b-CSV/country_es.csv b/src/test/resources/rml-core/RMLTC0015b-CSV/country_es.csv deleted file mode 100644 index 63d50851..00000000 --- a/src/test/resources/rml-core/RMLTC0015b-CSV/country_es.csv +++ /dev/null @@ -1,3 +0,0 @@ -Code,Name -BO,"Estado Plurinacional de Bolivia" -IE,Irlanda diff --git a/src/test/resources/rml-core/RMLTC0015b-CSV/mapping.ttl b/src/test/resources/rml-core/RMLTC0015b-CSV/mapping.ttl deleted file mode 100644 index 247e382b..00000000 --- a/src/test/resources/rml-core/RMLTC0015b-CSV/mapping.ttl +++ /dev/null @@ -1,40 +0,0 @@ -@prefix rdfs: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:referenceFormulation rml:CSV; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "country_en.csv" - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:language "a-english"; - rml:reference "Name" - ]; - rml:predicate rdfs:label - ]; - rml:subjectMap [ - rml:template "http://example.com/{Code}" - ] . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:referenceFormulation rml:CSV; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "country_es.csv" - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:language "a-spanish"; - rml:reference "Name" - ]; - rml:predicate rdfs:label - ]; - rml:subjectMap [ - rml:template "http://example.com/{Code}" - ] . diff --git a/src/test/resources/rml-core/RMLTC0015b-JSON/README.md b/src/test/resources/rml-core/RMLTC0015b-JSON/README.md new file mode 100644 index 00000000..006c0dba --- /dev/null +++ b/src/test/resources/rml-core/RMLTC0015b-JSON/README.md @@ -0,0 +1,68 @@ +## RMLTC0015b-JSON + +**Title**: "Generation of language tags from a table with language information, and a term map with invalid rml:language value" + +**Description**: "Tests a term map with an invalid rml:language value, which is an error" + +**Default Base IRI**: http://example.com/ + +**Error expected?** Yes + +**Input** +``` +{ + "countries": [ + {"Code": "BO", "Name": "Estado Plurinacional de Bolivia"}, + {"Code": "IE", "Name": "Irlanda"} + ] +} + +``` + +**Mapping** +``` +@prefix rdfs: . +@prefix rml: . + + a rml:TriplesMap; + rml:logicalSource [ a rml:LogicalSource; + rml:iterator "$.countries[*]"; + rml:referenceFormulation rml:JSONPath; + rml:source [ a rml:RelativePathSource; + rml:root rml:MappingDirectory; + rml:path "country_en.json" + ] + ]; + rml:predicateObjectMap [ + rml:objectMap [ + rml:language "a-english"; + rml:reference "$.Name" + ]; + rml:predicate rdfs:label + ]; + rml:subjectMap [ + rml:template "http://example.com/{$.Code}" + ] . + + a rml:TriplesMap; + rml:logicalSource [ a rml:LogicalSource; + rml:iterator "$.countries[*]"; + rml:referenceFormulation rml:JSONPath; + rml:source [ a rml:RelativePathSource; + rml:root rml:MappingDirectory; + rml:path "country_en.json" + ] + ]; + rml:predicateObjectMap [ + rml:objectMap [ + rml:language "a-spanish"; + rml:reference "$.Name" + ]; + rml:predicate rdfs:label + ]; + rml:subjectMap [ + rml:template "http://example.com/{$.Code}" + ] . + +``` + diff --git a/src/test/resources/rml-core/RMLTC0015b-JSON/mapping.ttl b/src/test/resources/rml-core/RMLTC0015b-JSON/mapping.ttl index 168ef9d5..6f485f7d 100644 --- a/src/test/resources/rml-core/RMLTC0015b-JSON/mapping.ttl +++ b/src/test/resources/rml-core/RMLTC0015b-JSON/mapping.ttl @@ -13,12 +13,12 @@ rml:predicateObjectMap [ rml:objectMap [ rml:language "a-english"; - rml:reference "Name" + rml:reference "$.Name" ]; rml:predicate rdfs:label ]; rml:subjectMap [ - rml:template "http://example.com/{Code}" + rml:template "http://example.com/{$.Code}" ] . a rml:TriplesMap; @@ -33,10 +33,10 @@ rml:predicateObjectMap [ rml:objectMap [ rml:language "a-spanish"; - rml:reference "Name" + rml:reference "$.Name" ]; rml:predicate rdfs:label ]; rml:subjectMap [ - rml:template "http://example.com/{Code}" + rml:template "http://example.com/{$.Code}" ] . diff --git a/src/test/resources/rml-core/RMLTC0015b-MySQL/mapping.ttl b/src/test/resources/rml-core/RMLTC0015b-MySQL/mapping.ttl deleted file mode 100644 index ec8847cf..00000000 --- a/src/test/resources/rml-core/RMLTC0015b-MySQL/mapping.ttl +++ /dev/null @@ -1,51 +0,0 @@ -@prefix d2rq: . -@prefix rdfs: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator """ - SELECT Code, Name, Lan - FROM Country - WHERE Lan = 'EN'; - """; - rml:source ; - rml:referenceFormulation rml:SQL2008Query - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:language "a-english"; - rml:reference "Name" - ]; - rml:predicate rdfs:label - ]; - rml:subjectMap [ - rml:template "http://example.com/{Code}" - ] . - - a rml:TriplesMap; - rml:logicalSource [ - rml:iterator """ - SELECT Code, Name, Lan - FROM Country - WHERE Lan = 'EN'; - """; - rml:source ; - rml:referenceFormulation rml:SQL2008Query - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:language "a-spanish"; - rml:reference "Name" - ]; - rml:predicate rdfs:label - ]; - rml:subjectMap [ - rml:template "http://example.com/{Code}" - ] . - - a d2rq:Database; - d2rq:jdbcDSN "CONNECTIONDSN"; - d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver"; - d2rq:password ""; - d2rq:username "root" . diff --git a/src/test/resources/rml-core/RMLTC0015b-MySQL/resource.sql b/src/test/resources/rml-core/RMLTC0015b-MySQL/resource.sql deleted file mode 100644 index 52a4c88e..00000000 --- a/src/test/resources/rml-core/RMLTC0015b-MySQL/resource.sql +++ /dev/null @@ -1,13 +0,0 @@ -USE test; -DROP TABLE IF EXISTS test.Country; - -CREATE TABLE Country ( - Code VARCHAR(2), - Name VARCHAR(100), - Lan VARCHAR(10), - PRIMARY KEY (Code,Lan) -); -INSERT INTO Country (Code, Name, Lan) VALUES ('BO', 'Bolivia, Plurinational State of', 'EN'); -INSERT INTO Country (Code, Name, Lan) VALUES ('BO', 'Estado Plurinacional de Bolivia', 'ES'); -INSERT INTO Country (Code, Name, Lan) VALUES ('IE', 'Ireland', 'EN'); -INSERT INTO Country (Code, Name, Lan) VALUES ('IE', 'Irlanda', 'ES'); diff --git a/src/test/resources/rml-core/RMLTC0015b-PostgreSQL/mapping.ttl b/src/test/resources/rml-core/RMLTC0015b-PostgreSQL/mapping.ttl deleted file mode 100644 index f0def09e..00000000 --- a/src/test/resources/rml-core/RMLTC0015b-PostgreSQL/mapping.ttl +++ /dev/null @@ -1,51 +0,0 @@ -@prefix d2rq: . -@prefix rdfs: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:iterator """ - SELECT Code, Name, Lan - FROM Country - WHERE Lan = 'EN'; - """; - rml:source ; - rml:referenceFormulation rml:SQL2008Query - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:language "a-english"; - rml:reference "Name" - ]; - rml:predicate rdfs:label - ]; - rml:subjectMap [ - rml:template "http://example.com/{Code}" - ] . - - a rml:TriplesMap; - rml:logicalSource [ - rml:iterator """ - SELECT Code, Name, Lan - FROM Country - WHERE Lan = 'EN'; - """; - rml:source ; - rml:referenceFormulation rml:SQL2008Query - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:language "a-spanish"; - rml:reference "Name" - ]; - rml:predicate rdfs:label - ]; - rml:subjectMap [ - rml:template "http://example.com/{Code}" - ] . - - a d2rq:Database; - d2rq:jdbcDSN "CONNECTIONDSN"; - d2rq:jdbcDriver "org.postgresql.Driver"; - d2rq:password ""; - d2rq:username "postgres" . diff --git a/src/test/resources/rml-core/RMLTC0015b-PostgreSQL/resource.sql b/src/test/resources/rml-core/RMLTC0015b-PostgreSQL/resource.sql deleted file mode 100644 index 5640c8f8..00000000 --- a/src/test/resources/rml-core/RMLTC0015b-PostgreSQL/resource.sql +++ /dev/null @@ -1,12 +0,0 @@ -DROP TABLE IF EXISTS Country; - -CREATE TABLE Country ( - Code VARCHAR(2), - Name VARCHAR(100), - Lan VARCHAR(10), - PRIMARY KEY (Code,Lan) -); -INSERT INTO Country (Code, Name, Lan) VALUES ('BO', 'Bolivia, Plurinational State of', 'EN'); -INSERT INTO Country (Code, Name, Lan) VALUES ('BO', 'Estado Plurinacional de Bolivia', 'ES'); -INSERT INTO Country (Code, Name, Lan) VALUES ('IE', 'Ireland', 'EN'); -INSERT INTO Country (Code, Name, Lan) VALUES ('IE', 'Irlanda', 'ES'); diff --git a/src/test/resources/rml-core/RMLTC0015b-SQLServer/mapping.ttl b/src/test/resources/rml-core/RMLTC0015b-SQLServer/mapping.ttl deleted file mode 100644 index b1a77f3b..00000000 --- a/src/test/resources/rml-core/RMLTC0015b-SQLServer/mapping.ttl +++ /dev/null @@ -1,51 +0,0 @@ -@prefix d2rq: . -@prefix rdfs: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:iterator """ - SELECT Code, Name, Lan - FROM Country - WHERE Lan = 'EN'; - """; - rml:source ; - rml:referenceFormulation rml:SQL2008Query - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:language "a-english"; - rml:reference "Name" - ]; - rml:predicate rdfs:label - ]; - rml:subjectMap [ - rml:template "http://example.com/{Code}" - ] . - - a rml:TriplesMap; - rml:logicalSource [ - rml:iterator """ - SELECT Code, Name, Lan - FROM Country - WHERE Lan = 'EN'; - """; - rml:source ; - rml:referenceFormulation rml:SQL2008Query - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:language "a-spanish"; - rml:reference "Name" - ]; - rml:predicate rdfs:label - ]; - rml:subjectMap [ - rml:template "http://example.com/{Code}" - ] . - - a d2rq:Database; - d2rq:jdbcDSN "CONNECTIONDSN"; - d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver"; - d2rq:password "YourSTRONG!Passw0rd;"; - d2rq:username "sa" . diff --git a/src/test/resources/rml-core/RMLTC0015b-SQLServer/resource.sql b/src/test/resources/rml-core/RMLTC0015b-SQLServer/resource.sql deleted file mode 100644 index a0a684ef..00000000 --- a/src/test/resources/rml-core/RMLTC0015b-SQLServer/resource.sql +++ /dev/null @@ -1,13 +0,0 @@ -USE TestDB; -DROP TABLE IF EXISTS Country; - -CREATE TABLE Country ( - Code VARCHAR(2), - Name VARCHAR(100), - Lan VARCHAR(10), - PRIMARY KEY (Code,Lan) -); -INSERT INTO Country (Code, Name, Lan) VALUES ('BO', 'Bolivia, Plurinational State of', 'EN'); -INSERT INTO Country (Code, Name, Lan) VALUES ('BO', 'Estado Plurinacional de Bolivia', 'ES'); -INSERT INTO Country (Code, Name, Lan) VALUES ('IE', 'Ireland', 'EN'); -INSERT INTO Country (Code, Name, Lan) VALUES ('IE', 'Irlanda', 'ES'); diff --git a/src/test/resources/rml-core/RMLTC0015b-XML/country_en.xml b/src/test/resources/rml-core/RMLTC0015b-XML/country_en.xml deleted file mode 100644 index be754f17..00000000 --- a/src/test/resources/rml-core/RMLTC0015b-XML/country_en.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - BOBolivia, Plurinational State of - IEIreland - diff --git a/src/test/resources/rml-core/RMLTC0015b-XML/country_es.xml b/src/test/resources/rml-core/RMLTC0015b-XML/country_es.xml deleted file mode 100644 index 62bb8e4a..00000000 --- a/src/test/resources/rml-core/RMLTC0015b-XML/country_es.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - BOEstado Plurinacional de Bolivia - IEIrlanda - diff --git a/src/test/resources/rml-core/RMLTC0015b-XML/mapping.ttl b/src/test/resources/rml-core/RMLTC0015b-XML/mapping.ttl deleted file mode 100644 index 41211467..00000000 --- a/src/test/resources/rml-core/RMLTC0015b-XML/mapping.ttl +++ /dev/null @@ -1,42 +0,0 @@ -@prefix rdfs: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator "/countries/country"; - rml:referenceFormulation rml:XPath; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "country_en.xml" - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:language "a-english"; - rml:reference "Name" - ]; - rml:predicate rdfs:label - ]; - rml:subjectMap [ - rml:template "http://example.com/{Code}" - ] . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator "/countries/country"; - rml:referenceFormulation rml:XPath; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "country_es.xml" - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:language "a-spanish"; - rml:reference "Name" - ]; - rml:predicate rdfs:label - ]; - rml:subjectMap [ - rml:template "http://example.com/{Code}" - ] . diff --git a/src/test/resources/rml-core/RMLTC0016a-MySQL/mapping.ttl b/src/test/resources/rml-core/RMLTC0016a-MySQL/mapping.ttl deleted file mode 100644 index 7d8ac19c..00000000 --- a/src/test/resources/rml-core/RMLTC0016a-MySQL/mapping.ttl +++ /dev/null @@ -1,45 +0,0 @@ -@prefix d2rq: . -@prefix ex: . -@prefix foaf: . -@prefix rdf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source ; - rml:referenceFormulation rml:SQL2008Table; - rml:iterator "Patient" - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "Sex" - ]; - rml:predicate ex:gender - ], [ - rml:object foaf:Person; - rml:predicate rdf:type - ], [ - rml:objectMap [ - rml:reference "ID" - ]; - rml:predicate ex:id - ], [ - rml:objectMap [ - rml:reference "FirstName" - ]; - rml:predicate ex:firstName - ], [ - rml:objectMap [ - rml:reference "LastName" - ]; - rml:predicate ex:lastName - ]; - rml:subjectMap [ - rml:template "http://example.com/Patient/{ID}" - ] . - - a d2rq:Database; - d2rq:jdbcDSN "CONNECTIONDSN"; - d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver"; - d2rq:password ""; - d2rq:username "root" . diff --git a/src/test/resources/rml-core/RMLTC0016a-MySQL/output.nq b/src/test/resources/rml-core/RMLTC0016a-MySQL/output.nq deleted file mode 100644 index c854ecf9..00000000 --- a/src/test/resources/rml-core/RMLTC0016a-MySQL/output.nq +++ /dev/null @@ -1,16 +0,0 @@ - . - "10"^^ . - "Monica" . - "Geller" . - "female" . - . - "11"^^ . - "Rachel" . - "Green" . - "female" . - . - "12"^^ . - "Chandler" . - "Bing" . - "male" . - diff --git a/src/test/resources/rml-core/RMLTC0016a-MySQL/resource.sql b/src/test/resources/rml-core/RMLTC0016a-MySQL/resource.sql deleted file mode 100644 index 1b0346e7..00000000 --- a/src/test/resources/rml-core/RMLTC0016a-MySQL/resource.sql +++ /dev/null @@ -1,28 +0,0 @@ -USE test; -DROP TABLE IF EXISTS test.Patient; - -CREATE TABLE Patient ( -ID INTEGER, -FirstName VARCHAR(50), -LastName VARCHAR(50), -Sex VARCHAR(6), -Weight REAL, -Height FLOAT, -BirthDate DATE, -EntranceDate TIMESTAMP, -PaidInAdvance BOOLEAN, -Photo VARBINARY(200), -PRIMARY KEY (ID) -); - -INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo) -VALUES (10,'Monica','Geller','female',80.25,1.65,'1981-10-10','2009-10-10 12:12:22',FALSE, -X'89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFEBFC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082'); - -INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo) -VALUES (11,'Rachel','Green','female',70.22,1.70,'1982-11-12','2008-11-12 09:45:44',TRUE, -X'89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFF3FC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082'); - -INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo) -VALUES (12,'Chandler','Bing','male',90.31,1.76,'1978-04-06','2007-03-12 02:13:14',TRUE, -X'89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFEBFC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082'); diff --git a/src/test/resources/rml-core/RMLTC0016a-PostgreSQL/mapping.ttl b/src/test/resources/rml-core/RMLTC0016a-PostgreSQL/mapping.ttl deleted file mode 100644 index 18ede22b..00000000 --- a/src/test/resources/rml-core/RMLTC0016a-PostgreSQL/mapping.ttl +++ /dev/null @@ -1,45 +0,0 @@ -@prefix d2rq: . -@prefix ex: . -@prefix foaf: . -@prefix rdf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source ; - rml:referenceFormulation rml:SQL2008Table; - rml:iterator "Patient" - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "sex" - ]; - rml:predicate ex:gender - ], [ - rml:object foaf:Person; - rml:predicate rdf:type - ], [ - rml:objectMap [ - rml:reference "id" - ]; - rml:predicate ex:id - ], [ - rml:objectMap [ - rml:reference "firstname" - ]; - rml:predicate ex:firstName - ], [ - rml:objectMap [ - rml:reference "lastname" - ]; - rml:predicate ex:lastName - ]; - rml:subjectMap [ - rml:template "http://example.com/Patient/{id}" - ] . - - a d2rq:Database; - d2rq:jdbcDSN "CONNECTIONDSN"; - d2rq:jdbcDriver "org.postgresql.Driver"; - d2rq:password ""; - d2rq:username "postgres" . diff --git a/src/test/resources/rml-core/RMLTC0016a-PostgreSQL/output.nq b/src/test/resources/rml-core/RMLTC0016a-PostgreSQL/output.nq deleted file mode 100644 index c854ecf9..00000000 --- a/src/test/resources/rml-core/RMLTC0016a-PostgreSQL/output.nq +++ /dev/null @@ -1,16 +0,0 @@ - . - "10"^^ . - "Monica" . - "Geller" . - "female" . - . - "11"^^ . - "Rachel" . - "Green" . - "female" . - . - "12"^^ . - "Chandler" . - "Bing" . - "male" . - diff --git a/src/test/resources/rml-core/RMLTC0016a-PostgreSQL/resource.sql b/src/test/resources/rml-core/RMLTC0016a-PostgreSQL/resource.sql deleted file mode 100644 index 3fa73e67..00000000 --- a/src/test/resources/rml-core/RMLTC0016a-PostgreSQL/resource.sql +++ /dev/null @@ -1,27 +0,0 @@ -DROP TABLE IF EXISTS Patient; - -CREATE TABLE Patient ( -ID INTEGER, -FirstName VARCHAR(50), -LastName VARCHAR(50), -Sex VARCHAR(6), -Weight REAL, -Height FLOAT, -BirthDate DATE, -EntranceDate TIMESTAMP, -PaidInAdvance BOOLEAN, -Photo BYTEA, -PRIMARY KEY (ID) -); - -INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo) -VALUES (10,'Monica','Geller','female',80.25,1.65,'1981-10-10','2009-10-10 12:12:22',FALSE, -'\\x89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFEBFC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082'); - -INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo) -VALUES (11,'Rachel','Green','female',70.22,1.70,'1982-11-12','2008-11-12 09:45:44',TRUE, -'\\x89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFF3FC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082'); - -INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo) -VALUES (12,'Chandler','Bing','male',90.31,1.76,'1978-04-06','2007-03-12 02:13:14',TRUE, -'\\x89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFEBFC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082'); diff --git a/src/test/resources/rml-core/RMLTC0016a-SQLServer/mapping.ttl b/src/test/resources/rml-core/RMLTC0016a-SQLServer/mapping.ttl deleted file mode 100644 index 29373f89..00000000 --- a/src/test/resources/rml-core/RMLTC0016a-SQLServer/mapping.ttl +++ /dev/null @@ -1,45 +0,0 @@ -@prefix d2rq: . -@prefix ex: . -@prefix foaf: . -@prefix rdf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source ; - rml:referenceFormulation rml:SQL2008Table; - rml:iterator "Patient" - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "Sex" - ]; - rml:predicate ex:gender - ], [ - rml:object foaf:Person; - rml:predicate rdf:type - ], [ - rml:objectMap [ - rml:reference "ID" - ]; - rml:predicate ex:id - ], [ - rml:objectMap [ - rml:reference "FirstName" - ]; - rml:predicate ex:firstName - ], [ - rml:objectMap [ - rml:reference "LastName" - ]; - rml:predicate ex:lastName - ]; - rml:subjectMap [ - rml:template "http://example.com/Patient/{ID}" - ] . - - a d2rq:Database; - d2rq:jdbcDSN "CONNECTIONDSN"; - d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver"; - d2rq:password "YourSTRONG!Passw0rd;"; - d2rq:username "sa" . diff --git a/src/test/resources/rml-core/RMLTC0016a-SQLServer/output.nq b/src/test/resources/rml-core/RMLTC0016a-SQLServer/output.nq deleted file mode 100644 index c854ecf9..00000000 --- a/src/test/resources/rml-core/RMLTC0016a-SQLServer/output.nq +++ /dev/null @@ -1,16 +0,0 @@ - . - "10"^^ . - "Monica" . - "Geller" . - "female" . - . - "11"^^ . - "Rachel" . - "Green" . - "female" . - . - "12"^^ . - "Chandler" . - "Bing" . - "male" . - diff --git a/src/test/resources/rml-core/RMLTC0016a-SQLServer/resource.sql b/src/test/resources/rml-core/RMLTC0016a-SQLServer/resource.sql deleted file mode 100644 index e1607220..00000000 --- a/src/test/resources/rml-core/RMLTC0016a-SQLServer/resource.sql +++ /dev/null @@ -1,28 +0,0 @@ -USE TestDB; -DROP TABLE IF EXISTS Patient; - -CREATE TABLE Patient ( -ID INTEGER, -FirstName VARCHAR(50), -LastName VARCHAR(50), -Sex VARCHAR(6), -Weight REAL, -Height FLOAT, -BirthDate DATE, -EntranceDate DATETIME, -PaidInAdvance BIT, -Photo VARBINARY(200), -PRIMARY KEY (ID) -); - -INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo) -VALUES (10,'Monica','Geller','female',80.25,1.65,'1981-10-10','2009-10-10 12:12:22',0, -CAST('89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFEBFC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082' as VARBINARY)); - -INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo) -VALUES (11,'Rachel','Green','female',70.22,1.70,'1982-11-12','2008-11-12 09:45:44',1, -CAST('89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFF3FC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082' as VARBINARY)); - -INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo) -VALUES (12,'Chandler','Bing','male',90.31,1.76,'1978-04-06','2007-03-12 02:13:14',1, -CAST('89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFEBFC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082' as VARBINARY)); diff --git a/src/test/resources/rml-core/RMLTC0016b-MySQL/mapping.ttl b/src/test/resources/rml-core/RMLTC0016b-MySQL/mapping.ttl deleted file mode 100644 index bafd2c79..00000000 --- a/src/test/resources/rml-core/RMLTC0016b-MySQL/mapping.ttl +++ /dev/null @@ -1,35 +0,0 @@ -@prefix d2rq: . -@prefix ex: . -@prefix foaf: . -@prefix rdf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source ; - rml:referenceFormulation rml:SQL2008Table; - rml:iterator "Patient" - ]; - rml:predicateObjectMap [ - rml:object foaf:Person; - rml:predicate rdf:type - ], [ - rml:objectMap [ - rml:reference "Weight" - ]; - rml:predicate ex:weight - ], [ - rml:objectMap [ - rml:reference "Height" - ]; - rml:predicate ex:height - ]; - rml:subjectMap [ - rml:template "http://example.com/Patient{ID}" - ] . - - a d2rq:Database; - d2rq:jdbcDSN "CONNECTIONDSN"; - d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver"; - d2rq:password ""; - d2rq:username "root" . diff --git a/src/test/resources/rml-core/RMLTC0016b-MySQL/output.nq b/src/test/resources/rml-core/RMLTC0016b-MySQL/output.nq deleted file mode 100644 index 0801105b..00000000 --- a/src/test/resources/rml-core/RMLTC0016b-MySQL/output.nq +++ /dev/null @@ -1,9 +0,0 @@ - . - "8.025E1"^^ . - "1.65E0"^^ . - . - "7.022E1"^^ . - "1.7E0"^^ . - . - "9.031E1"^^ . - "1.76E0"^^ . diff --git a/src/test/resources/rml-core/RMLTC0016b-MySQL/resource.sql b/src/test/resources/rml-core/RMLTC0016b-MySQL/resource.sql deleted file mode 100644 index 1b0346e7..00000000 --- a/src/test/resources/rml-core/RMLTC0016b-MySQL/resource.sql +++ /dev/null @@ -1,28 +0,0 @@ -USE test; -DROP TABLE IF EXISTS test.Patient; - -CREATE TABLE Patient ( -ID INTEGER, -FirstName VARCHAR(50), -LastName VARCHAR(50), -Sex VARCHAR(6), -Weight REAL, -Height FLOAT, -BirthDate DATE, -EntranceDate TIMESTAMP, -PaidInAdvance BOOLEAN, -Photo VARBINARY(200), -PRIMARY KEY (ID) -); - -INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo) -VALUES (10,'Monica','Geller','female',80.25,1.65,'1981-10-10','2009-10-10 12:12:22',FALSE, -X'89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFEBFC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082'); - -INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo) -VALUES (11,'Rachel','Green','female',70.22,1.70,'1982-11-12','2008-11-12 09:45:44',TRUE, -X'89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFF3FC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082'); - -INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo) -VALUES (12,'Chandler','Bing','male',90.31,1.76,'1978-04-06','2007-03-12 02:13:14',TRUE, -X'89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFEBFC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082'); diff --git a/src/test/resources/rml-core/RMLTC0016b-PostgreSQL/mapping.ttl b/src/test/resources/rml-core/RMLTC0016b-PostgreSQL/mapping.ttl deleted file mode 100644 index 14b93e75..00000000 --- a/src/test/resources/rml-core/RMLTC0016b-PostgreSQL/mapping.ttl +++ /dev/null @@ -1,35 +0,0 @@ -@prefix d2rq: . -@prefix ex: . -@prefix foaf: . -@prefix rdf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source ; - rml:referenceFormulation rml:SQL2008Table; - rml:iterator "Patient" - ]; - rml:predicateObjectMap [ - rml:object foaf:Person; - rml:predicate rdf:type - ], [ - rml:objectMap [ - rml:reference "weight" - ]; - rml:predicate ex:weight - ], [ - rml:objectMap [ - rml:reference "height" - ]; - rml:predicate ex:height - ]; - rml:subjectMap [ - rml:template "http://example.com/Patient{id}" - ] . - - a d2rq:Database; - d2rq:jdbcDSN "CONNECTIONDSN"; - d2rq:jdbcDriver "org.postgresql.Driver"; - d2rq:password ""; - d2rq:username "postgres" . diff --git a/src/test/resources/rml-core/RMLTC0016b-PostgreSQL/output.nq b/src/test/resources/rml-core/RMLTC0016b-PostgreSQL/output.nq deleted file mode 100644 index 0801105b..00000000 --- a/src/test/resources/rml-core/RMLTC0016b-PostgreSQL/output.nq +++ /dev/null @@ -1,9 +0,0 @@ - . - "8.025E1"^^ . - "1.65E0"^^ . - . - "7.022E1"^^ . - "1.7E0"^^ . - . - "9.031E1"^^ . - "1.76E0"^^ . diff --git a/src/test/resources/rml-core/RMLTC0016b-PostgreSQL/resource.sql b/src/test/resources/rml-core/RMLTC0016b-PostgreSQL/resource.sql deleted file mode 100644 index 3fa73e67..00000000 --- a/src/test/resources/rml-core/RMLTC0016b-PostgreSQL/resource.sql +++ /dev/null @@ -1,27 +0,0 @@ -DROP TABLE IF EXISTS Patient; - -CREATE TABLE Patient ( -ID INTEGER, -FirstName VARCHAR(50), -LastName VARCHAR(50), -Sex VARCHAR(6), -Weight REAL, -Height FLOAT, -BirthDate DATE, -EntranceDate TIMESTAMP, -PaidInAdvance BOOLEAN, -Photo BYTEA, -PRIMARY KEY (ID) -); - -INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo) -VALUES (10,'Monica','Geller','female',80.25,1.65,'1981-10-10','2009-10-10 12:12:22',FALSE, -'\\x89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFEBFC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082'); - -INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo) -VALUES (11,'Rachel','Green','female',70.22,1.70,'1982-11-12','2008-11-12 09:45:44',TRUE, -'\\x89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFF3FC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082'); - -INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo) -VALUES (12,'Chandler','Bing','male',90.31,1.76,'1978-04-06','2007-03-12 02:13:14',TRUE, -'\\x89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFEBFC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082'); diff --git a/src/test/resources/rml-core/RMLTC0016b-SQLServer/mapping.ttl b/src/test/resources/rml-core/RMLTC0016b-SQLServer/mapping.ttl deleted file mode 100644 index e0e8d53b..00000000 --- a/src/test/resources/rml-core/RMLTC0016b-SQLServer/mapping.ttl +++ /dev/null @@ -1,35 +0,0 @@ -@prefix d2rq: . -@prefix ex: . -@prefix foaf: . -@prefix rdf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source ; - rml:referenceFormulation rml:SQL2008Table; - rml:iterator "Patient" - ]; - rml:predicateObjectMap [ - rml:object foaf:Person; - rml:predicate rdf:type - ], [ - rml:objectMap [ - rml:reference "Weight" - ]; - rml:predicate ex:weight - ], [ - rml:objectMap [ - rml:reference "Height" - ]; - rml:predicate ex:height - ]; - rml:subjectMap [ - rml:template "http://example.com/Patient{ID}" - ] . - - a d2rq:Database; - d2rq:jdbcDSN "CONNECTIONDSN"; - d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver"; - d2rq:password "YourSTRONG!Passw0rd;"; - d2rq:username "sa" . diff --git a/src/test/resources/rml-core/RMLTC0016b-SQLServer/output.nq b/src/test/resources/rml-core/RMLTC0016b-SQLServer/output.nq deleted file mode 100644 index 0801105b..00000000 --- a/src/test/resources/rml-core/RMLTC0016b-SQLServer/output.nq +++ /dev/null @@ -1,9 +0,0 @@ - . - "8.025E1"^^ . - "1.65E0"^^ . - . - "7.022E1"^^ . - "1.7E0"^^ . - . - "9.031E1"^^ . - "1.76E0"^^ . diff --git a/src/test/resources/rml-core/RMLTC0016b-SQLServer/resource.sql b/src/test/resources/rml-core/RMLTC0016b-SQLServer/resource.sql deleted file mode 100644 index e1607220..00000000 --- a/src/test/resources/rml-core/RMLTC0016b-SQLServer/resource.sql +++ /dev/null @@ -1,28 +0,0 @@ -USE TestDB; -DROP TABLE IF EXISTS Patient; - -CREATE TABLE Patient ( -ID INTEGER, -FirstName VARCHAR(50), -LastName VARCHAR(50), -Sex VARCHAR(6), -Weight REAL, -Height FLOAT, -BirthDate DATE, -EntranceDate DATETIME, -PaidInAdvance BIT, -Photo VARBINARY(200), -PRIMARY KEY (ID) -); - -INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo) -VALUES (10,'Monica','Geller','female',80.25,1.65,'1981-10-10','2009-10-10 12:12:22',0, -CAST('89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFEBFC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082' as VARBINARY)); - -INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo) -VALUES (11,'Rachel','Green','female',70.22,1.70,'1982-11-12','2008-11-12 09:45:44',1, -CAST('89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFF3FC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082' as VARBINARY)); - -INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo) -VALUES (12,'Chandler','Bing','male',90.31,1.76,'1978-04-06','2007-03-12 02:13:14',1, -CAST('89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFEBFC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082' as VARBINARY)); diff --git a/src/test/resources/rml-core/RMLTC0016c-MySQL/mapping.ttl b/src/test/resources/rml-core/RMLTC0016c-MySQL/mapping.ttl deleted file mode 100644 index ea0d4e4e..00000000 --- a/src/test/resources/rml-core/RMLTC0016c-MySQL/mapping.ttl +++ /dev/null @@ -1,35 +0,0 @@ -@prefix d2rq: . -@prefix ex: . -@prefix foaf: . -@prefix rdf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source ; - rml:referenceFormulation rml:SQL2008Table; - rml:iterator "Patient" - ]; - rml:predicateObjectMap [ - rml:object foaf:Person; - rml:predicate rdf:type - ], [ - rml:objectMap [ - rml:reference "BirthDate" - ]; - rml:predicate ex:birthdate - ], [ - rml:objectMap [ - rml:reference "EntranceDate" - ]; - rml:predicate ex:entrancedate - ]; - rml:subjectMap [ - rml:template "http://example.com/Patient{ID}" - ] . - - a d2rq:Database; - d2rq:jdbcDSN "CONNECTIONDSN"; - d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver"; - d2rq:password ""; - d2rq:username "root" . diff --git a/src/test/resources/rml-core/RMLTC0016c-MySQL/output.nq b/src/test/resources/rml-core/RMLTC0016c-MySQL/output.nq deleted file mode 100644 index 020b5b7c..00000000 --- a/src/test/resources/rml-core/RMLTC0016c-MySQL/output.nq +++ /dev/null @@ -1,9 +0,0 @@ - . - "1981-10-10"^^ . - "2009-10-10T12:12:22"^^ . - . - "1982-11-12"^^ . - "2008-11-12T09:45:44"^^ . - . - "1978-04-06"^^ . - "2007-03-12T02:13:14"^^ . diff --git a/src/test/resources/rml-core/RMLTC0016c-MySQL/resource.sql b/src/test/resources/rml-core/RMLTC0016c-MySQL/resource.sql deleted file mode 100644 index 1b0346e7..00000000 --- a/src/test/resources/rml-core/RMLTC0016c-MySQL/resource.sql +++ /dev/null @@ -1,28 +0,0 @@ -USE test; -DROP TABLE IF EXISTS test.Patient; - -CREATE TABLE Patient ( -ID INTEGER, -FirstName VARCHAR(50), -LastName VARCHAR(50), -Sex VARCHAR(6), -Weight REAL, -Height FLOAT, -BirthDate DATE, -EntranceDate TIMESTAMP, -PaidInAdvance BOOLEAN, -Photo VARBINARY(200), -PRIMARY KEY (ID) -); - -INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo) -VALUES (10,'Monica','Geller','female',80.25,1.65,'1981-10-10','2009-10-10 12:12:22',FALSE, -X'89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFEBFC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082'); - -INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo) -VALUES (11,'Rachel','Green','female',70.22,1.70,'1982-11-12','2008-11-12 09:45:44',TRUE, -X'89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFF3FC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082'); - -INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo) -VALUES (12,'Chandler','Bing','male',90.31,1.76,'1978-04-06','2007-03-12 02:13:14',TRUE, -X'89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFEBFC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082'); diff --git a/src/test/resources/rml-core/RMLTC0016c-PostgreSQL/mapping.ttl b/src/test/resources/rml-core/RMLTC0016c-PostgreSQL/mapping.ttl deleted file mode 100644 index b7eba2d1..00000000 --- a/src/test/resources/rml-core/RMLTC0016c-PostgreSQL/mapping.ttl +++ /dev/null @@ -1,35 +0,0 @@ -@prefix d2rq: . -@prefix ex: . -@prefix foaf: . -@prefix rdf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source ; - rml:referenceFormulation rml:SQL2008Table; - rml:iterator "Patient" - ]; - rml:predicateObjectMap [ - rml:object foaf:Person; - rml:predicate rdf:type - ], [ - rml:objectMap [ - rml:reference "birthdate" - ]; - rml:predicate ex:birthdate - ], [ - rml:objectMap [ - rml:reference "entrancedate" - ]; - rml:predicate ex:entrancedate - ]; - rml:subjectMap [ - rml:template "http://example.com/Patient{id}" - ] . - - a d2rq:Database; - d2rq:jdbcDSN "CONNECTIONDSN"; - d2rq:jdbcDriver "org.postgresql.Driver"; - d2rq:password ""; - d2rq:username "postgres" . diff --git a/src/test/resources/rml-core/RMLTC0016c-PostgreSQL/output.nq b/src/test/resources/rml-core/RMLTC0016c-PostgreSQL/output.nq deleted file mode 100644 index 020b5b7c..00000000 --- a/src/test/resources/rml-core/RMLTC0016c-PostgreSQL/output.nq +++ /dev/null @@ -1,9 +0,0 @@ - . - "1981-10-10"^^ . - "2009-10-10T12:12:22"^^ . - . - "1982-11-12"^^ . - "2008-11-12T09:45:44"^^ . - . - "1978-04-06"^^ . - "2007-03-12T02:13:14"^^ . diff --git a/src/test/resources/rml-core/RMLTC0016c-PostgreSQL/resource.sql b/src/test/resources/rml-core/RMLTC0016c-PostgreSQL/resource.sql deleted file mode 100644 index 3fa73e67..00000000 --- a/src/test/resources/rml-core/RMLTC0016c-PostgreSQL/resource.sql +++ /dev/null @@ -1,27 +0,0 @@ -DROP TABLE IF EXISTS Patient; - -CREATE TABLE Patient ( -ID INTEGER, -FirstName VARCHAR(50), -LastName VARCHAR(50), -Sex VARCHAR(6), -Weight REAL, -Height FLOAT, -BirthDate DATE, -EntranceDate TIMESTAMP, -PaidInAdvance BOOLEAN, -Photo BYTEA, -PRIMARY KEY (ID) -); - -INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo) -VALUES (10,'Monica','Geller','female',80.25,1.65,'1981-10-10','2009-10-10 12:12:22',FALSE, -'\\x89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFEBFC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082'); - -INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo) -VALUES (11,'Rachel','Green','female',70.22,1.70,'1982-11-12','2008-11-12 09:45:44',TRUE, -'\\x89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFF3FC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082'); - -INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo) -VALUES (12,'Chandler','Bing','male',90.31,1.76,'1978-04-06','2007-03-12 02:13:14',TRUE, -'\\x89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFEBFC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082'); diff --git a/src/test/resources/rml-core/RMLTC0016c-SQLServer/mapping.ttl b/src/test/resources/rml-core/RMLTC0016c-SQLServer/mapping.ttl deleted file mode 100644 index ead4ab31..00000000 --- a/src/test/resources/rml-core/RMLTC0016c-SQLServer/mapping.ttl +++ /dev/null @@ -1,35 +0,0 @@ -@prefix d2rq: . -@prefix ex: . -@prefix foaf: . -@prefix rdf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source ; - rml:referenceFormulation rml:SQL2008Table; - rml:iterator "Patient" - ]; - rml:predicateObjectMap [ - rml:object foaf:Person; - rml:predicate rdf:type - ], [ - rml:objectMap [ - rml:reference "BirthDate" - ]; - rml:predicate ex:birthdate - ], [ - rml:objectMap [ - rml:reference "EntranceDate" - ]; - rml:predicate ex:entrancedate - ]; - rml:subjectMap [ - rml:template "http://example.com/Patient{ID}" - ] . - - a d2rq:Database; - d2rq:jdbcDSN "CONNECTIONDSN"; - d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver"; - d2rq:password "YourSTRONG!Passw0rd;"; - d2rq:username "sa" . diff --git a/src/test/resources/rml-core/RMLTC0016c-SQLServer/output.nq b/src/test/resources/rml-core/RMLTC0016c-SQLServer/output.nq deleted file mode 100644 index 020b5b7c..00000000 --- a/src/test/resources/rml-core/RMLTC0016c-SQLServer/output.nq +++ /dev/null @@ -1,9 +0,0 @@ - . - "1981-10-10"^^ . - "2009-10-10T12:12:22"^^ . - . - "1982-11-12"^^ . - "2008-11-12T09:45:44"^^ . - . - "1978-04-06"^^ . - "2007-03-12T02:13:14"^^ . diff --git a/src/test/resources/rml-core/RMLTC0016c-SQLServer/resource.sql b/src/test/resources/rml-core/RMLTC0016c-SQLServer/resource.sql deleted file mode 100644 index e1607220..00000000 --- a/src/test/resources/rml-core/RMLTC0016c-SQLServer/resource.sql +++ /dev/null @@ -1,28 +0,0 @@ -USE TestDB; -DROP TABLE IF EXISTS Patient; - -CREATE TABLE Patient ( -ID INTEGER, -FirstName VARCHAR(50), -LastName VARCHAR(50), -Sex VARCHAR(6), -Weight REAL, -Height FLOAT, -BirthDate DATE, -EntranceDate DATETIME, -PaidInAdvance BIT, -Photo VARBINARY(200), -PRIMARY KEY (ID) -); - -INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo) -VALUES (10,'Monica','Geller','female',80.25,1.65,'1981-10-10','2009-10-10 12:12:22',0, -CAST('89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFEBFC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082' as VARBINARY)); - -INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo) -VALUES (11,'Rachel','Green','female',70.22,1.70,'1982-11-12','2008-11-12 09:45:44',1, -CAST('89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFF3FC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082' as VARBINARY)); - -INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo) -VALUES (12,'Chandler','Bing','male',90.31,1.76,'1978-04-06','2007-03-12 02:13:14',1, -CAST('89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFEBFC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082' as VARBINARY)); diff --git a/src/test/resources/rml-core/RMLTC0016d-MySQL/mapping.ttl b/src/test/resources/rml-core/RMLTC0016d-MySQL/mapping.ttl deleted file mode 100644 index 4164f6f2..00000000 --- a/src/test/resources/rml-core/RMLTC0016d-MySQL/mapping.ttl +++ /dev/null @@ -1,30 +0,0 @@ -@prefix d2rq: . -@prefix ex: . -@prefix foaf: . -@prefix rdf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source ; - rml:referenceFormulation rml:SQL2008Table; - rml:iterator "Patient" - ]; - rml:predicateObjectMap [ - rml:object foaf:Person; - rml:predicate rdf:type - ], [ - rml:objectMap [ - rml:reference "PaidInAdvance" - ]; - rml:predicate ex:paid - ]; - rml:subjectMap [ - rml:template "http://example.com/Patient{ID}" - ] . - - a d2rq:Database; - d2rq:jdbcDSN "CONNECTIONDSN"; - d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver"; - d2rq:password ""; - d2rq:username "root" . diff --git a/src/test/resources/rml-core/RMLTC0016d-MySQL/output.nq b/src/test/resources/rml-core/RMLTC0016d-MySQL/output.nq deleted file mode 100644 index 578b074e..00000000 --- a/src/test/resources/rml-core/RMLTC0016d-MySQL/output.nq +++ /dev/null @@ -1,6 +0,0 @@ - . - "false"^^ . - . - "true"^^ . - . - "true"^^ . diff --git a/src/test/resources/rml-core/RMLTC0016d-MySQL/resource.sql b/src/test/resources/rml-core/RMLTC0016d-MySQL/resource.sql deleted file mode 100644 index 1b0346e7..00000000 --- a/src/test/resources/rml-core/RMLTC0016d-MySQL/resource.sql +++ /dev/null @@ -1,28 +0,0 @@ -USE test; -DROP TABLE IF EXISTS test.Patient; - -CREATE TABLE Patient ( -ID INTEGER, -FirstName VARCHAR(50), -LastName VARCHAR(50), -Sex VARCHAR(6), -Weight REAL, -Height FLOAT, -BirthDate DATE, -EntranceDate TIMESTAMP, -PaidInAdvance BOOLEAN, -Photo VARBINARY(200), -PRIMARY KEY (ID) -); - -INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo) -VALUES (10,'Monica','Geller','female',80.25,1.65,'1981-10-10','2009-10-10 12:12:22',FALSE, -X'89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFEBFC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082'); - -INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo) -VALUES (11,'Rachel','Green','female',70.22,1.70,'1982-11-12','2008-11-12 09:45:44',TRUE, -X'89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFF3FC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082'); - -INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo) -VALUES (12,'Chandler','Bing','male',90.31,1.76,'1978-04-06','2007-03-12 02:13:14',TRUE, -X'89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFEBFC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082'); diff --git a/src/test/resources/rml-core/RMLTC0016d-PostgreSQL/mapping.ttl b/src/test/resources/rml-core/RMLTC0016d-PostgreSQL/mapping.ttl deleted file mode 100644 index 5105f9af..00000000 --- a/src/test/resources/rml-core/RMLTC0016d-PostgreSQL/mapping.ttl +++ /dev/null @@ -1,30 +0,0 @@ -@prefix d2rq: . -@prefix ex: . -@prefix foaf: . -@prefix rdf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source ; - rml:referenceFormulation rml:SQL2008Table; - rml:iterator "Patient" - ]; - rml:predicateObjectMap [ - rml:object foaf:Person; - rml:predicate rdf:type - ], [ - rml:objectMap [ - rml:reference "paidinadvance" - ]; - rml:predicate ex:paid - ]; - rml:subjectMap [ - rml:template "http://example.com/Patient{id}" - ] . - - a d2rq:Database; - d2rq:jdbcDSN "CONNECTIONDSN"; - d2rq:jdbcDriver "org.postgresql.Driver"; - d2rq:password ""; - d2rq:username "postgres" . diff --git a/src/test/resources/rml-core/RMLTC0016d-PostgreSQL/output.nq b/src/test/resources/rml-core/RMLTC0016d-PostgreSQL/output.nq deleted file mode 100644 index 578b074e..00000000 --- a/src/test/resources/rml-core/RMLTC0016d-PostgreSQL/output.nq +++ /dev/null @@ -1,6 +0,0 @@ - . - "false"^^ . - . - "true"^^ . - . - "true"^^ . diff --git a/src/test/resources/rml-core/RMLTC0016d-PostgreSQL/resource.sql b/src/test/resources/rml-core/RMLTC0016d-PostgreSQL/resource.sql deleted file mode 100644 index 3fa73e67..00000000 --- a/src/test/resources/rml-core/RMLTC0016d-PostgreSQL/resource.sql +++ /dev/null @@ -1,27 +0,0 @@ -DROP TABLE IF EXISTS Patient; - -CREATE TABLE Patient ( -ID INTEGER, -FirstName VARCHAR(50), -LastName VARCHAR(50), -Sex VARCHAR(6), -Weight REAL, -Height FLOAT, -BirthDate DATE, -EntranceDate TIMESTAMP, -PaidInAdvance BOOLEAN, -Photo BYTEA, -PRIMARY KEY (ID) -); - -INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo) -VALUES (10,'Monica','Geller','female',80.25,1.65,'1981-10-10','2009-10-10 12:12:22',FALSE, -'\\x89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFEBFC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082'); - -INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo) -VALUES (11,'Rachel','Green','female',70.22,1.70,'1982-11-12','2008-11-12 09:45:44',TRUE, -'\\x89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFF3FC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082'); - -INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo) -VALUES (12,'Chandler','Bing','male',90.31,1.76,'1978-04-06','2007-03-12 02:13:14',TRUE, -'\\x89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFEBFC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082'); diff --git a/src/test/resources/rml-core/RMLTC0016d-SQLServer/mapping.ttl b/src/test/resources/rml-core/RMLTC0016d-SQLServer/mapping.ttl deleted file mode 100644 index 691cefd5..00000000 --- a/src/test/resources/rml-core/RMLTC0016d-SQLServer/mapping.ttl +++ /dev/null @@ -1,30 +0,0 @@ -@prefix d2rq: . -@prefix ex: . -@prefix foaf: . -@prefix rdf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source ; - rml:referenceFormulation rml:SQL2008Table; - rml:iterator "Patient" - ]; - rml:predicateObjectMap [ - rml:object foaf:Person; - rml:predicate rdf:type - ], [ - rml:objectMap [ - rml:reference "PaidInAdvance" - ]; - rml:predicate ex:paid - ]; - rml:subjectMap [ - rml:template "http://example.com/Patient{ID}" - ] . - - a d2rq:Database; - d2rq:jdbcDSN "CONNECTIONDSN"; - d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver"; - d2rq:password "YourSTRONG!Passw0rd;"; - d2rq:username "sa" . diff --git a/src/test/resources/rml-core/RMLTC0016d-SQLServer/output.nq b/src/test/resources/rml-core/RMLTC0016d-SQLServer/output.nq deleted file mode 100644 index 578b074e..00000000 --- a/src/test/resources/rml-core/RMLTC0016d-SQLServer/output.nq +++ /dev/null @@ -1,6 +0,0 @@ - . - "false"^^ . - . - "true"^^ . - . - "true"^^ . diff --git a/src/test/resources/rml-core/RMLTC0016d-SQLServer/resource.sql b/src/test/resources/rml-core/RMLTC0016d-SQLServer/resource.sql deleted file mode 100644 index e1607220..00000000 --- a/src/test/resources/rml-core/RMLTC0016d-SQLServer/resource.sql +++ /dev/null @@ -1,28 +0,0 @@ -USE TestDB; -DROP TABLE IF EXISTS Patient; - -CREATE TABLE Patient ( -ID INTEGER, -FirstName VARCHAR(50), -LastName VARCHAR(50), -Sex VARCHAR(6), -Weight REAL, -Height FLOAT, -BirthDate DATE, -EntranceDate DATETIME, -PaidInAdvance BIT, -Photo VARBINARY(200), -PRIMARY KEY (ID) -); - -INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo) -VALUES (10,'Monica','Geller','female',80.25,1.65,'1981-10-10','2009-10-10 12:12:22',0, -CAST('89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFEBFC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082' as VARBINARY)); - -INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo) -VALUES (11,'Rachel','Green','female',70.22,1.70,'1982-11-12','2008-11-12 09:45:44',1, -CAST('89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFF3FC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082' as VARBINARY)); - -INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo) -VALUES (12,'Chandler','Bing','male',90.31,1.76,'1978-04-06','2007-03-12 02:13:14',1, -CAST('89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFEBFC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082' as VARBINARY)); diff --git a/src/test/resources/rml-core/RMLTC0016e-MySQL/mapping.ttl b/src/test/resources/rml-core/RMLTC0016e-MySQL/mapping.ttl deleted file mode 100644 index 34086d5f..00000000 --- a/src/test/resources/rml-core/RMLTC0016e-MySQL/mapping.ttl +++ /dev/null @@ -1,30 +0,0 @@ -@prefix d2rq: . -@prefix ex: . -@prefix foaf: . -@prefix rdf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source ; - rml:referenceFormulation rml:SQL2008Table; - rml:iterator "Patient" - ]; - rml:predicateObjectMap [ - rml:object foaf:Person; - rml:predicate rdf:type - ], [ - rml:objectMap [ - rml:template "data:image/png;hex,{Photo}" - ]; - rml:predicate ex:photo - ]; - rml:subjectMap [ - rml:template "http://example.com/Patient{ID}" - ] . - - a d2rq:Database; - d2rq:jdbcDSN "CONNECTIONDSN"; - d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver"; - d2rq:password ""; - d2rq:username "root" . diff --git a/src/test/resources/rml-core/RMLTC0016e-MySQL/output.nq b/src/test/resources/rml-core/RMLTC0016e-MySQL/output.nq deleted file mode 100644 index 789a3e30..00000000 --- a/src/test/resources/rml-core/RMLTC0016e-MySQL/output.nq +++ /dev/null @@ -1,6 +0,0 @@ - . - . - . - . - . - . diff --git a/src/test/resources/rml-core/RMLTC0016e-MySQL/resource.sql b/src/test/resources/rml-core/RMLTC0016e-MySQL/resource.sql deleted file mode 100644 index 1b0346e7..00000000 --- a/src/test/resources/rml-core/RMLTC0016e-MySQL/resource.sql +++ /dev/null @@ -1,28 +0,0 @@ -USE test; -DROP TABLE IF EXISTS test.Patient; - -CREATE TABLE Patient ( -ID INTEGER, -FirstName VARCHAR(50), -LastName VARCHAR(50), -Sex VARCHAR(6), -Weight REAL, -Height FLOAT, -BirthDate DATE, -EntranceDate TIMESTAMP, -PaidInAdvance BOOLEAN, -Photo VARBINARY(200), -PRIMARY KEY (ID) -); - -INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo) -VALUES (10,'Monica','Geller','female',80.25,1.65,'1981-10-10','2009-10-10 12:12:22',FALSE, -X'89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFEBFC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082'); - -INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo) -VALUES (11,'Rachel','Green','female',70.22,1.70,'1982-11-12','2008-11-12 09:45:44',TRUE, -X'89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFF3FC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082'); - -INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo) -VALUES (12,'Chandler','Bing','male',90.31,1.76,'1978-04-06','2007-03-12 02:13:14',TRUE, -X'89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFEBFC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082'); diff --git a/src/test/resources/rml-core/RMLTC0016e-PostgreSQL/mapping.ttl b/src/test/resources/rml-core/RMLTC0016e-PostgreSQL/mapping.ttl deleted file mode 100644 index f6d99e51..00000000 --- a/src/test/resources/rml-core/RMLTC0016e-PostgreSQL/mapping.ttl +++ /dev/null @@ -1,30 +0,0 @@ -@prefix d2rq: . -@prefix ex: . -@prefix foaf: . -@prefix rdf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source ; - rml:referenceFormulation rml:SQL2008Table; - rml:iterator "Patient" - ]; - rml:predicateObjectMap [ - rml:object foaf:Person; - rml:predicate rdf:type - ], [ - rml:objectMap [ - rml:template "data:image/png;hex,{photo}" - ]; - rml:predicate ex:photo - ]; - rml:subjectMap [ - rml:template "http://example.com/Patient{id}" - ] . - - a d2rq:Database; - d2rq:jdbcDSN "CONNECTIONDSN"; - d2rq:jdbcDriver "org.postgresql.Driver"; - d2rq:password ""; - d2rq:username "postgres" . diff --git a/src/test/resources/rml-core/RMLTC0016e-PostgreSQL/output.nq b/src/test/resources/rml-core/RMLTC0016e-PostgreSQL/output.nq deleted file mode 100644 index 789a3e30..00000000 --- a/src/test/resources/rml-core/RMLTC0016e-PostgreSQL/output.nq +++ /dev/null @@ -1,6 +0,0 @@ - . - . - . - . - . - . diff --git a/src/test/resources/rml-core/RMLTC0016e-PostgreSQL/resource.sql b/src/test/resources/rml-core/RMLTC0016e-PostgreSQL/resource.sql deleted file mode 100644 index 51e63e7b..00000000 --- a/src/test/resources/rml-core/RMLTC0016e-PostgreSQL/resource.sql +++ /dev/null @@ -1,27 +0,0 @@ -DROP TABLE IF EXISTS Patient; - -CREATE TABLE Patient ( -ID INTEGER, -FirstName VARCHAR(50), -LastName VARCHAR(50), -Sex VARCHAR(6), -Weight REAL, -Height FLOAT, -BirthDate DATE, -EntranceDate TIMESTAMP, -PaidInAdvance BOOLEAN, -Photo BYTEA, -PRIMARY KEY (ID) -); - -INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo) -VALUES (10,'Monica','Geller','female',80.25,1.65,'1981-10-10','2009-10-10 12:12:22',FALSE, -'\x89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFEBFC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082'); - -INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo) -VALUES (11,'Rachel','Green','female',70.22,1.70,'1982-11-12','2008-11-12 09:45:44',TRUE, -'\x89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFF3FC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082'); - -INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo) -VALUES (12,'Chandler','Bing','male',90.31,1.76,'1978-04-06','2007-03-12 02:13:14',TRUE, -'\x89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFEBFC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082'); diff --git a/src/test/resources/rml-core/RMLTC0016e-SQLServer/mapping.ttl b/src/test/resources/rml-core/RMLTC0016e-SQLServer/mapping.ttl deleted file mode 100644 index 2fbf776c..00000000 --- a/src/test/resources/rml-core/RMLTC0016e-SQLServer/mapping.ttl +++ /dev/null @@ -1,30 +0,0 @@ -@prefix d2rq: . -@prefix ex: . -@prefix foaf: . -@prefix rdf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source ; - rml:referenceFormulation rml:SQL2008Table; - rml:iterator "Patient" - ]; - rml:predicateObjectMap [ - rml:object foaf:Person; - rml:predicate rdf:type - ], [ - rml:objectMap [ - rml:template "data:image/png;hex,{Photo}" - ]; - rml:predicate ex:photo - ]; - rml:subjectMap [ - rml:template "http://example.com/Patient{ID}" - ] . - - a d2rq:Database; - d2rq:jdbcDSN "CONNECTIONDSN"; - d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver"; - d2rq:password "YourSTRONG!Passw0rd;"; - d2rq:username "sa" . diff --git a/src/test/resources/rml-core/RMLTC0016e-SQLServer/output.nq b/src/test/resources/rml-core/RMLTC0016e-SQLServer/output.nq deleted file mode 100644 index 789a3e30..00000000 --- a/src/test/resources/rml-core/RMLTC0016e-SQLServer/output.nq +++ /dev/null @@ -1,6 +0,0 @@ - . - . - . - . - . - . diff --git a/src/test/resources/rml-core/RMLTC0016e-SQLServer/resource.sql b/src/test/resources/rml-core/RMLTC0016e-SQLServer/resource.sql deleted file mode 100644 index e1607220..00000000 --- a/src/test/resources/rml-core/RMLTC0016e-SQLServer/resource.sql +++ /dev/null @@ -1,28 +0,0 @@ -USE TestDB; -DROP TABLE IF EXISTS Patient; - -CREATE TABLE Patient ( -ID INTEGER, -FirstName VARCHAR(50), -LastName VARCHAR(50), -Sex VARCHAR(6), -Weight REAL, -Height FLOAT, -BirthDate DATE, -EntranceDate DATETIME, -PaidInAdvance BIT, -Photo VARBINARY(200), -PRIMARY KEY (ID) -); - -INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo) -VALUES (10,'Monica','Geller','female',80.25,1.65,'1981-10-10','2009-10-10 12:12:22',0, -CAST('89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFEBFC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082' as VARBINARY)); - -INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo) -VALUES (11,'Rachel','Green','female',70.22,1.70,'1982-11-12','2008-11-12 09:45:44',1, -CAST('89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFF3FC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082' as VARBINARY)); - -INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo) -VALUES (12,'Chandler','Bing','male',90.31,1.76,'1978-04-06','2007-03-12 02:13:14',1, -CAST('89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFEBFC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082' as VARBINARY)); diff --git a/src/test/resources/rml-core/RMLTC0018a-MySQL/mapping.ttl b/src/test/resources/rml-core/RMLTC0018a-MySQL/mapping.ttl deleted file mode 100644 index 65183549..00000000 --- a/src/test/resources/rml-core/RMLTC0018a-MySQL/mapping.ttl +++ /dev/null @@ -1,32 +0,0 @@ -@prefix d2rq: . -@prefix ex: . -@prefix foaf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source ; - rml:referenceFormulation rml:SQL2008Table; - rml:iterator "Student" - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "ID" - ]; - rml:predicate ex:id - ], [ - rml:objectMap [ - rml:reference "Name" - ]; - rml:predicate foaf:name - ]; - rml:subjectMap [ - rml:class foaf:Person; - rml:template "http://example.com/{ID}" - ] . - - a d2rq:Database; - d2rq:jdbcDSN "CONNECTIONDSN"; - d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver"; - d2rq:password ""; - d2rq:username "root" . diff --git a/src/test/resources/rml-core/RMLTC0018a-MySQL/note.md b/src/test/resources/rml-core/RMLTC0018a-MySQL/note.md deleted file mode 100644 index 3defd1cb..00000000 --- a/src/test/resources/rml-core/RMLTC0018a-MySQL/note.md +++ /dev/null @@ -1,4 +0,0 @@ -## Change note - -Changed output.nq to remove padding from char column reference values since -MySQL by default is not ANSI SQL compliant diff --git a/src/test/resources/rml-core/RMLTC0018a-MySQL/output.nq b/src/test/resources/rml-core/RMLTC0018a-MySQL/output.nq deleted file mode 100644 index bcb2490c..00000000 --- a/src/test/resources/rml-core/RMLTC0018a-MySQL/output.nq +++ /dev/null @@ -1,9 +0,0 @@ - "Venus" . - "10"^^ . - . - "Fernando" . - "20"^^ . - . - "David" . - "30"^^ . - . diff --git a/src/test/resources/rml-core/RMLTC0018a-MySQL/resource.sql b/src/test/resources/rml-core/RMLTC0018a-MySQL/resource.sql deleted file mode 100644 index 23da1f17..00000000 --- a/src/test/resources/rml-core/RMLTC0018a-MySQL/resource.sql +++ /dev/null @@ -1,13 +0,0 @@ -USE test; -SET FOREIGN_KEY_CHECKS = 0; -DROP TABLE IF EXISTS test.Student; -DROP TABLE IF EXISTS test.Student_Sport; -SET FOREIGN_KEY_CHECKS = 1; - -CREATE TABLE Student ( -ID INTEGER, -Name CHAR(15) -); -INSERT INTO Student (ID,Name) VALUES (10,'Venus'); -INSERT INTO Student (ID,Name) VALUES (20,'Fernando'); -INSERT INTO Student (ID,Name) VALUES (30,'David'); diff --git a/src/test/resources/rml-core/RMLTC0018a-PostgreSQL/mapping.ttl b/src/test/resources/rml-core/RMLTC0018a-PostgreSQL/mapping.ttl deleted file mode 100644 index d2acedd1..00000000 --- a/src/test/resources/rml-core/RMLTC0018a-PostgreSQL/mapping.ttl +++ /dev/null @@ -1,32 +0,0 @@ -@prefix d2rq: . -@prefix ex: . -@prefix foaf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source ; - rml:referenceFormulation rml:SQL2008Table; - rml:iterator "Student" - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "id" - ]; - rml:predicate ex:id - ], [ - rml:objectMap [ - rml:reference "name" - ]; - rml:predicate foaf:name - ]; - rml:subjectMap [ - rml:class foaf:Person; - rml:template "http://example.com/{id}" - ] . - - a d2rq:Database; - d2rq:jdbcDSN "CONNECTIONDSN"; - d2rq:jdbcDriver "org.postgresql.Driver"; - d2rq:password ""; - d2rq:username "postgres" . diff --git a/src/test/resources/rml-core/RMLTC0018a-PostgreSQL/output.nq b/src/test/resources/rml-core/RMLTC0018a-PostgreSQL/output.nq deleted file mode 100644 index ae8816d4..00000000 --- a/src/test/resources/rml-core/RMLTC0018a-PostgreSQL/output.nq +++ /dev/null @@ -1,9 +0,0 @@ - "Venus " . - "10"^^ . - . - "Fernando " . - "20"^^ . - . - "David " . - "30"^^ . - . diff --git a/src/test/resources/rml-core/RMLTC0018a-PostgreSQL/resource.sql b/src/test/resources/rml-core/RMLTC0018a-PostgreSQL/resource.sql deleted file mode 100644 index b2e9f677..00000000 --- a/src/test/resources/rml-core/RMLTC0018a-PostgreSQL/resource.sql +++ /dev/null @@ -1,9 +0,0 @@ -DROP TABLE IF EXISTS Student CASCADE; - -CREATE TABLE Student ( -ID INTEGER, -Name CHAR(15) -); -INSERT INTO Student (ID,Name) VALUES (10,'Venus'); -INSERT INTO Student (ID,Name) VALUES (20,'Fernando'); -INSERT INTO Student (ID,Name) VALUES (30,'David'); diff --git a/src/test/resources/rml-core/RMLTC0018a-SQLServer/mapping.ttl b/src/test/resources/rml-core/RMLTC0018a-SQLServer/mapping.ttl deleted file mode 100644 index a3ad93dc..00000000 --- a/src/test/resources/rml-core/RMLTC0018a-SQLServer/mapping.ttl +++ /dev/null @@ -1,32 +0,0 @@ -@prefix d2rq: . -@prefix ex: . -@prefix foaf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source ; - rml:referenceFormulation rml:SQL2008Table; - rml:iterator "Student" - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "ID" - ]; - rml:predicate ex:id - ], [ - rml:objectMap [ - rml:reference "Name" - ]; - rml:predicate foaf:name - ]; - rml:subjectMap [ - rml:class foaf:Person; - rml:template "http://example.com/{ID}" - ] . - - a d2rq:Database; - d2rq:jdbcDSN "CONNECTIONDSN"; - d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver"; - d2rq:password "YourSTRONG!Passw0rd;"; - d2rq:username "sa" . diff --git a/src/test/resources/rml-core/RMLTC0018a-SQLServer/output.nq b/src/test/resources/rml-core/RMLTC0018a-SQLServer/output.nq deleted file mode 100644 index ae8816d4..00000000 --- a/src/test/resources/rml-core/RMLTC0018a-SQLServer/output.nq +++ /dev/null @@ -1,9 +0,0 @@ - "Venus " . - "10"^^ . - . - "Fernando " . - "20"^^ . - . - "David " . - "30"^^ . - . diff --git a/src/test/resources/rml-core/RMLTC0018a-SQLServer/resource.sql b/src/test/resources/rml-core/RMLTC0018a-SQLServer/resource.sql deleted file mode 100644 index 971a3ad4..00000000 --- a/src/test/resources/rml-core/RMLTC0018a-SQLServer/resource.sql +++ /dev/null @@ -1,10 +0,0 @@ -USE TestDB; -DROP TABLE IF EXISTS Student; - -CREATE TABLE Student ( -ID INTEGER, -Name CHAR(15) -); -INSERT INTO Student (ID,Name) VALUES (10,'Venus'); -INSERT INTO Student (ID,Name) VALUES (20,'Fernando'); -INSERT INTO Student (ID,Name) VALUES (30,'David'); diff --git a/src/test/resources/rml-core/RMLTC0019a-CSV/mapping.ttl b/src/test/resources/rml-core/RMLTC0019a-CSV/mapping.ttl deleted file mode 100644 index 5618ce88..00000000 --- a/src/test/resources/rml-core/RMLTC0019a-CSV/mapping.ttl +++ /dev/null @@ -1,20 +0,0 @@ -@prefix foaf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:referenceFormulation rml:CSV; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "persons.csv" - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "FirstName" - ]; - rml:predicate foaf:name - ]; - rml:subjectMap [ - rml:reference "FirstName" - ] . diff --git a/src/test/resources/rml-core/RMLTC0019a-CSV/output.nq b/src/test/resources/rml-core/RMLTC0019a-CSV/output.nq deleted file mode 100644 index d07559d8..00000000 --- a/src/test/resources/rml-core/RMLTC0019a-CSV/output.nq +++ /dev/null @@ -1,2 +0,0 @@ - "http://example.com/ns#Jhon" . - "Carlos" . diff --git a/src/test/resources/rml-core/RMLTC0019a-CSV/persons.csv b/src/test/resources/rml-core/RMLTC0019a-CSV/persons.csv deleted file mode 100644 index d1b36144..00000000 --- a/src/test/resources/rml-core/RMLTC0019a-CSV/persons.csv +++ /dev/null @@ -1,3 +0,0 @@ -ID,FirstName,LastName -10,http://example.com/ns#Jhon,Smith -20,Carlos,Mendoza diff --git a/src/test/resources/rml-core/RMLTC0019a-JSON/README.md b/src/test/resources/rml-core/RMLTC0019a-JSON/README.md new file mode 100644 index 00000000..eb11b856 --- /dev/null +++ b/src/test/resources/rml-core/RMLTC0019a-JSON/README.md @@ -0,0 +1,62 @@ +## RMLTC0019a-JSON + +**Title**: "Generation of triples by using IRI value in columns" + +**Description**: "Test the generation of triples by using IRI value in attributes" + +**Default Base IRI**: http://example.com/ + +**Error expected?** No + +**Input** +``` +{ + "persons": [ + { + "ID": 10, + "FirstName": "http://example.com/ns#Jhon", + "LastName": "Smith" + }, + { + "ID": 20, + "FirstName": "Carlos", + "LastName": "Mendoza" + } + ] +} + +``` + +**Mapping** +``` +@prefix foaf: . +@prefix rml: . + + a rml:TriplesMap; + rml:logicalSource [ a rml:LogicalSource; + rml:iterator "$.persons[*]"; + rml:referenceFormulation rml:JSONPath; + rml:source [ a rml:RelativePathSource; + rml:root rml:MappingDirectory; + rml:path "persons.json" + ] + ]; + rml:predicateObjectMap [ + rml:objectMap [ + rml:reference "$.FirstName" + ]; + rml:predicate foaf:name + ]; + rml:subjectMap [ + rml:reference "$.FirstName" + ] . + +``` + +**Output** +``` + "http://example.com/ns#Jhon" . + "Carlos" . + +``` + diff --git a/src/test/resources/rml-core/RMLTC0019a-JSON/mapping.ttl b/src/test/resources/rml-core/RMLTC0019a-JSON/mapping.ttl index 63a7b5f9..2870ff6e 100644 --- a/src/test/resources/rml-core/RMLTC0019a-JSON/mapping.ttl +++ b/src/test/resources/rml-core/RMLTC0019a-JSON/mapping.ttl @@ -12,10 +12,10 @@ ]; rml:predicateObjectMap [ rml:objectMap [ - rml:reference "FirstName" + rml:reference "$.FirstName" ]; rml:predicate foaf:name ]; rml:subjectMap [ - rml:reference "FirstName" + rml:reference "$.FirstName" ] . diff --git a/src/test/resources/rml-core/RMLTC0019a-JSON/output.nq b/src/test/resources/rml-core/RMLTC0019a-JSON/output.nq index d07559d8..4a97fdf0 100644 --- a/src/test/resources/rml-core/RMLTC0019a-JSON/output.nq +++ b/src/test/resources/rml-core/RMLTC0019a-JSON/output.nq @@ -1,2 +1,2 @@ "http://example.com/ns#Jhon" . - "Carlos" . + "Carlos" . diff --git a/src/test/resources/rml-core/RMLTC0019a-MySQL/mapping.ttl b/src/test/resources/rml-core/RMLTC0019a-MySQL/mapping.ttl deleted file mode 100644 index 514e6594..00000000 --- a/src/test/resources/rml-core/RMLTC0019a-MySQL/mapping.ttl +++ /dev/null @@ -1,29 +0,0 @@ -@prefix d2rq: . -@prefix foaf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator """ - SELECT ID, FirstName, LastName - FROM Employee - WHERE ID < 30 - """; - rml:source ; - rml:referenceFormulation rml:SQL2008Query - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "FirstName" - ]; - rml:predicate foaf:name - ]; - rml:subjectMap [ - rml:reference "FirstName" - ] . - - a d2rq:Database; - d2rq:jdbcDSN "CONNECTIONDSN"; - d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver"; - d2rq:password ""; - d2rq:username "root" . diff --git a/src/test/resources/rml-core/RMLTC0019a-MySQL/output.nq b/src/test/resources/rml-core/RMLTC0019a-MySQL/output.nq deleted file mode 100644 index d07559d8..00000000 --- a/src/test/resources/rml-core/RMLTC0019a-MySQL/output.nq +++ /dev/null @@ -1,2 +0,0 @@ - "http://example.com/ns#Jhon" . - "Carlos" . diff --git a/src/test/resources/rml-core/RMLTC0019a-MySQL/resource.sql b/src/test/resources/rml-core/RMLTC0019a-MySQL/resource.sql deleted file mode 100644 index 24988be6..00000000 --- a/src/test/resources/rml-core/RMLTC0019a-MySQL/resource.sql +++ /dev/null @@ -1,11 +0,0 @@ -USE test; -DROP TABLE IF EXISTS test.Employee; - -CREATE TABLE Employee ( -ID INTEGER, -FirstName VARCHAR(50), -LastName VARCHAR(50) -); -INSERT INTO Employee (ID,FirstName,LastName) VALUES (10,'http://example.com/ns#Jhon','Smith'); -INSERT INTO Employee (ID,FirstName,LastName) VALUES (20,'Carlos','Mendoza'); -INSERT INTO Employee (ID,FirstName,LastName) VALUES (30,'Juan Daniel','Crespo'); diff --git a/src/test/resources/rml-core/RMLTC0019a-PostgreSQL/mapping.ttl b/src/test/resources/rml-core/RMLTC0019a-PostgreSQL/mapping.ttl deleted file mode 100644 index 0a57c29f..00000000 --- a/src/test/resources/rml-core/RMLTC0019a-PostgreSQL/mapping.ttl +++ /dev/null @@ -1,29 +0,0 @@ -@prefix d2rq: . -@prefix foaf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator """ - SELECT ID, FirstName, LastName - FROM Employee - WHERE ID < 30 - """; - rml:source ; - rml:referenceFormulation rml:SQL2008Query - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "firstname" - ]; - rml:predicate foaf:name - ]; - rml:subjectMap [ - rml:reference "firstname" - ] . - - a d2rq:Database; - d2rq:jdbcDSN "CONNECTIONDSN"; - d2rq:jdbcDriver "org.postgresql.Driver"; - d2rq:password ""; - d2rq:username "postgres" . diff --git a/src/test/resources/rml-core/RMLTC0019a-PostgreSQL/output.nq b/src/test/resources/rml-core/RMLTC0019a-PostgreSQL/output.nq deleted file mode 100644 index d07559d8..00000000 --- a/src/test/resources/rml-core/RMLTC0019a-PostgreSQL/output.nq +++ /dev/null @@ -1,2 +0,0 @@ - "http://example.com/ns#Jhon" . - "Carlos" . diff --git a/src/test/resources/rml-core/RMLTC0019a-PostgreSQL/resource.sql b/src/test/resources/rml-core/RMLTC0019a-PostgreSQL/resource.sql deleted file mode 100644 index ae78dc8a..00000000 --- a/src/test/resources/rml-core/RMLTC0019a-PostgreSQL/resource.sql +++ /dev/null @@ -1,10 +0,0 @@ -DROP TABLE IF EXISTS Employee; - -CREATE TABLE Employee ( -ID INTEGER, -FirstName VARCHAR(50), -LastName VARCHAR(50) -); -INSERT INTO Employee (ID,FirstName,LastName) VALUES (10,'http://example.com/ns#Jhon','Smith'); -INSERT INTO Employee (ID,FirstName,LastName) VALUES (20,'Carlos','Mendoza'); -INSERT INTO Employee (ID,FirstName,LastName) VALUES (30,'Juan Daniel','Crespo'); diff --git a/src/test/resources/rml-core/RMLTC0019a-SQLServer/mapping.ttl b/src/test/resources/rml-core/RMLTC0019a-SQLServer/mapping.ttl deleted file mode 100644 index 808b17d2..00000000 --- a/src/test/resources/rml-core/RMLTC0019a-SQLServer/mapping.ttl +++ /dev/null @@ -1,29 +0,0 @@ -@prefix d2rq: . -@prefix foaf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator """ - SELECT ID, FirstName, LastName - FROM Employee - WHERE ID < 30 - """; - rml:source ; - rml:referenceFormulation rml:SQL2008Query - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "FirstName" - ]; - rml:predicate foaf:name - ]; - rml:subjectMap [ - rml:reference "FirstName" - ] . - - a d2rq:Database; - d2rq:jdbcDSN "CONNECTIONDSN"; - d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver"; - d2rq:password "YourSTRONG!Passw0rd;"; - d2rq:username "sa" . diff --git a/src/test/resources/rml-core/RMLTC0019a-SQLServer/output.nq b/src/test/resources/rml-core/RMLTC0019a-SQLServer/output.nq deleted file mode 100644 index d07559d8..00000000 --- a/src/test/resources/rml-core/RMLTC0019a-SQLServer/output.nq +++ /dev/null @@ -1,2 +0,0 @@ - "http://example.com/ns#Jhon" . - "Carlos" . diff --git a/src/test/resources/rml-core/RMLTC0019a-SQLServer/resource.sql b/src/test/resources/rml-core/RMLTC0019a-SQLServer/resource.sql deleted file mode 100644 index 2ff708ef..00000000 --- a/src/test/resources/rml-core/RMLTC0019a-SQLServer/resource.sql +++ /dev/null @@ -1,11 +0,0 @@ -USE TestDB; -DROP TABLE IF EXISTS Employee; - -CREATE TABLE Employee ( -ID INTEGER, -FirstName VARCHAR(50), -LastName VARCHAR(50) -); -INSERT INTO Employee (ID,FirstName,LastName) VALUES (10,'http://example.com/ns#Jhon','Smith'); -INSERT INTO Employee (ID,FirstName,LastName) VALUES (20,'Carlos','Mendoza'); -INSERT INTO Employee (ID,FirstName,LastName) VALUES (30,'Juan Daniel','Crespo'); diff --git a/src/test/resources/rml-core/RMLTC0019a-XML/mapping.ttl b/src/test/resources/rml-core/RMLTC0019a-XML/mapping.ttl deleted file mode 100644 index 75e60005..00000000 --- a/src/test/resources/rml-core/RMLTC0019a-XML/mapping.ttl +++ /dev/null @@ -1,21 +0,0 @@ -@prefix foaf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator "/persons/person"; - rml:referenceFormulation rml:XPath; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "persons.xml" - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "FirstName" - ]; - rml:predicate foaf:name - ]; - rml:subjectMap [ - rml:reference "FirstName" - ] . diff --git a/src/test/resources/rml-core/RMLTC0019a-XML/output.nq b/src/test/resources/rml-core/RMLTC0019a-XML/output.nq deleted file mode 100644 index d07559d8..00000000 --- a/src/test/resources/rml-core/RMLTC0019a-XML/output.nq +++ /dev/null @@ -1,2 +0,0 @@ - "http://example.com/ns#Jhon" . - "Carlos" . diff --git a/src/test/resources/rml-core/RMLTC0019a-XML/persons.xml b/src/test/resources/rml-core/RMLTC0019a-XML/persons.xml deleted file mode 100644 index 7579d58b..00000000 --- a/src/test/resources/rml-core/RMLTC0019a-XML/persons.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - 10 - http://example.com/ns#Jhon - Smith - - - 20 - Carlos - Mendoza - - diff --git a/src/test/resources/rml-core/RMLTC0019b-CSV/mapping.ttl b/src/test/resources/rml-core/RMLTC0019b-CSV/mapping.ttl deleted file mode 100644 index 5618ce88..00000000 --- a/src/test/resources/rml-core/RMLTC0019b-CSV/mapping.ttl +++ /dev/null @@ -1,20 +0,0 @@ -@prefix foaf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:referenceFormulation rml:CSV; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "persons.csv" - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "FirstName" - ]; - rml:predicate foaf:name - ]; - rml:subjectMap [ - rml:reference "FirstName" - ] . diff --git a/src/test/resources/rml-core/RMLTC0019b-CSV/persons.csv b/src/test/resources/rml-core/RMLTC0019b-CSV/persons.csv deleted file mode 100644 index a89aea2e..00000000 --- a/src/test/resources/rml-core/RMLTC0019b-CSV/persons.csv +++ /dev/null @@ -1,4 +0,0 @@ -ID,FirstName,LastName -10,http://example.com/ns#Jhon,Smith -20,Carlos,Mendoza -30,Juan Daniel,Crespo diff --git a/src/test/resources/rml-core/RMLTC0019b-JSON/README.md b/src/test/resources/rml-core/RMLTC0019b-JSON/README.md new file mode 100644 index 00000000..768c29dd --- /dev/null +++ b/src/test/resources/rml-core/RMLTC0019b-JSON/README.md @@ -0,0 +1,50 @@ +## RMLTC0019b-JSON + +**Title**: "Generation of triples by using IRI value in columns, with data error" + +**Description**: "Test the generation of triples by using IRI value in attributes, conforming RML mapping with data error (and limited results)" + +**Default Base IRI**: http://example.com/ + +**Error expected?** Yes + +**Input** +``` +{ + "persons": [ + { + "ID": 30, + "FirstName": "Juan Daniel", + "LastName": "Crespo" + } + ] +} + +``` + +**Mapping** +``` +@prefix foaf: . +@prefix rml: . + + a rml:TriplesMap; + rml:logicalSource [ a rml:LogicalSource; + rml:iterator "$.persons[*]"; + rml:referenceFormulation rml:JSONPath; + rml:source [ a rml:RelativePathSource; + rml:root rml:MappingDirectory; + rml:path "persons.json" + ] + ]; + rml:predicateObjectMap [ + rml:objectMap [ + rml:reference "$.FirstName" + ]; + rml:predicate foaf:name + ]; + rml:subjectMap [ + rml:reference "$.FirstName" + ] . + +``` + diff --git a/src/test/resources/rml-core/RMLTC0019b-JSON/mapping.ttl b/src/test/resources/rml-core/RMLTC0019b-JSON/mapping.ttl index 63a7b5f9..2870ff6e 100644 --- a/src/test/resources/rml-core/RMLTC0019b-JSON/mapping.ttl +++ b/src/test/resources/rml-core/RMLTC0019b-JSON/mapping.ttl @@ -12,10 +12,10 @@ ]; rml:predicateObjectMap [ rml:objectMap [ - rml:reference "FirstName" + rml:reference "$.FirstName" ]; rml:predicate foaf:name ]; rml:subjectMap [ - rml:reference "FirstName" + rml:reference "$.FirstName" ] . diff --git a/src/test/resources/rml-core/RMLTC0019b-JSON/persons.json b/src/test/resources/rml-core/RMLTC0019b-JSON/persons.json index ba1e6036..87c4f146 100644 --- a/src/test/resources/rml-core/RMLTC0019b-JSON/persons.json +++ b/src/test/resources/rml-core/RMLTC0019b-JSON/persons.json @@ -1,15 +1,5 @@ { "persons": [ - { - "ID": 10, - "FirstName": "http://example.com/ns#Jhon", - "LastName": "Smith" - }, - { - "ID": 20, - "FirstName": "Carlos", - "LastName": "Mendoza" - }, { "ID": 30, "FirstName": "Juan Daniel", diff --git a/src/test/resources/rml-core/RMLTC0019b-MySQL/mapping.ttl b/src/test/resources/rml-core/RMLTC0019b-MySQL/mapping.ttl deleted file mode 100644 index 788d1cce..00000000 --- a/src/test/resources/rml-core/RMLTC0019b-MySQL/mapping.ttl +++ /dev/null @@ -1,25 +0,0 @@ -@prefix d2rq: . -@prefix foaf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source ; - rml:referenceFormulation rml:SQL2008Table; - rml:iterator "Employee" - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "FirstName" - ]; - rml:predicate foaf:name - ]; - rml:subjectMap [ - rml:reference "FirstName" - ] . - - a d2rq:Database; - d2rq:jdbcDSN "CONNECTIONDSN"; - d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver"; - d2rq:password ""; - d2rq:username "root" . diff --git a/src/test/resources/rml-core/RMLTC0019b-MySQL/resource.sql b/src/test/resources/rml-core/RMLTC0019b-MySQL/resource.sql deleted file mode 100644 index 24988be6..00000000 --- a/src/test/resources/rml-core/RMLTC0019b-MySQL/resource.sql +++ /dev/null @@ -1,11 +0,0 @@ -USE test; -DROP TABLE IF EXISTS test.Employee; - -CREATE TABLE Employee ( -ID INTEGER, -FirstName VARCHAR(50), -LastName VARCHAR(50) -); -INSERT INTO Employee (ID,FirstName,LastName) VALUES (10,'http://example.com/ns#Jhon','Smith'); -INSERT INTO Employee (ID,FirstName,LastName) VALUES (20,'Carlos','Mendoza'); -INSERT INTO Employee (ID,FirstName,LastName) VALUES (30,'Juan Daniel','Crespo'); diff --git a/src/test/resources/rml-core/RMLTC0019b-PostgreSQL/mapping.ttl b/src/test/resources/rml-core/RMLTC0019b-PostgreSQL/mapping.ttl deleted file mode 100644 index e7f00f33..00000000 --- a/src/test/resources/rml-core/RMLTC0019b-PostgreSQL/mapping.ttl +++ /dev/null @@ -1,25 +0,0 @@ -@prefix d2rq: . -@prefix foaf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source ; - rml:referenceFormulation rml:SQL2008Table; - rml:iterator "Employee" - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "firstname" - ]; - rml:predicate foaf:name - ]; - rml:subjectMap [ - rml:reference "firstname" - ] . - - a d2rq:Database; - d2rq:jdbcDSN "CONNECTIONDSN"; - d2rq:jdbcDriver "org.postgresql.Driver"; - d2rq:password ""; - d2rq:username "postgres" . diff --git a/src/test/resources/rml-core/RMLTC0019b-PostgreSQL/resource.sql b/src/test/resources/rml-core/RMLTC0019b-PostgreSQL/resource.sql deleted file mode 100644 index ae78dc8a..00000000 --- a/src/test/resources/rml-core/RMLTC0019b-PostgreSQL/resource.sql +++ /dev/null @@ -1,10 +0,0 @@ -DROP TABLE IF EXISTS Employee; - -CREATE TABLE Employee ( -ID INTEGER, -FirstName VARCHAR(50), -LastName VARCHAR(50) -); -INSERT INTO Employee (ID,FirstName,LastName) VALUES (10,'http://example.com/ns#Jhon','Smith'); -INSERT INTO Employee (ID,FirstName,LastName) VALUES (20,'Carlos','Mendoza'); -INSERT INTO Employee (ID,FirstName,LastName) VALUES (30,'Juan Daniel','Crespo'); diff --git a/src/test/resources/rml-core/RMLTC0019b-SQLServer/mapping.ttl b/src/test/resources/rml-core/RMLTC0019b-SQLServer/mapping.ttl deleted file mode 100644 index 9172f6ce..00000000 --- a/src/test/resources/rml-core/RMLTC0019b-SQLServer/mapping.ttl +++ /dev/null @@ -1,25 +0,0 @@ -@prefix d2rq: . -@prefix foaf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source ; - rml:referenceFormulation rml:SQL2008Table; - rml:iterator "Employee" - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "FirstName" - ]; - rml:predicate foaf:name - ]; - rml:subjectMap [ - rml:reference "FirstName" - ] . - - a d2rq:Database; - d2rq:jdbcDSN "CONNECTIONDSN"; - d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver"; - d2rq:password "YourSTRONG!Passw0rd;"; - d2rq:username "sa" . diff --git a/src/test/resources/rml-core/RMLTC0019b-SQLServer/resource.sql b/src/test/resources/rml-core/RMLTC0019b-SQLServer/resource.sql deleted file mode 100644 index 2ff708ef..00000000 --- a/src/test/resources/rml-core/RMLTC0019b-SQLServer/resource.sql +++ /dev/null @@ -1,11 +0,0 @@ -USE TestDB; -DROP TABLE IF EXISTS Employee; - -CREATE TABLE Employee ( -ID INTEGER, -FirstName VARCHAR(50), -LastName VARCHAR(50) -); -INSERT INTO Employee (ID,FirstName,LastName) VALUES (10,'http://example.com/ns#Jhon','Smith'); -INSERT INTO Employee (ID,FirstName,LastName) VALUES (20,'Carlos','Mendoza'); -INSERT INTO Employee (ID,FirstName,LastName) VALUES (30,'Juan Daniel','Crespo'); diff --git a/src/test/resources/rml-core/RMLTC0019b-XML/mapping.ttl b/src/test/resources/rml-core/RMLTC0019b-XML/mapping.ttl deleted file mode 100644 index 75e60005..00000000 --- a/src/test/resources/rml-core/RMLTC0019b-XML/mapping.ttl +++ /dev/null @@ -1,21 +0,0 @@ -@prefix foaf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator "/persons/person"; - rml:referenceFormulation rml:XPath; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "persons.xml" - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "FirstName" - ]; - rml:predicate foaf:name - ]; - rml:subjectMap [ - rml:reference "FirstName" - ] . diff --git a/src/test/resources/rml-core/RMLTC0019b-XML/persons.xml b/src/test/resources/rml-core/RMLTC0019b-XML/persons.xml deleted file mode 100644 index 4f01b2e5..00000000 --- a/src/test/resources/rml-core/RMLTC0019b-XML/persons.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - 10 - http://example.com/ns#Jhon - Smith - - - 20 - Carlos - Mendoza - - - 30 - Juan Daniel - Crespo - - diff --git a/src/test/resources/rml-core/RMLTC0020a-CSV/mapping.ttl b/src/test/resources/rml-core/RMLTC0020a-CSV/mapping.ttl deleted file mode 100644 index fb9c8f5d..00000000 --- a/src/test/resources/rml-core/RMLTC0020a-CSV/mapping.ttl +++ /dev/null @@ -1,20 +0,0 @@ -@prefix foaf: . -@prefix rdf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:referenceFormulation rml:CSV; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.csv" - ] - ]; - rml:predicateObjectMap [ - rml:object foaf:Person; - rml:predicate rdf:type - ]; - rml:subjectMap [ - rml:template "{Name}"; - rml:termType rml:IRI - ] . diff --git a/src/test/resources/rml-core/RMLTC0020a-CSV/output.nq b/src/test/resources/rml-core/RMLTC0020a-CSV/output.nq deleted file mode 100644 index 65071a55..00000000 --- a/src/test/resources/rml-core/RMLTC0020a-CSV/output.nq +++ /dev/null @@ -1,5 +0,0 @@ - . - . - . - . - . diff --git a/src/test/resources/rml-core/RMLTC0020a-CSV/student.csv b/src/test/resources/rml-core/RMLTC0020a-CSV/student.csv deleted file mode 100644 index 289cde5c..00000000 --- a/src/test/resources/rml-core/RMLTC0020a-CSV/student.csv +++ /dev/null @@ -1,6 +0,0 @@ -Name -http://example.com/company/Alice -Bob -Bob/Charles -path/../Danny -Emily Smith diff --git a/src/test/resources/rml-core/RMLTC0020a-JSON/README.md b/src/test/resources/rml-core/RMLTC0020a-JSON/README.md new file mode 100644 index 00000000..bfbd4be7 --- /dev/null +++ b/src/test/resources/rml-core/RMLTC0020a-JSON/README.md @@ -0,0 +1,60 @@ +## RMLTC0020a-JSON + +**Title**: "Generation of triples by using IRI value in columns" + +**Description**: "Test the generation of triples by using IRI value in attributes" + +**Default Base IRI**: http://example.com/ + +**Error expected?** No + +**Input** +``` +{ + "students": [ + {"Name": "http://example.com/company/Alice"}, + {"Name": "Bob"}, + {"Name": "Bob/Charles"}, + {"Name": "path/../Danny"}, + {"Name": "Emily Smith"} + ] +} + +``` + +**Mapping** +``` +@prefix foaf: . +@prefix rdf: . +@prefix rml: . + + a rml:TriplesMap; + rml:logicalSource [ a rml:LogicalSource; + rml:iterator "$.students[*]"; + rml:referenceFormulation rml:JSONPath; + rml:source [ a rml:RelativePathSource; + rml:root rml:MappingDirectory; + rml:path "student.json" + ] + ]; + rml:predicateObjectMap [ + rml:object foaf:Person; + rml:predicate rdf:type + ]; + rml:subjectMap [ + rml:template "{$.Name}"; + rml:termType rml:IRI + ] . + +``` + +**Output** +``` + . + . + . + . + . + +``` + diff --git a/src/test/resources/rml-core/RMLTC0020a-JSON/mapping.ttl b/src/test/resources/rml-core/RMLTC0020a-JSON/mapping.ttl index e3268b17..0d2892f8 100644 --- a/src/test/resources/rml-core/RMLTC0020a-JSON/mapping.ttl +++ b/src/test/resources/rml-core/RMLTC0020a-JSON/mapping.ttl @@ -16,6 +16,6 @@ rml:predicate rdf:type ]; rml:subjectMap [ - rml:template "{Name}"; + rml:template "{$.Name}"; rml:termType rml:IRI ] . diff --git a/src/test/resources/rml-core/RMLTC0020a-JSON/output.nq b/src/test/resources/rml-core/RMLTC0020a-JSON/output.nq index 65071a55..d2b4b5f9 100644 --- a/src/test/resources/rml-core/RMLTC0020a-JSON/output.nq +++ b/src/test/resources/rml-core/RMLTC0020a-JSON/output.nq @@ -1,5 +1,5 @@ - . - . - . - . - . + . + . + . + . + . diff --git a/src/test/resources/rml-core/RMLTC0020a-MySQL/mapping.ttl b/src/test/resources/rml-core/RMLTC0020a-MySQL/mapping.ttl deleted file mode 100644 index f60f5907..00000000 --- a/src/test/resources/rml-core/RMLTC0020a-MySQL/mapping.ttl +++ /dev/null @@ -1,25 +0,0 @@ -@prefix d2rq: . -@prefix foaf: . -@prefix rdf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source ; - rml:referenceFormulation rml:SQL2008Table; - rml:iterator "Student" - ]; - rml:predicateObjectMap [ - rml:object foaf:Person; - rml:predicate rdf:type - ]; - rml:subjectMap [ - rml:template "{Name}"; - rml:termType rml:IRI - ] . - - a d2rq:Database; - d2rq:jdbcDSN "CONNECTIONDSN"; - d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver"; - d2rq:password ""; - d2rq:username "root" . diff --git a/src/test/resources/rml-core/RMLTC0020a-MySQL/output.nq b/src/test/resources/rml-core/RMLTC0020a-MySQL/output.nq deleted file mode 100644 index 65071a55..00000000 --- a/src/test/resources/rml-core/RMLTC0020a-MySQL/output.nq +++ /dev/null @@ -1,5 +0,0 @@ - . - . - . - . - . diff --git a/src/test/resources/rml-core/RMLTC0020a-MySQL/resource.sql b/src/test/resources/rml-core/RMLTC0020a-MySQL/resource.sql deleted file mode 100644 index e3228e27..00000000 --- a/src/test/resources/rml-core/RMLTC0020a-MySQL/resource.sql +++ /dev/null @@ -1,12 +0,0 @@ -USE test; -DROP TABLE IF EXISTS test.Student; - -CREATE TABLE Student ( -Name VARCHAR(50) -); - -INSERT INTO Student (Name) VALUES ('http://example.com/company/Alice'); -INSERT INTO Student (Name) VALUES ('Bob'); -INSERT INTO Student (Name) VALUES ('Bob/Charles'); -INSERT INTO Student (Name) VALUES ('path/../Danny'); -INSERT INTO Student (Name) VALUES ('Emily Smith'); diff --git a/src/test/resources/rml-core/RMLTC0020a-PostgreSQL/mapping.ttl b/src/test/resources/rml-core/RMLTC0020a-PostgreSQL/mapping.ttl deleted file mode 100644 index 646dbbf7..00000000 --- a/src/test/resources/rml-core/RMLTC0020a-PostgreSQL/mapping.ttl +++ /dev/null @@ -1,25 +0,0 @@ -@prefix d2rq: . -@prefix foaf: . -@prefix rdf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source ; - rml:referenceFormulation rml:SQL2008Table; - rml:iterator "Student" - ]; - rml:predicateObjectMap [ - rml:object foaf:Person; - rml:predicate rdf:type - ]; - rml:subjectMap [ - rml:template "{name}"; - rml:termType rml:IRI - ] . - - a d2rq:Database; - d2rq:jdbcDSN "CONNECTIONDSN"; - d2rq:jdbcDriver "org.postgresql.Driver"; - d2rq:password ""; - d2rq:username "postgres" . diff --git a/src/test/resources/rml-core/RMLTC0020a-PostgreSQL/output.nq b/src/test/resources/rml-core/RMLTC0020a-PostgreSQL/output.nq deleted file mode 100644 index 65071a55..00000000 --- a/src/test/resources/rml-core/RMLTC0020a-PostgreSQL/output.nq +++ /dev/null @@ -1,5 +0,0 @@ - . - . - . - . - . diff --git a/src/test/resources/rml-core/RMLTC0020a-PostgreSQL/resource.sql b/src/test/resources/rml-core/RMLTC0020a-PostgreSQL/resource.sql deleted file mode 100644 index 0bee3169..00000000 --- a/src/test/resources/rml-core/RMLTC0020a-PostgreSQL/resource.sql +++ /dev/null @@ -1,11 +0,0 @@ -DROP TABLE IF EXISTS Student; - -CREATE TABLE Student ( -Name VARCHAR(50) -); - -INSERT INTO Student (Name) VALUES ('http://example.com/company/Alice'); -INSERT INTO Student (Name) VALUES ('Bob'); -INSERT INTO Student (Name) VALUES ('Bob/Charles'); -INSERT INTO Student (Name) VALUES ('path/../Danny'); -INSERT INTO Student (Name) VALUES ('Emily Smith'); diff --git a/src/test/resources/rml-core/RMLTC0020a-SQLServer/mapping.ttl b/src/test/resources/rml-core/RMLTC0020a-SQLServer/mapping.ttl deleted file mode 100644 index f6e5b4f0..00000000 --- a/src/test/resources/rml-core/RMLTC0020a-SQLServer/mapping.ttl +++ /dev/null @@ -1,25 +0,0 @@ -@prefix d2rq: . -@prefix foaf: . -@prefix rdf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source ; - rml:referenceFormulation rml:SQL2008Table; - rml:iterator "Student" - ]; - rml:predicateObjectMap [ - rml:object foaf:Person; - rml:predicate rdf:type - ]; - rml:subjectMap [ - rml:template "{Name}"; - rml:termType rml:IRI - ] . - - a d2rq:Database; - d2rq:jdbcDSN "CONNECTIONDSN"; - d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver"; - d2rq:password "YourSTRONG!Passw0rd;"; - d2rq:username "sa" . diff --git a/src/test/resources/rml-core/RMLTC0020a-SQLServer/output.nq b/src/test/resources/rml-core/RMLTC0020a-SQLServer/output.nq deleted file mode 100644 index 65071a55..00000000 --- a/src/test/resources/rml-core/RMLTC0020a-SQLServer/output.nq +++ /dev/null @@ -1,5 +0,0 @@ - . - . - . - . - . diff --git a/src/test/resources/rml-core/RMLTC0020a-SQLServer/resource.sql b/src/test/resources/rml-core/RMLTC0020a-SQLServer/resource.sql deleted file mode 100644 index 959a905b..00000000 --- a/src/test/resources/rml-core/RMLTC0020a-SQLServer/resource.sql +++ /dev/null @@ -1,12 +0,0 @@ -USE TestDB; -DROP TABLE IF EXISTS Student; - -CREATE TABLE Student ( -Name VARCHAR(50) -); - -INSERT INTO Student (Name) VALUES ('http://example.com/company/Alice'); -INSERT INTO Student (Name) VALUES ('Bob'); -INSERT INTO Student (Name) VALUES ('Bob/Charles'); -INSERT INTO Student (Name) VALUES ('path/../Danny'); -INSERT INTO Student (Name) VALUES ('Emily Smith'); diff --git a/src/test/resources/rml-core/RMLTC0020a-XML/mapping.ttl b/src/test/resources/rml-core/RMLTC0020a-XML/mapping.ttl deleted file mode 100644 index 8a179cce..00000000 --- a/src/test/resources/rml-core/RMLTC0020a-XML/mapping.ttl +++ /dev/null @@ -1,21 +0,0 @@ -@prefix foaf: . -@prefix rdf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator "/students/student"; - rml:referenceFormulation rml:XPath; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.xml" - ] - ]; - rml:predicateObjectMap [ - rml:object foaf:Person; - rml:predicate rdf:type - ]; - rml:subjectMap [ - rml:template "{Name}"; - rml:termType rml:IRI - ] . diff --git a/src/test/resources/rml-core/RMLTC0020a-XML/output.nq b/src/test/resources/rml-core/RMLTC0020a-XML/output.nq deleted file mode 100644 index 65071a55..00000000 --- a/src/test/resources/rml-core/RMLTC0020a-XML/output.nq +++ /dev/null @@ -1,5 +0,0 @@ - . - . - . - . - . diff --git a/src/test/resources/rml-core/RMLTC0020a-XML/student.xml b/src/test/resources/rml-core/RMLTC0020a-XML/student.xml deleted file mode 100644 index 467bf17d..00000000 --- a/src/test/resources/rml-core/RMLTC0020a-XML/student.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - http://example.com/company/Alice - Bob - Bob/Charles - path/../Danny - Emily Smith - diff --git a/src/test/resources/rml-core/RMLTC0021a-CSV/mapping.ttl b/src/test/resources/rml-core/RMLTC0021a-CSV/mapping.ttl deleted file mode 100644 index 79799413..00000000 --- a/src/test/resources/rml-core/RMLTC0021a-CSV/mapping.ttl +++ /dev/null @@ -1,25 +0,0 @@ -@prefix ex: . -@prefix rml: . - - a rml:RefObjectMap; - rml:joinCondition [ - rml:child "Sport"; - rml:parent "Sport" - ]; - rml:parentTriplesMap . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:referenceFormulation rml:CSV; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.csv" - ] - ]; - rml:predicateObjectMap [ - rml:objectMap ; - rml:predicate ex:sameSportAs - ]; - rml:subjectMap [ - rml:template "http://example.com/Student/{ID}/{Name}" - ] . diff --git a/src/test/resources/rml-core/RMLTC0021a-CSV/output.nq b/src/test/resources/rml-core/RMLTC0021a-CSV/output.nq deleted file mode 100644 index 4488c582..00000000 --- a/src/test/resources/rml-core/RMLTC0021a-CSV/output.nq +++ /dev/null @@ -1,7 +0,0 @@ - . - . - . - . - . - - diff --git a/src/test/resources/rml-core/RMLTC0021a-CSV/student.csv b/src/test/resources/rml-core/RMLTC0021a-CSV/student.csv deleted file mode 100644 index 8a96794b..00000000 --- a/src/test/resources/rml-core/RMLTC0021a-CSV/student.csv +++ /dev/null @@ -1,4 +0,0 @@ -ID,Name,Sport -10,Venus Williams,Tennis -20,Serena Williams,Tennis -30,Loena Hendrickx,Figure skating diff --git a/src/test/resources/rml-core/RMLTC0021a-JSON/README.md b/src/test/resources/rml-core/RMLTC0021a-JSON/README.md new file mode 100644 index 00000000..ac2bc65d --- /dev/null +++ b/src/test/resources/rml-core/RMLTC0021a-JSON/README.md @@ -0,0 +1,75 @@ +## RMLTC0021a-JSON + +**Title**: "Generation of triples referencing object map" + +**Description**: "Tests the mapping specification referencing object map with same logical source and join condition" + +**Default Base IRI**: http://example.com/ + +**Error expected?** No + +**Input** +``` +{ + "students": [{ + "ID": 10, + "Name":"Venus Williams", + "Sport": "Tennis" + }, { + "ID": 20, + "Name":"Serena Williams", + "Sport": "Tennis" + }, { + "ID": 30, + "Name":"Loena Hendrickx", + "Sport": "Figure skating" + }] +} + +``` + +**Mapping** +``` +@prefix activity: . +@prefix ex: . +@prefix rdf: . +@prefix rml: . + + a rml:RefObjectMap; + rml:joinCondition [ + rml:child "$.Sport"; + rml:parent "$.Sport" + ]; + rml:parentTriplesMap . + + a rml:TriplesMap; + rml:logicalSource [ a rml:LogicalSource; + rml:iterator "$.students[*]"; + rml:referenceFormulation rml:JSONPath; + rml:source [ a rml:RelativePathSource; + rml:root rml:MappingDirectory; + rml:path "student.json" + ] + ]; + rml:predicateObjectMap [ + rml:objectMap ; + rml:predicate ex:sameSportAs + ]; + rml:subjectMap [ + rml:template "http://example.com/Student/{$.ID}/{$.Name}" + ] . + +``` + +**Output** +``` + . + . + . + . + . + + + +``` + diff --git a/src/test/resources/rml-core/RMLTC0021a-JSON/mapping.ttl b/src/test/resources/rml-core/RMLTC0021a-JSON/mapping.ttl index 0603e541..f7a7d85a 100644 --- a/src/test/resources/rml-core/RMLTC0021a-JSON/mapping.ttl +++ b/src/test/resources/rml-core/RMLTC0021a-JSON/mapping.ttl @@ -5,8 +5,8 @@ a rml:RefObjectMap; rml:joinCondition [ - rml:child "Sport"; - rml:parent "Sport" + rml:child "$.Sport"; + rml:parent "$.Sport" ]; rml:parentTriplesMap . @@ -24,5 +24,5 @@ rml:predicate ex:sameSportAs ]; rml:subjectMap [ - rml:template "http://example.com/Student/{ID}/{Name}" + rml:template "http://example.com/Student/{$.ID}/{$.Name}" ] . diff --git a/src/test/resources/rml-core/RMLTC0021a-MySQL/mapping.ttl b/src/test/resources/rml-core/RMLTC0021a-MySQL/mapping.ttl deleted file mode 100644 index 079d449f..00000000 --- a/src/test/resources/rml-core/RMLTC0021a-MySQL/mapping.ttl +++ /dev/null @@ -1,30 +0,0 @@ -@prefix d2rq: . -@prefix ex: . -@prefix rml: . - - a d2rq:Database; - d2rq:jdbcDSN "CONNECTIONDSN"; - d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver"; - d2rq:password ""; - d2rq:username "root" . - - a rml:RefObjectMap; - rml:joinCondition [ - rml:child "Sport"; - rml:parent "Sport" - ]; - rml:parentTriplesMap . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source ; - rml:referenceFormulation rml:SQL2008Table; - rml:iterator "student" - ]; - rml:predicateObjectMap [ - rml:objectMap ; - rml:predicate ex:sameSportAs - ]; - rml:subjectMap [ - rml:template "http://example.com/Student/{ID}/{Name}" - ] . diff --git a/src/test/resources/rml-core/RMLTC0021a-MySQL/output.nq b/src/test/resources/rml-core/RMLTC0021a-MySQL/output.nq deleted file mode 100644 index 4488c582..00000000 --- a/src/test/resources/rml-core/RMLTC0021a-MySQL/output.nq +++ /dev/null @@ -1,7 +0,0 @@ - . - . - . - . - . - - diff --git a/src/test/resources/rml-core/RMLTC0021a-MySQL/resource.sql b/src/test/resources/rml-core/RMLTC0021a-MySQL/resource.sql deleted file mode 100644 index d7f421d4..00000000 --- a/src/test/resources/rml-core/RMLTC0021a-MySQL/resource.sql +++ /dev/null @@ -1,11 +0,0 @@ -USE test; -DROP TABLE IF EXISTS test.student; - -CREATE TABLE student ( - ID INTEGER, - Name VARCHAR(50), - Sport VARCHAR(50) -); -INSERT INTO student values ('10', 'Venus Williams', 'Tennis'); -INSERT INTO student values ('20', 'Serena Williams', 'Tennis'); -INSERT INTO student values ('30', 'Loena Hendrickx', 'Figure skating'); diff --git a/src/test/resources/rml-core/RMLTC0021a-PostgreSQL/mapping.ttl b/src/test/resources/rml-core/RMLTC0021a-PostgreSQL/mapping.ttl deleted file mode 100644 index 7d2dff27..00000000 --- a/src/test/resources/rml-core/RMLTC0021a-PostgreSQL/mapping.ttl +++ /dev/null @@ -1,30 +0,0 @@ -@prefix d2rq: . -@prefix ex: . -@prefix rml: . - - a d2rq:Database; - d2rq:jdbcDSN "CONNECTIONDSN"; - d2rq:jdbcDriver "org.postgresql.Driver"; - d2rq:password ""; - d2rq:username "postgres" . - - a rml:RefObjectMap; - rml:joinCondition [ - rml:child "Sport"; - rml:parent "Sport" - ]; - rml:parentTriplesMap . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source ; - rml:referenceFormulation rml:SQL2008Table; - rml:iterator "student" - ]; - rml:predicateObjectMap [ - rml:objectMap ; - rml:predicate ex:sameSportAs - ]; - rml:subjectMap [ - rml:template "http://example.com/Student/{ID}/{Name}" - ] . diff --git a/src/test/resources/rml-core/RMLTC0021a-PostgreSQL/output.nq b/src/test/resources/rml-core/RMLTC0021a-PostgreSQL/output.nq deleted file mode 100644 index 4488c582..00000000 --- a/src/test/resources/rml-core/RMLTC0021a-PostgreSQL/output.nq +++ /dev/null @@ -1,7 +0,0 @@ - . - . - . - . - . - - diff --git a/src/test/resources/rml-core/RMLTC0021a-PostgreSQL/resource.sql b/src/test/resources/rml-core/RMLTC0021a-PostgreSQL/resource.sql deleted file mode 100644 index 9e31d74b..00000000 --- a/src/test/resources/rml-core/RMLTC0021a-PostgreSQL/resource.sql +++ /dev/null @@ -1,10 +0,0 @@ -DROP TABLE IF EXISTS student; - -CREATE TABLE student ( - "ID" INTEGER, - "Name" VARCHAR(50), - "Sport" VARCHAR(50) -); -INSERT INTO student values ('10', 'Venus Williams', 'Tennis'); -INSERT INTO student values ('20', 'Serena Williams', 'Tennis'); -INSERT INTO student values ('30', 'Loena Hendrickx', 'Figure skating'); diff --git a/src/test/resources/rml-core/RMLTC0021a-SPARQL/mapping.ttl b/src/test/resources/rml-core/RMLTC0021a-SPARQL/mapping.ttl deleted file mode 100644 index 5e44b45c..00000000 --- a/src/test/resources/rml-core/RMLTC0021a-SPARQL/mapping.ttl +++ /dev/null @@ -1,40 +0,0 @@ -@prefix ex: . -@prefix formats: . -@prefix rml: . -@prefix sd: . - -ex:RefObjectMap1 a rml:RefObjectMap; - rml:joinCondition [ - rml:child "Sport.value"; - rml:parent "Sport.value" - ]; - rml:parentTriplesMap ex:TriplesMap1 . - -ex:TriplesMap1 a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator """ - PREFIX rdfs: - PREFIX foaf: - PREFIX rdf: - SELECT ?Name ?ID - WHERE { - ?x foaf:name ?Name ; - rdf:ID ?ID ; - } """; - rml:referenceFormulation formats:SPARQL_Results_JSON; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path - ] - ]; - rml:predicateObjectMap [ - rml:objectMap ex:RefObjectMap1; - rml:predicate ex:sameSportAs - ]; - rml:subjectMap [ - rml:template "http://example.com/Student/{ID.value}/{Name.value}" - ] . - - a sd:Service; - sd:endpoint ; - sd:supportedLanguage sd:SPARQL11Query . diff --git a/src/test/resources/rml-core/RMLTC0021a-SPARQL/output.nq b/src/test/resources/rml-core/RMLTC0021a-SPARQL/output.nq deleted file mode 100644 index 4488c582..00000000 --- a/src/test/resources/rml-core/RMLTC0021a-SPARQL/output.nq +++ /dev/null @@ -1,7 +0,0 @@ - . - . - . - . - . - - diff --git a/src/test/resources/rml-core/RMLTC0021a-SPARQL/resource.ttl b/src/test/resources/rml-core/RMLTC0021a-SPARQL/resource.ttl deleted file mode 100644 index fd943016..00000000 --- a/src/test/resources/rml-core/RMLTC0021a-SPARQL/resource.ttl +++ /dev/null @@ -1,19 +0,0 @@ -@prefix foaf: . -@prefix ns1: . -@prefix rdf: . - -[] ns1:plays [ a ns1:Sport ; - foaf:name "Tennis" ] ; - rdf:ID "10" ; - foaf:name "Venus Williams" . - -[] ns1:plays [ a ns1:Sport ; - foaf:name "Tennis" ] ; - rdf:ID "20" ; - foaf:name "Serena Williams" . - -[] ns1:plays [ a ns1:Sport ; - foaf:name "Figure skating" ] ; - rdf:ID "30" ; - foaf:name "Loena Hendrickx" . - diff --git a/src/test/resources/rml-core/RMLTC0021a-SQLServer/mapping.ttl b/src/test/resources/rml-core/RMLTC0021a-SQLServer/mapping.ttl deleted file mode 100644 index a3be9075..00000000 --- a/src/test/resources/rml-core/RMLTC0021a-SQLServer/mapping.ttl +++ /dev/null @@ -1,30 +0,0 @@ -@prefix d2rq: . -@prefix ex: . -@prefix rml: . - - a d2rq:Database; - d2rq:jdbcDSN "CONNECTIONDSN"; - d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver"; - d2rq:password "YourSTRONG!Passw0rd;"; - d2rq:username "sa" . - - a rml:RefObjectMap; - rml:joinCondition [ - rml:child "Sport"; - rml:parent "Sport" - ]; - rml:parentTriplesMap . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source ; - rml:referenceFormulation rml:SQL2008Table; - rml:iterator "student" - ]; - rml:predicateObjectMap [ - rml:objectMap ; - rml:predicate ex:sameSportAs - ]; - rml:subjectMap [ - rml:template "http://example.com/Student/{ID}/{Name}" - ] . diff --git a/src/test/resources/rml-core/RMLTC0021a-SQLServer/output.nq b/src/test/resources/rml-core/RMLTC0021a-SQLServer/output.nq deleted file mode 100644 index 4488c582..00000000 --- a/src/test/resources/rml-core/RMLTC0021a-SQLServer/output.nq +++ /dev/null @@ -1,7 +0,0 @@ - . - . - . - . - . - - diff --git a/src/test/resources/rml-core/RMLTC0021a-SQLServer/resource.sql b/src/test/resources/rml-core/RMLTC0021a-SQLServer/resource.sql deleted file mode 100644 index 76d1c3e6..00000000 --- a/src/test/resources/rml-core/RMLTC0021a-SQLServer/resource.sql +++ /dev/null @@ -1,10 +0,0 @@ -USE TestDB; -DROP TABLE IF EXISTS student; -CREATE TABLE student ( - "ID" INTEGER, - "Name" VARCHAR(50), - "Sport" VARCHAR(50) -); -INSERT INTO student values ('10', 'Venus Williams', 'Tennis'); -INSERT INTO student values ('20', 'Serena Williams', 'Tennis'); -INSERT INTO student values ('30', 'Loena Hendrickx', 'Figure skating'); diff --git a/src/test/resources/rml-core/RMLTC0021a-XML/mapping.ttl b/src/test/resources/rml-core/RMLTC0021a-XML/mapping.ttl deleted file mode 100644 index 60bf4a18..00000000 --- a/src/test/resources/rml-core/RMLTC0021a-XML/mapping.ttl +++ /dev/null @@ -1,26 +0,0 @@ -@prefix ex: . -@prefix rml: . - - a rml:RefObjectMap; - rml:joinCondition [ - rml:child "Sport"; - rml:parent "Sport" - ]; - rml:parentTriplesMap . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator "/students/student"; - rml:referenceFormulation rml:XPath; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.xml" - ] - ]; - rml:predicateObjectMap [ - rml:objectMap ; - rml:predicate ex:sameSportAs - ]; - rml:subjectMap [ - rml:template "http://example.com/Student/{ID}/{Name}" - ] . diff --git a/src/test/resources/rml-core/RMLTC0021a-XML/output.nq b/src/test/resources/rml-core/RMLTC0021a-XML/output.nq deleted file mode 100644 index 4488c582..00000000 --- a/src/test/resources/rml-core/RMLTC0021a-XML/output.nq +++ /dev/null @@ -1,7 +0,0 @@ - . - . - . - . - . - - diff --git a/src/test/resources/rml-core/RMLTC0021a-XML/student.xml b/src/test/resources/rml-core/RMLTC0021a-XML/student.xml deleted file mode 100644 index 2b184f7d..00000000 --- a/src/test/resources/rml-core/RMLTC0021a-XML/student.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - 10 - Venus Williams - Tennis - - - 20 - Serena Williams - Tennis - - - 30 - Loena Hendrickx - Figure skating - - diff --git a/src/test/resources/rml-core/RMLTC0022a-CSV/mapping.ttl b/src/test/resources/rml-core/RMLTC0022a-CSV/mapping.ttl deleted file mode 100644 index af948398..00000000 --- a/src/test/resources/rml-core/RMLTC0022a-CSV/mapping.ttl +++ /dev/null @@ -1,29 +0,0 @@ -@prefix ex: . -@prefix foaf: . -@prefix rml: . -@prefix xsd: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:referenceFormulation rml:CSV; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.csv" - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:datatype xsd:string; - rml:reference "Name" - ]; - rml:predicate foaf:name - ], [ - rml:objectMap [ - rml:datatype xsd:int; - rml:reference "Age" - ]; - rml:predicate ex:age - ]; - rml:subjectMap [ - rml:template "http://example.com/{Name}" - ] . diff --git a/src/test/resources/rml-core/RMLTC0022a-CSV/output.nq b/src/test/resources/rml-core/RMLTC0022a-CSV/output.nq deleted file mode 100644 index a25ee88a..00000000 --- a/src/test/resources/rml-core/RMLTC0022a-CSV/output.nq +++ /dev/null @@ -1,2 +0,0 @@ - "Venus"^^ . - "21"^^ . \ No newline at end of file diff --git a/src/test/resources/rml-core/RMLTC0022a-CSV/student.csv b/src/test/resources/rml-core/RMLTC0022a-CSV/student.csv deleted file mode 100644 index 7af01247..00000000 --- a/src/test/resources/rml-core/RMLTC0022a-CSV/student.csv +++ /dev/null @@ -1,2 +0,0 @@ -Name,Age -Venus,21 diff --git a/src/test/resources/rml-core/RMLTC0022a-JSON/README.md b/src/test/resources/rml-core/RMLTC0022a-JSON/README.md new file mode 100644 index 00000000..31d47a23 --- /dev/null +++ b/src/test/resources/rml-core/RMLTC0022a-JSON/README.md @@ -0,0 +1,64 @@ +## RMLTC0022a-JSON + +**Title**: "Generating of triples with constant datatype" + +**Description**: "Test triples with a fixed constant datatype" + +**Default Base IRI**: http://example.com/ + +**Error expected?** No + +**Input** +``` +{ + "students": [{ + "ID": 10, + "Name":"Venus", + "Age": 21 + }] +} + +``` + +**Mapping** +``` +@prefix ex: . +@prefix foaf: . +@prefix rml: . +@prefix xsd: . + + a rml:TriplesMap; + rml:logicalSource [ a rml:LogicalSource; + rml:iterator "$.students[*]"; + rml:referenceFormulation rml:JSONPath; + rml:source [ a rml:RelativePathSource; + rml:root rml:MappingDirectory; + rml:path "student.json" + ] + ]; + rml:predicateObjectMap [ + rml:objectMap [ + rml:datatype xsd:string; + rml:reference "$.Name" + ]; + rml:predicate foaf:name + ], [ + rml:objectMap [ + rml:datatype xsd:int; + rml:reference "$.Age" + ]; + rml:predicate ex:age + ]; + rml:subjectMap [ + rml:template "http://example.com/{$.Name}" + ] . + +``` + +**Output** +``` + "Venus"^^ . + "21"^^ . + +``` + diff --git a/src/test/resources/rml-core/RMLTC0022a-JSON/mapping.ttl b/src/test/resources/rml-core/RMLTC0022a-JSON/mapping.ttl new file mode 100644 index 00000000..761e5507 --- /dev/null +++ b/src/test/resources/rml-core/RMLTC0022a-JSON/mapping.ttl @@ -0,0 +1,30 @@ +@prefix ex: . +@prefix foaf: . +@prefix rml: . +@prefix xsd: . + + a rml:TriplesMap; + rml:logicalSource [ a rml:LogicalSource; + rml:iterator "$.students[*]"; + rml:referenceFormulation rml:JSONPath; + rml:source [ a rml:RelativePathSource; + rml:root rml:MappingDirectory; + rml:path "student.json" + ] + ]; + rml:predicateObjectMap [ + rml:objectMap [ + rml:datatype xsd:string; + rml:reference "$.Name" + ]; + rml:predicate foaf:name + ], [ + rml:objectMap [ + rml:datatype xsd:int; + rml:reference "$.Age" + ]; + rml:predicate ex:age + ]; + rml:subjectMap [ + rml:template "http://example.com/{$.Name}" + ] . diff --git a/src/test/resources/rml-core/RMLTC0022a-JSON/output.nq b/src/test/resources/rml-core/RMLTC0022a-JSON/output.nq new file mode 100644 index 00000000..f18b6f47 --- /dev/null +++ b/src/test/resources/rml-core/RMLTC0022a-JSON/output.nq @@ -0,0 +1,2 @@ + "Venus"^^ . + "21"^^ . diff --git a/src/test/resources/rml-core/RMLTC0022a-JSON/student.json b/src/test/resources/rml-core/RMLTC0022a-JSON/student.json new file mode 100644 index 00000000..b51a0d81 --- /dev/null +++ b/src/test/resources/rml-core/RMLTC0022a-JSON/student.json @@ -0,0 +1,7 @@ +{ + "students": [{ + "ID": 10, + "Name":"Venus", + "Age": 21 + }] +} diff --git a/src/test/resources/rml-core/RMLTC0022b-CSV/data.csv b/src/test/resources/rml-core/RMLTC0022b-CSV/data.csv deleted file mode 100644 index 00a92ee4..00000000 --- a/src/test/resources/rml-core/RMLTC0022b-CSV/data.csv +++ /dev/null @@ -1,3 +0,0 @@ -FOO,BAR -1,string -2,int diff --git a/src/test/resources/rml-core/RMLTC0022b-CSV/mapping.ttl b/src/test/resources/rml-core/RMLTC0022b-CSV/mapping.ttl deleted file mode 100644 index 40a4c33a..00000000 --- a/src/test/resources/rml-core/RMLTC0022b-CSV/mapping.ttl +++ /dev/null @@ -1,23 +0,0 @@ -@prefix ex: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:referenceFormulation rml:CSV; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "data.csv" - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:datatypeMap [ - rml:template "http://www.w3.org/2001/XMLSchema#{BAR}" - ]; - rml:reference "FOO" - ]; - rml:predicate ex:x - ]; - rml:subjectMap [ - rml:template "http://example.com/{FOO}" - ] . diff --git a/src/test/resources/rml-core/RMLTC0022b-CSV/output.nq b/src/test/resources/rml-core/RMLTC0022b-CSV/output.nq deleted file mode 100644 index c81c7378..00000000 --- a/src/test/resources/rml-core/RMLTC0022b-CSV/output.nq +++ /dev/null @@ -1,2 +0,0 @@ - "1"^^ . - "2"^^ . \ No newline at end of file diff --git a/src/test/resources/rml-core/RMLTC0022b-JSON/README.md b/src/test/resources/rml-core/RMLTC0022b-JSON/README.md new file mode 100644 index 00000000..7fe506f0 --- /dev/null +++ b/src/test/resources/rml-core/RMLTC0022b-JSON/README.md @@ -0,0 +1,56 @@ +## RMLTC0022b-JSON + +**Title**: "Generating of triples with datatypeMap" + +**Description**: "Test triples with a XSD datatype generated from the data" + +**Default Base IRI**: http://example.com/ + +**Error expected?** No + +**Input** +``` +[ + { "FOO": 1, "BAR": "string"}, + { "FOO": 2, "BAR": "int"} +] + +``` + +**Mapping** +``` +@prefix ex: . +@prefix rml: . + + a rml:TriplesMap; + rml:logicalSource [ a rml:LogicalSource; + rml:referenceFormulation rml:JSONPath; + rml:iterator "$[*]"; + rml:source [ a rml:RelativePathSource; + rml:root rml:MappingDirectory; + rml:path "data.json" + ] + ]; + rml:predicateObjectMap [ + rml:objectMap [ + rml:datatypeMap [ + rml:template "http://www.w3.org/2001/XMLSchema#{$.BAR}" + ]; + rml:reference "$.FOO" + ]; + rml:predicate ex:x + ]; + rml:subjectMap [ + rml:template "http://example.com/{$.FOO}" + ] . + + +``` + +**Output** +``` + "1"^^ . + "2"^^ . + +``` + diff --git a/src/test/resources/rml-core/RMLTC0022b-JSON/data.json b/src/test/resources/rml-core/RMLTC0022b-JSON/data.json new file mode 100644 index 00000000..6b0dcef9 --- /dev/null +++ b/src/test/resources/rml-core/RMLTC0022b-JSON/data.json @@ -0,0 +1,4 @@ +[ + { "FOO": 1, "BAR": "string"}, + { "FOO": 2, "BAR": "int"} +] diff --git a/src/test/resources/rml-core/RMLTC0022b-JSON/mapping.ttl b/src/test/resources/rml-core/RMLTC0022b-JSON/mapping.ttl new file mode 100644 index 00000000..0f519282 --- /dev/null +++ b/src/test/resources/rml-core/RMLTC0022b-JSON/mapping.ttl @@ -0,0 +1,25 @@ +@prefix ex: . +@prefix rml: . + + a rml:TriplesMap; + rml:logicalSource [ a rml:LogicalSource; + rml:referenceFormulation rml:JSONPath; + rml:iterator "$[*]"; + rml:source [ a rml:RelativePathSource; + rml:root rml:MappingDirectory; + rml:path "data.json" + ] + ]; + rml:predicateObjectMap [ + rml:objectMap [ + rml:datatypeMap [ + rml:template "http://www.w3.org/2001/XMLSchema#{$.BAR}" + ]; + rml:reference "$.FOO" + ]; + rml:predicate ex:x + ]; + rml:subjectMap [ + rml:template "http://example.com/{$.FOO}" + ] . + diff --git a/src/test/resources/rml-core/RMLTC0022b-JSON/output.nq b/src/test/resources/rml-core/RMLTC0022b-JSON/output.nq new file mode 100644 index 00000000..0e3c60c4 --- /dev/null +++ b/src/test/resources/rml-core/RMLTC0022b-JSON/output.nq @@ -0,0 +1,2 @@ + "1"^^ . + "2"^^ . diff --git a/src/test/resources/rml-core/RMLTC0022c-CSV/data.csv b/src/test/resources/rml-core/RMLTC0022c-CSV/data.csv deleted file mode 100644 index 00a92ee4..00000000 --- a/src/test/resources/rml-core/RMLTC0022c-CSV/data.csv +++ /dev/null @@ -1,3 +0,0 @@ -FOO,BAR -1,string -2,int diff --git a/src/test/resources/rml-core/RMLTC0022c-CSV/mapping.ttl b/src/test/resources/rml-core/RMLTC0022c-CSV/mapping.ttl deleted file mode 100644 index 3aa1c86c..00000000 --- a/src/test/resources/rml-core/RMLTC0022c-CSV/mapping.ttl +++ /dev/null @@ -1,23 +0,0 @@ -@prefix ex: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:referenceFormulation rml:CSV; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "data.csv" - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:datatypeMap [ - rml:template "datatype#{BAR}" - ]; - rml:reference "FOO" - ]; - rml:predicate ex:x - ]; - rml:subjectMap [ - rml:template "http://example.com/{FOO}" - ] . diff --git a/src/test/resources/rml-core/RMLTC0022c-CSV/output.nq b/src/test/resources/rml-core/RMLTC0022c-CSV/output.nq deleted file mode 100644 index 593f6c51..00000000 --- a/src/test/resources/rml-core/RMLTC0022c-CSV/output.nq +++ /dev/null @@ -1,2 +0,0 @@ - "1"^^ . - "2"^^ . \ No newline at end of file diff --git a/src/test/resources/rml-core/RMLTC0022c-JSON/README.md b/src/test/resources/rml-core/RMLTC0022c-JSON/README.md new file mode 100644 index 00000000..72870ba6 --- /dev/null +++ b/src/test/resources/rml-core/RMLTC0022c-JSON/README.md @@ -0,0 +1,55 @@ +## RMLTC0022c-JSON + +**Title**: "Generating of triples with datatypeMap with custom datatype" + +**Description**: "Test triples with a custom datype from the data" + +**Default Base IRI**: http://example.com/ + +**Error expected?** No + +**Input** +``` +[ + { "FOO": 1, "BAR": "string"}, + { "FOO": 2, "BAR": "int"} +] + +``` + +**Mapping** +``` +@prefix ex: . +@prefix rml: . + + a rml:TriplesMap; + rml:logicalSource [ a rml:LogicalSource; + rml:referenceFormulation rml:JSONPath; + rml:iterator "$[*]"; + rml:source [ a rml:RelativePathSource; + rml:root rml:MappingDirectory; + rml:path "data.json" + ] + ]; + rml:predicateObjectMap [ + rml:objectMap [ + rml:datatypeMap [ + rml:template "datatype#{$.BAR}" + ]; + rml:reference "$.FOO" + ]; + rml:predicate ex:x + ]; + rml:subjectMap [ + rml:template "http://example.com/{$.FOO}" + ] . + +``` + +**Output** +``` + "1"^^ . + "2"^^ . + +``` + diff --git a/src/test/resources/rml-core/RMLTC0022c-JSON/data.json b/src/test/resources/rml-core/RMLTC0022c-JSON/data.json new file mode 100644 index 00000000..6b0dcef9 --- /dev/null +++ b/src/test/resources/rml-core/RMLTC0022c-JSON/data.json @@ -0,0 +1,4 @@ +[ + { "FOO": 1, "BAR": "string"}, + { "FOO": 2, "BAR": "int"} +] diff --git a/src/test/resources/rml-core/RMLTC0022c-JSON/mapping.ttl b/src/test/resources/rml-core/RMLTC0022c-JSON/mapping.ttl new file mode 100644 index 00000000..3bc1cd72 --- /dev/null +++ b/src/test/resources/rml-core/RMLTC0022c-JSON/mapping.ttl @@ -0,0 +1,24 @@ +@prefix ex: . +@prefix rml: . + + a rml:TriplesMap; + rml:logicalSource [ a rml:LogicalSource; + rml:referenceFormulation rml:JSONPath; + rml:iterator "$[*]"; + rml:source [ a rml:RelativePathSource; + rml:root rml:MappingDirectory; + rml:path "data.json" + ] + ]; + rml:predicateObjectMap [ + rml:objectMap [ + rml:datatypeMap [ + rml:template "datatype#{$.BAR}" + ]; + rml:reference "$.FOO" + ]; + rml:predicate ex:x + ]; + rml:subjectMap [ + rml:template "http://example.com/{$.FOO}" + ] . diff --git a/src/test/resources/rml-core/RMLTC0022c-JSON/output.nq b/src/test/resources/rml-core/RMLTC0022c-JSON/output.nq new file mode 100644 index 00000000..dcca5d82 --- /dev/null +++ b/src/test/resources/rml-core/RMLTC0022c-JSON/output.nq @@ -0,0 +1,2 @@ + "1"^^ . + "2"^^ . diff --git a/src/test/resources/rml-core/RMLTC0023a-JSON/README.md b/src/test/resources/rml-core/RMLTC0023a-JSON/README.md new file mode 100644 index 00000000..80535ccb --- /dev/null +++ b/src/test/resources/rml-core/RMLTC0023a-JSON/README.md @@ -0,0 +1,42 @@ +## RMLTC0023a-JSON + +**Title**: "Invalid IRI template 1" + +**Description**: "Test handling of invalid IRI template" + +**Default Base IRI**: http://example.com/ + +**Error expected?** Yes + +**Input** +``` +{ + "students": [{ + "ID": 10, + "{Name}":"Venus" + }] +} + +``` + +**Mapping** +``` +@prefix foaf: . +@prefix rml: . + + a rml:TriplesMap; + rml:logicalSource [ a rml:LogicalSource; + rml:referenceFormulation rml:JSONPath; + rml:iterator "$.students[*]"; + rml:source [ a rml:RelativePathSource; + rml:root rml:MappingDirectory; + rml:path "student.json" + ] + ]; + rml:subjectMap [ + rml:template "http://example.com/{{Name}}"; + rml:class foaf:Person; + ] . + +``` + diff --git a/src/test/resources/rml-core/RMLTC0023a-JSON/mapping.ttl b/src/test/resources/rml-core/RMLTC0023a-JSON/mapping.ttl new file mode 100644 index 00000000..4c4e6923 --- /dev/null +++ b/src/test/resources/rml-core/RMLTC0023a-JSON/mapping.ttl @@ -0,0 +1,16 @@ +@prefix foaf: . +@prefix rml: . + + a rml:TriplesMap; + rml:logicalSource [ a rml:LogicalSource; + rml:referenceFormulation rml:JSONPath; + rml:iterator "$.students[*]"; + rml:source [ a rml:RelativePathSource; + rml:root rml:MappingDirectory; + rml:path "student.json" + ] + ]; + rml:subjectMap [ + rml:template "http://example.com/{{Name}}"; + rml:class foaf:Person; + ] . diff --git a/src/test/resources/rml-core/RMLTC0023a-JSON/student.json b/src/test/resources/rml-core/RMLTC0023a-JSON/student.json new file mode 100644 index 00000000..2aa21689 --- /dev/null +++ b/src/test/resources/rml-core/RMLTC0023a-JSON/student.json @@ -0,0 +1,6 @@ +{ + "students": [{ + "ID": 10, + "{Name}":"Venus" + }] +} diff --git a/src/test/resources/rml-core/RMLTC0023a-XML/ious.xml b/src/test/resources/rml-core/RMLTC0023a-XML/ious.xml deleted file mode 100644 index aad50963..00000000 --- a/src/test/resources/rml-core/RMLTC0023a-XML/ious.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - diff --git a/src/test/resources/rml-core/RMLTC0023a-XML/mapping.ttl b/src/test/resources/rml-core/RMLTC0023a-XML/mapping.ttl deleted file mode 100644 index 16ac0cce..00000000 --- a/src/test/resources/rml-core/RMLTC0023a-XML/mapping.ttl +++ /dev/null @@ -1,23 +0,0 @@ -@prefix ex: . -@prefix foaf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator "/persons/person"; - rml:referenceFormulation rml:XPath; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "ious.xml" - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "@amount" - ]; - rml:predicate ex:owes - ]; - rml:subjectMap [ - rml:class foaf:Person; - rml:template "http://example.com/{@fname};{@lname}" - ] . diff --git a/src/test/resources/rml-core/RMLTC0023a-XML/output.nq b/src/test/resources/rml-core/RMLTC0023a-XML/output.nq deleted file mode 100644 index 64e91da4..00000000 --- a/src/test/resources/rml-core/RMLTC0023a-XML/output.nq +++ /dev/null @@ -1,5 +0,0 @@ - . - "30.0E0" . - . - "20.0E0" . - diff --git a/src/test/resources/rml-core/RMLTC0023b-JSON/README.md b/src/test/resources/rml-core/RMLTC0023b-JSON/README.md new file mode 100644 index 00000000..b77e6934 --- /dev/null +++ b/src/test/resources/rml-core/RMLTC0023b-JSON/README.md @@ -0,0 +1,43 @@ +## RMLTC0023b-JSON + +**Title**: "Invalid IRI template 2" + +**Description**: "Test handling of invalid IRI template" + +**Default Base IRI**: http://example.com/ + +**Error expected?** Yes + +**Input** +``` +{ + "students": [{ + "ID": 10, + "N\ame":"Venus" + }] +} + +``` + +**Mapping** +``` +@prefix foaf: . +@prefix rml: . + + a rml:TriplesMap; + rml:logicalSource [ a rml:LogicalSource; + rml:referenceFormulation rml:JSONPath; + rml:iterator "$.students[*]"; + rml:source [ a rml:RelativePathSource; + rml:root rml:MappingDirectory; + rml:path "student.json" + ] + ]; + rml:subjectMap [ + rml:template "http://example.com/{N\ame}"; + rml:class foaf:Person; + ] . + + +``` + diff --git a/src/test/resources/rml-core/RMLTC0023b-JSON/mapping.ttl b/src/test/resources/rml-core/RMLTC0023b-JSON/mapping.ttl new file mode 100644 index 00000000..e23f6935 --- /dev/null +++ b/src/test/resources/rml-core/RMLTC0023b-JSON/mapping.ttl @@ -0,0 +1,17 @@ +@prefix foaf: . +@prefix rml: . + + a rml:TriplesMap; + rml:logicalSource [ a rml:LogicalSource; + rml:referenceFormulation rml:JSONPath; + rml:iterator "$.students[*]"; + rml:source [ a rml:RelativePathSource; + rml:root rml:MappingDirectory; + rml:path "student.json" + ] + ]; + rml:subjectMap [ + rml:template "http://example.com/{N\ame}"; + rml:class foaf:Person; + ] . + diff --git a/src/test/resources/rml-core/RMLTC0023b-JSON/student.json b/src/test/resources/rml-core/RMLTC0023b-JSON/student.json new file mode 100644 index 00000000..a905e537 --- /dev/null +++ b/src/test/resources/rml-core/RMLTC0023b-JSON/student.json @@ -0,0 +1,6 @@ +{ + "students": [{ + "ID": 10, + "N\ame":"Venus" + }] +} diff --git a/src/test/resources/rml-core/RMLTC0023c-JSON/README.md b/src/test/resources/rml-core/RMLTC0023c-JSON/README.md new file mode 100644 index 00000000..84285615 --- /dev/null +++ b/src/test/resources/rml-core/RMLTC0023c-JSON/README.md @@ -0,0 +1,43 @@ +## RMLTC0023c-JSON + +**Title**: "Invalid IRI template 3" + +**Description**: "Test handling of invalid IRI template" + +**Default Base IRI**: http://example.com/ + +**Error expected?** Yes + +**Input** +``` +{ + "students": [{ + "ID": 10, + "Name":"Venus" + }] +} + +``` + +**Mapping** +``` +@prefix foaf: . +@prefix rml: . + + a rml:TriplesMap; + rml:logicalSource [ a rml:LogicalSource; + rml:referenceFormulation rml:JSONPath; + rml:iterator "$.students[*]"; + rml:source [ a rml:RelativePathSource; + rml:root rml:MappingDirectory; + rml:path "student.json" + ] + ]; + rml:subjectMap [ + rml:template "http://example.com/{Name\}"; + rml:class foaf:Person; + ] . + + +``` + diff --git a/src/test/resources/rml-core/RMLTC0023c-JSON/mapping.ttl b/src/test/resources/rml-core/RMLTC0023c-JSON/mapping.ttl new file mode 100644 index 00000000..0b46f351 --- /dev/null +++ b/src/test/resources/rml-core/RMLTC0023c-JSON/mapping.ttl @@ -0,0 +1,17 @@ +@prefix foaf: . +@prefix rml: . + + a rml:TriplesMap; + rml:logicalSource [ a rml:LogicalSource; + rml:referenceFormulation rml:JSONPath; + rml:iterator "$.students[*]"; + rml:source [ a rml:RelativePathSource; + rml:root rml:MappingDirectory; + rml:path "student.json" + ] + ]; + rml:subjectMap [ + rml:template "http://example.com/{Name\}"; + rml:class foaf:Person; + ] . + diff --git a/src/test/resources/rml-core/RMLTC0023c-JSON/student.json b/src/test/resources/rml-core/RMLTC0023c-JSON/student.json new file mode 100644 index 00000000..0f6f797f --- /dev/null +++ b/src/test/resources/rml-core/RMLTC0023c-JSON/student.json @@ -0,0 +1,6 @@ +{ + "students": [{ + "ID": 10, + "Name":"Venus" + }] +} diff --git a/src/test/resources/rml-core/RMLTC0023d-JSON/README.md b/src/test/resources/rml-core/RMLTC0023d-JSON/README.md new file mode 100644 index 00000000..1cbc5eef --- /dev/null +++ b/src/test/resources/rml-core/RMLTC0023d-JSON/README.md @@ -0,0 +1,43 @@ +## RMLTC0023d-JSON + +**Title**: "Invalid IRI template 4" + +**Description**: "Test handling of invalid IRI template" + +**Default Base IRI**: http://example.com/ + +**Error expected?** Yes + +**Input** +``` +{ + "students": [{ + "ID": 10, + "{Name}":"Venus" + }] +} + +``` + +**Mapping** +``` +@prefix foaf: . +@prefix rml: . + + a rml:TriplesMap; + rml:logicalSource [ a rml:LogicalSource; + rml:referenceFormulation rml:JSONPath; + rml:iterator "$.students[*]"; + rml:source [ a rml:RelativePathSource; + rml:root rml:MappingDirectory; + rml:path "student.json" + ] + ]; + rml:subjectMap [ + rml:template "http://example.com/{\\\\{Name\\\\}}"; + rml:class foaf:Person; + ] . + + +``` + diff --git a/src/test/resources/rml-core/RMLTC0023d-JSON/mapping.ttl b/src/test/resources/rml-core/RMLTC0023d-JSON/mapping.ttl new file mode 100644 index 00000000..4d56d8ab --- /dev/null +++ b/src/test/resources/rml-core/RMLTC0023d-JSON/mapping.ttl @@ -0,0 +1,17 @@ +@prefix foaf: . +@prefix rml: . + + a rml:TriplesMap; + rml:logicalSource [ a rml:LogicalSource; + rml:referenceFormulation rml:JSONPath; + rml:iterator "$.students[*]"; + rml:source [ a rml:RelativePathSource; + rml:root rml:MappingDirectory; + rml:path "student.json" + ] + ]; + rml:subjectMap [ + rml:template "http://example.com/{\\\\{Name\\\\}}"; + rml:class foaf:Person; + ] . + diff --git a/src/test/resources/rml-core/RMLTC0023d-JSON/student.json b/src/test/resources/rml-core/RMLTC0023d-JSON/student.json new file mode 100644 index 00000000..2aa21689 --- /dev/null +++ b/src/test/resources/rml-core/RMLTC0023d-JSON/student.json @@ -0,0 +1,6 @@ +{ + "students": [{ + "ID": 10, + "{Name}":"Venus" + }] +} diff --git a/src/test/resources/rml-core/RMLTC0023e-JSON/README.md b/src/test/resources/rml-core/RMLTC0023e-JSON/README.md new file mode 100644 index 00000000..91737abc --- /dev/null +++ b/src/test/resources/rml-core/RMLTC0023e-JSON/README.md @@ -0,0 +1,42 @@ +## RMLTC0023e-JSON + +**Title**: "Invalid IRI template 5" + +**Description**: "Test handling of invalid IRI template" + +**Default Base IRI**: http://example.com/ + +**Error expected?** Yes + +**Input** +``` +{ + "students": [{ + "ID": 10, + "N\ame":"Venus" + }] +} + +``` + +**Mapping** +``` +@prefix foaf: . +@prefix rml: . + + a rml:TriplesMap; + rml:logicalSource [ a rml:LogicalSource; + rml:referenceFormulation rml:JSONPath; + rml:iterator "$.students[*]"; + rml:source [ a rml:RelativePathSource; + rml:root rml:MappingDirectory; + rml:path "student.json" + ] + ]; + rml:subjectMap [ + rml:template "http://example.com/{N\\\ame}"; + rml:class foaf:Person; + ] . + +``` + diff --git a/src/test/resources/rml-core/RMLTC0023e-JSON/mapping.ttl b/src/test/resources/rml-core/RMLTC0023e-JSON/mapping.ttl new file mode 100644 index 00000000..98c1d29e --- /dev/null +++ b/src/test/resources/rml-core/RMLTC0023e-JSON/mapping.ttl @@ -0,0 +1,16 @@ +@prefix foaf: . +@prefix rml: . + + a rml:TriplesMap; + rml:logicalSource [ a rml:LogicalSource; + rml:referenceFormulation rml:JSONPath; + rml:iterator "$.students[*]"; + rml:source [ a rml:RelativePathSource; + rml:root rml:MappingDirectory; + rml:path "student.json" + ] + ]; + rml:subjectMap [ + rml:template "http://example.com/{N\\\ame}"; + rml:class foaf:Person; + ] . diff --git a/src/test/resources/rml-core/RMLTC0023e-JSON/student.json b/src/test/resources/rml-core/RMLTC0023e-JSON/student.json new file mode 100644 index 00000000..a905e537 --- /dev/null +++ b/src/test/resources/rml-core/RMLTC0023e-JSON/student.json @@ -0,0 +1,6 @@ +{ + "students": [{ + "ID": 10, + "N\ame":"Venus" + }] +} diff --git a/src/test/resources/rml-core/RMLTC0023f-JSON/README.md b/src/test/resources/rml-core/RMLTC0023f-JSON/README.md new file mode 100644 index 00000000..e786a76c --- /dev/null +++ b/src/test/resources/rml-core/RMLTC0023f-JSON/README.md @@ -0,0 +1,48 @@ +## RMLTC0023f-JSON + +**Title**: "Valid IRI template with backslash-escape" + +**Description**: "Test handling of a valid IRI template using backslash-escape" + +**Default Base IRI**: http://example.com/ + +**Error expected?** No + +**Input** +``` +{ + "students": [{ + "ID": 10, + "{Name}":"Venus" + }] +} + +``` + +**Mapping** +``` +@prefix foaf: . +@prefix rml: . + + a rml:TriplesMap; + rml:logicalSource [ a rml:LogicalSource; + rml:referenceFormulation rml:JSONPath; + rml:iterator "$.students[*]"; + rml:source [ a rml:RelativePathSource; + rml:root rml:MappingDirectory; + rml:path "student.json" + ] + ]; + rml:subjectMap [ + rml:template "http://example.com/{\\{Name\\}}"; + rml:class foaf:Person; + ] . + + +``` + +**Output** +``` + . +``` + diff --git a/src/test/resources/rml-core/RMLTC0023f-JSON/mapping.ttl b/src/test/resources/rml-core/RMLTC0023f-JSON/mapping.ttl new file mode 100644 index 00000000..6a619068 --- /dev/null +++ b/src/test/resources/rml-core/RMLTC0023f-JSON/mapping.ttl @@ -0,0 +1,17 @@ +@prefix foaf: . +@prefix rml: . + + a rml:TriplesMap; + rml:logicalSource [ a rml:LogicalSource; + rml:referenceFormulation rml:JSONPath; + rml:iterator "$.students[*]"; + rml:source [ a rml:RelativePathSource; + rml:root rml:MappingDirectory; + rml:path "student.json" + ] + ]; + rml:subjectMap [ + rml:template "http://example.com/{\\{Name\\}}"; + rml:class foaf:Person; + ] . + diff --git a/src/test/resources/rml-core/RMLTC0023f-JSON/output.nq b/src/test/resources/rml-core/RMLTC0023f-JSON/output.nq new file mode 100644 index 00000000..aa54753b --- /dev/null +++ b/src/test/resources/rml-core/RMLTC0023f-JSON/output.nq @@ -0,0 +1 @@ + . \ No newline at end of file diff --git a/src/test/resources/rml-core/RMLTC0023f-JSON/student.json b/src/test/resources/rml-core/RMLTC0023f-JSON/student.json new file mode 100644 index 00000000..2aa21689 --- /dev/null +++ b/src/test/resources/rml-core/RMLTC0023f-JSON/student.json @@ -0,0 +1,6 @@ +{ + "students": [{ + "ID": 10, + "{Name}":"Venus" + }] +} diff --git a/src/test/resources/rml-core/RMLTC0024a-JSON/README.md b/src/test/resources/rml-core/RMLTC0024a-JSON/README.md new file mode 100644 index 00000000..142a5bef --- /dev/null +++ b/src/test/resources/rml-core/RMLTC0024a-JSON/README.md @@ -0,0 +1,51 @@ +## RMLTC0024a-JSON + +**Title**: "Usage of constant term maps in combination with explicitly defined term types" + +**Description**: "Tests the usage of constant term maps in combination with explicitly defined term types" + +**Default Base IRI**: http://example.com/ + +**Error expected?** Yes + +**Input** +``` +{ + "students": [{ + "Name":"Venus" + }, + { + "Name":"Julio" + }] +} + +``` + +**Mapping** +``` +@prefix foaf: . +@prefix rml: . +@prefix ex: . + + a rml:TriplesMap; + rml:logicalSource [ a rml:LogicalSource; + rml:iterator "$.students[*]"; + rml:referenceFormulation rml:JSONPath; + rml:source [ a rml:RelativePathSource; + rml:root rml:MappingDirectory; + rml:path "student.json" + ] + ]; + rml:predicateObjectMap [ + rml:objectMap [ + rml:reference "$.Name" + ]; + rml:predicate ex:student + ]; + rml:subjectMap [ + rml:constant "School"; + rml:termType rml:BlankNode + ] . + +``` + diff --git a/src/test/resources/rml-core/RMLTC0024a-JSON/mapping.ttl b/src/test/resources/rml-core/RMLTC0024a-JSON/mapping.ttl new file mode 100644 index 00000000..387a3943 --- /dev/null +++ b/src/test/resources/rml-core/RMLTC0024a-JSON/mapping.ttl @@ -0,0 +1,23 @@ +@prefix foaf: . +@prefix rml: . +@prefix ex: . + + a rml:TriplesMap; + rml:logicalSource [ a rml:LogicalSource; + rml:iterator "$.students[*]"; + rml:referenceFormulation rml:JSONPath; + rml:source [ a rml:RelativePathSource; + rml:root rml:MappingDirectory; + rml:path "student.json" + ] + ]; + rml:predicateObjectMap [ + rml:objectMap [ + rml:reference "$.Name" + ]; + rml:predicate ex:student + ]; + rml:subjectMap [ + rml:constant "School"; + rml:termType rml:BlankNode + ] . diff --git a/src/test/resources/rml-core/RMLTC0024a-JSON/student.json b/src/test/resources/rml-core/RMLTC0024a-JSON/student.json new file mode 100644 index 00000000..10ebb2e1 --- /dev/null +++ b/src/test/resources/rml-core/RMLTC0024a-JSON/student.json @@ -0,0 +1,8 @@ +{ + "students": [{ + "Name":"Venus" + }, + { + "Name":"Julio" + }] +} diff --git a/src/test/resources/rml-core/RMLTC0025a-JSON/README.md b/src/test/resources/rml-core/RMLTC0025a-JSON/README.md new file mode 100644 index 00000000..7ecf2ddd --- /dev/null +++ b/src/test/resources/rml-core/RMLTC0025a-JSON/README.md @@ -0,0 +1,55 @@ +## RMLTC0025a-JSON + +**Title**: "Generation of triples from arrays" + +**Description**: "Tests the generation of triples from array input data structures" + +**Default Base IRI**: http://example.com/ + +**Error expected?** No + +**Input** +``` +{ + "persons": [ + {"fname":"Bob","lname":"Smith","amounts":[30, 40, 50]} + ] +} + +``` + +**Mapping** +``` +@prefix ex: . +@prefix foaf: . +@prefix rml: . + + a rml:TriplesMap; + rml:logicalSource [ a rml:LogicalSource; + rml:iterator "$.persons[*]"; + rml:referenceFormulation rml:JSONPath; + rml:source [ a rml:RelativePathSource; + rml:root rml:MappingDirectory; + rml:path "persons.json" + ] + ]; + rml:predicateObjectMap [ + rml:objectMap [ + rml:reference "$.amounts[*]" + ]; + rml:predicate ex:amount + ]; + rml:subjectMap [ + rml:template "http://example.com/Student/{$.fname}/{$.lname}" + ] . + +``` + +**Output** +``` + "30"^^ . + "40"^^ . + "50"^^ . + +``` + diff --git a/src/test/resources/rml-core/RMLTC0025a-JSON/mapping.ttl b/src/test/resources/rml-core/RMLTC0025a-JSON/mapping.ttl new file mode 100644 index 00000000..ea839cde --- /dev/null +++ b/src/test/resources/rml-core/RMLTC0025a-JSON/mapping.ttl @@ -0,0 +1,22 @@ +@prefix ex: . +@prefix foaf: . +@prefix rml: . + + a rml:TriplesMap; + rml:logicalSource [ a rml:LogicalSource; + rml:iterator "$.persons[*]"; + rml:referenceFormulation rml:JSONPath; + rml:source [ a rml:RelativePathSource; + rml:root rml:MappingDirectory; + rml:path "persons.json" + ] + ]; + rml:predicateObjectMap [ + rml:objectMap [ + rml:reference "$.amounts[*]" + ]; + rml:predicate ex:amount + ]; + rml:subjectMap [ + rml:template "http://example.com/Student/{$.fname}/{$.lname}" + ] . diff --git a/src/test/resources/rml-core/RMLTC0025a-JSON/output.nq b/src/test/resources/rml-core/RMLTC0025a-JSON/output.nq new file mode 100644 index 00000000..e1bc9a43 --- /dev/null +++ b/src/test/resources/rml-core/RMLTC0025a-JSON/output.nq @@ -0,0 +1,3 @@ + "30"^^ . + "40"^^ . + "50"^^ . diff --git a/src/test/resources/rml-core/RMLTC0025a-JSON/persons.json b/src/test/resources/rml-core/RMLTC0025a-JSON/persons.json new file mode 100644 index 00000000..705406a9 --- /dev/null +++ b/src/test/resources/rml-core/RMLTC0025a-JSON/persons.json @@ -0,0 +1,5 @@ +{ + "persons": [ + {"fname":"Bob","lname":"Smith","amounts":[30, 40, 50]} + ] +} diff --git a/src/test/resources/rml-core/RMLTC0025b-JSON/README.md b/src/test/resources/rml-core/RMLTC0025b-JSON/README.md new file mode 100644 index 00000000..30a3a751 --- /dev/null +++ b/src/test/resources/rml-core/RMLTC0025b-JSON/README.md @@ -0,0 +1,47 @@ +## RMLTC0025b-JSON + +**Title**: "Generation of triples from arrays with wrong reference" + +**Description**: "Tests the generation of triples from array input data structures. Test should fail as reference points to the array and not the values of the array" + +**Default Base IRI**: http://example.com/ + +**Error expected?** Yes + +**Input** +``` +{ + "persons": [ + {"fname":"Bob","lname":"Smith","amounts":[30, 40, 50]} + ] +} + +``` + +**Mapping** +``` +@prefix ex: . +@prefix foaf: . +@prefix rml: . + + a rml:TriplesMap; + rml:logicalSource [ a rml:LogicalSource; + rml:iterator "$.persons[*]"; + rml:referenceFormulation rml:JSONPath; + rml:source [ a rml:RelativePathSource; + rml:root rml:MappingDirectory; + rml:path "persons.json" + ] + ]; + rml:predicateObjectMap [ + rml:objectMap [ + rml:reference "$.amounts" + ]; + rml:predicate ex:amount + ]; + rml:subjectMap [ + rml:template "http://example.com/Student/{$.fname}/{$.lname}" + ] . + +``` + diff --git a/src/test/resources/rml-core/RMLTC0025b-JSON/mapping.ttl b/src/test/resources/rml-core/RMLTC0025b-JSON/mapping.ttl new file mode 100644 index 00000000..780bd99a --- /dev/null +++ b/src/test/resources/rml-core/RMLTC0025b-JSON/mapping.ttl @@ -0,0 +1,22 @@ +@prefix ex: . +@prefix foaf: . +@prefix rml: . + + a rml:TriplesMap; + rml:logicalSource [ a rml:LogicalSource; + rml:iterator "$.persons[*]"; + rml:referenceFormulation rml:JSONPath; + rml:source [ a rml:RelativePathSource; + rml:root rml:MappingDirectory; + rml:path "persons.json" + ] + ]; + rml:predicateObjectMap [ + rml:objectMap [ + rml:reference "$.amounts" + ]; + rml:predicate ex:amount + ]; + rml:subjectMap [ + rml:template "http://example.com/Student/{$.fname}/{$.lname}" + ] . diff --git a/src/test/resources/rml-core/RMLTC0025b-JSON/persons.json b/src/test/resources/rml-core/RMLTC0025b-JSON/persons.json new file mode 100644 index 00000000..705406a9 --- /dev/null +++ b/src/test/resources/rml-core/RMLTC0025b-JSON/persons.json @@ -0,0 +1,5 @@ +{ + "persons": [ + {"fname":"Bob","lname":"Smith","amounts":[30, 40, 50]} + ] +} diff --git a/src/test/resources/rml-core/RMLTC0025c-JSON/README.md b/src/test/resources/rml-core/RMLTC0025c-JSON/README.md new file mode 100644 index 00000000..3472e637 --- /dev/null +++ b/src/test/resources/rml-core/RMLTC0025c-JSON/README.md @@ -0,0 +1,58 @@ +## RMLTC0025c-JSON + +**Title**: "Generation of triples from arrays in subject and object" + +**Description**: "Tests the generation of triples from array input data structures in subject and object" + +**Default Base IRI**: http://example.com/ + +**Error expected?** No + +**Input** +``` +{ + "persons": [ + {"names":["Bob", "Smith"],"amounts":[30, 40, 50]} + ] +} + +``` + +**Mapping** +``` +@prefix ex: . +@prefix foaf: . +@prefix rml: . + + a rml:TriplesMap; + rml:logicalSource [ a rml:LogicalSource; + rml:iterator "$.persons[*]"; + rml:referenceFormulation rml:JSONPath; + rml:source [ a rml:RelativePathSource; + rml:root rml:MappingDirectory; + rml:path "persons.json" + ] + ]; + rml:predicateObjectMap [ + rml:objectMap [ + rml:reference "$.amounts[*]" + ]; + rml:predicate ex:amount + ]; + rml:subjectMap [ + rml:template "http://example.com/Student/{$.names[*]}" + ] . + +``` + +**Output** +``` + "30"^^ . + "40"^^ . + "50"^^ . + "30"^^ . + "40"^^ . + "50"^^ . + +``` + diff --git a/src/test/resources/rml-core/RMLTC0025c-JSON/mapping.ttl b/src/test/resources/rml-core/RMLTC0025c-JSON/mapping.ttl new file mode 100644 index 00000000..e498664c --- /dev/null +++ b/src/test/resources/rml-core/RMLTC0025c-JSON/mapping.ttl @@ -0,0 +1,22 @@ +@prefix ex: . +@prefix foaf: . +@prefix rml: . + + a rml:TriplesMap; + rml:logicalSource [ a rml:LogicalSource; + rml:iterator "$.persons[*]"; + rml:referenceFormulation rml:JSONPath; + rml:source [ a rml:RelativePathSource; + rml:root rml:MappingDirectory; + rml:path "persons.json" + ] + ]; + rml:predicateObjectMap [ + rml:objectMap [ + rml:reference "$.amounts[*]" + ]; + rml:predicate ex:amount + ]; + rml:subjectMap [ + rml:template "http://example.com/Student/{$.names[*]}" + ] . diff --git a/src/test/resources/rml-core/RMLTC0025c-JSON/output.nq b/src/test/resources/rml-core/RMLTC0025c-JSON/output.nq new file mode 100644 index 00000000..8fc12789 --- /dev/null +++ b/src/test/resources/rml-core/RMLTC0025c-JSON/output.nq @@ -0,0 +1,6 @@ + "30"^^ . + "40"^^ . + "50"^^ . + "30"^^ . + "40"^^ . + "50"^^ . diff --git a/src/test/resources/rml-core/RMLTC0025c-JSON/persons.json b/src/test/resources/rml-core/RMLTC0025c-JSON/persons.json new file mode 100644 index 00000000..6b67d59f --- /dev/null +++ b/src/test/resources/rml-core/RMLTC0025c-JSON/persons.json @@ -0,0 +1,5 @@ +{ + "persons": [ + {"names":["Bob", "Smith"],"amounts":[30, 40, 50]} + ] +} diff --git a/src/test/resources/rml-core/RMLTC0026a-JSON/README.md b/src/test/resources/rml-core/RMLTC0026a-JSON/README.md index 85e87a24..b2201854 100644 --- a/src/test/resources/rml-core/RMLTC0026a-JSON/README.md +++ b/src/test/resources/rml-core/RMLTC0026a-JSON/README.md @@ -1,8 +1,10 @@ ## RMLTC0026a-JSON -**Title**: "Generation of triples from arrays" +**Title**: "Two triples maps, one with rml:baseIRI and one without and generating absolute IRIs" -**Description**: "Tests the generation of triples from array input data structures" +**Description**: "Tests the generation of triples from relative IRIs using base IRI" + +**Default Base IRI**: http://example.com/ **Error expected?** No @@ -10,7 +12,8 @@ ``` { "persons": [ - {"fname":"Bob","lname":"Smith","amounts":[30, 40, 50]} + {"fname":"Bob","lname":"Smith","amount":30}, + {"fname":"Sue","lname":"Jones","amount":20} ] } @@ -23,6 +26,26 @@ @prefix rml: . a rml:TriplesMap; + rml:baseIRI ; + rml:logicalSource [ a rml:LogicalSource; + rml:iterator "$.persons[*]"; + rml:referenceFormulation rml:JSONPath; + rml:source [ a rml:RelativePathSource; + rml:root rml:MappingDirectory; + rml:path "persons.json" + ] + ]; + rml:predicateObjectMap [ + rml:objectMap [ + rml:reference "$.amount" + ]; + rml:predicate ex:amount + ]; + rml:subjectMap [ + rml:template "{$.fname}" + ] . + + a rml:TriplesMap; rml:logicalSource [ a rml:LogicalSource; rml:iterator "$.persons[*]"; rml:referenceFormulation rml:JSONPath; @@ -33,21 +56,22 @@ ]; rml:predicateObjectMap [ rml:objectMap [ - rml:reference "$.amounts" + rml:reference "$.amount" ]; rml:predicate ex:amount ]; rml:subjectMap [ - rml:template "http://example.com/Student/{$.fname}/{$.lname}" + rml:template "http://example.com/{$.lname}" ] . ``` **Output** ``` - "30" . - "40" . - "50" . + "30"^^ . + "20"^^ . + "30"^^ . + "20"^^ . ``` diff --git a/src/test/resources/rml-core/RMLTC0026a-JSON/mapping.ttl b/src/test/resources/rml-core/RMLTC0026a-JSON/mapping.ttl index 780bd99a..41ed54da 100644 --- a/src/test/resources/rml-core/RMLTC0026a-JSON/mapping.ttl +++ b/src/test/resources/rml-core/RMLTC0026a-JSON/mapping.ttl @@ -3,6 +3,7 @@ @prefix rml: . a rml:TriplesMap; + rml:baseIRI ; rml:logicalSource [ a rml:LogicalSource; rml:iterator "$.persons[*]"; rml:referenceFormulation rml:JSONPath; @@ -13,10 +14,29 @@ ]; rml:predicateObjectMap [ rml:objectMap [ - rml:reference "$.amounts" + rml:reference "$.amount" ]; rml:predicate ex:amount ]; rml:subjectMap [ - rml:template "http://example.com/Student/{$.fname}/{$.lname}" + rml:template "{$.fname}" + ] . + + a rml:TriplesMap; + rml:logicalSource [ a rml:LogicalSource; + rml:iterator "$.persons[*]"; + rml:referenceFormulation rml:JSONPath; + rml:source [ a rml:RelativePathSource; + rml:root rml:MappingDirectory; + rml:path "persons.json" + ] + ]; + rml:predicateObjectMap [ + rml:objectMap [ + rml:reference "$.amount" + ]; + rml:predicate ex:amount + ]; + rml:subjectMap [ + rml:template "http://example.com/{$.lname}" ] . diff --git a/src/test/resources/rml-core/RMLTC0026a-JSON/output.nq b/src/test/resources/rml-core/RMLTC0026a-JSON/output.nq index 3b8e09fb..e6eee90f 100644 --- a/src/test/resources/rml-core/RMLTC0026a-JSON/output.nq +++ b/src/test/resources/rml-core/RMLTC0026a-JSON/output.nq @@ -1,3 +1,4 @@ - "30" . - "40" . - "50" . + "30"^^ . + "20"^^ . + "30"^^ . + "20"^^ . diff --git a/src/test/resources/rml-core/RMLTC0026a-JSON/persons.json b/src/test/resources/rml-core/RMLTC0026a-JSON/persons.json index 705406a9..b7f1a04f 100644 --- a/src/test/resources/rml-core/RMLTC0026a-JSON/persons.json +++ b/src/test/resources/rml-core/RMLTC0026a-JSON/persons.json @@ -1,5 +1,6 @@ { "persons": [ - {"fname":"Bob","lname":"Smith","amounts":[30, 40, 50]} + {"fname":"Bob","lname":"Smith","amount":30}, + {"fname":"Sue","lname":"Jones","amount":20} ] } diff --git a/src/test/resources/rml-core/RMLTC0026b-JSON/README.md b/src/test/resources/rml-core/RMLTC0026b-JSON/README.md new file mode 100644 index 00000000..618503df --- /dev/null +++ b/src/test/resources/rml-core/RMLTC0026b-JSON/README.md @@ -0,0 +1,77 @@ +## RMLTC0026b-JSON + +**Title**: "Two triples maps, one with rml:baseIRI one one without and generating relative IRIs using baseIRI parameter" + +**Description**: "Tests the generation of triples from relative IRI using base IRI parameter" + +**Default Base IRI**: http://example.com/ + +**Error expected?** No + +**Input** +``` +{ + "persons": [ + {"fname":"Bob","lname":"Smith","amount":30}, + {"fname":"Sue","lname":"Jones","amount":20} + ] +} + +``` + +**Mapping** +``` +@prefix ex: . +@prefix foaf: . +@prefix rml: . + + a rml:TriplesMap; + rml:baseIRI ; + rml:logicalSource [ a rml:LogicalSource; + rml:iterator "$.persons[*]"; + rml:referenceFormulation rml:JSONPath; + rml:source [ a rml:RelativePathSource; + rml:root rml:MappingDirectory; + rml:path "persons.json" + ] + ]; + rml:predicateObjectMap [ + rml:objectMap [ + rml:reference "$.amount" + ]; + rml:predicate ex:amount + ]; + rml:subjectMap [ + rml:template "{$.fname}" + ] . + + a rml:TriplesMap; + rml:logicalSource [ a rml:LogicalSource; + rml:iterator "$.persons[*]"; + rml:referenceFormulation rml:JSONPath; + rml:source [ a rml:RelativePathSource; + rml:root rml:MappingDirectory; + rml:path "persons.json" + ] + ]; + rml:predicateObjectMap [ + rml:objectMap [ + rml:reference "$.amount" + ]; + rml:predicate ex:amount + ]; + rml:subjectMap [ + rml:template "{$.lname}" + ] . + +``` + +**Output** +``` + "30"^^ . + "20"^^ . + "30"^^ . + "20"^^ . + +``` + diff --git a/src/test/resources/rml-core/RMLTC0026b-JSON/mapping.ttl b/src/test/resources/rml-core/RMLTC0026b-JSON/mapping.ttl new file mode 100644 index 00000000..040d95d4 --- /dev/null +++ b/src/test/resources/rml-core/RMLTC0026b-JSON/mapping.ttl @@ -0,0 +1,42 @@ +@prefix ex: . +@prefix foaf: . +@prefix rml: . + + a rml:TriplesMap; + rml:baseIRI ; + rml:logicalSource [ a rml:LogicalSource; + rml:iterator "$.persons[*]"; + rml:referenceFormulation rml:JSONPath; + rml:source [ a rml:RelativePathSource; + rml:root rml:MappingDirectory; + rml:path "persons.json" + ] + ]; + rml:predicateObjectMap [ + rml:objectMap [ + rml:reference "$.amount" + ]; + rml:predicate ex:amount + ]; + rml:subjectMap [ + rml:template "{$.fname}" + ] . + + a rml:TriplesMap; + rml:logicalSource [ a rml:LogicalSource; + rml:iterator "$.persons[*]"; + rml:referenceFormulation rml:JSONPath; + rml:source [ a rml:RelativePathSource; + rml:root rml:MappingDirectory; + rml:path "persons.json" + ] + ]; + rml:predicateObjectMap [ + rml:objectMap [ + rml:reference "$.amount" + ]; + rml:predicate ex:amount + ]; + rml:subjectMap [ + rml:template "{$.lname}" + ] . diff --git a/src/test/resources/rml-core/RMLTC0026b-JSON/output.nq b/src/test/resources/rml-core/RMLTC0026b-JSON/output.nq new file mode 100644 index 00000000..9a447010 --- /dev/null +++ b/src/test/resources/rml-core/RMLTC0026b-JSON/output.nq @@ -0,0 +1,4 @@ + "30"^^ . + "20"^^ . + "30"^^ . + "20"^^ . diff --git a/src/test/resources/rml-core/RMLTC0026b-JSON/persons.json b/src/test/resources/rml-core/RMLTC0026b-JSON/persons.json new file mode 100644 index 00000000..b7f1a04f --- /dev/null +++ b/src/test/resources/rml-core/RMLTC0026b-JSON/persons.json @@ -0,0 +1,6 @@ +{ + "persons": [ + {"fname":"Bob","lname":"Smith","amount":30}, + {"fname":"Sue","lname":"Jones","amount":20} + ] +} diff --git a/src/test/resources/rml-core/RMLTC0026c-JSON/README.md b/src/test/resources/rml-core/RMLTC0026c-JSON/README.md new file mode 100644 index 00000000..d07991fa --- /dev/null +++ b/src/test/resources/rml-core/RMLTC0026c-JSON/README.md @@ -0,0 +1,78 @@ +## RMLTC0026c-JSON + +**Title**: "Two triples maps, both with rml:baseIRI defined" + +**Description**: "Tests the generation of triples using relative IRIs with base IRIs defined only in triples maps, without base IRI parameter" + +**Default Base IRI**: http://example.com/ + +**Error expected?** No + +**Input** +``` +{ + "persons": [ + {"fname":"Bob","lname":"Smith","amount":30}, + {"fname":"Sue","lname":"Jones","amount":20} + ] +} + +``` + +**Mapping** +``` +@prefix ex: . +@prefix foaf: . +@prefix rml: . + + a rml:TriplesMap; + rml:baseIRI ; + rml:logicalSource [ a rml:LogicalSource; + rml:iterator "$.persons[*]"; + rml:referenceFormulation rml:JSONPath; + rml:source [ a rml:RelativePathSource; + rml:root rml:MappingDirectory; + rml:path "persons.json" + ] + ]; + rml:predicateObjectMap [ + rml:objectMap [ + rml:reference "$.amount" + ]; + rml:predicate ex:amount + ]; + rml:subjectMap [ + rml:template "{$.fname}" + ] . + + a rml:TriplesMap; + rml:baseIRI ; + rml:logicalSource [ a rml:LogicalSource; + rml:iterator "$.persons[*]"; + rml:referenceFormulation rml:JSONPath; + rml:source [ a rml:RelativePathSource; + rml:root rml:MappingDirectory; + rml:path "persons.json" + ] + ]; + rml:predicateObjectMap [ + rml:objectMap [ + rml:reference "$.amount" + ]; + rml:predicate ex:amount + ]; + rml:subjectMap [ + rml:template "{$.lname}" + ] . + +``` + +**Output** +``` + "30"^^ . + "20"^^ . + "30"^^ . + "20"^^ . + +``` + diff --git a/src/test/resources/rml-core/RMLTC0026c-JSON/mapping.ttl b/src/test/resources/rml-core/RMLTC0026c-JSON/mapping.ttl new file mode 100644 index 00000000..d2825418 --- /dev/null +++ b/src/test/resources/rml-core/RMLTC0026c-JSON/mapping.ttl @@ -0,0 +1,43 @@ +@prefix ex: . +@prefix foaf: . +@prefix rml: . + + a rml:TriplesMap; + rml:baseIRI ; + rml:logicalSource [ a rml:LogicalSource; + rml:iterator "$.persons[*]"; + rml:referenceFormulation rml:JSONPath; + rml:source [ a rml:RelativePathSource; + rml:root rml:MappingDirectory; + rml:path "persons.json" + ] + ]; + rml:predicateObjectMap [ + rml:objectMap [ + rml:reference "$.amount" + ]; + rml:predicate ex:amount + ]; + rml:subjectMap [ + rml:template "{$.fname}" + ] . + + a rml:TriplesMap; + rml:baseIRI ; + rml:logicalSource [ a rml:LogicalSource; + rml:iterator "$.persons[*]"; + rml:referenceFormulation rml:JSONPath; + rml:source [ a rml:RelativePathSource; + rml:root rml:MappingDirectory; + rml:path "persons.json" + ] + ]; + rml:predicateObjectMap [ + rml:objectMap [ + rml:reference "$.amount" + ]; + rml:predicate ex:amount + ]; + rml:subjectMap [ + rml:template "{$.lname}" + ] . diff --git a/src/test/resources/rml-core/RMLTC0026c-JSON/output.nq b/src/test/resources/rml-core/RMLTC0026c-JSON/output.nq new file mode 100644 index 00000000..e6eee90f --- /dev/null +++ b/src/test/resources/rml-core/RMLTC0026c-JSON/output.nq @@ -0,0 +1,4 @@ + "30"^^ . + "20"^^ . + "30"^^ . + "20"^^ . diff --git a/src/test/resources/rml-core/RMLTC0026c-JSON/persons.json b/src/test/resources/rml-core/RMLTC0026c-JSON/persons.json new file mode 100644 index 00000000..b7f1a04f --- /dev/null +++ b/src/test/resources/rml-core/RMLTC0026c-JSON/persons.json @@ -0,0 +1,6 @@ +{ + "persons": [ + {"fname":"Bob","lname":"Smith","amount":30}, + {"fname":"Sue","lname":"Jones","amount":20} + ] +} diff --git a/src/test/resources/rml-core/RMLTC0026d-JSON/README.md b/src/test/resources/rml-core/RMLTC0026d-JSON/README.md new file mode 100644 index 00000000..d799d4e5 --- /dev/null +++ b/src/test/resources/rml-core/RMLTC0026d-JSON/README.md @@ -0,0 +1,78 @@ +## RMLTC0026d-JSON + +**Title**: "Two triples maps,both with rml:bseIRI defined and baseIRI parameter defined" + +**Description**: "Tests the generation of triples by with base IRIs different than the base IRI parameter" + +**Default Base IRI**: http://example.com/ + +**Error expected?** No + +**Input** +``` +{ + "persons": [ + {"fname":"Bob","lname":"Smith","amount":30}, + {"fname":"Sue","lname":"Jones","amount":20} + ] +} + +``` + +**Mapping** +``` +@prefix ex: . +@prefix foaf: . +@prefix rml: . + + a rml:TriplesMap; + rml:baseIRI ; + rml:logicalSource [ a rml:LogicalSource; + rml:iterator "$.persons[*]"; + rml:referenceFormulation rml:JSONPath; + rml:source [ a rml:RelativePathSource; + rml:root rml:MappingDirectory; + rml:path "persons.json" + ] + ]; + rml:predicateObjectMap [ + rml:objectMap [ + rml:reference "$.amount" + ]; + rml:predicate ex:amount + ]; + rml:subjectMap [ + rml:template "{$.fname}" + ] . + + a rml:TriplesMap; + rml:baseIRI ; + rml:logicalSource [ a rml:LogicalSource; + rml:iterator "$.persons[*]"; + rml:referenceFormulation rml:JSONPath; + rml:source [ a rml:RelativePathSource; + rml:root rml:MappingDirectory; + rml:path "persons.json" + ] + ]; + rml:predicateObjectMap [ + rml:objectMap [ + rml:reference "$.amount" + ]; + rml:predicate ex:amount + ]; + rml:subjectMap [ + rml:template "{$.lname}" + ] . + +``` + +**Output** +``` + "30"^^ . + "20"^^ . + "30"^^ . + "20"^^ . + +``` + diff --git a/src/test/resources/rml-core/RMLTC0026d-JSON/mapping.ttl b/src/test/resources/rml-core/RMLTC0026d-JSON/mapping.ttl new file mode 100644 index 00000000..387c6254 --- /dev/null +++ b/src/test/resources/rml-core/RMLTC0026d-JSON/mapping.ttl @@ -0,0 +1,43 @@ +@prefix ex: . +@prefix foaf: . +@prefix rml: . + + a rml:TriplesMap; + rml:baseIRI ; + rml:logicalSource [ a rml:LogicalSource; + rml:iterator "$.persons[*]"; + rml:referenceFormulation rml:JSONPath; + rml:source [ a rml:RelativePathSource; + rml:root rml:MappingDirectory; + rml:path "persons.json" + ] + ]; + rml:predicateObjectMap [ + rml:objectMap [ + rml:reference "$.amount" + ]; + rml:predicate ex:amount + ]; + rml:subjectMap [ + rml:template "{$.fname}" + ] . + + a rml:TriplesMap; + rml:baseIRI ; + rml:logicalSource [ a rml:LogicalSource; + rml:iterator "$.persons[*]"; + rml:referenceFormulation rml:JSONPath; + rml:source [ a rml:RelativePathSource; + rml:root rml:MappingDirectory; + rml:path "persons.json" + ] + ]; + rml:predicateObjectMap [ + rml:objectMap [ + rml:reference "$.amount" + ]; + rml:predicate ex:amount + ]; + rml:subjectMap [ + rml:template "{$.lname}" + ] . diff --git a/src/test/resources/rml-core/RMLTC0026d-JSON/output.nq b/src/test/resources/rml-core/RMLTC0026d-JSON/output.nq new file mode 100644 index 00000000..a6a4afac --- /dev/null +++ b/src/test/resources/rml-core/RMLTC0026d-JSON/output.nq @@ -0,0 +1,4 @@ + "30"^^ . + "20"^^ . + "30"^^ . + "20"^^ . diff --git a/src/test/resources/rml-core/RMLTC0026d-JSON/persons.json b/src/test/resources/rml-core/RMLTC0026d-JSON/persons.json new file mode 100644 index 00000000..b7f1a04f --- /dev/null +++ b/src/test/resources/rml-core/RMLTC0026d-JSON/persons.json @@ -0,0 +1,6 @@ +{ + "persons": [ + {"fname":"Bob","lname":"Smith","amount":30}, + {"fname":"Sue","lname":"Jones","amount":20} + ] +} diff --git a/src/test/resources/rml-core/RMLTC0027a-JSON/README.md b/src/test/resources/rml-core/RMLTC0027a-JSON/README.md new file mode 100644 index 00000000..7aed1582 --- /dev/null +++ b/src/test/resources/rml-core/RMLTC0027a-JSON/README.md @@ -0,0 +1,60 @@ +## RMLTC0027a-JSON + +**Title**: "Generation of triples using the URI term type" + +**Description**: "Tests the generation of triples with a URI term type in the subject or object" + +**Default Base IRI**: http://example.com/ + +**Error expected?** No + +**Input** +``` +{ + "students": [ + {"Name": "Alice"}, + {"Name": "Bob"}, + {"Name": "Bob/Charles"}, + {"Name": "Danny"}, + {"Name": "Emily Smith"} + ] +} + +``` + +**Mapping** +``` +@prefix foaf: . +@prefix rdf: . +@prefix rml: . + + a rml:TriplesMap; + rml:logicalSource [ a rml:LogicalSource; + rml:iterator "$.students[*]"; + rml:referenceFormulation rml:JSONPath; + rml:source [ a rml:RelativePathSource; + rml:root rml:MappingDirectory; + rml:path "student.json" + ] + ]; + rml:predicateObjectMap [ + rml:object foaf:Person; + rml:predicate rdf:type + ]; + rml:subjectMap [ + rml:template "http://example.com/Person/{$.Name}"; + rml:termType rml:URI + ] . + +``` + +**Output** +``` + . + . + . + . + . + +``` + diff --git a/src/test/resources/rml-core/RMLTC0027a-JSON/mapping.ttl b/src/test/resources/rml-core/RMLTC0027a-JSON/mapping.ttl new file mode 100644 index 00000000..2d873b5a --- /dev/null +++ b/src/test/resources/rml-core/RMLTC0027a-JSON/mapping.ttl @@ -0,0 +1,21 @@ +@prefix foaf: . +@prefix rdf: . +@prefix rml: . + + a rml:TriplesMap; + rml:logicalSource [ a rml:LogicalSource; + rml:iterator "$.students[*]"; + rml:referenceFormulation rml:JSONPath; + rml:source [ a rml:RelativePathSource; + rml:root rml:MappingDirectory; + rml:path "student.json" + ] + ]; + rml:predicateObjectMap [ + rml:object foaf:Person; + rml:predicate rdf:type + ]; + rml:subjectMap [ + rml:template "http://example.com/Person/{$.Name}"; + rml:termType rml:URI + ] . diff --git a/src/test/resources/rml-core/RMLTC0027a-JSON/output.nq b/src/test/resources/rml-core/RMLTC0027a-JSON/output.nq new file mode 100644 index 00000000..0d4f5564 --- /dev/null +++ b/src/test/resources/rml-core/RMLTC0027a-JSON/output.nq @@ -0,0 +1,5 @@ + . + . + . + . + . diff --git a/src/test/resources/rml-core/RMLTC0027a-JSON/student.json b/src/test/resources/rml-core/RMLTC0027a-JSON/student.json new file mode 100644 index 00000000..c1c6e961 --- /dev/null +++ b/src/test/resources/rml-core/RMLTC0027a-JSON/student.json @@ -0,0 +1,9 @@ +{ + "students": [ + {"Name": "Alice"}, + {"Name": "Bob"}, + {"Name": "Bob/Charles"}, + {"Name": "Danny"}, + {"Name": "Emily Smith"} + ] +} diff --git a/src/test/resources/rml-core/RMLTC0027b-JSON/README.md b/src/test/resources/rml-core/RMLTC0027b-JSON/README.md new file mode 100644 index 00000000..748971f2 --- /dev/null +++ b/src/test/resources/rml-core/RMLTC0027b-JSON/README.md @@ -0,0 +1,60 @@ +## RMLTC0027b-JSON + +**Title**: "Generation of triples using the UnsafeURI term type" + +**Description**: "Tests the generation of triples with a UnsafeURI term type in the subject or object" + +**Default Base IRI**: http://example.com/ + +**Error expected?** No + +**Input** +``` +{ + "students": [ + {"Name": "Alice"}, + {"Name": "Bob"}, + {"Name": "Bob/Charles"}, + {"Name": "Danny"}, + {"Name": "Emily Smith"} + ] +} + +``` + +**Mapping** +``` +@prefix foaf: . +@prefix rdf: . +@prefix rml: . + + a rml:TriplesMap; + rml:logicalSource [ a rml:LogicalSource; + rml:iterator "$.students[*]"; + rml:referenceFormulation rml:JSONPath; + rml:source [ a rml:RelativePathSource; + rml:root rml:MappingDirectory; + rml:path "student.json" + ] + ]; + rml:predicateObjectMap [ + rml:object foaf:Person; + rml:predicate rdf:type + ]; + rml:subjectMap [ + rml:template "http://example.com/Person/{$.Name}"; + rml:termType rml:UnsafeURI + ] . + +``` + +**Output** +``` + . + . + . + . + . + +``` + diff --git a/src/test/resources/rml-core/RMLTC0027b-JSON/mapping.ttl b/src/test/resources/rml-core/RMLTC0027b-JSON/mapping.ttl new file mode 100644 index 00000000..803c17e1 --- /dev/null +++ b/src/test/resources/rml-core/RMLTC0027b-JSON/mapping.ttl @@ -0,0 +1,21 @@ +@prefix foaf: . +@prefix rdf: . +@prefix rml: . + + a rml:TriplesMap; + rml:logicalSource [ a rml:LogicalSource; + rml:iterator "$.students[*]"; + rml:referenceFormulation rml:JSONPath; + rml:source [ a rml:RelativePathSource; + rml:root rml:MappingDirectory; + rml:path "student.json" + ] + ]; + rml:predicateObjectMap [ + rml:object foaf:Person; + rml:predicate rdf:type + ]; + rml:subjectMap [ + rml:template "http://example.com/Person/{$.Name}"; + rml:termType rml:UnsafeURI + ] . diff --git a/src/test/resources/rml-core/RMLTC0027b-JSON/output.nq b/src/test/resources/rml-core/RMLTC0027b-JSON/output.nq new file mode 100644 index 00000000..0d4f5564 --- /dev/null +++ b/src/test/resources/rml-core/RMLTC0027b-JSON/output.nq @@ -0,0 +1,5 @@ + . + . + . + . + . diff --git a/src/test/resources/rml-core/RMLTC0027b-JSON/student.json b/src/test/resources/rml-core/RMLTC0027b-JSON/student.json new file mode 100644 index 00000000..c1c6e961 --- /dev/null +++ b/src/test/resources/rml-core/RMLTC0027b-JSON/student.json @@ -0,0 +1,9 @@ +{ + "students": [ + {"Name": "Alice"}, + {"Name": "Bob"}, + {"Name": "Bob/Charles"}, + {"Name": "Danny"}, + {"Name": "Emily Smith"} + ] +} diff --git a/src/test/resources/rml-core/RMLTC0027c-JSON/README.md b/src/test/resources/rml-core/RMLTC0027c-JSON/README.md new file mode 100644 index 00000000..9d6d04b2 --- /dev/null +++ b/src/test/resources/rml-core/RMLTC0027c-JSON/README.md @@ -0,0 +1,60 @@ +## RMLTC0027c-JSON + +**Title**: "Generation of triples using the UnsafeIRI term type" + +**Description**: "Tests the generation of triples with a UnsafeIRI term type in the subject or object" + +**Default Base IRI**: http://example.com/ + +**Error expected?** No + +**Input** +``` +{ + "students": [ + {"Name": "Alice"}, + {"Name": "Bob"}, + {"Name": "Bob/Charles"}, + {"Name": "Danny"}, + {"Name": "Emily Smith"} + ] +} + +``` + +**Mapping** +``` +@prefix foaf: . +@prefix rdf: . +@prefix rml: . + + a rml:TriplesMap; + rml:logicalSource [ a rml:LogicalSource; + rml:iterator "$.students[*]"; + rml:referenceFormulation rml:JSONPath; + rml:source [ a rml:RelativePathSource; + rml:root rml:MappingDirectory; + rml:path "student.json" + ] + ]; + rml:predicateObjectMap [ + rml:object foaf:Person; + rml:predicate rdf:type + ]; + rml:subjectMap [ + rml:template "http://example.com/Person/{$.Name}"; + rml:termType rml:UnsafeIRI + ] . + +``` + +**Output** +``` + . + . + . + . + . + +``` + diff --git a/src/test/resources/rml-core/RMLTC0027c-JSON/mapping.ttl b/src/test/resources/rml-core/RMLTC0027c-JSON/mapping.ttl new file mode 100644 index 00000000..4a03ab54 --- /dev/null +++ b/src/test/resources/rml-core/RMLTC0027c-JSON/mapping.ttl @@ -0,0 +1,21 @@ +@prefix foaf: . +@prefix rdf: . +@prefix rml: . + + a rml:TriplesMap; + rml:logicalSource [ a rml:LogicalSource; + rml:iterator "$.students[*]"; + rml:referenceFormulation rml:JSONPath; + rml:source [ a rml:RelativePathSource; + rml:root rml:MappingDirectory; + rml:path "student.json" + ] + ]; + rml:predicateObjectMap [ + rml:object foaf:Person; + rml:predicate rdf:type + ]; + rml:subjectMap [ + rml:template "http://example.com/Person/{$.Name}"; + rml:termType rml:UnsafeIRI + ] . diff --git a/src/test/resources/rml-core/RMLTC0027c-JSON/output.nq b/src/test/resources/rml-core/RMLTC0027c-JSON/output.nq new file mode 100644 index 00000000..0d4f5564 --- /dev/null +++ b/src/test/resources/rml-core/RMLTC0027c-JSON/output.nq @@ -0,0 +1,5 @@ + . + . + . + . + . diff --git a/src/test/resources/rml-core/RMLTC0027c-JSON/student.json b/src/test/resources/rml-core/RMLTC0027c-JSON/student.json new file mode 100644 index 00000000..c1c6e961 --- /dev/null +++ b/src/test/resources/rml-core/RMLTC0027c-JSON/student.json @@ -0,0 +1,9 @@ +{ + "students": [ + {"Name": "Alice"}, + {"Name": "Bob"}, + {"Name": "Bob/Charles"}, + {"Name": "Danny"}, + {"Name": "Emily Smith"} + ] +} diff --git a/src/test/resources/rml-core/RMLTC0028a-JSON/README.md b/src/test/resources/rml-core/RMLTC0028a-JSON/README.md new file mode 100644 index 00000000..d5d5cecc --- /dev/null +++ b/src/test/resources/rml-core/RMLTC0028a-JSON/README.md @@ -0,0 +1,45 @@ +## RMLTC0028a-JSON + +**Title**: "Generation of the right datatype for a constant in the mapping" + +**Description**: "Test the honoring of the datatype specified by the constant term in the mapping" + +**Default Base IRI**: http://example.com/ + +**Error expected?** No + +**Input** +``` +[ { "id": "0", "foo": "bar" } ] + +``` + +**Mapping** +``` +@prefix rml: . + + a rml:TriplesMap; + rml:logicalSource [ + rml:referenceFormulation rml:JSONPath ; + rml:iterator "$[*]"; + rml:source [ a rml:RelativePathSource; + rml:root rml:MappingDirectory; + rml:path "data.json" + ] + ]; + rml:subjectMap [ + rml:template "https://example.org/instances/{id}"; + ]; + rml:predicateObjectMap [ + rml:predicate ; + rml:object true ; # datatype is boolean + ] . + +``` + +**Output** +``` + "true"^^ . + +``` + diff --git a/src/test/resources/rml-core/RMLTC0028a-JSON/data.json b/src/test/resources/rml-core/RMLTC0028a-JSON/data.json new file mode 100644 index 00000000..64a11ae8 --- /dev/null +++ b/src/test/resources/rml-core/RMLTC0028a-JSON/data.json @@ -0,0 +1 @@ +[ { "id": "0", "foo": "bar" } ] diff --git a/src/test/resources/rml-core/RMLTC0028a-JSON/mapping.ttl b/src/test/resources/rml-core/RMLTC0028a-JSON/mapping.ttl new file mode 100644 index 00000000..140141f7 --- /dev/null +++ b/src/test/resources/rml-core/RMLTC0028a-JSON/mapping.ttl @@ -0,0 +1,18 @@ +@prefix rml: . + + a rml:TriplesMap; + rml:logicalSource [ + rml:referenceFormulation rml:JSONPath ; + rml:iterator "$[*]"; + rml:source [ a rml:RelativePathSource; + rml:root rml:MappingDirectory; + rml:path "data.json" + ] + ]; + rml:subjectMap [ + rml:template "https://example.org/instances/{id}"; + ]; + rml:predicateObjectMap [ + rml:predicate ; + rml:object true ; # datatype is boolean + ] . diff --git a/src/test/resources/rml-core/RMLTC0028a-JSON/output.nq b/src/test/resources/rml-core/RMLTC0028a-JSON/output.nq new file mode 100644 index 00000000..ed7a2cd1 --- /dev/null +++ b/src/test/resources/rml-core/RMLTC0028a-JSON/output.nq @@ -0,0 +1 @@ + "true"^^ . diff --git a/src/test/resources/rml-core/RMLTC0028b-JSON/README.md b/src/test/resources/rml-core/RMLTC0028b-JSON/README.md new file mode 100644 index 00000000..4428a0ae --- /dev/null +++ b/src/test/resources/rml-core/RMLTC0028b-JSON/README.md @@ -0,0 +1,51 @@ +## RMLTC0028b-JSON + +**Title**: "Generation of all named graphs when rml:defaultGraph is involved" + +**Description**: "Test if the default graph is also generated correctly." + +**Default Base IRI**: http://example.com/ + +**Error expected?** No + +**Input** +``` +[ { "id": "0", "name": "Alice" } ] + +``` + +**Mapping** +``` +@prefix rml: . +@prefix s: . + + a rml:TriplesMap; + rml:logicalSource [ + rml:referenceFormulation rml:JSONPath ; + rml:iterator "$[*]"; + rml:source [ a rml:RelativePathSource; + rml:root rml:MappingDirectory; + rml:path "data.json" + ] + ]; + rml:subjectMap [ + rml:template "https://example.org/instances/{id}"; + rml:class s:Person ; + rml:graph ; + ]; + rml:predicateObjectMap [ + rml:predicate s:givenName ; + rml:objectMap [ rml:reference "name" ] ; + rml:graph rml:defaultGraph ; + ]. + +``` + +**Output** +``` + "Alice". + "Alice" . + . + +``` + diff --git a/src/test/resources/rml-core/RMLTC0028b-JSON/data.json b/src/test/resources/rml-core/RMLTC0028b-JSON/data.json new file mode 100644 index 00000000..4087270d --- /dev/null +++ b/src/test/resources/rml-core/RMLTC0028b-JSON/data.json @@ -0,0 +1 @@ +[ { "id": "0", "name": "Alice" } ] diff --git a/src/test/resources/rml-core/RMLTC0028b-JSON/mapping.ttl b/src/test/resources/rml-core/RMLTC0028b-JSON/mapping.ttl new file mode 100644 index 00000000..9564c1e4 --- /dev/null +++ b/src/test/resources/rml-core/RMLTC0028b-JSON/mapping.ttl @@ -0,0 +1,22 @@ +@prefix rml: . +@prefix s: . + + a rml:TriplesMap; + rml:logicalSource [ + rml:referenceFormulation rml:JSONPath ; + rml:iterator "$[*]"; + rml:source [ a rml:RelativePathSource; + rml:root rml:MappingDirectory; + rml:path "data.json" + ] + ]; + rml:subjectMap [ + rml:template "https://example.org/instances/{id}"; + rml:class s:Person ; + rml:graph ; + ]; + rml:predicateObjectMap [ + rml:predicate s:givenName ; + rml:objectMap [ rml:reference "name" ] ; + rml:graph rml:defaultGraph ; + ]. diff --git a/src/test/resources/rml-core/RMLTC0028b-JSON/output.nq b/src/test/resources/rml-core/RMLTC0028b-JSON/output.nq new file mode 100644 index 00000000..8e306356 --- /dev/null +++ b/src/test/resources/rml-core/RMLTC0028b-JSON/output.nq @@ -0,0 +1,3 @@ + "Alice". + "Alice" . + . diff --git a/src/test/resources/rml-core/RMLTC0028c-JSON/README.md b/src/test/resources/rml-core/RMLTC0028c-JSON/README.md new file mode 100644 index 00000000..2a0a6d06 --- /dev/null +++ b/src/test/resources/rml-core/RMLTC0028c-JSON/README.md @@ -0,0 +1,45 @@ +## RMLTC0028c-JSON + +**Title**: "Generation of the right language tag for a constant in the mapping" + +**Description**: "Test the honoring of the language tag specified by the constant term in the mapping" + +**Default Base IRI**: http://example.com/ + +**Error expected?** No + +**Input** +``` +[ { "id": "0", "foo": "bar" } ] + +``` + +**Mapping** +``` +@prefix rml: . + + a rml:TriplesMap; + rml:logicalSource [ + rml:referenceFormulation rml:JSONPath ; + rml:iterator "$[*]"; + rml:source [ a rml:RelativePathSource; + rml:root rml:MappingDirectory; + rml:path "data.json" + ] + ]; + rml:subjectMap [ + rml:template "https://example.org/instances/{id}"; + ]; + rml:predicateObjectMap [ + rml:predicate ; + rml:object "train"@en ; + ] . + +``` + +**Output** +``` + "train"@en . + +``` + diff --git a/src/test/resources/rml-core/RMLTC0028c-JSON/data.json b/src/test/resources/rml-core/RMLTC0028c-JSON/data.json new file mode 100644 index 00000000..64a11ae8 --- /dev/null +++ b/src/test/resources/rml-core/RMLTC0028c-JSON/data.json @@ -0,0 +1 @@ +[ { "id": "0", "foo": "bar" } ] diff --git a/src/test/resources/rml-core/RMLTC0028c-JSON/mapping.ttl b/src/test/resources/rml-core/RMLTC0028c-JSON/mapping.ttl new file mode 100644 index 00000000..8c9145de --- /dev/null +++ b/src/test/resources/rml-core/RMLTC0028c-JSON/mapping.ttl @@ -0,0 +1,18 @@ +@prefix rml: . + + a rml:TriplesMap; + rml:logicalSource [ + rml:referenceFormulation rml:JSONPath ; + rml:iterator "$[*]"; + rml:source [ a rml:RelativePathSource; + rml:root rml:MappingDirectory; + rml:path "data.json" + ] + ]; + rml:subjectMap [ + rml:template "https://example.org/instances/{id}"; + ]; + rml:predicateObjectMap [ + rml:predicate ; + rml:object "train"@en ; + ] . diff --git a/src/test/resources/rml-core/RMLTC0028c-JSON/output.nq b/src/test/resources/rml-core/RMLTC0028c-JSON/output.nq new file mode 100644 index 00000000..55246cc3 --- /dev/null +++ b/src/test/resources/rml-core/RMLTC0028c-JSON/output.nq @@ -0,0 +1 @@ + "train"@en . diff --git a/src/test/resources/rml-core/config.js b/src/test/resources/rml-core/config.js new file mode 100644 index 00000000..8bc9b13b --- /dev/null +++ b/src/test/resources/rml-core/config.js @@ -0,0 +1,79 @@ +async function loadTurtle() { + //this is the function you call in 'preProcess', to load the highlighter + const worker = await new Promise(resolve => { + require(["core/worker"], ({ worker }) => resolve(worker)); + }); + const action = "highlight-load-lang"; + const langURL = + "https://cdn.jsdelivr.net/gh/redmer/highlightjs-turtle/src/languages/turtle.js"; + const propName = "hljsDefineTurtle"; // This funtion is defined in the highlighter being loaded + const lang = "turtle"; // this is the class you use to identify the language + worker.postMessage({ action, langURL, propName, lang }); + return new Promise(resolve => { + worker.addEventListener("message", function listener({ data }) { + const { action: responseAction, lang: responseLang } = data; + if (responseAction === action && responseLang === lang) { + worker.removeEventListener("message", listener); + resolve(); + } + }); + }); +} + +var respecConfig = { + // check https://respec.org/docs/ for the meaning of these keys + preProcess: [loadTurtle], + authors: [ + { + name: "Dylan Van Assche", + url: "https://dylanvanassche.be", + company: "IDLab – Ghent University – imec", + orcid: "0000-0002-7195-9935", + companyURL: "https://knows.idlab.ugent.be/" + } + ], + edDraftURI: "https://w3id.org/rml/core/test-cases/", + editors: [ + { + name: "Dylan Van Assche", + url: "https://dylanvanassche.be", + company: "IDLab – Ghent University – imec", + orcid: "0000-0002-7195-9935", + companyURL: "https://knows.idlab.ugent.be/" + }, + { + name: "David Chaves-Fraga", + url: "https://davidchavesfraga.com", + company: "CiTIUS – University of Santiago de Compostela", + orcid: "0000-0003-3236-2789", + companyURL: "https://citius.gal" + } + ], + formerEditors: [ + ], + github: "https://github.com/kg-construct/rml-core", + license: "w3c-software-doc", + localBiblio: { + "RML-Core": { + title: "RML-Core", + href: "https://w3id.org/rml/core/spec", + status: "Draft Community Group Report", + publisher: "W3C", + date: "07 August 2024", + }, + "RML-IO": { + title: "RML-IO", + href: "https://w3id.org/rml/io/spec", + status: "Draft Community Group Report", + publisher: "W3C", + date: "12 March 2024", + }, + }, + otherLinks: [], + shortName: "RML-Core-Testcases", + specStatus: "CG-DRAFT", + // W3C config + copyrightStart: "2024", + doJsonLd: true, + group: "kg-construct", +}; diff --git a/src/test/resources/rml-core/descriptions.csv b/src/test/resources/rml-core/descriptions.csv new file mode 100644 index 00000000..c5220b8f --- /dev/null +++ b/src/test/resources/rml-core/descriptions.csv @@ -0,0 +1,64 @@ +ID,title,description +RMLTC0000-JSON,"one table, one column, zero rows",Tests if an empty table produces an empty RDF graph +RMLTC0001a-JSON,"One column mapping, subject URI generation by using rml:template",Tests: (1) one column mapping; (2) subject URI generation by using rml:template; (3) one column to one property +RMLTC0001b-JSON,"One column mapping, generation of a BlankNode subject by using rml:termType",Tests: (1) one column mapping; (2) generation of a BlankNode subject by using rml:termType; (3) one column to one property +RMLTC0002a-JSON,"Two columns mapping, generation of a subject URI by the concatenation of two column values","Tests: (1) two column mapping, no primary key; (2) subject URI generated by the concatenation of two column values; (3) one column to one property" +RMLTC0002b-JSON,"Two columns mapping, generation of a BlankNode subject by using rml:template and rml:termType","Tests: (1) two column mapping, no primary key; (2) generation of a BlankNode subject by using rml:template; (3) one column to one property" +RMLTC0002e-JSON,"Two columns mapping, an undefined rml:path",Tests the presence of an undefined rml:path +RMLTC0002g-JSON,"Two columns mapping, invalid JSONPath",Test the presence of an invalid JSONPath +RMLTC0003c-JSON,"Three columns mapping, by using a rml:template to produce literal",Tests: (1) three column mapping; and (2) the use of rml:template to produce literal +RMLTC0004a-JSON,"Two column mapping, from one row table to two different triples","Tests: (1) two column mapping, (2) subject URI generated by a column value; (3) from one row table to two different triples (4) typing by using rml:class" +RMLTC0004b-JSON,"One column mapping, presence of rml:termType rml:Literal on rml:subjectMap","Tests: (1) one column mapping (2) the presence of rml:termType rml:Literal on rml:subjectMap, which is invalid" +RMLTC0005a-JSON,Typing of resources,Tests the typing of resources +RMLTC0006a-JSON,"Use of rml:constant in rml:subjectMap, rml:predicateMap, rml:objectMap and rml:graphMap","Tests the use of rml:constant in rml:subjectMap, rml:predicateMap, rml:objectMap and rml:graphMap" +RMLTC0007a-JSON,Typing resources by relying on rdf:type predicate,Tests the typing resources by relying on rdf:type predicate +RMLTC0007b-JSON,Assigning triples to Named Graphs,Tests the generation of triples to a named graph +RMLTC0007c-JSON,"One row mapping, using rml:class","Tests subjectmap with more than one class IRIs, rml:class" +RMLTC0007d-JSON,"One column mapping, specifying an rml:predicateObjectMap with rdf:type","Tests subjectmap with an alternative of having rml:class, i.e., by specifying an rml:predicateObjectMap with predicate rdf:type" +RMLTC0007e-JSON,"One column mapping, using rml:graphMap and rml:class",Tests subjectmap with rml:graphMap and rml:class +RMLTC0007f-JSON,"One column mapping, using rml:graphMap and specifying an rml:predicateObjectMap with rdf:type",Tests subjectmap with rml:graphMap and specifying an rml:predicateObjectMap with predicate rdf:type +RMLTC0007g-JSON,Assigning triples to the default graph,Tests the generation of triples to the default graph +RMLTC0007h-JSON,Assigning triples to a non-IRI named graph,"Tests the generation of triples to a non-IRI named graph, which is an error" +RMLTC0008a-JSON,Generation of triples to a target graph by using rml:graphMap and rml:template,Test that results of the mapping can be directed to a target graph by using rml:graphMap and rml:template +RMLTC0008b-JSON,Generation of triples referencing object map,Tests the mapping specification referencing object map without join +RMLTC0008c-JSON,Generation of triples by using multiple predicateMaps within a rml:predicateObjectMap,Tests the generation of triples by using multiple predicateMaps within a rml:predicateObjectMap +RMLTC0009a-JSON,Generation of triples from foreign key relations,Test foreign key relationships among logical tables +RMLTC0009b-JSON,Generation of triples to multiple graphs,Test that results from distinct parts of the mapping can be directed to different target graphs. +RMLTC0010a-JSON,Template with table column with blank space,Tests a template with blank space in column value +RMLTC0010b-JSON,Template with table columns with special chars,Tests a template with special chars in column value +RMLTC0010c-JSON,Template with table columns with special chars and backslashes,Tests a template with special chars in reference value and backslash escapes in string templates +RMLTC0011b-JSON,"M to M relation, by using an additional Triples Map","Tests, M to M relations, by using an additional Triples Map" +RMLTC0012a-JSON,Blank node referencing multiple columns,Tests that blank nodes can be generated by referencing multiple columns +RMLTC0012b-JSON,Duplicate tuples generate same blank node,Tests that blank nodes with same identifier and in the same graph but generated by different logical rows are considered equivalent. +RMLTC0012c-JSON,TriplesMap without subjectMap,"Tests a RML with missing information, TriplesMap without subjectMap." +RMLTC0012d-JSON,TriplesMap with two subjectMap,"Tests a RML with wrong information, TriplesMap with two subjectMap." +RMLTC0013a-JSON,Null value in JSON file,Tests if null values in JSON files are handled correctly. +RMLTC0015a-JSON,Generation of language tags from a table with language information,Generation of language tags from a table with language information +RMLTC0015b-JSON,"Generation of language tags from a table with language information, and a term map with invalid rml:language value","Tests a term map with an invalid rml:language value, which is an error" +RMLTC0019a-JSON,Generation of triples by using IRI value in columns,Test the generation of triples by using IRI value in attributes +RMLTC0019b-JSON,"Generation of triples by using IRI value in columns, with data error","Test the generation of triples by using IRI value in attributes, conforming RML mapping with data error (and limited results)" +RMLTC0020a-JSON,Generation of triples by using IRI value in columns,Test the generation of triples by using IRI value in attributes +RMLTC0021a-JSON,Generation of triples referencing object map,Tests the mapping specification referencing object map with same logical source and join condition +RMLTC0022a-JSON,Generating of triples with constant datatype,Test triples with a fixed constant datatype +RMLTC0022b-JSON,Generating of triples with datatypeMap,Test triples with a XSD datatype generated from the data +RMLTC0022c-JSON,Generating of triples with datatypeMap with custom datatype,Test triples with a custom datype from the data +RMLTC0023a-JSON,Invalid IRI template 1,Test handling of invalid IRI template +RMLTC0023b-JSON,Invalid IRI template 2,Test handling of invalid IRI template +RMLTC0023c-JSON,Invalid IRI template 3,Test handling of invalid IRI template +RMLTC0023d-JSON,Invalid IRI template 4,Test handling of invalid IRI template +RMLTC0023e-JSON,Invalid IRI template 5,Test handling of invalid IRI template +RMLTC0023f-JSON,Valid IRI template with backslash-escape,Test handling of a valid IRI template using backslash-escape +RMLTC0024a-JSON,Usage of constant term maps in combination with explicitly defined term types,Tests the usage of constant term maps in combination with explicitly defined term types +RMLTC0025a-JSON,Generation of triples from arrays,Tests the generation of triples from array input data structures +RMLTC0025b-JSON,Generation of triples from arrays with wrong reference,Tests the generation of triples from array input data structures. Test should fail as reference points to the array and not the values of the array +RMLTC0025c-JSON,Generation of triples from arrays in subject and object,Tests the generation of triples from array input data structures in subject and object +RMLTC0026a-JSON,"Two triples maps, one with rml:baseIRI and one without and generating absolute IRIs",Tests the generation of triples from relative IRIs using base IRI +RMLTC0026b-JSON,"Two triples maps, one with rml:baseIRI one one without and generating relative IRIs using baseIRI parameter",Tests the generation of triples from relative IRI using base IRI parameter +RMLTC0026c-JSON,"Two triples maps, both with rml:baseIRI defined","Tests the generation of triples using relative IRIs with base IRIs defined only in triples maps, without base IRI parameter" +RMLTC0026d-JSON,"Two triples maps,both with rml:bseIRI defined and baseIRI parameter defined",Tests the generation of triples by with base IRIs different than the base IRI parameter +RMLTC0027a-JSON,Generation of triples using the URI term type,Tests the generation of triples with a URI term type in the subject or object +RMLTC0027b-JSON,Generation of triples using the UnsafeURI term type,Tests the generation of triples with a UnsafeURI term type in the subject or object +RMLTC0027c-JSON,Generation of triples using the UnsafeIRI term type,Tests the generation of triples with a UnsafeIRI term type in the subject or object +RMLTC0028a-JSON,Generation of the right datatype for a constant in the mapping,Test the honoring of the datatype specified by the constant term in the mapping +RMLTC0028b-JSON,Generation of all named graphs when rml:defaultGraph is involved,Test if the default graph is also generated correctly. +RMLTC0028c-JSON,Generation of the right language tag for a constant in the mapping,Test the honoring of the language tag specified by the constant term in the mapping diff --git a/src/test/resources/rml-core/descriptions_old.csv b/src/test/resources/rml-core/descriptions_old.csv new file mode 100644 index 00000000..a80465eb --- /dev/null +++ b/src/test/resources/rml-core/descriptions_old.csv @@ -0,0 +1,426 @@ +ID,Title,Purpose,"Error expected?",Input ,"Output default","Output 1","Output 2","Output 3",Comment +RMLTC0000-CSV,"one table, one column, zero rows",Tests if an empty table produces an empty RDF graph,no,,,,,, +RMLTC0000-JSON,"one table, one column, zero rows",Tests if an empty table produces an empty RDF graph,no,,,,,, +RMLTC0000-XML,"one table, one column, zero rows",Tests if an empty table produces an empty RDF graph,no,,,,,, +RMLTC0000-MySQL,"one table, one column, zero rows",Tests if an empty table produces an empty RDF graph,no,,,,,, +RMLTC0000-PostgreSQL,"one table, one column, zero rows",Tests if an empty table produces an empty RDF graph,no,,,,,, +RMLTC0000-SQLServer,"one table, one column, zero rows",Tests if an empty table produces an empty RDF graph,no,,,,,, +RMLTC0000-SPARQL,Empty dataset,Test if an empty dataset produces an empty RDF graph,no,,,,,, +RMLTC0001a-CSV,"One column mapping, subject URI generation by using rml:template",Tests: (1) one column mapping; (2) subject URI generation by using rml:template; (3) one column to one property,no,,,,,, +RMLTC0001a-JSON,"One column mapping, subject URI generation by using rml:template",Tests: (1) one column mapping; (2) subject URI generation by using rml:template; (3) one column to one property,no,,,,,, +RMLTC0001a-XML,"One column mapping, subject URI generation by using rml:template",Tests: (1) one column mapping; (2) subject URI generation by using rml:template; (3) one column to one property,no,,,,,, +RMLTC0001a-MySQL,"One column mapping, subject URI generation by using rml:template",Tests: (1) one column mapping; (2) subject URI generation by using rml:template; (3) one column to one property,no,,,,,, +RMLTC0001a-PostgreSQL,"One column mapping, subject URI generation by using rml:template",Tests: (1) one column mapping; (2) subject URI generation by using rml:template; (3) one column to one property,no,,,,,, +RMLTC0001a-SQLServer,"One column mapping, subject URI generation by using rml:template",Tests: (1) one column mapping; (2) subject URI generation by using rml:template; (3) one column to one property,no,,,,,, +RMLTC0001a-SPARQL,"One tripple mapping, subject URI generation by using rml:template",Tests: (1) one tripple mapping; (2) generation of a BlankNode subject by using rml:termType; (3) one tripple to one property,no,,,,,, +RMLTC0001b-CSV,"One column mapping, generation of a BlankNode subject by using rml:termType",Tests: (1) one column mapping; (2) generation of a BlankNode subject by using rml:termType; (3) one column to one property,no,,,,,, +RMLTC0001b-JSON,"One column mapping, generation of a BlankNode subject by using rml:termType",Tests: (1) one column mapping; (2) generation of a BlankNode subject by using rml:termType; (3) one column to one property,no,,,,,, +RMLTC0001b-XML,"One column mapping, generation of a BlankNode subject by using rml:termType",Tests: (1) one column mapping; (2) generation of a BlankNode subject by using rml:termType; (3) one column to one property,no,,,,,, +RMLTC0001b-MySQL,"One column mapping, generation of a BlankNode subject by using rml:termType",Tests: (1) one column mapping; (2) generation of a BlankNode subject by using rml:termType; (3) one column to one property,no,,,,,, +RMLTC0001b-PostgreSQL,"One column mapping, generation of a BlankNode subject by using rml:termType",Tests: (1) one column mapping; (2) generation of a BlankNode subject by using rml:termType; (3) one column to one property,no,,,,,, +RMLTC0001b-SQLServer,"One column mapping, generation of a BlankNode subject by using rml:termType",Tests: (1) one column mapping; (2) generation of a BlankNode subject by using rml:termType; (3) one column to one property,no,,,,,, +RMLTC0001b-SPARQL,"One tripple mapping, generation of a BlankNode subject by using rml:termType",Tests: (1) one tripple mapping; (2) generation of a BlankNode subject by using rml:termType; (3) one tripple to one property,no,,,,,, +RMLTC0002a-CSV,"Two columns mapping, generation of a subject URI by the concatenation of two column values","Tests: (1) two column mapping, no primary key; (2) subject URI generated by the concatenation of two column values; (3) one column to one property",no,,,,,, +RMLTC0002a-JSON,"Two columns mapping, generation of a subject URI by the concatenation of two column values","Tests: (1) two column mapping, no primary key; (2) subject URI generated by the concatenation of two column values; (3) one column to one property",no,,,,,, +RMLTC0002a-XML,"Two columns mapping, generation of a subject URI by the concatenation of two column values","Tests: (1) two column mapping, no primary key; (2) subject URI generated by the concatenation of two column values; (3) one column to one property",no,,,,,, +RMLTC0002a-MySQL,"Two columns mapping, generation of a subject URI by the concatenation of two column values","Tests: (1) two column mapping, no primary key; (2) subject URI generated by the concatenation of two column values; (3) one column to one property",no,,,,,, +RMLTC0002a-PostgreSQL,"Two columns mapping, generation of a subject URI by the concatenation of two column values","Tests: (1) two column mapping, no primary key; (2) subject URI generated by the concatenation of two column values; (3) one column to one property",no,,,,,, +RMLTC0002a-SQLServer,"Two columns mapping, generation of a subject URI by the concatenation of two column values","Tests: (1) two column mapping, no primary key; (2) subject URI generated by the concatenation of two column values; (3) one column to one property",no,,,,,, +RMLTC0002a-SPARQL,"Two tripples mapping, generation of a subject URI by the concatenation of two column values","Tests: (1) two tripple mapping, no primary key; (2) subject URI generated by the concatenation of two tripple object values; (3) one tripple object to one property",no,,,,,, +RMLTC0002b-CSV,"Two columns mapping, generation of a BlankNode subject by using rml:template and rml:termType","Tests: (1) two column mapping, no primary key; (2) generation of a BlankNode subject by using rml:template; (3) one column to one property",no,,,,,, +RMLTC0002b-JSON,"Two columns mapping, generation of a BlankNode subject by using rml:template and rml:termType","Tests: (1) two column mapping, no primary key; (2) generation of a BlankNode subject by using rml:template; (3) one column to one property",no,,,,,, +RMLTC0002b-XML,"Two columns mapping, generation of a BlankNode subject by using rml:template and rml:termType","Tests: (1) two column mapping, no primary key; (2) generation of a BlankNode subject by using rml:template; (3) one column to one property",no,,,,,, +RMLTC0002b-MySQL,"Two columns mapping, generation of a BlankNode subject by using rml:template and rml:termType","Tests: (1) two column mapping, no primary key; (2) generation of a BlankNode subject by using rml:template; (3) one column to one property",no,,,,,, +RMLTC0002b-PostgreSQL,"Two columns mapping, generation of a BlankNode subject by using rml:template and rml:termType","Tests: (1) two column mapping, no primary key; (2) generation of a BlankNode subject by using rml:template; (3) one column to one property",no,,,,,, +RMLTC0002b-SQLServer,"Two columns mapping, generation of a BlankNode subject by using rml:template and rml:termType","Tests: (1) two column mapping, no primary key; (2) generation of a BlankNode subject by using rml:template; (3) one column to one property",no,,,,,, +RMLTC0002b-SPARQL,"Two tripples maping, generation of a BlankNode subject by using rml:template and rml:termType","Tests: (1) two tripple mapping, no primary key; (2) generation of a BlankNode subject by using rml:template; (3) one triple to one property",no,,,,,, +RMLTC0002c-CSV,"Two columns mapping, an undefined SQL identifier / logical reference",Tests the presence of an undefined SQL identifier / logical reference,yes,,,,,, +RMLTC0002c-XML,"Two columns mapping, an undefined SQL identifier / logical reference",Tests the presence of an undefined SQL identifier / logical reference,yes,,,,,, +RMLTC0002c-MySQL,"Two columns mapping, an undefined SQL identifier / logical reference",Tests the presence of an undefined SQL identifier / logical reference,yes,,,,,, +RMLTC0002c-PostgreSQL,"Two columns mapping, an undefined SQL identifier / logical reference",Tests the presence of an undefined SQL identifier / logical reference,yes,,,,,, +RMLTC0002c-SQLServer,"Two columns mapping, an undefined SQL identifier / logical reference",Tests the presence of an undefined SQL identifier / logical reference,yes,,,,,, +RMLTC0002d-MySQL,"Two columns mapping, generation of a BlankNode subject by using a SQL Query that concatenates two columns","Tests (1) two column mapping, no primary key; (2) generation of a BlankNode subject by using a SQL Query that concatenates two columns; (3) one column to one property",no,,,,,, +RMLTC0002d-PostgreSQL,"Two columns mapping, generation of a BlankNode subject by using a SQL Query that concatenates two columns","Tests (1) two column mapping, no primary key; (2) generation of a BlankNode subject by using a SQL Query that concatenates two columns; (3) one column to one property",no,,,,,, +RMLTC0002d-SQLServer,"Two columns mapping, generation of a BlankNode subject by using a SQL Query that concatenates two columns","Tests (1) two column mapping, no primary key; (2) generation of a BlankNode subject by using a SQL Query that concatenates two columns; (3) one column to one property",no,,,,,, +RMLTC0002e-CSV,"Two columns mapping, an undefined rml:path",Tests the presence of an undefined rml:path,yes,,,,,, +RMLTC0002e-JSON,"Two columns mapping, an undefined rml:path",Tests the presence of an undefined rml:path,yes,,,,,, +RMLTC0002e-XML,"Two columns mapping, an undefined rml:path",Tests the presence of an undefined rml:path,yes,,,,,, +RMLTC0002e-MySQL,"Two columns mapping, an undefined rml:path",Tests the presence of an undefined rml:path,yes,,,,,, +RMLTC0002e-PostgreSQL,"Two columns mapping, an undefined rml:path",Tests the presence of an undefined rml:path,yes,,,,,, +RMLTC0002e-SQLServer,"Two columns mapping, an undefined rml:path",Tests the presence of an undefined rml:path,yes,,,,,, +RMLTC0002f-MySQL,"Two columns mapping, delimited identifiers referenced as regular identifiers","Tests the presence of delimited identifiers referenced as regular identifiers. Within rml:template ID is ok, but Name is not",yes,,,,,, +RMLTC0002f-PostgreSQL,"Two columns mapping, delimited identifiers referenced as regular identifiers","Tests the presence of delimited identifiers referenced as regular identifiers. Within rml:template ID is ok, but Name is not",yes,,,,,, +RMLTC0002f-SQLServer,"Two columns mapping, delimited identifiers referenced as regular identifiers","Tests the presence of delimited identifiers referenced as regular identifiers. Within rml:template ID is ok, but Name is not",yes,,,,,, +RMLTC0002g-JSON,"Two columns mapping, invalid JSONPath",Test the presence of an invalid JSONPath,yes,,,,,, +RMLTC0002g-MySQL,"Two columns mapping, invalid SQL query",Tests the presence of an invalid SQL query,yes,,,,,, +RMLTC0002g-PostgreSQL,"Two columns mapping, invalid SQL query",Tests the presence of an invalid SQL query,yes,,,,,, +RMLTC0002g-SQLServer,"Two columns mapping, invalid SQL query",Tests the presence of an invalid SQL query,yes,,,,,, +RMLTC0002g-SPARQL,"Two tripples mapping, invalid SPARQL query",Tests the presence of an invalid SPARQL query,yes,,,,,, +RMLTC0002h-MySQL,"Two columns mapping, duplicate column name in SELECT",Tests the presence of duplicate column names in the SELECT list of the SQL query,yes,,,,,, +RMLTC0002h-PostgreSQL,"Two columns mapping, duplicate column name in SELECT",Tests the presence of duplicate column names in the SELECT list of the SQL query,yes,,,,,, +RMLTC0002h-SQLServer,"Two columns mapping, duplicate column name in SELECT",Tests the presence of duplicate column names in the SELECT list of the SQL query,yes,,,,,, +RMLTC0002h-SPARQL,"Two tripples mapping, duplicate variable name in SELECT",Tests the presence of duplicate variable names in the SELECT list of the SPARQL query,yes,,,,,, +RMLTC0002i-MySQL,"Two columns mapping, SQL Version identifier",Tests the presence of a SQL Version identifier ,no,,,,,, +RMLTC0002i-PostgreSQL,"Two columns mapping, SQL Version identifier",Tests the presence of a SQL Version identifier ,no,,,,,, +RMLTC0002i-SQLServer,"Two columns mapping, SQL Version identifier",Tests the presence of a SQL Version identifier ,no,,,,,, +RMLTC0002j-MySQL,"Two columns mapping, qualified column names",Tests the presence of qualified column names in the SELECT list of the SQL query,no,,,,,, +RMLTC0002j-PostgreSQL,"Two columns mapping, qualified column names",Tests the presence of qualified column names in the SELECT list of the SQL query,no,,,,,, +RMLTC0002j-SQLServer,"Two columns mapping, qualified column names",Tests the presence of qualified column names in the SELECT list of the SQL query,no,,,,,, +RMLTC0003a-MySQL,"Three columns mapping, undefined SQL Version identifier",Tests the presence of an undefined SQL Version identifier,yes,,,,,, +RMLTC0003a-PostgreSQL,"Three columns mapping, undefined SQL Version identifier",Tests the presence of an undefined SQL Version identifier,yes,,,,,, +RMLTC0003a-SQLServer,"Three columns mapping, undefined SQL Version identifier",Tests the presence of an undefined SQL Version identifier,yes,,,,,, +RMLTC0003b-MySQL,"Three columns mapping, concatenation of columns, by using a rml:SQL2008Query to produce literal","Tests: (1) three column mapping; and (2) concatenation of columns to produce literal, by using a rml:SQL2008Query",no,,,,,, +RMLTC0003b-PostgreSQL,"Three columns mapping, concatenation of columns, by using a rml:SQL2008Query to produce literal","Tests: (1) three column mapping; and (2) concatenation of columns to produce literal, by using a rml:SQL2008Query",no,,,,,, +RMLTC0003b-SQLServer,"Three columns mapping, concatenation of columns, by using a rml:SQL2008Query to produce literal","Tests: (1) three column mapping; and (2) concatenation of columns to produce literal, by using a rml:SQL2008Query",no,,,,,, +RMLTC0003c-CSV,"Three columns mapping, by using a rml:template to produce literal",Tests: (1) three column mapping; and (2) the use of rml:template to produce literal,no,,,,,, +RMLTC0003c-JSON,"Three columns mapping, by using a rml:template to produce literal",Tests: (1) three column mapping; and (2) the use of rml:template to produce literal,no,,,,,, +RMLTC0003c-XML,"Three columns mapping, by using a rml:template to produce literal",Tests: (1) three column mapping; and (2) the use of rml:template to produce literal,no,,,,,, +RMLTC0003c-MySQL,"Three columns mapping, by using a rml:template to produce literal",Tests: (1) three column mapping; and (2) the use of rml:template to produce literal,no,,,,,, +RMLTC0003c-PostgreSQL,"Three columns mapping, by using a rml:template to produce literal",Tests: (1) three column mapping; and (2) the use of rml:template to produce literal,no,,,,,, +RMLTC0003c-SQLServer,"Three columns mapping, by using a rml:template to produce literal",Tests: (1) three column mapping; and (2) the use of rml:template to produce literal,no,,,,,, +RMLTC0003c-SPARQL,"Three tripple mapping, by using a rml:template to produce literal",Tests: (1) three column mapping; and (2) the use of rml:template to produce literal,no,,,,,, +RMLTC0004a-CSV,"Two column mapping, from one row table to two different triples","Tests: (1) two column mapping, (2) subject URI generated by a column value; (3) from one row table to two different triples (4) typing by using rml:class",no,,,,,, +RMLTC0004a-JSON,"Two column mapping, from one row table to two different triples","Tests: (1) two column mapping, (2) subject URI generated by a column value; (3) from one row table to two different triples (4) typing by using rml:class",no,,,,,, +RMLTC0004a-XML,"Two column mapping, from one row table to two different triples","Tests: (1) two column mapping, (2) subject URI generated by a column value; (3) from one row table to two different triples (4) typing by using rml:class",no,,,,,, +RMLTC0004a-MySQL,"Two column mapping, from one row table to two different triples","Tests: (1) two column mapping, (2) subject URI generated by a column value; (3) from one row table to two different triples (4) typing by using rml:class",no,,,,,, +RMLTC0004a-PostgreSQL,"Two column mapping, from one row table to two different triples","Tests: (1) two column mapping, (2) subject URI generated by a column value; (3) from one row table to two different triples (4) typing by using rml:class",no,,,,,, +RMLTC0004a-SQLServer,"Two column mapping, from one row table to two different triples","Tests: (1) two column mapping, (2) subject URI generated by a column value; (3) from one row table to two different triples (4) typing by using rml:class",no,,,,,, +RMLTC0004a-SPARQL,"Two BlankNodes mapping, from one object to two different triples","Tests: (1) two BlankNodes mapping, (2) subject URI generated by a tripple object value; (3) from one BlankNode to two different triples (4) typing by using rml:class",no,,,,,, +RMLTC0004b-CSV,"One column mapping, presence of rml:termType rml:Literal on rml:subjectMap","Tests: (1) one column mapping (2) the presence of rml:termType rml:Literal on rml:subjectMap, which is invalid",yes,,,,,, +RMLTC0004b-JSON,"One column mapping, presence of rml:termType rml:Literal on rml:subjectMap","Tests: (1) one column mapping (2) the presence of rml:termType rml:Literal on rml:subjectMap, which is invalid",yes,,,,,, +RMLTC0004b-XML,"One column mapping, presence of rml:termType rml:Literal on rml:subjectMap","Tests: (1) one column mapping (2) the presence of rml:termType rml:Literal on rml:subjectMap, which is invalid",yes,,,,,, +RMLTC0004b-MySQL,"One column mapping, presence of rml:termType rml:Literal on rml:subjectMap","Tests: (1) one column mapping (2) the presence of rml:termType rml:Literal on rml:subjectMap, which is invalid",yes,,,,,, +RMLTC0004b-PostgreSQL,"One column mapping, presence of rml:termType rml:Literal on rml:subjectMap","Tests: (1) one column mapping (2) the presence of rml:termType rml:Literal on rml:subjectMap, which is invalid",yes,,,,,, +RMLTC0004b-SQLServer,"One column mapping, presence of rml:termType rml:Literal on rml:subjectMap","Tests: (1) one column mapping (2) the presence of rml:termType rml:Literal on rml:subjectMap, which is invalid",yes,,,,,, +RMLTC0004b-SPARQL,"One tripple mapping, presence of rml:termType rml:Literal on rml:subjectMap","Tests: (1) one column mapping (2) the presence of rml:termType rml:Literal on rml:subjectMap, which is invalid",yes,,,,,, +RMLTC0005a-CSV,Typing of resources,Tests the typing of resources,no,,,,,, +RMLTC0005a-JSON,Typing of resources,Tests the typing of resources,no,,,,,, +RMLTC0005a-XML,Typing of resources,Tests the typing of resources,no,,,,,, +RMLTC0005a-MySQL,Typing of resources,Tests the typing of resources,no,,,,,, +RMLTC0005a-PostgreSQL,Typing of resources,Tests the typing of resources,no,,,,,, +RMLTC0005a-SQLServer,Typing of resources,Tests the typing of resources,no,,,,,, +RMLTC0005b-MySQL,Default mapping,Tests the generation of a default mapping for tables without a primary key,no,,,,,, +RMLTC0005b-PostgreSQL,Default mapping,Tests the generation of a default mapping for tables without a primary key,no,,,,,, +RMLTC0005b-SQLServer,Default mapping,Tests the generation of a default mapping for tables without a primary key,no,,,,,, +RMLTC0006a-CSV,"Use of rml:constant in rml:subjectMap, rml:predicateMap, rml:objectMap and rml:graphMap","Tests the use of rml:constant in rml:subjectMap, rml:predicateMap, rml:objectMap and rml:graphMap",no,,,,,, +RMLTC0006a-JSON,"Use of rml:constant in rml:subjectMap, rml:predicateMap, rml:objectMap and rml:graphMap","Tests the use of rml:constant in rml:subjectMap, rml:predicateMap, rml:objectMap and rml:graphMap",no,,,,,, +RMLTC0006a-XML,"Use of rml:constant in rml:subjectMap, rml:predicateMap, rml:objectMap and rml:graphMap","Tests the use of rml:constant in rml:subjectMap, rml:predicateMap, rml:objectMap and rml:graphMap",no,,,,,, +RMLTC0006a-MySQL,"Use of rml:constant in rml:subjectMap, rml:predicateMap, rml:objectMap and rml:graphMap","Tests the use of rml:constant in rml:subjectMap, rml:predicateMap, rml:objectMap and rml:graphMap",no,,,,,, +RMLTC0006a-PostgreSQL,"Use of rml:constant in rml:subjectMap, rml:predicateMap, rml:objectMap and rml:graphMap","Tests the use of rml:constant in rml:subjectMap, rml:predicateMap, rml:objectMap and rml:graphMap",no,,,,,, +RMLTC0006a-SQLServer,"Use of rml:constant in rml:subjectMap, rml:predicateMap, rml:objectMap and rml:graphMap","Tests the use of rml:constant in rml:subjectMap, rml:predicateMap, rml:objectMap and rml:graphMap",no,,,,,, +RMLTC0006a-SPARQL,"rml:constant in rml:subjectMap, rml:predicateMap, rml:objectMap and rml:graphMap","Tests the use of rml:constant in rml:subjectMap, rml:predicateMap, rml:objectMap and rml:graphMap",no,,,,,, +RMLTC0007a-CSV,Typing resources by relying on rdf:type predicate,Tests the typing resources by relying on rdf:type predicate,no,,,,,, +RMLTC0007a-JSON,Typing resources by relying on rdf:type predicate,Tests the typing resources by relying on rdf:type predicate,no,,,,,, +RMLTC0007a-XML,Typing resources by relying on rdf:type predicate,Tests the typing resources by relying on rdf:type predicate,no,,,,,, +RMLTC0007a-MySQL,Typing resources by relying on rdf:type predicate,Tests the typing resources by relying on rdf:type predicate,no,,,,,, +RMLTC0007a-PostgreSQL,Typing resources by relying on rdf:type predicate,Tests the typing resources by relying on rdf:type predicate,no,,,,,, +RMLTC0007a-SQLServer,Typing resources by relying on rdf:type predicate,Tests the typing resources by relying on rdf:type predicate,no,,,,,, +RMLTC0007a-SPARQL,Typing resources by relying on rdf:type predicate,Tests the typing resources by relying on rdf:type predicate,no,,,,,, +RMLTC0007b-CSV,Assigning triples to Named Graphs,Tests the generation of triples to a named graph,no,,,,,, +RMLTC0007b-JSON,Assigning triples to Named Graphs,Tests the generation of triples to a named graph,no,,,,,, +RMLTC0007b-XML,Assigning triples to Named Graphs,Tests the generation of triples to a named graph,no,,,,,, +RMLTC0007b-MySQL,Assigning triples to Named Graphs,Tests the generation of triples to a named graph,no,,,,,, +RMLTC0007b-PostgreSQL,Assigning triples to Named Graphs,Tests the generation of triples to a named graph,no,,,,,, +RMLTC0007b-SQLServer,Assigning triples to Named Graphs,Tests the generation of triples to a named graph,no,,,,,, +RMLTC0007b-SPARQL,Assigning triples to Named Graphs,Tests the generation of triples to a named graph,no,,,,,, +RMLTC0007c-CSV,"One row mapping, using rml:class","Tests subjectmap with more than one class IRIs, rml:class",no,,,,,, +RMLTC0007c-JSON,"One row mapping, using rml:class","Tests subjectmap with more than one class IRIs, rml:class",no,,,,,, +RMLTC0007c-XML,"One row mapping, using rml:class","Tests subjectmap with more than one class IRIs, rml:class",no,,,,,, +RMLTC0007c-MySQL,"One row mapping, using rml:class","Tests subjectmap with more than one class IRIs, rml:class",no,,,,,, +RMLTC0007c-PostgreSQL,"One row mapping, using rml:class","Tests subjectmap with more than one class IRIs, rml:class",no,,,,,, +RMLTC0007c-SQLServer,"One row mapping, using rml:class","Tests subjectmap with more than one class IRIs, rml:class",no,,,,,, +RMLTC0007c-SPARQL,"One object mapping, using rml:class","Tests subjectmap with more than one class IRIs, rml:class",no,,,,,, +RMLTC0007d-CSV,"One column mapping, specifying an rml:predicateObjectMap with rdf:type","Tests subjectmap with an alternative of having rml:class, i.e., by specifying an rml:predicateObjectMap with predicate rdf:type",no,,,,,, +RMLTC0007d-JSON,"One column mapping, specifying an rml:predicateObjectMap with rdf:type","Tests subjectmap with an alternative of having rml:class, i.e., by specifying an rml:predicateObjectMap with predicate rdf:type",no,,,,,, +RMLTC0007d-XML,"One column mapping, specifying an rml:predicateObjectMap with rdf:type","Tests subjectmap with an alternative of having rml:class, i.e., by specifying an rml:predicateObjectMap with predicate rdf:type",no,,,,,, +RMLTC0007d-MySQL,"One column mapping, specifying an rml:predicateObjectMap with rdf:type","Tests subjectmap with an alternative of having rml:class, i.e., by specifying an rml:predicateObjectMap with predicate rdf:type",no,,,,,, +RMLTC0007d-PostgreSQL,"One column mapping, specifying an rml:predicateObjectMap with rdf:type","Tests subjectmap with an alternative of having rml:class, i.e., by specifying an rml:predicateObjectMap with predicate rdf:type",no,,,,,, +RMLTC0007d-SQLServer,"One column mapping, specifying an rml:predicateObjectMap with rdf:type","Tests subjectmap with an alternative of having rml:class, i.e., by specifying an rml:predicateObjectMap with predicate rdf:type",no,,,,,, +RMLTC0007d-SPARQL,"One object mapping, specifying an rml:predicateObjectMap with rdf:type","Tests subjectmap with an alternative of having rml:class, i.e., by specifying an rml:predicateObjectMap with predicate rdf:type",no,,,,,, +RMLTC0007e-CSV,"One column mapping, using rml:graphMap and rml:class",Tests subjectmap with rml:graphMap and rml:class,no,,,,,, +RMLTC0007e-JSON,"One column mapping, using rml:graphMap and rml:class",Tests subjectmap with rml:graphMap and rml:class,no,,,,,, +RMLTC0007e-XML,"One column mapping, using rml:graphMap and rml:class",Tests subjectmap with rml:graphMap and rml:class,no,,,,,, +RMLTC0007e-MySQL,"One column mapping, using rml:graphMap and rml:class",Tests subjectmap with rml:graphMap and rml:class,no,,,,,, +RMLTC0007e-PostgreSQL,"One column mapping, using rml:graphMap and rml:class",Tests subjectmap with rml:graphMap and rml:class,no,,,,,, +RMLTC0007e-SQLServer,"One column mapping, using rml:graphMap and rml:class",Tests subjectmap with rml:graphMap and rml:class,no,,,,,, +RMLTC0007e-SPARQL,"One object mapping, using rml:graphMap and rml:class",Tests subjectmap with rml:graphMap and rml:class,no,,,,,, +RMLTC0007f-CSV,"One column mapping, using rml:graphMap and specifying an rml:predicateObjectMap with rdf:type",Tests subjectmap with rml:graphMap and specifying an rml:predicateObjectMap with predicate rdf:type,no,,,,,, +RMLTC0007f-JSON,"One column mapping, using rml:graphMap and specifying an rml:predicateObjectMap with rdf:type",Tests subjectmap with rml:graphMap and specifying an rml:predicateObjectMap with predicate rdf:type,no,,,,,, +RMLTC0007f-XML,"One column mapping, using rml:graphMap and specifying an rml:predicateObjectMap with rdf:type",Tests subjectmap with rml:graphMap and specifying an rml:predicateObjectMap with predicate rdf:type,no,,,,,, +RMLTC0007f-MySQL,"One column mapping, using rml:graphMap and specifying an rml:predicateObjectMap with rdf:type",Tests subjectmap with rml:graphMap and specifying an rml:predicateObjectMap with predicate rdf:type,no,,,,,, +RMLTC0007f-PostgreSQL,"One column mapping, using rml:graphMap and specifying an rml:predicateObjectMap with rdf:type",Tests subjectmap with rml:graphMap and specifying an rml:predicateObjectMap with predicate rdf:type,no,,,,,, +RMLTC0007f-SQLServer,"One column mapping, using rml:graphMap and specifying an rml:predicateObjectMap with rdf:type",Tests subjectmap with rml:graphMap and specifying an rml:predicateObjectMap with predicate rdf:type,no,,,,,, +RMLTC0007f-SPARQL,"One object mapping, using rml:graphMap and specifying an rml:predicateObjectMap with rdf:type",Tests subjectmap with rml:graphMap and specifying an rml:predicateObjectMap with predicate rdf:type,no,,,,,, +RMLTC0007g-CSV,Assigning triples to the default graph,Tests the generation of triples to the default graph,no,,,,,, +RMLTC0007g-JSON,Assigning triples to the default graph,Tests the generation of triples to the default graph,no,,,,,, +RMLTC0007g-XML,Assigning triples to the default graph,Tests the generation of triples to the default graph,no,,,,,, +RMLTC0007g-MySQL,Assigning triples to the default graph,Tests the generation of triples to the default graph,no,,,,,, +RMLTC0007g-PostgreSQL,Assigning triples to the default graph,Tests the generation of triples to the default graph,no,,,,,, +RMLTC0007g-SQLServer,Assigning triples to the default graph,Tests the generation of triples to the default graph,no,,,,,, +RMLTC0007g-SPARQL,Assigning triples to the default graph,Tests the generation of triples to the default graph,no,,,,,, +RMLTC0007h-CSV,Assigning triples to a non-IRI named graph,"Tests the generation of triples to a non-IRI named graph, which is an error",yes,,,,,, +RMLTC0007h-JSON,Assigning triples to a non-IRI named graph,"Tests the generation of triples to a non-IRI named graph, which is an error",yes,,,,,, +RMLTC0007h-XML,Assigning triples to a non-IRI named graph,"Tests the generation of triples to a non-IRI named graph, which is an error",yes,,,,,, +RMLTC0007h-MySQL,Assigning triples to a non-IRI named graph,"Tests the generation of triples to a non-IRI named graph, which is an error",yes,,,,,, +RMLTC0007h-PostgreSQL,Assigning triples to a non-IRI named graph,"Tests the generation of triples to a non-IRI named graph, which is an error",yes,,,,,, +RMLTC0007h-SQLServer,Assigning triples to a non-IRI named graph,"Tests the generation of triples to a non-IRI named graph, which is an error",yes,,,,,, +RMLTC0007h-SPARQL,Assigning triples to a non-IRI named graph,"Tests the generation of triples to a non-IRI named graph, which is an error",yes,,,,,, +RMLTC0008a-CSV,Generation of triples to a target graph by using rml:graphMap and rml:template,Test that results of the mapping can be directed to a target graph by using rml:graphMap and rml:template,no,,,,,, +RMLTC0008a-JSON,Generation of triples to a target graph by using rml:graphMap and rml:template,Test that results of the mapping can be directed to a target graph by using rml:graphMap and rml:template,no,,,,,, +RMLTC0008a-XML,Generation of triples to a target graph by using rml:graphMap and rml:template,Test that results of the mapping can be directed to a target graph by using rml:graphMap and rml:template,no,,,,,, +RMLTC0008a-MySQL,Generation of triples to a target graph by using rml:graphMap and rml:template,Test that results of the mapping can be directed to a target graph by using rml:graphMap and rml:template,no,,,,,, +RMLTC0008a-PostgreSQL,Generation of triples to a target graph by using rml:graphMap and rml:template,Test that results of the mapping can be directed to a target graph by using rml:graphMap and rml:template,no,,,,,, +RMLTC0008a-SQLServer,Generation of triples to a target graph by using rml:graphMap and rml:template,Test that results of the mapping can be directed to a target graph by using rml:graphMap and rml:template,no,,,,,, +RMLTC0008a-SPARQL,Generation of triples to a target graph by using rml:graphMap and rml:template,Test that results of the mapping can be directed to a target graph by using rml:graphMap and rml:template,no,,,,,, +RMLTC0008b-CSV,Generation of triples referencing object map,Tests the mapping specification referencing object map without join,no,,,,,, +RMLTC0008b-JSON,Generation of triples referencing object map,Tests the mapping specification referencing object map without join,no,,,,,, +RMLTC0008b-XML,Generation of triples referencing object map,Tests the mapping specification referencing object map without join,no,,,,,, +RMLTC0008b-MySQL,Generation of triples referencing object map,Tests the mapping specification referencing object map without join,no,,,,,, +RMLTC0008b-PostgreSQL,Generation of triples referencing object map,Tests the mapping specification referencing object map without join,no,,,,,, +RMLTC0008b-SQLServer,Generation of triples referencing object map,Tests the mapping specification referencing object map without join,no,,,,,, +RMLTC0008b-SPARQL,Generation of triples referencing object map,Tests the mapping specification referencing object map without join,no,,,,,, +RMLTC0008c-CSV,Generation of triples by using multiple predicateMaps within a rml:predicateObjectMap,Tests the generation of triples by using multiple predicateMaps within a rml:predicateObjectMap,no,,,,,, +RMLTC0008c-JSON,Generation of triples by using multiple predicateMaps within a rml:predicateObjectMap,Tests the generation of triples by using multiple predicateMaps within a rml:predicateObjectMap,no,,,,,, +RMLTC0008c-XML,Generation of triples by using multiple predicateMaps within a rml:predicateObjectMap,Tests the generation of triples by using multiple predicateMaps within a rml:predicateObjectMap,no,,,,,, +RMLTC0008c-MySQL,Generation of triples by using multiple predicateMaps within a rml:predicateObjectMap,Tests the generation of triples by using multiple predicateMaps within a rml:predicateObjectMap,no,,,,,, +RMLTC0008c-PostgreSQL,Generation of triples by using multiple predicateMaps within a rml:predicateObjectMap,Tests the generation of triples by using multiple predicateMaps within a rml:predicateObjectMap,no,,,,,, +RMLTC0008c-SQLServer,Generation of triples by using multiple predicateMaps within a rml:predicateObjectMap,Tests the generation of triples by using multiple predicateMaps within a rml:predicateObjectMap,no,,,,,, +RMLTC0008c-SPARQL,Generation of triples by using multiple predicateMaps within a rml:predicateObjectMap,Tests the generation of triples by using multiple predicateMaps within a rml:predicateObjectMap,no,,,,,, +RMLTC0009a-CSV,Generation of triples from foreign key relations,Test foreign key relationships among logical tables,no,,,,,, +RMLTC0009a-JSON,Generation of triples from foreign key relations,Test foreign key relationships among logical tables,no,,,,,, +RMLTC0009a-XML,Generation of triples from foreign key relations,Test foreign key relationships among logical tables,no,,,,,, +RMLTC0009a-MySQL,Generation of triples from foreign key relations,Test foreign key relationships among logical tables,no,,,,,, +RMLTC0009a-PostgreSQL,Generation of triples from foreign key relations,Test foreign key relationships among logical tables,no,,,,,, +RMLTC0009a-SQLServer,Generation of triples from foreign key relations,Test foreign key relationships among logical tables,no,,,,,, +RMLTC0009a-SPARQL,Generation of triples from foreign key relations,Test foreign key relationships among logical tables,no,,,,,, +RMLTC0009b-CSV,Generation of triples to multiple graphs,Test that results from distinct parts of the mapping can be directed to different target graphs.,no,,,,,, +RMLTC0009b-JSON,Generation of triples to multiple graphs,Test that results from distinct parts of the mapping can be directed to different target graphs.,no,,,,,, +RMLTC0009b-XML,Generation of triples to multiple graphs,Test that results from distinct parts of the mapping can be directed to different target graphs.,no,,,,,, +RMLTC0009b-MySQL,Generation of triples to multiple graphs,Test that results from distinct parts of the mapping can be directed to different target graphs.,no,,,,,, +RMLTC0009b-PostgreSQL,Generation of triples to multiple graphs,Test that results from distinct parts of the mapping can be directed to different target graphs.,no,,,,,, +RMLTC0009b-SQLServer,Generation of triples to multiple graphs,Test that results from distinct parts of the mapping can be directed to different target graphs.,no,,,,,, +RMLTC0009b-SPARQL,Generation of triples to multiple graphs,Test that results from distinct parts of the mapping can be directed to different target graphs.,no,,,,,, +RMLTC0009c-MySQL,Unnamed column in a logical table,Test a logical table with unnamed column.,no,,,,,, +RMLTC0009c-PostgreSQL,Unnamed column in a logical table,Test a logical table with unnamed column.,no,,,,,, +RMLTC0009c-SQLServer,Unnamed column in a logical table,Test a logical table with unnamed column.,no,,,,,, +RMLTC0009d-MySQL,Named column in logical table,Test a logical table named column.,no,,,,,, +RMLTC0009d-PostgreSQL,Named column in logical table,Test a logical table named column.,no,,,,,, +RMLTC0009d-SQLServer,Named column in logical table,Test a logical table named column.,no,,,,,, +RMLTC0010a-CSV,Template with table column with special chars,Tests a template with blank space in column value,no,,,,,, +RMLTC0010a-JSON,Template with table column with blank space,Tests a template with blank space in column value,no,,,,,, +RMLTC0010a-MySQL,Template with table column with special chars,Tests a template with blank space in column value,no,,,,,, +RMLTC0010a-PostgreSQL,Template with table column with special chars,Tests a template with blank space in column value,no,,,,,, +RMLTC0010a-SQLServer,Template with table column with special chars,Tests a template with blank space in column value,no,,,,,, +RMLTC0010b-CSV,Template with table columns with special chars,Tests a template with special chars in column value,no,,,,,, +RMLTC0010b-JSON,Template with table columns with special chars,Tests a template with special chars in column value,no,,,,,, +RMLTC0010b-XML,Template with table columns with special chars,Tests a template with special chars in column value,no,,,,,, +RMLTC0010b-MySQL,Template with table columns with special chars,Tests a template with special chars in column value,no,,,,,, +RMLTC0010b-PostgreSQL,Template with table columns with special chars,Tests a template with special chars in column value,no,,,,,, +RMLTC0010b-SQLServer,Template with table columns with special chars,Tests a template with special chars in column value,no,,,,,, +RMLTC0010c-CSV,Template with table columns with special chars and backslashes,Tests a template with special chars in reference value and backslash escapes in string templates,no,,,,,, +RMLTC0010c-JSON,Template with table columns with special chars and backslashes,Tests a template with special chars in reference value and backslash escapes in string templates,no,,,,,, +RMLTC0010c-XML,Template with table columns with special chars and backslashes,Tests a template with special chars in reference value and backslash escapes in string templates,no,,,,,, +RMLTC0010c-MySQL,Template with table columns with special chars and backslashes,Tests a template with special chars in column value and backslash escapes in string templates,no,,,,,, +RMLTC0010c-PostgreSQL,Template with table columns with special chars and backslashes,Tests a template with special chars in column value and backslash escapes in string templates,no,,,,,, +RMLTC0010c-SQLServer,Template with table columns with special chars and backslashes,Tests a template with special chars in column value and backslash escapes in string templates,no,,,,,, +RMLTC0011a-MySQL,"M to M relation, by using a SQL query","Tests, M to M relations, by using a SQL query",no,,,,,, +RMLTC0011a-PostgreSQL,"M to M relation, by using a SQL query","Tests, M to M relations, by using a SQL query",no,,,,,, +RMLTC0011a-SQLServer,"M to M relation, by using a SQL query","Tests, M to M relations, by using a SQL query",no,,,,,, +RMLTC0011b-CSV,"M to M relation, by using an additional Triples Map","Tests, M to M relations, by using an additional Triples Map",no,,,,,, +RMLTC0011b-JSON,"M to M relation, by using an additional Triples Map","Tests, M to M relations, by using an additional Triples Map",no,,,,,, +RMLTC0011b-XML,"M to M relation, by using an additional Triples Map","Tests, M to M relations, by using an additional Triples Map",no,,,,,, +RMLTC0011b-MySQL,"M to M relation, by using an additional Triples Map","Tests, M to M relations, by using an additional Triples Map",no,,,,,, +RMLTC0011b-PostgreSQL,"M to M relation, by using an additional Triples Map","Tests, M to M relations, by using an additional Triples Map",no,,,,,, +RMLTC0011b-SQLServer,"M to M relation, by using an additional Triples Map","Tests, M to M relations, by using an additional Triples Map",no,,,,,, +RMLTC0012a-CSV,Duplicate tuples generate same blank node,Tests that blank nodes with same identifier and in the same graph but generated by different logical rows are considered equivalent.,no,,,,,, +RMLTC0012a-JSON,Blank node referencing multiple columns,Tests that blank nodes can be generated by referencing multiple columns,no,,,,,, +RMLTC0012a-XML,Duplicate tuples generate same blank node,Tests that blank nodes with same identifier and in the same graph but generated by different logical rows are considered equivalent.,no,,,,,, +RMLTC0012a-MySQL,Duplicate tuples generate same blank node,Tests that blank nodes with same identifier and in the same graph but generated by different logical rows are considered equivalent.,no,,,,,, +RMLTC0012a-PostgreSQL,Duplicate tuples generate same blank node,Tests that blank nodes with same identifier and in the same graph but generated by different logical rows are considered equivalent.,no,,,,,, +RMLTC0012a-SQLServer,Duplicate tuples generate same blank node,Tests that blank nodes with same identifier and in the same graph but generated by different logical rows are considered equivalent.,no,,,,,, +RMLTC0012a-SPARQL,Duplicate triples generate same blank node,Tests that blank nodes with same identifier and in the same graph but generated by different logical rows are considered equivalent.,no,,,,,, +RMLTC0012b-CSV,Duplicate tuples generate same blank node,Tests that blank nodes with same identifier and in the same graph but generated by different logical rows are considered equivalent.,no,,,,,, +RMLTC0012b-JSON,Duplicate tuples generate same blank node,Tests that blank nodes with same identifier and in the same graph but generated by different logical rows are considered equivalent.,no,,,,,, +RMLTC0012b-XML,Duplicate tuples generate same blank node,Tests that blank nodes with same identifier and in the same graph but generated by different logical rows are considered equivalent.,no,,,,,, +RMLTC0012b-MySQL,Duplicate tuples generate same blank node,Tests that blank nodes with same identifier and in the same graph but generated by different logical rows are considered equivalent.,no,,,,,, +RMLTC0012b-PostgreSQL,Duplicate tuples generate same blank node,Tests that blank nodes with same identifier and in the same graph but generated by different logical rows are considered equivalent.,no,,,,,, +RMLTC0012b-SQLServer,Duplicate tuples generate same blank node,Tests that blank nodes with same identifier and in the same graph but generated by different logical rows are considered equivalent.,no,,,,,, +RMLTC0012b-SPARQL,Duplicate triples generate same blank node,Tests that blank nodes with same identifier and in the same graph but generated by different logical rows are considered equivalent.,no,,,,,, +RMLTC0012c-CSV,TriplesMap without subjectMap,"Tests a RML with missing information, TriplesMap without subjectMap.",yes,,,,,, +RMLTC0012c-JSON,TriplesMap without subjectMap,"Tests a RML with missing information, TriplesMap without subjectMap.",yes,,,,,, +RMLTC0012c-XML,TriplesMap without subjectMap,"Tests a RML with missing information, TriplesMap without subjectMap.",yes,,,,,, +RMLTC0012c-MySQL,TriplesMap without subjectMap,"Tests a RML with missing information, TriplesMap without subjectMap.",yes,,,,,, +RMLTC0012c-PostgreSQL,TriplesMap without subjectMap,"Tests a RML with missing information, TriplesMap without subjectMap.",yes,,,,,, +RMLTC0012c-SQLServer,TriplesMap without subjectMap,"Tests a RML with missing information, TriplesMap without subjectMap.",yes,,,,,, +RMLTC0012d-CSV,TriplesMap with two subjectMap,"Tests a RML with wrong information, TriplesMap with two subjectMap.",yes,,,,,, +RMLTC0012d-JSON,TriplesMap with two subjectMap,"Tests a RML with wrong information, TriplesMap with two subjectMap.",yes,,,,,, +RMLTC0012d-XML,TriplesMap with two subjectMap,"Tests a RML with wrong information, TriplesMap with two subjectMap.",yes,,,,,, +RMLTC0012d-MySQL,TriplesMap with two subjectMap,"Tests a RML with wrong information, TriplesMap with two subjectMap.",yes,,,,,, +RMLTC0012d-PostgreSQL,TriplesMap with two subjectMap,"Tests a RML with wrong information, TriplesMap with two subjectMap.",yes,,,,,, +RMLTC0012d-SQLServer,TriplesMap with two subjectMap,"Tests a RML with wrong information, TriplesMap with two subjectMap.",yes,,,,,, +RMLTC0012e-MySQL,Default mapping,Tests the generation of a default mapping for tables without a primary key.,no,,,,,, +RMLTC0012e-PostgreSQL,Default mapping,Tests the generation of a default mapping for tables without a primary key.,no,,,,,, +RMLTC0012e-SQLServer,Default mapping,Tests the generation of a default mapping for tables without a primary key.,no,,,,,, +RMLTC0013a-JSON,Null value in JSON file,Tests if null values in JSON files are handled correctly.,no,,,,,, +RMLTC0013a-MySQL,Generation of empty triples from referenced columns that have null values,Tests the generation of empty triples from referenced columns that have null values,no,,,,,, +RMLTC0013a-PostgreSQL,Generation of empty triples from referenced columns that have null values,Tests the generation of empty triples from referenced columns that have null values,no,,,,,, +RMLTC0013a-SQLServer,Generation of empty triples from referenced columns that have null values,Tests the generation of empty triples from referenced columns that have null values,no,,,,,, +"Inverse expression can only be used for run-time optimizations, i.e., if you use it it will only affect performance, but not the resulting RDF. Therefore, I would suggest to skip those.",Subjectmap with rr:inverseExpression,Tests a rml:subjectMap with rr:inverseExpression,no,,,,,, +,Triplesmaps with rr:inverseExpression and rr:joinCondition,"Test two triplesmaps, one with a rr:inverseExpression and the other with a rr:joinCondition for foerign key relations",no,,,,,, +,"Triplesmaps with rr:inverseExpression, rr:joinCondition, and referencing object maps","Triplesmaps with rr:inverseExpression, rr:joinCondition, and referencing object maps",no,,,,,, +RMLTC0014d-MySQL,"three tables, one primary key, one foreign key",Test the translation of database type codes to IRIs,no,,,,,, +RMLTC0014d-PostgreSQL,"three tables, one primary key, one foreign key",Test the translation of database type codes to IRIs,no,,,,,, +RMLTC0014d-SQLServer,"three tables, one primary key, one foreign key",Test the translation of database type codes to IRIs,no,,,,,, +RMLTC0015a-CSV,Generation of language tags from a table with language information,Generation of language tags from a table with language information,no,,,,,, +RMLTC0015a-JSON,Generation of language tags from a table with language information,Generation of language tags from a table with language information,no,,,,,, +RMLTC0015a-XML,Generation of language tags from a table with language information,Generation of language tags from a table with language information,no,,,,,, +RMLTC0015a-MySQL,Generation of language tags from a table with language information,Generation of language tags from a table with language information,no,,,,,, +RMLTC0015a-PostgreSQL,Generation of language tags from a table with language information,Generation of language tags from a table with language information,no,,,,,, +RMLTC0015a-SQLServer,Generation of language tags from a table with language information,Generation of language tags from a table with language information,no,,,,,, +RMLTC0015b-CSV,"Generation of language tags from a table with language information, and a term map with invalid rml:language value","Tests a term map with an invalid rml:language value, which is an error",yes,,,,,, +RMLTC0015b-JSON,"Generation of language tags from a table with language information, and a term map with invalid rml:language value","Tests a term map with an invalid rml:language value, which is an error",yes,,,,,, +RMLTC0015b-XML,"Generation of language tags from a table with language information, and a term map with invalid rml:language value","Tests a term map with an invalid rml:language value, which is an error",yes,,,,,, +RMLTC0015b-MySQL,"Generation of language tags from a table with language information, and a term map with invalid rml:language value","Tests a term map with an invalid rml:language value, which is an error",yes,,,,,, +RMLTC0015b-PostgreSQL,"Generation of language tags from a table with language information, and a term map with invalid rml:language value","Tests a term map with an invalid rml:language value, which is an error",yes,,,,,, +RMLTC0015b-SQLServer,"Generation of language tags from a table with language information, and a term map with invalid rml:language value","Tests a term map with an invalid rml:language value, which is an error",yes,,,,,, +RMLTC0016a-MySQL,Table with datatypes: string and integer,Tests the rml:termType and datatype conversions: string and integer,no,,,,,, +RMLTC0016a-PostgreSQL,Table with datatypes: string and integer,Tests the rml:termType and datatype conversions: string and integer,no,,,,,, +RMLTC0016a-SQLServer,Table with datatypes: string and integer,Tests the rml:termType and datatype conversions: string and integer,no,,,,,, +RMLTC0016b-MySQL,Table with datatypes: real and float,Tests the rml:termType and datatype conversions: real and float,no,,,,,, +RMLTC0016b-PostgreSQL,Table with datatypes: real and float,Tests the rml:termType and datatype conversions: real and float,no,,,,,, +RMLTC0016b-SQLServer,Table with datatypes: real and float,Tests the rml:termType and datatype conversions: real and float,no,,,,,, +RMLTC0016c-MySQL,Table with datatypes: date and timestamp,Tests the rml:termType and datatype conversions: date and timestamp,no,,,,,, +RMLTC0016c-PostgreSQL,Table with datatypes: date and timestamp,Tests the rml:termType and datatype conversions: date and timestamp,no,,,,,, +RMLTC0016c-SQLServer,Table with datatypes: date and timestamp,Tests the rml:termType and datatype conversions: date and timestamp,no,,,,,, +RMLTC0016d-MySQL,"Table with datatypes, boolean conversions",Tests the rml:termType and datatype conversions: boolean,no,,,,,, +RMLTC0016d-PostgreSQL,"Table with datatypes, boolean conversions",Tests the rml:termType and datatype conversions: boolean,no,,,,,, +RMLTC0016d-SQLServer,"Table with datatypes, boolean conversions",Tests the rml:termType and datatype conversions: boolean,no,,,,,, +RMLTC0016e-MySQL,"Table with datatypes, binary column",Tests the rml:termType and datatype conversions: binary,no,,,,,, +RMLTC0016e-PostgreSQL,"Table with datatypes, binary column",Tests the rml:termType and datatype conversions: binary,no,,,,,, +RMLTC0016e-SQLServer,"Table with datatypes, binary column",Tests the rml:termType and datatype conversions: binary,no,,,,,, +RMLTC0018a-MySQL,Generation of triples by using CHAR datatype column,"Generation of triples by using CHAR datatype column, resulting RDF literal is space-padded.",no,,,,,, +RMLTC0018a-PostgreSQL,Generation of triples by using CHAR datatype column,"Generation of triples by using CHAR datatype column, resulting RDF literal is space-padded.",no,,,,,, +RMLTC0018a-SQLServer,Generation of triples by using CHAR datatype column,"Generation of triples by using CHAR datatype column, resulting RDF literal is space-padded.",no,,,,,, +RMLTC0019a-CSV,Generation of triples by using IRI value in columns,Test the generation of triples by using IRI value in columns,no,,,,,, +RMLTC0019a-JSON,Generation of triples by using IRI value in columns,Test the generation of triples by using IRI value in attributes,no,,,,,, +RMLTC0019a-XML,Generation of triples by using IRI value in columns,Test the generation of triples by using IRI value in elements,no,,,,,, +RMLTC0019a-MySQL,Generation of triples by using IRI value in columns,Test the generation of triples by using IRI value in columns,no,,,,,, +RMLTC0019a-PostgreSQL,Generation of triples by using IRI value in columns,Test the generation of triples by using IRI value in columns,no,,,,,, +RMLTC0019a-SQLServer,Generation of triples by using IRI value in columns,Test the generation of triples by using IRI value in columns,no,,,,,, +RMLTC0019b-CSV,"Generation of triples by using IRI value in columns, with data error","Test the generation of triples by using IRI value in columns, conforming RML mapping with data error (and limited results)",no,,,,,, +RMLTC0019b-JSON,"Generation of triples by using IRI value in columns, with data error","Test the generation of triples by using IRI value in attributes, conforming RML mapping with data error (and limited results)",no,,,,,, +RMLTC0019b-XML,"Generation of triples by using IRI value in columns, with data error","Test the generation of triples by using IRI value in elements, conforming RML mapping with data error (and limited results)",no,,,,,, +RMLTC0019b-MySQL,"Generation of triples by using IRI value in columns, with data error","Test the generation of triples by using IRI value in columns, conforming RML mapping with data error (and limited results)",no,,,,,, +RMLTC0019b-PostgreSQL,"Generation of triples by using IRI value in columns, with data error","Test the generation of triples by using IRI value in columns, conforming RML mapping with data error (and limited results)",no,,,,,, +RMLTC0019b-SQLServer,"Generation of triples by using IRI value in columns, with data error","Test the generation of triples by using IRI value in columns, conforming RML mapping with data error (and limited results)",no,,,,,, +RMLTC0020a-CSV,Generation of triples by using IRI value in columns,Test the generation of triples by using IRI value in columns,no,,,,,, +RMLTC0020a-JSON,Generation of triples by using IRI value in columns,Test the generation of triples by using IRI value in attributes,no,,,,,, +RMLTC0020a-XML,Generation of triples by using IRI value in columns,Test the generation of triples by using IRI value in elements,no,,,,,, +RMLTC0020a-MySQL,Generation of triples by using IRI value in columns,Test the generation of triples by using IRI value in columns,no,,,,,, +RMLTC0020a-PostgreSQL,Generation of triples by using IRI value in columns,Test the generation of triples by using IRI value in columns,no,,,,,, +RMLTC0020a-SQLServer,Generation of triples by using IRI value in columns,Test the generation of triples by using IRI value in columns,no,,,,,, +RMLTC0020b-CSV,"Generation of triples by using IRI value in columns, with data errors","Test the generation of triples by using IRI value in columns, conforming R2RML mapping with data error (and no result)",no,,,,,, +RMLTC0020b-JSON,"Generation of triples by using IRI value in columns, with data errors","Test the generation of triples by using IRI value in columns, conforming R2RML mapping with data error (and no result)",no,,,,,, +RMLTC0020b-XML,"Generation of triples by using IRI value in columns, with data errors","Test the generation of triples by using IRI value in columns, conforming R2RML mapping with data error (and no result)",no,,,,,, +RMLTC0020b-MySQL,"Generation of triples by using IRI value in columns, with data errors","Test the generation of triples by using IRI value in columns, conforming R2RML mapping with data error (and no result)",no,,,,,, +RMLTC0020b-PostgreSQL,"Generation of triples by using IRI value in columns, with data errors","Test the generation of triples by using IRI value in columns, conforming R2RML mapping with data error (and no result)",no,,,,,, +RMLTC0020b-SQLServer,"Generation of triples by using IRI value in columns, with data errors","Test the generation of triples by using IRI value in columns, conforming R2RML mapping with data error (and no result)",no,,,,,, +RMLTC0021a-CSV,Generation of triples referencing object map,Tests the mapping specification referencing object map with same logical source and join condition,no,,,,,, +RMLTC0021a-JSON,Generation of triples referencing object map,Tests the mapping specification referencing object map with same logical source and join condition,no,,,,,, +RMLTC0021a-XML,Generation of triples referencing object map,Tests the mapping specification referencing object map with same logical source and join condition,no,,,,,, +RMLTC0021a-MySQL,Generation of triples referencing object map,Tests the mapping specification referencing object map with same logical source and join condition,no,,,,,, +RMLTC0021a-PostgreSQL,Generation of triples referencing object map,Tests the mapping specification referencing object map with same logical source and join condition,no,,,,,, +RMLTC0021a-SQLServer,Generation of triples referencing object map,Tests the mapping specification referencing object map with same logical source and join condition,no,,,,,, +RMLTC0021a-SPARQL,Generation of triples referencing object map,Tests the mapping specification referencing object map with same logical source and join condition,no,,,,,, +RMLTC0012d-MySQL,TriplesMap with two subjectMap,"Tests a RML with wrong information, TriplesMap with two subjectMap.",yes,,,,,, +RMLTC0012d-PostgreSQL,TriplesMap with two subjectMap,"Tests a RML with wrong information, TriplesMap with two subjectMap.",yes,,,,,, +RMLTC0012d-SQLServer,TriplesMap with two subjectMap,"Tests a RML with wrong information, TriplesMap with two subjectMap.",yes,,,,,, +RMLTC0012e-MySQL,Default mapping,Tests the generation of a default mapping for tables without a primary key.,no,,,,,, +RMLTC0012e-PostgreSQL,Default mapping,Tests the generation of a default mapping for tables without a primary key.,no,,,,,, +RMLTC0012e-SQLServer,Default mapping,Tests the generation of a default mapping for tables without a primary key.,no,,,,,, +RMLTC0013a-MySQL,Generation of empty triples from referenced columns that have null values,Tests the generation of empty triples from referenced columns that have null values,no,,,,,, +RMLTC0013a-PostgreSQL,Generation of empty triples from referenced columns that have null values,Tests the generation of empty triples from referenced columns that have null values,no,,,,,, +RMLTC0013a-SQLServer,Generation of empty triples from referenced columns that have null values,Tests the generation of empty triples from referenced columns that have null values,no,,,,,, +"Inverse expression can only be used for run-time optimizations, i.e., if you use it it will only affect performance, but not the resulting RDF. Therefore, I would suggest to skip those.",Subjectmap with rr:inverseExpression,Tests a rml:subjectMap with rr:inverseExpression,no,,,,,, +,Triplesmaps with rr:inverseExpression and rr:joinCondition,"Test two triplesmaps, one with a rr:inverseExpression and the other with a rr:joinCondition for foerign key relations",no,,,,,, +,"Triplesmaps with rr:inverseExpression, rr:joinCondition, and referencing object maps","Triplesmaps with rr:inverseExpression, rr:joinCondition, and referencing object maps",no,,,,,, +RMLTC0014d-MySQL,"three tables, one primary key, one foreign key",Test the translation of database type codes to IRIs,no,,,,,, +RMLTC0014d-PostgreSQL,"three tables, one primary key, one foreign key",Test the translation of database type codes to IRIs,no,,,,,, +RMLTC0014d-SQLServer,"three tables, one primary key, one foreign key",Test the translation of database type codes to IRIs,no,,,,,, +RMLTC0015a-CSV,Generation of language tags from a table with language information,Generation of language tags from a table with language information,no,,,,,, +RMLTC0015a-XML,Generation of language tags from a table with language information,Generation of language tags from a table with language information,no,,,,,, +RMLTC0015a-MySQL,Generation of language tags from a table with language information,Generation of language tags from a table with language information,no,,,,,, +RMLTC0015a-PostgreSQL,Generation of language tags from a table with language information,Generation of language tags from a table with language information,no,,,,,, +RMLTC0015a-SQLServer,Generation of language tags from a table with language information,Generation of language tags from a table with language information,no,,,,,, +RMLTC0015b-CSV,"Generation of language tags from a table with language information, and a term map with invalid rml:language value","Tests a term map with an invalid rml:language value, which is an error",yes,,,,,, +RMLTC0015b-XML,"Generation of language tags from a table with language information, and a term map with invalid rml:language value","Tests a term map with an invalid rml:language value, which is an error",yes,,,,,, +RMLTC0015b-MySQL,"Generation of language tags from a table with language information, and a term map with invalid rml:language value","Tests a term map with an invalid rml:language value, which is an error",yes,,,,,, +RMLTC0015b-PostgreSQL,"Generation of language tags from a table with language information, and a term map with invalid rml:language value","Tests a term map with an invalid rml:language value, which is an error",yes,,,,,, +RMLTC0015b-SQLServer,"Generation of language tags from a table with language information, and a term map with invalid rml:language value","Tests a term map with an invalid rml:language value, which is an error",yes,,,,,, +RMLTC0016a-MySQL,Table with datatypes: string and integer,Tests the rml:termType and datatype conversions: string and integer,no,,,,,, +RMLTC0016a-PostgreSQL,Table with datatypes: string and integer,Tests the rml:termType and datatype conversions: string and integer,no,,,,,, +RMLTC0016a-SQLServer,Table with datatypes: string and integer,Tests the rml:termType and datatype conversions: string and integer,no,,,,,, +RMLTC0016b-MySQL,Table with datatypes: real and float,Tests the rml:termType and datatype conversions: real and float,no,,,,,, +RMLTC0016b-PostgreSQL,Table with datatypes: real and float,Tests the rml:termType and datatype conversions: real and float,no,,,,,, +RMLTC0016b-SQLServer,Table with datatypes: real and float,Tests the rml:termType and datatype conversions: real and float,no,,,,,, +RMLTC0016c-MySQL,Table with datatypes: date and timestamp,Tests the rml:termType and datatype conversions: date and timestamp,no,,,,,, +RMLTC0016c-PostgreSQL,Table with datatypes: date and timestamp,Tests the rml:termType and datatype conversions: date and timestamp,no,,,,,, +RMLTC0016c-SQLServer,Table with datatypes: date and timestamp,Tests the rml:termType and datatype conversions: date and timestamp,no,,,,,, +RMLTC0016d-MySQL,"Table with datatypes, boolean conversions",Tests the rml:termType and datatype conversions: boolean,no,,,,,, +RMLTC0016d-PostgreSQL,"Table with datatypes, boolean conversions",Tests the rml:termType and datatype conversions: boolean,no,,,,,, +RMLTC0016d-SQLServer,"Table with datatypes, boolean conversions",Tests the rml:termType and datatype conversions: boolean,no,,,,,, +RMLTC0016e-MySQL,"Table with datatypes, binary column",Tests the rml:termType and datatype conversions: binary,no,,,,,, +RMLTC0016e-PostgreSQL,"Table with datatypes, binary column",Tests the rml:termType and datatype conversions: binary,no,,,,,, +RMLTC0016e-SQLServer,"Table with datatypes, binary column",Tests the rml:termType and datatype conversions: binary,no,,,,,, +RMLTC0018a-MySQL,Generation of triples by using CHAR datatype column,"Generation of triples by using CHAR datatype column, resulting RDF literal is space-padded.",no,,,,,, +RMLTC0018a-PostgreSQL,Generation of triples by using CHAR datatype column,"Generation of triples by using CHAR datatype column, resulting RDF literal is space-padded.",no,,,,,, +RMLTC0018a-SQLServer,Generation of triples by using CHAR datatype column,"Generation of triples by using CHAR datatype column, resulting RDF literal is space-padded.",no,,,,,, +RMLTC0019a-CSV,Generation of triples by using IRI value in columns,Test the generation of triples by using IRI value in columns,no,,,,,, +RMLTC0019a-XML,Generation of triples by using IRI value in columns,Test the generation of triples by using IRI value in elements,no,,,,,, +RMLTC0019a-MySQL,Generation of triples by using IRI value in columns,Test the generation of triples by using IRI value in columns,no,,,,,, +RMLTC0019a-PostgreSQL,Generation of triples by using IRI value in columns,Test the generation of triples by using IRI value in columns,no,,,,,, +RMLTC0019a-SQLServer,Generation of triples by using IRI value in columns,Test the generation of triples by using IRI value in columns,no,,,,,, +RMLTC0019b-CSV,"Generation of triples by using IRI value in columns, with data error","Test the generation of triples by using IRI value in columns, conforming RML mapping with data error (and limited results)",no,,,,,, +RMLTC0019b-XML,"Generation of triples by using IRI value in columns, with data error","Test the generation of triples by using IRI value in elements, conforming RML mapping with data error (and limited results)",no,,,,,, +RMLTC0019b-MySQL,"Generation of triples by using IRI value in columns, with data error","Test the generation of triples by using IRI value in columns, conforming RML mapping with data error (and limited results)",no,,,,,, +RMLTC0019b-PostgreSQL,"Generation of triples by using IRI value in columns, with data error","Test the generation of triples by using IRI value in columns, conforming RML mapping with data error (and limited results)",no,,,,,, +RMLTC0019b-SQLServer,"Generation of triples by using IRI value in columns, with data error","Test the generation of triples by using IRI value in columns, conforming RML mapping with data error (and limited results)",no,,,,,, +RMLTC0020a-CSV,Generation of triples by using IRI value in columns,Test the generation of triples by using IRI value in columns,no,,,,,, +RMLTC0020a-XML,Generation of triples by using IRI value in columns,Test the generation of triples by using IRI value in elements,no,,,,,, +RMLTC0020a-MySQL,Generation of triples by using IRI value in columns,Test the generation of triples by using IRI value in columns,no,,,,,, +RMLTC0020a-PostgreSQL,Generation of triples by using IRI value in columns,Test the generation of triples by using IRI value in columns,no,,,,,, +RMLTC0020a-SQLServer,Generation of triples by using IRI value in columns,Test the generation of triples by using IRI value in columns,no,,,,,, +RMLTC0020b-CSV,"Generation of triples by using IRI value in columns, with data errors","Test the generation of triples by using IRI value in columns, conforming R2RML mapping with data error (and no result)",no,,,,,, +RMLTC0020b-XML,"Generation of triples by using IRI value in columns, with data errors","Test the generation of triples by using IRI value in columns, conforming R2RML mapping with data error (and no result)",no,,,,,, +RMLTC0020b-MySQL,"Generation of triples by using IRI value in columns, with data errors","Test the generation of triples by using IRI value in columns, conforming R2RML mapping with data error (and no result)",no,,,,,, +RMLTC0020b-PostgreSQL,"Generation of triples by using IRI value in columns, with data errors","Test the generation of triples by using IRI value in columns, conforming R2RML mapping with data error (and no result)",no,,,,,, +RMLTC0020b-SQLServer,"Generation of triples by using IRI value in columns, with data errors","Test the generation of triples by using IRI value in columns, conforming R2RML mapping with data error (and no result)",no,,,,,, +RMLTC0021a-CSV,Generation of triples referencing object map,Tests the mapping specification referencing object map with same logical source and join condition,no,,,,,, +RMLTC0021a-XML,Generation of triples referencing object map,Tests the mapping specification referencing object map with same logical source and join condition,no,,,,,, +RMLTC0021a-MySQL,Generation of triples referencing object map,Tests the mapping specification referencing object map with same logical source and join condition,no,,,,,, +RMLTC0021a-PostgreSQL,Generation of triples referencing object map,Tests the mapping specification referencing object map with same logical source and join condition,no,,,,,, +RMLTC0021a-SQLServer,Generation of triples referencing object map,Tests the mapping specification referencing object map with same logical source and join condition,no,,,,,, +RMLTC0021a-SPARQL,Generation of triples referencing object map,Tests the mapping specification referencing object map with same logical source and join condition,no,,,,,, +RMLTC0022a-JSON,Generating of triples with constant datatype,Test triples with a fixed constant datatype,no,,,,,, +RMLTC0022b-JSON,Generating of triples with datatypeMap,Test triples with a XSD datatype generated from the data,no,,,,,, +RMLTC0022c-JSON,Generating of triples with datatypeMap with custom datatype,Test triples with a custom datype from the data,no,,,,,, +RMLTC0023a-JSON,Invalid IRI template 1,Test handling of invalid IRI template,yes,,,,,, +RMLTC0023b-JSON,Invalid IRI template 2,Test handling of invalid IRI template,yes,,,,,, +RMLTC0023c-JSON,Invalid IRI template 3,Test handling of invalid IRI template,yes,,,,,, +RMLTC0023d-JSON,Invalid IRI template 4,Test handling of invalid IRI template,yes,,,,,, +RMLTC0023e-JSON,Invalid IRI template 5,Test handling of invalid IRI template,yes,,,,,, +RMLTC0023f-JSON,Invalid IRI template 6,Test handling of invalid IRI template,yes,,,,,, +RMLTC0023g-JSON,Valid IRI template with backslash-escape,no,,,,,, +RMLTC0025b-JSON,Usage of constant term maps in combination with explicitly defined term types,Tests the usage of constant term maps in combination with explicitly defined term types,yes,,,,,, +RMLTC0026a-JSON,Generation of triples from arrays,Tests the generation of triples from array input data structures,no,,,,,, +RMLTC0026b-JSON,Generation of triples from arrays with wrong reference,Tests the generation of triples from array input data structures. Test should fail as reference points to the array and not the values of the array,yes,,,,,, +RMLTC0027a-JSON,"Two triples maps, one with rml:baseIRI and one without and generating absolute IRIs",Tests the generation of triples from relative IRIs using base IRI,no,,,,,, +RMLTC0027b-JSON,"Two triples maps, one with rml:baseIRI one one without and generating relative IRIs using baseIRI parameter",Tests the generation of triples from relative IRI using base IRI parameter,no,,,,,, +RMLTC0027c-JSON,"Two triples maps, both with rml:baseIRI defined","Tests the generation of triples using relative IRIs with base IRIs defined only in triples maps, without base IRI parameter",no,,,,,, +RMLTC0027d-JSON,"Two triples maps,both with rml:bseIRI defined and baseIRI parameter defined",Tests the generation of triples by with base IRIs different than the base IRI parameter,no,,,,,, +RMLTC0028a-JSON,Generation of triples using the URI term type,Tests the generation of triples with a URI term type in the subject or object,no,,,,,, +RMLTC0028b-JSON,Generation of triples using the UnsafeURI term type,Tests the generation of triples with a UnsafeURI term type in the subject or object,no,,,,,, +RMLTC0028c-JSON,Generation of triples using the UnsafeIRI term type,Tests the generation of triples with a UnsafeIRI term type in the subject or object,no,,,,,, +RMLTC0029a-JSON,Generation of the right datatype for a constant in the mapping,Test the honoring of the datatype specified by the constant term in the mapping,no,,,,,, +RMLTC0029b-JSON,Generation of all named graphs when rml:defaultGraph is involved,Test if the default graph is also generated correctly.,no,,,,,, +RMLTC0029c-JSON,Generation of the right language tag for a constant in the mapping,Test the honoring of the language tag specified by the constant term in the mapping,no,,,,,, \ No newline at end of file diff --git a/src/test/resources/rml-core/dev.html b/src/test/resources/rml-core/dev.html new file mode 100644 index 00000000..a36285bc --- /dev/null +++ b/src/test/resources/rml-core/dev.html @@ -0,0 +1,163 @@ + + + + + RML-Core: Test Cases + + + + + + + + + + +
+ +
+ +
+ +
+ +
+ + +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ + + + diff --git a/src/test/resources/rml-core/docs/20250130/index.html b/src/test/resources/rml-core/docs/20250130/index.html new file mode 100644 index 00000000..8c6f0c29 --- /dev/null +++ b/src/test/resources/rml-core/docs/20250130/index.html @@ -0,0 +1,19356 @@ + + + + + + +RML-Core: Test Cases + + + + + + + + + + + + + + +
+ +

RML-Core: Test Cases

+

+ Draft Community Group Report + +

+
+ +
Latest published version:
+ https://www.w3.org/RML-Core-Testcases/ +
+
Latest editor's draft:
https://w3id.org/rml/core/test-cases/
+ + + + +
Editor:
+ Dylan Van Assche + + + + (IDLab – Ghent University – imec) +
+ +
Author:
+ Dylan Van Assche + + + + (IDLab – Ghent University – imec) +
+
Feedback:
+ GitHub kg-construct/rml-core + (pull requests, + new issue, + open issues) +
+ +
+ + +
+
+ + + +

Abstract

This document defines the RML-Core test cases to the determine the RML-Core specification conformance of tools.

+
+ +

Status of This Document

+ This specification was published by the + Knowledge Graph Construction Community Group. It is not a W3C Standard nor is it + on the W3C Standards Track. + + Please note that under the + W3C Community Contributor License Agreement (CLA) + there is a limited opt-out and other conditions apply. + + Learn more about + W3C Community and Business Groups. +

+ GitHub Issues are preferred for + discussion of this specification. + + +

+ +

1. Introduction

+

This document defines the RML-Core test cases, consisting of a collection of test case documents (input and expected output). +The purpose of the test cases is to determine the conformance of tools that execute RML rules to the RML-Core specification.

+
+ +

2. Data model

+

The test cases are semantically described for re-usability and shareability following the W3C Test case description. +Each test:Testcase as the following properties:

+
    +
  • dcterms:identifier: unique ID of the test case.
  • +
  • rmltest:hasError: if an error of the RML Processor is expected or not.
  • +
  • rmltest:input: One or more input data of the test case.
  • +
  • rmltest:output: One or more output data of the test case.
  • +
  • rmltest:inputFormat: the input data format.
  • +
  • rmltest:outputFormat: the output data format.
  • +
  • rmltest:mappingDocument: the RML mapping rules in Turtle.
  • +
+
+ +

3. Test cases

+

This section describes the RML-Core test cases. These descriptions are also available as RDF. +The files are available on GitHub in the folder test-cases. +Each test case is contained in a single folder, containing three types of files:

+
    +
  • Zero or more files containing the data sources, in the case of JSON, XML, CSV, or containing the SQL statements to create the necessary tables, in the case of MySQL, PostgreSQL, and SQL Server.
  • +
  • One file with the RML rules, called mapping.ttl, in the Turtle format.
  • +
  • Zero or more files with the expected RDF. No file is provided if an error is expected that must halt the generation of the RDF because of an error.
  • +
+
+ + +

4. RMLTC0000-CSV

+

Title: "one table, one column, zero rows"

+

Description: "Tests if an empty table produces an empty RDF graph"

+

Error expected? No

+

Input

+
Name
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:referenceFormulation rml:CSV;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.csv"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "Name"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{Name}"
+    ] .
+
+

Output

+
# empty database
+
+
+

5. RMLTC0000-JSON

+

Title: "one table, one column, zero rows"

+

Description: "Tests if an empty table produces an empty RDF graph"

+

Error expected? No

+

Input

+
{
+  "students": []
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.Name"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{$.Name}"
+    ] .
+
+

Output

+
# empty database
+
+
+

6. RMLTC0000-MySQL

+

Title: "one table, one column, zero rows"

+

Description: "Tests if an empty table produces an empty RDF graph"

+

Error expected? No

+

Input

+
USE test;
+DROP TABLE IF EXISTS test.student;
+CREATE TABLE student (
+  Name VARCHAR(50)
+);
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "student"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "Name"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{Name}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
+  d2rq:password "";
+  d2rq:username "root" .
+
+

Output

+
# empty database
+
+
+

7. RMLTC0000-PostgreSQL

+

Title: "one table, one column, zero rows"

+

Description: "Tests if an empty table produces an empty RDF graph"

+

Error expected? No

+

Input

+
DROP TABLE IF EXISTS student CASCADE ;
+CREATE TABLE student (
+  "Name" VARCHAR(50)
+);
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "student"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "Name"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{Name}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "org.postgresql.Driver";
+  d2rq:password "";
+  d2rq:username "postgres" .
+
+

Output

+
# empty database
+
+
+

8. RMLTC0000-SPARQL

+

Title: "Empty dataset"

+

Description: "Test if an empty dataset produces an empty RDF graph"

+

Error expected? No

+

Input

+

+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix sd: <http://www.w3.org/ns/sparql-service-description#> .
+
+<http://example.com/base#Country> rml:logicalSource [
+      rml:iterator """
+            PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
+            SELECT ?name
+            WHERE {
+                ?name a rdfs:Literal .
+            } """;
+      rml:referenceFormulation formats:SPARQL_Results_JSON;
+      rml:source <http://example.com/base#InputSPARQL>
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "name.value"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{name.value}"
+    ] .
+
+<http://example.com/base#InputSPARQL> a sd:Service;
+  sd:endpoint <http://HOST:PORT/ds1/sparql>;
+  sd:supportedLanguage sd:SPARQL11Query .
+
+

Output

+

+
+
+

9. RMLTC0000-SQLServer

+

Title: "one table, one column, zero rows"

+

Description: "Tests if an empty table produces an empty RDF graph"

+

Error expected? No

+

Input

+
USE TestDB;
+EXEC sp_msforeachtable 'ALTER TABLE ? NOCHECK CONSTRAINT all'
+EXEC sp_msforeachtable 'DROP TABLE ?'
+
+CREATE TABLE student (
+  "Name" VARCHAR(50)
+);
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "student"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "Name"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{Name}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
+  d2rq:password "YourSTRONG!Passw0rd;";
+  d2rq:username "sa" .
+
+

Output

+
# empty database
+
+
+

10. RMLTC0000-XML

+

Title: "one table, one column, zero rows"

+

Description: "Tests if an empty table produces an empty RDF graph"

+

Error expected? No

+

Input

+
<?xml version="1.0"?>
+
+<students>
+
+</students>
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "/students/student";
+      rml:referenceFormulation rml:XPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.xml"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "Name"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{Name}"
+    ] .
+
+

Output

+
# empty database
+
+
+

11. RMLTC0001a-CSV

+

Title: "One column mapping, subject URI generation by using rr:template"

+

Description: "Tests: (1) one column mapping; (2) subject URI generation by using rr:tmplate; (3) one column to one property"

+

Error expected? No

+

Input

+
Name
+Venus
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:referenceFormulation rml:CSV;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.csv"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "Name"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{Name}"
+    ] .
+
+

Output

+
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
+
+
+
+

12. RMLTC0001a-JSON

+

Title: "One column mapping, subject URI generation by using rr:template"

+

Description: "Tests: (1) one column mapping; (2) subject URI generation by using rr:tmplate; (3) one column to one property"

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "Name":"Venus"
+  }]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.Name"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap <http://example.com/base/#NameSubjectMap> .
+
+<http://example.com/base/#NameSubjectMap> rml:template "http://example.com/{$.Name}" .
+
+

Output

+
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
+
+
+
+

13. RMLTC0001a-MySQL

+

Title: "One column mapping, subject URI generation by using rr:template"

+

Description: "Tests: (1) one column mapping; (2) subject URI generation by using rr:tmplate; (3) one column to one property"

+

Error expected? No

+

Input

+
USE test;
+DROP TABLE IF EXISTS test.student;
+CREATE TABLE student (
+  Name VARCHAR(50)
+);
+INSERT INTO student values ('Venus');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "student"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "Name"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{Name}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
+  d2rq:password "";
+  d2rq:username "root" .
+
+

Output

+
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
+
+
+

14. RMLTC0001a-PostgreSQL

+

Title: "One column mapping, subject URI generation by using rr:template"

+

Description: "Tests: (1) one column mapping; (2) subject URI generation by using rr:tmplate; (3) one column to one property"

+

Error expected? No

+

Input

+
DROP TABLE IF EXISTS student CASCADE ;
+CREATE TABLE student (
+  "Name" VARCHAR(50)
+);
+INSERT INTO student values ('Venus');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "student"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "Name"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{Name}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "org.postgresql.Driver";
+  d2rq:password "";
+  d2rq:username "postgres" .
+
+

Output

+
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
+
+
+

15. RMLTC0001a-SPARQL

+

Title: "One tripple mapping, subject URI generation by using rr:template"

+

Description: "Tests: (1) one tripple mapping; (2) generation of a BlankNode subject by using rr:termType; (3) one tripple to one property"

+

Error expected? No

+

Input

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+
+[] foaf:name "Venus" .
+
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix sd: <http://www.w3.org/ns/sparql-service-description#> .
+
+<http://example.com/base#Country> rml:logicalSource [
+      rml:iterator """
+            PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
+            PREFIX foaf: <http://xmlns.com/foaf/0.1/>
+            SELECT ?name
+            WHERE {
+                ?x foaf:name ?name .
+            } """;
+      rml:referenceFormulation formats:SPARQL_Results_JSON;
+      rml:source <http://example.com/base#InputSPARQL>
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "name.value"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{name.value}"
+    ] .
+
+<http://example.com/base#InputSPARQL> a sd:Service;
+  sd:endpoint <http://HOST:PORT/ds1/sparql>;
+  sd:supportedLanguage sd:SPARQL11Query .
+
+

Output

+
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
+
+
+

16. RMLTC0001a-SQLServer

+

Title: "One column mapping, subject URI generation by using rr:template"

+

Description: "Tests: (1) one column mapping; (2) subject URI generation by using rr:tmplate; (3) one column to one property"

+

Error expected? No

+

Input

+
USE TestDB;
+EXEC sp_msforeachtable 'ALTER TABLE ? NOCHECK CONSTRAINT all'
+EXEC sp_msforeachtable 'DROP TABLE ?'
+
+CREATE TABLE student (
+  "Name" VARCHAR(50)
+);
+INSERT INTO student values ('Venus');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "student"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "Name"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{Name}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
+  d2rq:password "YourSTRONG!Passw0rd;";
+  d2rq:username "sa" .
+
+

Output

+
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
+
+
+

17. RMLTC0001a-XML

+

Title: "One column mapping, subject URI generation by using rr:template"

+

Description: "Tests: (1) one column mapping; (2) subject URI generation by using rr:tmplate; (3) one column to one property"

+

Error expected? No

+

Input

+
<?xml version="1.0"?>
+
+<students>
+  <student>
+    <Name>Venus</Name>
+  </student>
+</students>
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "/students/student";
+      rml:referenceFormulation rml:XPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.xml"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "Name"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{Name}"
+    ] .
+
+

Output

+
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
+
+
+
+

18. RMLTC0001b-CSV

+

Title: "One column mapping, generation of a BlankNode subject by using rr:termType"

+

Description: "Tests: (1) one column mapping; (2) generation of a BlankNode subject by using rr:termType; (3) one column to one property"

+

Error expected? No

+

Input

+
Name
+Venus
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:referenceFormulation rml:CSV;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.csv"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "Name"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "{Name}";
+      rml:termType rml:BlankNode
+    ] .
+
+

Output

+
_:Venus <http://xmlns.com/foaf/0.1/name> "Venus" .
+
+
+
+

19. RMLTC0001b-JSON

+

Title: "One column mapping, generation of a BlankNode subject by using rr:termType"

+

Description: "Tests: (1) one column mapping; (2) generation of a BlankNode subject by using rr:termType; (3) one column to one property"

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "Name":"Venus"
+  }]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.Name"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "{$.Name}";
+      rml:termType rml:BlankNode
+    ] .
+
+

Output

+
_:Venus <http://xmlns.com/foaf/0.1/name> "Venus" .
+
+
+
+

20. RMLTC0001b-MySQL

+

Title: "One column mapping, generation of a BlankNode subject by using rr:termType"

+

Description: "Tests: (1) one column mapping; (2) generation of a BlankNode subject by using rr:termType; (3) one column to one property"

+

Error expected? No

+

Input

+
USE test;
+DROP TABLE IF EXISTS test.student;
+CREATE TABLE student (
+  Name VARCHAR(50)
+);
+INSERT INTO student values ('Venus');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "SELECT Name FROM student";
+      rml:referenceFormulation rml:SQL2008Query;
+      rml:source <http://example.com/base/#DB_source>
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "Name"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{Name}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
+  d2rq:password "";
+  d2rq:username "root" .
+
+

Output

+
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
+
+
+

21. RMLTC0001b-PostgreSQL

+

Title: "One column mapping, generation of a BlankNode subject by using rr:termType"

+

Description: "Tests: (1) one column mapping; (2) generation of a BlankNode subject by using rr:termType; (3) one column to one property"

+

Error expected? No

+

Input

+
DROP TABLE IF EXISTS student CASCADE ;
+CREATE TABLE student (
+  name VARCHAR(50)
+);
+INSERT INTO student values ('Venus');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "SELECT Name FROM student";
+      rml:referenceFormulation rml:SQL2008Query;
+      rml:source <http://example.com/base/#DB_source>
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "name"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{name}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "org.postgresql.Driver";
+  d2rq:password "";
+  d2rq:username "postgres" .
+
+

Output

+
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
+
+
+

22. RMLTC0001b-SPARQL

+

Title: "One tripple mapping, generation of a BlankNode subject by using rr:termType"

+

Description: "Tests: (1) one tripple mapping; (2) generation of a BlankNode subject by using rr:termType; (3) one tripple to one property"

+

Error expected? No

+

Input

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+
+[] foaf:name "Venus" .
+
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix sd: <http://www.w3.org/ns/sparql-service-description#> .
+
+<http://example.com/base#Country> rml:logicalSource [
+      rml:iterator """
+            PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
+            PREFIX foaf: <http://xmlns.com/foaf/0.1/>
+            SELECT ?name
+            WHERE {
+                ?x foaf:name ?name .
+            } """;
+      rml:referenceFormulation formats:SPARQL_Results_JSON;
+      rml:source <http://example.com/base#InputSPARQL>
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "name.value"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{name.value}"
+    ] .
+
+<http://example.com/base#InputSPARQL> a sd:Service;
+  sd:endpoint <http://HOST:PORT/ds1/sparql>;
+  sd:supportedLanguage sd:SPARQL11Query .
+
+

Output

+
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
+
+
+

23. RMLTC0001b-SQLServer

+

Title: "One column mapping, generation of a BlankNode subject by using rr:termType"

+

Description: "Tests: (1) one column mapping; (2) generation of a BlankNode subject by using rr:termType; (3) one column to one property"

+

Error expected? No

+

Input

+
USE TestDB;
+EXEC sp_msforeachtable 'ALTER TABLE ? NOCHECK CONSTRAINT all'
+EXEC sp_msforeachtable 'DROP TABLE ?'
+
+CREATE TABLE student (
+  "Name" VARCHAR(50)
+);
+INSERT INTO student values ('Venus');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "SELECT Name FROM student";
+      rml:referenceFormulation rml:SQL2008Query;
+      rml:source <http://example.com/base/#DB_source>
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "Name"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{Name}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
+  d2rq:password "YourSTRONG!Passw0rd;";
+  d2rq:username "sa" .
+
+

Output

+
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
+
+
+

24. RMLTC0001b-XML

+

Title: "One column mapping, generation of a BlankNode subject by using rr:termType"

+

Description: "Tests: (1) one column mapping; (2) generation of a BlankNode subject by using rr:termType; (3) one column to one property"

+

Error expected? No

+

Input

+
<?xml version="1.0"?>
+
+<students>
+  <student>
+    <Name>Venus</Name>
+  </student>
+</students>
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "/students/student";
+      rml:referenceFormulation rml:XPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.xml"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "Name"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "{Name}";
+      rml:termType rml:BlankNode
+    ] .
+
+

Output

+
_:Venus <http://xmlns.com/foaf/0.1/name> "Venus" .
+
+
+
+

25. RMLTC0002a-CSV

+

Title: "Two columns mapping, generation of a subject URI by the concatenation of two column values"

+

Description: "Tests: (1) two column mapping, no primary key; (2) subject URI generated by the concatenation of two column values; (3) one column to one property"

+

Error expected? No

+

Input

+
ID,Name
+10,Venus
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:referenceFormulation rml:CSV;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.csv"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "ID"
+        ];
+      rml:predicate ex:id
+    ], [
+      rml:objectMap [
+          rml:reference "Name"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:class foaf:Person;
+      rml:template "http://example.com/{ID}/{Name}"
+    ] .
+
+

Output

+
<http://example.com/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
+<http://example.com/10/Venus> <http://example.com/id> "10" .
+<http://example.com/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+
+
+
+

26. RMLTC0002a-JSON

+

Title: "Two columns mapping, generation of a subject URI by the concatenation of two column values"

+

Description: "Tests: (1) two column mapping, no primary key; (2) subject URI generated by the concatenation of two column values; (3) one column to one property"

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "Name":"Venus"
+  }]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.ID"
+        ];
+      rml:predicate ex:id
+    ], [
+      rml:objectMap [
+          rml:reference "$.Name"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:class foaf:Person;
+      rml:template "http://example.com/{$.ID}/{$.Name}"
+    ] .
+
+

Output

+
<http://example.com/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
+<http://example.com/10/Venus> <http://example.com/id> "10" .
+<http://example.com/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+
+
+
+

27. RMLTC0002a-MySQL

+

Title: "Two columns mapping, generation of a subject URI by the concatenation of two column values"

+

Description: "Tests: (1) two column mapping, no primary key; (2) subject URI generated by the concatenation of two column values; (3) one column to one property"

+

Error expected? No

+

Input

+
USE test;
+DROP TABLE IF EXISTS test.student;
+CREATE TABLE student (
+  ID INTEGER,
+  Name VARCHAR(50)
+);
+INSERT INTO student values ('10', 'Venus');
+
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:source <http://example.com/base/#DB_source>;
+      rml:iterator "student"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "ID"
+        ];
+      rml:predicate ex:id
+    ], [
+      rml:objectMap [
+          rml:reference "Name"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:class foaf:Person;
+      rml:template "http://example.com/{ID}/{Name}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
+  d2rq:password "";
+  d2rq:username "root" .
+
+

Output

+
<http://example.com/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
+<http://example.com/10/Venus> <http://example.com/id> "10"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.com/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+
+
+

28. RMLTC0002a-PostgreSQL

+

Title: "Two columns mapping, generation of a subject URI by the concatenation of two column values"

+

Description: "Tests: (1) two column mapping, no primary key; (2) subject URI generated by the concatenation of two column values; (3) one column to one property"

+

Error expected? No

+

Input

+
DROP TABLE IF EXISTS student CASCADE ;
+CREATE TABLE student (
+  "ID" INTEGER,
+  "Name" VARCHAR(50)
+);
+INSERT INTO student values ('10', 'Venus');
+
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:source <http://example.com/base/#DB_source>;
+      rml:iterator "student"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "ID"
+        ];
+      rml:predicate ex:id
+    ], [
+      rml:objectMap [
+          rml:reference "Name"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:class foaf:Person;
+      rml:template "http://example.com/{ID}/{Name}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "org.postgresql.Driver";
+  d2rq:password "";
+  d2rq:username "postgres" .
+
+

Output

+
<http://example.com/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
+<http://example.com/10/Venus> <http://example.com/id> "10"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.com/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+
+
+

29. RMLTC0002a-SPARQL

+

Title: "Two tripples mapping, generation of a subject URI by the concatenation of two column values"

+

Description: "Tests: (1) two tripple mapping, no primary key; (2) subject URI generated by the concatenation of two tripple object values; (3) one tripple object to one property"

+

Error expected? No

+

Input

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+
+[] rdf:ID "10" ;
+    foaf:name "Venus" .
+
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix sd: <http://www.w3.org/ns/sparql-service-description#> .
+
+<http://example.com/base#Country> rml:logicalSource [
+      rml:iterator """
+            PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
+            PREFIX foaf: <http://xmlns.com/foaf/0.1/>
+            PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
+            SELECT ?Name ?ID
+            WHERE {
+                ?x foaf:name ?Name ;
+                   rdf:ID ?ID .
+            } """;
+      rml:referenceFormulation formats:SPARQL_Results_JSON;
+      rml:source <http://example.com/base#InputSPARQL>
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "ID.value"
+        ];
+      rml:predicate ex:id
+    ], [
+      rml:objectMap [
+          rml:reference "Name.value"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:class foaf:Person;
+      rml:template "http://example.com/{ID.value}/{Name.value}"
+    ] .
+
+<http://example.com/base#InputSPARQL> a sd:Service;
+  sd:endpoint <http://HOST:PORT/ds1/sparql>;
+  sd:supportedLanguage sd:SPARQL11Query .
+
+

Output

+
<http://example.com/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
+<http://example.com/10/Venus> <http://example.com/id> "10" .
+<http://example.com/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+
+
+

30. RMLTC0002a-SQLServer

+

Title: "Two columns mapping, generation of a subject URI by the concatenation of two column values"

+

Description: "Tests: (1) two column mapping, no primary key; (2) subject URI generated by the concatenation of two column values; (3) one column to one property"

+

Error expected? No

+

Input

+
USE TestDB;
+EXEC sp_msforeachtable 'ALTER TABLE ? NOCHECK CONSTRAINT all'
+EXEC sp_msforeachtable 'DROP TABLE ?'
+
+CREATE TABLE student (
+  "ID" INTEGER,
+  "Name" VARCHAR(50)
+);
+INSERT INTO student ("ID", "Name") values (10, 'Venus');
+
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:source <http://example.com/base/#DB_source>;
+      rml:iterator "student"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "ID"
+        ];
+      rml:predicate ex:id
+    ], [
+      rml:objectMap [
+          rml:reference "Name"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:class foaf:Person;
+      rml:template "http://example.com/{ID}/{Name}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
+  d2rq:password "YourSTRONG!Passw0rd;";
+  d2rq:username "sa" .
+
+

Output

+
<http://example.com/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
+<http://example.com/10/Venus> <http://example.com/id> "10"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.com/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+
+
+

31. RMLTC0002a-XML

+

Title: "Two columns mapping, generation of a subject URI by the concatenation of two column values"

+

Description: "Tests: (1) two column mapping, no primary key; (2) subject URI generated by the concatenation of two column values; (3) one column to one property"

+

Error expected? No

+

Input

+
<?xml version="1.0"?>
+
+<students>
+  <student>
+    <ID>10</ID>
+    <Name>Venus</Name>
+  </student>
+</students>
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "/students/student";
+      rml:referenceFormulation rml:XPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.xml"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "ID"
+        ];
+      rml:predicate ex:id
+    ], [
+      rml:objectMap [
+          rml:reference "Name"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:class foaf:Person;
+      rml:template "http://example.com/{ID}/{Name}"
+    ] .
+
+

Output

+
<http://example.com/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
+<http://example.com/10/Venus> <http://example.com/id> "10".
+<http://example.com/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+
+
+
+

32. RMLTC0002b-CSV

+

Title: "Two columns mapping, generation of a BlankNode subject by using rr:template and rr:termType"

+

Description: "Tests: (1) two column mapping, no primary key; (2) generation of a BlankNode subject by using rr:template; (3) one column to one property"

+

Error expected? No

+

Input

+
ID,Name
+10,Venus
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:referenceFormulation rml:CSV;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.csv"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "Name"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "students{ID}";
+      rml:termType rml:BlankNode
+    ] .
+
+

Output

+
_:students10 <http://xmlns.com/foaf/0.1/name> "Venus" .
+
+
+
+

33. RMLTC0002b-JSON

+

Title: "Two columns mapping, generation of a BlankNode subject by using rr:template and rr:termType"

+

Description: "Tests: (1) two column mapping, no primary key; (2) generation of a BlankNode subject by using rr:template; (3) one column to one property"

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "Name":"Venus"
+  }]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.Name"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "students{$.ID}";
+      rml:termType rml:BlankNode
+    ] .
+
+

Output

+
_:students10 <http://xmlns.com/foaf/0.1/name> "Venus" .
+
+
+
+

34. RMLTC0002b-MySQL

+

Title: "Two columns mapping, generation of a BlankNode subject by using rr:template and rr:termType"

+

Description: "Tests: (1) two column mapping, no primary key; (2) generation of a BlankNode subject by using rr:template; (3) one column to one property"

+

Error expected? No

+

Input

+
USE test;
+DROP TABLE IF EXISTS test.student;
+CREATE TABLE student (
+  ID INTEGER,
+  Name VARCHAR(50)
+);
+INSERT INTO student values ('10', 'Venus');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:source <http://example.com/base/#DB_source>;
+      rml:iterator "student"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "Name"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "students{ID}";
+      rml:termType rml:BlankNode
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
+  d2rq:password "";
+  d2rq:username "root" .
+
+

Output

+
_:students10 <http://xmlns.com/foaf/0.1/name> "Venus" .
+
+
+
+

35. RMLTC0002b-PostgreSQL

+

Title: "Two columns mapping, generation of a BlankNode subject by using rr:template and rr:termType"

+

Description: "Tests: (1) two column mapping, no primary key; (2) generation of a BlankNode subject by using rr:template; (3) one column to one property"

+

Error expected? No

+

Input

+
DROP TABLE IF EXISTS student CASCADE ;
+CREATE TABLE student (
+  "ID" INTEGER,
+  "Name" VARCHAR(50)
+);
+INSERT INTO student values ('10', 'Venus');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:source <http://example.com/base/#DB_source>;
+      rml:iterator "student"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "Name"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "students{ID}";
+      rml:termType rml:BlankNode
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "org.postgresql.Driver";
+  d2rq:password "";
+  d2rq:username "postgres" .
+
+

Output

+
_:students10 <http://xmlns.com/foaf/0.1/name> "Venus" .
+
+
+

36. RMLTC0002b-SPARQL

+

Title: "Two tripples maping, generation of a BlankNode subject by using rr:template and rr:termType"

+

Description: "Tests: (1) two tripple mapping, no primary key; (2) generation of a BlankNode subject by using rr:template; (3) one triple to one property"

+

Error expected? No

+

Input

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+
+[] rdf:ID "10" ;
+    foaf:name "Venus" .
+
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix sd: <http://www.w3.org/ns/sparql-service-description#> .
+
+<http://example.com/base#Country> rml:logicalSource [
+      rml:iterator """
+            PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
+            PREFIX foaf: <http://xmlns.com/foaf/0.1/>
+            PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
+            SELECT ?Name ?ID
+            WHERE {
+                ?x foaf:name ?Name ;
+                   rdf:ID ?ID .
+            } """;
+      rml:referenceFormulation formats:SPARQL_Results_JSON;
+      rml:source <http://example.com/base#InputSPARQL>
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "Name.value"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "students{ID.value}";
+      rml:termType rml:BlankNode
+    ] .
+
+<http://example.com/base#InputSPARQL> a sd:Service;
+  sd:endpoint <http://HOST:PORT/ds1/sparql>;
+  sd:supportedLanguage sd:SPARQL11Query .
+
+

Output

+
_:students10 <http://xmlns.com/foaf/0.1/name> "Venus" .
+
+
+

37. RMLTC0002b-SQLServer

+

Title: "Two columns mapping, generation of a BlankNode subject by using rr:template and rr:termType"

+

Description: "Tests: (1) two column mapping, no primary key; (2) generation of a BlankNode subject by using rr:template; (3) one column to one property"

+

Error expected? No

+

Input

+
USE TestDB;
+EXEC sp_msforeachtable 'ALTER TABLE ? NOCHECK CONSTRAINT all'
+EXEC sp_msforeachtable 'DROP TABLE ?'
+
+CREATE TABLE student (
+  "ID" INTEGER,
+  "Name" VARCHAR(50)
+);
+INSERT INTO student values ('10', 'Venus');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:source <http://example.com/base/#DB_source>;
+      rml:iterator "student"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "Name"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "students{ID}";
+      rml:termType rml:BlankNode
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
+  d2rq:password "YourSTRONG!Passw0rd;";
+  d2rq:username "sa" .
+
+

Output

+
_:students10 <http://xmlns.com/foaf/0.1/name> "Venus" .
+
+
+
+

38. RMLTC0002b-XML

+

Title: "Two columns mapping, generation of a BlankNode subject by using rr:template and rr:termType"

+

Description: "Tests: (1) two column mapping, no primary key; (2) generation of a BlankNode subject by using rr:template; (3) one column to one property"

+

Error expected? No

+

Input

+
<?xml version="1.0"?>
+
+<students>
+  <student>
+    <ID>10</ID>
+    <Name>Venus</Name>
+  </student>
+</students>
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "/students/student";
+      rml:referenceFormulation rml:XPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.xml"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "Name"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "students{ID}";
+      rml:termType rml:BlankNode
+    ] .
+
+

Output

+
_:students10 <http://xmlns.com/foaf/0.1/name> "Venus" .
+
+
+
+

39. RMLTC0002c-CSV

+

Title: "Two columns mapping, an undefined SQL identifier / logical reference"

+

Description: "Tests the presence of an undefined SQL identifier / logical reference"

+

Error expected? Yes

+

Input

+
ID,Name
+10,Venus
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:referenceFormulation rml:CSV;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.csv"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "IDs"
+        ];
+      rml:predicate ex:id
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{ID}/{Name}"
+    ] .
+
+
+

40. RMLTC0002c-MySQL

+

Title: "Two columns mapping, an undefined SQL identifier / logical reference"

+

Description: "Tests the presence of an undefined SQL identifier / logical reference"

+

Error expected? Yes

+

Input

+
USE test;
+DROP TABLE IF EXISTS test.student;
+CREATE TABLE student (
+  ID INTEGER,
+  Name VARCHAR(50)
+);
+INSERT INTO student values ('10', 'Venus');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:source <http://example.com/base/#DB_source>;
+      rml:iterator "student"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "IDs"
+        ];
+      rml:predicate ex:id
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{ID}/{Name}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
+  d2rq:password "";
+  d2rq:username "root" .
+
+
+

41. RMLTC0002c-PostgreSQL

+

Title: "Two columns mapping, an undefined SQL identifier / logical reference"

+

Description: "Tests the presence of an undefined SQL identifier / logical reference"

+

Error expected? Yes

+

Input

+
DROP TABLE IF EXISTS student CASCADE ;
+CREATE TABLE student (
+  "ID" INTEGER,
+  "Name" VARCHAR(50)
+);
+INSERT INTO student values ('10', 'Venus');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:source <http://example.com/base/#DB_source>;
+      rml:iterator "student"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "IDs"
+        ];
+      rml:predicate ex:id
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{ID}/{Name}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "org.postgresql.Driver";
+  d2rq:password "";
+  d2rq:username "postgres" .
+
+
+

42. RMLTC0002c-SQLServer

+

Title: "Two columns mapping, an undefined SQL identifier / logical reference"

+

Description: "Tests the presence of an undefined SQL identifier / logical reference"

+

Error expected? Yes

+

Input

+
USE TestDB;
+EXEC sp_msforeachtable 'ALTER TABLE ? NOCHECK CONSTRAINT all'
+EXEC sp_msforeachtable 'DROP TABLE ?'
+
+CREATE TABLE student (
+  "ID" INTEGER,
+  "Name" VARCHAR(50)
+);
+INSERT INTO student values ('10', 'Venus');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:source <http://example.com/base/#DB_source>;
+      rml:iterator "student"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "IDs"
+        ];
+      rml:predicate ex:id
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{ID}/{Name}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
+  d2rq:password "YourSTRONG!Passw0rd;";
+  d2rq:username "sa" .
+
+
+

43. RMLTC0002d-MySQL

+

Title: "Two columns mapping, generation of a BlankNode subject by using a SQL Query that concatenates two columns"

+

Description: "Tests (1) two column mapping, no primary key; (2) generation of a BlankNode subject by using a SQL Query that concatenates two columns; (3) one column to one property"

+

Error expected? No

+

Input

+
USE test;
+DROP TABLE IF EXISTS test.student;
+CREATE TABLE student (
+  ID INTEGER,
+  Name VARCHAR(50)
+);
+INSERT INTO student values ('10', 'Venus');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "SELECT CONCAT('Student', ID) AS StudentId, ID, Name FROM student";
+      rml:referenceFormulation rml:SQL2008Query;
+      rml:source <http://example.com/base/#DB_source>
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "Name"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:reference "StudentId";
+      rml:termType rml:BlankNode
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
+  d2rq:password "";
+  d2rq:username "root" .
+
+

Output

+
_:Student10 <http://xmlns.com/foaf/0.1/name> "Venus".
+
+
+

44. RMLTC0002d-PostgreSQL

+

Title: "Two columns mapping, generation of a BlankNode subject by using a SQL Query that concatenates two columns"

+

Description: "Tests (1) two column mapping, no primary key; (2) generation of a BlankNode subject by using a SQL Query that concatenates two columns; (3) one column to one property"

+

Error expected? No

+

Input

+
DROP TABLE IF EXISTS student CASCADE ;
+CREATE TABLE student (
+  ID INTEGER,
+  Name VARCHAR(50)
+);
+INSERT INTO student values ('10', 'Venus');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "SELECT ('Student' || ID) AS StudentId, ID, Name FROM student";
+      rml:referenceFormulation rml:SQL2008Query;
+      rml:source <http://example.com/base/#DB_source>
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "name"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:reference "studentid";
+      rml:termType rml:BlankNode
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "org.postgresql.Driver";
+  d2rq:password "";
+  d2rq:username "postgres" .
+
+

Output

+
_:Student10 <http://xmlns.com/foaf/0.1/name> "Venus".
+
+
+

45. RMLTC0002d-SQLServer

+

Title: "Two columns mapping, generation of a BlankNode subject by using a SQL Query that concatenates two columns"

+

Description: "Tests (1) two column mapping, no primary key; (2) generation of a BlankNode subject by using a SQL Query that concatenates two columns; (3) one column to one property"

+

Error expected? No

+

Input

+
USE TestDB;
+EXEC sp_msforeachtable 'ALTER TABLE ? NOCHECK CONSTRAINT all'
+EXEC sp_msforeachtable 'DROP TABLE ?'
+
+CREATE TABLE student (
+  ID INTEGER,
+  Name VARCHAR(50)
+);
+INSERT INTO student values ('10', 'Venus');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "SELECT CONCAT('Student', ID) AS StudentId, ID, Name FROM student";
+      rml:referenceFormulation rml:SQL2008Query;
+      rml:source <http://example.com/base/#DB_source>
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "Name"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:reference "StudentId";
+      rml:termType rml:BlankNode
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
+  d2rq:password "YourSTRONG!Passw0rd;";
+  d2rq:username "sa" .
+
+

Output

+
_:Student10 <http://xmlns.com/foaf/0.1/name> "Venus".
+
+
+

46. RMLTC0002e-CSV

+

Title: "Two columns mapping, an undefined rr:tableName"

+

Description: "Tests the presence of an undefined rr:tableName"

+

Error expected? Yes

+

Input

+
ID,Name
+10,Venus
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:referenceFormulation rml:CSV;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student2.csv"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "IDs"
+        ];
+      rml:predicate ex:id
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{ID}/{Name}"
+    ] .
+
+
+

47. RMLTC0002e-JSON

+

Title: "Two columns mapping, an undefined rr:tableName"

+

Description: "Tests the presence of an undefined rr:tableName"

+

Error expected? Yes

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "Name":"Venus"
+  }]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student2.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.IDs"
+        ];
+      rml:predicate ex:id
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{$.ID}/{$.Name}"
+    ] .
+
+
+

48. RMLTC0002e-MySQL

+

Title: "Two columns mapping, an undefined rr:tableName"

+

Description: "Tests the presence of an undefined rr:tableName"

+

Error expected? Yes

+

Input

+
USE test;
+DROP TABLE IF EXISTS test.student;
+CREATE TABLE student (
+  ID INTEGER,
+  Name VARCHAR(50)
+);
+INSERT INTO student values ('10', 'Venus');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:source <http://example.com/base/#DB_source>;
+      rml:iterator "\"Students\""
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "IDs"
+        ];
+      rml:predicate ex:id
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{ID}/{Name}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
+  d2rq:password "";
+  d2rq:username "root" .
+
+
+

49. RMLTC0002e-PostgreSQL

+

Title: "Two columns mapping, an undefined rr:tableName"

+

Description: "Tests the presence of an undefined rr:tableName"

+

Error expected? Yes

+

Input

+
DROP TABLE IF EXISTS student CASCADE ;
+CREATE TABLE student (
+  "ID" INTEGER,
+  "Name" VARCHAR(50)
+);
+INSERT INTO student values ('10', 'Venus');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:source <http://example.com/base/#DB_source>;
+      rml:iterator "\"Students\""
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "IDs"
+        ];
+      rml:predicate ex:id
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{ID}/{Name}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "org.postgresql.Driver";
+  d2rq:password "";
+  d2rq:username "postgres" .
+
+
+

50. RMLTC0002e-SQLServer

+

Title: "Two columns mapping, an undefined rr:tableName"

+

Description: "Tests the presence of an undefined rr:tableName"

+

Error expected? Yes

+

Input

+
USE TestDB;
+EXEC sp_msforeachtable 'ALTER TABLE ? NOCHECK CONSTRAINT all'
+EXEC sp_msforeachtable 'DROP TABLE ?'
+
+CREATE TABLE student (
+  "ID" INTEGER,
+  "Name" VARCHAR(50)
+);
+INSERT INTO student values ('10', 'Venus');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:source <http://example.com/base/#DB_source>;
+      rml:iterator "\"Students\""
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "IDs"
+        ];
+      rml:predicate ex:id
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{ID}/{Name}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
+  d2rq:password "YourSTRONG!Passw0rd;";
+  d2rq:username "sa" .
+
+
+

51. RMLTC0002e-XML

+

Title: "Two columns mapping, an undefined rr:tableName"

+

Description: "Tests the presence of an undefined rr:tableName"

+

Error expected? Yes

+

Input

+
<?xml version="1.0"?>
+
+<students>
+  <student>
+    <ID>10</ID>
+    <Name>Venus</Name>
+  </student>
+</students>
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "/students/student";
+      rml:referenceFormulation rml:XPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student2.xml"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "IDs"
+        ];
+      rml:predicate ex:id
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{ID}/{Name}"
+    ] .
+
+
+

52. RMLTC0002f-MySQL

+

Title: "Two columns mapping, delimited identifiers referenced as regular identifiers"

+

Description: "Tests the presence of delimited identifiers referenced as regular identifiers. Within rr:template ID is ok, but Name is not"

+

Error expected? Yes

+

Input

+
USE test;
+DROP TABLE IF EXISTS test.Student;
+CREATE TABLE Student (
+ID INTEGER,
+Name VARCHAR(15)
+);
+INSERT INTO Student (ID, Name) VALUES(10,'Venus');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:source <http://example.com/base/#DB_source>;
+      rml:iterator "\"Student\""
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "\"ID\""
+        ];
+      rml:predicate ex:id
+    ], [
+      rml:objectMap [
+          rml:reference "\"Name\""
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:class foaf:Person;
+      rml:template "http://example.com/{\"ID\"}/{\"Name\"}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
+  d2rq:password "";
+  d2rq:username "root" .
+
+
+

53. RMLTC0002f-PostgreSQL

+

Title: "Two columns mapping, delimited identifiers referenced as regular identifiers"

+

Description: "Tests the presence of delimited identifiers referenced as regular identifiers. Within rr:template ID is ok, but Name is not"

+

Error expected? Yes

+

Input

+
DROP TABLE IF EXISTS Student CASCADE;
+CREATE TABLE Student (
+ID INTEGER,
+Name VARCHAR(15)
+);
+INSERT INTO Student (ID, Name) VALUES(10,'Venus');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:source <http://example.com/base/#DB_source>;
+      rml:iterator "\"Student\""
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "\"ID\""
+        ];
+      rml:predicate ex:id
+    ], [
+      rml:objectMap [
+          rml:reference "\"Name\""
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:class foaf:Person;
+      rml:template "http://example.com/{\"ID\"}/{\"Name\"}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
+  d2rq:password "";
+  d2rq:username "root" .
+
+
+

54. RMLTC0002f-SQLServer

+

Title: "Two columns mapping, delimited identifiers referenced as regular identifiers"

+

Description: "Tests the presence of delimited identifiers referenced as regular identifiers. Within rr:template ID is ok, but Name is not"

+

Error expected? Yes

+

Input

+
USE TestDB;
+DROP TABLE IF EXISTS TestDB.Student;
+CREATE TABLE Student (
+ID INTEGER,
+Name VARCHAR(15)
+);
+INSERT INTO Student (ID, Name) VALUES(10,'Venus');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:source <http://example.com/base/#DB_source>;
+      rml:iterator "\"Student\""
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "\"ID\""
+        ];
+      rml:predicate ex:id
+    ], [
+      rml:objectMap [
+          rml:reference "\"Name\""
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:class foaf:Person;
+      rml:template "http://example.com/{\"ID\"}/{\"Name\"}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
+  d2rq:password "";
+  d2rq:username "root" .
+
+
+

55. RMLTC0002g-JSON

+

Title: "Two columns mapping, invalid JSONPath"

+

Description: "Test the presence of an invalid JSONPath"

+

Error expected? Yes

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "Name":"Venus"
+  }]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student2.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.IDs"
+        ];
+      rml:predicate ex:id
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{$.ID}/{$.Name}"
+    ] .
+
+
+

56. RMLTC0002g-MySQL

+

Title: "Two columns mapping, invalid SQL query"

+

Description: "Tests the presence of an invalid SQL query"

+

Error expected? Yes

+

Input

+
USE test;
+DROP TABLE IF EXISTS test.student;
+CREATE TABLE student (
+  ID INTEGER,
+  Name VARCHAR(50)
+);
+INSERT INTO student values ('10', 'Venus');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "SELECT kjnqsdjfbqsdjfmsdnfm FROM student";
+      rml:referenceFormulation rml:SQL2008Query;
+      rml:source <http://example.com/base/#DB_source>
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "IDs"
+        ];
+      rml:predicate ex:id
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{ID}/{Name}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
+  d2rq:password "";
+  d2rq:username "root" .
+
+
+

57. RMLTC0002g-PostgreSQL

+

Title: "Two columns mapping, invalid SQL query"

+

Description: "Tests the presence of an invalid SQL query"

+

Error expected? Yes

+

Input

+
DROP TABLE IF EXISTS student CASCADE ;
+CREATE TABLE student (
+  "ID" INTEGER,
+  "Name" VARCHAR(50)
+);
+INSERT INTO student values ('10', 'Venus');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "SELECT kjnqsdjfbqsdjfmsdnfm FROM student";
+      rml:referenceFormulation rml:SQL2008Query;
+      rml:source <http://example.com/base/#DB_source>
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "IDs"
+        ];
+      rml:predicate ex:id
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{ID}/{Name}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "org.postgresql.Driver";
+  d2rq:password "";
+  d2rq:username "postgres" .
+
+
+

58. RMLTC0002g-SPARQL

+

Title: "Two tripples mapping, invalid SPARQL query"

+

Description: "Tests the presence of an invalid SPARQL query"

+

Error expected? Yes

+

Input

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+
+[] rdf:ID "10" ;
+    foaf:name "Venus" .
+
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix sd: <http://www.w3.org/ns/sparql-service-description#> .
+
+<http://example.com/base#Country> rml:logicalSource [
+      rml:iterator """
+            PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
+            PREFIX foaf: <http://xmlns.com/foaf/0.1/>
+            PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
+            SELECT qsdfqsdf sqdfqsdfsd ?Nsdfqs ame ?ID qmsndfknqskfmdnemznfmkznfmizmnknfmz
+            WHERE {
+                ?x foaf:name ?Name ;
+                   rdf:ID ?ID .
+            } """;
+      rml:referenceFormulation formats:SPARQL_Results_JSON;
+      rml:source <http://example.com/base#InputSPARQL>
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "IDs"
+        ];
+      rml:predicate ex:id
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{ID.value}/{Name.value}"
+    ] .
+
+<http://example.com/base#InputSPARQL> a sd:Service;
+  sd:endpoint <http://HOST:PORT/ds1/sparql>;
+  sd:supportedLanguage sd:SPARQL11Query .
+
+
+

59. RMLTC0002g-SQLServer

+

Title: "Two columns mapping, invalid SQL query"

+

Description: "Tests the presence of an invalid SQL query"

+

Error expected? Yes

+

Input

+
USE TestDB;
+EXEC sp_msforeachtable 'ALTER TABLE ? NOCHECK CONSTRAINT all'
+EXEC sp_msforeachtable 'DROP TABLE ?'
+
+CREATE TABLE student (
+  "ID" INTEGER,
+  "Name" VARCHAR(50)
+);
+INSERT INTO student values ('10', 'Venus');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "SELECT kjnqsdjfbqsdjfmsdnfm FROM student";
+      rml:referenceFormulation rml:SQL2008Query;
+      rml:source <http://example.com/base/#DB_source>
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "IDs"
+        ];
+      rml:predicate ex:id
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{ID}/{Name}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
+  d2rq:password "YourSTRONG!Passw0rd;";
+  d2rq:username "sa" .
+
+
+

60. RMLTC0002h-MySQL

+

Title: "Two columns mapping, duplicate column name in SELECT"

+

Description: "Tests the presence of duplicate column names in the SELECT list of the SQL query"

+

Error expected? Yes

+

Input

+
USE test;
+DROP TABLE IF EXISTS test.student;
+CREATE TABLE student (
+  ID INTEGER,
+  Name VARCHAR(50)
+);
+INSERT INTO student values ('10', 'Venus');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:iterator "SELECT Name, Name FROM student";
+      rml:referenceFormulation rml:SQL2008Query;
+      rml:source <http://example.com/base/#DB_source>
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "IDs"
+        ];
+      rml:predicate ex:id
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{ID}/{Name}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
+  d2rq:password "";
+  d2rq:username "root" .
+
+
+

61. RMLTC0002h-PostgreSQL

+

Title: "Two columns mapping, duplicate column name in SELECT"

+

Description: "Tests the presence of duplicate column names in the SELECT list of the SQL query"

+

Error expected? Yes

+

Input

+
DROP TABLE IF EXISTS student CASCADE ;
+CREATE TABLE student (
+  "ID" INTEGER,
+  "Name" VARCHAR(50)
+);
+INSERT INTO student values ('10', 'Venus');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:iterator "SELECT Name, Name FROM student";
+      rml:referenceFormulation rml:SQL2008Query;
+      rml:source <http://example.com/base/#DB_source>
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "IDs"
+        ];
+      rml:predicate ex:id
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{ID}/{Name}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "org.postgresql.Driver";
+  d2rq:password "";
+  d2rq:username "postgres" .
+
+
+

62. RMLTC0002h-SPARQL

+

Title: "Two tripples mapping, duplicate variable name in SELECT"

+

Description: "Tests the presence of duplicate variable names in the SELECT list of the SPARQL query"

+

Error expected? Yes

+

Input

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+
+[] rdf:ID "10" ;
+    foaf:name "Venus" .
+
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix sd: <http://www.w3.org/ns/sparql-service-description#> .
+
+<http://example.com/base#Country> rml:logicalSource [
+      rml:iterator """
+            PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
+            PREFIX foaf: <http://xmlns.com/foaf/0.1/>
+            PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
+            SELECT ?Name ?Name
+            WHERE {
+                ?x foaf:name ?Name ;
+            } """;
+      rml:referenceFormulation formats:SPARQL_Results_JSON;
+      rml:source <http://example.com/base#InputSPARQL>
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "IDs"
+        ];
+      rml:predicate ex:id
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{ID.value}/{Name.value}"
+    ] .
+
+<http://example.com/base#InputSPARQL> a sd:Service;
+  sd:endpoint <http://HOST:PORT/ds1/sparql>;
+  sd:supportedLanguage sd:SPARQL11Query .
+
+
+

63. RMLTC0002h-SQLServer

+

Title: "Two columns mapping, duplicate column name in SELECT"

+

Description: "Tests the presence of duplicate column names in the SELECT list of the SQL query"

+

Error expected? Yes

+

Input

+
USE TestDB;
+EXEC sp_msforeachtable 'ALTER TABLE ? NOCHECK CONSTRAINT all'
+EXEC sp_msforeachtable 'DROP TABLE ?'
+CREATE TABLE student (
+  "ID" INTEGER,
+  "Name" VARCHAR(50)
+);
+INSERT INTO student values ('10', 'Venus');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:iterator "SELECT Name, Name FROM student";
+      rml:referenceFormulation rml:SQL2008Query;
+      rml:source <http://example.com/base/#DB_source>
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "IDs"
+        ];
+      rml:predicate ex:id
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{ID}/{Name}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
+  d2rq:password "YourSTRONG!Passw0rd;";
+  d2rq:username "sa" .
+
+
+

64. RMLTC0002i-MySQL

+

Title: "Two columns mapping, SQL Version identifier"

+

Description: "Tests the presence of a SQL Version identifier "

+

Error expected? Yes

+

Input

+
USE test;
+DROP TABLE IF EXISTS test.student;
+CREATE TABLE student (
+  ID INTEGER,
+  Name VARCHAR(50)
+);
+INSERT INTO student values ('10', 'Venus');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:iterator "SELECT Name FROM student";
+      rml:referenceFormulation rml:SQL2008Query;
+      rml:source <http://example.com/base/#DB_source>
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "IDs"
+        ];
+      rml:predicate ex:id
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{ID}/{Name}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
+  d2rq:password "";
+  d2rq:username "root" .
+
+
+

65. RMLTC0002i-PostgreSQL

+

Title: "Two columns mapping, SQL Version identifier"

+

Description: "Tests the presence of a SQL Version identifier "

+

Error expected? Yes

+

Input

+
DROP TABLE IF EXISTS student CASCADE ;
+CREATE TABLE student (
+  "ID" INTEGER,
+  "Name" VARCHAR(50)
+);
+INSERT INTO student values ('10', 'Venus');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:iterator "SELECT Name FROM student";
+      rml:referenceFormulation rml:SQL2008Query;
+      rml:source <http://example.com/base/#DB_source>
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "IDs"
+        ];
+      rml:predicate ex:id
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{ID}/{Name}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "org.postgresql.Driver";
+  d2rq:password "";
+  d2rq:username "postgres" .
+
+
+

66. RMLTC0002i-SQLServer

+

Title: "Two columns mapping, SQL Version identifier"

+

Description: "Tests the presence of a SQL Version identifier "

+

Error expected? Yes

+

Input

+
USE TestDB;
+EXEC sp_msforeachtable 'ALTER TABLE ? NOCHECK CONSTRAINT all'
+EXEC sp_msforeachtable 'DROP TABLE ?'
+
+CREATE TABLE student (
+  "ID" INTEGER,
+  "Name" VARCHAR(50)
+);
+INSERT INTO student values ('10', 'Venus');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:iterator "SELECT Name FROM student";
+      rml:referenceFormulation rml:SQL2008Query;
+      rml:source <http://example.com/base/#DB_source>
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "IDs"
+        ];
+      rml:predicate ex:id
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{ID}/{Name}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
+  d2rq:password "YourSTRONG!Passw0rd;";
+  d2rq:username "sa" .
+
+
+

67. RMLTC0002j-MySQL

+

Title: "Two columns mapping, qualified column names"

+

Description: "Tests the presence of qualified column names in the SELECT list of the SQL query"

+

Error expected? Yes

+

Input

+
USE test;
+DROP TABLE IF EXISTS test.student;
+CREATE TABLE student (
+  ID INTEGER,
+  Name VARCHAR(50)
+);
+INSERT INTO student values ('10', 'Venus');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:iterator "SELECT NoColumnName, Name FROM student";
+      rml:referenceFormulation rml:SQL2008Query;
+      rml:source <http://example.com/base/#DB_source>
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "IDs"
+        ];
+      rml:predicate ex:id
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{ID}/{Name}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
+  d2rq:password "";
+  d2rq:username "root" .
+
+
+

68. RMLTC0002j-PostgreSQL

+

Title: "Two columns mapping, qualified column names"

+

Description: "Tests the presence of qualified column names in the SELECT list of the SQL query"

+

Error expected? Yes

+

Input

+
DROP TABLE IF EXISTS student CASCADE ;
+CREATE TABLE student (
+  "ID" INTEGER,
+  "Name" VARCHAR(50)
+);
+INSERT INTO student values ('10', 'Venus');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:iterator "SELECT NoColumnName, Name FROM student";
+      rml:referenceFormulation rml:SQL2008Query;
+      rml:source <http://example.com/base/#DB_source>
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "IDs"
+        ];
+      rml:predicate ex:id
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{ID}/{Name}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "org.postgresql.Driver";
+  d2rq:password "";
+  d2rq:username "postgres" .
+
+
+

69. RMLTC0002j-SQLServer

+

Title: "Two columns mapping, qualified column names"

+

Description: "Tests the presence of qualified column names in the SELECT list of the SQL query"

+

Error expected? Yes

+

Input

+
USE TestDB;
+EXEC sp_msforeachtable 'ALTER TABLE ? NOCHECK CONSTRAINT all'
+EXEC sp_msforeachtable 'DROP TABLE ?'
+
+CREATE TABLE student (
+  "ID" INTEGER,
+  "Name" VARCHAR(50)
+);
+INSERT INTO student values ('10', 'Venus');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:iterator "SELECT NoColumnName, Name FROM student";
+      rml:referenceFormulation rml:SQL2008Query;
+      rml:source <http://example.com/base/#DB_source>
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "IDs"
+        ];
+      rml:predicate ex:id
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{ID}/{Name}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
+  d2rq:password "YourSTRONG!Passw0rd;";
+  d2rq:username "sa" .
+
+
+

70. RMLTC0003a-MySQL

+

Title: "Three columns mapping, undefined SQL Version identifier"

+

Description: "Tests the presence of an undefined SQL Version identifier"

+

Error expected? Yes

+

Input

+
USE test;
+DROP TABLE IF EXISTS test.student;
+CREATE TABLE student (
+  ID INTEGER,
+  FirstName VARCHAR(50),
+  LastName VARCHAR(50)
+);
+INSERT INTO student values ('10', 'Venus', 'Williams');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:iterator "SELECT FirstName, LastName FROM student";
+      rml:referenceFormulation rml:SQL2008Query;
+      rml:source <http://example.com/base/#DB_source>
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "IDs"
+        ];
+      rml:predicate ex:id
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{ID}/{Name}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
+  d2rq:password "";
+  d2rq:username "root" .
+
+
+

71. RMLTC0003a-PostgreSQL

+

Title: "Three columns mapping, undefined SQL Version identifier"

+

Description: "Tests the presence of an undefined SQL Version identifier"

+

Error expected? Yes

+

Input

+
DROP TABLE IF EXISTS student CASCADE ;
+CREATE TABLE student (
+  "ID" INTEGER,
+  "FirstName" VARCHAR(50),
+  "LastName" VARCHAR(50)
+);
+INSERT INTO student values ('10', 'Venus', 'Williams');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:iterator "SELECT FirstName, LastName FROM student";
+      rml:referenceFormulation rml:SQL2008Query;
+      rml:source <http://example.com/base/#DB_source>
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "IDs"
+        ];
+      rml:predicate ex:id
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{ID}/{Name}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "org.postgresql.Driver";
+  d2rq:password "";
+  d2rq:username "postgres" .
+
+
+

72. RMLTC0003a-SQLServer

+

Title: "Three columns mapping, undefined SQL Version identifier"

+

Description: "Tests the presence of an undefined SQL Version identifier"

+

Error expected? Yes

+

Input

+
USE TestDB;
+EXEC sp_msforeachtable 'ALTER TABLE ? NOCHECK CONSTRAINT all'
+EXEC sp_msforeachtable 'DROP TABLE ?'
+
+CREATE TABLE student (
+  "ID" INTEGER,
+  "FirstName" VARCHAR(50),
+  "LastName" VARCHAR(50)
+);
+INSERT INTO student values ('10', 'Venus', 'Williams');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:iterator "SELECT FirstName, LastName FROM student";
+      rml:referenceFormulation rml:SQL2008Query;
+      rml:source <http://example.com/base/#DB_source>
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "IDs"
+        ];
+      rml:predicate ex:id
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{ID}/{Name}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
+  d2rq:password "YourSTRONG!Passw0rd;";
+  d2rq:username "sa" .
+
+
+

73. RMLTC0003b-MySQL

+

Title: "Three columns mapping, concatenation of columns, by using a rr:sqlQuery to produce literal"

+

Description: "Tests: (1) three column mapping; and (2) concatenation of columns to produce literal, by using a rr:sqlQuery"

+

Error expected? No

+

Input

+
USE test;
+DROP TABLE IF EXISTS test.student;
+CREATE TABLE student (
+  ID INTEGER,
+  FirstName VARCHAR(50),
+  LastName VARCHAR(50)
+);
+INSERT INTO student values ('10', 'Venus', 'Williams');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:iterator "SELECT ID, LastName, CONCAT(`FirstName`, '', `LastName`) as Name FROM student";
+      rml:referenceFormulation rml:SQL2008Query;
+      rml:source <http://example.com/base/#DB_source>
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "Name";
+          rml:termType rml:Literal
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{ID}/{LastName}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
+  d2rq:password "";
+  d2rq:username "root" .
+
+

Output

+
<http://example.com/10/Williams> <http://xmlns.com/foaf/0.1/name> "VenusWilliams" .
+
+
+

74. RMLTC0003b-PostgreSQL

+

Title: "Three columns mapping, concatenation of columns, by using a rr:sqlQuery to produce literal"

+

Description: "Tests: (1) three column mapping; and (2) concatenation of columns to produce literal, by using a rr:sqlQuery"

+

Error expected? No

+

Input

+
DROP TABLE IF EXISTS student CASCADE ;
+CREATE TABLE student (
+  id INTEGER,
+  firstname VARCHAR(50),
+  lastname VARCHAR(50)
+);
+INSERT INTO student values ('10', 'Venus', 'Williams');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:iterator "SELECT id, lastname, concat_ws(firstname, '', lastname) as name FROM student";
+      rml:referenceFormulation rml:SQL2008Query;
+      rml:source <http://example.com/base/#DB_source>
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "name";
+          rml:termType rml:Literal
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{id}/{lastname}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "org.postgresql.Driver";
+  d2rq:password "";
+  d2rq:username "postgres" .
+
+

Output

+
<http://example.com/10/Williams> <http://xmlns.com/foaf/0.1/name> "VenusWilliams" .
+
+
+

75. RMLTC0003b-SQLServer

+

Title: "Three columns mapping, concatenation of columns, by using a rr:sqlQuery to produce literal"

+

Description: "Tests: (1) three column mapping; and (2) concatenation of columns to produce literal, by using a rr:sqlQuery"

+

Error expected? No

+

Input

+
USE TestDB;
+EXEC sp_msforeachtable 'ALTER TABLE ? NOCHECK CONSTRAINT all'
+EXEC sp_msforeachtable 'DROP TABLE ?'
+
+CREATE TABLE student (
+  "ID" INTEGER,
+  "FirstName" VARCHAR(50),
+  "LastName" VARCHAR(50)
+);
+INSERT INTO student values ('10', 'Venus', 'Williams');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:iterator "SELECT ID, LastName, concat_ws(FirstName, '', LastName) as Name FROM student";
+      rml:referenceFormulation rml:SQL2008Query;
+      rml:source <http://example.com/base/#DB_source>
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "Name";
+          rml:termType rml:Literal
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{ID}/{LastName}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
+  d2rq:password "YourSTRONG!Passw0rd;";
+  d2rq:username "sa" .
+
+

Output

+
<http://example.com/10/Williams> <http://xmlns.com/foaf/0.1/name> "VenusWilliams" .
+
+
+

76. RMLTC0003c-CSV

+

Title: "Three columns mapping, by using a rr:template to produce literal"

+

Description: "Tests: (1) three column mapping; and (2) the use of rr:template to produce literal"

+

Error expected? No

+

Input

+
ID,FirstName,LastName
+10,Venus,Williams
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:referenceFormulation rml:CSV;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.csv"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:template "{FirstName} {LastName}";
+          rml:termType rml:Literal
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Student{ID}"
+    ] .
+
+

Output

+
<http://example.com/Student10> <http://xmlns.com/foaf/0.1/name> "Venus Williams" .
+
+
+

77. RMLTC0003c-JSON

+

Title: "Three columns mapping, by using a rr:template to produce literal"

+

Description: "Tests: (1) three column mapping; and (2) the use of rr:template to produce literal"

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "FirstName":"Venus",
+    "LastName":"Williams"
+  }]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:template "{$.FirstName} {$.LastName}";
+          rml:termType rml:Literal
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Student{$.ID}"
+    ] .
+
+

Output

+
<http://example.com/Student10> <http://xmlns.com/foaf/0.1/name> "Venus Williams" .
+
+
+

78. RMLTC0003c-MySQL

+

Title: "Three columns mapping, by using a rr:template to produce literal"

+

Description: "Tests: (1) three column mapping; and (2) the use of rr:template to produce literal"

+

Error expected? No

+

Input

+
USE test;
+DROP TABLE IF EXISTS test.student;
+
+CREATE TABLE student (
+  ID INTEGER,
+  FirstName VARCHAR(50),
+  LastName VARCHAR(50)
+);
+INSERT INTO student values ('10', 'Venus', 'Williams');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "student"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:template "{FirstName} {LastName}";
+          rml:termType rml:Literal
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Student{ID}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
+  d2rq:password "";
+  d2rq:username "root" .
+
+

Output

+
<http://example.com/Student10> <http://xmlns.com/foaf/0.1/name> "Venus Williams" .
+
+
+

79. RMLTC0003c-PostgreSQL

+

Title: "Three columns mapping, by using a rr:template to produce literal"

+

Description: "Tests: (1) three column mapping; and (2) the use of rr:template to produce literal"

+

Error expected? No

+

Input

+
DROP TABLE IF EXISTS student CASCADE ;
+CREATE TABLE student (
+  "ID" INTEGER,
+  "FirstName" VARCHAR(50),
+  "LastName" VARCHAR(50)
+);
+INSERT INTO student values ('10', 'Venus', 'Williams');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "student"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:template "{FirstName} {LastName}";
+          rml:termType rml:Literal
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Student{ID}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "org.postgresql.Driver";
+  d2rq:password "";
+  d2rq:username "postgres" .
+
+

Output

+
<http://example.com/Student10> <http://xmlns.com/foaf/0.1/name> "Venus Williams" .
+
+
+

80. RMLTC0003c-SPARQL

+

Title: "Three tripple mapping, by using a rr:template to produce literal"

+

Description: "Tests: (1) three column mapping; and (2) the use of rr:template to produce literal"

+

Error expected? No

+

Input

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+
+[] rdf:ID "10" ;
+    foaf:firstName "Venus" ;
+    foaf:lastName "Williams" .
+
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix sd: <http://www.w3.org/ns/sparql-service-description#> .
+
+<http://example.com/base#Country> rml:logicalSource [
+      rml:iterator """
+            PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
+            PREFIX foaf: <http://xmlns.com/foaf/0.1/>
+            PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
+            SELECT ?FirstName ?LastName ?ID
+            WHERE {
+                ?x  foaf:firstName ?FirstName ;
+                    foaf:lastName  ?LastName ;
+                    rdf:ID         ?ID .
+            } """;
+      rml:referenceFormulation formats:SPARQL_Results_JSON;
+      rml:source <http://example.com/base#InputSPARQL>
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:template "{FirstName.value} {LastName.value}";
+          rml:termType rml:Literal
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Student{ID.value}"
+    ] .
+
+<http://example.com/base#InputSPARQL> a sd:Service;
+  sd:endpoint <http://HOST:PORT/ds1/sparql>;
+  sd:supportedLanguage sd:SPARQL11Query .
+
+

Output

+
<http://example.com/Student10> <http://xmlns.com/foaf/0.1/name> "Venus Williams" .
+
+
+

81. RMLTC0003c-SQLServer

+

Title: "Three columns mapping, by using a rr:template to produce literal"

+

Description: "Tests: (1) three column mapping; and (2) the use of rr:template to produce literal"

+

Error expected? No

+

Input

+
USE TestDB;
+EXEC sp_msforeachtable 'ALTER TABLE ? NOCHECK CONSTRAINT all'
+EXEC sp_msforeachtable 'DROP TABLE ?'
+
+CREATE TABLE student (
+  "ID" INTEGER,
+  "FirstName" VARCHAR(50),
+  "LastName" VARCHAR(50)
+);
+INSERT INTO student values ('10', 'Venus', 'Williams');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "student"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:template "{FirstName} {LastName}";
+          rml:termType rml:Literal
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Student{ID}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
+  d2rq:password "YourSTRONG!Passw0rd;";
+  d2rq:username "sa" .
+
+

Output

+
<http://example.com/Student10> <http://xmlns.com/foaf/0.1/name> "Venus Williams" .
+
+
+

82. RMLTC0003c-XML

+

Title: "Three columns mapping, by using a rr:template to produce literal"

+

Description: "Tests: (1) three column mapping; and (2) the use of rr:template to produce literal"

+

Error expected? No

+

Input

+
<?xml version="1.0"?>
+
+<students>
+  <student>
+    <ID>10</ID>
+    <FirstName>Venus</FirstName>
+    <LastName>Williams</LastName>
+  </student>
+</students>
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "/students/student";
+      rml:referenceFormulation rml:XPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.xml"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:template "{FirstName} {LastName}";
+          rml:termType rml:Literal
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Student{ID}"
+    ] .
+
+

Output

+
<http://example.com/Student10> <http://xmlns.com/foaf/0.1/name> "Venus Williams" .
+
+
+

83. RMLTC0004a-CSV

+

Title: "Two column mapping, from one row table to two different triples"

+

Description: "Tests: (1) two column mapping, (2) subject URI generated by a column value; (3) from one row table to two different triples (4) typing by using rr:class"

+

Error expected? No

+

Input

+
Student,Sport
+Venus,Tennis
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:referenceFormulation rml:CSV;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student_sport.csv"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "Student"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:class ex:Student;
+      rml:template "http://example.com/{Student}"
+    ] .
+
+<http://example.com/base/TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:referenceFormulation rml:CSV;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student_sport.csv"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "Sport"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:class ex:Sport;
+      rml:template "http://example.com/{Sport}"
+    ] .
+
+

Output

+
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
+<http://example.com/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/Student> .
+<http://example.com/Tennis> <http://xmlns.com/foaf/0.1/name> "Tennis" .
+<http://example.com/Tennis> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/Sport> .
+
+
+
+

84. RMLTC0004a-JSON

+

Title: "Two column mapping, from one row table to two different triples"

+

Description: "Tests: (1) two column mapping, (2) subject URI generated by a column value; (3) from one row table to two different triples (4) typing by using rr:class"

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "Student": "Venus",
+    "Sport":"Tennis"
+  }]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student_sport.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.Student"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:class ex:Student;
+      rml:template "http://example.com/{$.Student}"
+    ] .
+
+<http://example.com/base/TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student_sport.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.Sport"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:class ex:Sport;
+      rml:template "http://example.com/{$.Sport}"
+    ] .
+
+

Output

+
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
+<http://example.com/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/Student> .
+<http://example.com/Tennis> <http://xmlns.com/foaf/0.1/name> "Tennis" .
+<http://example.com/Tennis> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/Sport> .
+
+
+
+

85. RMLTC0004a-MySQL

+

Title: "Two column mapping, from one row table to two different triples"

+

Description: "Tests: (1) two column mapping, (2) subject URI generated by a column value; (3) from one row table to two different triples (4) typing by using rr:class"

+

Error expected? No

+

Input

+
Student,Sport
+Venus,Tennis
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "student_sport"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "Student"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:class ex:Student;
+      rml:template "http://example.com/{Student}"
+    ] .
+
+<http://example.com/base/TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "student_sport"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "Sport"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:class ex:Sport;
+      rml:template "http://example.com/{Sport}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
+  d2rq:password "";
+  d2rq:username "root" .
+
+

Output

+
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
+<http://example.com/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/Student> .
+<http://example.com/Tennis> <http://xmlns.com/foaf/0.1/name> "Tennis" .
+<http://example.com/Tennis> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/Sport> .
+
+
+
+

86. RMLTC0004a-PostgreSQL

+

Title: "Two column mapping, from one row table to two different triples"

+

Description: "Tests: (1) two column mapping, (2) subject URI generated by a column value; (3) from one row table to two different triples (4) typing by using rr:class"

+

Error expected? No

+

Input

+
Student,Sport
+Venus,Tennis
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "student_sport"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "Student"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:class ex:Student;
+      rml:template "http://example.com/{Student}"
+    ] .
+
+<http://example.com/base/TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "student_sport"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "Sport"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:class ex:Sport;
+      rml:template "http://example.com/{Sport}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "org.postgresql.Driver";
+  d2rq:password "";
+  d2rq:username "postgres" .
+
+

Output

+
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
+<http://example.com/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/Student> .
+<http://example.com/Tennis> <http://xmlns.com/foaf/0.1/name> "Tennis" .
+<http://example.com/Tennis> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/Sport> .
+
+
+

87. RMLTC0004a-SPARQL

+

Title: "Two BlankNodes mapping, from one object to two different triples"

+

Description: "Tests: (1) two BlankNodes mapping, (2) subject URI generated by a tripple object value; (3) from one BlankNode to two different triples (4) typing by using rr:class"

+

Error expected? No

+

Input

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix ns1: <http://example.com/> .
+
+[] a ns1:Student ;
+    ns1:plays [ a ns1:Sport ;
+            foaf:name "Tennis" ] ;
+    foaf:name "Venus" .
+
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix sd: <http://www.w3.org/ns/sparql-service-description#> .
+
+ex:TriplesMap1 a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator """
+            PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
+            PREFIX foaf: <http://xmlns.com/foaf/0.1/>
+            PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
+            SELECT ?Student
+            WHERE {
+                ?x  a <http://example.com/Student> ;
+                    foaf:name  ?Student .
+            } """;
+      rml:referenceFormulation formats:SPARQL_Results_JSON;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path <http://example.com/base#InputSPARQL>
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "Student.value"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:class ex:Student;
+      rml:template "http://example.com/{Student.value}"
+    ] .
+
+ex:TriplesMap2 a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator """
+                PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
+                PREFIX foaf: <http://xmlns.com/foaf/0.1/>
+                PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
+                SELECT ?Sport
+                WHERE {
+                    ?x  a <http://example.com/Student> ;
+                        <http://example.com/plays> ?sportObject .
+                    ?sportObject foaf:name ?Sport .
+                } """;
+      rml:referenceFormulation formats:SPARQL_Results_JSON;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path <http://example.com/base#InputSPARQL>
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "Sport.value"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:class ex:Sport;
+      rml:template "http://example.com/{Sport.value}"
+    ] .
+
+<http://example.com/base#InputSPARQL> a sd:Service;
+  sd:endpoint <http://HOST:PORT/ds1/sparql>;
+  sd:supportedLanguage sd:SPARQL11Query .
+
+

Output

+
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
+<http://example.com/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/Student> .
+<http://example.com/Tennis> <http://xmlns.com/foaf/0.1/name> "Tennis" .
+<http://example.com/Tennis> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/Sport> .
+
+
+

88. RMLTC0004a-SQLServer

+

Title: "Two column mapping, from one row table to two different triples"

+

Description: "Tests: (1) two column mapping, (2) subject URI generated by a column value; (3) from one row table to two different triples (4) typing by using rr:class"

+

Error expected? No

+

Input

+
Student,Sport
+Venus,Tennis
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "student_sport"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "Student"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:class ex:Student;
+      rml:template "http://example.com/{Student}"
+    ] .
+
+<http://example.com/base/TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "student_sport"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "Sport"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:class ex:Sport;
+      rml:template "http://example.com/{Sport}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
+  d2rq:password "YourSTRONG!Passw0rd;";
+  d2rq:username "sa" .
+
+

Output

+
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
+<http://example.com/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/Student> .
+<http://example.com/Tennis> <http://xmlns.com/foaf/0.1/name> "Tennis" .
+<http://example.com/Tennis> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/Sport> .
+
+
+
+

89. RMLTC0004a-XML

+

Title: "Two column mapping, from one row table to two different triples"

+

Description: "Tests: (1) two column mapping, (2) subject URI generated by a column value; (3) from one row table to two different triples (4) typing by using rr:class"

+

Error expected? No

+

Input

+
<?xml version="1.0"?>
+
+<students>
+  <student>
+    <Student>Venus</Student>
+    <Sport>Tennis</Sport>
+  </student>
+</students>
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "/students/student";
+      rml:referenceFormulation rml:XPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student_sport.xml"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "Student"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:class ex:Student;
+      rml:template "http://example.com/{Student}"
+    ] .
+
+<http://example.com/base/TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "/students/student";
+      rml:referenceFormulation rml:XPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student_sport.xml"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "Sport"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:class ex:Sport;
+      rml:template "http://example.com/{Sport}"
+    ] .
+
+

Output

+
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
+<http://example.com/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/Student> .
+<http://example.com/Tennis> <http://xmlns.com/foaf/0.1/name> "Tennis" .
+<http://example.com/Tennis> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/Sport> .
+
+
+
+

90. RMLTC0004b-CSV

+

Title: "One column mapping, presence of rr:termType rr:Literal on rr:subjectMap"

+

Description: "Tests: (1) one column mapping (2) the presence of rr:termType rr:Literal on rr:subjectMap, which is invalid"

+

Error expected? Yes

+

Input

+
Name
+Venus
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:referenceFormulation rml:CSV;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.csv"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "Name"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{Name}";
+      rml:termType rml:Literal
+    ] .
+
+
+

91. RMLTC0004b-JSON

+

Title: "One column mapping, presence of rr:termType rr:Literal on rr:subjectMap"

+

Description: "Tests: (1) one column mapping (2) the presence of rr:termType rr:Literal on rr:subjectMap, which is invalid"

+

Error expected? Yes

+

Input

+
{
+  "students": [{
+    "Name":"Venus"
+  }]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.Name"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{$.Name}";
+      rml:termType rml:Literal
+    ] .
+
+
+

92. RMLTC0004b-MySQL

+

Title: "One column mapping, presence of rr:termType rr:Literal on rr:subjectMap"

+

Description: "Tests: (1) one column mapping (2) the presence of rr:termType rr:Literal on rr:subjectMap, which is invalid"

+

Error expected? Yes

+

Input

+
USE test;
+DROP TABLE IF EXISTS test.student;
+CREATE TABLE student (
+  Name VARCHAR(50)
+);
+INSERT INTO student values ('Venus');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "student"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "Name"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{Name}";
+      rml:termType rml:Literal
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
+  d2rq:password "";
+  d2rq:username "root" .
+
+
+

93. RMLTC0004b-PostgreSQL

+

Title: "One column mapping, presence of rr:termType rr:Literal on rr:subjectMap"

+

Description: "Tests: (1) one column mapping (2) the presence of rr:termType rr:Literal on rr:subjectMap, which is invalid"

+

Error expected? Yes

+

Input

+
DROP TABLE IF EXISTS student;
+CREATE TABLE student (
+  "Name" VARCHAR(50)
+);
+INSERT INTO student values ('Venus');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "student"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "Name"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{Name}";
+      rml:termType rml:Literal
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "org.postgresql.Driver";
+  d2rq:password "";
+  d2rq:username "postgres" .
+
+
+

94. RMLTC0004b-SPARQL

+

Title: "One tripple mapping, presence of rr:termType rr:Literal on rr:subjectMap"

+

Description: "Tests: (1) one column mapping (2) the presence of rr:termType rr:Literal on rr:subjectMap, which is invalid"

+

Error expected? Yes

+

Input

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+
+[] foaf:name "Venus" .
+
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix sd: <http://www.w3.org/ns/sparql-service-description#> .
+
+ex:TriplesMap1 a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator """
+            PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
+            PREFIX foaf: <http://xmlns.com/foaf/0.1/>
+            PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
+            SELECT ?Name
+            WHERE {
+                ?x foaf:name ?Name .
+            } """;
+      rml:referenceFormulation formats:SPARQL_Results_JSON;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path <http://example.com/base#InputSPARQL>
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "Name.value"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{Name.value}";
+      rml:termType rml:Literal
+    ] .
+
+<http://example.com/base#InputSPARQL> a sd:Service;
+  sd:endpoint <http://HOST:PORT/ds1/sparql>;
+  sd:supportedLanguage sd:SPARQL11Query .
+
+
+

95. RMLTC0004b-SQLServer

+

Title: "One column mapping, presence of rr:termType rr:Literal on rr:subjectMap"

+

Description: "Tests: (1) one column mapping (2) the presence of rr:termType rr:Literal on rr:subjectMap, which is invalid"

+

Error expected? Yes

+

Input

+
USE TestDB;
+DROP TABLE IF EXISTS student;
+CREATE TABLE student (
+  "Name" VARCHAR(50)
+);
+INSERT INTO student values ('Venus');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "student"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "Name"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{Name}";
+      rml:termType rml:Literal
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
+  d2rq:password "YourSTRONG!Passw0rd;";
+  d2rq:username "sa" .
+
+
+

96. RMLTC0004b-XML

+

Title: "One column mapping, presence of rr:termType rr:Literal on rr:subjectMap"

+

Description: "Tests: (1) one column mapping (2) the presence of rr:termType rr:Literal on rr:subjectMap, which is invalid"

+

Error expected? Yes

+

Input

+
<?xml version="1.0"?>
+
+<students>
+  <student>
+    <Name>Venus</Name>
+  </student>
+</students>
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "/students/student";
+      rml:referenceFormulation rml:XPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.xml"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "Name"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{Name}";
+      rml:termType rml:Literal
+    ] .
+
+
+

97. RMLTC0005a-CSV

+

Title: "Typing of resources"

+

Description: "Tests the typing of resources"

+

Error expected? No

+

Input

+
fname,lname,amount
+Bob,Smith,30.0E0
+Sue,Jones,20.0E0
+Bob,Smith,30.0E0
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:referenceFormulation rml:CSV;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "ious.csv"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "amount"
+        ];
+      rml:predicate ex:owes
+    ];
+  rml:subjectMap [
+      rml:class foaf:Person;
+      rml:template "http://example.com/{fname};{lname}"
+    ] .
+
+

Output

+
<http://example.com/Bob;Smith> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Bob;Smith> <http://example.com/owes> "30.0E0" .
+<http://example.com/Sue;Jones> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Sue;Jones> <http://example.com/owes> "20.0E0" .
+
+
+
+

98. RMLTC0005a-JSON

+

Title: "Typing of resources"

+

Description: "Tests the typing of resources"

+

Error expected? No

+

Input

+
{
+  "persons": [
+    {
+      "fname": "Bob",
+      "lname": "Smith",
+      "amount": "30.0E0"
+    },
+    {
+      "fname": "Sue",
+      "lname": "Jones",
+      "amount": "20.0E0"
+    },
+    {
+      "fname": "Bob",
+      "lname": "Smith",
+      "amount": "30.0E0"
+    }
+  ]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.persons[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "ious.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.amount"
+        ];
+      rml:predicate ex:owes
+    ];
+  rml:subjectMap [
+      rml:class foaf:Person;
+      rml:template "http://example.com/{$.fname};{$.lname}"
+    ] .
+
+

Output

+
<http://example.com/Bob;Smith> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Bob;Smith> <http://example.com/owes> "30.0E0" .
+<http://example.com/Sue;Jones> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Sue;Jones> <http://example.com/owes> "20.0E0" .
+
+
+
+

99. RMLTC0005a-MySQL

+

Title: "Typing of resources"

+

Description: "Tests the typing of resources"

+

Error expected? No

+

Input

+
USE test;
+DROP TABLE IF EXISTS test.IOUs;
+CREATE TABLE IOUs (
+      fname VARCHAR(20),
+      lname  VARCHAR(20),
+      amount FLOAT);
+INSERT INTO IOUs (fname, lname, amount) VALUES ('Bob', 'Smith', 30);
+INSERT INTO IOUs (fname, lname, amount) VALUES ('Sue', 'Jones', 20);
+INSERT INTO IOUs (fname, lname, amount) VALUES ('Bob', 'Smith', 30);
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "IOUs"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "amount"
+        ];
+      rml:predicate ex:owes
+    ];
+  rml:subjectMap [
+      rml:class foaf:Person;
+      rml:template "http://example.com/{fname};{lname}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
+  d2rq:password "";
+  d2rq:username "root" .
+
+

Output

+
<http://example.com/Bob;Smith> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Bob;Smith> <http://example.com/owes> "3.0E1"^^<http://www.w3.org/2001/XMLSchema#double> .
+<http://example.com/Sue;Jones> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Sue;Jones> <http://example.com/owes> "2.0E1"^^<http://www.w3.org/2001/XMLSchema#double> .
+
+
+
+

100. RMLTC0005a-PostgreSQL

+

Title: "Typing of resources"

+

Description: "Tests the typing of resources"

+

Error expected? No

+

Input

+
DROP TABLE IF EXISTS IOUs;
+CREATE TABLE IOUs (
+      fname VARCHAR(20),
+      lname  VARCHAR(20),
+      amount FLOAT);
+INSERT INTO IOUs (fname, lname, amount) VALUES ('Bob', 'Smith', 30);
+INSERT INTO IOUs (fname, lname, amount) VALUES ('Sue', 'Jones', 20);
+INSERT INTO IOUs (fname, lname, amount) VALUES ('Bob', 'Smith', 30);
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "IOUs"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "amount"
+        ];
+      rml:predicate ex:owes
+    ];
+  rml:subjectMap [
+      rml:class foaf:Person;
+      rml:template "http://example.com/{fname};{lname}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "org.postgresql.Driver";
+  d2rq:password "";
+  d2rq:username "postgres" .
+
+

Output

+
<http://example.com/Bob;Smith> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Bob;Smith> <http://example.com/owes> "3.0E1"^^<http://www.w3.org/2001/XMLSchema#double> .
+<http://example.com/Sue;Jones> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Sue;Jones> <http://example.com/owes> "2.0E1"^^<http://www.w3.org/2001/XMLSchema#double> .
+
+
+
+

101. RMLTC0005a-SQLServer

+

Title: "Typing of resources"

+

Description: "Tests the typing of resources"

+

Error expected? No

+

Input

+
USE TestDB;
+DROP TABLE IF EXISTS IOUs;
+
+CREATE TABLE IOUs (
+      fname VARCHAR(20),
+      lname  VARCHAR(20),
+      amount FLOAT);
+INSERT INTO IOUs (fname, lname, amount) VALUES ('Bob', 'Smith', 30);
+INSERT INTO IOUs (fname, lname, amount) VALUES ('Sue', 'Jones', 20);
+INSERT INTO IOUs (fname, lname, amount) VALUES ('Bob', 'Smith', 30);
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "IOUs"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "amount"
+        ];
+      rml:predicate ex:owes
+    ];
+  rml:subjectMap [
+      rml:class foaf:Person;
+      rml:template "http://example.com/{fname};{lname}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
+  d2rq:password "YourSTRONG!Passw0rd;";
+  d2rq:username "sa" .
+
+

Output

+
<http://example.com/Bob;Smith> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Bob;Smith> <http://example.com/owes> "3.0E1"^^<http://www.w3.org/2001/XMLSchema#double> .
+<http://example.com/Sue;Jones> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Sue;Jones> <http://example.com/owes> "2.0E1"^^<http://www.w3.org/2001/XMLSchema#double> .
+
+
+
+

102. RMLTC0005a-XML

+

Title: "Typing of resources"

+

Description: "Tests the typing of resources"

+

Error expected? No

+

Input

+
<?xml version="1.0"?>
+
+<persons>
+  <person>
+    <fname>Bob</fname>
+    <lname>Smith</lname>
+    <amount>30.0E0</amount>
+  </person>
+  <person>
+    <fname>Sue</fname>
+    <lname>Jones</lname>
+    <amount>20.0E0</amount>
+  </person>
+  <person>
+    <fname>Bob</fname>
+    <lname>Smith</lname>
+    <amount>30.0E0</amount>
+  </person>
+</persons>
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "/persons/person";
+      rml:referenceFormulation rml:XPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "ious.xml"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "amount"
+        ];
+      rml:predicate ex:owes
+    ];
+  rml:subjectMap [
+      rml:class foaf:Person;
+      rml:template "http://example.com/{fname};{lname}"
+    ] .
+
+

Output

+
<http://example.com/Bob;Smith> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Bob;Smith> <http://example.com/owes> "30.0E0" .
+<http://example.com/Sue;Jones> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Sue;Jones> <http://example.com/owes> "20.0E0" .
+
+
+
+

103. RMLTC0005b-MySQL

+

Title: "Default mapping"

+

Description: "Tests the generation of a default mapping for tables without a primary key"

+

Error expected? No

+

Input

+
USE test;
+DROP TABLE IF EXISTS test.IOUs;
+CREATE TABLE IOUs (
+      fname VARCHAR(20),
+      lname  VARCHAR(20),
+      amount FLOAT);
+INSERT INTO IOUs (fname, lname, amount) VALUES ('Bob', 'Smith', 30);
+INSERT INTO IOUs (fname, lname, amount) VALUES ('Sue', 'Jones', 20);
+INSERT INTO IOUs (fname, lname, amount) VALUES ('Bob', 'Smith', 30);
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "IOUs"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "fname"
+        ];
+      rml:predicate <http://example.com/base/IOUs#fname>
+    ], [
+      rml:objectMap [
+          rml:reference "lname"
+        ];
+      rml:predicate <http://example.com/base/IOUs#lname>
+    ], [
+      rml:objectMap [
+          rml:reference "amount"
+        ];
+      rml:predicate <http://example.com/base/IOUs#amount>
+    ];
+  rml:subjectMap [
+      rml:class <http://example.com/base/IOUs>;
+      rml:template "{fname}_{lname}";
+      rml:termType rml:BlankNode
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
+  d2rq:password "";
+  d2rq:username "root" .
+
+

Output

+
_:Bob_Smith <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/base/IOUs> .
+_:Bob_Smith <http://example.com/base/IOUs#fname> "Bob" .
+_:Bob_Smith <http://example.com/base/IOUs#lname> "Smith" .
+_:Bob_Smith <http://example.com/base/IOUs#amount> "3.0E1"^^<http://www.w3.org/2001/XMLSchema#double> .
+_:Sue_Jones <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/base/IOUs> .
+_:Sue_Jones <http://example.com/base/IOUs#fname> "Sue" .
+_:Sue_Jones <http://example.com/base/IOUs#lname> "Jones" .
+_:Sue_Jones <http://example.com/base/IOUs#amount> "2.0E1"^^<http://www.w3.org/2001/XMLSchema#double> .
+    
+
+
+

104. RMLTC0005b-PostgreSQL

+

Title: "Default mapping"

+

Description: "Tests the generation of a default mapping for tables without a primary key"

+

Error expected? No

+

Input

+
DROP TABLE IF EXISTS IOUs;
+CREATE TABLE IOUs (
+      fname VARCHAR(20),
+      lname  VARCHAR(20),
+      amount FLOAT);
+INSERT INTO IOUs (fname, lname, amount) VALUES ('Bob', 'Smith', 30);
+INSERT INTO IOUs (fname, lname, amount) VALUES ('Sue', 'Jones', 20);
+INSERT INTO IOUs (fname, lname, amount) VALUES ('Bob', 'Smith', 30);
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "IOUs"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "fname"
+        ];
+      rml:predicate <http://example.com/base/IOUs#fname>
+    ], [
+      rml:objectMap [
+          rml:reference "lname"
+        ];
+      rml:predicate <http://example.com/base/IOUs#lname>
+    ], [
+      rml:objectMap [
+          rml:reference "amount"
+        ];
+      rml:predicate <http://example.com/base/IOUs#amount>
+    ];
+  rml:subjectMap [
+      rml:class <http://example.com/base/IOUs>;
+      rml:template "{fname}_{lname}";
+      rml:termType rml:BlankNode
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "org.postgresql.Driver";
+  d2rq:password "";
+  d2rq:username "postgres" .
+
+

Output

+
_:Bob_Smith <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/base/IOUs> .
+_:Bob_Smith <http://example.com/base/IOUs#fname> "Bob" .
+_:Bob_Smith <http://example.com/base/IOUs#lname> "Smith" .
+_:Bob_Smith <http://example.com/base/IOUs#amount> "3.0E1"^^<http://www.w3.org/2001/XMLSchema#double> .
+_:Sue_Jones <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/base/IOUs> .
+_:Sue_Jones <http://example.com/base/IOUs#fname> "Sue" .
+_:Sue_Jones <http://example.com/base/IOUs#lname> "Jones" .
+_:Sue_Jones <http://example.com/base/IOUs#amount> "2.0E1"^^<http://www.w3.org/2001/XMLSchema#double> .
+    
+
+
+

105. RMLTC0005b-SQLServer

+

Title: "Default mapping"

+

Description: "Tests the generation of a default mapping for tables without a primary key"

+

Error expected? No

+

Input

+
USE TestDB;
+DROP TABLE IF EXISTS IOUs;
+CREATE TABLE IOUs (
+      fname VARCHAR(20),
+      lname  VARCHAR(20),
+      amount FLOAT);
+INSERT INTO IOUs (fname, lname, amount) VALUES ('Bob', 'Smith', 30);
+INSERT INTO IOUs (fname, lname, amount) VALUES ('Sue', 'Jones', 20);
+INSERT INTO IOUs (fname, lname, amount) VALUES ('Bob', 'Smith', 30);
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "IOUs"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "fname"
+        ];
+      rml:predicate <http://example.com/base/IOUs#fname>
+    ], [
+      rml:objectMap [
+          rml:reference "lname"
+        ];
+      rml:predicate <http://example.com/base/IOUs#lname>
+    ], [
+      rml:objectMap [
+          rml:reference "amount"
+        ];
+      rml:predicate <http://example.com/base/IOUs#amount>
+    ];
+  rml:subjectMap [
+      rml:class <http://example.com/base/IOUs>;
+      rml:template "{fname}_{lname}";
+      rml:termType rml:BlankNode
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
+  d2rq:password "YourSTRONG!Passw0rd;";
+  d2rq:username "sa" .
+
+

Output

+
_:Bob_Smith <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/base/IOUs> .
+_:Bob_Smith <http://example.com/base/IOUs#fname> "Bob" .
+_:Bob_Smith <http://example.com/base/IOUs#lname> "Smith" .
+_:Bob_Smith <http://example.com/base/IOUs#amount> "3.0E1"^^<http://www.w3.org/2001/XMLSchema#double> .
+_:Sue_Jones <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/base/IOUs> .
+_:Sue_Jones <http://example.com/base/IOUs#fname> "Sue" .
+_:Sue_Jones <http://example.com/base/IOUs#lname> "Jones" .
+_:Sue_Jones <http://example.com/base/IOUs#amount> "2.0E1"^^<http://www.w3.org/2001/XMLSchema#double> .
+    
+
+
+

106. RMLTC0006a-CSV

+

Title: "Long form of R2RML by using rr:constant in rr:subjectMap, rr:predicateMap, rr:objectMap and rr:graphMap"

+

Description: "Tests the use of rr:constant in rr:subjectMap, rr:predicateMap, rr:objectMap and rr:graphMap"

+

Error expected? No

+

Input

+
ID,FirstName,LastName
+10,Venus,Williams
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:referenceFormulation rml:CSV;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.csv"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:constant "Bad Student"
+        ];
+      rml:predicateMap [
+          rml:constant ex:description
+        ]
+    ];
+  rml:subjectMap [
+      rml:constant ex:BadStudent;
+      rml:graphMap [
+          rml:constant <http://example.com/graph/student>
+        ]
+    ] .
+
+

Output

+
<http://example.com/BadStudent> <http://example.com/description> "Bad Student" <http://example.com/graph/student> .
+
+
+

107. RMLTC0006a-JSON

+

Title: "Long form of R2RML by using rr:constant in rr:subjectMap, rr:predicateMap, rr:objectMap and rr:graphMap"

+

Description: "Tests the use of rr:constant in rr:subjectMap, rr:predicateMap, rr:objectMap and rr:graphMap"

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "FirstName":"Venus",
+    "LastName":"Williams"
+  }]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:constant "Bad Student"
+        ];
+      rml:predicateMap [
+          rml:constant ex:description
+        ]
+    ];
+  rml:subjectMap [
+      rml:constant ex:BadStudent;
+      rml:graphMap [
+          rml:constant <http://example.com/graph/student>
+        ]
+    ] .
+
+

Output

+
<http://example.com/BadStudent> <http://example.com/description> "Bad Student" <http://example.com/graph/student> .
+
+
+

108. RMLTC0006a-MySQL

+

Title: "Long form of R2RML by using rr:constant in rr:subjectMap, rr:predicateMap, rr:objectMap and rr:graphMap"

+

Description: "Tests the use of rr:constant in rr:subjectMap, rr:predicateMap, rr:objectMap and rr:graphMap"

+

Error expected? No

+

Input

+
USE test;
+DROP TABLE IF EXISTS test.student;
+
+CREATE TABLE student (
+  ID INTEGER,
+  FirstName VARCHAR(50),
+  LastName VARCHAR(50)
+);
+INSERT INTO student values ('10', 'Venus', 'Williams');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "student"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:constant "Bad Student"
+        ];
+      rml:predicateMap [
+          rml:constant ex:description
+        ]
+    ];
+  rml:subjectMap [
+      rml:constant ex:BadStudent;
+      rml:graphMap [
+          rml:constant <http://example.com/graph/student>
+        ]
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
+  d2rq:password "";
+  d2rq:username "root" .
+
+

Output

+
<http://example.com/BadStudent> <http://example.com/description> "Bad Student" <http://example.com/graph/student> .
+
+
+

109. RMLTC0006a-PostgreSQL

+

Title: "Long form of R2RML by using rr:constant in rr:subjectMap, rr:predicateMap, rr:objectMap and rr:graphMap"

+

Description: "Tests the use of rr:constant in rr:subjectMap, rr:predicateMap, rr:objectMap and rr:graphMap"

+

Error expected? No

+

Input

+
DROP TABLE IF EXISTS student;
+
+CREATE TABLE student (
+  "ID" INTEGER,
+  "FirstName" VARCHAR(50),
+  "LastName" VARCHAR(50)
+);
+INSERT INTO student values ('10', 'Venus', 'Williams');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "student"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:constant "Bad Student"
+        ];
+      rml:predicateMap [
+          rml:constant ex:description
+        ]
+    ];
+  rml:subjectMap [
+      rml:constant ex:BadStudent;
+      rml:graphMap [
+          rml:constant <http://example.com/graph/student>
+        ]
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "org.postgresql.Driver";
+  d2rq:password "";
+  d2rq:username "postgres" .
+
+

Output

+
<http://example.com/BadStudent> <http://example.com/description> "Bad Student" <http://example.com/graph/student> .
+
+
+

110. RMLTC0006a-SPARQL

+

Title: "rr:constant in rr:subjectMap, rr:predicateMap, rr:objectMap and rr:graphMap"

+

Description: "Tests the use of rr:constant in rr:subjectMap, rr:predicateMap, rr:objectMap and rr:graphMap"

+

Error expected? No

+

Input

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+
+[] rdf:ID "10" ;
+    foaf:firstName "Venus" ;
+    foaf:lastName "Williams" .
+
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix sd: <http://www.w3.org/ns/sparql-service-description#> .
+
+ex:TriplesMap1 a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator """
+            PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
+            PREFIX foaf: <http://xmlns.com/foaf/0.1/>
+            PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
+            SELECT ?BadStudent ?LastName ?ID
+            WHERE {
+
+            } """;
+      rml:referenceFormulation formats:SPARQL_Results_JSON;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path <http://example.com/base#InputSPARQL>
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:constant "Bad Student"
+        ];
+      rml:predicateMap [
+          rml:constant ex:description
+        ]
+    ];
+  rml:subjectMap [
+      rml:constant ex:BadStudent;
+      rml:graphMap [
+          rml:constant <http://example.com/graph/student>
+        ]
+    ] .
+
+<http://example.com/base#InputSPARQL> a sd:Service;
+  sd:endpoint <http://HOST:PORT/ds1/sparql>;
+  sd:supportedLanguage sd:SPARQL11Query .
+
+

Output

+
<http://example.com/BadStudent> <http://example.com/description> "Bad Student" <http://example.com/graph/student> .
+
+
+

111. RMLTC0006a-SQLServer

+

Title: "Long form of R2RML by using rr:constant in rr:subjectMap, rr:predicateMap, rr:objectMap and rr:graphMap"

+

Description: "Tests the use of rr:constant in rr:subjectMap, rr:predicateMap, rr:objectMap and rr:graphMap"

+

Error expected? No

+

Input

+
USE TestDB;
+DROP TABLE IF EXISTS student;
+CREATE TABLE student (
+  "ID" INTEGER,
+  "FirstName" VARCHAR(50),
+  "LastName" VARCHAR(50)
+);
+INSERT INTO student values ('10', 'Venus', 'Williams');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "student"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:constant "Bad Student"
+        ];
+      rml:predicateMap [
+          rml:constant ex:description
+        ]
+    ];
+  rml:subjectMap [
+      rml:constant ex:BadStudent;
+      rml:graphMap [
+          rml:constant <http://example.com/graph/student>
+        ]
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
+  d2rq:password "YourSTRONG!Passw0rd;";
+  d2rq:username "sa" .
+
+

Output

+
<http://example.com/BadStudent> <http://example.com/description> "Bad Student" <http://example.com/graph/student> .
+
+
+

112. RMLTC0006a-XML

+

Title: "Long form of R2RML by using rr:constant in rr:subjectMap, rr:predicateMap, rr:objectMap and rr:graphMap"

+

Description: "Tests the use of rr:constant in rr:subjectMap, rr:predicateMap, rr:objectMap and rr:graphMap"

+

Error expected? No

+

Input

+
<?xml version="1.0"?>
+
+<students>
+  <student>
+    <ID>10</ID>
+    <FirstName>Venus</FirstName>
+    <LastName>Williams</LastName>
+  </student>
+</students>
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "/students/student";
+      rml:referenceFormulation rml:XPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.xml"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:constant "Bad Student"
+        ];
+      rml:predicateMap [
+          rml:constant ex:description
+        ]
+    ];
+  rml:subjectMap [
+      rml:constant ex:BadStudent;
+      rml:graphMap [
+          rml:constant <http://example.com/graph/student>
+        ]
+    ] .
+
+

Output

+
<http://example.com/BadStudent> <http://example.com/description> "Bad Student" <http://example.com/graph/student> .
+
+
+

113. RMLTC0007a-CSV

+

Title: "Typing resources by relying on rdf:type predicate"

+

Description: "Tests the typing resources by relying on rdf:type predicate"

+

Error expected? No

+

Input

+
ID,FirstName,LastName
+10,Venus,Williams
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:referenceFormulation rml:CSV;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.csv"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:object foaf:Person;
+      rml:predicate rdf:type
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Student/{ID}/{FirstName}"
+    ] .
+
+

Output

+
 <http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+
+
+
+

114. RMLTC0007a-JSON

+

Title: "Typing resources by relying on rdf:type predicate"

+

Description: "Tests the typing resources by relying on rdf:type predicate"

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "FirstName":"Venus",
+    "LastName":"Williams"
+  }]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:object foaf:Person;
+      rml:predicate rdf:type
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Student/{$.ID}/{$.FirstName}"
+    ] .
+
+

Output

+
 <http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+
+
+
+

115. RMLTC0007a-MySQL

+

Title: "Typing resources by relying on rdf:type predicate"

+

Description: "Tests the typing resources by relying on rdf:type predicate"

+

Error expected? No

+

Input

+
USE test;
+DROP TABLE IF EXISTS test.student;
+
+CREATE TABLE student (
+  ID INTEGER,
+  FirstName VARCHAR(50),
+  LastName VARCHAR(50)
+);
+INSERT INTO student values ('10', 'Venus', 'Williams');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "student"
+    ];
+  rml:predicateObjectMap [
+      rml:object foaf:Person;
+      rml:predicate rdf:type
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Student/{ID}/{FirstName}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
+  d2rq:password "";
+  d2rq:username "root" .
+
+

Output

+
 <http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+
+
+
+

116. RMLTC0007a-PostgreSQL

+

Title: "Typing resources by relying on rdf:type predicate"

+

Description: "Tests the typing resources by relying on rdf:type predicate"

+

Error expected? No

+

Input

+
DROP TABLE IF EXISTS student;
+
+CREATE TABLE student (
+  "ID" INTEGER,
+  "FirstName" VARCHAR(50),
+  "LastName" VARCHAR(50)
+);
+INSERT INTO student values ('10', 'Venus', 'Williams');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "student"
+    ];
+  rml:predicateObjectMap [
+      rml:object foaf:Person;
+      rml:predicate rdf:type
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Student/{ID}/{FirstName}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "org.postgresql.Driver";
+  d2rq:password "";
+  d2rq:username "postgres" .
+
+

Output

+
 <http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+
+
+
+

117. RMLTC0007a-SPARQL

+

Title: "Typing resources by relying on rdf:type predicate"

+

Description: "Tests the typing resources by relying on rdf:type predicate"

+

Error expected? No

+

Input

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+
+[] rdf:ID "10" ;
+    foaf:firstName "Venus" ;
+    foaf:lastName "Williams" .
+
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix sd: <http://www.w3.org/ns/sparql-service-description#> .
+
+<http://example.com/base#Country> rml:logicalSource [
+      rml:iterator """
+            PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
+            PREFIX foaf: <http://xmlns.com/foaf/0.1/>
+            PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
+            SELECT ?FirstName ?LastName ?ID
+            WHERE {
+                ?x  foaf:firstName ?FirstName ;
+                    foaf:lastName  ?LastName ;
+                    rdf:ID         ?ID .
+            } """;
+      rml:referenceFormulation formats:SPARQL_Results_JSON;
+      rml:source <http://example.com/base#InputSPARQL>
+    ];
+  rml:predicateObjectMap [
+      rml:object foaf:Person;
+      rml:predicate rdf:type
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Student/{ID.value}/{FirstName.value}"
+    ] .
+
+<http://example.com/base#InputSPARQL> a sd:Service;
+  sd:endpoint <http://HOST:PORT/ds1/sparql>;
+  sd:supportedLanguage sd:SPARQL11Query .
+
+

Output

+
 <http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+
+
+
+

118. RMLTC0007a-SQLServer

+

Title: "Typing resources by relying on rdf:type predicate"

+

Description: "Tests the typing resources by relying on rdf:type predicate"

+

Error expected? No

+

Input

+
USE TestDB;
+DROP TABLE IF EXISTS student;
+CREATE TABLE student (
+  "ID" INTEGER,
+  "FirstName" VARCHAR(50),
+  "LastName" VARCHAR(50)
+);
+INSERT INTO student values ('10', 'Venus', 'Williams');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "student"
+    ];
+  rml:predicateObjectMap [
+      rml:object foaf:Person;
+      rml:predicate rdf:type
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Student/{ID}/{FirstName}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
+  d2rq:password "YourSTRONG!Passw0rd;";
+  d2rq:username "sa" .
+
+

Output

+
 <http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+
+
+
+

119. RMLTC0007a-XML

+

Title: "Typing resources by relying on rdf:type predicate"

+

Description: "Tests the typing resources by relying on rdf:type predicate"

+

Error expected? No

+

Input

+
<?xml version="1.0"?>
+
+<students>
+  <student>
+    <ID>10</ID>
+    <FirstName>Venus</FirstName>
+    <LastName>Williams</LastName>
+  </student>
+</students>
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "/students/student";
+      rml:referenceFormulation rml:XPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.xml"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:object foaf:Person;
+      rml:predicate rdf:type
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Student/{ID}/{FirstName}"
+    ] .
+
+

Output

+
 <http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+
+
+
+

120. RMLTC0007b-CSV

+

Title: "Assigning triples to Named Graphs"

+

Description: "Tests the generation of triples to a named graph"

+

Error expected? No

+

Input

+
ID,FirstName,LastName
+10,Venus,Williams
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:referenceFormulation rml:CSV;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.csv"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:object foaf:Person;
+      rml:predicate rdf:type
+    ], [
+      rml:objectMap [
+          rml:reference "FirstName"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:graph ex:PersonGraph;
+      rml:template "http://example.com/Student/{ID}/{FirstName}"
+    ] .
+
+

Output

+
<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" <http://example.com/PersonGraph> . 
+<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person>  <http://example.com/PersonGraph> .
+
+
+
+

121. RMLTC0007b-JSON

+

Title: "Assigning triples to Named Graphs"

+

Description: "Tests the generation of triples to a named graph"

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "FirstName":"Venus",
+    "LastName":"Williams"
+  }]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:object foaf:Person;
+      rml:predicate rdf:type
+    ], [
+      rml:objectMap [
+          rml:reference "$.FirstName"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:graph ex:PersonGraph;
+      rml:template "http://example.com/Student/{$.ID}/{$.FirstName}"
+    ] .
+
+

Output

+
<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" <http://example.com/PersonGraph> . 
+<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person>  <http://example.com/PersonGraph> .
+
+
+
+

122. RMLTC0007b-MySQL

+

Title: "Assigning triples to Named Graphs"

+

Description: "Tests the generation of triples to a named graph"

+

Error expected? No

+

Input

+
USE test;
+DROP TABLE IF EXISTS test.student;
+
+CREATE TABLE student (
+  ID INTEGER,
+  FirstName VARCHAR(50),
+  LastName VARCHAR(50)
+);
+INSERT INTO student values ('10', 'Venus', 'Williams');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "student"
+    ];
+  rml:predicateObjectMap [
+      rml:object foaf:Person;
+      rml:predicate rdf:type
+    ], [
+      rml:objectMap [
+          rml:reference "FirstName"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:graph ex:PersonGraph;
+      rml:template "http://example.com/Student/{ID}/{FirstName}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
+  d2rq:password "";
+  d2rq:username "root" .
+
+

Output

+
<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" <http://example.com/PersonGraph> . 
+<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person>  <http://example.com/PersonGraph> .
+
+
+
+

123. RMLTC0007b-PostgreSQL

+

Title: "Assigning triples to Named Graphs"

+

Description: "Tests the generation of triples to a named graph"

+

Error expected? No

+

Input

+
DROP TABLE IF EXISTS student;
+
+CREATE TABLE student (
+  "ID" INTEGER,
+  "FirstName" VARCHAR(50),
+  "LastName" VARCHAR(50)
+);
+INSERT INTO student values ('10', 'Venus', 'Williams');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "student"
+    ];
+  rml:predicateObjectMap [
+      rml:object foaf:Person;
+      rml:predicate rdf:type
+    ], [
+      rml:objectMap [
+          rml:reference "FirstName"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:graph ex:PersonGraph;
+      rml:template "http://example.com/Student/{ID}/{FirstName}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "org.postgresql.Driver";
+  d2rq:password "";
+  d2rq:username "postgres" .
+
+

Output

+
<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" <http://example.com/PersonGraph> . 
+<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person>  <http://example.com/PersonGraph> .
+
+
+
+

124. RMLTC0007b-SPARQL

+

Title: "Assigning triples to Named Graphs"

+

Description: "Tests the generation of triples to a named graph"

+

Error expected? No

+

Input

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+
+[] rdf:ID "10" ;
+    foaf:firstName "Venus" ;
+    foaf:lastName "Williams" .
+
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix sd: <http://www.w3.org/ns/sparql-service-description#> .
+
+<http://example.com/base#Country> rml:logicalSource [
+      rml:iterator """
+            PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
+            PREFIX foaf: <http://xmlns.com/foaf/0.1/>
+            PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
+            SELECT ?FirstName ?LastName ?ID
+            WHERE {
+                ?x  foaf:firstName ?FirstName ;
+                    foaf:lastName  ?LastName ;
+                    rdf:ID         ?ID .
+            } """;
+      rml:referenceFormulation formats:SPARQL_Results_JSON;
+      rml:source <http://example.com/base#InputSPARQL>
+    ];
+  rml:predicateObjectMap [
+      rml:object foaf:Person;
+      rml:predicate rdf:type
+    ], [
+      rml:objectMap [
+          rml:reference "FirstName.value"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:graph ex:PersonGraph;
+      rml:template "http://example.com/Student/{ID.value}/{FirstName.value}"
+    ] .
+
+<http://example.com/base#InputSPARQL> a sd:Service;
+  sd:endpoint <http://HOST:PORT/ds1/sparql>;
+  sd:supportedLanguage sd:SPARQL11Query .
+
+

Output

+
<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" <http://example.com/PersonGraph> . 
+<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person>  <http://example.com/PersonGraph> .
+
+
+
+

125. RMLTC0007b-SQLServer

+

Title: "Assigning triples to Named Graphs"

+

Description: "Tests the generation of triples to a named graph"

+

Error expected? No

+

Input

+
USE TestDB;
+DROP TABLE IF EXISTS student;
+CREATE TABLE student (
+  "ID" INTEGER,
+  "FirstName" VARCHAR(50),
+  "LastName" VARCHAR(50)
+);
+INSERT INTO student values ('10', 'Venus', 'Williams');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "student"
+    ];
+  rml:predicateObjectMap [
+      rml:object foaf:Person;
+      rml:predicate rdf:type
+    ], [
+      rml:objectMap [
+          rml:reference "FirstName"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:graph ex:PersonGraph;
+      rml:template "http://example.com/Student/{ID}/{FirstName}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
+  d2rq:password "YourSTRONG!Passw0rd;";
+  d2rq:username "sa" .
+
+

Output

+
<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" <http://example.com/PersonGraph> . 
+<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person>  <http://example.com/PersonGraph> .
+
+
+
+

126. RMLTC0007b-XML

+

Title: "Assigning triples to Named Graphs"

+

Description: "Tests the generation of triples to a named graph"

+

Error expected? No

+

Input

+
<?xml version="1.0"?>
+
+<students>
+  <student>
+    <ID>10</ID>
+    <FirstName>Venus</FirstName>
+    <LastName>Williams</LastName>
+  </student>
+</students>
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "/students/student";
+      rml:referenceFormulation rml:XPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.xml"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:object foaf:Person;
+      rml:predicate rdf:type
+    ], [
+      rml:objectMap [
+          rml:reference "FirstName"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:graph ex:PersonGraph;
+      rml:template "http://example.com/Student/{ID}/{FirstName}"
+    ] .
+
+

Output

+
<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" <http://example.com/PersonGraph> . 
+<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person>  <http://example.com/PersonGraph> .
+
+
+
+

127. RMLTC0007c-CSV

+

Title: "One row mapping, using rr:class"

+

Description: "Tests subjectmap with more than one class IRIs, rr:class"

+

Error expected? No

+

Input

+
ID,FirstName,LastName
+10,Venus,Williams
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:referenceFormulation rml:CSV;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.csv"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "ID"
+        ];
+      rml:predicate ex:id
+    ], [
+      rml:objectMap [
+          rml:reference "FirstName"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:class ex:Student, foaf:Person;
+      rml:template "http://example.com/Student/{ID}/{FirstName}"
+    ] .
+
+

Output

+
<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
+<http://example.com/Student/10/Venus> <http://example.com/id> "10" . 
+<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/Student> .
+
+
+
+

128. RMLTC0007c-JSON

+

Title: "One row mapping, using rr:class"

+

Description: "Tests subjectmap with more than one class IRIs, rr:class"

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "FirstName":"Venus",
+    "LastName":"Williams"
+  }]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.ID"
+        ];
+      rml:predicate ex:id
+    ], [
+      rml:objectMap [
+          rml:reference "$.FirstName"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:class ex:Student, foaf:Person;
+      rml:template "http://example.com/Student/{$.ID}/{$.FirstName}"
+    ] .
+
+

Output

+
<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
+<http://example.com/Student/10/Venus> <http://example.com/id> "10" . 
+<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/Student> .
+
+
+
+

129. RMLTC0007c-MySQL

+

Title: "One row mapping, using rr:class"

+

Description: "Tests subjectmap with more than one class IRIs, rr:class"

+

Error expected? No

+

Input

+
USE test;
+DROP TABLE IF EXISTS test.student;
+
+CREATE TABLE student (
+  ID INTEGER,
+  FirstName VARCHAR(50),
+  LastName VARCHAR(50)
+);
+INSERT INTO student values ('10', 'Venus', 'Williams');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "student"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "ID"
+        ];
+      rml:predicate ex:id
+    ], [
+      rml:objectMap [
+          rml:reference "FirstName"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:class ex:Student, foaf:Person;
+      rml:template "http://example.com/Student/{ID}/{FirstName}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
+  d2rq:password "";
+  d2rq:username "root" .
+
+

Output

+
<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
+<http://example.com/Student/10/Venus> <http://example.com/id> "10"^^<http://www.w3.org/2001/XMLSchema#integer> . 
+<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/Student> .
+
+
+
+

130. RMLTC0007c-PostgreSQL

+

Title: "One row mapping, using rr:class"

+

Description: "Tests subjectmap with more than one class IRIs, rr:class"

+

Error expected? No

+

Input

+
DROP TABLE IF EXISTS student;
+
+CREATE TABLE student (
+  "ID" INTEGER,
+  "FirstName" VARCHAR(50),
+  "LastName" VARCHAR(50)
+);
+INSERT INTO student values ('10', 'Venus', 'Williams');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "student"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "ID"
+        ];
+      rml:predicate ex:id
+    ], [
+      rml:objectMap [
+          rml:reference "FirstName"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:class ex:Student, foaf:Person;
+      rml:template "http://example.com/Student/{ID}/{FirstName}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "org.postgresql.Driver";
+  d2rq:password "";
+  d2rq:username "postgres" .
+
+

Output

+
<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
+<http://example.com/Student/10/Venus> <http://example.com/id> "10"^^<http://www.w3.org/2001/XMLSchema#integer> . 
+<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/Student> .
+
+
+
+

131. RMLTC0007c-SPARQL

+

Title: "One object mapping, using rr:class"

+

Description: "Tests subjectmap with more than one class IRIs, rr:class"

+

Error expected? No

+

Input

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+
+[] rdf:ID "10" ;
+    foaf:firstName "Venus" ;
+    foaf:lastName "Williams" .
+
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix sd: <http://www.w3.org/ns/sparql-service-description#> .
+
+<http://example.com/base#Country> rml:logicalSource [
+      rml:iterator """
+            PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
+            PREFIX foaf: <http://xmlns.com/foaf/0.1/>
+            PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
+            SELECT ?FirstName ?LastName ?ID
+            WHERE {
+                ?x  foaf:firstName ?FirstName ;
+                    foaf:lastName  ?LastName ;
+                    rdf:ID         ?ID .
+            } """;
+      rml:referenceFormulation formats:SPARQL_Results_JSON;
+      rml:source <http://example.com/base#InputSPARQL>
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "FirstName.value"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:class ex:Student, foaf:Person;
+      rml:template "http://example.com/Student/{ID.value}/{FirstName.value}"
+    ] .
+
+<http://example.com/base#InputSPARQL> a sd:Service;
+  sd:endpoint <http://HOST:PORT/ds1/sparql>;
+  sd:supportedLanguage sd:SPARQL11Query .
+
+

Output

+
<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" . 
+<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/Student> .
+
+
+
+

132. RMLTC0007c-SQLServer

+

Title: "One row mapping, using rr:class"

+

Description: "Tests subjectmap with more than one class IRIs, rr:class"

+

Error expected? No

+

Input

+
USE TestDB;
+DROP TABLE IF EXISTS student;
+CREATE TABLE student (
+  "ID" INTEGER,
+  "FirstName" VARCHAR(50),
+  "LastName" VARCHAR(50)
+);
+INSERT INTO student values ('10', 'Venus', 'Williams');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "student"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "ID"
+        ];
+      rml:predicate ex:id
+    ], [
+      rml:objectMap [
+          rml:reference "FirstName"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:class ex:Student, foaf:Person;
+      rml:template "http://example.com/Student/{ID}/{FirstName}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
+  d2rq:password "YourSTRONG!Passw0rd;";
+  d2rq:username "sa" .
+
+

Output

+
<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
+<http://example.com/Student/10/Venus> <http://example.com/id> "10"^^<http://www.w3.org/2001/XMLSchema#integer> . 
+<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/Student> .
+
+
+
+

133. RMLTC0007c-XML

+

Title: "One row mapping, using rr:class"

+

Description: "Tests subjectmap with more than one class IRIs, rr:class"

+

Error expected? No

+

Input

+
<?xml version="1.0"?>
+
+<students>
+  <student>
+    <ID>10</ID>
+    <FirstName>Venus</FirstName>
+    <LastName>Williams</LastName>
+  </student>
+</students>
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "/students/student";
+      rml:referenceFormulation rml:XPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.xml"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "ID"
+        ];
+      rml:predicate ex:id
+    ], [
+      rml:objectMap [
+          rml:reference "FirstName"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:class ex:Student, foaf:Person;
+      rml:template "http://example.com/Student/{ID}/{FirstName}"
+    ] .
+
+

Output

+
<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
+<http://example.com/Student/10/Venus> <http://example.com/id> "10" . 
+<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/Student> .
+
+
+
+

134. RMLTC0007d-CSV

+

Title: "One column mapping, specifying an rr:predicateObjectMap with rdf:type"

+

Description: "Tests subjectmap with an alternative of having rr:class, i.e., by specifying an rr:predicateObjectMap with predicate rdf:type"

+

Error expected? No

+

Input

+
ID,FirstName,LastName
+10,Venus,Williams
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:referenceFormulation rml:CSV;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.csv"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:object foaf:Person;
+      rml:predicate rdf:type
+    ], [
+      rml:object ex:Student;
+      rml:predicate rdf:type
+    ], [
+      rml:objectMap [
+          rml:reference "ID"
+        ];
+      rml:predicate ex:id
+    ], [
+      rml:objectMap [
+          rml:reference "FirstName"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Student/{ID}/{FirstName}"
+    ] .
+
+

Output

+
<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" . 
+<http://example.com/Student/10/Venus> <http://example.com/id> "10" .
+<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/Student> .
+
+
+
+

135. RMLTC0007d-JSON

+

Title: "One column mapping, specifying an rr:predicateObjectMap with rdf:type"

+

Description: "Tests subjectmap with an alternative of having rr:class, i.e., by specifying an rr:predicateObjectMap with predicate rdf:type"

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "FirstName":"Venus",
+    "LastName":"Williams"
+  }]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:object foaf:Person;
+      rml:predicate rdf:type
+    ], [
+      rml:object ex:Student;
+      rml:predicate rdf:type
+    ], [
+      rml:objectMap [
+          rml:reference "$.ID"
+        ];
+      rml:predicate ex:id
+    ], [
+      rml:objectMap [
+          rml:reference "$.FirstName"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Student/{$.ID}/{$.FirstName}"
+    ] .
+
+

Output

+
<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" . 
+<http://example.com/Student/10/Venus> <http://example.com/id> "10" .
+<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/Student> .
+
+
+
+

136. RMLTC0007d-MySQL

+

Title: "One column mapping, specifying an rr:predicateObjectMap with rdf:type"

+

Description: "Tests subjectmap with an alternative of having rr:class, i.e., by specifying an rr:predicateObjectMap with predicate rdf:type"

+

Error expected? No

+

Input

+
USE test;
+DROP TABLE IF EXISTS test.student;
+
+CREATE TABLE student (
+  ID INTEGER,
+  FirstName VARCHAR(50),
+  LastName VARCHAR(50)
+);
+INSERT INTO student values ('10', 'Venus', 'Williams');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "student"
+    ];
+  rml:predicateObjectMap [
+      rml:object foaf:Person;
+      rml:predicate rdf:type
+    ], [
+      rml:object ex:Student;
+      rml:predicate rdf:type
+    ], [
+      rml:objectMap [
+          rml:reference "ID"
+        ];
+      rml:predicate ex:id
+    ], [
+      rml:objectMap [
+          rml:reference "FirstName"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Student/{ID}/{FirstName}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
+  d2rq:password "";
+  d2rq:username "root" .
+
+

Output

+
<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
+<http://example.com/Student/10/Venus> <http://example.com/id> "10"^^<http://www.w3.org/2001/XMLSchema#integer> . 
+<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/Student> .
+
+
+
+

137. RMLTC0007d-PostgreSQL

+

Title: "One column mapping, specifying an rr:predicateObjectMap with rdf:type"

+

Description: "Tests subjectmap with an alternative of having rr:class, i.e., by specifying an rr:predicateObjectMap with predicate rdf:type"

+

Error expected? No

+

Input

+
DROP TABLE IF EXISTS student;
+
+CREATE TABLE student (
+  "ID" INTEGER,
+  "FirstName" VARCHAR(50),
+  "LastName" VARCHAR(50)
+);
+INSERT INTO student values ('10', 'Venus', 'Williams');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "student"
+    ];
+  rml:predicateObjectMap [
+      rml:object foaf:Person;
+      rml:predicate rdf:type
+    ], [
+      rml:object ex:Student;
+      rml:predicate rdf:type
+    ], [
+      rml:objectMap [
+          rml:reference "ID"
+        ];
+      rml:predicate ex:id
+    ], [
+      rml:objectMap [
+          rml:reference "FirstName"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Student/{ID}/{FirstName}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "org.postgresql.Driver";
+  d2rq:password "";
+  d2rq:username "postgres" .
+
+

Output

+
<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
+<http://example.com/Student/10/Venus> <http://example.com/id> "10"^^<http://www.w3.org/2001/XMLSchema#integer> . 
+<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/Student> .
+
+
+
+

138. RMLTC0007d-SPARQL

+

Title: "One object mapping, specifying an rr:predicateObjectMap with rdf:type"

+

Description: "Tests subjectmap with an alternative of having rr:class, i.e., by specifying an rr:predicateObjectMap with predicate rdf:type"

+

Error expected? No

+

Input

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+
+[] rdf:ID "10" ;
+    foaf:firstName "Venus" ;
+    foaf:lastName "Williams" .
+
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix sd: <http://www.w3.org/ns/sparql-service-description#> .
+
+<http://example.com/base#Country> rml:logicalSource [
+      rml:iterator """
+            PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
+            PREFIX foaf: <http://xmlns.com/foaf/0.1/>
+            PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
+            SELECT ?FirstName ?LastName ?ID
+            WHERE {
+                ?x  foaf:firstName ?FirstName ;
+                    foaf:lastName  ?LastName ;
+                    rdf:ID         ?ID .
+            } """;
+      rml:referenceFormulation formats:SPARQL_Results_JSON;
+      rml:source <http://example.com/base#InputSPARQL>
+    ];
+  rml:predicateObjectMap [
+      rml:object foaf:Person;
+      rml:predicate rdf:type
+    ], [
+      rml:object ex:Student;
+      rml:predicate rdf:type
+    ], [
+      rml:objectMap [
+          rml:reference "FirstName.value"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Student/{ID.value}/{FirstName.value}"
+    ] .
+
+<http://example.com/base#InputSPARQL> a sd:Service;
+  sd:endpoint <http://HOST:PORT/ds1/sparql>;
+  sd:supportedLanguage sd:SPARQL11Query .
+
+

Output

+
<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" . 
+<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/Student> .
+
+
+
+

139. RMLTC0007d-SQLServer

+

Title: "One column mapping, specifying an rr:predicateObjectMap with rdf:type"

+

Description: "Tests subjectmap with an alternative of having rr:class, i.e., by specifying an rr:predicateObjectMap with predicate rdf:type"

+

Error expected? No

+

Input

+
USE TestDB;
+DROP TABLE IF EXISTS student;
+CREATE TABLE student (
+  "ID" INTEGER,
+  "FirstName" VARCHAR(50),
+  "LastName" VARCHAR(50)
+);
+INSERT INTO student values ('10', 'Venus', 'Williams');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "student"
+    ];
+  rml:predicateObjectMap [
+      rml:object foaf:Person;
+      rml:predicate rdf:type
+    ], [
+      rml:object ex:Student;
+      rml:predicate rdf:type
+    ], [
+      rml:objectMap [
+          rml:reference "ID"
+        ];
+      rml:predicate ex:id
+    ], [
+      rml:objectMap [
+          rml:reference "FirstName"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Student/{ID}/{FirstName}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
+  d2rq:password "YourSTRONG!Passw0rd;";
+  d2rq:username "sa" .
+
+

Output

+
<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
+<http://example.com/Student/10/Venus> <http://example.com/id> "10"^^<http://www.w3.org/2001/XMLSchema#integer> . 
+<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/Student> .
+
+
+
+

140. RMLTC0007d-XML

+

Title: "One column mapping, specifying an rr:predicateObjectMap with rdf:type"

+

Description: "Tests subjectmap with an alternative of having rr:class, i.e., by specifying an rr:predicateObjectMap with predicate rdf:type"

+

Error expected? No

+

Input

+
<?xml version="1.0"?>
+
+<students>
+  <student>
+    <ID>10</ID>
+    <FirstName>Venus</FirstName>
+    <LastName>Williams</LastName>
+  </student>
+</students>
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "/students/student";
+      rml:referenceFormulation rml:XPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.xml"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:object foaf:Person;
+      rml:predicate rdf:type
+    ], [
+      rml:object ex:Student;
+      rml:predicate rdf:type
+    ], [
+      rml:objectMap [
+          rml:reference "ID"
+        ];
+      rml:predicate ex:id
+    ], [
+      rml:objectMap [
+          rml:reference "FirstName"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Student/{ID}/{FirstName}"
+    ] .
+
+

Output

+
<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" . 
+<http://example.com/Student/10/Venus> <http://example.com/id> "10" .
+<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/Student> .
+
+
+
+

141. RMLTC0007e-CSV

+

Title: "One column mapping, using rr:graphMap and rr:class"

+

Description: "Tests subjectmap with rr:graphMap and rr:class"

+

Error expected? No

+

Input

+
ID,Name
+10,Venus
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:referenceFormulation rml:CSV;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.csv"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "ID"
+        ];
+      rml:predicate ex:id
+    ], [
+      rml:objectMap [
+          rml:reference "Name"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:class foaf:Person;
+      rml:graph ex:PersonGraph;
+      rml:template "http://example.com/Student/{ID}/{Name}"
+    ] .
+
+

Output

+
<http://example.com/Student/10/Venus> <http://example.com/id> "10" <http://example.com/PersonGraph> .
+<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" <http://example.com/PersonGraph> .
+<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> <http://example.com/PersonGraph> .
+
+
+
+

142. RMLTC0007e-JSON

+

Title: "One column mapping, using rr:graphMap and rr:class"

+

Description: "Tests subjectmap with rr:graphMap and rr:class"

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "Name":"Venus"
+  }]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.ID"
+        ];
+      rml:predicate ex:id
+    ], [
+      rml:objectMap [
+          rml:reference "$.Name"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:class foaf:Person;
+      rml:graph ex:PersonGraph;
+      rml:template "http://example.com/Student/{$.ID}/{$.Name}"
+    ] .
+
+

Output

+
<http://example.com/Student/10/Venus> <http://example.com/id> "10" <http://example.com/PersonGraph> .
+<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" <http://example.com/PersonGraph> .
+<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> <http://example.com/PersonGraph> .
+
+
+
+

143. RMLTC0007e-MySQL

+

Title: "One column mapping, using rr:graphMap and rr:class"

+

Description: "Tests subjectmap with rr:graphMap and rr:class"

+

Error expected? No

+

Input

+
USE test;
+DROP TABLE IF EXISTS test.student;
+
+CREATE TABLE student (
+  ID INTEGER,
+  FirstName VARCHAR(50),
+  LastName VARCHAR(50)
+);
+INSERT INTO student values ('10', 'Venus', 'Williams');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "student"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "ID"
+        ];
+      rml:predicate ex:id
+    ], [
+      rml:objectMap [
+          rml:reference "FirstName"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:class foaf:Person;
+      rml:graph ex:PersonGraph;
+      rml:template "http://example.com/Student/{ID}/{FirstName}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
+  d2rq:password "";
+  d2rq:username "root" .
+
+

Output

+
<http://example.com/Student/10/Venus> <http://example.com/id> "10"^^<http://www.w3.org/2001/XMLSchema#integer> <http://example.com/PersonGraph> .
+<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" <http://example.com/PersonGraph> .
+<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> <http://example.com/PersonGraph> .
+
+
+
+

144. RMLTC0007e-PostgreSQL

+

Title: "One column mapping, using rr:graphMap and rr:class"

+

Description: "Tests subjectmap with rr:graphMap and rr:class"

+

Error expected? No

+

Input

+
DROP TABLE IF EXISTS student;
+
+CREATE TABLE student (
+  "ID" INTEGER,
+  "FirstName" VARCHAR(50),
+  "LastName" VARCHAR(50)
+);
+INSERT INTO student values ('10', 'Venus', 'Williams');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "student"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "ID"
+        ];
+      rml:predicate ex:id
+    ], [
+      rml:objectMap [
+          rml:reference "FirstName"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:class foaf:Person;
+      rml:graph ex:PersonGraph;
+      rml:template "http://example.com/Student/{ID}/{FirstName}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "org.postgresql.Driver";
+  d2rq:password "";
+  d2rq:username "postgres" .
+
+

Output

+
<http://example.com/Student/10/Venus> <http://example.com/id> "10"^^<http://www.w3.org/2001/XMLSchema#integer> <http://example.com/PersonGraph> .
+<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" <http://example.com/PersonGraph> .
+<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> <http://example.com/PersonGraph> .
+
+
+
+

145. RMLTC0007e-SPARQL

+

Title: "One object mapping, using rr:graphMap and rr:class"

+

Description: "Tests subjectmap with rr:graphMap and rr:class"

+

Error expected? No

+

Input

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+
+[] rdf:ID "10" ;
+    foaf:firstName "Venus" ;
+    foaf:lastName "Williams" .
+
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix sd: <http://www.w3.org/ns/sparql-service-description#> .
+
+<http://example.com/base#Country> rml:logicalSource [
+      rml:iterator """
+            PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
+            PREFIX foaf: <http://xmlns.com/foaf/0.1/>
+            PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
+            SELECT ?FirstName ?LastName ?ID
+            WHERE {
+                ?x  foaf:firstName ?FirstName ;
+                    foaf:lastName  ?LastName ;
+                    rdf:ID         ?ID .
+            } """;
+      rml:referenceFormulation formats:SPARQL_Results_JSON;
+      rml:source <http://example.com/base#InputSPARQL>
+    ];
+  rml:subjectMap [
+      rml:class foaf:Person;
+      rml:graph ex:PersonGraph;
+      rml:template "http://example.com/Student/{ID.value}/{FirstName.value}"
+    ] .
+
+<http://example.com/base#InputSPARQL> a sd:Service;
+  sd:endpoint <http://HOST:PORT/ds1/sparql>;
+  sd:supportedLanguage sd:SPARQL11Query .
+
+

Output

+
<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> <http://example.com/PersonGraph> .
+
+
+
+

146. RMLTC0007e-SQLServer

+

Title: "One column mapping, using rr:graphMap and rr:class"

+

Description: "Tests subjectmap with rr:graphMap and rr:class"

+

Error expected? No

+

Input

+
USE TestDB;
+DROP TABLE IF EXISTS student;
+CREATE TABLE student (
+  "ID" INTEGER,
+  "FirstName" VARCHAR(50),
+  "LastName" VARCHAR(50)
+);
+INSERT INTO student values ('10', 'Venus', 'Williams');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "student"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "ID"
+        ];
+      rml:predicate ex:id
+    ], [
+      rml:objectMap [
+          rml:reference "FirstName"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:class foaf:Person;
+      rml:graph ex:PersonGraph;
+      rml:template "http://example.com/Student/{ID}/{FirstName}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
+  d2rq:password "YourSTRONG!Passw0rd;";
+  d2rq:username "sa" .
+
+

Output

+
<http://example.com/Student/10/Venus> <http://example.com/id> "10"^^<http://www.w3.org/2001/XMLSchema#integer> <http://example.com/PersonGraph> .
+<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" <http://example.com/PersonGraph> .
+<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> <http://example.com/PersonGraph> .
+
+
+
+

147. RMLTC0007e-XML

+

Title: "One column mapping, using rr:graphMap and rr:class"

+

Description: "Tests subjectmap with rr:graphMap and rr:class"

+

Error expected? No

+

Input

+
<?xml version="1.0"?>
+
+<students>
+  <student>
+    <ID>10</ID>
+    <Name>Venus</Name>
+  </student>
+</students>
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "/students/student";
+      rml:referenceFormulation rml:XPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.xml"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "ID"
+        ];
+      rml:predicate ex:id
+    ], [
+      rml:objectMap [
+          rml:reference "Name"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:class foaf:Person;
+      rml:graph ex:PersonGraph;
+      rml:template "http://example.com/Student/{ID}/{Name}"
+    ] .
+
+

Output

+
<http://example.com/Student/10/Venus> <http://example.com/id> "10" <http://example.com/PersonGraph> .
+<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" <http://example.com/PersonGraph> .
+<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> <http://example.com/PersonGraph> .
+
+
+
+

148. RMLTC0007f-CSV

+

Title: "One column mapping, using rr:graphMap and specifying an rr:predicateObjectMap with rdf:type"

+

Description: "Tests subjectmap with rr:graphMap and specifying an rr:predicateObjectMap with predicate rdf:type"

+

Error expected? No

+

Input

+
ID,FirstName,LastName
+10,Venus,Williams
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:referenceFormulation rml:CSV;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.csv"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:object foaf:Person;
+      rml:predicate rdf:type
+    ], [
+      rml:objectMap [
+          rml:reference "ID"
+        ];
+      rml:predicate ex:id
+    ], [
+      rml:objectMap [
+          rml:reference "FirstName"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:graph ex:PersonGraph;
+      rml:template "http://example.com/Student/{ID}/{FirstName}"
+    ] .
+
+

Output

+
<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> <http://example.com/PersonGraph> .
+<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" <http://example.com/PersonGraph> .
+<http://example.com/Student/10/Venus> <http://example.com/id> "10" <http://example.com/PersonGraph> .
+
+
+
+

149. RMLTC0007f-JSON

+

Title: "One column mapping, using rr:graphMap and specifying an rr:predicateObjectMap with rdf:type"

+

Description: "Tests subjectmap with rr:graphMap and specifying an rr:predicateObjectMap with predicate rdf:type"

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "FirstName":"Venus",
+    "LastName":"Williams"
+  }]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:object foaf:Person;
+      rml:predicate rdf:type
+    ], [
+      rml:objectMap [
+          rml:reference "$.ID"
+        ];
+      rml:predicate ex:id
+    ], [
+      rml:objectMap [
+          rml:reference "$.FirstName"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:graph ex:PersonGraph;
+      rml:template "http://example.com/Student/{$.ID}/{$.FirstName}"
+    ] .
+
+

Output

+
<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> <http://example.com/PersonGraph> .
+<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" <http://example.com/PersonGraph> .
+<http://example.com/Student/10/Venus> <http://example.com/id> "10" <http://example.com/PersonGraph> .
+
+
+
+

150. RMLTC0007f-MySQL

+

Title: "One column mapping, using rr:graphMap and specifying an rr:predicateObjectMap with rdf:type"

+

Description: "Tests subjectmap with rr:graphMap and specifying an rr:predicateObjectMap with predicate rdf:type"

+

Error expected? No

+

Input

+
USE test;
+DROP TABLE IF EXISTS test.student;
+
+CREATE TABLE student (
+  ID INTEGER,
+  FirstName VARCHAR(50),
+  LastName VARCHAR(50)
+);
+INSERT INTO student values ('10', 'Venus', 'Williams');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "student"
+    ];
+  rml:predicateObjectMap [
+      rml:object foaf:Person;
+      rml:predicate rdf:type
+    ], [
+      rml:objectMap [
+          rml:reference "ID"
+        ];
+      rml:predicate ex:id
+    ], [
+      rml:objectMap [
+          rml:reference "FirstName"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:graph ex:PersonGraph;
+      rml:template "http://example.com/Student/{ID}/{FirstName}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
+  d2rq:password "";
+  d2rq:username "root" .
+
+

Output

+
<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> <http://example.com/PersonGraph> .
+<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" <http://example.com/PersonGraph> .
+<http://example.com/Student/10/Venus> <http://example.com/id> "10"^^<http://www.w3.org/2001/XMLSchema#integer> <http://example.com/PersonGraph> .
+
+
+
+

151. RMLTC0007f-PostgreSQL

+

Title: "One column mapping, using rr:graphMap and specifying an rr:predicateObjectMap with rdf:type"

+

Description: "Tests subjectmap with rr:graphMap and specifying an rr:predicateObjectMap with predicate rdf:type"

+

Error expected? No

+

Input

+
DROP TABLE IF EXISTS student;
+
+CREATE TABLE student (
+  "ID" INTEGER,
+  "FirstName" VARCHAR(50),
+  "LastName" VARCHAR(50)
+);
+INSERT INTO student values ('10', 'Venus', 'Williams');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "student"
+    ];
+  rml:predicateObjectMap [
+      rml:object foaf:Person;
+      rml:predicate rdf:type
+    ], [
+      rml:objectMap [
+          rml:reference "ID"
+        ];
+      rml:predicate ex:id
+    ], [
+      rml:objectMap [
+          rml:reference "FirstName"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:graph ex:PersonGraph;
+      rml:template "http://example.com/Student/{ID}/{FirstName}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "org.postgresql.Driver";
+  d2rq:password "";
+  d2rq:username "postgres" .
+
+

Output

+
<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> <http://example.com/PersonGraph> .
+<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" <http://example.com/PersonGraph> .
+<http://example.com/Student/10/Venus> <http://example.com/id> "10"^^<http://www.w3.org/2001/XMLSchema#integer> <http://example.com/PersonGraph> .
+
+
+
+

152. RMLTC0007f-SPARQL

+

Title: "One object mapping, using rr:graphMap and specifying an rr:predicateObjectMap with rdf:type"

+

Description: "Tests subjectmap with rr:graphMap and specifying an rr:predicateObjectMap with predicate rdf:type"

+

Error expected? No

+

Input

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+
+[] rdf:ID "10" ;
+    foaf:firstName "Venus" ;
+    foaf:lastName "Williams" .
+
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix sd: <http://www.w3.org/ns/sparql-service-description#> .
+
+<http://example.com/base#Country> rml:logicalSource [
+      rml:iterator """
+            PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
+            PREFIX foaf: <http://xmlns.com/foaf/0.1/>
+            PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
+            SELECT ?FirstName ?LastName ?ID
+            WHERE {
+                ?x  foaf:firstName ?FirstName ;
+                    foaf:lastName  ?LastName ;
+                    rdf:ID         ?ID .
+            } """;
+      rml:referenceFormulation formats:SPARQL_Results_JSON;
+      rml:source <http://example.com/base#InputSPARQL>
+    ];
+  rml:predicateObjectMap [
+      rml:object foaf:Person;
+      rml:predicate rdf:type
+    ];
+  rml:subjectMap [
+      rml:graph ex:PersonGraph;
+      rml:template "http://example.com/Student/{ID.value}/{FirstName.value}"
+    ] .
+
+<http://example.com/base#InputSPARQL> a sd:Service;
+  sd:endpoint <http://HOST:PORT/ds1/sparql>;
+  sd:supportedLanguage sd:SPARQL11Query .
+
+

Output

+
<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> <http://example.com/PersonGraph> .
+
+
+
+

153. RMLTC0007f-SQLServer

+

Title: "One column mapping, using rr:graphMap and specifying an rr:predicateObjectMap with rdf:type"

+

Description: "Tests subjectmap with rr:graphMap and specifying an rr:predicateObjectMap with predicate rdf:type"

+

Error expected? No

+

Input

+
USE TestDB;
+DROP TABLE IF EXISTS student;
+CREATE TABLE student (
+  "ID" INTEGER,
+  "FirstName" VARCHAR(50),
+  "LastName" VARCHAR(50)
+);
+INSERT INTO student values ('10', 'Venus', 'Williams');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "student"
+    ];
+  rml:predicateObjectMap [
+      rml:object foaf:Person;
+      rml:predicate rdf:type
+    ], [
+      rml:objectMap [
+          rml:reference "ID"
+        ];
+      rml:predicate ex:id
+    ], [
+      rml:objectMap [
+          rml:reference "FirstName"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:graph ex:PersonGraph;
+      rml:template "http://example.com/Student/{ID}/{FirstName}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
+  d2rq:password "YourSTRONG!Passw0rd;";
+  d2rq:username "sa" .
+
+

Output

+
<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> <http://example.com/PersonGraph> .
+<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" <http://example.com/PersonGraph> .
+<http://example.com/Student/10/Venus> <http://example.com/id> "10"^^<http://www.w3.org/2001/XMLSchema#integer> <http://example.com/PersonGraph> .
+
+
+
+

154. RMLTC0007f-XML

+

Title: "One column mapping, using rr:graphMap and specifying an rr:predicateObjectMap with rdf:type"

+

Description: "Tests subjectmap with rr:graphMap and specifying an rr:predicateObjectMap with predicate rdf:type"

+

Error expected? No

+

Input

+
<?xml version="1.0"?>
+
+<students>
+  <student>
+    <ID>10</ID>
+    <FirstName>Venus</FirstName>
+    <LastName>Williams</LastName>
+  </student>
+</students>
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "/students/student";
+      rml:referenceFormulation rml:XPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.xml"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:object foaf:Person;
+      rml:predicate rdf:type
+    ], [
+      rml:objectMap [
+          rml:reference "ID"
+        ];
+      rml:predicate ex:id
+    ], [
+      rml:objectMap [
+          rml:reference "FirstName"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:graph ex:PersonGraph;
+      rml:template "http://example.com/Student/{ID}/{FirstName}"
+    ] .
+
+

Output

+
<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> <http://example.com/PersonGraph> .
+<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" <http://example.com/PersonGraph> .
+<http://example.com/Student/10/Venus> <http://example.com/id> "10" <http://example.com/PersonGraph> .
+
+
+
+

155. RMLTC0007g-CSV

+

Title: "Assigning triples to the default graph"

+

Description: "Tests the generation of triples to the default graph"

+

Error expected? No

+

Input

+
ID,FirstName,LastName
+10,Venus,Williams
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:referenceFormulation rml:CSV;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.csv"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "FirstName"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:graph rml:defaultGraph;
+      rml:template "http://example.com/Student/{ID}/{FirstName}"
+    ] .
+
+

Output

+
<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
+
+
+
+

156. RMLTC0007g-JSON

+

Title: "Assigning triples to the default graph"

+

Description: "Tests the generation of triples to the default graph"

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "FirstName":"Venus",
+    "LastName":"Williams"
+  }]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.FirstName"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:graph rml:defaultGraph;
+      rml:template "http://example.com/Student/{$.ID}/{$.FirstName}"
+    ] .
+
+

Output

+
<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
+
+
+
+

157. RMLTC0007g-MySQL

+

Title: "Assigning triples to the default graph"

+

Description: "Tests the generation of triples to the default graph"

+

Error expected? No

+

Input

+
USE test;
+DROP TABLE IF EXISTS test.student;
+
+CREATE TABLE student (
+  ID INTEGER,
+  FirstName VARCHAR(50),
+  LastName VARCHAR(50)
+);
+INSERT INTO student values ('10', 'Venus', 'Williams');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "student"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "FirstName"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:graph rml:defaultGraph;
+      rml:template "http://example.com/Student/{ID}/{FirstName}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
+  d2rq:password "";
+  d2rq:username "root" .
+
+

Output

+
<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
+
+
+
+

158. RMLTC0007g-PostgreSQL

+

Title: "Assigning triples to the default graph"

+

Description: "Tests the generation of triples to the default graph"

+

Error expected? No

+

Input

+
DROP TABLE IF EXISTS student;
+
+CREATE TABLE student (
+  "ID" INTEGER,
+  "FirstName" VARCHAR(50),
+  "LastName" VARCHAR(50)
+);
+INSERT INTO student values ('10', 'Venus', 'Williams');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "student"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "FirstName"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:graph rml:defaultGraph;
+      rml:template "http://example.com/Student/{ID}/{FirstName}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "org.postgresql.Driver";
+  d2rq:password "";
+  d2rq:username "postgres" .
+
+

Output

+
<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
+
+
+
+

159. RMLTC0007g-SPARQL

+

Title: "Assigning triples to the default graph"

+

Description: "Tests the generation of triples to the default graph"

+

Error expected? No

+

Input

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+
+[] rdf:ID "10" ;
+    foaf:firstName "Venus" ;
+    foaf:lastName "Williams" .
+
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix sd: <http://www.w3.org/ns/sparql-service-description#> .
+
+<http://example.com/base#Country> rml:logicalSource [
+      rml:iterator """
+            PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
+            PREFIX foaf: <http://xmlns.com/foaf/0.1/>
+            PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
+            SELECT ?FirstName ?LastName ?ID
+            WHERE {
+                ?x  foaf:firstName ?FirstName ;
+                    foaf:lastName  ?LastName ;
+                    rdf:ID         ?ID .
+            } """;
+      rml:referenceFormulation formats:SPARQL_Results_JSON;
+      rml:source <http://example.com/base#InputSPARQL>
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "FirstName.value"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:graph rml:defaultGraph;
+      rml:template "http://example.com/Student/{ID.value}/{FirstName.value}"
+    ] .
+
+<http://example.com/base#InputSPARQL> a sd:Service;
+  sd:endpoint <http://HOST:PORT/ds1/sparql>;
+  sd:supportedLanguage sd:SPARQL11Query .
+
+

Output

+
<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
+
+
+
+

160. RMLTC0007g-SQLServer

+

Title: "Assigning triples to the default graph"

+

Description: "Tests the generation of triples to the default graph"

+

Error expected? No

+

Input

+
USE TestDB;
+DROP TABLE IF EXISTS student;
+CREATE TABLE student (
+  "ID" INTEGER,
+  "FirstName" VARCHAR(50),
+  "LastName" VARCHAR(50)
+);
+INSERT INTO student values ('10', 'Venus', 'Williams');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "student"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "FirstName"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:graph rml:defaultGraph;
+      rml:template "http://example.com/Student/{ID}/{FirstName}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
+  d2rq:password "YourSTRONG!Passw0rd;";
+  d2rq:username "sa" .
+
+

Output

+
<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
+
+
+
+

161. RMLTC0007g-XML

+

Title: "Assigning triples to the default graph"

+

Description: "Tests the generation of triples to the default graph"

+

Error expected? No

+

Input

+
<?xml version="1.0"?>
+
+<students>
+  <student>
+    <ID>10</ID>
+    <FirstName>Venus</FirstName>
+    <LastName>Williams</LastName>
+  </student>
+</students>
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "/students/student";
+      rml:referenceFormulation rml:XPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.xml"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "FirstName"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:graph rml:defaultGraph;
+      rml:template "http://example.com/Student/{ID}/{FirstName}"
+    ] .
+
+

Output

+
<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
+
+
+
+

162. RMLTC0007h-CSV

+

Title: "Assigning triples to a non-IRI named graph"

+

Description: "Tests the generation of triples to a non-IRI named graph, which is an error"

+

Error expected? Yes

+

Input

+
ID,FirstName,LastName
+10,Venus,Williams
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:referenceFormulation rml:CSV;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.csv"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "Name"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:graphMap [
+          rml:reference "Name";
+          rml:termType rml:Literal
+        ];
+      rml:template "http://example.com/Student/{ID}/{FirstName}"
+    ] .
+
+
+

163. RMLTC0007h-JSON

+

Title: "Assigning triples to a non-IRI named graph"

+

Description: "Tests the generation of triples to a non-IRI named graph, which is an error"

+

Error expected? Yes

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "FirstName":"Venus",
+    "LastName":"Williams"
+  }]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.Name"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:graphMap [
+          rml:reference "$.Name";
+          rml:termType rml:Literal
+        ];
+      rml:template "http://example.com/Student/{$.ID}/{$.FirstName}"
+    ] .
+
+
+

164. RMLTC0007h-MySQL

+

Title: "Assigning triples to a non-IRI named graph"

+

Description: "Tests the generation of triples to a non-IRI named graph, which is an error"

+

Error expected? Yes

+

Input

+
USE test;
+DROP TABLE IF EXISTS test.student;
+
+CREATE TABLE student (
+  ID INTEGER,
+  FirstName VARCHAR(50),
+  LastName VARCHAR(50)
+);
+INSERT INTO student values ('10', 'Venus', 'Williams');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "student"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "Name"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:graphMap [
+          rml:reference "Name";
+          rml:termType rml:Literal
+        ];
+      rml:template "http://example.com/Student/{ID}/{FirstName}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
+  d2rq:password "";
+  d2rq:username "root" .
+
+
+

165. RMLTC0007h-PostgreSQL

+

Title: "Assigning triples to a non-IRI named graph"

+

Description: "Tests the generation of triples to a non-IRI named graph, which is an error"

+

Error expected? Yes

+

Input

+
DROP TABLE IF EXISTS student;
+
+CREATE TABLE student (
+  "ID" INTEGER,
+  "FirstName" VARCHAR(50),
+  "LastName" VARCHAR(50)
+);
+INSERT INTO student values ('10', 'Venus', 'Williams');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "student"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "Name"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:graphMap [
+          rml:reference "Name";
+          rml:termType rml:Literal
+        ];
+      rml:template "http://example.com/Student/{ID}/{FirstName}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "org.postgresql.Driver";
+  d2rq:password "";
+  d2rq:username "postgres" .
+
+
+

166. RMLTC0007h-SPARQL

+

Title: "Assigning triples to a non-IRI named graph"

+

Description: "Tests the generation of triples to a non-IRI named graph, which is an error"

+

Error expected? Yes

+

Input

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+
+[] rdf:ID "10" ;
+    foaf:firstName "Venus" ;
+    foaf:lastName "Williams" .
+
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix sd: <http://www.w3.org/ns/sparql-service-description#> .
+
+<http://example.com/base#Country> rml:logicalSource [
+      rml:iterator """
+            PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
+            PREFIX foaf: <http://xmlns.com/foaf/0.1/>
+            PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
+            SELECT ?FirstName ?LastName ?ID
+            WHERE {
+                ?x  foaf:firstName ?FirstName ;
+                    foaf:lastName  ?LastName ;
+                    rdf:ID         ?ID .
+            } """;
+      rml:referenceFormulation formats:SPARQL_Results_JSON;
+      rml:source <http://example.com/base#InputSPARQL>
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "Name.value"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:graphMap [
+          rml:reference "Name";
+          rml:termType rml:Literal
+        ];
+      rml:template "http://example.com/Student/{ID.value}/{FirstName.value}"
+    ] .
+
+<http://example.com/base#InputSPARQL> a sd:Service;
+  sd:endpoint <http://HOST:PORT/ds1/sparql>;
+  sd:supportedLanguage sd:SPARQL11Query .
+
+
+

167. RMLTC0007h-SQLServer

+

Title: "Assigning triples to a non-IRI named graph"

+

Description: "Tests the generation of triples to a non-IRI named graph, which is an error"

+

Error expected? Yes

+

Input

+
USE TestDB;
+DROP TABLE IF EXISTS student;
+CREATE TABLE student (
+  "ID" INTEGER,
+  "FirstName" VARCHAR(50),
+  "LastName" VARCHAR(50)
+);
+INSERT INTO student values ('10', 'Venus', 'Williams');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "student"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "Name"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:graphMap [
+          rml:reference "Name";
+          rml:termType rml:Literal
+        ];
+      rml:template "http://example.com/Student/{ID}/{FirstName}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
+  d2rq:password "YourSTRONG!Passw0rd;";
+  d2rq:username "sa" .
+
+
+

168. RMLTC0007h-XML

+

Title: "Assigning triples to a non-IRI named graph"

+

Description: "Tests the generation of triples to a non-IRI named graph, which is an error"

+

Error expected? Yes

+

Input

+
<?xml version="1.0"?>
+
+<students>
+  <student>
+    <ID>10</ID>
+    <FirstName>Venus</FirstName>
+    <LastName>Williams</LastName>
+  </student>
+</students>
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "/students/student";
+      rml:referenceFormulation rml:XPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.xml"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "Name"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:graphMap [
+          rml:reference "Name";
+          rml:termType rml:Literal
+        ];
+      rml:template "http://example.com/Student/{ID}/{FirstName}"
+    ] .
+
+
+

169. RMLTC0008a-CSV

+

Title: "Generation of triples to a target graph by using rr:graphMap and rr:template"

+

Description: "Test that results of the mapping can be directed to a target graph by using rr:graphMap and rr:template"

+

Error expected? No

+

Input

+
ID,Name,Sport
+10,Venus Williams,Tennis
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:referenceFormulation rml:CSV;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.csv"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:object foaf:Person;
+      rml:predicate rdf:type
+    ], [
+      rml:objectMap [
+          rml:reference "ID"
+        ];
+      rml:predicate ex:id
+    ], [
+      rml:objectMap [
+          rml:reference "Name"
+        ];
+      rml:predicate foaf:name
+    ], [
+      rml:objectMap [
+          rml:reference "Sport"
+        ];
+      rml:predicate ex:Sport
+    ];
+  rml:subjectMap [
+      rml:graphMap [
+          rml:template "http://example.com/graph/Student/{ID}/{Name}"
+        ];
+      rml:template "http://example.com/Student/{ID}/{Name}"
+    ] .
+
+

Output

+
<http://example.com/Student/10/Venus%20Williams> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> <http://example.com/graph/Student/10/Venus%20Williams> .
+<http://example.com/Student/10/Venus%20Williams> <http://xmlns.com/foaf/0.1/name> "Venus Williams" <http://example.com/graph/Student/10/Venus%20Williams> .
+<http://example.com/Student/10/Venus%20Williams> <http://example.com/id> "10" <http://example.com/graph/Student/10/Venus%20Williams> . 
+<http://example.com/Student/10/Venus%20Williams> <http://example.com/Sport> "Tennis" <http://example.com/graph/Student/10/Venus%20Williams> . 
+
+
+
+

170. RMLTC0008a-JSON

+

Title: "Generation of triples to a target graph by using rr:graphMap and rr:template"

+

Description: "Test that results of the mapping can be directed to a target graph by using rr:graphMap and rr:template"

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "Name":"Venus Williams",
+    "Sport": "Tennis"
+  }]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:object foaf:Person;
+      rml:predicate rdf:type
+    ], [
+      rml:objectMap [
+          rml:reference "$.ID"
+        ];
+      rml:predicate ex:id
+    ], [
+      rml:objectMap [
+          rml:reference "$.Name"
+        ];
+      rml:predicate foaf:name
+    ], [
+      rml:objectMap [
+          rml:reference "$.Sport"
+        ];
+      rml:predicate ex:Sport
+    ];
+  rml:subjectMap [
+      rml:graphMap [
+          rml:template "http://example.com/graph/Student/{$.ID}/{$.Name}"
+        ];
+      rml:template "http://example.com/Student/{$.ID}/{$.Name}"
+    ] .
+
+

Output

+
<http://example.com/Student/10/Venus%20Williams> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> <http://example.com/graph/Student/10/Venus%20Williams> .
+<http://example.com/Student/10/Venus%20Williams> <http://xmlns.com/foaf/0.1/name> "Venus Williams" <http://example.com/graph/Student/10/Venus%20Williams> .
+<http://example.com/Student/10/Venus%20Williams> <http://example.com/id> "10" <http://example.com/graph/Student/10/Venus%20Williams> . 
+<http://example.com/Student/10/Venus%20Williams> <http://example.com/Sport> "Tennis" <http://example.com/graph/Student/10/Venus%20Williams> . 
+
+
+
+

171. RMLTC0008a-MySQL

+

Title: "Generation of triples to a target graph by using rr:graphMap and rr:template"

+

Description: "Test that results of the mapping can be directed to a target graph by using rr:graphMap and rr:template"

+

Error expected? No

+

Input

+
USE test;
+DROP TABLE IF EXISTS test.student;
+
+CREATE TABLE student (
+  ID INTEGER,
+  Name VARCHAR(50),
+  Sport VARCHAR(50)
+);
+INSERT INTO student values ('10', 'Venus Williams', 'Tennis');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "student"
+    ];
+  rml:predicateObjectMap [
+      rml:object foaf:Person;
+      rml:predicate rdf:type
+    ], [
+      rml:objectMap [
+          rml:reference "ID"
+        ];
+      rml:predicate ex:id
+    ], [
+      rml:objectMap [
+          rml:reference "Name"
+        ];
+      rml:predicate foaf:name
+    ], [
+      rml:objectMap [
+          rml:reference "Sport"
+        ];
+      rml:predicate ex:Sport
+    ];
+  rml:subjectMap [
+      rml:graphMap [
+          rml:template "http://example.com/graph/Student/{ID}/{Name}"
+        ];
+      rml:template "http://example.com/Student/{ID}/{Name}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
+  d2rq:password "";
+  d2rq:username "root" .
+
+

Output

+
<http://example.com/Student/10/Venus%20Williams> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> <http://example.com/graph/Student/10/Venus%20Williams> .
+<http://example.com/Student/10/Venus%20Williams> <http://xmlns.com/foaf/0.1/name> "Venus Williams" <http://example.com/graph/Student/10/Venus%20Williams> .
+<http://example.com/Student/10/Venus%20Williams> <http://example.com/id> "10"^^<http://www.w3.org/2001/XMLSchema#integer> <http://example.com/graph/Student/10/Venus%20Williams> . 
+<http://example.com/Student/10/Venus%20Williams> <http://example.com/Sport> "Tennis" <http://example.com/graph/Student/10/Venus%20Williams> . 
+
+
+
+
+

172. RMLTC0008a-PostgreSQL

+

Title: "Generation of triples to a target graph by using rr:graphMap and rr:template"

+

Description: "Test that results of the mapping can be directed to a target graph by using rr:graphMap and rr:template"

+

Error expected? No

+

Input

+
DROP TABLE IF EXISTS student;
+
+CREATE TABLE student (
+  "ID" INTEGER,
+  "Name" VARCHAR(50),
+  "Sport" VARCHAR(50)
+);
+INSERT INTO student values ('10', 'Venus Williams', 'Tennis');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "student"
+    ];
+  rml:predicateObjectMap [
+      rml:object foaf:Person;
+      rml:predicate rdf:type
+    ], [
+      rml:objectMap [
+          rml:reference "ID"
+        ];
+      rml:predicate ex:id
+    ], [
+      rml:objectMap [
+          rml:reference "Name"
+        ];
+      rml:predicate foaf:name
+    ], [
+      rml:objectMap [
+          rml:reference "Sport"
+        ];
+      rml:predicate ex:Sport
+    ];
+  rml:subjectMap [
+      rml:graphMap [
+          rml:template "http://example.com/graph/Student/{ID}/{Name}"
+        ];
+      rml:template "http://example.com/Student/{ID}/{Name}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "org.postgresql.Driver";
+  d2rq:password "";
+  d2rq:username "postgres" .
+
+

Output

+
<http://example.com/Student/10/Venus%20Williams> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> <http://example.com/graph/Student/10/Venus%20Williams> .
+<http://example.com/Student/10/Venus%20Williams> <http://xmlns.com/foaf/0.1/name> "Venus Williams" <http://example.com/graph/Student/10/Venus%20Williams> .
+<http://example.com/Student/10/Venus%20Williams> <http://example.com/id> "10"^^<http://www.w3.org/2001/XMLSchema#integer> <http://example.com/graph/Student/10/Venus%20Williams> . 
+<http://example.com/Student/10/Venus%20Williams> <http://example.com/Sport> "Tennis" <http://example.com/graph/Student/10/Venus%20Williams> . 
+
+
+
+
+

173. RMLTC0008a-SPARQL

+

Title: "Generation of triples to a target graph by using rr:graphMap and rr:template"

+

Description: "Test that results of the mapping can be directed to a target graph by using rr:graphMap and rr:template"

+

Error expected? No

+

Input

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix ns1: <http://example.com/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+
+[] ns1:plays [ a ns1:Sport ;
+            foaf:name "Tennis" ] ;
+    rdf:ID "10" ;
+    foaf:name "Venus Williams" .
+
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix sd: <http://www.w3.org/ns/sparql-service-description#> .
+
+<http://example.com/base#Country> rml:logicalSource [
+      rml:iterator """
+            PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
+            PREFIX foaf: <http://xmlns.com/foaf/0.1/>
+            PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
+            SELECT ?Name ?Sport ?ID
+            WHERE {
+                ?x  foaf:name ?Name ;
+                    rdf:ID    ?ID ;
+                    <http://example.com/plays>  ?sportObject .
+                ?sportObject foaf:name ?Sport .
+            } """;
+      rml:referenceFormulation formats:SPARQL_Results_JSON;
+      rml:source <http://example.com/base#InputSPARQL>
+    ];
+  rml:predicateObjectMap [
+      rml:object foaf:Person;
+      rml:predicate rdf:type
+    ], [
+      rml:objectMap [
+          rml:reference "ID.value"
+        ];
+      rml:predicate ex:id
+    ], [
+      rml:objectMap [
+          rml:reference "Name.value"
+        ];
+      rml:predicate foaf:name
+    ], [
+      rml:objectMap [
+          rml:reference "Sport.value"
+        ];
+      rml:predicate ex:Sport
+    ];
+  rml:subjectMap [
+      rml:graphMap [
+          rml:template "http://example.com/graph/Student/{ID.value}/{Name.value}"
+        ];
+      rml:template "http://example.com/Student/{ID.value}/{Name.value}"
+    ] .
+
+<http://example.com/base#InputSPARQL> a sd:Service;
+  sd:endpoint <http://HOST:PORT/ds1/sparql>;
+  sd:supportedLanguage sd:SPARQL11Query .
+
+

Output

+
<http://example.com/Student/10/Venus%20Williams> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> <http://example.com/graph/Student/10/Venus%20Williams> .
+<http://example.com/Student/10/Venus%20Williams> <http://xmlns.com/foaf/0.1/name> "Venus Williams" <http://example.com/graph/Student/10/Venus%20Williams> .
+<http://example.com/Student/10/Venus%20Williams> <http://example.com/id> "10" <http://example.com/graph/Student/10/Venus%20Williams> . 
+<http://example.com/Student/10/Venus%20Williams> <http://example.com/Sport> "Tennis" <http://example.com/graph/Student/10/Venus%20Williams> . 
+
+
+
+

174. RMLTC0008a-SQLServer

+

Title: "Generation of triples to a target graph by using rr:graphMap and rr:template"

+

Description: "Test that results of the mapping can be directed to a target graph by using rr:graphMap and rr:template"

+

Error expected? No

+

Input

+
USE TestDB;
+DROP TABLE IF EXISTS student;
+CREATE TABLE student (
+  "ID" INTEGER,
+  "Name" VARCHAR(50),
+  "Sport" VARCHAR(50)
+);
+INSERT INTO student values ('10', 'Venus Williams', 'Tennis');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "student"
+    ];
+  rml:predicateObjectMap [
+      rml:object foaf:Person;
+      rml:predicate rdf:type
+    ], [
+      rml:objectMap [
+          rml:reference "ID"
+        ];
+      rml:predicate ex:id
+    ], [
+      rml:objectMap [
+          rml:reference "Name"
+        ];
+      rml:predicate foaf:name
+    ], [
+      rml:objectMap [
+          rml:reference "Sport"
+        ];
+      rml:predicate ex:Sport
+    ];
+  rml:subjectMap [
+      rml:graphMap [
+          rml:template "http://example.com/graph/Student/{ID}/{Name}"
+        ];
+      rml:template "http://example.com/Student/{ID}/{Name}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
+  d2rq:password "YourSTRONG!Passw0rd;";
+  d2rq:username "sa" .
+
+

Output

+
<http://example.com/Student/10/Venus%20Williams> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> <http://example.com/graph/Student/10/Venus%20Williams> .
+<http://example.com/Student/10/Venus%20Williams> <http://xmlns.com/foaf/0.1/name> "Venus Williams" <http://example.com/graph/Student/10/Venus%20Williams> .
+<http://example.com/Student/10/Venus%20Williams> <http://example.com/id> "10"^^<http://www.w3.org/2001/XMLSchema#integer> <http://example.com/graph/Student/10/Venus%20Williams> . 
+<http://example.com/Student/10/Venus%20Williams> <http://example.com/Sport> "Tennis" <http://example.com/graph/Student/10/Venus%20Williams> . 
+
+
+
+
+

175. RMLTC0008a-XML

+

Title: "Generation of triples to a target graph by using rr:graphMap and rr:template"

+

Description: "Test that results of the mapping can be directed to a target graph by using rr:graphMap and rr:template"

+

Error expected? No

+

Input

+
<?xml version="1.0"?>
+
+<students>
+  <student>
+    <ID>10</ID>
+    <Name>Venus Williams</Name>
+    <Sport>Tennis</Sport>
+  </student>
+</students>
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "/students/student";
+      rml:referenceFormulation rml:XPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.xml"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:object foaf:Person;
+      rml:predicate rdf:type
+    ], [
+      rml:objectMap [
+          rml:reference "ID"
+        ];
+      rml:predicate ex:id
+    ], [
+      rml:objectMap [
+          rml:reference "Name"
+        ];
+      rml:predicate foaf:name
+    ], [
+      rml:objectMap [
+          rml:reference "Sport"
+        ];
+      rml:predicate ex:Sport
+    ];
+  rml:subjectMap [
+      rml:graphMap [
+          rml:template "http://example.com/graph/Student/{ID}/{Name}"
+        ];
+      rml:template "http://example.com/Student/{ID}/{Name}"
+    ] .
+
+

Output

+
<http://example.com/Student/10/Venus%20Williams> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> <http://example.com/graph/Student/10/Venus%20Williams> .
+<http://example.com/Student/10/Venus%20Williams> <http://xmlns.com/foaf/0.1/name> "Venus Williams" <http://example.com/graph/Student/10/Venus%20Williams> .
+<http://example.com/Student/10/Venus%20Williams> <http://example.com/id> "10" <http://example.com/graph/Student/10/Venus%20Williams> . 
+<http://example.com/Student/10/Venus%20Williams> <http://example.com/Sport> "Tennis" <http://example.com/graph/Student/10/Venus%20Williams> . 
+
+
+
+

176. RMLTC0008b-CSV

+

Title: "Generation of triples referencing object map"

+

Description: "Tests the mapping specification referencing object map without join"

+

Error expected? No

+

Input

+
ID,Name,Sport
+10,Venus Williams,Tennis
+
+

Mapping

+
@prefix activity: <http://example.com/activity/> .
+@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:referenceFormulation rml:CSV;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.csv"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap <http://example.com/base/RefObjectMap1>;
+      rml:predicate ex:Sport
+    ], [
+      rml:object foaf:Person;
+      rml:predicate rdf:type
+    ], [
+      rml:objectMap [
+          rml:reference "ID"
+        ];
+      rml:predicate ex:id
+    ], [
+      rml:objectMap [
+          rml:reference "Name"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Student/{ID}/{Name}"
+    ] .
+
+<http://example.com/base/RefObjectMap1> a rml:RefObjectMap;
+  rml:parentTriplesMap <http://example.com/base/TriplesMap2> .
+
+<http://example.com/base/TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:referenceFormulation rml:CSV;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.csv"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:object activity:Sport;
+      rml:predicate rdf:type
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{Sport}"
+    ] .
+
+

Output

+
<http://example.com/Student/10/Venus%20Williams> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person>  .
+<http://example.com/Student/10/Venus%20Williams> <http://xmlns.com/foaf/0.1/name> "Venus Williams" .
+<http://example.com/Student/10/Venus%20Williams> <http://example.com/id> "10" . 
+<http://example.com/Student/10/Venus%20Williams> <http://example.com/Sport> <http://example.com/Tennis> . 
+<http://example.com/Tennis> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/activity/Sport> .
+
+
+
+
+

177. RMLTC0008b-JSON

+

Title: "Generation of triples referencing object map"

+

Description: "Tests the mapping specification referencing object map without join"

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "Name":"Venus Williams",
+    "Sport": "Tennis"
+  }]
+}
+
+

Mapping

+
@prefix activity: <http://example.com/activity/> .
+@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap <http://example.com/base/RefObjectMap1>;
+      rml:predicate ex:Sport
+    ], [
+      rml:object foaf:Person;
+      rml:predicate rdf:type
+    ], [
+      rml:objectMap [
+          rml:reference "$.ID"
+        ];
+      rml:predicate ex:id
+    ], [
+      rml:objectMap [
+          rml:reference "$.Name"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Student/{$.ID}/{$.Name}"
+    ] .
+
+<http://example.com/base/RefObjectMap1> a rml:RefObjectMap;
+  rml:parentTriplesMap <http://example.com/base/TriplesMap2> .
+
+<http://example.com/base/TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:object activity:Sport;
+      rml:predicate rdf:type
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{$.Sport}"
+    ] .
+
+

Output

+
<http://example.com/Student/10/Venus%20Williams> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person>  .
+<http://example.com/Student/10/Venus%20Williams> <http://xmlns.com/foaf/0.1/name> "Venus Williams" .
+<http://example.com/Student/10/Venus%20Williams> <http://example.com/id> "10" . 
+<http://example.com/Student/10/Venus%20Williams> <http://example.com/Sport> <http://example.com/Tennis> . 
+<http://example.com/Tennis> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/activity/Sport> .
+
+
+
+
+

178. RMLTC0008b-MySQL

+

Title: "Generation of triples referencing object map"

+

Description: "Tests the mapping specification referencing object map without join"

+

Error expected? No

+

Input

+
USE test;
+DROP TABLE IF EXISTS test.student;
+
+CREATE TABLE student (
+  ID INTEGER,
+  Name VARCHAR(50),
+  Sport VARCHAR(50)
+);
+INSERT INTO student values ('10', 'Venus Williams', 'Tennis');
+
+

Mapping

+
@prefix activity: <http://example.com/activity/> .
+@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "student"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap <http://example.com/base/RefObjectMap1>;
+      rml:predicate ex:Sport
+    ], [
+      rml:object foaf:Person;
+      rml:predicate rdf:type
+    ], [
+      rml:objectMap [
+          rml:reference "ID"
+        ];
+      rml:predicate ex:id
+    ], [
+      rml:objectMap [
+          rml:reference "Name"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Student/{ID}/{Name}"
+    ] .
+
+<http://example.com/base/RefObjectMap1> a rml:RefObjectMap;
+  rml:parentTriplesMap <http://example.com/base/TriplesMap2> .
+
+<http://example.com/base/TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "student"
+    ];
+  rml:predicateObjectMap [
+      rml:object activity:Sport;
+      rml:predicate rdf:type
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{Sport}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
+  d2rq:password "";
+  d2rq:username "root" .
+
+

Output

+
<http://example.com/Student/10/Venus%20Williams> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person>  .
+<http://example.com/Student/10/Venus%20Williams> <http://xmlns.com/foaf/0.1/name> "Venus Williams" .
+<http://example.com/Student/10/Venus%20Williams> <http://example.com/id> "10"^^<http://www.w3.org/2001/XMLSchema#integer>  . 
+<http://example.com/Student/10/Venus%20Williams> <http://example.com/Sport> <http://example.com/Tennis> . 
+<http://example.com/Tennis> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/activity/Sport> .
+
+
+
+
+

179. RMLTC0008b-PostgreSQL

+

Title: "Generation of triples referencing object map"

+

Description: "Tests the mapping specification referencing object map without join"

+

Error expected? No

+

Input

+
DROP TABLE IF EXISTS student;
+
+CREATE TABLE student (
+  "ID" INTEGER,
+  "Name" VARCHAR(50),
+  "Sport" VARCHAR(50)
+);
+INSERT INTO student values ('10', 'Venus Williams', 'Tennis');
+
+

Mapping

+
@prefix activity: <http://example.com/activity/> .
+@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "student"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap <http://example.com/base/RefObjectMap1>;
+      rml:predicate ex:Sport
+    ], [
+      rml:object foaf:Person;
+      rml:predicate rdf:type
+    ], [
+      rml:objectMap [
+          rml:reference "ID"
+        ];
+      rml:predicate ex:id
+    ], [
+      rml:objectMap [
+          rml:reference "Name"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Student/{ID}/{Name}"
+    ] .
+
+<http://example.com/base/RefObjectMap1> a rml:RefObjectMap;
+  rml:parentTriplesMap <http://example.com/base/TriplesMap2> .
+
+<http://example.com/base/TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "student"
+    ];
+  rml:predicateObjectMap [
+      rml:object activity:Sport;
+      rml:predicate rdf:type
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{Sport}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "org.postgresql.Driver";
+  d2rq:password "";
+  d2rq:username "postgres" .
+
+

Output

+
<http://example.com/Student/10/Venus%20Williams> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person>  .
+<http://example.com/Student/10/Venus%20Williams> <http://xmlns.com/foaf/0.1/name> "Venus Williams" .
+<http://example.com/Student/10/Venus%20Williams> <http://example.com/id> "10"^^<http://www.w3.org/2001/XMLSchema#integer>  . 
+<http://example.com/Student/10/Venus%20Williams> <http://example.com/Sport> <http://example.com/Tennis> . 
+<http://example.com/Tennis> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/activity/Sport> .
+
+
+
+
+

180. RMLTC0008b-SPARQL

+

Title: "Generation of triples referencing object map"

+

Description: "Tests the mapping specification referencing object map without join"

+

Error expected? No

+

Input

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix ns1: <http://example.com/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+
+[] ns1:plays [ a ns1:Sport ;
+            foaf:name "Tennis" ] ;
+    rdf:ID "10" ;
+    foaf:name "Venus Williams" .
+
+
+

Mapping

+
@prefix activity: <http://example.com/activity/> .
+@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix sd: <http://www.w3.org/ns/sparql-service-description#> .
+
+ex:TriplesMap1 a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator """
+            PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
+            PREFIX foaf: <http://xmlns.com/foaf/0.1/>
+            PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
+            SELECT ?Name ?ID
+            WHERE {
+                ?x  foaf:name ?Name ;
+                    rdf:ID    ?ID ;
+            } """;
+      rml:referenceFormulation formats:SPARQL_Results_JSON;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path <http://example.com/base#InputSPARQL>
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap ex:RefObjectMap1;
+      rml:predicate ex:Sport
+    ], [
+      rml:object foaf:Person;
+      rml:predicate rdf:type
+    ], [
+      rml:objectMap [
+          rml:reference "ID.value"
+        ];
+      rml:predicate ex:id
+    ], [
+      rml:objectMap [
+          rml:reference "Name.value"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Student/{ID.value}/{Name.value}"
+    ] .
+
+ex:RefObjectMap1 a rml:RefObjectMap;
+  rml:parentTriplesMap ex:TriplesMap2 .
+
+ex:TriplesMap2 a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator """
+                PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
+                PREFIX foaf: <http://xmlns.com/foaf/0.1/>
+                PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
+                SELECT ?Sport
+                WHERE {
+                    ?x a <http://example.com/Sport> .
+                    ?x foaf:name ?Sport .
+                } """;
+      rml:referenceFormulation formats:SPARQL_Results_JSON;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path <http://example.com/base#InputSPARQL>
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:object activity:Sport;
+      rml:predicate rdf:type
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{Sport.value}"
+    ] .
+
+<http://example.com/base#InputSPARQL> a sd:Service;
+  sd:endpoint <http://HOST:PORT/ds1/sparql>;
+  sd:supportedLanguage sd:SPARQL11Query .
+
+

Output

+
<http://example.com/Student/10/Venus%20Williams> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person>  .
+<http://example.com/Student/10/Venus%20Williams> <http://xmlns.com/foaf/0.1/name> "Venus Williams" .
+<http://example.com/Student/10/Venus%20Williams> <http://example.com/id> "10" . 
+<http://example.com/Student/10/Venus%20Williams> <http://example.com/Sport> <http://example.com/Tennis> . 
+<http://example.com/Tennis> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/activity/Sport> .
+
+
+
+
+

181. RMLTC0008b-SQLServer

+

Title: "Generation of triples referencing object map"

+

Description: "Tests the mapping specification referencing object map without join"

+

Error expected? No

+

Input

+
USE TestDB;
+DROP TABLE IF EXISTS student;
+CREATE TABLE student (
+  "ID" INTEGER,
+  "Name" VARCHAR(50),
+  "Sport" VARCHAR(50)
+);
+INSERT INTO student values ('10', 'Venus Williams', 'Tennis');
+
+

Mapping

+
@prefix activity: <http://example.com/activity/> .
+@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "student"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap <http://example.com/base/RefObjectMap1>;
+      rml:predicate ex:Sport
+    ], [
+      rml:object foaf:Person;
+      rml:predicate rdf:type
+    ], [
+      rml:objectMap [
+          rml:reference "ID"
+        ];
+      rml:predicate ex:id
+    ], [
+      rml:objectMap [
+          rml:reference "Name"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Student/{ID}/{Name}"
+    ] .
+
+<http://example.com/base/RefObjectMap1> a rml:RefObjectMap;
+  rml:parentTriplesMap <http://example.com/base/TriplesMap2> .
+
+<http://example.com/base/TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "student"
+    ];
+  rml:predicateObjectMap [
+      rml:object activity:Sport;
+      rml:predicate rdf:type
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{Sport}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
+  d2rq:password "YourSTRONG!Passw0rd;";
+  d2rq:username "sa" .
+
+

Output

+
<http://example.com/Student/10/Venus%20Williams> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person>  .
+<http://example.com/Student/10/Venus%20Williams> <http://xmlns.com/foaf/0.1/name> "Venus Williams" .
+<http://example.com/Student/10/Venus%20Williams> <http://example.com/id> "10"^^<http://www.w3.org/2001/XMLSchema#integer>  . 
+<http://example.com/Student/10/Venus%20Williams> <http://example.com/Sport> <http://example.com/Tennis> . 
+<http://example.com/Tennis> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/activity/Sport> .
+
+
+
+
+

182. RMLTC0008b-XML

+

Title: "Generation of triples referencing object map"

+

Description: "Tests the mapping specification referencing object map without join"

+

Error expected? No

+

Input

+
<?xml version="1.0"?>
+
+<students>
+  <student>
+    <ID>10</ID>
+    <Name>Venus Williams</Name>
+    <Sport>Tennis</Sport>
+  </student>
+</students>
+
+

Mapping

+
@prefix activity: <http://example.com/activity/> .
+@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "/students/student";
+      rml:referenceFormulation rml:XPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.xml"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap <http://example.com/base/RefObjectMap1>;
+      rml:predicate ex:Sport
+    ], [
+      rml:object foaf:Person;
+      rml:predicate rdf:type
+    ], [
+      rml:objectMap [
+          rml:reference "ID"
+        ];
+      rml:predicate ex:id
+    ], [
+      rml:objectMap [
+          rml:reference "Name"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Student/{ID}/{Name}"
+    ] .
+
+<http://example.com/base/RefObjectMap1> a rml:RefObjectMap;
+  rml:parentTriplesMap <http://example.com/base/TriplesMap2> .
+
+<http://example.com/base/TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "/students/student";
+      rml:referenceFormulation rml:XPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.xml"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:object activity:Sport;
+      rml:predicate rdf:type
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{Sport}"
+    ] .
+
+

Output

+
<http://example.com/Student/10/Venus%20Williams> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person>  .
+<http://example.com/Student/10/Venus%20Williams> <http://xmlns.com/foaf/0.1/name> "Venus Williams" .
+<http://example.com/Student/10/Venus%20Williams> <http://example.com/id> "10" . 
+<http://example.com/Student/10/Venus%20Williams> <http://example.com/Sport> <http://example.com/Tennis> . 
+<http://example.com/Tennis> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/activity/Sport> .
+
+
+
+
+

183. RMLTC0008c-CSV

+

Title: "Generation of triples by using multiple predicateMaps within a rr:predicateObjectMap"

+

Description: "Tests the generation of triples by using multiple predicateMaps within a rr:predicateObjectMap"

+

Error expected? No

+

Input

+
ID,Name,Sport
+10,Venus Williams,Tennis
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:referenceFormulation rml:CSV;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.csv"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "Name"
+        ];
+      rml:predicate ex:name, foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Student/{ID}/{Name}"
+    ] .
+
+

Output

+
<http://example.com/Student/10/Venus%20Williams> <http://xmlns.com/foaf/0.1/name> "Venus Williams"  .
+<http://example.com/Student/10/Venus%20Williams> <http://example.com/name> "Venus Williams"  .
+
+
+
+

184. RMLTC0008c-JSON

+

Title: "Generation of triples by using multiple predicateMaps within a rr:predicateObjectMap"

+

Description: "Tests the generation of triples by using multiple predicateMaps within a rr:predicateObjectMap"

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "Name":"Venus Williams",
+    "Sport": "Tennis"
+  }]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.Name"
+        ];
+      rml:predicate ex:name, foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Student/{$.ID}/{$.Name}"
+    ] .
+
+

Output

+
<http://example.com/Student/10/Venus%20Williams> <http://xmlns.com/foaf/0.1/name> "Venus Williams"  .
+<http://example.com/Student/10/Venus%20Williams> <http://example.com/name> "Venus Williams"  .
+
+
+
+

185. RMLTC0008c-MySQL

+

Title: "Generation of triples by using multiple predicateMaps within a rr:predicateObjectMap"

+

Description: "Tests the generation of triples by using multiple predicateMaps within a rr:predicateObjectMap"

+

Error expected? No

+

Input

+
USE test;
+DROP TABLE IF EXISTS test.student;
+
+CREATE TABLE student (
+  ID INTEGER,
+  Name VARCHAR(50),
+  Sport VARCHAR(50)
+);
+INSERT INTO student values ('10', 'Venus Williams', 'Tennis');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "student"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "Name"
+        ];
+      rml:predicate ex:name, foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Student/{ID}/{Name}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
+  d2rq:password "";
+  d2rq:username "root" .
+
+

Output

+
<http://example.com/Student/10/Venus%20Williams> <http://xmlns.com/foaf/0.1/name> "Venus Williams"  .
+<http://example.com/Student/10/Venus%20Williams> <http://example.com/name> "Venus Williams"  .
+
+
+
+

186. RMLTC0008c-PostgreSQL

+

Title: "Generation of triples by using multiple predicateMaps within a rr:predicateObjectMap"

+

Description: "Tests the generation of triples by using multiple predicateMaps within a rr:predicateObjectMap"

+

Error expected? No

+

Input

+
DROP TABLE IF EXISTS student;
+
+CREATE TABLE student (
+  "ID" INTEGER,
+  "Name" VARCHAR(50),
+  "Sport" VARCHAR(50)
+);
+INSERT INTO student values ('10', 'Venus Williams', 'Tennis');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "student"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "Name"
+        ];
+      rml:predicate ex:name, foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Student/{ID}/{Name}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "org.postgresql.Driver";
+  d2rq:password "";
+  d2rq:username "postgres" .
+
+

Output

+
<http://example.com/Student/10/Venus%20Williams> <http://xmlns.com/foaf/0.1/name> "Venus Williams"  .
+<http://example.com/Student/10/Venus%20Williams> <http://example.com/name> "Venus Williams"  .
+
+
+
+

187. RMLTC0008c-SPARQL

+

Title: "Generation of triples by using multiple predicateMaps within a rr:predicateObjectMap"

+

Description: "Tests the generation of triples by using multiple predicateMaps within a rr:predicateObjectMap"

+

Error expected? No

+

Input

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix ns1: <http://example.com/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+
+[] ns1:plays [ a ns1:Sport ;
+            foaf:name "Tennis" ] ;
+    rdf:ID "10" ;
+    foaf:name "Venus Williams" .
+
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix sd: <http://www.w3.org/ns/sparql-service-description#> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator """
+              PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
+              PREFIX foaf: <http://xmlns.com/foaf/0.1/>
+              PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
+              SELECT ?Name ?ID
+              WHERE {
+                  ?x  foaf:name ?Name ;
+                      rdf:ID    ?ID ;
+              } """;
+      rml:referenceFormulation formats:SPARQL_Results_JSON;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path <http://example.com/base/#InputSPARQL>
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "Name.value"
+        ];
+      rml:predicate ex:name, foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Student/{ID.value}/{Name.value}"
+    ] .
+
+<http://example.com/base/#InputSPARQL> a sd:Service;
+  sd:endpoint <http://HOST:PORT/ds1/sparql>;
+  sd:supportedLanguage sd:SPARQL11Query .
+
+

Output

+
<http://example.com/Student/10/Venus%20Williams> <http://xmlns.com/foaf/0.1/name> "Venus Williams"  .
+<http://example.com/Student/10/Venus%20Williams> <http://example.com/name> "Venus Williams"  .
+
+
+
+

188. RMLTC0008c-SQLServer

+

Title: "Generation of triples by using multiple predicateMaps within a rr:predicateObjectMap"

+

Description: "Tests the generation of triples by using multiple predicateMaps within a rr:predicateObjectMap"

+

Error expected? No

+

Input

+
USE TestDB;
+DROP TABLE IF EXISTS student;
+CREATE TABLE student (
+  "ID" INTEGER,
+  "Name" VARCHAR(50),
+  "Sport" VARCHAR(50)
+);
+INSERT INTO student values ('10', 'Venus Williams', 'Tennis');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "student"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "Name"
+        ];
+      rml:predicate ex:name, foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Student/{ID}/{Name}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
+  d2rq:password "YourSTRONG!Passw0rd;";
+  d2rq:username "sa" .
+
+

Output

+
<http://example.com/Student/10/Venus%20Williams> <http://xmlns.com/foaf/0.1/name> "Venus Williams"  .
+<http://example.com/Student/10/Venus%20Williams> <http://example.com/name> "Venus Williams"  .
+
+
+
+

189. RMLTC0008c-XML

+

Title: "Generation of triples by using multiple predicateMaps within a rr:predicateObjectMap"

+

Description: "Tests the generation of triples by using multiple predicateMaps within a rr:predicateObjectMap"

+

Error expected? No

+

Input

+
<?xml version="1.0"?>
+
+<students>
+  <student>
+    <ID>10</ID>
+    <Name>Venus Williams</Name>
+    <Sport>Tennis</Sport>
+  </student>
+</students>
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "/students/student";
+      rml:referenceFormulation rml:XPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.xml"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "Name"
+        ];
+      rml:predicate ex:name, foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Student/{ID}/{Name}"
+    ] .
+
+

Output

+
<http://example.com/Student/10/Venus%20Williams> <http://xmlns.com/foaf/0.1/name> "Venus Williams"  .
+<http://example.com/Student/10/Venus%20Williams> <http://example.com/name> "Venus Williams"  .
+
+
+
+

190. RMLTC0009a-CSV

+

Title: "Generation of triples from foreign key relations"

+

Description: "Test foreign key relationships among logical tables"

+

Error expected? No

+

Input

+
ID,Sport,Name
+10,100,Venus Williams
+20,,Demi Moore
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:referenceFormulation rml:CSV;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.csv"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "Name"
+        ];
+      rml:predicate foaf:name
+    ], [
+      rml:objectMap [ a rml:RefObjectMap;
+          rml:joinCondition [
+              rml:child "Sport";
+              rml:parent "ID"
+            ];
+          rml:parentTriplesMap <http://example.com/base/TriplesMap2>
+        ];
+      rml:predicate <http://example.com/ontology/practises>
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/resource/student_{ID}"
+    ] .
+
+<http://example.com/base/TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:referenceFormulation rml:CSV;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "sport.csv"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "Name"
+        ];
+      rml:predicate rdfs:label
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/resource/sport_{ID}"
+    ] .
+
+

Output

+
<http://example.com/resource/student_10> <http://xmlns.com/foaf/0.1/name> "Venus Williams"  .
+<http://example.com/resource/student_20> <http://xmlns.com/foaf/0.1/name> "Demi Moore"  .
+<http://example.com/resource/sport_100> <http://www.w3.org/2000/01/rdf-schema#label> "Tennis" .
+<http://example.com/resource/student_10> <http://example.com/ontology/practises> <http://example.com/resource/sport_100>  .
+
+
+

191. RMLTC0009a-JSON

+

Title: "Generation of triples from foreign key relations"

+

Description: "Test foreign key relationships among logical tables"

+

Error expected? No

+

Input

+
{
+  "students" : [
+    { 
+      "ID": 10,
+      "Sport": 100,
+      "Name": "Venus Williams"
+    },
+    { 
+      "ID": 20,
+      "Name": "Demi Moore"
+    }
+  ]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.Name"
+        ];
+      rml:predicate foaf:name
+    ], [
+      rml:objectMap [ a rml:RefObjectMap;
+          rml:joinCondition [
+              rml:child "$.Sport";
+              rml:parent "$.ID"
+            ];
+          rml:parentTriplesMap <http://example.com/base/TriplesMap2>
+        ];
+      rml:predicate <http://example.com/ontology/practises>
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/resource/student_{$.ID}"
+    ] .
+
+<http://example.com/base/TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.sports[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "sport.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.Name"
+        ];
+      rml:predicate rdfs:label
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/resource/sport_{$.ID}"
+    ] .
+
+

Output

+
<http://example.com/resource/student_10> <http://xmlns.com/foaf/0.1/name> "Venus Williams"  .
+<http://example.com/resource/student_20> <http://xmlns.com/foaf/0.1/name> "Demi Moore"  .
+<http://example.com/resource/sport_100> <http://www.w3.org/2000/01/rdf-schema#label> "Tennis" .
+<http://example.com/resource/student_10> <http://example.com/ontology/practises> <http://example.com/resource/sport_100>  .
+
+
+

192. RMLTC0009a-MySQL

+

Title: "Generation of triples from foreign key relations"

+

Description: "Test foreign key relationships among logical tables"

+

Error expected? No

+

Input

+
USE test;
+DROP TABLE IF EXISTS test.student;
+
+CREATE TABLE student (
+  ID INTEGER,
+  Sport VARCHAR(50),
+  Name VARCHAR(50)
+);
+INSERT INTO student values ('10', '100', 'Venus Williams');
+INSERT INTO student values ('20', NULL , 'Demi Moore');
+
+DROP TABLE IF EXISTS test.sport;
+
+CREATE TABLE sport (
+  ID INTEGER,
+  Name VARCHAR(50)
+);
+INSERT INTO sport values ('100', 'Tennis');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "student"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "Name"
+        ];
+      rml:predicate foaf:name
+    ], [
+      rml:objectMap [ a rml:RefObjectMap;
+          rml:joinCondition [
+              rml:child "Sport";
+              rml:parent "ID"
+            ];
+          rml:parentTriplesMap <http://example.com/base/TriplesMap2>
+        ];
+      rml:predicate <http://example.com/ontology/practises>
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/resource/student_{ID}"
+    ] .
+
+<http://example.com/base/TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "sport"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "Name"
+        ];
+      rml:predicate rdfs:label
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/resource/sport_{ID}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
+  d2rq:password "";
+  d2rq:username "root" .
+
+

Output

+
<http://example.com/resource/student_10> <http://xmlns.com/foaf/0.1/name> "Venus Williams"  .
+<http://example.com/resource/student_20> <http://xmlns.com/foaf/0.1/name> "Demi Moore"  .
+<http://example.com/resource/sport_100> <http://www.w3.org/2000/01/rdf-schema#label> "Tennis" .
+<http://example.com/resource/student_10> <http://example.com/ontology/practises> <http://example.com/resource/sport_100>  .
+
+
+

193. RMLTC0009a-PostgreSQL

+

Title: "Generation of triples from foreign key relations"

+

Description: "Test foreign key relationships among logical tables"

+

Error expected? No

+

Input

+
DROP TABLE IF EXISTS student;
+
+CREATE TABLE student (
+  "ID" INTEGER,
+  "Sport" VARCHAR(50),
+  "Name" VARCHAR(50)
+);
+INSERT INTO student values ('10', '100', 'Venus Williams');
+INSERT INTO student values ('20', NULL , 'Demi Moore');
+
+DROP TABLE IF EXISTS sport;
+
+CREATE TABLE sport (
+  "ID" VARCHAR(50),
+  "Name" VARCHAR(50)
+);
+INSERT INTO sport values ('100', 'Tennis');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "student"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "Name"
+        ];
+      rml:predicate foaf:name
+    ], [
+      rml:objectMap [ a rml:RefObjectMap;
+          rml:joinCondition [
+              rml:child "Sport";
+              rml:parent "ID"
+            ];
+          rml:parentTriplesMap <http://example.com/base/TriplesMap2>
+        ];
+      rml:predicate <http://example.com/ontology/practises>
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/resource/student_{ID}"
+    ] .
+
+<http://example.com/base/TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "sport"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "Name"
+        ];
+      rml:predicate rdfs:label
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/resource/sport_{ID}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "org.postgresql.Driver";
+  d2rq:password "";
+  d2rq:username "postgres" .
+
+

Output

+
<http://example.com/resource/student_10> <http://xmlns.com/foaf/0.1/name> "Venus Williams"  .
+<http://example.com/resource/student_20> <http://xmlns.com/foaf/0.1/name> "Demi Moore"  .
+<http://example.com/resource/sport_100> <http://www.w3.org/2000/01/rdf-schema#label> "Tennis" .
+<http://example.com/resource/student_10> <http://example.com/ontology/practises> <http://example.com/resource/sport_100>  .
+
+
+

194. RMLTC0009a-SPARQL

+

Title: "Generation of triples from foreign key relations"

+

Description: "Test foreign key relationships among logical tables"

+

Error expected? No

+

Input

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix ns1: <http://example.com/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+
+[] ns1:plays [ a ns1:Sport ;
+            rdf:ID "100" ] ;
+    rdf:ID "10" ;
+    foaf:name "Venus Williams" .
+
+[] ns1:plays [ a ns1:Sport ] ;
+    rdf:ID "20" ;
+    foaf:name "Demi Moore" .
+
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix sd: <http://www.w3.org/ns/sparql-service-description#> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator """
+              PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
+              PREFIX foaf: <http://xmlns.com/foaf/0.1/>
+              PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
+              SELECT ?Name ?ID ?Sport
+              WHERE {
+                  ?x  foaf:name ?Name ;
+                      rdf:ID    ?ID ;
+                      <http://example.com/plays> ?sportObject .
+                  OPTIONAL { ?sportObject a <http://example.com/Sport> ;
+                                            rdf:ID ?Sport . }
+              } """;
+      rml:referenceFormulation formats:SPARQL_Results_JSON;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path <http://example.com/base/#InputSPARQL1>
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "Name.value"
+        ];
+      rml:predicate foaf:name
+    ], [
+      rml:objectMap [ a rml:RefObjectMap;
+          rml:joinCondition [
+              rml:child "Sport";
+              rml:parent "ID"
+            ];
+          rml:parentTriplesMap <http://example.com/base/TriplesMap2>
+        ];
+      rml:predicate <http://example.com/ontology/practises>
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/resource/student_{ID.value}"
+    ] .
+
+<http://example.com/base/#InputSPARQL1> a sd:Service;
+  sd:endpoint <http://HOST:PORT/ds1/sparql>;
+  sd:supportedLanguage sd:SPARQL11Query .
+
+<http://example.com/base/#InputSPARQL2> a sd:Service;
+  sd:endpoint <http://HOST:PORT/ds2/sparql>;
+  sd:supportedLanguage sd:SPARQL11Query .
+
+<http://example.com/base/TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator """
+                PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
+                PREFIX foaf: <http://xmlns.com/foaf/0.1/>
+                PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
+                SELECT ?ID ?Name
+                WHERE {
+                    ?x  foaf:name ?Name ;
+                        rdf:ID    ?ID ;
+                } """;
+      rml:referenceFormulation formats:SPARQL_Results_JSON;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path <http://example.com/base/#InputSPARQL2>
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "Name.value"
+        ];
+      rml:predicate rdfs:label
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/resource/sport_{ID.value}"
+    ] .
+
+

Output

+
<http://example.com/resource/student_10> <http://xmlns.com/foaf/0.1/name> "Venus Williams"  .
+<http://example.com/resource/student_20> <http://xmlns.com/foaf/0.1/name> "Demi Moore"  .
+<http://example.com/resource/sport_100> <http://www.w3.org/2000/01/rdf-schema#label> "Tennis" .
+<http://example.com/resource/student_10> <http://example.com/ontology/practises> <http://example.com/resource/sport_100>  .
+
+
+

195. RMLTC0009a-SQLServer

+

Title: "Generation of triples from foreign key relations"

+

Description: "Test foreign key relationships among logical tables"

+

Error expected? No

+

Input

+
USE TestDB;
+DROP TABLE IF EXISTS student;
+CREATE TABLE student (
+  "ID" INTEGER,
+  "Sport" VARCHAR(50),
+  "Name" VARCHAR(50)
+);
+INSERT INTO student values ('10', '100', 'Venus Williams');
+INSERT INTO student values ('20', NULL , 'Demi Moore');
+
+DROP TABLE IF EXISTS sport;
+
+CREATE TABLE sport (
+  "ID" INTEGER,
+  "Name" VARCHAR(50)
+);
+INSERT INTO sport values ('100', 'Tennis');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "student"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "Name"
+        ];
+      rml:predicate foaf:name
+    ], [
+      rml:objectMap [ a rml:RefObjectMap;
+          rml:joinCondition [
+              rml:child "Sport";
+              rml:parent "ID"
+            ];
+          rml:parentTriplesMap <http://example.com/base/TriplesMap2>
+        ];
+      rml:predicate <http://example.com/ontology/practises>
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/resource/student_{ID}"
+    ] .
+
+<http://example.com/base/TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "sport"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "Name"
+        ];
+      rml:predicate rdfs:label
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/resource/sport_{ID}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
+  d2rq:password "YourSTRONG!Passw0rd;";
+  d2rq:username "sa" .
+
+

Output

+
<http://example.com/resource/student_10> <http://xmlns.com/foaf/0.1/name> "Venus Williams"  .
+<http://example.com/resource/student_20> <http://xmlns.com/foaf/0.1/name> "Demi Moore"  .
+<http://example.com/resource/sport_100> <http://www.w3.org/2000/01/rdf-schema#label> "Tennis" .
+<http://example.com/resource/student_10> <http://example.com/ontology/practises> <http://example.com/resource/sport_100>  .
+
+
+

196. RMLTC0009a-XML

+

Title: "Generation of triples from foreign key relations"

+

Description: "Test foreign key relationships among logical tables"

+

Error expected? No

+

Input

+
<?xml version="1.0"?>
+
+<students>
+  <student>
+    <ID>10</ID>
+    <Name>Venus Williams</Name>
+    <Sport>100</Sport>
+  </student>
+  <student>
+    <ID>20</ID>
+    <Name>Demi Moore</Name>
+  </student>
+</students>
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "/students/student";
+      rml:referenceFormulation rml:XPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.xml"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "Name"
+        ];
+      rml:predicate foaf:name
+    ], [
+      rml:objectMap [ a rml:RefObjectMap;
+          rml:joinCondition [
+              rml:child "Sport";
+              rml:parent "ID"
+            ];
+          rml:parentTriplesMap <http://example.com/base/TriplesMap2>
+        ];
+      rml:predicate <http://example.com/ontology/practises>
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/resource/student_{ID}"
+    ] .
+
+<http://example.com/base/TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "/sports/sport";
+      rml:referenceFormulation rml:XPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "sport.xml"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "Name"
+        ];
+      rml:predicate rdfs:label
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/resource/sport_{ID}"
+    ] .
+
+

Output

+
<http://example.com/resource/student_10> <http://xmlns.com/foaf/0.1/name> "Venus Williams"  .
+<http://example.com/resource/student_20> <http://xmlns.com/foaf/0.1/name> "Demi Moore"  .
+<http://example.com/resource/sport_100> <http://www.w3.org/2000/01/rdf-schema#label> "Tennis" .
+<http://example.com/resource/student_10> <http://example.com/ontology/practises> <http://example.com/resource/sport_100>  .
+
+
+

197. RMLTC0009b-CSV

+

Title: "Generation of triples to multiple graphs"

+

Description: "Test that results from distinct parts of the mapping can be directed to different target graphs."

+

Error expected? No

+

Input

+
ID,Sport,Name
+10,100,Venus Williams
+20,,Demi Moore
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:referenceFormulation rml:CSV;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.csv"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:graph <http://example.com/graph/students>;
+      rml:objectMap [
+          rml:reference "Name"
+        ];
+      rml:predicate foaf:name
+    ], [
+      rml:graph <http://example.com/graph/practise>;
+      rml:objectMap [ a rml:RefObjectMap;
+          rml:joinCondition [
+              rml:child "Sport";
+              rml:parent "ID"
+            ];
+          rml:parentTriplesMap <http://example.com/base/TriplesMap2>
+        ];
+      rml:predicate <http://example.com/ontology/practises>
+    ];
+  rml:subjectMap [
+      rml:class <http://example.com/ontology/Student>;
+      rml:graph <http://example.com/graph/students>;
+      rml:template "http://example.com/resource/student_{ID}"
+    ] .
+
+<http://example.com/base/TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:referenceFormulation rml:CSV;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "sport.csv"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "Name"
+        ];
+      rml:predicate rdfs:label
+    ];
+  rml:subjectMap [
+      rml:class <http://example.com/ontology/Sport>;
+      rml:graph <http://example.com/graph/sports>;
+      rml:template "http://example.com/resource/sport_{ID}"
+    ] .
+
+

Output

+
<http://example.com/resource/student_10> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/ontology/Student> <http://example.com/graph/students> .
+<http://example.com/resource/student_10> <http://xmlns.com/foaf/0.1/name> "Venus Williams" <http://example.com/graph/students> .
+<http://example.com/resource/student_20> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/ontology/Student> <http://example.com/graph/students> .
+<http://example.com/resource/student_20> <http://xmlns.com/foaf/0.1/name> "Demi Moore" <http://example.com/graph/students> .
+<http://example.com/resource/sport_100> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/ontology/Sport> <http://example.com/graph/sports> .
+<http://example.com/resource/sport_100> <http://www.w3.org/2000/01/rdf-schema#label> "Tennis" <http://example.com/graph/sports> .
+<http://example.com/resource/student_10> <http://example.com/ontology/practises> <http://example.com/resource/sport_100> <http://example.com/graph/practise> .
+<http://example.com/resource/student_10> <http://example.com/ontology/practises> <http://example.com/resource/sport_100> <http://example.com/graph/students> .
+
+
+

198. RMLTC0009b-JSON

+

Title: "Generation of triples to multiple graphs"

+

Description: "Test that results from distinct parts of the mapping can be directed to different target graphs."

+

Error expected? No

+

Input

+
{
+  "students" : [
+    { 
+      "ID": 10,
+      "Sport": 100,
+      "Name": "Venus Williams"
+    },
+    { 
+      "ID": 20,
+      "Name": "Demi Moore"
+    }
+  ]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:graph <http://example.com/graph/students>;
+      rml:objectMap [
+          rml:reference "$.Name"
+        ];
+      rml:predicate foaf:name
+    ], [
+      rml:graph <http://example.com/graph/practise>;
+      rml:objectMap [ a rml:RefObjectMap;
+          rml:joinCondition [
+              rml:child "$.Sport";
+              rml:parent "$.ID"
+            ];
+          rml:parentTriplesMap <http://example.com/base/TriplesMap2>
+        ];
+      rml:predicate <http://example.com/ontology/practises>
+    ];
+  rml:subjectMap [
+      rml:class <http://example.com/ontology/Student>;
+      rml:graph <http://example.com/graph/students>;
+      rml:template "http://example.com/resource/student_{$.ID}"
+    ] .
+
+<http://example.com/base/TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.sports[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "sport.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.Name"
+        ];
+      rml:predicate rdfs:label
+    ];
+  rml:subjectMap [
+      rml:class <http://example.com/ontology/Sport>;
+      rml:graph <http://example.com/graph/sports>;
+      rml:template "http://example.com/resource/sport_{$.ID}"
+    ] .
+
+

Output

+
<http://example.com/resource/student_10> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/ontology/Student> <http://example.com/graph/students> .
+<http://example.com/resource/student_10> <http://xmlns.com/foaf/0.1/name> "Venus Williams" <http://example.com/graph/students> .
+<http://example.com/resource/student_20> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/ontology/Student> <http://example.com/graph/students> .
+<http://example.com/resource/student_20> <http://xmlns.com/foaf/0.1/name> "Demi Moore" <http://example.com/graph/students> .
+<http://example.com/resource/sport_100> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/ontology/Sport> <http://example.com/graph/sports> .
+<http://example.com/resource/sport_100> <http://www.w3.org/2000/01/rdf-schema#label> "Tennis" <http://example.com/graph/sports> .
+<http://example.com/resource/student_10> <http://example.com/ontology/practises> <http://example.com/resource/sport_100> <http://example.com/graph/practise> .
+<http://example.com/resource/student_10> <http://example.com/ontology/practises> <http://example.com/resource/sport_100> <http://example.com/graph/students> .
+
+
+

199. RMLTC0009b-MySQL

+

Title: "Generation of triples to multiple graphs"

+

Description: "Test that results from distinct parts of the mapping can be directed to different target graphs."

+

Error expected? No

+

Input

+
USE test;
+DROP TABLE IF EXISTS test.student;
+
+CREATE TABLE student (
+  ID INTEGER,
+  Sport VARCHAR(50),
+  Name VARCHAR(50)
+);
+INSERT INTO student values ('10', '100', 'Venus Williams');
+INSERT INTO student values ('20', NULL, 'Demi Moore');
+
+DROP TABLE IF EXISTS test.sport;
+
+CREATE TABLE sport (
+  ID INTEGER,
+  Name VARCHAR(50)
+);
+INSERT INTO sport values ('100', 'Tennis');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "student"
+    ];
+  rml:predicateObjectMap [
+      rml:graph <http://example.com/graph/students>;
+      rml:objectMap [
+          rml:reference "Name"
+        ];
+      rml:predicate foaf:name
+    ], [
+      rml:graph <http://example.com/graph/practise>;
+      rml:objectMap [ a rml:RefObjectMap;
+          rml:joinCondition [
+              rml:child "Sport";
+              rml:parent "ID"
+            ];
+          rml:parentTriplesMap <http://example.com/base/TriplesMap2>
+        ];
+      rml:predicate <http://example.com/ontology/practises>
+    ];
+  rml:subjectMap [
+      rml:class <http://example.com/ontology/Student>;
+      rml:graph <http://example.com/graph/students>;
+      rml:template "http://example.com/resource/student_{ID}"
+    ] .
+
+<http://example.com/base/TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "sport"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "Name"
+        ];
+      rml:predicate rdfs:label
+    ];
+  rml:subjectMap [
+      rml:class <http://example.com/ontology/Sport>;
+      rml:graph <http://example.com/graph/sports>;
+      rml:template "http://example.com/resource/sport_{ID}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
+  d2rq:password "";
+  d2rq:username "root" .
+
+

Output

+
<http://example.com/resource/student_10> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/ontology/Student> <http://example.com/graph/students> .
+<http://example.com/resource/student_10> <http://xmlns.com/foaf/0.1/name> "Venus Williams" <http://example.com/graph/students> .
+<http://example.com/resource/student_20> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/ontology/Student> <http://example.com/graph/students> .
+<http://example.com/resource/student_20> <http://xmlns.com/foaf/0.1/name> "Demi Moore" <http://example.com/graph/students> .
+<http://example.com/resource/sport_100> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/ontology/Sport> <http://example.com/graph/sports> .
+<http://example.com/resource/sport_100> <http://www.w3.org/2000/01/rdf-schema#label> "Tennis" <http://example.com/graph/sports> .
+<http://example.com/resource/student_10> <http://example.com/ontology/practises> <http://example.com/resource/sport_100> <http://example.com/graph/practise> .
+<http://example.com/resource/student_10> <http://example.com/ontology/practises> <http://example.com/resource/sport_100> <http://example.com/graph/students> .
+
+
+

200. RMLTC0009b-PostgreSQL

+

Title: "Generation of triples to multiple graphs"

+

Description: "Test that results from distinct parts of the mapping can be directed to different target graphs."

+

Error expected? No

+

Input

+
DROP TABLE IF EXISTS student;
+
+CREATE TABLE student (
+  "ID" INTEGER,
+  "Sport" VARCHAR(50),
+  "Name" VARCHAR(50)
+);
+INSERT INTO student values ('10', '100', 'Venus Williams');
+INSERT INTO student values ('20', NULL, 'Demi Moore');
+
+DROP TABLE IF EXISTS sport;
+
+CREATE TABLE sport (
+  "ID" VARCHAR(50),
+  "Name" VARCHAR(50)
+);
+INSERT INTO sport values ('100', 'Tennis');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "student"
+    ];
+  rml:predicateObjectMap [
+      rml:graph <http://example.com/graph/students>;
+      rml:objectMap [
+          rml:reference "Name"
+        ];
+      rml:predicate foaf:name
+    ], [
+      rml:graph <http://example.com/graph/practise>;
+      rml:objectMap [ a rml:RefObjectMap;
+          rml:joinCondition [
+              rml:child "Sport";
+              rml:parent "ID"
+            ];
+          rml:parentTriplesMap <http://example.com/base/TriplesMap2>
+        ];
+      rml:predicate <http://example.com/ontology/practises>
+    ];
+  rml:subjectMap [
+      rml:class <http://example.com/ontology/Student>;
+      rml:graph <http://example.com/graph/students>;
+      rml:template "http://example.com/resource/student_{ID}"
+    ] .
+
+<http://example.com/base/TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "sport"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "Name"
+        ];
+      rml:predicate rdfs:label
+    ];
+  rml:subjectMap [
+      rml:class <http://example.com/ontology/Sport>;
+      rml:graph <http://example.com/graph/sports>;
+      rml:template "http://example.com/resource/sport_{ID}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "org.postgresql.Driver";
+  d2rq:password "";
+  d2rq:username "postgres" .
+
+

Output

+
<http://example.com/resource/student_10> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/ontology/Student> <http://example.com/graph/students> .
+<http://example.com/resource/student_10> <http://xmlns.com/foaf/0.1/name> "Venus Williams" <http://example.com/graph/students> .
+<http://example.com/resource/student_20> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/ontology/Student> <http://example.com/graph/students> .
+<http://example.com/resource/student_20> <http://xmlns.com/foaf/0.1/name> "Demi Moore" <http://example.com/graph/students> .
+<http://example.com/resource/sport_100> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/ontology/Sport> <http://example.com/graph/sports> .
+<http://example.com/resource/sport_100> <http://www.w3.org/2000/01/rdf-schema#label> "Tennis" <http://example.com/graph/sports> .
+<http://example.com/resource/student_10> <http://example.com/ontology/practises> <http://example.com/resource/sport_100> <http://example.com/graph/practise> .
+<http://example.com/resource/student_10> <http://example.com/ontology/practises> <http://example.com/resource/sport_100> <http://example.com/graph/students> .
+
+
+

201. RMLTC0009b-SPARQL

+

Title: "Generation of triples to multiple graphs"

+

Description: "Test that results from distinct parts of the mapping can be directed to different target graphs."

+

Error expected? No

+

Input

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix ns1: <http://example.com/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+
+[] ns1:plays [ a ns1:Sport ;
+            rdf:ID "100" ] ;
+    rdf:ID "10" ;
+    foaf:name "Venus Williams" .
+
+[] ns1:plays [ a ns1:Sport ] ;
+    rdf:ID "20" ;
+    foaf:name "Demi Moore" .
+
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix sd: <http://www.w3.org/ns/sparql-service-description#> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator """
+              PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
+              PREFIX foaf: <http://xmlns.com/foaf/0.1/>
+              PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
+              SELECT ?Name ?ID ?Sport
+              WHERE {
+                  ?x  foaf:name ?Name ;
+                      rdf:ID    ?ID ;
+                      <http://example.com/plays> ?sportObject .
+                  OPTIONAL { ?sportObject a <http://example.com/Sport> ;
+                                            rdf:ID ?Sport . }
+              } """;
+      rml:referenceFormulation formats:SPARQL_Results_JSON;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path <http://example.com/base/#InputSPARQL1>
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:graph <http://example.com/graph/students>;
+      rml:objectMap [
+          rml:reference "Name.value"
+        ];
+      rml:predicate foaf:name
+    ], [
+      rml:graph <http://example.com/graph/practise>;
+      rml:objectMap [ a rml:RefObjectMap;
+          rml:joinCondition [
+              rml:child "Sport.value";
+              rml:parent "ID.value"
+            ];
+          rml:parentTriplesMap <http://example.com/base/TriplesMap2>
+        ];
+      rml:predicate <http://example.com/ontology/practises>
+    ];
+  rml:subjectMap [
+      rml:class <http://example.com/ontology/Student>;
+      rml:graph <http://example.com/graph/students>;
+      rml:template "http://example.com/resource/student_{ID.value}"
+    ] .
+
+<http://example.com/base/#InputSPARQL1> a sd:Service;
+  sd:endpoint <http://HOST:PORT/ds1/sparql>;
+  sd:supportedLanguage sd:SPARQL11Query .
+
+<http://example.com/base/#InputSPARQL2> a sd:Service;
+  sd:endpoint <http://HOST:PORT/ds2/sparql>;
+  sd:supportedLanguage sd:SPARQL11Query .
+
+<http://example.com/base/TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator """
+                PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
+                PREFIX foaf: <http://xmlns.com/foaf/0.1/>
+                PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
+                SELECT ?ID ?Name
+                WHERE {
+                    ?x  foaf:name ?Name ;
+                        rdf:ID    ?ID ;
+                } """;
+      rml:referenceFormulation formats:SPARQL_Results_JSON;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path <http://example.com/base/#InputSPARQL2>
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "Name.value"
+        ];
+      rml:predicate rdfs:label
+    ];
+  rml:subjectMap [
+      rml:class <http://example.com/ontology/Sport>;
+      rml:graph <http://example.com/graph/sports>;
+      rml:template "http://example.com/resource/sport_{ID.value}"
+    ] .
+
+

Output

+
<http://example.com/resource/student_10> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/ontology/Student> <http://example.com/graph/students> .
+<http://example.com/resource/student_10> <http://xmlns.com/foaf/0.1/name> "Venus Williams" <http://example.com/graph/students> .
+<http://example.com/resource/student_20> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/ontology/Student> <http://example.com/graph/students> .
+<http://example.com/resource/student_20> <http://xmlns.com/foaf/0.1/name> "Demi Moore" <http://example.com/graph/students> .
+<http://example.com/resource/sport_100> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/ontology/Sport> <http://example.com/graph/sports> .
+<http://example.com/resource/sport_100> <http://www.w3.org/2000/01/rdf-schema#label> "Tennis" <http://example.com/graph/sports> .
+<http://example.com/resource/student_10> <http://example.com/ontology/practises> <http://example.com/resource/sport_100> <http://example.com/graph/practise> .
+<http://example.com/resource/student_10> <http://example.com/ontology/practises> <http://example.com/resource/sport_100> <http://example.com/graph/students> .
+
+
+

202. RMLTC0009b-SQLServer

+

Title: "Generation of triples to multiple graphs"

+

Description: "Test that results from distinct parts of the mapping can be directed to different target graphs."

+

Error expected? No

+

Input

+
USE TestDB;
+DROP TABLE IF EXISTS student;
+
+CREATE TABLE student (
+  "ID" INTEGER,
+  "Sport" VARCHAR(50),
+  "Name" VARCHAR(50)
+);
+INSERT INTO student values ('10', '100', 'Venus Williams');
+INSERT INTO student values ('20', NULL, 'Demi Moore');
+
+DROP TABLE IF EXISTS sport;
+
+CREATE TABLE sport (
+  "ID" INTEGER,
+  "Name" VARCHAR(50)
+);
+INSERT INTO sport values ('100', 'Tennis');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "student"
+    ];
+  rml:predicateObjectMap [
+      rml:graph <http://example.com/graph/students>;
+      rml:objectMap [
+          rml:reference "Name"
+        ];
+      rml:predicate foaf:name
+    ], [
+      rml:graph <http://example.com/graph/practise>;
+      rml:objectMap [ a rml:RefObjectMap;
+          rml:joinCondition [
+              rml:child "Sport";
+              rml:parent "ID"
+            ];
+          rml:parentTriplesMap <http://example.com/base/TriplesMap2>
+        ];
+      rml:predicate <http://example.com/ontology/practises>
+    ];
+  rml:subjectMap [
+      rml:class <http://example.com/ontology/Student>;
+      rml:graph <http://example.com/graph/students>;
+      rml:template "http://example.com/resource/student_{ID}"
+    ] .
+
+<http://example.com/base/TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "sport"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "Name"
+        ];
+      rml:predicate rdfs:label
+    ];
+  rml:subjectMap [
+      rml:class <http://example.com/ontology/Sport>;
+      rml:graph <http://example.com/graph/sports>;
+      rml:template "http://example.com/resource/sport_{ID}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
+  d2rq:password "YourSTRONG!Passw0rd;";
+  d2rq:username "sa" .
+
+

Output

+
<http://example.com/resource/student_10> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/ontology/Student> <http://example.com/graph/students> .
+<http://example.com/resource/student_10> <http://xmlns.com/foaf/0.1/name> "Venus Williams" <http://example.com/graph/students> .
+<http://example.com/resource/student_20> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/ontology/Student> <http://example.com/graph/students> .
+<http://example.com/resource/student_20> <http://xmlns.com/foaf/0.1/name> "Demi Moore" <http://example.com/graph/students> .
+<http://example.com/resource/sport_100> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/ontology/Sport> <http://example.com/graph/sports> .
+<http://example.com/resource/sport_100> <http://www.w3.org/2000/01/rdf-schema#label> "Tennis" <http://example.com/graph/sports> .
+<http://example.com/resource/student_10> <http://example.com/ontology/practises> <http://example.com/resource/sport_100> <http://example.com/graph/practise> .
+<http://example.com/resource/student_10> <http://example.com/ontology/practises> <http://example.com/resource/sport_100> <http://example.com/graph/students> .
+
+
+

203. RMLTC0009b-XML

+

Title: "Generation of triples to multiple graphs"

+

Description: "Test that results from distinct parts of the mapping can be directed to different target graphs."

+

Error expected? No

+

Input

+
<?xml version="1.0"?>
+
+<students>
+  <student>
+    <ID>10</ID>
+    <Name>Venus Williams</Name>
+    <Sport>100</Sport>
+  </student>
+  <student>
+    <ID>20</ID>
+    <Name>Demi Moore</Name>
+  </student>
+</students>
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "/students/student";
+      rml:referenceFormulation rml:XPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.xml"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:graph <http://example.com/graph/students>;
+      rml:objectMap [
+          rml:reference "Name"
+        ];
+      rml:predicate foaf:name
+    ], [
+      rml:graph <http://example.com/graph/practise>;
+      rml:objectMap [ a rml:RefObjectMap;
+          rml:joinCondition [
+              rml:child "Sport";
+              rml:parent "ID"
+            ];
+          rml:parentTriplesMap <http://example.com/base/TriplesMap2>
+        ];
+      rml:predicate <http://example.com/ontology/practises>
+    ];
+  rml:subjectMap [
+      rml:class <http://example.com/ontology/Student>;
+      rml:graph <http://example.com/graph/students>;
+      rml:template "http://example.com/resource/student_{ID}"
+    ] .
+
+<http://example.com/base/TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "/sports/sport";
+      rml:referenceFormulation rml:XPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "sport.xml"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "Name"
+        ];
+      rml:predicate rdfs:label
+    ];
+  rml:subjectMap [
+      rml:class <http://example.com/ontology/Sport>;
+      rml:graph <http://example.com/graph/sports>;
+      rml:template "http://example.com/resource/sport_{ID}"
+    ] .
+
+

Output

+
<http://example.com/resource/student_10> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/ontology/Student> <http://example.com/graph/students> .
+<http://example.com/resource/student_10> <http://xmlns.com/foaf/0.1/name> "Venus Williams" <http://example.com/graph/students> .
+<http://example.com/resource/student_20> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/ontology/Student> <http://example.com/graph/students> .
+<http://example.com/resource/student_20> <http://xmlns.com/foaf/0.1/name> "Demi Moore" <http://example.com/graph/students> .
+<http://example.com/resource/sport_100> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/ontology/Sport> <http://example.com/graph/sports> .
+<http://example.com/resource/sport_100> <http://www.w3.org/2000/01/rdf-schema#label> "Tennis" <http://example.com/graph/sports> .
+<http://example.com/resource/student_10> <http://example.com/ontology/practises> <http://example.com/resource/sport_100> <http://example.com/graph/practise> .
+<http://example.com/resource/student_10> <http://example.com/ontology/practises> <http://example.com/resource/sport_100> <http://example.com/graph/students> .
+
+
+

204. RMLTC0009c-MySQL

+

Title: "Unnamed column in a logical table"

+

Description: "Test a logical table with unnamed column."

+

Error expected? No

+

Input

+
USE test;
+DROP TABLE IF EXISTS test.Sport;
+DROP TABLE IF EXISTS test.Student;
+
+CREATE TABLE Sport (
+ID integer,
+Name varchar (50),
+PRIMARY KEY (ID)
+);
+
+CREATE TABLE Student (
+ID integer,
+Name varchar(50),
+Sport integer,
+PRIMARY KEY (ID),
+FOREIGN KEY(Sport) REFERENCES Sport(ID)
+);
+
+INSERT INTO Sport (ID, Name) VALUES (100,'Tennis');
+INSERT INTO Student (ID, Name, Sport) VALUES (10,'Venus Williams', 100);
+INSERT INTO Student (ID, Name, Sport) VALUES (20,'Demi Moore', NULL);
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator """
+        SELECT Name, COUNT(Sport)
+        FROM Student
+        GROUP BY Name
+        """;
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Query
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "Name"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/resource/student_{Name}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
+  d2rq:password "";
+  d2rq:username "root" .
+
+

Output

+
<http://example.com/resource/student_Venus%20Williams> <http://xmlns.com/foaf/0.1/name> "Venus Williams" . 
+<http://example.com/resource/student_Demi%20Moore> <http://xmlns.com/foaf/0.1/name> "Demi Moore" . 
+
+
+
+
+

205. RMLTC0009c-PostgreSQL

+

Title: "Unnamed column in a logical table"

+

Description: "Test a logical table with unnamed column."

+

Error expected? No

+

Input

+
DROP TABLE IF EXISTS Sport;
+DROP TABLE IF EXISTS Student;
+
+CREATE TABLE Sport (
+ID integer,
+Name varchar (50),
+PRIMARY KEY (ID)
+);
+
+CREATE TABLE Student (
+ID integer,
+Name varchar(50),
+Sport integer,
+PRIMARY KEY (ID),
+FOREIGN KEY(Sport) REFERENCES Sport(ID)
+);
+
+INSERT INTO Sport (ID, Name) VALUES (100,'Tennis');
+INSERT INTO Student (ID, Name, Sport) VALUES (10,'Venus Williams', 100);
+INSERT INTO Student (ID, Name, Sport) VALUES (20,'Demi Moore', NULL);
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator """
+        SELECT Name, COUNT(Sport)
+        FROM Student
+        GROUP BY Name
+        """;
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Query
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "name"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/resource/student_{name}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "org.postgresql.Driver";
+  d2rq:password "";
+  d2rq:username "postgres" .
+
+

Output

+
<http://example.com/resource/student_Venus%20Williams> <http://xmlns.com/foaf/0.1/name> "Venus Williams" . 
+<http://example.com/resource/student_Demi%20Moore> <http://xmlns.com/foaf/0.1/name> "Demi Moore" . 
+
+
+
+
+

206. RMLTC0009c-SQLServer

+

Title: "Unnamed column in a logical table"

+

Description: "Test a logical table with unnamed column."

+

Error expected? No

+

Input

+
USE TestDB;
+DROP TABLE IF EXISTS Sport;
+DROP TABLE IF EXISTS Student;
+
+CREATE TABLE Sport (
+ID integer,
+Name varchar (50),
+PRIMARY KEY (ID)
+);
+
+CREATE TABLE Student (
+ID integer,
+Name varchar(50),
+Sport integer,
+PRIMARY KEY (ID),
+FOREIGN KEY(Sport) REFERENCES Sport(ID)
+);
+
+INSERT INTO Sport (ID, Name) VALUES (100,'Tennis');
+INSERT INTO Student (ID, Name, Sport) VALUES (10,'Venus Williams', 100);
+INSERT INTO Student (ID, Name, Sport) VALUES (20,'Demi Moore', NULL);
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator """
+        SELECT Name, COUNT(Sport)
+        FROM Student
+        GROUP BY Name
+        """;
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Query
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "Name"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/resource/student_{Name}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
+  d2rq:password "YourSTRONG!Passw0rd;";
+  d2rq:username "sa" .
+
+

Output

+
<http://example.com/resource/student_Venus%20Williams> <http://xmlns.com/foaf/0.1/name> "Venus Williams" . 
+<http://example.com/resource/student_Demi%20Moore> <http://xmlns.com/foaf/0.1/name> "Demi Moore" . 
+
+
+
+
+

207. RMLTC0009d-MySQL

+

Title: "Named column in logical table"

+

Description: "Test a logical table named column."

+

Error expected? No

+

Input

+
USE test;
+DROP TABLE IF EXISTS test.Student;
+DROP TABLE IF EXISTS test.Sport;
+
+CREATE TABLE Sport (
+ID integer,
+Name varchar (50),
+PRIMARY KEY (ID)
+);
+
+CREATE TABLE Student (
+ID integer,
+Name varchar(50),
+Sport integer,
+PRIMARY KEY (ID),
+FOREIGN KEY(Sport) REFERENCES Sport(ID)
+);
+
+INSERT INTO Sport (ID, Name) VALUES (100,'Tennis');
+INSERT INTO Student (ID, Name, Sport) VALUES (10,'Venus Williams', 100);
+INSERT INTO Student (ID, Name, Sport) VALUES (20,'Demi Moore', NULL);
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator """
+        SELECT Name, COUNT(Sport) as SPORTCOUNT
+        FROM Student
+        GROUP BY Name
+        """;
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Query
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "Name"
+        ];
+      rml:predicate foaf:name
+    ], [
+      rml:objectMap [
+          rml:reference "SPORTCOUNT"
+        ];
+      rml:predicate ex:numSport
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/resource/student_{Name}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
+  d2rq:password "";
+  d2rq:username "root" .
+
+

Output

+
<http://example.com/resource/student_Venus%20Williams> <http://xmlns.com/foaf/0.1/name> "Venus Williams" . 
+<http://example.com/resource/student_Venus%20Williams> <http://example.com/numSport> "1"^^<http://www.w3.org/2001/XMLSchema#integer> . 
+<http://example.com/resource/student_Demi%20Moore> <http://xmlns.com/foaf/0.1/name> "Demi Moore" . 
+<http://example.com/resource/student_Demi%20Moore> <http://example.com/numSport> "0"^^<http://www.w3.org/2001/XMLSchema#integer> . 
+
+
+
+
+
+

208. RMLTC0009d-PostgreSQL

+

Title: "Named column in logical table"

+

Description: "Test a logical table named column."

+

Error expected? No

+

Input

+
DROP TABLE IF EXISTS Student;
+DROP TABLE IF EXISTS Sport;
+
+CREATE TABLE Sport (
+ID integer,
+Name varchar (50),
+PRIMARY KEY (ID)
+);
+
+CREATE TABLE Student (
+ID integer,
+Name varchar(50),
+Sport integer,
+PRIMARY KEY (ID),
+FOREIGN KEY(Sport) REFERENCES Sport(ID)
+);
+
+INSERT INTO Sport (ID, Name) VALUES (100,'Tennis');
+INSERT INTO Student (ID, Name, Sport) VALUES (10,'Venus Williams', 100);
+INSERT INTO Student (ID, Name, Sport) VALUES (20,'Demi Moore', NULL);
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator """
+        SELECT Name, COUNT(Sport) as SPORTCOUNT
+        FROM Student
+        GROUP BY Name
+        """;
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Query
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "name"
+        ];
+      rml:predicate foaf:name
+    ], [
+      rml:objectMap [
+          rml:reference "sportcount"
+        ];
+      rml:predicate ex:numSport
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/resource/student_{name}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "org.postgresql.Driver";
+  d2rq:password "";
+  d2rq:username "postgres" .
+
+

Output

+
<http://example.com/resource/student_Venus%20Williams> <http://xmlns.com/foaf/0.1/name> "Venus Williams" . 
+<http://example.com/resource/student_Venus%20Williams> <http://example.com/numSport> "1"^^<http://www.w3.org/2001/XMLSchema#integer> . 
+<http://example.com/resource/student_Demi%20Moore> <http://xmlns.com/foaf/0.1/name> "Demi Moore" . 
+<http://example.com/resource/student_Demi%20Moore> <http://example.com/numSport> "0"^^<http://www.w3.org/2001/XMLSchema#integer> . 
+
+
+
+
+
+

209. RMLTC0009d-SQLServer

+

Title: "Named column in logical table"

+

Description: "Test a logical table named column."

+

Error expected? No

+

Input

+
USE TestDB;
+DROP TABLE IF EXISTS Student;
+DROP TABLE IF EXISTS Sport;
+
+CREATE TABLE Sport (
+ID integer,
+Name varchar (50),
+PRIMARY KEY (ID)
+);
+
+CREATE TABLE Student (
+ID integer,
+Name varchar(50),
+Sport integer,
+PRIMARY KEY (ID),
+FOREIGN KEY(Sport) REFERENCES Sport(ID)
+);
+
+INSERT INTO Sport (ID, Name) VALUES (100,'Tennis');
+INSERT INTO Student (ID, Name, Sport) VALUES (10,'Venus Williams', 100);
+INSERT INTO Student (ID, Name, Sport) VALUES (20,'Demi Moore', NULL);
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator """
+        SELECT Name, COUNT(Sport) as SPORTCOUNT
+        FROM Student
+        GROUP BY Name
+        """;
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Query
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "Name"
+        ];
+      rml:predicate foaf:name
+    ], [
+      rml:objectMap [
+          rml:reference "SPORTCOUNT"
+        ];
+      rml:predicate ex:numSport
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/resource/student_{Name}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
+  d2rq:password "YourSTRONG!Passw0rd;";
+  d2rq:username "sa" .
+
+

Output

+
<http://example.com/resource/student_Venus%20Williams> <http://xmlns.com/foaf/0.1/name> "Venus Williams" . 
+<http://example.com/resource/student_Venus%20Williams> <http://example.com/numSport> "1"^^<http://www.w3.org/2001/XMLSchema#integer> . 
+<http://example.com/resource/student_Demi%20Moore> <http://xmlns.com/foaf/0.1/name> "Demi Moore" . 
+<http://example.com/resource/student_Demi%20Moore> <http://example.com/numSport> "0"^^<http://www.w3.org/2001/XMLSchema#integer> . 
+
+
+
+
+
+

210. RMLTC0010a-CSV

+

Title: "Template with table column with special chars"

+

Description: "Tests a template with blank space in column value"

+

Error expected? No

+

Input

+
Country Code,Name,ISO 3166
+1,"Bolivia, Plurinational State of",BO
+2,"Ireland",IE
+3,"Saint Martin (French part)",MF
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:referenceFormulation rml:CSV;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "country_info.csv"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "Name"
+        ];
+      rml:predicate ex:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{Country Code}"
+    ] .
+
+

Output

+
<http://example.com/1> <http://example.com/name> "Bolivia, Plurinational State of" .
+<http://example.com/2> <http://example.com/name> "Ireland" .
+<http://example.com/3> <http://example.com/name> "Saint Martin (French part)" .
+
+
+
+

211. RMLTC0010a-JSON

+

Title: "Template with table column with special chars"

+

Description: "Tests a template with blank space in column value"

+

Error expected? No

+

Input

+
{
+  "countries": [{
+    "Country Code": 1,
+    "Name":"Bolivia, Plurinational State of",
+    "ISO 3166": "BO"
+  }, {
+    "Country Code": 2,
+    "Name":"Ireland",
+    "ISO 3166": "IE"
+  }, {
+    "Country Code": 3,
+    "Name":"Saint Martin (French part)",
+    "ISO 3166": "MF"
+  }]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.countries[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "country_info.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.Name"
+        ];
+      rml:predicate ex:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{$.['Country Code']}"
+    ] .
+
+

Output

+
<http://example.com/1> <http://example.com/name> "Bolivia, Plurinational State of" .
+<http://example.com/2> <http://example.com/name> "Ireland" .
+<http://example.com/3> <http://example.com/name> "Saint Martin (French part)" .
+
+
+
+

212. RMLTC0010a-MySQL

+

Title: "Template with table column with special chars"

+

Description: "Tests a template with blank space in column value"

+

Error expected? No

+

Input

+
USE test;
+DROP TABLE IF EXISTS test.country_info;
+
+CREATE TABLE country_info (
+  `Country Code` INTEGER,
+  Name VARCHAR(100),
+  `ISO 3166` VARCHAR(10)
+);
+INSERT INTO country_info values ('1', 'Bolivia, Plurinational State of', 'BO');
+INSERT INTO country_info values ('2', 'Ireland', 'IE');
+INSERT INTO country_info values ('3', 'Saint Martin (French part)', 'MF');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "country_info"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "Name"
+        ];
+      rml:predicate ex:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{Country Code}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
+  d2rq:password "";
+  d2rq:username "root" .
+
+

Output

+
<http://example.com/1> <http://example.com/name> "Bolivia, Plurinational State of" .
+<http://example.com/2> <http://example.com/name> "Ireland" .
+<http://example.com/3> <http://example.com/name> "Saint Martin (French part)" .
+
+
+
+

213. RMLTC0010a-PostgreSQL

+

Title: "Template with table column with special chars"

+

Description: "Tests a template with blank space in column value"

+

Error expected? No

+

Input

+
DROP TABLE IF EXISTS country_info;
+
+CREATE TABLE country_info (
+  "Country Code" INTEGER,
+  "Name" VARCHAR(100),
+  "ISO 3166" VARCHAR(10)
+);
+INSERT INTO country_info values ('1', 'Bolivia, Plurinational State of', 'BO');
+INSERT INTO country_info values ('2', 'Ireland', 'IE');
+INSERT INTO country_info values ('3', 'Saint Martin (French part)', 'MF');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "country_info"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "Name"
+        ];
+      rml:predicate ex:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{Country Code}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "org.postgresql.Driver";
+  d2rq:password "";
+  d2rq:username "postgres" .
+
+

Output

+
<http://example.com/1> <http://example.com/name> "Bolivia, Plurinational State of" .
+<http://example.com/2> <http://example.com/name> "Ireland" .
+<http://example.com/3> <http://example.com/name> "Saint Martin (French part)" .
+
+
+
+

214. RMLTC0010a-SQLServer

+

Title: "Template with table column with special chars"

+

Description: "Tests a template with blank space in column value"

+

Error expected? No

+

Input

+
USE TestDB;
+DROP TABLE IF EXISTS country_info;
+
+CREATE TABLE country_info (
+  "Country Code" INTEGER,
+  "Name" VARCHAR(100),
+  "ISO 3166" VARCHAR(10)
+);
+INSERT INTO country_info values ('1', 'Bolivia, Plurinational State of', 'BO');
+INSERT INTO country_info values ('2', 'Ireland', 'IE');
+INSERT INTO country_info values ('3', 'Saint Martin (French part)', 'MF');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "country_info"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "Name"
+        ];
+      rml:predicate ex:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{Country Code}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
+  d2rq:password "YourSTRONG!Passw0rd;";
+  d2rq:username "sa" .
+
+

Output

+
<http://example.com/1> <http://example.com/name> "Bolivia, Plurinational State of" .
+<http://example.com/2> <http://example.com/name> "Ireland" .
+<http://example.com/3> <http://example.com/name> "Saint Martin (French part)" .
+
+
+
+

215. RMLTC0010b-CSV

+

Title: "Template with table columns with special chars"

+

Description: "Tests a template with special chars in column value"

+

Error expected? No

+

Input

+
Country Code,Name,ISO 3166
+1,"Bolivia, Plurinational State of",BO
+2,Ireland,IE
+3,"Saint Martin (French part)",MF
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:referenceFormulation rml:CSV;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "country_info.csv"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "Name"
+        ];
+      rml:predicate ex:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{Country Code}/{Name}"
+    ] .
+
+

Output

+
<http://example.com/1/Bolivia%2C%20Plurinational%20State%20of> <http://example.com/name> "Bolivia, Plurinational State of" .
+<http://example.com/2/Ireland> <http://example.com/name> "Ireland" .
+<http://example.com/3/Saint%20Martin%20%28French%20part%29> <http://example.com/name> "Saint Martin (French part)" .
+
+
+
+

216. RMLTC0010b-JSON

+

Title: "Template with table columns with special chars"

+

Description: "Tests a template with special chars in column value"

+

Error expected? No

+

Input

+
{
+  "countries": [{
+    "Country Code": 1,
+    "Name":"Bolivia, Plurinational State of",
+    "ISO 3166": "BO"
+  }, {
+    "Country Code": 2,
+    "Name":"Ireland",
+    "ISO 3166": "IE"
+  }, {
+    "Country Code": 3,
+    "Name":"Saint Martin (French part)",
+    "ISO 3166": "MF"
+  }]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.countries[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "country_info.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.Name"
+        ];
+      rml:predicate ex:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{$.['Country Code']}/{$.Name}"
+    ] .
+
+

Output

+
<http://example.com/1/Bolivia%2C%20Plurinational%20State%20of> <http://example.com/name> "Bolivia, Plurinational State of" .
+<http://example.com/2/Ireland> <http://example.com/name> "Ireland" .
+<http://example.com/3/Saint%20Martin%20%28French%20part%29> <http://example.com/name> "Saint Martin (French part)" .
+
+
+
+

217. RMLTC0010b-MySQL

+

Title: "Template with table columns with special chars"

+

Description: "Tests a template with special chars in column value"

+

Error expected? No

+

Input

+
USE test;
+DROP TABLE IF EXISTS test.country_info;
+
+CREATE TABLE country_info (
+  `Country Code` INTEGER,
+  Name VARCHAR(100),
+  `ISO 3166` VARCHAR(10)
+);
+INSERT INTO country_info values ('1', 'Bolivia, Plurinational State of', 'BO');
+INSERT INTO country_info values ('2', 'Ireland', 'IE');
+INSERT INTO country_info values ('3', 'Saint Martin (French part)', 'MF');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "country_info"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "Name"
+        ];
+      rml:predicate ex:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{Country Code}/{Name}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
+  d2rq:password "";
+  d2rq:username "root" .
+
+

Output

+
<http://example.com/1/Bolivia%2C%20Plurinational%20State%20of> <http://example.com/name> "Bolivia, Plurinational State of" .
+<http://example.com/2/Ireland> <http://example.com/name> "Ireland" .
+<http://example.com/3/Saint%20Martin%20%28French%20part%29> <http://example.com/name> "Saint Martin (French part)" .
+
+
+
+

218. RMLTC0010b-PostgreSQL

+

Title: "Template with table columns with special chars"

+

Description: "Tests a template with special chars in column value"

+

Error expected? No

+

Input

+
DROP TABLE IF EXISTS country_info;
+
+CREATE TABLE country_info (
+  "Country Code" INTEGER,
+  "Name" VARCHAR(100),
+  "ISO 3166" VARCHAR(10)
+);
+INSERT INTO country_info values ('1', 'Bolivia, Plurinational State of', 'BO');
+INSERT INTO country_info values ('2', 'Ireland', 'IE');
+INSERT INTO country_info values ('3', 'Saint Martin (French part)', 'MF');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "country_info"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "Name"
+        ];
+      rml:predicate ex:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{Country Code}/{Name}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "org.postgresql.Driver";
+  d2rq:password "";
+  d2rq:username "postgres" .
+
+

Output

+
<http://example.com/1/Bolivia%2C%20Plurinational%20State%20of> <http://example.com/name> "Bolivia, Plurinational State of" .
+<http://example.com/2/Ireland> <http://example.com/name> "Ireland" .
+<http://example.com/3/Saint%20Martin%20%28French%20part%29> <http://example.com/name> "Saint Martin (French part)" .
+
+
+
+

219. RMLTC0010b-SQLServer

+

Title: "Template with table columns with special chars"

+

Description: "Tests a template with special chars in column value"

+

Error expected? No

+

Input

+
USE TestDB;
+DROP TABLE IF EXISTS country_info;
+
+CREATE TABLE country_info (
+  "Country Code" INTEGER,
+  "Name" VARCHAR(100),
+  "ISO 3166" VARCHAR(10)
+);
+INSERT INTO country_info values ('1', 'Bolivia, Plurinational State of', 'BO');
+INSERT INTO country_info values ('2', 'Ireland', 'IE');
+INSERT INTO country_info values ('3', 'Saint Martin (French part)', 'MF');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "country_info"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "Name"
+        ];
+      rml:predicate ex:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{Country Code}/{Name}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
+  d2rq:password "YourSTRONG!Passw0rd;";
+  d2rq:username "sa" .
+
+

Output

+
<http://example.com/1/Bolivia%2C%20Plurinational%20State%20of> <http://example.com/name> "Bolivia, Plurinational State of" .
+<http://example.com/2/Ireland> <http://example.com/name> "Ireland" .
+<http://example.com/3/Saint%20Martin%20%28French%20part%29> <http://example.com/name> "Saint Martin (French part)" .
+
+
+
+

220. RMLTC0010b-XML

+

Title: "Template with table columns with special chars"

+

Description: "Tests a template with special chars in column value"

+

Error expected? No

+

Input

+
<?xml version="1.0"?>
+
+<countries>
+  <country>
+    <CountryCode>1</CountryCode>
+    <Name>Bolivia, Plurinational State of</Name>
+    <ISO3166>BO</ISO3166>
+  </country>
+  <country>
+    <CountryCode>2</CountryCode>
+    <Name>Ireland</Name>
+    <ISO3166>IE</ISO3166>
+  </country>
+  <country>
+    <CountryCode>3</CountryCode>
+    <Name>Saint Martin (French part)</Name>
+    <ISO3166>MF</ISO3166>
+  </country>
+</countries>
+
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "/countries/country";
+      rml:referenceFormulation rml:XPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "country_info.xml"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "Name"
+        ];
+      rml:predicate ex:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{CountryCode}/{Name}"
+    ] .
+
+

Output

+
<http://example.com/1/Bolivia%2C%20Plurinational%20State%20of> <http://example.com/name> "Bolivia, Plurinational State of" .
+<http://example.com/2/Ireland> <http://example.com/name> "Ireland" .
+<http://example.com/3/Saint%20Martin%20%28French%20part%29> <http://example.com/name> "Saint Martin (French part)" .
+
+
+
+

221. RMLTC0010c-CSV

+

Title: "Template with table columns with special chars and backslashes"

+

Description: "Tests a template with special chars in reference value and backslash escapes in string templates"

+

Error expected? No

+

Input

+
Country Code,Name,ISO 3166
+1,"Bolivia, Plurinational State of",BO
+2,Ireland,IE
+3,Saint Martin (French part),MF
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:referenceFormulation rml:CSV;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "country_info.csv"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:template "\\{\\{\\{ {ISO 3166} \\}\\}\\}";
+          rml:termType rml:Literal
+        ];
+      rml:predicate ex:code
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{Country Code}/{Name}"
+    ] .
+
+

Output

+
<http://example.com/1/Bolivia%2C%20Plurinational%20State%20of> <http://example.com/code> "{{{ BO }}}" .
+<http://example.com/2/Ireland> <http://example.com/code> "{{{ IE }}}" .
+<http://example.com/3/Saint%20Martin%20%28French%20part%29> <http://example.com/code> "{{{ MF }}}" .
+
+
+
+

222. RMLTC0010c-JSON

+

Title: "Template with table columns with special chars and backslashes"

+

Description: "Tests a template with special chars in reference value and backslash escapes in string templates"

+

Error expected? No

+

Input

+
{
+  "countries": [{
+    "Country Code": 1,
+    "Name":"Bolivia, Plurinational State of",
+    "ISO 3166": "BO"
+  }, {
+    "Country Code": 2,
+    "Name":"Ireland",
+    "ISO 3166": "IE"
+  }, {
+    "Country Code": 3,
+    "Name":"Saint Martin (French part)",
+    "ISO 3166": "MF"
+  }]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.countries[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "country_info.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:predicate ex:code;
+      rml:objectMap [
+          rml:template "\\{\\{\\{ {$.['ISO 3166']} \\}\\}\\}";
+          rml:termType rml:Literal
+        ]
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{$.['Country Code']}/{$.Name}"
+    ] .
+
+

Output

+
<http://example.com/1/Bolivia%2C%20Plurinational%20State%20of> <http://example.com/code> "{{{ BO }}}" .
+<http://example.com/2/Ireland> <http://example.com/code> "{{{ IE }}}" .
+<http://example.com/3/Saint%20Martin%20%28French%20part%29> <http://example.com/code> "{{{ MF }}}" .
+
+
+
+

223. RMLTC0010c-MySQL

+

Title: "Template with table columns with special chars and backslashes"

+

Description: "Tests a template with special chars in column value and backslash escapes in string templates"

+

Error expected? No

+

Input

+
USE test;
+DROP TABLE IF EXISTS test.country_info;
+
+CREATE TABLE country_info (
+  `Country Code` INTEGER,
+  Name VARCHAR(100),
+  `ISO 3166` VARCHAR(10)
+);
+INSERT INTO country_info values ('1', 'Bolivia, Plurinational State of', 'BO');
+INSERT INTO country_info values ('2', 'Ireland', 'IE');
+INSERT INTO country_info values ('3', 'Saint Martin (French part)', 'MF');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "country_info"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:template "\\{\\{\\{ {ISO 3166} \\}\\}\\}";
+          rml:termType rml:Literal
+        ];
+      rml:predicate ex:code
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{Country Code}/{Name}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
+  d2rq:password "";
+  d2rq:username "root" .
+
+

Output

+
<http://example.com/1/Bolivia%2C%20Plurinational%20State%20of> <http://example.com/code> "{{{ BO }}}" .
+<http://example.com/2/Ireland> <http://example.com/code> "{{{ IE }}}" .
+<http://example.com/3/Saint%20Martin%20%28French%20part%29> <http://example.com/code> "{{{ MF }}}" .
+
+
+
+

224. RMLTC0010c-PostgreSQL

+

Title: "Template with table columns with special chars and backslashes"

+

Description: "Tests a template with special chars in column value and backslash escapes in string templates"

+

Error expected? No

+

Input

+
DROP TABLE IF EXISTS country_info;
+
+CREATE TABLE country_info (
+  "Country Code" INTEGER,
+  "Name" VARCHAR(100),
+  "ISO 3166" VARCHAR(10)
+);
+INSERT INTO country_info values ('1', 'Bolivia, Plurinational State of', 'BO');
+INSERT INTO country_info values ('2', 'Ireland', 'IE');
+INSERT INTO country_info values ('3', 'Saint Martin (French part)', 'MF');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "country_info"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:template "\\{\\{\\{ {ISO 3166} \\}\\}\\}";
+          rml:termType rml:Literal
+        ];
+      rml:predicate ex:code
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{Country Code}/{Name}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "org.postgresql.Driver";
+  d2rq:password "";
+  d2rq:username "postgres" .
+
+

Output

+
<http://example.com/1/Bolivia%2C%20Plurinational%20State%20of> <http://example.com/code> "{{{ BO }}}" .
+<http://example.com/2/Ireland> <http://example.com/code> "{{{ IE }}}" .
+<http://example.com/3/Saint%20Martin%20%28French%20part%29> <http://example.com/code> "{{{ MF }}}" .
+
+
+
+

225. RMLTC0010c-SQLServer

+

Title: "Template with table columns with special chars and backslashes"

+

Description: "Tests a template with special chars in column value and backslash escapes in string templates"

+

Error expected? No

+

Input

+
USE TestDB;
+DROP TABLE IF EXISTS country_info;
+
+CREATE TABLE country_info (
+  "Country Code" INTEGER,
+  "Name" VARCHAR(100),
+  "ISO 3166" VARCHAR(10)
+);
+INSERT INTO country_info values ('1', 'Bolivia, Plurinational State of', 'BO');
+INSERT INTO country_info values ('2', 'Ireland', 'IE');
+INSERT INTO country_info values ('3', 'Saint Martin (French part)', 'MF');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "country_info"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:template "\\{\\{\\{ {ISO 3166} \\}\\}\\}";
+          rml:termType rml:Literal
+        ];
+      rml:predicate ex:code
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{Country Code}/{Name}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
+  d2rq:password "YourSTRONG!Passw0rd;";
+  d2rq:username "sa" .
+
+

Output

+
<http://example.com/1/Bolivia%2C%20Plurinational%20State%20of> <http://example.com/code> "{{{ BO }}}" .
+<http://example.com/2/Ireland> <http://example.com/code> "{{{ IE }}}" .
+<http://example.com/3/Saint%20Martin%20%28French%20part%29> <http://example.com/code> "{{{ MF }}}" .
+
+
+
+

226. RMLTC0010c-XML

+

Title: "Template with table columns with special chars and backslashes"

+

Description: "Tests a template with special chars in reference value and backslash escapes in string templates"

+

Error expected? No

+

Input

+
<?xml version="1.0"?>
+
+<countries>
+  <country>
+    <CountryCode>1</CountryCode>
+    <Name>Bolivia, Plurinational State of</Name>
+    <ISO3166>BO</ISO3166>
+  </country>
+  <country>
+    <CountryCode>2</CountryCode>
+    <Name>Ireland</Name>
+    <ISO3166>IE</ISO3166>
+  </country>
+  <country>
+    <CountryCode>3</CountryCode>
+    <Name>Saint Martin (French part)</Name>
+    <ISO3166>MF</ISO3166>
+  </country>
+</countries>
+
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "/countries/country";
+      rml:referenceFormulation rml:XPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "country_info.xml"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:template "\\{\\{\\{ {ISO3166} \\}\\}\\}";
+          rml:termType rml:Literal
+        ];
+      rml:predicate ex:code
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{CountryCode}/{Name}"
+    ] .
+
+

Output

+
<http://example.com/1/Bolivia%2C%20Plurinational%20State%20of> <http://example.com/code> "{{{ BO }}}" .
+<http://example.com/2/Ireland> <http://example.com/code> "{{{ IE }}}" .
+<http://example.com/3/Saint%20Martin%20%28French%20part%29> <http://example.com/code> "{{{ MF }}}" .
+
+
+
+

227. RMLTC0011a-MySQL

+

Title: "M to M relation, by using a SQL query"

+

Description: "Tests, M to M relations, by using a SQL query"

+

Error expected? No

+

Input

+
USE test;
+SET FOREIGN_KEY_CHECKS = 0;
+DROP TABLE IF EXISTS test.Student_Sport;
+DROP TABLE IF EXISTS test.Sport;
+DROP TABLE IF EXISTS test.Student;
+SET FOREIGN_KEY_CHECKS = 1;
+
+CREATE TABLE Student (
+ID integer PRIMARY KEY,
+FirstName varchar(50),
+LastName varchar(50)
+);
+CREATE TABLE Sport (
+ID integer PRIMARY KEY,
+Description varchar(50)
+);
+CREATE TABLE Student_Sport (
+ID_Student integer,
+ID_Sport integer,
+PRIMARY KEY (ID_Student,ID_Sport),
+FOREIGN KEY (ID_Student) REFERENCES Student(ID),
+FOREIGN KEY (ID_Sport) REFERENCES Sport(ID)
+);
+
+INSERT INTO Student (ID,FirstName,LastName) VALUES (10,'Venus', 'Williams');
+INSERT INTO Student (ID,FirstName,LastName) VALUES (11,'Fernando', 'Alonso');
+INSERT INTO Student (ID,FirstName,LastName) VALUES (12,'David', 'Villa');
+
+INSERT INTO Sport (ID, Description) VALUES (110,'Tennis');
+INSERT INTO Sport (ID, Description) VALUES (111,'Football');
+INSERT INTO Sport (ID, Description) VALUES (112,'Formula1');
+
+INSERT INTO Student_Sport (ID_Student, ID_Sport) VALUES (10,110);
+INSERT INTO Student_Sport (ID_Student, ID_Sport) VALUES (11,111);
+INSERT INTO Student_Sport (ID_Student, ID_Sport) VALUES (11,112);
+INSERT INTO Student_Sport (ID_Student, ID_Sport) VALUES (12,111);
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator """
+       SELECT Student.ID as ID,
+              Student.FirstName as FirstName,
+              Student.LastName as LastName,
+              Sport.Description as Description,
+              Sport.ID as Sport_ID
+       FROM Student,Sport,Student_Sport
+       WHERE Student.ID = Student_Sport.ID_Student
+       AND Sport.ID = Student_Sport.ID_Sport;
+       """;
+      rml:referenceFormulation rml:SQL2008Query;
+      rml:source <http://example.com/base/#DB_source>
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "ID"
+        ];
+      rml:predicate ex:id
+    ], [
+      rml:objectMap [
+          rml:reference "FirstName"
+        ];
+      rml:predicate ex:firstName
+    ], [
+      rml:objectMap [
+          rml:reference "LastName"
+        ];
+      rml:predicate ex:lastName
+    ], [
+      rml:objectMap [
+          rml:template "http://example.com/{Sport_ID}/{Description}"
+        ];
+      rml:predicate ex:plays
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{ID}/{FirstName};{LastName}"
+    ] .
+
+<http://example.com/base/TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator """
+       SELECT * FROM Sport;
+       """;
+      rml:referenceFormulation rml:SQL2008Query;
+      rml:source <http://example.com/base/#DB_source>
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "ID"
+        ];
+      rml:predicate ex:id
+    ], [
+      rml:objectMap [
+          rml:reference "Description"
+        ];
+      rml:predicate ex:description
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{ID}/{Description}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
+  d2rq:password "";
+  d2rq:username "root" .
+
+

Output

+
<http://example.com/110/Tennis> <http://example.com/description> "Tennis" .
+<http://example.com/110/Tennis> <http://example.com/id> "110"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.com/10/Venus;Williams> <http://example.com/plays> <http://example.com/110/Tennis> .
+<http://example.com/10/Venus;Williams> <http://example.com/lastName> "Williams" .
+<http://example.com/10/Venus;Williams> <http://example.com/firstName> "Venus" .
+<http://example.com/10/Venus;Williams> <http://example.com/id> "10"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.com/111/Football> <http://example.com/description> "Football" .
+<http://example.com/111/Football> <http://example.com/id> "111"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.com/12/David;Villa> <http://example.com/plays> <http://example.com/111/Football> .
+<http://example.com/12/David;Villa> <http://example.com/lastName> "Villa" .
+<http://example.com/12/David;Villa> <http://example.com/firstName> "David" .
+<http://example.com/12/David;Villa> <http://example.com/id> "12"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.com/112/Formula1> <http://example.com/description> "Formula1" .
+<http://example.com/112/Formula1> <http://example.com/id> "112"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.com/11/Fernando;Alonso> <http://example.com/lastName> "Alonso" .
+<http://example.com/11/Fernando;Alonso> <http://example.com/firstName> "Fernando" .
+<http://example.com/11/Fernando;Alonso> <http://example.com/id> "11"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.com/11/Fernando;Alonso> <http://example.com/plays> <http://example.com/111/Football> .
+<http://example.com/11/Fernando;Alonso> <http://example.com/plays> <http://example.com/112/Formula1> .
+
+
+
+

228. RMLTC0011a-PostgreSQL

+

Title: "M to M relation, by using a SQL query"

+

Description: "Tests, M to M relations, by using a SQL query"

+

Error expected? No

+

Input

+
DROP TABLE IF EXISTS Student_Sport;
+DROP TABLE IF EXISTS Sport CASCADE;
+DROP TABLE IF EXISTS Student;
+
+CREATE TABLE Student (
+ID integer PRIMARY KEY,
+FirstName varchar(50),
+LastName varchar(50)
+);
+CREATE TABLE Sport (
+ID integer PRIMARY KEY,
+Description varchar(50)
+);
+CREATE TABLE Student_Sport (
+ID_Student integer,
+ID_Sport integer,
+PRIMARY KEY (ID_Student,ID_Sport),
+FOREIGN KEY (ID_Student) REFERENCES Student(ID),
+FOREIGN KEY (ID_Sport) REFERENCES Sport(ID)
+);
+
+INSERT INTO Student (ID,FirstName,LastName) VALUES (10,'Venus', 'Williams');
+INSERT INTO Student (ID,FirstName,LastName) VALUES (11,'Fernando', 'Alonso');
+INSERT INTO Student (ID,FirstName,LastName) VALUES (12,'David', 'Villa');
+
+INSERT INTO Sport (ID, Description) VALUES (110,'Tennis');
+INSERT INTO Sport (ID, Description) VALUES (111,'Football');
+INSERT INTO Sport (ID, Description) VALUES (112,'Formula1');
+
+INSERT INTO Student_Sport (ID_Student, ID_Sport) VALUES (10,110);
+INSERT INTO Student_Sport (ID_Student, ID_Sport) VALUES (11,111);
+INSERT INTO Student_Sport (ID_Student, ID_Sport) VALUES (11,112);
+INSERT INTO Student_Sport (ID_Student, ID_Sport) VALUES (12,111);
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator """
+       SELECT Student.ID as ID,
+              Student.FirstName as FirstName,
+              Student.LastName as LastName,
+              Sport.Description as Description,
+              Sport.ID as Sport_ID
+       FROM Student,Sport,Student_Sport
+       WHERE Student.ID = Student_Sport.ID_Student
+       AND Sport.ID = Student_Sport.ID_Sport;
+       """;
+      rml:referenceFormulation rml:SQL2008Query;
+      rml:source <http://example.com/base/#DB_source>
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "id"
+        ];
+      rml:predicate ex:id
+    ], [
+      rml:objectMap [
+          rml:reference "firstname"
+        ];
+      rml:predicate ex:firstName
+    ], [
+      rml:objectMap [
+          rml:reference "lastname"
+        ];
+      rml:predicate ex:lastName
+    ], [
+      rml:objectMap [
+          rml:template "http://example.com/{sport_id}/{description}"
+        ];
+      rml:predicate ex:plays
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{id}/{firstname};{lastname}"
+    ] .
+
+<http://example.com/base/TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator """
+       SELECT * FROM Sport ;
+       """;
+      rml:referenceFormulation rml:SQL2008Query;
+      rml:source <http://example.com/base/#DB_source>
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "id"
+        ];
+      rml:predicate ex:id
+    ], [
+      rml:objectMap [
+          rml:reference "description"
+        ];
+      rml:predicate ex:description
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{id}/{description}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "org.postgresql.Driver";
+  d2rq:password "";
+  d2rq:username "postgres" .
+
+

Output

+
<http://example.com/110/Tennis> <http://example.com/description> "Tennis" .
+<http://example.com/110/Tennis> <http://example.com/id> "110"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.com/10/Venus;Williams> <http://example.com/plays> <http://example.com/110/Tennis> .
+<http://example.com/10/Venus;Williams> <http://example.com/lastName> "Williams" .
+<http://example.com/10/Venus;Williams> <http://example.com/firstName> "Venus" .
+<http://example.com/10/Venus;Williams> <http://example.com/id> "10"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.com/111/Football> <http://example.com/description> "Football" .
+<http://example.com/111/Football> <http://example.com/id> "111"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.com/12/David;Villa> <http://example.com/plays> <http://example.com/111/Football> .
+<http://example.com/12/David;Villa> <http://example.com/lastName> "Villa" .
+<http://example.com/12/David;Villa> <http://example.com/firstName> "David" .
+<http://example.com/12/David;Villa> <http://example.com/id> "12"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.com/112/Formula1> <http://example.com/description> "Formula1" .
+<http://example.com/112/Formula1> <http://example.com/id> "112"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.com/11/Fernando;Alonso> <http://example.com/lastName> "Alonso" .
+<http://example.com/11/Fernando;Alonso> <http://example.com/firstName> "Fernando" .
+<http://example.com/11/Fernando;Alonso> <http://example.com/id> "11"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.com/11/Fernando;Alonso> <http://example.com/plays> <http://example.com/111/Football> .
+<http://example.com/11/Fernando;Alonso> <http://example.com/plays> <http://example.com/112/Formula1> .
+
+
+
+

229. RMLTC0011a-SQLServer

+

Title: "M to M relation, by using a SQL query"

+

Description: "Tests, M to M relations, by using a SQL query"

+

Error expected? No

+

Input

+
USE TestDB;
+EXEC sp_msforeachtable 'ALTER TABLE ? NOCHECK CONSTRAINT all'
+EXEC sp_msforeachtable 'DROP TABLE ?'
+
+CREATE TABLE Student (
+ID integer PRIMARY KEY,
+FirstName varchar(50),
+LastName varchar(50)
+);
+CREATE TABLE Sport (
+ID integer PRIMARY KEY,
+Description varchar(50)
+);
+CREATE TABLE Student_Sport (
+ID_Student integer,
+ID_Sport integer,
+PRIMARY KEY (ID_Student,ID_Sport),
+FOREIGN KEY (ID_Student) REFERENCES Student(ID),
+FOREIGN KEY (ID_Sport) REFERENCES Sport(ID)
+);
+
+INSERT INTO Student (ID,FirstName,LastName) VALUES (10,'Venus', 'Williams');
+INSERT INTO Student (ID,FirstName,LastName) VALUES (11,'Fernando', 'Alonso');
+INSERT INTO Student (ID,FirstName,LastName) VALUES (12,'David', 'Villa');
+
+INSERT INTO Sport (ID, Description) VALUES (110,'Tennis');
+INSERT INTO Sport (ID, Description) VALUES (111,'Football');
+INSERT INTO Sport (ID, Description) VALUES (112,'Formula1');
+
+INSERT INTO Student_Sport (ID_Student, ID_Sport) VALUES (10,110);
+INSERT INTO Student_Sport (ID_Student, ID_Sport) VALUES (11,111);
+INSERT INTO Student_Sport (ID_Student, ID_Sport) VALUES (11,112);
+INSERT INTO Student_Sport (ID_Student, ID_Sport) VALUES (12,111);
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator """
+       SELECT Student.ID as ID,
+              Student.FirstName as FirstName,
+              Student.LastName as LastName,
+              Sport.Description as Description,
+              Sport.ID as Sport_ID
+       FROM Student,Sport,Student_Sport
+       WHERE Student.ID = Student_Sport.ID_Student
+       AND Sport.ID = Student_Sport.ID_Sport;
+       """;
+      rml:referenceFormulation rml:SQL2008Query;
+      rml:source <http://example.com/base/#DB_source>
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "ID"
+        ];
+      rml:predicate ex:id
+    ], [
+      rml:objectMap [
+          rml:reference "FirstName"
+        ];
+      rml:predicate ex:firstName
+    ], [
+      rml:objectMap [
+          rml:reference "LastName"
+        ];
+      rml:predicate ex:lastName
+    ], [
+      rml:objectMap [
+          rml:template "http://example.com/{Sport_ID}/{Description}"
+        ];
+      rml:predicate ex:plays
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{ID}/{FirstName};{LastName}"
+    ] .
+
+<http://example.com/base/TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator """
+       SELECT * FROM Sport ;
+       """;
+      rml:referenceFormulation rml:SQL2008Query;
+      rml:source <http://example.com/base/#DB_source>
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "ID"
+        ];
+      rml:predicate ex:id
+    ], [
+      rml:objectMap [
+          rml:reference "Description"
+        ];
+      rml:predicate ex:description
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{ID}/{Description}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
+  d2rq:password "YourSTRONG!Passw0rd;";
+  d2rq:username "sa" .
+
+

Output

+
<http://example.com/110/Tennis> <http://example.com/description> "Tennis" .
+<http://example.com/110/Tennis> <http://example.com/id> "110"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.com/10/Venus;Williams> <http://example.com/plays> <http://example.com/110/Tennis> .
+<http://example.com/10/Venus;Williams> <http://example.com/lastName> "Williams" .
+<http://example.com/10/Venus;Williams> <http://example.com/firstName> "Venus" .
+<http://example.com/10/Venus;Williams> <http://example.com/id> "10"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.com/111/Football> <http://example.com/description> "Football" .
+<http://example.com/111/Football> <http://example.com/id> "111"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.com/12/David;Villa> <http://example.com/plays> <http://example.com/111/Football> .
+<http://example.com/12/David;Villa> <http://example.com/lastName> "Villa" .
+<http://example.com/12/David;Villa> <http://example.com/firstName> "David" .
+<http://example.com/12/David;Villa> <http://example.com/id> "12"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.com/112/Formula1> <http://example.com/description> "Formula1" .
+<http://example.com/112/Formula1> <http://example.com/id> "112"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.com/11/Fernando;Alonso> <http://example.com/lastName> "Alonso" .
+<http://example.com/11/Fernando;Alonso> <http://example.com/firstName> "Fernando" .
+<http://example.com/11/Fernando;Alonso> <http://example.com/id> "11"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.com/11/Fernando;Alonso> <http://example.com/plays> <http://example.com/111/Football> .
+<http://example.com/11/Fernando;Alonso> <http://example.com/plays> <http://example.com/112/Formula1> .
+
+
+
+

230. RMLTC0011b-CSV

+

Title: "M to M relation, by using an additional Triples Map"

+

Description: "Tests, M to M relations, by using an additional Triples Map"

+

Error expected? No

+

Input

+
ID,FirstName,LastName
+10,Venus,Williams
+11,Fernando,Alonso
+12,David,Villa
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/LinkMap_1_2> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:referenceFormulation rml:CSV;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student_sport.csv"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:template "http://example.com/sport/{ID_Sport}"
+        ];
+      rml:predicate ex:plays
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/student/{ID_Student}"
+    ] .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:referenceFormulation rml:CSV;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.csv"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "FirstName"
+        ];
+      rml:predicate ex:firstName
+    ], [
+      rml:objectMap [
+          rml:reference "LastName"
+        ];
+      rml:predicate ex:lastName
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/student/{ID}"
+    ] .
+
+<http://example.com/base/TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:referenceFormulation rml:CSV;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "sport.csv"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "Description"
+        ];
+      rml:predicate ex:description
+    ], [
+      rml:objectMap [
+          rml:reference "ID"
+        ];
+      rml:predicate ex:id
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/sport/{ID}"
+    ] .
+
+

Output

+
<http://example.com/student/10> <http://example.com/lastName> "Williams" .
+<http://example.com/student/10> <http://example.com/firstName> "Venus" .
+<http://example.com/student/12> <http://example.com/lastName> "Villa" .
+<http://example.com/student/12> <http://example.com/firstName> "David" .
+<http://example.com/student/11> <http://example.com/lastName> "Alonso" .
+<http://example.com/student/11> <http://example.com/firstName> "Fernando" .
+<http://example.com/sport/110> <http://example.com/description> "Tennis" .
+<http://example.com/sport/110> <http://example.com/id> "110" .
+<http://example.com/sport/111> <http://example.com/description> "Football" .
+<http://example.com/sport/111> <http://example.com/id> "111" .
+<http://example.com/sport/112> <http://example.com/description> "Formula1" .
+<http://example.com/sport/112> <http://example.com/id> "112" .
+<http://example.com/student/10> <http://example.com/plays> <http://example.com/sport/110> .
+<http://example.com/student/12> <http://example.com/plays> <http://example.com/sport/111> .
+<http://example.com/student/11> <http://example.com/plays> <http://example.com/sport/112> .
+<http://example.com/student/11> <http://example.com/plays> <http://example.com/sport/111> .
+
+
+
+

231. RMLTC0011b-JSON

+

Title: "M to M relation, by using an additional Triples Map"

+

Description: "Tests, M to M relations, by using an additional Triples Map"

+

Error expected? No

+

Input

+
{
+  "students": [
+    {"ID":10, "FirstName":"Venus", "LastName":"Williams"},
+    {"ID":11, "FirstName":"Fernando", "LastName":"Alonso"},
+    {"ID":12, "FirstName":"David", "LastName":"Villa"}
+  ]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/LinkMap_1_2> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.links[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student_sport.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:template "http://example.com/sport/{$.ID_Sport}"
+        ];
+      rml:predicate ex:plays
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/student/{$.ID_Student}"
+    ] .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.FirstName"
+        ];
+      rml:predicate ex:firstName
+    ], [
+      rml:objectMap [
+          rml:reference "$.LastName"
+        ];
+      rml:predicate ex:lastName
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/student/{$.ID}"
+    ] .
+
+<http://example.com/base/TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.sports[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "sport.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.Description"
+        ];
+      rml:predicate ex:description
+    ], [
+      rml:objectMap [
+          rml:reference "$.ID"
+        ];
+      rml:predicate ex:id
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/sport/{$.ID}"
+    ] .
+
+

Output

+
<http://example.com/student/10> <http://example.com/lastName> "Williams" .
+<http://example.com/student/10> <http://example.com/firstName> "Venus" .
+<http://example.com/student/12> <http://example.com/lastName> "Villa" .
+<http://example.com/student/12> <http://example.com/firstName> "David" .
+<http://example.com/student/11> <http://example.com/lastName> "Alonso" .
+<http://example.com/student/11> <http://example.com/firstName> "Fernando" .
+<http://example.com/sport/110> <http://example.com/description> "Tennis" .
+<http://example.com/sport/110> <http://example.com/id> "110" .
+<http://example.com/sport/111> <http://example.com/description> "Football" .
+<http://example.com/sport/111> <http://example.com/id> "111" .
+<http://example.com/sport/112> <http://example.com/description> "Formula1" .
+<http://example.com/sport/112> <http://example.com/id> "112" .
+<http://example.com/student/10> <http://example.com/plays> <http://example.com/sport/110> .
+<http://example.com/student/12> <http://example.com/plays> <http://example.com/sport/111> .
+<http://example.com/student/11> <http://example.com/plays> <http://example.com/sport/112> .
+<http://example.com/student/11> <http://example.com/plays> <http://example.com/sport/111> .
+
+
+
+

232. RMLTC0011b-MySQL

+

Title: "M to M relation, by using an additional Triples Map"

+

Description: "Tests, M to M relations, by using an additional Triples Map"

+

Error expected? No

+

Input

+
USE test;
+SET FOREIGN_KEY_CHECKS = 0;
+DROP TABLE IF EXISTS test.student_sport;
+DROP TABLE IF EXISTS test.student;
+DROP TABLE IF EXISTS test.sport;
+SET FOREIGN_KEY_CHECKS = 1;
+
+CREATE TABLE sport (
+  ID INTEGER,
+  Description VARCHAR(200)
+);
+INSERT INTO sport values ('110','Tennis');
+INSERT INTO sport values ('111','Football');
+INSERT INTO sport values ('112','Formula1');
+
+
+CREATE TABLE student (
+  ID INTEGER,
+  FirstName VARCHAR(200),
+  LastName VARCHAR(200)
+);
+INSERT INTO student values ('10','Venus','Williams');
+INSERT INTO student values ('11','Fernando','Alonso');
+INSERT INTO student values ('12','David','Villa');
+
+
+CREATE TABLE student_sport (
+  ID_Student INTEGER,
+  ID_Sport INTEGER
+);
+INSERT INTO student_sport values ('10', '110');
+INSERT INTO student_sport values ('11','111');
+INSERT INTO student_sport values ('11','112');
+INSERT INTO student_sport values ('12','111');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/LinkMap_1_2> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "student_sport"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:template "http://example.com/sport/{ID_Sport}"
+        ];
+      rml:predicate ex:plays
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/student/{ID_Student}"
+    ] .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "student"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "FirstName"
+        ];
+      rml:predicate ex:firstName
+    ], [
+      rml:objectMap [
+          rml:reference "LastName"
+        ];
+      rml:predicate ex:lastName
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/student/{ID}"
+    ] .
+
+<http://example.com/base/TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "sport"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "Description"
+        ];
+      rml:predicate ex:description
+    ], [
+      rml:objectMap [
+          rml:reference "ID"
+        ];
+      rml:predicate ex:id
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/sport/{ID}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
+  d2rq:password "";
+  d2rq:username "root" .
+
+

Output

+
<http://example.com/student/10> <http://example.com/lastName> "Williams" .
+<http://example.com/student/10> <http://example.com/firstName> "Venus" .
+<http://example.com/student/12> <http://example.com/lastName> "Villa" .
+<http://example.com/student/12> <http://example.com/firstName> "David" .
+<http://example.com/student/11> <http://example.com/lastName> "Alonso" .
+<http://example.com/student/11> <http://example.com/firstName> "Fernando" .
+<http://example.com/sport/110> <http://example.com/description> "Tennis" .
+<http://example.com/sport/110> <http://example.com/id> "110"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.com/sport/111> <http://example.com/description> "Football" .
+<http://example.com/sport/111> <http://example.com/id> "111"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.com/sport/112> <http://example.com/description> "Formula1" .
+<http://example.com/sport/112> <http://example.com/id> "112"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.com/student/10> <http://example.com/plays> <http://example.com/sport/110> .
+<http://example.com/student/12> <http://example.com/plays> <http://example.com/sport/111> .
+<http://example.com/student/11> <http://example.com/plays> <http://example.com/sport/112> .
+<http://example.com/student/11> <http://example.com/plays> <http://example.com/sport/111> .
+
+
+
+

233. RMLTC0011b-PostgreSQL

+

Title: "M to M relation, by using an additional Triples Map"

+

Description: "Tests, M to M relations, by using an additional Triples Map"

+

Error expected? No

+

Input

+
DROP TABLE IF EXISTS student_sport;
+DROP TABLE IF EXISTS student;
+DROP TABLE IF EXISTS sport;
+
+CREATE TABLE sport (
+  ID INTEGER,
+  Description VARCHAR(200)
+);
+INSERT INTO sport values ('110','Tennis');
+INSERT INTO sport values ('111','Football');
+INSERT INTO sport values ('112','Formula1');
+
+
+CREATE TABLE student (
+  ID INTEGER,
+  FirstName VARCHAR(200),
+  LastName VARCHAR(200)
+);
+INSERT INTO student values ('10','Venus','Williams');
+INSERT INTO student values ('11','Fernando','Alonso');
+INSERT INTO student values ('12','David','Villa');
+
+
+CREATE TABLE student_sport (
+  ID_Student INTEGER,
+  ID_Sport INTEGER
+);
+INSERT INTO student_sport values ('10', '110');
+INSERT INTO student_sport values ('11','111');
+INSERT INTO student_sport values ('11','112');
+INSERT INTO student_sport values ('12','111');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/LinkMap_1_2> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "student_sport"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:template "http://example.com/sport/{id_sport}"
+        ];
+      rml:predicate ex:plays
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/student/{id_student}"
+    ] .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "student"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "firstname"
+        ];
+      rml:predicate ex:firstName
+    ], [
+      rml:objectMap [
+          rml:reference "lastname"
+        ];
+      rml:predicate ex:lastName
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/student/{id}"
+    ] .
+
+<http://example.com/base/TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "sport"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "description"
+        ];
+      rml:predicate ex:description
+    ], [
+      rml:objectMap [
+          rml:reference "id"
+        ];
+      rml:predicate ex:id
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/sport/{id}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "org.postgresql.Driver";
+  d2rq:password "";
+  d2rq:username "postgres" .
+
+

Output

+
<http://example.com/student/10> <http://example.com/lastName> "Williams" .
+<http://example.com/student/10> <http://example.com/firstName> "Venus" .
+<http://example.com/student/12> <http://example.com/lastName> "Villa" .
+<http://example.com/student/12> <http://example.com/firstName> "David" .
+<http://example.com/student/11> <http://example.com/lastName> "Alonso" .
+<http://example.com/student/11> <http://example.com/firstName> "Fernando" .
+<http://example.com/sport/110> <http://example.com/description> "Tennis" .
+<http://example.com/sport/110> <http://example.com/id> "110"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.com/sport/111> <http://example.com/description> "Football" .
+<http://example.com/sport/111> <http://example.com/id> "111"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.com/sport/112> <http://example.com/description> "Formula1" .
+<http://example.com/sport/112> <http://example.com/id> "112"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.com/student/10> <http://example.com/plays> <http://example.com/sport/110> .
+<http://example.com/student/12> <http://example.com/plays> <http://example.com/sport/111> .
+<http://example.com/student/11> <http://example.com/plays> <http://example.com/sport/112> .
+<http://example.com/student/11> <http://example.com/plays> <http://example.com/sport/111> .
+
+
+
+

234. RMLTC0011b-SQLServer

+

Title: "M to M relation, by using an additional Triples Map"

+

Description: "Tests, M to M relations, by using an additional Triples Map"

+

Error expected? No

+

Input

+
USE TestDB;
+DROP TABLE IF EXISTS student_sport;
+DROP TABLE IF EXISTS student;
+DROP TABLE IF EXISTS sport;
+
+CREATE TABLE sport (
+  ID INTEGER,
+  Description VARCHAR(200)
+);
+INSERT INTO sport values ('110','Tennis');
+INSERT INTO sport values ('111','Football');
+INSERT INTO sport values ('112','Formula1');
+
+
+CREATE TABLE student (
+  ID INTEGER,
+  FirstName VARCHAR(200),
+  LastName VARCHAR(200)
+);
+INSERT INTO student values ('10','Venus','Williams');
+INSERT INTO student values ('11','Fernando','Alonso');
+INSERT INTO student values ('12','David','Villa');
+
+
+CREATE TABLE student_sport (
+  ID_Student INTEGER,
+  ID_Sport INTEGER
+);
+INSERT INTO student_sport values ('10', '110');
+INSERT INTO student_sport values ('11','111');
+INSERT INTO student_sport values ('11','112');
+INSERT INTO student_sport values ('12','111');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/LinkMap_1_2> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "student_sport"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:template "http://example.com/sport/{ID_Sport}"
+        ];
+      rml:predicate ex:plays
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/student/{ID_Student}"
+    ] .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "student"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "FirstName"
+        ];
+      rml:predicate ex:firstName
+    ], [
+      rml:objectMap [
+          rml:reference "LastName"
+        ];
+      rml:predicate ex:lastName
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/student/{ID}"
+    ] .
+
+<http://example.com/base/TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "sport"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "Description"
+        ];
+      rml:predicate ex:description
+    ], [
+      rml:objectMap [
+          rml:reference "ID"
+        ];
+      rml:predicate ex:id
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/sport/{ID}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
+  d2rq:password "YourSTRONG!Passw0rd;";
+  d2rq:username "sa" .
+
+

Output

+
<http://example.com/student/10> <http://example.com/lastName> "Williams" .
+<http://example.com/student/10> <http://example.com/firstName> "Venus" .
+<http://example.com/student/12> <http://example.com/lastName> "Villa" .
+<http://example.com/student/12> <http://example.com/firstName> "David" .
+<http://example.com/student/11> <http://example.com/lastName> "Alonso" .
+<http://example.com/student/11> <http://example.com/firstName> "Fernando" .
+<http://example.com/sport/110> <http://example.com/description> "Tennis" .
+<http://example.com/sport/110> <http://example.com/id> "110"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.com/sport/111> <http://example.com/description> "Football" .
+<http://example.com/sport/111> <http://example.com/id> "111"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.com/sport/112> <http://example.com/description> "Formula1" .
+<http://example.com/sport/112> <http://example.com/id> "112"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.com/student/10> <http://example.com/plays> <http://example.com/sport/110> .
+<http://example.com/student/12> <http://example.com/plays> <http://example.com/sport/111> .
+<http://example.com/student/11> <http://example.com/plays> <http://example.com/sport/112> .
+<http://example.com/student/11> <http://example.com/plays> <http://example.com/sport/111> .
+
+
+
+

235. RMLTC0011b-XML

+

Title: "M to M relation, by using an additional Triples Map"

+

Description: "Tests, M to M relations, by using an additional Triples Map"

+

Error expected? No

+

Input

+
<?xml version="1.0"?>
+
+<Students>
+  <Student>
+    <ID>10</ID>
+    <FirstName>Venus</FirstName>
+    <LastName>Williams</LastName>
+  </Student>
+  <Student>
+    <ID>11</ID>
+    <FirstName>Fernando</FirstName>
+    <LastName>Alonso</LastName>
+  </Student>
+  <Student>
+    <ID>12</ID>
+    <FirstName>David</FirstName>
+    <LastName>Villa</LastName>
+  </Student>
+</Students>
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/LinkMap_1_2> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "/links/link";
+      rml:referenceFormulation rml:XPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student_sport.xml"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:template "http://example.com/sport/{ID_Sport}"
+        ];
+      rml:predicate ex:plays
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/student/{ID_Student}"
+    ] .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "/Students/Student";
+      rml:referenceFormulation rml:XPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.xml"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "FirstName"
+        ];
+      rml:predicate ex:firstName
+    ], [
+      rml:objectMap [
+          rml:reference "LastName"
+        ];
+      rml:predicate ex:lastName
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/student/{ID}"
+    ] .
+
+<http://example.com/base/TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "/Sports/Sport";
+      rml:referenceFormulation rml:XPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "sport.xml"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "Description"
+        ];
+      rml:predicate ex:description
+    ], [
+      rml:objectMap [
+          rml:reference "ID"
+        ];
+      rml:predicate ex:id
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/sport/{ID}"
+    ] .
+
+

Output

+
<http://example.com/student/10> <http://example.com/lastName> "Williams" .
+<http://example.com/student/10> <http://example.com/firstName> "Venus" .
+<http://example.com/student/12> <http://example.com/lastName> "Villa" .
+<http://example.com/student/12> <http://example.com/firstName> "David" .
+<http://example.com/student/11> <http://example.com/lastName> "Alonso" .
+<http://example.com/student/11> <http://example.com/firstName> "Fernando" .
+<http://example.com/sport/110> <http://example.com/description> "Tennis" .
+<http://example.com/sport/110> <http://example.com/id> "110" .
+<http://example.com/sport/111> <http://example.com/description> "Football" .
+<http://example.com/sport/111> <http://example.com/id> "111" .
+<http://example.com/sport/112> <http://example.com/description> "Formula1" .
+<http://example.com/sport/112> <http://example.com/id> "112" .
+<http://example.com/student/10> <http://example.com/plays> <http://example.com/sport/110> .
+<http://example.com/student/12> <http://example.com/plays> <http://example.com/sport/111> .
+<http://example.com/student/11> <http://example.com/plays> <http://example.com/sport/112> .
+<http://example.com/student/11> <http://example.com/plays> <http://example.com/sport/111> .
+
+
+
+

236. RMLTC0012a-CSV

+

Title: "Duplicate tuples generate same blank node"

+

Description: "Tests that blank nodes with same identifier and in the same graph but generated by different logical rows are considered equivalent."

+

Error expected? No

+

Input

+
fname,lname,amount
+Bob,Smith,30
+Sue,Jones,20
+Bob,Smith,30
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:referenceFormulation rml:CSV;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "persons.csv"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:template "{fname} {lname}";
+          rml:termType rml:Literal
+        ];
+      rml:predicate foaf:name
+    ], [
+      rml:objectMap [
+          rml:reference "amount"
+        ];
+      rml:predicate ex:amount
+    ];
+  rml:subjectMap [
+      rml:template "{fname}{lname}{amount}";
+      rml:termType rml:BlankNode
+    ] .
+
+

Output

+
_:BobSmith30 <http://example.com/amount> "30" .
+_:BobSmith30 <http://xmlns.com/foaf/0.1/name> "Bob Smith" .
+_:SueJones20 <http://example.com/amount> "20" .
+_:SueJones20 <http://xmlns.com/foaf/0.1/name> "Sue Jones" .
+
+
+
+

237. RMLTC0012a-JSON

+

Title: "Duplicate tuples generate same blank node"

+

Description: "Tests that blank nodes with same identifier and in the same graph but generated by different logical rows are considered equivalent."

+

Error expected? No

+

Input

+
{
+  "persons": [
+    {"fname":"Bob","lname":"Smith","amount":30},
+    {"fname":"Sue","lname":"Jones","amount":20},
+    {"fname":"Bob","lname":"Smith","amount":30}
+  ]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.persons[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "persons.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:template "{$.fname} {$.lname}";
+          rml:termType rml:Literal
+        ];
+      rml:predicate foaf:name
+    ], [
+      rml:objectMap [
+          rml:reference "$.amount"
+        ];
+      rml:predicate ex:amount
+    ];
+  rml:subjectMap [
+      rml:template "{$.fname}{$.lname}{$.amount}";
+      rml:termType rml:BlankNode
+    ] .
+
+

Output

+
_:BobSmith30 <http://example.com/amount> "30" .
+_:BobSmith30 <http://xmlns.com/foaf/0.1/name> "Bob Smith" .
+_:SueJones20 <http://example.com/amount> "20" .
+_:SueJones20 <http://xmlns.com/foaf/0.1/name> "Sue Jones" .
+
+
+
+

238. RMLTC0012a-MySQL

+

Title: "Duplicate tuples generate same blank node"

+

Description: "Tests that blank nodes with same identifier and in the same graph but generated by different logical rows are considered equivalent."

+

Error expected? No

+

Input

+
USE test;
+DROP TABLE IF EXISTS test.IOUs;
+DROP TABLE IF EXISTS test.Lives;
+
+CREATE TABLE IOUs (
+      fname VARCHAR(20),
+      lname VARCHAR(20),
+      amount INT);
+/* We replaced DOUBLE with INT, because the datatype conversion is different across databases, and this test case is not relevant to that aspect */
+INSERT INTO IOUs (fname, lname, amount) VALUES ('Bob', 'Smith', 30);
+INSERT INTO IOUs (fname, lname, amount) VALUES ('Sue', 'Jones', 20);
+INSERT INTO IOUs (fname, lname, amount) VALUES ('Bob', 'Smith', 30);
+CREATE TABLE Lives (
+      fname VARCHAR(20),
+      lname VARCHAR(20),
+      city VARCHAR(20));
+INSERT INTO Lives (fname, lname, city) VALUES ('Bob', 'Smith', 'London');
+INSERT INTO Lives (fname, lname, city) VALUES ('Sue', 'Jones', 'Madrid');
+INSERT INTO Lives (fname, lname, city) VALUES ('Bob', 'Smith', 'London');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "IOUs"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:template "{fname} {lname}";
+          rml:termType rml:Literal
+        ];
+      rml:predicate foaf:name
+    ], [
+      rml:objectMap [
+          rml:reference "amount"
+        ];
+      rml:predicate ex:amount
+    ];
+  rml:subjectMap [
+      rml:template "{fname}_{lname}_{amount}";
+      rml:termType rml:BlankNode
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
+  d2rq:password "";
+  d2rq:username "root" .
+
+

Output

+
_:Bob_Smith_30 <http://example.com/amount> "30"^^<http://www.w3.org/2001/XMLSchema#integer> .
+_:Bob_Smith_30 <http://xmlns.com/foaf/0.1/name> "Bob Smith" .
+_:Sue_Jones_20 <http://example.com/amount> "20"^^<http://www.w3.org/2001/XMLSchema#integer> .
+_:Sue_Jones_20 <http://xmlns.com/foaf/0.1/name> "Sue Jones" .
+
+
+
+

239. RMLTC0012a-PostgreSQL

+

Title: "Duplicate tuples generate same blank node"

+

Description: "Tests that blank nodes with same identifier and in the same graph but generated by different logical rows are considered equivalent."

+

Error expected? No

+

Input

+
DROP TABLE IF EXISTS IOUs;
+DROP TABLE IF EXISTS Lives;
+
+CREATE TABLE IOUs (
+      fname VARCHAR(20),
+      lname VARCHAR(20),
+      amount INT);
+INSERT INTO IOUs (fname, lname, amount) VALUES ('Bob', 'Smith', 30);
+INSERT INTO IOUs (fname, lname, amount) VALUES ('Sue', 'Jones', 20);
+INSERT INTO IOUs (fname, lname, amount) VALUES ('Bob', 'Smith', 30);
+CREATE TABLE Lives (
+      fname VARCHAR(20),
+      lname VARCHAR(20),
+      city VARCHAR(20));
+INSERT INTO Lives (fname, lname, city) VALUES ('Bob', 'Smith', 'London');
+INSERT INTO Lives (fname, lname, city) VALUES ('Sue', 'Jones', 'Madrid');
+INSERT INTO Lives (fname, lname, city) VALUES ('Bob', 'Smith', 'London');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "IOUs"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:template "{fname} {lname}";
+          rml:termType rml:Literal
+        ];
+      rml:predicate foaf:name
+    ], [
+      rml:objectMap [
+          rml:reference "amount"
+        ];
+      rml:predicate ex:amount
+    ];
+  rml:subjectMap [
+      rml:template "{fname}_{lname}_{amount}";
+      rml:termType rml:BlankNode
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "org.postgresql.Driver";
+  d2rq:password "";
+  d2rq:username "postgres" .
+
+

Output

+
_:Bob_Smith_30 <http://example.com/amount> "30"^^<http://www.w3.org/2001/XMLSchema#integer> .
+_:Bob_Smith_30 <http://xmlns.com/foaf/0.1/name> "Bob Smith" .
+_:Sue_Jones_20 <http://example.com/amount> "20"^^<http://www.w3.org/2001/XMLSchema#integer> .
+_:Sue_Jones_20 <http://xmlns.com/foaf/0.1/name> "Sue Jones" .
+
+
+
+

240. RMLTC0012a-SPARQL

+

Title: "Duplicate triples generate same blank node"

+

Description: "Tests that blank nodes with same identifier and in the same graph but generated by different logical rows are considered equivalent."

+

Error expected? No

+

Input

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix ns1: <http://example.com/> .
+
+[] ns1:amount "30" ;
+    foaf:firstName "Bob" ;
+    foaf:lastName "Smith" .
+
+[] ns1:amount "20" ;
+    foaf:firstName "Sue" ;
+    foaf:lastName "Jones" .
+
+[] ns1:amount "30" ;
+    foaf:firstName "Bob" ;
+    foaf:lastName "Smith" .
+
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix sd: <http://www.w3.org/ns/sparql-service-description#> .
+
+<http://example.com/base#Country> rml:logicalSource [
+      rml:iterator """
+            PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
+            PREFIX foaf: <http://xmlns.com/foaf/0.1/>
+            PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
+            SELECT ?fname ?lname ?amount
+            WHERE {
+                ?x  foaf:firstName ?fname ;
+                    foaf:lastName  ?lname ;
+                    <http://example.com/amount> ?amount .
+            } """;
+      rml:referenceFormulation formats:SPARQL_Results_JSON;
+      rml:source <http://example.com/base#InputSPARQL>
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:template "{fname.value} {lname.value}";
+          rml:termType rml:Literal
+        ];
+      rml:predicate foaf:name
+    ], [
+      rml:objectMap [
+          rml:reference "amount.value"
+        ];
+      rml:predicate ex:amount
+    ];
+  rml:subjectMap [
+      rml:template "{fname.value}{lname.value}{amount.value}";
+      rml:termType rml:BlankNode
+    ] .
+
+<http://example.com/base#InputSPARQL> a sd:Service;
+  sd:endpoint <http://HOST:PORT/ds1/sparql>;
+  sd:supportedLanguage sd:SPARQL11Query .
+
+

Output

+
_:BobSmith30 <http://example.com/amount> "30" .
+_:BobSmith30 <http://xmlns.com/foaf/0.1/name> "Bob Smith" .
+_:SueJones20 <http://example.com/amount> "20" .
+_:SueJones20 <http://xmlns.com/foaf/0.1/name> "Sue Jones" .
+
+
+
+

241. RMLTC0012a-SQLServer

+

Title: "Duplicate tuples generate same blank node"

+

Description: "Tests that blank nodes with same identifier and in the same graph but generated by different logical rows are considered equivalent."

+

Error expected? No

+

Input

+
USE TestDB;
+DROP TABLE IF EXISTS IOUs;
+DROP TABLE IF EXISTS Lives;
+
+CREATE TABLE IOUs (
+      fname VARCHAR(20),
+      lname VARCHAR(20),
+      amount INT);
+/* We replaced DOUBLE with INT, because the datatype conversion is different across databases, and this test case is not relevant to that aspect */
+INSERT INTO IOUs (fname, lname, amount) VALUES ('Bob', 'Smith', 30);
+INSERT INTO IOUs (fname, lname, amount) VALUES ('Sue', 'Jones', 20);
+INSERT INTO IOUs (fname, lname, amount) VALUES ('Bob', 'Smith', 30);
+CREATE TABLE Lives (
+      fname VARCHAR(20),
+      lname VARCHAR(20),
+      city VARCHAR(20));
+INSERT INTO Lives (fname, lname, city) VALUES ('Bob', 'Smith', 'London');
+INSERT INTO Lives (fname, lname, city) VALUES ('Sue', 'Jones', 'Madrid');
+INSERT INTO Lives (fname, lname, city) VALUES ('Bob', 'Smith', 'London');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "IOUs"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:template "{fname} {lname}";
+          rml:termType rml:Literal
+        ];
+      rml:predicate foaf:name
+    ], [
+      rml:objectMap [
+          rml:reference "amount"
+        ];
+      rml:predicate ex:amount
+    ];
+  rml:subjectMap [
+      rml:template "{fname}_{lname}_{amount}";
+      rml:termType rml:BlankNode
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
+  d2rq:password "YourSTRONG!Passw0rd;";
+  d2rq:username "sa" .
+
+

Output

+
_:Bob_Smith_30 <http://example.com/amount> "30"^^<http://www.w3.org/2001/XMLSchema#integer> .
+_:Bob_Smith_30 <http://xmlns.com/foaf/0.1/name> "Bob Smith" .
+_:Sue_Jones_20 <http://example.com/amount> "20"^^<http://www.w3.org/2001/XMLSchema#integer> .
+_:Sue_Jones_20 <http://xmlns.com/foaf/0.1/name> "Sue Jones" .
+
+
+
+

242. RMLTC0012a-XML

+

Title: "Duplicate tuples generate same blank node"

+

Description: "Tests that blank nodes with same identifier and in the same graph but generated by different logical rows are considered equivalent."

+

Error expected? No

+

Input

+
<?xml version="1.0"?>
+
+<Persons>
+  <Person>
+    <fname>Bob</fname>
+    <lname>Smith</lname>
+    <amount>30</amount>
+  </Person>
+  <Person>
+    <fname>Sue</fname>
+    <lname>Jones</lname>
+    <amount>20</amount>
+  </Person>
+  <Person>
+    <fname>Bob</fname>
+    <lname>Smith</lname>
+    <amount>30</amount>
+  </Person>
+</Persons>
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "/Persons/Person";
+      rml:referenceFormulation rml:XPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "persons.xml"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:template "{fname} {lname}";
+          rml:termType rml:Literal
+        ];
+      rml:predicate foaf:name
+    ], [
+      rml:objectMap [
+          rml:reference "amount"
+        ];
+      rml:predicate ex:amount
+    ];
+  rml:subjectMap [
+      rml:template "{fname}{lname}{amount}";
+      rml:termType rml:BlankNode
+    ] .
+
+

Output

+
_:BobSmith30 <http://example.com/amount> "30" .
+_:BobSmith30 <http://xmlns.com/foaf/0.1/name> "Bob Smith" .
+_:SueJones20 <http://example.com/amount> "20" .
+_:SueJones20 <http://xmlns.com/foaf/0.1/name> "Sue Jones" .
+
+
+
+

243. RMLTC0012b-CSV

+

Title: "Duplicate tuples generate same blank node"

+

Description: "Tests that blank nodes with same identifier and in the same graph but generated by different logical rows are considered equivalent."

+

Error expected? No

+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:referenceFormulation rml:CSV;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "persons.csv"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:template "{fname} {lname}";
+          rml:termType rml:Literal
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "{fname}{lname}";
+      rml:termType rml:BlankNode
+    ] .
+
+<http://example.com/base/TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:referenceFormulation rml:CSV;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "lives.csv"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "city"
+        ];
+      rml:predicate ex:city
+    ];
+  rml:subjectMap [
+      rml:template "{fname}{lname}";
+      rml:termType rml:BlankNode
+    ] .
+
+

Output

+
_:BobSmith <http://example.com/city> "London" .
+_:BobSmith <http://xmlns.com/foaf/0.1/name> "Bob Smith" .
+_:SueJones <http://example.com/city> "Madrid" .
+_:SueJones <http://xmlns.com/foaf/0.1/name> "Sue Jones" .
+
+
+
+

244. RMLTC0012b-JSON

+

Title: "Duplicate tuples generate same blank node"

+

Description: "Tests that blank nodes with same identifier and in the same graph but generated by different logical rows are considered equivalent."

+

Error expected? No

+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.persons[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "persons.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:template "{$.fname} {$.lname}";
+          rml:termType rml:Literal
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "{$.fname}{$.lname}";
+      rml:termType rml:BlankNode
+    ] .
+
+<http://example.com/base/TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.lives[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "lives.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.city"
+        ];
+      rml:predicate ex:city
+    ];
+  rml:subjectMap [
+      rml:template "{$.fname}{$.lname}";
+      rml:termType rml:BlankNode
+    ] .
+
+

Output

+
_:BobSmith <http://example.com/city> "London" .
+_:BobSmith <http://xmlns.com/foaf/0.1/name> "Bob Smith" .
+_:SueJones <http://example.com/city> "Madrid" .
+_:SueJones <http://xmlns.com/foaf/0.1/name> "Sue Jones" .
+
+
+
+

245. RMLTC0012b-MySQL

+

Title: "Duplicate tuples generate same blank node"

+

Description: "Tests that blank nodes with same identifier and in the same graph but generated by different logical rows are considered equivalent."

+

Error expected? No

+

Input

+
USE test;
+DROP TABLE IF EXISTS test.persons;
+
+CREATE TABLE persons (
+  fname VARCHAR(200),
+  lname VARCHAR(200),
+  amount INTEGER
+);
+INSERT INTO persons values ('Bob','Smith','30');
+INSERT INTO persons values ('Sue','Jones','20');
+INSERT INTO persons values ('Bob','Smith','30');
+
+DROP TABLE IF EXISTS test.lives;
+
+CREATE TABLE lives (
+  fname VARCHAR(200),
+  lname VARCHAR(200),
+  city VARCHAR(200)
+);
+INSERT INTO lives values ('Bob','Smith','London');
+INSERT INTO lives values ('Sue','Jones','Madrid');
+INSERT INTO lives values ('Bob','Smith','London');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "persons"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:template "{fname} {lname}";
+          rml:termType rml:Literal
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "{fname}{lname}";
+      rml:termType rml:BlankNode
+    ] .
+
+<http://example.com/base/TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "lives"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "city"
+        ];
+      rml:predicate ex:city
+    ];
+  rml:subjectMap [
+      rml:template "{fname}{lname}";
+      rml:termType rml:BlankNode
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
+  d2rq:password "";
+  d2rq:username "root" .
+
+

Output

+
_:BobSmith <http://example.com/city> "London" .
+_:BobSmith <http://xmlns.com/foaf/0.1/name> "Bob Smith" .
+_:SueJones <http://example.com/city> "Madrid" .
+_:SueJones <http://xmlns.com/foaf/0.1/name> "Sue Jones" .
+
+
+
+

246. RMLTC0012b-PostgreSQL

+

Title: "Duplicate tuples generate same blank node"

+

Description: "Tests that blank nodes with same identifier and in the same graph but generated by different logical rows are considered equivalent."

+

Error expected? No

+

Input

+
DROP TABLE IF EXISTS persons;
+
+CREATE TABLE persons (
+  "fname" VARCHAR(200),
+  "lname" VARCHAR(200),
+  "amount" INTEGER
+);
+INSERT INTO persons values ('Bob','Smith','30');
+INSERT INTO persons values ('Sue','Jones','20');
+INSERT INTO persons values ('Bob','Smith','30');
+
+DROP TABLE IF EXISTS lives;
+
+CREATE TABLE lives (
+  "fname" VARCHAR(200),
+  "lname" VARCHAR(200),
+  "city" VARCHAR(200)
+);
+INSERT INTO lives values ('Bob','Smith','London');
+INSERT INTO lives values ('Sue','Jones','Madrid');
+INSERT INTO lives values ('Bob','Smith','London');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "persons"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:template "{fname} {lname}";
+          rml:termType rml:Literal
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "{fname}{lname}";
+      rml:termType rml:BlankNode
+    ] .
+
+<http://example.com/base/TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "lives"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "city"
+        ];
+      rml:predicate ex:city
+    ];
+  rml:subjectMap [
+      rml:template "{fname}{lname}";
+      rml:termType rml:BlankNode
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "org.postgresql.Driver";
+  d2rq:password "password";
+  d2rq:username "postgres" .
+
+

Output

+
_:BobSmith <http://example.com/city> "London" .
+_:BobSmith <http://xmlns.com/foaf/0.1/name> "Bob Smith" .
+_:SueJones <http://example.com/city> "Madrid" .
+_:SueJones <http://xmlns.com/foaf/0.1/name> "Sue Jones" .
+
+
+
+

247. RMLTC0012b-SPARQL

+

Title: "Duplicate triples generate same blank node"

+

Description: "Tests that blank nodes with same identifier and in the same graph but generated by different logical rows are considered equivalent."

+

Error expected? No

+

Input

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix ns1: <http://example.com/> .
+
+[] ns1:amount "30" ;
+    foaf:firstName "Bob" ;
+    foaf:lastName "Smith" .
+
+[] ns1:amount "20" ;
+    foaf:firstName "Sue" ;
+    foaf:lastName "Jones" .
+
+[] ns1:amount "30" ;
+    foaf:firstName "Bob" ;
+    foaf:lastName "Smith" .
+
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix sd: <http://www.w3.org/ns/sparql-service-description#> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator """
+              PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
+              PREFIX foaf: <http://xmlns.com/foaf/0.1/>
+              PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
+              SELECT ?fname ?lname
+              WHERE {
+                   ?x  foaf:firstName ?fname ;
+                       foaf:lastName  ?lname ;
+              } """;
+      rml:referenceFormulation formats:SPARQL_Results_JSON;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path <http://example.com/base/#InputSPARQL1>
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:template "{fname.value} {lname.value}";
+          rml:termType rml:Literal
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "{fname.value}{lname.value}";
+      rml:termType rml:BlankNode
+    ] .
+
+<http://example.com/base/TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator """
+                PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
+                PREFIX foaf: <http://xmlns.com/foaf/0.1/>
+                PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
+                SELECT ?city ?fname ?lname
+                WHERE {
+                    ?x  foaf:firstName ?fname ;
+                        foaf:lastName  ?lname ;
+                        <http://example.com/city> ?city .
+                } """;
+      rml:referenceFormulation formats:SPARQL_Results_JSON;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path <http://example.com/base/#InputSPARQL2>
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "city.value"
+        ];
+      rml:predicate ex:city
+    ];
+  rml:subjectMap [
+      rml:template "{fname.value}{lname.value}";
+      rml:termType rml:BlankNode
+    ] .
+
+<http://example.com/base/#InputSPARQL1> a sd:Service;
+  sd:endpoint <http://HOST:PORT/ds1/sparql>;
+  sd:supportedLanguage sd:SPARQL11Query .
+
+<http://example.com/base/#InputSPARQL2> a sd:Service;
+  sd:endpoint <http://HOST:PORT/ds2/sparql>;
+  sd:supportedLanguage sd:SPARQL11Query .
+
+

Output

+
_:BobSmith <http://example.com/city> "London" .
+_:BobSmith <http://xmlns.com/foaf/0.1/name> "Bob Smith" .
+_:SueJones <http://example.com/city> "Madrid" .
+_:SueJones <http://xmlns.com/foaf/0.1/name> "Sue Jones" .
+
+
+
+

248. RMLTC0012b-SQLServer

+

Title: "Duplicate tuples generate same blank node"

+

Description: "Tests that blank nodes with same identifier and in the same graph but generated by different logical rows are considered equivalent."

+

Error expected? No

+

Input

+
USE TestDB;
+DROP TABLE IF EXISTS persons;
+
+CREATE TABLE persons (
+  "fname" VARCHAR(200),
+  "lname" VARCHAR(200),
+  "amount" INTEGER
+);
+INSERT INTO persons values ('Bob','Smith','30');
+INSERT INTO persons values ('Sue','Jones','20');
+INSERT INTO persons values ('Bob','Smith','30');
+
+DROP TABLE IF EXISTS lives;
+
+CREATE TABLE lives (
+  "fname" VARCHAR(200),
+  "lname" VARCHAR(200),
+  "city" VARCHAR(200)
+);
+INSERT INTO lives values ('Bob','Smith','London');
+INSERT INTO lives values ('Sue','Jones','Madrid');
+INSERT INTO lives values ('Bob','Smith','London');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "persons"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:template "{fname} {lname}";
+          rml:termType rml:Literal
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "{fname}{lname}";
+      rml:termType rml:BlankNode
+    ] .
+
+<http://example.com/base/TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "lives"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "city"
+        ];
+      rml:predicate ex:city
+    ];
+  rml:subjectMap [
+      rml:template "{fname}{lname}";
+      rml:termType rml:BlankNode
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
+  d2rq:password "YourSTRONG!Passw0rd;";
+  d2rq:username "sa" .
+
+

Output

+
_:BobSmith <http://example.com/city> "London" .
+_:BobSmith <http://xmlns.com/foaf/0.1/name> "Bob Smith" .
+_:SueJones <http://example.com/city> "Madrid" .
+_:SueJones <http://xmlns.com/foaf/0.1/name> "Sue Jones" .
+
+
+
+

249. RMLTC0012b-XML

+

Title: "Duplicate tuples generate same blank node"

+

Description: "Tests that blank nodes with same identifier and in the same graph but generated by different logical rows are considered equivalent."

+

Error expected? No

+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "/Persons/Person";
+      rml:referenceFormulation rml:XPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "persons.xml"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:template "{fname} {lname}";
+          rml:termType rml:Literal
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "{fname}{lname}";
+      rml:termType rml:BlankNode
+    ] .
+
+<http://example.com/base/TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "/Lives/Live";
+      rml:referenceFormulation rml:XPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "lives.xml"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "city"
+        ];
+      rml:predicate ex:city
+    ];
+  rml:subjectMap [
+      rml:template "{fname}{lname}";
+      rml:termType rml:BlankNode
+    ] .
+
+

Output

+
_:BobSmith <http://example.com/city> "London" .
+_:BobSmith <http://xmlns.com/foaf/0.1/name> "Bob Smith" .
+_:SueJones <http://example.com/city> "Madrid" .
+_:SueJones <http://xmlns.com/foaf/0.1/name> "Sue Jones" .
+
+
+
+

250. RMLTC0012c-CSV

+

Title: "TriplesMap without subjectMap"

+

Description: "Tests a RML with missing information, TriplesMap without subjectMap."

+

Error expected? Yes

+

Input

+
fname,lname,amount
+Bob,Smith,30
+Sue,Jones,20
+Bob,Smith,30
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:referenceFormulation rml:CSV;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "persons.csv"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:template "{fname} {lname}";
+          rml:termType rml:Literal
+        ];
+      rml:predicate foaf:name
+    ], [
+      rml:objectMap [
+          rml:reference "amount"
+        ];
+      rml:predicate ex:amount
+    ] .
+
+
+

251. RMLTC0012c-JSON

+

Title: "TriplesMap without subjectMap"

+

Description: "Tests a RML with missing information, TriplesMap without subjectMap."

+

Error expected? Yes

+

Input

+
{
+  "persons": [
+    {"fname":"Bob","lname":"Smith","amount":30},
+    {"fname":"Sue","lname":"Jones","amount":20},
+    {"fname":"Bob","lname":"Smith","amount":30}
+  ]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.persons[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "persons.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:template "{$.fname} {$.lname}";
+          rml:termType rml:Literal
+        ];
+      rml:predicate foaf:name
+    ], [
+      rml:objectMap [
+          rml:reference "$.amount"
+        ];
+      rml:predicate ex:amount
+    ] .
+
+
+

252. RMLTC0012c-MySQL

+

Title: "TriplesMap without subjectMap"

+

Description: "Tests a RML with missing information, TriplesMap without subjectMap."

+

Error expected? Yes

+

Input

+
USE test;
+DROP TABLE IF EXISTS test.IOUs;
+DROP TABLE IF EXISTS test.Lives;
+
+CREATE TABLE IOUs (
+      fname VARCHAR(20),
+      lname VARCHAR(20),
+      amount FLOAT);
+INSERT INTO IOUs (fname, lname, amount) VALUES ('Bob', 'Smith', 30);
+INSERT INTO IOUs (fname, lname, amount) VALUES ('Sue', 'Jones', 20);
+INSERT INTO IOUs (fname, lname, amount) VALUES ('Bob', 'Smith', 30);
+
+CREATE TABLE Lives (
+      fname VARCHAR(20),
+      lname VARCHAR(20),
+      city VARCHAR(20));
+INSERT INTO Lives (fname, lname, city) VALUES ('Bob', 'Smith', 'London');
+INSERT INTO Lives (fname, lname, city) VALUES ('Sue', 'Jones', 'Madrid');
+INSERT INTO Lives (fname, lname, city) VALUES ('Bob', 'Smith', 'London');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "IOUs"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:template "{fname} {lname}";
+          rml:termType rml:Literal
+        ];
+      rml:predicate foaf:name
+    ], [
+      rml:objectMap [
+          rml:reference "amount"
+        ];
+      rml:predicate ex:amount
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
+  d2rq:password "";
+  d2rq:username "root" .
+
+
+

253. RMLTC0012c-PostgreSQL

+

Title: "TriplesMap without subjectMap"

+

Description: "Tests a RML with missing information, TriplesMap without subjectMap."

+

Error expected? Yes

+

Input

+
DROP TABLE IF EXISTS IOUs;
+DROP TABLE IF EXISTS Lives;
+
+CREATE TABLE IOUs (
+      fname VARCHAR(20),
+      lname VARCHAR(20),
+      amount FLOAT);
+INSERT INTO IOUs (fname, lname, amount) VALUES ('Bob', 'Smith', 30);
+INSERT INTO IOUs (fname, lname, amount) VALUES ('Sue', 'Jones', 20);
+INSERT INTO IOUs (fname, lname, amount) VALUES ('Bob', 'Smith', 30);
+
+CREATE TABLE Lives (
+      fname VARCHAR(20),
+      lname VARCHAR(20),
+      city VARCHAR(20));
+INSERT INTO Lives (fname, lname, city) VALUES ('Bob', 'Smith', 'London');
+INSERT INTO Lives (fname, lname, city) VALUES ('Sue', 'Jones', 'Madrid');
+INSERT INTO Lives (fname, lname, city) VALUES ('Bob', 'Smith', 'London');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "IOUs"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:template "{fname} {lname}";
+          rml:termType rml:Literal
+        ];
+      rml:predicate foaf:name
+    ], [
+      rml:objectMap [
+          rml:reference "amount"
+        ];
+      rml:predicate ex:amount
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "org.postgresql.Driver";
+  d2rq:password "password";
+  d2rq:username "postgres" .
+
+
+

254. RMLTC0012c-SQLServer

+

Title: "TriplesMap without subjectMap"

+

Description: "Tests a RML with missing information, TriplesMap without subjectMap."

+

Error expected? Yes

+

Input

+
USE TestDB;
+DROP TABLE IF EXISTS IOUs;
+DROP TABLE IF EXISTS Lives;
+
+CREATE TABLE IOUs (
+      fname VARCHAR(20),
+      lname VARCHAR(20),
+      amount FLOAT);
+INSERT INTO IOUs (fname, lname, amount) VALUES ('Bob', 'Smith', 30);
+INSERT INTO IOUs (fname, lname, amount) VALUES ('Sue', 'Jones', 20);
+INSERT INTO IOUs (fname, lname, amount) VALUES ('Bob', 'Smith', 30);
+
+CREATE TABLE Lives (
+      fname VARCHAR(20),
+      lname VARCHAR(20),
+      city VARCHAR(20));
+INSERT INTO Lives (fname, lname, city) VALUES ('Bob', 'Smith', 'London');
+INSERT INTO Lives (fname, lname, city) VALUES ('Sue', 'Jones', 'Madrid');
+INSERT INTO Lives (fname, lname, city) VALUES ('Bob', 'Smith', 'London');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "IOUs"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:template "{fname} {lname}";
+          rml:termType rml:Literal
+        ];
+      rml:predicate foaf:name
+    ], [
+      rml:objectMap [
+          rml:reference "amount"
+        ];
+      rml:predicate ex:amount
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
+  d2rq:password "YourSTRONG!Passw0rd;";
+  d2rq:username "sa" .
+
+
+

255. RMLTC0012c-XML

+

Title: "TriplesMap without subjectMap"

+

Description: "Tests a RML with missing information, TriplesMap without subjectMap."

+

Error expected? Yes

+

Input

+
<?xml version="1.0"?>
+
+<Persons>
+  <Person>
+    <fname>Bob</fname>
+    <lname>Smith></lname>
+    <amount>30</amount>
+  </Person>
+  <Person>
+    <fname>Sue</fname>
+    <lname>Jones></lname>
+    <amount>20</amount>
+  </Person>
+  <Person>
+    <fname>Bob</fname>
+    <lname>Smith></lname>
+    <amount>30</amount>
+  </Person>
+</Persons>
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "/Persons/Person";
+      rml:referenceFormulation rml:XPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "persons.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:template "{fname} {lname}";
+          rml:termType rml:Literal
+        ];
+      rml:predicate foaf:name
+    ], [
+      rml:objectMap [
+          rml:reference "amount"
+        ];
+      rml:predicate ex:amount
+    ] .
+
+
+

256. RMLTC0012d-CSV

+

Title: "TriplesMap with two subjectMap"

+

Description: "Tests a RML with wrong information, TriplesMap with two subjectMap."

+

Error expected? Yes

+

Input

+
fname,lname,amount
+Bob,Smith,30
+Sue,Jones,20
+Bob,Smith,30
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:referenceFormulation rml:CSV;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "persons.csv"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:template "{fname} {lname}";
+          rml:termType rml:Literal
+        ];
+      rml:predicate foaf:name
+    ], [
+      rml:objectMap [
+          rml:reference "amount"
+        ];
+      rml:predicate ex:amount
+    ];
+  rml:subjectMap [
+      rml:template "{fname}_{lname}_{amount}";
+      rml:termType rml:BlankNode
+    ], [
+      rml:template "{amount}_{fname}_{lname}";
+      rml:termType rml:BlankNode
+    ] .
+
+
+

257. RMLTC0012d-JSON

+

Title: "TriplesMap with two subjectMap"

+

Description: "Tests a RML with wrong information, TriplesMap with two subjectMap."

+

Error expected? Yes

+

Input

+
{
+  "persons": [
+    {"fname":"Bob","lname":"Smith","amount":30},
+    {"fname":"Sue","lname":"Jones","amount":20},
+    {"fname":"Bob","lname":"Smith","amount":30}
+  ]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.persons[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "persons.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:template "{$.fname} {$.lname}";
+          rml:termType rml:Literal
+        ];
+      rml:predicate foaf:name
+    ], [
+      rml:objectMap [
+          rml:reference "$.amount"
+        ];
+      rml:predicate ex:amount
+    ];
+  rml:subjectMap [
+      rml:template "{$.fname}_{$.lname}_{$.amount}";
+      rml:termType rml:BlankNode
+    ], [
+      rml:template "{$.amount}_{$.fname}_{$.lname}";
+      rml:termType rml:BlankNode
+    ] .
+
+
+

258. RMLTC0012d-MySQL

+

Title: "TriplesMap with two subjectMap"

+

Description: "Tests a RML with wrong information, TriplesMap with two subjectMap."

+

Error expected? Yes

+

Input

+
USE test;
+DROP TABLE IF EXISTS test.IOUs;
+DROP TABLE IF EXISTS test.Lives;
+
+CREATE TABLE IOUs (
+      fname VARCHAR(20),
+      lname VARCHAR(20),
+      amount FLOAT);
+INSERT INTO IOUs (fname, lname, amount) VALUES ('Bob', 'Smith', 30);
+INSERT INTO IOUs (fname, lname, amount) VALUES ('Sue', 'Jones', 20);
+INSERT INTO IOUs (fname, lname, amount) VALUES ('Bob', 'Smith', 30);
+
+CREATE TABLE Lives (
+      fname VARCHAR(20),
+      lname VARCHAR(20),
+      city VARCHAR(20));
+INSERT INTO Lives (fname, lname, city) VALUES ('Bob', 'Smith', 'London');
+INSERT INTO Lives (fname, lname, city) VALUES ('Sue', 'Jones', 'Madrid');
+INSERT INTO Lives (fname, lname, city) VALUES ('Bob', 'Smith', 'London');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "IOUs"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "amount"
+        ];
+      rml:predicate ex:amount
+    ];
+  rml:subjectMap [
+      rml:template "{fname}_{lname}_{amount}"
+    ], [
+      rml:template "{amount}_{fname}_{lname}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
+  d2rq:password "";
+  d2rq:username "root" .
+
+
+

259. RMLTC0012d-PostgreSQL

+

Title: "TriplesMap with two subjectMap"

+

Description: "Tests a RML with wrong information, TriplesMap with two subjectMap."

+

Error expected? Yes

+

Input

+
DROP TABLE IF EXISTS IOUs;
+DROP TABLE IF EXISTS Lives;
+
+CREATE TABLE IOUs (
+      fname VARCHAR(20),
+      lname VARCHAR(20),
+      amount FLOAT);
+INSERT INTO IOUs (fname, lname, amount) VALUES ('Bob', 'Smith', 30);
+INSERT INTO IOUs (fname, lname, amount) VALUES ('Sue', 'Jones', 20);
+INSERT INTO IOUs (fname, lname, amount) VALUES ('Bob', 'Smith', 30);
+
+CREATE TABLE Lives (
+      fname VARCHAR(20),
+      lname VARCHAR(20),
+      city VARCHAR(20));
+INSERT INTO Lives (fname, lname, city) VALUES ('Bob', 'Smith', 'London');
+INSERT INTO Lives (fname, lname, city) VALUES ('Sue', 'Jones', 'Madrid');
+INSERT INTO Lives (fname, lname, city) VALUES ('Bob', 'Smith', 'London');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "IOUs"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "amount"
+        ];
+      rml:predicate ex:amount
+    ];
+  rml:subjectMap [
+      rml:template "{fname}_{lname}_{amount}"
+    ], [
+      rml:template "{amount}_{fname}_{lname}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "org.postgresql.Driver";
+  d2rq:password "password";
+  d2rq:username "postgres" .
+
+
+

260. RMLTC0012d-SQLServer

+

Title: "TriplesMap with two subjectMap"

+

Description: "Tests a RML with wrong information, TriplesMap with two subjectMap."

+

Error expected? Yes

+

Input

+
USE TestDB;
+DROP TABLE IF EXISTS IOUs;
+DROP TABLE IF EXISTS Lives;
+
+CREATE TABLE IOUs (
+      fname VARCHAR(20),
+      lname VARCHAR(20),
+      amount FLOAT);
+INSERT INTO IOUs (fname, lname, amount) VALUES ('Bob', 'Smith', 30);
+INSERT INTO IOUs (fname, lname, amount) VALUES ('Sue', 'Jones', 20);
+INSERT INTO IOUs (fname, lname, amount) VALUES ('Bob', 'Smith', 30);
+
+CREATE TABLE Lives (
+      fname VARCHAR(20),
+      lname VARCHAR(20),
+      city VARCHAR(20));
+INSERT INTO Lives (fname, lname, city) VALUES ('Bob', 'Smith', 'London');
+INSERT INTO Lives (fname, lname, city) VALUES ('Sue', 'Jones', 'Madrid');
+INSERT INTO Lives (fname, lname, city) VALUES ('Bob', 'Smith', 'London');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "IOUs"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "amount"
+        ];
+      rml:predicate ex:amount
+    ];
+  rml:subjectMap [
+      rml:template "{fname}_{lname}_{amount}"
+    ], [
+      rml:template "{amount}_{fname}_{lname}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
+  d2rq:password "YourSTRONG!Passw0rd;";
+  d2rq:username "sa" .
+
+
+

261. RMLTC0012d-XML

+

Title: "TriplesMap with two subjectMap"

+

Description: "Tests a RML with wrong information, TriplesMap with two subjectMap."

+

Error expected? Yes

+

Input

+
<?xml version="1.0"?>
+
+<Persons>
+  <Person>
+    <fname>Bob</fname>
+    <lname>Smith</lname>
+    <amount>30</amount>
+  </Person>
+  <Person>
+    <fname>Sue</fname>
+    <lname>Jones</lname>
+    <amount>20</amount>
+  </Person>
+  <Person>
+    <fname>Bob</fname>
+    <lname>Smith</lname>
+    <amount>30</amount>
+  </Person>
+</Persons>
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "/Persons/Person";
+      rml:referenceFormulation rml:XPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "persons.xml"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:template "{fname} {lname}";
+          rml:termType rml:Literal
+        ];
+      rml:predicate foaf:name
+    ], [
+      rml:objectMap [
+          rml:reference "amount"
+        ];
+      rml:predicate ex:amount
+    ];
+  rml:subjectMap [
+      rml:template "{fname}_{lname}_{amount}";
+      rml:termType rml:BlankNode
+    ], [
+      rml:template "{amount}_{fname}_{lname}";
+      rml:termType rml:BlankNode
+    ] .
+
+
+

262. RMLTC0012e-MySQL

+

Title: "Default mapping"

+

Description: "Tests the generation of a default mapping for tables without a primary key."

+

Error expected? No

+

Input

+
USE test;
+DROP TABLE IF EXISTS test.IOUs;
+DROP TABLE IF EXISTS test.Lives;
+
+CREATE TABLE IOUs (
+      fname VARCHAR(20),
+      lname VARCHAR(20),
+      amount FLOAT);
+INSERT INTO IOUs (fname, lname, amount) VALUES ('Bob', 'Smith', 30);
+INSERT INTO IOUs (fname, lname, amount) VALUES ('Sue', 'Jones', 20);
+INSERT INTO IOUs (fname, lname, amount) VALUES ('Bob', 'Smith', 30);
+
+CREATE TABLE Lives (
+      fname VARCHAR(20),
+      lname VARCHAR(20),
+      city VARCHAR(20));
+INSERT INTO Lives (fname, lname, city) VALUES ('Bob', 'Smith', 'London');
+INSERT INTO Lives (fname, lname, city) VALUES ('Sue', 'Jones', 'Madrid');
+INSERT INTO Lives (fname, lname, city) VALUES ('Bob', 'Smith', 'London');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "IOUs"
+    ];
+  rml:predicateObjectMap [
+      rml:object <http://example.com/base/IOUs>;
+      rml:predicate rdf:type
+    ], [
+      rml:objectMap [
+          rml:reference "fname"
+        ];
+      rml:predicate <http://example.com/base/IOUs#fname>
+    ], [
+      rml:objectMap [
+          rml:reference "lname"
+        ];
+      rml:predicate <http://example.com/base/IOUs#lname>
+    ], [
+      rml:objectMap [
+          rml:reference "amount"
+        ];
+      rml:predicate <http://example.com/base/IOUs#amount>
+    ];
+  rml:subjectMap [
+      rml:template "{fname}_{lname}_{amount}";
+      rml:termType rml:BlankNode
+    ] .
+
+<http://example.com/base/TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "Lives"
+    ];
+  rml:predicateObjectMap [
+      rml:object <http://example.com/base/Lives>;
+      rml:predicate rdf:type
+    ], [
+      rml:objectMap [
+          rml:reference "fname"
+        ];
+      rml:predicate <http://example.com/base/IOUs#fname>
+    ], [
+      rml:objectMap [
+          rml:reference "lname"
+        ];
+      rml:predicate <http://example.com/base/IOUs#lname>
+    ], [
+      rml:objectMap [
+          rml:reference "city"
+        ];
+      rml:predicate <http://example.com/base/IOUs#city>
+    ];
+  rml:subjectMap [
+      rml:template "{fname}_{lname}_{city}";
+      rml:termType rml:BlankNode
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
+  d2rq:password "";
+  d2rq:username "root" .
+
+

Output

+
_:Bob_Smith_30 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/base/IOUs> .
+_:Bob_Smith_30 <http://example.com/base/IOUs#fname> "Bob" .
+_:Bob_Smith_30 <http://example.com/base/IOUs#lname> "Smith" .
+_:Bob_Smith_30 <http://example.com/base/IOUs#amount> "3.0E1"^^<http://www.w3.org/2001/XMLSchema#double> .
+_:Sue_Jones_20 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/base/IOUs> .
+_:Sue_Jones_20 <http://example.com/base/IOUs#fname> "Sue" .
+_:Sue_Jones_20 <http://example.com/base/IOUs#lname> "Jones" .
+_:Sue_Jones_20 <http://example.com/base/IOUs#amount> "2.0E1"^^<http://www.w3.org/2001/XMLSchema#double> .
+_:Bob_Smith_London <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/base/Lives> .
+_:Bob_Smith_London <http://example.com/base/IOUs#fname> "Bob" .
+_:Bob_Smith_London <http://example.com/base/IOUs#lname> "Smith" .
+_:Bob_Smith_London <http://example.com/base/IOUs#city> "London" .
+_:Sue_Jones_Madrid <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/base/Lives> .
+_:Sue_Jones_Madrid <http://example.com/base/IOUs#fname> "Sue" .
+_:Sue_Jones_Madrid <http://example.com/base/IOUs#lname> "Jones" .
+_:Sue_Jones_Madrid <http://example.com/base/IOUs#city> "Madrid" .
+
+
+
+
+

263. RMLTC0012e-PostgreSQL

+

Title: "Default mapping"

+

Description: "Tests the generation of a default mapping for tables without a primary key."

+

Error expected? No

+

Input

+
DROP TABLE IF EXISTS IOUs;
+DROP TABLE IF EXISTS Lives;
+
+CREATE TABLE IOUs (
+      fname VARCHAR(20),
+      lname VARCHAR(20),
+      amount FLOAT);
+INSERT INTO IOUs (fname, lname, amount) VALUES ('Bob', 'Smith', 30);
+INSERT INTO IOUs (fname, lname, amount) VALUES ('Sue', 'Jones', 20);
+INSERT INTO IOUs (fname, lname, amount) VALUES ('Bob', 'Smith', 30);
+
+CREATE TABLE Lives (
+      fname VARCHAR(20),
+      lname VARCHAR(20),
+      city VARCHAR(20));
+INSERT INTO Lives (fname, lname, city) VALUES ('Bob', 'Smith', 'London');
+INSERT INTO Lives (fname, lname, city) VALUES ('Sue', 'Jones', 'Madrid');
+INSERT INTO Lives (fname, lname, city) VALUES ('Bob', 'Smith', 'London');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "IOUs"
+    ];
+  rml:predicateObjectMap [
+      rml:object <http://example.com/base/IOUs>;
+      rml:predicate rdf:type
+    ], [
+      rml:objectMap [
+          rml:reference "fname"
+        ];
+      rml:predicate <http://example.com/base/IOUs#fname>
+    ], [
+      rml:objectMap [
+          rml:reference "lname"
+        ];
+      rml:predicate <http://example.com/base/IOUs#lname>
+    ], [
+      rml:objectMap [
+          rml:reference "amount"
+        ];
+      rml:predicate <http://example.com/base/IOUs#amount>
+    ];
+  rml:subjectMap [
+      rml:template "{fname}_{lname}_{amount}";
+      rml:termType rml:BlankNode
+    ] .
+
+<http://example.com/base/TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "Lives"
+    ];
+  rml:predicateObjectMap [
+      rml:object <http://example.com/base/Lives>;
+      rml:predicate rdf:type
+    ], [
+      rml:objectMap [
+          rml:reference "fname"
+        ];
+      rml:predicate <http://example.com/base/IOUs#fname>
+    ], [
+      rml:objectMap [
+          rml:reference "lname"
+        ];
+      rml:predicate <http://example.com/base/IOUs#lname>
+    ], [
+      rml:objectMap [
+          rml:reference "city"
+        ];
+      rml:predicate <http://example.com/base/IOUs#city>
+    ];
+  rml:subjectMap [
+      rml:template "{fname}_{lname}_{city}";
+      rml:termType rml:BlankNode
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "org.postgresql.Driver";
+  d2rq:password "";
+  d2rq:username "postgres" .
+
+

Output

+
_:Bob_Smith_30 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/base/IOUs> .
+_:Bob_Smith_30 <http://example.com/base/IOUs#fname> "Bob" .
+_:Bob_Smith_30 <http://example.com/base/IOUs#lname> "Smith" .
+_:Bob_Smith_30 <http://example.com/base/IOUs#amount> "3.0E1"^^<http://www.w3.org/2001/XMLSchema#double> .
+_:Sue_Jones_20 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/base/IOUs> .
+_:Sue_Jones_20 <http://example.com/base/IOUs#fname> "Sue" .
+_:Sue_Jones_20 <http://example.com/base/IOUs#lname> "Jones" .
+_:Sue_Jones_20 <http://example.com/base/IOUs#amount> "2.0E1"^^<http://www.w3.org/2001/XMLSchema#double> .
+_:Bob_Smith_London <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/base/Lives> .
+_:Bob_Smith_London <http://example.com/base/IOUs#fname> "Bob" .
+_:Bob_Smith_London <http://example.com/base/IOUs#lname> "Smith" .
+_:Bob_Smith_London <http://example.com/base/IOUs#city> "London" .
+_:Sue_Jones_Madrid <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/base/Lives> .
+_:Sue_Jones_Madrid <http://example.com/base/IOUs#fname> "Sue" .
+_:Sue_Jones_Madrid <http://example.com/base/IOUs#lname> "Jones" .
+_:Sue_Jones_Madrid <http://example.com/base/IOUs#city> "Madrid" .
+
+
+
+
+

264. RMLTC0012e-SQLServer

+

Title: "Default mapping"

+

Description: "Tests the generation of a default mapping for tables without a primary key."

+

Error expected? No

+

Input

+
USE TestDB;
+DROP TABLE IF EXISTS IOUs;
+DROP TABLE IF EXISTS Lives;
+
+CREATE TABLE IOUs (
+      fname VARCHAR(20),
+      lname VARCHAR(20),
+      amount FLOAT);
+INSERT INTO IOUs (fname, lname, amount) VALUES ('Bob', 'Smith', 30);
+INSERT INTO IOUs (fname, lname, amount) VALUES ('Sue', 'Jones', 20);
+INSERT INTO IOUs (fname, lname, amount) VALUES ('Bob', 'Smith', 30);
+
+CREATE TABLE Lives (
+      fname VARCHAR(20),
+      lname VARCHAR(20),
+      city VARCHAR(20));
+INSERT INTO Lives (fname, lname, city) VALUES ('Bob', 'Smith', 'London');
+INSERT INTO Lives (fname, lname, city) VALUES ('Sue', 'Jones', 'Madrid');
+INSERT INTO Lives (fname, lname, city) VALUES ('Bob', 'Smith', 'London');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "IOUs"
+    ];
+  rml:predicateObjectMap [
+      rml:object <http://example.com/base/IOUs>;
+      rml:predicate rdf:type
+    ], [
+      rml:objectMap [
+          rml:reference "fname"
+        ];
+      rml:predicate <http://example.com/base/IOUs#fname>
+    ], [
+      rml:objectMap [
+          rml:reference "lname"
+        ];
+      rml:predicate <http://example.com/base/IOUs#lname>
+    ], [
+      rml:objectMap [
+          rml:reference "amount"
+        ];
+      rml:predicate <http://example.com/base/IOUs#amount>
+    ];
+  rml:subjectMap [
+      rml:template "{fname}_{lname}_{amount}";
+      rml:termType rml:BlankNode
+    ] .
+
+<http://example.com/base/TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "Lives"
+    ];
+  rml:predicateObjectMap [
+      rml:object <http://example.com/base/Lives>;
+      rml:predicate rdf:type
+    ], [
+      rml:objectMap [
+          rml:reference "fname"
+        ];
+      rml:predicate <http://example.com/base/IOUs#fname>
+    ], [
+      rml:objectMap [
+          rml:reference "lname"
+        ];
+      rml:predicate <http://example.com/base/IOUs#lname>
+    ], [
+      rml:objectMap [
+          rml:reference "city"
+        ];
+      rml:predicate <http://example.com/base/IOUs#city>
+    ];
+  rml:subjectMap [
+      rml:template "{fname}_{lname}_{city}";
+      rml:termType rml:BlankNode
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
+  d2rq:password "YourSTRONG!Passw0rd;";
+  d2rq:username "sa" .
+
+

Output

+
_:Bob_Smith_30 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/base/IOUs> .
+_:Bob_Smith_30 <http://example.com/base/IOUs#fname> "Bob" .
+_:Bob_Smith_30 <http://example.com/base/IOUs#lname> "Smith" .
+_:Bob_Smith_30 <http://example.com/base/IOUs#amount> "3.0E1"^^<http://www.w3.org/2001/XMLSchema#double> .
+_:Sue_Jones_20 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/base/IOUs> .
+_:Sue_Jones_20 <http://example.com/base/IOUs#fname> "Sue" .
+_:Sue_Jones_20 <http://example.com/base/IOUs#lname> "Jones" .
+_:Sue_Jones_20 <http://example.com/base/IOUs#amount> "2.0E1"^^<http://www.w3.org/2001/XMLSchema#double> .
+_:Bob_Smith_London <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/base/Lives> .
+_:Bob_Smith_London <http://example.com/base/IOUs#fname> "Bob" .
+_:Bob_Smith_London <http://example.com/base/IOUs#lname> "Smith" .
+_:Bob_Smith_London <http://example.com/base/IOUs#city> "London" .
+_:Sue_Jones_Madrid <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/base/Lives> .
+_:Sue_Jones_Madrid <http://example.com/base/IOUs#fname> "Sue" .
+_:Sue_Jones_Madrid <http://example.com/base/IOUs#lname> "Jones" .
+_:Sue_Jones_Madrid <http://example.com/base/IOUs#city> "Madrid" .
+
+
+
+
+

265. RMLTC0013a-JSON

+

Title: "Null value in JSON file"

+

Description: "Tests if null values in JSON files are handled correctly."

+

Error expected? No

+

Input

+
{
+  "persons": [
+    {"ID":"1","Name":"Alice","DateOfBirth":null},
+    {"ID":"2","Name":"Bob","DateOfBirth":"September, 2010"}
+  ]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.persons[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "persons.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.DateOfBirth"
+        ];
+      rml:predicate ex:BirthDay
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Person/{$.ID}/{$.Name}/{$.DateOfBirth}"
+    ] .
+
+

Output

+
<http://example.com/Person/2/Bob/September%2C%202010> <http://example.com/BirthDay> "September, 2010" .
+
+
+

266. RMLTC0013a-MySQL

+

Title: "Generation of empty triples from referenced columns that have null values"

+

Description: "Tests the generation of empty triples from referenced columns that have null values"

+

Error expected? No

+

Input

+
USE test;
+DROP TABLE IF EXISTS test.Person;
+
+CREATE TABLE Person (
+ID integer,
+Name varchar(50),
+DateOfBirth varchar(50),
+PRIMARY KEY (ID)
+);
+INSERT INTO Person (ID, Name, DateOfBirth) VALUES (1,'Alice', NULL);
+INSERT INTO Person (ID, Name, DateOfBirth) VALUES (2,'Bob', 'September, 2010');
+
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "Person"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "DateOfBirth"
+        ];
+      rml:predicate ex:BirthDay
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Person/{ID}/{Name}/{DateOfBirth}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
+  d2rq:password "";
+  d2rq:username "root" .
+
+

Output

+
<http://example.com/Person/2/Bob/September%2C%202010> <http://example.com/BirthDay> "September, 2010" .
+
+
+
+
+

267. RMLTC0013a-PostgreSQL

+

Title: "Generation of empty triples from referenced columns that have null values"

+

Description: "Tests the generation of empty triples from referenced columns that have null values"

+

Error expected? No

+

Input

+
DROP TABLE IF EXISTS Person;
+
+CREATE TABLE Person (
+"ID" integer,
+"Name" varchar(50),
+"DateOfBirth" varchar(50),
+PRIMARY KEY ("ID")
+);
+INSERT INTO Person ("ID", "Name", "DateOfBirth") VALUES (1,'Alice', NULL);
+INSERT INTO Person ("ID", "Name", "DateOfBirth") VALUES (2,'Bob', 'September, 2010');
+
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "Person"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "DateOfBirth"
+        ];
+      rml:predicate ex:BirthDay
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Person/{ID}/{Name}/{DateOfBirth}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "org.postgresql.Driver";
+  d2rq:password "password";
+  d2rq:username "postgres" .
+
+

Output

+
<http://example.com/Person/2/Bob/September%2C%202010> <http://example.com/BirthDay> "September, 2010" .
+
+
+
+
+

268. RMLTC0013a-SQLServer

+

Title: "Generation of empty triples from referenced columns that have null values"

+

Description: "Tests the generation of empty triples from referenced columns that have null values"

+

Error expected? No

+

Input

+
USE TestDB;
+DROP TABLE IF EXISTS Person;
+
+CREATE TABLE Person (
+ID integer,
+Name varchar(50),
+DateOfBirth varchar(50),
+PRIMARY KEY (ID)
+);
+INSERT INTO Person (ID, Name, DateOfBirth) VALUES (1,'Alice', NULL);
+INSERT INTO Person (ID, Name, DateOfBirth) VALUES (2,'Bob', 'September, 2010');
+
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "Person"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "DateOfBirth"
+        ];
+      rml:predicate ex:BirthDay
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Person/{ID}/{Name}/{DateOfBirth}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
+  d2rq:password "YourSTRONG!Passw0rd;";
+  d2rq:username "sa" .
+
+

Output

+
<http://example.com/Person/2/Bob/September%2C%202010> <http://example.com/BirthDay> "September, 2010" .
+
+
+
+
+

269. RMLTC0014d-MySQL

+

Title: "three tables, one primary key, one foreign key"

+

Description: "Test the translation of database type codes to IRIs"

+

Error expected? No

+

Input

+
USE test;
+DROP TABLE IF EXISTS test.DEPT;
+DROP TABLE IF EXISTS test.EMP;
+DROP TABLE IF EXISTS test.LIKES;
+
+CREATE TABLE DEPT (
+      deptno INTEGER UNIQUE,
+      dname VARCHAR(30),
+      loc VARCHAR(100));
+INSERT INTO DEPT (deptno, dname, loc) VALUES (10, 'APPSERVER', 'NEW YORK');
+
+CREATE TABLE EMP (
+      empno INTEGER PRIMARY KEY,
+      ename VARCHAR(100),
+      job VARCHAR(30),
+      deptno INTEGER REFERENCES DEPT (deptno),
+      etype VARCHAR(30));
+INSERT INTO EMP (empno, ename, job, deptno, etype ) VALUES (7369, 'SMITH', 'CLERK', 10, 'PART_TIME');
+
+CREATE TABLE LIKES (
+      id INTEGER,
+      likeType VARCHAR(30),
+      likedObj VARCHAR(100));
+INSERT INTO LIKES (id, likeType, likedObj) VALUES (7369, 'Playing', 'Soccer');
+INSERT INTO LIKES (id, likeType, likedObj) VALUES (7369, 'Watching', 'Basketball');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator """
+      SELECT EMP.*, (CASE job
+        WHEN 'CLERK' THEN 'general-office'
+        WHEN 'NIGHTGUARD' THEN 'security'
+        WHEN 'ENGINEER' THEN 'engineering'
+      END) AS ROLE FROM EMP
+    """;
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Query
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:template "http://data.example.com/roles/{ROLE}"
+        ];
+      rml:predicate ex:role
+    ];
+  rml:subjectMap [
+      rml:template "http://data.example.com/employee/{empno}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
+  d2rq:password "";
+  d2rq:username "root" .
+
+

Output

+
<http://data.example.com/employee/7369> <http://example.com/ns#role> <http://data.example.com/roles/general-office> .
+
+
+

270. RMLTC0014d-PostgreSQL

+

Title: "three tables, one primary key, one foreign key"

+

Description: "Test the translation of database type codes to IRIs"

+

Error expected? No

+

Input

+
DROP TABLE IF EXISTS LIKES;
+DROP TABLE IF EXISTS EMP;
+DROP TABLE IF EXISTS DEPT;
+
+CREATE TABLE DEPT (
+      deptno INTEGER UNIQUE,
+      dname VARCHAR(30),
+      loc VARCHAR(100));
+INSERT INTO DEPT (deptno, dname, loc) VALUES (10, 'APPSERVER', 'NEW YORK');
+
+CREATE TABLE EMP (
+      empno INTEGER PRIMARY KEY,
+      ename VARCHAR(100),
+      job VARCHAR(30),
+      deptno INTEGER REFERENCES DEPT (deptno),
+      etype VARCHAR(30));
+INSERT INTO EMP (empno, ename, job, deptno, etype ) VALUES (7369, 'SMITH', 'CLERK', 10, 'PART_TIME');
+
+CREATE TABLE LIKES (
+      id INTEGER,
+      likeType VARCHAR(30),
+      likedObj VARCHAR(100));
+INSERT INTO LIKES (id, likeType, likedObj) VALUES (7369, 'Playing', 'Soccer');
+INSERT INTO LIKES (id, likeType, likedObj) VALUES (7369, 'Watching', 'Basketball');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator """
+      SELECT EMP.*, (CASE job
+        WHEN 'CLERK' THEN 'general-office'
+        WHEN 'NIGHTGUARD' THEN 'security'
+        WHEN 'ENGINEER' THEN 'engineering'
+      END) AS ROLE FROM EMP
+    """;
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Query
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:template "http://data.example.com/roles/{role}"
+        ];
+      rml:predicate ex:role
+    ];
+  rml:subjectMap [
+      rml:template "http://data.example.com/employee/{empno}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "org.postgresql.Driver";
+  d2rq:password "";
+  d2rq:username "postgres" .
+
+

Output

+
<http://data.example.com/employee/7369> <http://example.com/ns#role> <http://data.example.com/roles/general-office> .
+
+
+

271. RMLTC0014d-SQLServer

+

Title: "three tables, one primary key, one foreign key"

+

Description: "Test the translation of database type codes to IRIs"

+

Error expected? No

+

Input

+
USE TestDB;
+EXEC sp_msforeachtable 'ALTER TABLE ? NOCHECK CONSTRAINT all'
+EXEC sp_msforeachtable 'DROP TABLE ?'
+
+CREATE TABLE DEPT (
+      deptno INTEGER UNIQUE,
+      dname VARCHAR(30),
+      loc VARCHAR(100));
+INSERT INTO DEPT (deptno, dname, loc) VALUES (10, 'APPSERVER', 'NEW YORK');
+
+CREATE TABLE EMP (
+      empno INTEGER PRIMARY KEY,
+      ename VARCHAR(100),
+      job VARCHAR(30),
+      deptno INTEGER REFERENCES DEPT (deptno),
+      etype VARCHAR(30));
+INSERT INTO EMP (empno, ename, job, deptno, etype ) VALUES (7369, 'SMITH', 'CLERK', 10, 'PART_TIME');
+
+CREATE TABLE LIKES (
+      id INTEGER,
+      likeType VARCHAR(30),
+      likedObj VARCHAR(100));
+INSERT INTO LIKES (id, likeType, likedObj) VALUES (7369, 'Playing', 'Soccer');
+INSERT INTO LIKES (id, likeType, likedObj) VALUES (7369, 'Watching', 'Basketball');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator """
+      SELECT EMP.*, (CASE job
+        WHEN 'CLERK' THEN 'general-office'
+        WHEN 'NIGHTGUARD' THEN 'security'
+        WHEN 'ENGINEER' THEN 'engineering'
+      END) AS ROLE FROM EMP
+    """;
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Query
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:template "http://data.example.com/roles/{ROLE}"
+        ];
+      rml:predicate ex:role
+    ];
+  rml:subjectMap [
+      rml:template "http://data.example.com/employee/{empno}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
+  d2rq:password "YourSTRONG!Passw0rd;";
+  d2rq:username "sa" .
+
+

Output

+
<http://data.example.com/employee/7369> <http://example.com/ns#role> <http://data.example.com/roles/general-office> .
+
+
+

272. RMLTC0015a-CSV

+

Title: "Generation of language tags from a table with language information"

+

Description: "Generation of language tags from a table with language information"

+

Error expected? No

+

Input

+
Code,Name
+BO,"Bolivia, Plurinational State of"
+IE,Ireland
+
+

Mapping

+
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:referenceFormulation rml:CSV;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "country_en.csv"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:language "en";
+          rml:reference "Name"
+        ];
+      rml:predicate rdfs:label
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{Code}"
+    ] .
+
+<http://example.com/base/TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:referenceFormulation rml:CSV;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "country_es.csv"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:language "es";
+          rml:reference "Name"
+        ];
+      rml:predicate rdfs:label
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{Code}"
+    ] .
+
+

Output

+
<http://example.com/BO> <http://www.w3.org/2000/01/rdf-schema#label> "Bolivia, Plurinational State of"@en .
+<http://example.com/BO> <http://www.w3.org/2000/01/rdf-schema#label> "Estado Plurinacional de Bolivia"@es .
+<http://example.com/IE> <http://www.w3.org/2000/01/rdf-schema#label> "Ireland"@en .
+<http://example.com/IE> <http://www.w3.org/2000/01/rdf-schema#label> "Irlanda"@es .
+
+
+
+
+

273. RMLTC0015a-JSON

+

Title: "Generation of language tags from a table with language information"

+

Description: "Generation of language tags from a table with language information"

+

Error expected? No

+

Input

+
{
+  "countries": [
+    {"Code": "BO", "Name": "Bolivia, Plurinational State of"},
+    {"Code": "IE", "Name": "Ireland"}
+  ]
+}
+
+

Mapping

+
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.countries[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "country_en.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:language "en";
+          rml:reference "$.Name"
+        ];
+      rml:predicate rdfs:label
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{$.Code}"
+    ] .
+
+<http://example.com/base/TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.countries[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "country_es.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:language "es";
+          rml:reference "$.Name"
+        ];
+      rml:predicate rdfs:label
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{$.Code}"
+    ] .
+
+

Output

+
<http://example.com/BO> <http://www.w3.org/2000/01/rdf-schema#label> "Bolivia, Plurinational State of"@en .
+<http://example.com/BO> <http://www.w3.org/2000/01/rdf-schema#label> "Estado Plurinacional de Bolivia"@es .
+<http://example.com/IE> <http://www.w3.org/2000/01/rdf-schema#label> "Ireland"@en .
+<http://example.com/IE> <http://www.w3.org/2000/01/rdf-schema#label> "Irlanda"@es .
+
+
+
+
+

274. RMLTC0015a-MySQL

+

Title: "Generation of language tags from a table with language information"

+

Description: "Generation of language tags from a table with language information"

+

Error expected? No

+

Input

+
USE test;
+DROP TABLE IF EXISTS test.Country;
+
+CREATE TABLE Country (
+  Code VARCHAR(2),
+  Name VARCHAR(100),
+  Lan VARCHAR(10),
+  PRIMARY KEY (Code,Lan)
+);
+INSERT INTO Country (Code, Name, Lan) VALUES ('BO', 'Bolivia, Plurinational State of', 'EN');
+INSERT INTO Country (Code, Name, Lan) VALUES ('BO', 'Estado Plurinacional de Bolivia', 'ES');
+INSERT INTO Country (Code, Name, Lan) VALUES ('IE', 'Ireland', 'EN');
+INSERT INTO Country (Code, Name, Lan) VALUES ('IE', 'Irlanda', 'ES');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator """
+        SELECT Code, Name, Lan
+        FROM Country
+        WHERE Lan = 'EN';
+       """;
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Query
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:language "en";
+          rml:reference "Name"
+        ];
+      rml:predicate rdfs:label
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{Code}"
+    ] .
+
+<http://example.com/base/TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator """
+        SELECT Code, Name, Lan
+        FROM Country
+        WHERE Lan = 'ES';
+       """;
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Query
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:language "es";
+          rml:reference "Name"
+        ];
+      rml:predicate rdfs:label
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{Code}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
+  d2rq:password "";
+  d2rq:username "root" .
+
+

Output

+
<http://example.com/BO> <http://www.w3.org/2000/01/rdf-schema#label> "Bolivia, Plurinational State of"@en .
+<http://example.com/BO> <http://www.w3.org/2000/01/rdf-schema#label> "Estado Plurinacional de Bolivia"@es .
+<http://example.com/IE> <http://www.w3.org/2000/01/rdf-schema#label> "Ireland"@en .
+<http://example.com/IE> <http://www.w3.org/2000/01/rdf-schema#label> "Irlanda"@es .
+
+
+
+
+

275. RMLTC0015a-PostgreSQL

+

Title: "Generation of language tags from a table with language information"

+

Description: "Generation of language tags from a table with language information"

+

Error expected? No

+

Input

+
DROP TABLE IF EXISTS Country;
+
+CREATE TABLE Country (
+  Code VARCHAR(2),
+  Name VARCHAR(100),
+  Lan VARCHAR(10),
+  PRIMARY KEY (Code,Lan)
+);
+INSERT INTO Country (Code, Name, Lan) VALUES ('BO', 'Bolivia, Plurinational State of', 'EN');
+INSERT INTO Country (Code, Name, Lan) VALUES ('BO', 'Estado Plurinacional de Bolivia', 'ES');
+INSERT INTO Country (Code, Name, Lan) VALUES ('IE', 'Ireland', 'EN');
+INSERT INTO Country (Code, Name, Lan) VALUES ('IE', 'Irlanda', 'ES');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator """
+        SELECT Code, Name, Lan
+        FROM Country
+        WHERE Lan = 'EN';
+       """;
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Query
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:language "en";
+          rml:reference "name"
+        ];
+      rml:predicate rdfs:label
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{code}"
+    ] .
+
+<http://example.com/base/TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator """
+        SELECT Code, Name, Lan
+        FROM Country
+        WHERE Lan = 'ES';
+       """;
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Query
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:language "es";
+          rml:reference "name"
+        ];
+      rml:predicate rdfs:label
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{code}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "org.postgresql.Driver";
+  d2rq:password "";
+  d2rq:username "postgres" .
+
+

Output

+
<http://example.com/BO> <http://www.w3.org/2000/01/rdf-schema#label> "Bolivia, Plurinational State of"@en .
+<http://example.com/BO> <http://www.w3.org/2000/01/rdf-schema#label> "Estado Plurinacional de Bolivia"@es .
+<http://example.com/IE> <http://www.w3.org/2000/01/rdf-schema#label> "Ireland"@en .
+<http://example.com/IE> <http://www.w3.org/2000/01/rdf-schema#label> "Irlanda"@es .
+
+
+
+
+

276. RMLTC0015a-SQLServer

+

Title: "Generation of language tags from a table with language information"

+

Description: "Generation of language tags from a table with language information"

+

Error expected? No

+

Input

+
USE TestDB;
+DROP TABLE IF EXISTS Country;
+
+CREATE TABLE Country (
+  Code VARCHAR(2),
+  Name VARCHAR(100),
+  Lan VARCHAR(10),
+  PRIMARY KEY (Code,Lan)
+);
+INSERT INTO Country (Code, Name, Lan) VALUES ('BO', 'Bolivia, Plurinational State of', 'EN');
+INSERT INTO Country (Code, Name, Lan) VALUES ('BO', 'Estado Plurinacional de Bolivia', 'ES');
+INSERT INTO Country (Code, Name, Lan) VALUES ('IE', 'Ireland', 'EN');
+INSERT INTO Country (Code, Name, Lan) VALUES ('IE', 'Irlanda', 'ES');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator """
+        SELECT Code, Name, Lan
+        FROM Country
+        WHERE Lan = 'EN';
+       """;
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Query
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:language "en";
+          rml:reference "Name"
+        ];
+      rml:predicate rdfs:label
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{Code}"
+    ] .
+
+<http://example.com/base/TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator """
+        SELECT \"Code\", \"Name\", \"Lan\"
+        FROM \"Country\"
+        WHERE \"Lan\" = 'ES';
+       """;
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Query
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:language "es";
+          rml:reference "Name"
+        ];
+      rml:predicate rdfs:label
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{Code}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
+  d2rq:password "YourSTRONG!Passw0rd;";
+  d2rq:username "sa" .
+
+

Output

+
<http://example.com/BO> <http://www.w3.org/2000/01/rdf-schema#label> "Bolivia, Plurinational State of"@en .
+<http://example.com/BO> <http://www.w3.org/2000/01/rdf-schema#label> "Estado Plurinacional de Bolivia"@es .
+<http://example.com/IE> <http://www.w3.org/2000/01/rdf-schema#label> "Ireland"@en .
+<http://example.com/IE> <http://www.w3.org/2000/01/rdf-schema#label> "Irlanda"@es .
+
+
+
+
+

277. RMLTC0015a-XML

+

Title: "Generation of language tags from a table with language information"

+

Description: "Generation of language tags from a table with language information"

+

Error expected? No

+

Input

+
<?xml version="1.0"?>
+
+<countries>
+  <country><Code>BO</Code><Name>Bolivia, Plurinational State of</Name></country>
+  <country><Code>IE</Code><Name>Ireland</Name></country>
+</countries>
+
+

Mapping

+
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "/countries/country";
+      rml:referenceFormulation rml:XPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "country_en.xml"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:language "en";
+          rml:reference "Name"
+        ];
+      rml:predicate rdfs:label
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{Code}"
+    ] .
+
+<http://example.com/base/TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "/countries/country";
+      rml:referenceFormulation rml:XPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "country_es.xml"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:language "es";
+          rml:reference "Name"
+        ];
+      rml:predicate rdfs:label
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{Code}"
+    ] .
+
+

Output

+
<http://example.com/BO> <http://www.w3.org/2000/01/rdf-schema#label> "Bolivia, Plurinational State of"@en .
+<http://example.com/BO> <http://www.w3.org/2000/01/rdf-schema#label> "Estado Plurinacional de Bolivia"@es .
+<http://example.com/IE> <http://www.w3.org/2000/01/rdf-schema#label> "Ireland"@en .
+<http://example.com/IE> <http://www.w3.org/2000/01/rdf-schema#label> "Irlanda"@es .
+
+
+
+
+

278. RMLTC0015b-CSV

+

Title: "Generation of language tags from a table with language information, and a term map with invalid rr:language value"

+

Description: "Tests a term map with an invalid rr:language value, which is an error"

+

Error expected? Yes

+

Input

+
Code,Name
+BO,"Bolivia, Plurinational State of"
+IE,Ireland
+
+

Mapping

+
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:referenceFormulation rml:CSV;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "country_en.csv"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:language "a-english";
+          rml:reference "Name"
+        ];
+      rml:predicate rdfs:label
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{Code}"
+    ] .
+
+<http://example.com/base/TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:referenceFormulation rml:CSV;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "country_es.csv"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:language "a-spanish";
+          rml:reference "Name"
+        ];
+      rml:predicate rdfs:label
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{Code}"
+    ] .
+
+
+

279. RMLTC0015b-JSON

+

Title: "Generation of language tags from a table with language information, and a term map with invalid rr:language value"

+

Description: "Tests a term map with an invalid rr:language value, which is an error"

+

Error expected? Yes

+

Input

+
{
+  "countries": [
+    {"Code": "BO", "Name": "Bolivia, Plurinational State of"},
+    {"Code": "IE", "Name": "Ireland"}
+  ]
+}
+
+

Mapping

+
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.countries[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "country_en.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:language "a-english";
+          rml:reference "$.Name"
+        ];
+      rml:predicate rdfs:label
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{$.Code}"
+    ] .
+
+<http://example.com/base/TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.countries[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "country_en.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:language "a-spanish";
+          rml:reference "$.Name"
+        ];
+      rml:predicate rdfs:label
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{$.Code}"
+    ] .
+
+
+

280. RMLTC0015b-MySQL

+

Title: "Generation of language tags from a table with language information, and a term map with invalid rr:language value"

+

Description: "Tests a term map with an invalid rr:language value, which is an error"

+

Error expected? Yes

+

Input

+
USE test;
+DROP TABLE IF EXISTS test.Country;
+
+CREATE TABLE Country (
+  Code VARCHAR(2),
+  Name VARCHAR(100),
+  Lan VARCHAR(10),
+  PRIMARY KEY (Code,Lan)
+);
+INSERT INTO Country (Code, Name, Lan) VALUES ('BO', 'Bolivia, Plurinational State of', 'EN');
+INSERT INTO Country (Code, Name, Lan) VALUES ('BO', 'Estado Plurinacional de Bolivia', 'ES');
+INSERT INTO Country (Code, Name, Lan) VALUES ('IE', 'Ireland', 'EN');
+INSERT INTO Country (Code, Name, Lan) VALUES ('IE', 'Irlanda', 'ES');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator """
+        SELECT Code, Name, Lan
+        FROM Country
+        WHERE Lan = 'EN';
+       """;
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Query
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:language "a-english";
+          rml:reference "Name"
+        ];
+      rml:predicate rdfs:label
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{Code}"
+    ] .
+
+<http://example.com/base/TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:iterator """
+        SELECT Code, Name, Lan
+        FROM Country
+        WHERE Lan = 'EN';
+       """;
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Query
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:language "a-spanish";
+          rml:reference "Name"
+        ];
+      rml:predicate rdfs:label
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{Code}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
+  d2rq:password "";
+  d2rq:username "root" .
+
+
+

281. RMLTC0015b-PostgreSQL

+

Title: "Generation of language tags from a table with language information, and a term map with invalid rr:language value"

+

Description: "Tests a term map with an invalid rr:language value, which is an error"

+

Error expected? Yes

+

Input

+
DROP TABLE IF EXISTS Country;
+
+CREATE TABLE Country (
+  Code VARCHAR(2),
+  Name VARCHAR(100),
+  Lan VARCHAR(10),
+  PRIMARY KEY (Code,Lan)
+);
+INSERT INTO Country (Code, Name, Lan) VALUES ('BO', 'Bolivia, Plurinational State of', 'EN');
+INSERT INTO Country (Code, Name, Lan) VALUES ('BO', 'Estado Plurinacional de Bolivia', 'ES');
+INSERT INTO Country (Code, Name, Lan) VALUES ('IE', 'Ireland', 'EN');
+INSERT INTO Country (Code, Name, Lan) VALUES ('IE', 'Irlanda', 'ES');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:iterator """
+        SELECT Code, Name, Lan
+        FROM Country
+        WHERE Lan = 'EN';
+       """;
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Query
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:language "a-english";
+          rml:reference "Name"
+        ];
+      rml:predicate rdfs:label
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{Code}"
+    ] .
+
+<http://example.com/base/TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:iterator """
+        SELECT Code, Name, Lan
+        FROM Country
+        WHERE Lan = 'EN';
+       """;
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Query
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:language "a-spanish";
+          rml:reference "Name"
+        ];
+      rml:predicate rdfs:label
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{Code}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "org.postgresql.Driver";
+  d2rq:password "";
+  d2rq:username "postgres" .
+
+
+

282. RMLTC0015b-SQLServer

+

Title: "Generation of language tags from a table with language information, and a term map with invalid rr:language value"

+

Description: "Tests a term map with an invalid rr:language value, which is an error"

+

Error expected? Yes

+

Input

+
USE TestDB;
+DROP TABLE IF EXISTS Country;
+
+CREATE TABLE Country (
+  Code VARCHAR(2),
+  Name VARCHAR(100),
+  Lan VARCHAR(10),
+  PRIMARY KEY (Code,Lan)
+);
+INSERT INTO Country (Code, Name, Lan) VALUES ('BO', 'Bolivia, Plurinational State of', 'EN');
+INSERT INTO Country (Code, Name, Lan) VALUES ('BO', 'Estado Plurinacional de Bolivia', 'ES');
+INSERT INTO Country (Code, Name, Lan) VALUES ('IE', 'Ireland', 'EN');
+INSERT INTO Country (Code, Name, Lan) VALUES ('IE', 'Irlanda', 'ES');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:iterator """
+        SELECT Code, Name, Lan
+        FROM Country
+        WHERE Lan = 'EN';
+       """;
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Query
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:language "a-english";
+          rml:reference "Name"
+        ];
+      rml:predicate rdfs:label
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{Code}"
+    ] .
+
+<http://example.com/base/TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:iterator """
+        SELECT Code, Name, Lan
+        FROM Country
+        WHERE Lan = 'EN';
+       """;
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Query
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:language "a-spanish";
+          rml:reference "Name"
+        ];
+      rml:predicate rdfs:label
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{Code}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
+  d2rq:password "YourSTRONG!Passw0rd;";
+  d2rq:username "sa" .
+
+
+

283. RMLTC0015b-XML

+

Title: "Generation of language tags from a table with language information, and a term map with invalid rr:language value"

+

Description: "Tests a term map with an invalid rr:language value, which is an error"

+

Error expected? Yes

+

Input

+
<?xml version="1.0"?>
+
+<countries>
+  <country><Code>BO</Code><Name>Bolivia, Plurinational State of</Name></country>
+  <country><Code>IE</Code><Name>Ireland</Name></country>
+</countries>
+
+

Mapping

+
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "/countries/country";
+      rml:referenceFormulation rml:XPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "country_en.xml"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:language "a-english";
+          rml:reference "Name"
+        ];
+      rml:predicate rdfs:label
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{Code}"
+    ] .
+
+<http://example.com/base/TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "/countries/country";
+      rml:referenceFormulation rml:XPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "country_es.xml"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:language "a-spanish";
+          rml:reference "Name"
+        ];
+      rml:predicate rdfs:label
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{Code}"
+    ] .
+
+
+

284. RMLTC0016a-MySQL

+

Title: "Table with datatypes: string and integer"

+

Description: "Tests the rr:termtype and datatype conversions: string and integer"

+

Error expected? No

+

Input

+
USE test;
+DROP TABLE IF EXISTS test.Patient;
+
+CREATE TABLE Patient (
+ID INTEGER,
+FirstName VARCHAR(50),
+LastName VARCHAR(50),
+Sex VARCHAR(6),
+Weight REAL,
+Height FLOAT,
+BirthDate DATE,
+EntranceDate TIMESTAMP,
+PaidInAdvance BOOLEAN,
+Photo VARBINARY(200),
+PRIMARY KEY (ID)
+);
+
+INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo)
+VALUES (10,'Monica','Geller','female',80.25,1.65,'1981-10-10','2009-10-10 12:12:22',FALSE,
+X'89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFEBFC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082');
+
+INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo)
+VALUES (11,'Rachel','Green','female',70.22,1.70,'1982-11-12','2008-11-12 09:45:44',TRUE,
+X'89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFF3FC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082');
+
+INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo)
+VALUES (12,'Chandler','Bing','male',90.31,1.76,'1978-04-06','2007-03-12 02:13:14',TRUE,
+X'89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFEBFC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "Patient"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "Sex"
+        ];
+      rml:predicate ex:gender
+    ], [
+      rml:object foaf:Person;
+      rml:predicate rdf:type
+    ], [
+      rml:objectMap [
+          rml:reference "ID"
+        ];
+      rml:predicate ex:id
+    ], [
+      rml:objectMap [
+          rml:reference "FirstName"
+        ];
+      rml:predicate ex:firstName
+    ], [
+      rml:objectMap [
+          rml:reference "LastName"
+        ];
+      rml:predicate ex:lastName
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Patient/{ID}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
+  d2rq:password "";
+  d2rq:username "root" .
+
+

Output

+
<http://example.com/Patient/10> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Patient/10> <http://example.com/id> "10"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.com/Patient/10> <http://example.com/firstName> "Monica" .
+<http://example.com/Patient/10> <http://example.com/lastName> "Geller" .
+<http://example.com/Patient/10> <http://example.com/gender> "female" .
+<http://example.com/Patient/11> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Patient/11> <http://example.com/id> "11"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.com/Patient/11> <http://example.com/firstName> "Rachel" .
+<http://example.com/Patient/11> <http://example.com/lastName> "Green" .
+<http://example.com/Patient/11> <http://example.com/gender> "female" .
+<http://example.com/Patient/12> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Patient/12> <http://example.com/id> "12"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.com/Patient/12> <http://example.com/firstName> "Chandler" .
+<http://example.com/Patient/12> <http://example.com/lastName> "Bing" .
+<http://example.com/Patient/12> <http://example.com/gender> "male" .
+
+
+
+

285. RMLTC0016a-PostgreSQL

+

Title: "Table with datatypes: string and integer"

+

Description: "Tests the rr:termtype and datatype conversions: string and integer"

+

Error expected? No

+

Input

+
DROP TABLE IF EXISTS Patient;
+
+CREATE TABLE Patient (
+ID INTEGER,
+FirstName VARCHAR(50),
+LastName VARCHAR(50),
+Sex VARCHAR(6),
+Weight REAL,
+Height FLOAT,
+BirthDate DATE,
+EntranceDate TIMESTAMP,
+PaidInAdvance BOOLEAN,
+Photo BYTEA,
+PRIMARY KEY (ID)
+);
+
+INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo)
+VALUES (10,'Monica','Geller','female',80.25,1.65,'1981-10-10','2009-10-10 12:12:22',FALSE,
+'\\x89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFEBFC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082');
+
+INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo)
+VALUES (11,'Rachel','Green','female',70.22,1.70,'1982-11-12','2008-11-12 09:45:44',TRUE,
+'\\x89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFF3FC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082');
+
+INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo)
+VALUES (12,'Chandler','Bing','male',90.31,1.76,'1978-04-06','2007-03-12 02:13:14',TRUE,
+'\\x89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFEBFC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "Patient"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "sex"
+        ];
+      rml:predicate ex:gender
+    ], [
+      rml:object foaf:Person;
+      rml:predicate rdf:type
+    ], [
+      rml:objectMap [
+          rml:reference "id"
+        ];
+      rml:predicate ex:id
+    ], [
+      rml:objectMap [
+          rml:reference "firstname"
+        ];
+      rml:predicate ex:firstName
+    ], [
+      rml:objectMap [
+          rml:reference "lastname"
+        ];
+      rml:predicate ex:lastName
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Patient/{id}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "org.postgresql.Driver";
+  d2rq:password "";
+  d2rq:username "postgres" .
+
+

Output

+
<http://example.com/Patient/10> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Patient/10> <http://example.com/id> "10"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.com/Patient/10> <http://example.com/firstName> "Monica" .
+<http://example.com/Patient/10> <http://example.com/lastName> "Geller" .
+<http://example.com/Patient/10> <http://example.com/gender> "female" .
+<http://example.com/Patient/11> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Patient/11> <http://example.com/id> "11"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.com/Patient/11> <http://example.com/firstName> "Rachel" .
+<http://example.com/Patient/11> <http://example.com/lastName> "Green" .
+<http://example.com/Patient/11> <http://example.com/gender> "female" .
+<http://example.com/Patient/12> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Patient/12> <http://example.com/id> "12"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.com/Patient/12> <http://example.com/firstName> "Chandler" .
+<http://example.com/Patient/12> <http://example.com/lastName> "Bing" .
+<http://example.com/Patient/12> <http://example.com/gender> "male" .
+
+
+
+

286. RMLTC0016a-SQLServer

+

Title: "Table with datatypes: string and integer"

+

Description: "Tests the rr:termtype and datatype conversions: string and integer"

+

Error expected? No

+

Input

+
USE TestDB;
+DROP TABLE IF EXISTS Patient;
+
+CREATE TABLE Patient (
+ID INTEGER,
+FirstName VARCHAR(50),
+LastName VARCHAR(50),
+Sex VARCHAR(6),
+Weight REAL,
+Height FLOAT,
+BirthDate DATE,
+EntranceDate DATETIME,
+PaidInAdvance BIT,
+Photo VARBINARY(200),
+PRIMARY KEY (ID)
+);
+
+INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo)
+VALUES (10,'Monica','Geller','female',80.25,1.65,'1981-10-10','2009-10-10 12:12:22',0,
+CAST('89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFEBFC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082' as VARBINARY));
+
+INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo)
+VALUES (11,'Rachel','Green','female',70.22,1.70,'1982-11-12','2008-11-12 09:45:44',1,
+CAST('89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFF3FC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082' as VARBINARY));
+
+INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo)
+VALUES (12,'Chandler','Bing','male',90.31,1.76,'1978-04-06','2007-03-12 02:13:14',1,
+CAST('89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFEBFC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082' as VARBINARY));
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "Patient"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "Sex"
+        ];
+      rml:predicate ex:gender
+    ], [
+      rml:object foaf:Person;
+      rml:predicate rdf:type
+    ], [
+      rml:objectMap [
+          rml:reference "ID"
+        ];
+      rml:predicate ex:id
+    ], [
+      rml:objectMap [
+          rml:reference "FirstName"
+        ];
+      rml:predicate ex:firstName
+    ], [
+      rml:objectMap [
+          rml:reference "LastName"
+        ];
+      rml:predicate ex:lastName
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Patient/{ID}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
+  d2rq:password "YourSTRONG!Passw0rd;";
+  d2rq:username "sa" .
+
+

Output

+
<http://example.com/Patient/10> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Patient/10> <http://example.com/id> "10"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.com/Patient/10> <http://example.com/firstName> "Monica" .
+<http://example.com/Patient/10> <http://example.com/lastName> "Geller" .
+<http://example.com/Patient/10> <http://example.com/gender> "female" .
+<http://example.com/Patient/11> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Patient/11> <http://example.com/id> "11"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.com/Patient/11> <http://example.com/firstName> "Rachel" .
+<http://example.com/Patient/11> <http://example.com/lastName> "Green" .
+<http://example.com/Patient/11> <http://example.com/gender> "female" .
+<http://example.com/Patient/12> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Patient/12> <http://example.com/id> "12"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.com/Patient/12> <http://example.com/firstName> "Chandler" .
+<http://example.com/Patient/12> <http://example.com/lastName> "Bing" .
+<http://example.com/Patient/12> <http://example.com/gender> "male" .
+
+
+
+

287. RMLTC0016b-MySQL

+

Title: "Table with datatypes: real and float"

+

Description: "Tests the rr:termtype and datatype conversions: real and float"

+

Error expected? No

+

Input

+
USE test;
+DROP TABLE IF EXISTS test.Patient;
+
+CREATE TABLE Patient (
+ID INTEGER,
+FirstName VARCHAR(50),
+LastName VARCHAR(50),
+Sex VARCHAR(6),
+Weight REAL,
+Height FLOAT,
+BirthDate DATE,
+EntranceDate TIMESTAMP,
+PaidInAdvance BOOLEAN,
+Photo VARBINARY(200),
+PRIMARY KEY (ID)
+);
+
+INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo)
+VALUES (10,'Monica','Geller','female',80.25,1.65,'1981-10-10','2009-10-10 12:12:22',FALSE,
+X'89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFEBFC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082');
+
+INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo)
+VALUES (11,'Rachel','Green','female',70.22,1.70,'1982-11-12','2008-11-12 09:45:44',TRUE,
+X'89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFF3FC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082');
+
+INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo)
+VALUES (12,'Chandler','Bing','male',90.31,1.76,'1978-04-06','2007-03-12 02:13:14',TRUE,
+X'89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFEBFC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "Patient"
+    ];
+  rml:predicateObjectMap [
+      rml:object foaf:Person;
+      rml:predicate rdf:type
+    ], [
+      rml:objectMap [
+          rml:reference "Weight"
+        ];
+      rml:predicate ex:weight
+    ], [
+      rml:objectMap [
+          rml:reference "Height"
+        ];
+      rml:predicate ex:height
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Patient{ID}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
+  d2rq:password "";
+  d2rq:username "root" .
+
+

Output

+
<http://example.com/Patient10> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Patient10> <http://example.com/weight> "8.025E1"^^<http://www.w3.org/2001/XMLSchema#double> .
+<http://example.com/Patient10> <http://example.com/height> "1.65E0"^^<http://www.w3.org/2001/XMLSchema#double> .
+<http://example.com/Patient11> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Patient11> <http://example.com/weight> "7.022E1"^^<http://www.w3.org/2001/XMLSchema#double> .
+<http://example.com/Patient11> <http://example.com/height> "1.7E0"^^<http://www.w3.org/2001/XMLSchema#double> .
+<http://example.com/Patient12> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Patient12> <http://example.com/weight> "9.031E1"^^<http://www.w3.org/2001/XMLSchema#double> .
+<http://example.com/Patient12> <http://example.com/height> "1.76E0"^^<http://www.w3.org/2001/XMLSchema#double> .
+
+
+

288. RMLTC0016b-PostgreSQL

+

Title: "Table with datatypes: real and float"

+

Description: "Tests the rr:termtype and datatype conversions: real and float"

+

Error expected? No

+

Input

+
DROP TABLE IF EXISTS Patient;
+
+CREATE TABLE Patient (
+ID INTEGER,
+FirstName VARCHAR(50),
+LastName VARCHAR(50),
+Sex VARCHAR(6),
+Weight REAL,
+Height FLOAT,
+BirthDate DATE,
+EntranceDate TIMESTAMP,
+PaidInAdvance BOOLEAN,
+Photo BYTEA,
+PRIMARY KEY (ID)
+);
+
+INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo)
+VALUES (10,'Monica','Geller','female',80.25,1.65,'1981-10-10','2009-10-10 12:12:22',FALSE,
+'\\x89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFEBFC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082');
+
+INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo)
+VALUES (11,'Rachel','Green','female',70.22,1.70,'1982-11-12','2008-11-12 09:45:44',TRUE,
+'\\x89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFF3FC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082');
+
+INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo)
+VALUES (12,'Chandler','Bing','male',90.31,1.76,'1978-04-06','2007-03-12 02:13:14',TRUE,
+'\\x89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFEBFC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "Patient"
+    ];
+  rml:predicateObjectMap [
+      rml:object foaf:Person;
+      rml:predicate rdf:type
+    ], [
+      rml:objectMap [
+          rml:reference "weight"
+        ];
+      rml:predicate ex:weight
+    ], [
+      rml:objectMap [
+          rml:reference "height"
+        ];
+      rml:predicate ex:height
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Patient{id}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "org.postgresql.Driver";
+  d2rq:password "";
+  d2rq:username "postgres" .
+
+

Output

+
<http://example.com/Patient10> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Patient10> <http://example.com/weight> "8.025E1"^^<http://www.w3.org/2001/XMLSchema#double> .
+<http://example.com/Patient10> <http://example.com/height> "1.65E0"^^<http://www.w3.org/2001/XMLSchema#double> .
+<http://example.com/Patient11> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Patient11> <http://example.com/weight> "7.022E1"^^<http://www.w3.org/2001/XMLSchema#double> .
+<http://example.com/Patient11> <http://example.com/height> "1.7E0"^^<http://www.w3.org/2001/XMLSchema#double> .
+<http://example.com/Patient12> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Patient12> <http://example.com/weight> "9.031E1"^^<http://www.w3.org/2001/XMLSchema#double> .
+<http://example.com/Patient12> <http://example.com/height> "1.76E0"^^<http://www.w3.org/2001/XMLSchema#double> .
+
+
+

289. RMLTC0016b-SQLServer

+

Title: "Table with datatypes: real and float"

+

Description: "Tests the rr:termtype and datatype conversions: real and float"

+

Error expected? No

+

Input

+
USE TestDB;
+DROP TABLE IF EXISTS Patient;
+
+CREATE TABLE Patient (
+ID INTEGER,
+FirstName VARCHAR(50),
+LastName VARCHAR(50),
+Sex VARCHAR(6),
+Weight REAL,
+Height FLOAT,
+BirthDate DATE,
+EntranceDate DATETIME,
+PaidInAdvance BIT,
+Photo VARBINARY(200),
+PRIMARY KEY (ID)
+);
+
+INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo)
+VALUES (10,'Monica','Geller','female',80.25,1.65,'1981-10-10','2009-10-10 12:12:22',0,
+CAST('89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFEBFC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082' as VARBINARY));
+
+INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo)
+VALUES (11,'Rachel','Green','female',70.22,1.70,'1982-11-12','2008-11-12 09:45:44',1,
+CAST('89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFF3FC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082' as VARBINARY));
+
+INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo)
+VALUES (12,'Chandler','Bing','male',90.31,1.76,'1978-04-06','2007-03-12 02:13:14',1,
+CAST('89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFEBFC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082' as VARBINARY));
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "Patient"
+    ];
+  rml:predicateObjectMap [
+      rml:object foaf:Person;
+      rml:predicate rdf:type
+    ], [
+      rml:objectMap [
+          rml:reference "Weight"
+        ];
+      rml:predicate ex:weight
+    ], [
+      rml:objectMap [
+          rml:reference "Height"
+        ];
+      rml:predicate ex:height
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Patient{ID}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
+  d2rq:password "YourSTRONG!Passw0rd;";
+  d2rq:username "sa" .
+
+

Output

+
<http://example.com/Patient10> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Patient10> <http://example.com/weight> "8.025E1"^^<http://www.w3.org/2001/XMLSchema#double> .
+<http://example.com/Patient10> <http://example.com/height> "1.65E0"^^<http://www.w3.org/2001/XMLSchema#double> .
+<http://example.com/Patient11> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Patient11> <http://example.com/weight> "7.022E1"^^<http://www.w3.org/2001/XMLSchema#double> .
+<http://example.com/Patient11> <http://example.com/height> "1.7E0"^^<http://www.w3.org/2001/XMLSchema#double> .
+<http://example.com/Patient12> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Patient12> <http://example.com/weight> "9.031E1"^^<http://www.w3.org/2001/XMLSchema#double> .
+<http://example.com/Patient12> <http://example.com/height> "1.76E0"^^<http://www.w3.org/2001/XMLSchema#double> .
+
+
+

290. RMLTC0016c-MySQL

+

Title: "Table with datatypes: date and timestamp"

+

Description: "Tests the rr:termtype and datatype conversions: date and timestamp"

+

Error expected? No

+

Input

+
USE test;
+DROP TABLE IF EXISTS test.Patient;
+
+CREATE TABLE Patient (
+ID INTEGER,
+FirstName VARCHAR(50),
+LastName VARCHAR(50),
+Sex VARCHAR(6),
+Weight REAL,
+Height FLOAT,
+BirthDate DATE,
+EntranceDate TIMESTAMP,
+PaidInAdvance BOOLEAN,
+Photo VARBINARY(200),
+PRIMARY KEY (ID)
+);
+
+INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo)
+VALUES (10,'Monica','Geller','female',80.25,1.65,'1981-10-10','2009-10-10 12:12:22',FALSE,
+X'89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFEBFC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082');
+
+INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo)
+VALUES (11,'Rachel','Green','female',70.22,1.70,'1982-11-12','2008-11-12 09:45:44',TRUE,
+X'89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFF3FC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082');
+
+INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo)
+VALUES (12,'Chandler','Bing','male',90.31,1.76,'1978-04-06','2007-03-12 02:13:14',TRUE,
+X'89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFEBFC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "Patient"
+    ];
+  rml:predicateObjectMap [
+      rml:object foaf:Person;
+      rml:predicate rdf:type
+    ], [
+      rml:objectMap [
+          rml:reference "BirthDate"
+        ];
+      rml:predicate ex:birthdate
+    ], [
+      rml:objectMap [
+          rml:reference "EntranceDate"
+        ];
+      rml:predicate ex:entrancedate
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Patient{ID}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
+  d2rq:password "";
+  d2rq:username "root" .
+
+

Output

+
<http://example.com/Patient10> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Patient10> <http://example.com/birthdate> "1981-10-10"^^<http://www.w3.org/2001/XMLSchema#date> .
+<http://example.com/Patient10> <http://example.com/entrancedate> "2009-10-10T12:12:22"^^<http://www.w3.org/2001/XMLSchema#dateTime> .
+<http://example.com/Patient11> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Patient11> <http://example.com/birthdate> "1982-11-12"^^<http://www.w3.org/2001/XMLSchema#date> .
+<http://example.com/Patient11> <http://example.com/entrancedate> "2008-11-12T09:45:44"^^<http://www.w3.org/2001/XMLSchema#dateTime> .
+<http://example.com/Patient12> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Patient12> <http://example.com/birthdate> "1978-04-06"^^<http://www.w3.org/2001/XMLSchema#date> .
+<http://example.com/Patient12> <http://example.com/entrancedate> "2007-03-12T02:13:14"^^<http://www.w3.org/2001/XMLSchema#dateTime> .
+
+
+

291. RMLTC0016c-PostgreSQL

+

Title: "Table with datatypes: date and timestamp"

+

Description: "Tests the rr:termtype and datatype conversions: date and timestamp"

+

Error expected? No

+

Input

+
DROP TABLE IF EXISTS Patient;
+
+CREATE TABLE Patient (
+ID INTEGER,
+FirstName VARCHAR(50),
+LastName VARCHAR(50),
+Sex VARCHAR(6),
+Weight REAL,
+Height FLOAT,
+BirthDate DATE,
+EntranceDate TIMESTAMP,
+PaidInAdvance BOOLEAN,
+Photo BYTEA,
+PRIMARY KEY (ID)
+);
+
+INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo)
+VALUES (10,'Monica','Geller','female',80.25,1.65,'1981-10-10','2009-10-10 12:12:22',FALSE,
+'\\x89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFEBFC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082');
+
+INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo)
+VALUES (11,'Rachel','Green','female',70.22,1.70,'1982-11-12','2008-11-12 09:45:44',TRUE,
+'\\x89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFF3FC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082');
+
+INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo)
+VALUES (12,'Chandler','Bing','male',90.31,1.76,'1978-04-06','2007-03-12 02:13:14',TRUE,
+'\\x89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFEBFC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "Patient"
+    ];
+  rml:predicateObjectMap [
+      rml:object foaf:Person;
+      rml:predicate rdf:type
+    ], [
+      rml:objectMap [
+          rml:reference "birthdate"
+        ];
+      rml:predicate ex:birthdate
+    ], [
+      rml:objectMap [
+          rml:reference "entrancedate"
+        ];
+      rml:predicate ex:entrancedate
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Patient{id}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "org.postgresql.Driver";
+  d2rq:password "";
+  d2rq:username "postgres" .
+
+

Output

+
<http://example.com/Patient10> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Patient10> <http://example.com/birthdate> "1981-10-10"^^<http://www.w3.org/2001/XMLSchema#date> .
+<http://example.com/Patient10> <http://example.com/entrancedate> "2009-10-10T12:12:22"^^<http://www.w3.org/2001/XMLSchema#dateTime> .
+<http://example.com/Patient11> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Patient11> <http://example.com/birthdate> "1982-11-12"^^<http://www.w3.org/2001/XMLSchema#date> .
+<http://example.com/Patient11> <http://example.com/entrancedate> "2008-11-12T09:45:44"^^<http://www.w3.org/2001/XMLSchema#dateTime> .
+<http://example.com/Patient12> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Patient12> <http://example.com/birthdate> "1978-04-06"^^<http://www.w3.org/2001/XMLSchema#date> .
+<http://example.com/Patient12> <http://example.com/entrancedate> "2007-03-12T02:13:14"^^<http://www.w3.org/2001/XMLSchema#dateTime> .
+
+
+

292. RMLTC0016c-SQLServer

+

Title: "Table with datatypes: date and timestamp"

+

Description: "Tests the rr:termtype and datatype conversions: date and timestamp"

+

Error expected? No

+

Input

+
USE TestDB;
+DROP TABLE IF EXISTS Patient;
+
+CREATE TABLE Patient (
+ID INTEGER,
+FirstName VARCHAR(50),
+LastName VARCHAR(50),
+Sex VARCHAR(6),
+Weight REAL,
+Height FLOAT,
+BirthDate DATE,
+EntranceDate DATETIME,
+PaidInAdvance BIT,
+Photo VARBINARY(200),
+PRIMARY KEY (ID)
+);
+
+INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo)
+VALUES (10,'Monica','Geller','female',80.25,1.65,'1981-10-10','2009-10-10 12:12:22',0,
+CAST('89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFEBFC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082' as VARBINARY));
+
+INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo)
+VALUES (11,'Rachel','Green','female',70.22,1.70,'1982-11-12','2008-11-12 09:45:44',1,
+CAST('89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFF3FC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082' as VARBINARY));
+
+INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo)
+VALUES (12,'Chandler','Bing','male',90.31,1.76,'1978-04-06','2007-03-12 02:13:14',1,
+CAST('89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFEBFC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082' as VARBINARY));
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "Patient"
+    ];
+  rml:predicateObjectMap [
+      rml:object foaf:Person;
+      rml:predicate rdf:type
+    ], [
+      rml:objectMap [
+          rml:reference "BirthDate"
+        ];
+      rml:predicate ex:birthdate
+    ], [
+      rml:objectMap [
+          rml:reference "EntranceDate"
+        ];
+      rml:predicate ex:entrancedate
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Patient{ID}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
+  d2rq:password "YourSTRONG!Passw0rd;";
+  d2rq:username "sa" .
+
+

Output

+
<http://example.com/Patient10> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Patient10> <http://example.com/birthdate> "1981-10-10"^^<http://www.w3.org/2001/XMLSchema#date> .
+<http://example.com/Patient10> <http://example.com/entrancedate> "2009-10-10T12:12:22"^^<http://www.w3.org/2001/XMLSchema#dateTime> .
+<http://example.com/Patient11> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Patient11> <http://example.com/birthdate> "1982-11-12"^^<http://www.w3.org/2001/XMLSchema#date> .
+<http://example.com/Patient11> <http://example.com/entrancedate> "2008-11-12T09:45:44"^^<http://www.w3.org/2001/XMLSchema#dateTime> .
+<http://example.com/Patient12> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Patient12> <http://example.com/birthdate> "1978-04-06"^^<http://www.w3.org/2001/XMLSchema#date> .
+<http://example.com/Patient12> <http://example.com/entrancedate> "2007-03-12T02:13:14"^^<http://www.w3.org/2001/XMLSchema#dateTime> .
+
+
+

293. RMLTC0016d-MySQL

+

Title: "Table with datatypes, boolean conversions"

+

Description: "Tests the rr:termtype and datatype conversions: boolean"

+

Error expected? No

+

Input

+
USE test;
+DROP TABLE IF EXISTS test.Patient;
+
+CREATE TABLE Patient (
+ID INTEGER,
+FirstName VARCHAR(50),
+LastName VARCHAR(50),
+Sex VARCHAR(6),
+Weight REAL,
+Height FLOAT,
+BirthDate DATE,
+EntranceDate TIMESTAMP,
+PaidInAdvance BOOLEAN,
+Photo VARBINARY(200),
+PRIMARY KEY (ID)
+);
+
+INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo)
+VALUES (10,'Monica','Geller','female',80.25,1.65,'1981-10-10','2009-10-10 12:12:22',FALSE,
+X'89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFEBFC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082');
+
+INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo)
+VALUES (11,'Rachel','Green','female',70.22,1.70,'1982-11-12','2008-11-12 09:45:44',TRUE,
+X'89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFF3FC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082');
+
+INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo)
+VALUES (12,'Chandler','Bing','male',90.31,1.76,'1978-04-06','2007-03-12 02:13:14',TRUE,
+X'89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFEBFC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "Patient"
+    ];
+  rml:predicateObjectMap [
+      rml:object foaf:Person;
+      rml:predicate rdf:type
+    ], [
+      rml:objectMap [
+          rml:reference "PaidInAdvance"
+        ];
+      rml:predicate ex:paid
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Patient{ID}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
+  d2rq:password "";
+  d2rq:username "root" .
+
+

Output

+
<http://example.com/Patient10> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Patient10> <http://example.com/paid> "false"^^<http://www.w3.org/2001/XMLSchema#boolean> .
+<http://example.com/Patient11> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Patient11> <http://example.com/paid> "true"^^<http://www.w3.org/2001/XMLSchema#boolean> .
+<http://example.com/Patient12> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Patient12> <http://example.com/paid> "true"^^<http://www.w3.org/2001/XMLSchema#boolean> .
+
+
+

294. RMLTC0016d-PostgreSQL

+

Title: "Table with datatypes, boolean conversions"

+

Description: "Tests the rr:termtype and datatype conversions: boolean"

+

Error expected? No

+

Input

+
DROP TABLE IF EXISTS Patient;
+
+CREATE TABLE Patient (
+ID INTEGER,
+FirstName VARCHAR(50),
+LastName VARCHAR(50),
+Sex VARCHAR(6),
+Weight REAL,
+Height FLOAT,
+BirthDate DATE,
+EntranceDate TIMESTAMP,
+PaidInAdvance BOOLEAN,
+Photo BYTEA,
+PRIMARY KEY (ID)
+);
+
+INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo)
+VALUES (10,'Monica','Geller','female',80.25,1.65,'1981-10-10','2009-10-10 12:12:22',FALSE,
+'\\x89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFEBFC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082');
+
+INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo)
+VALUES (11,'Rachel','Green','female',70.22,1.70,'1982-11-12','2008-11-12 09:45:44',TRUE,
+'\\x89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFF3FC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082');
+
+INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo)
+VALUES (12,'Chandler','Bing','male',90.31,1.76,'1978-04-06','2007-03-12 02:13:14',TRUE,
+'\\x89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFEBFC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "Patient"
+    ];
+  rml:predicateObjectMap [
+      rml:object foaf:Person;
+      rml:predicate rdf:type
+    ], [
+      rml:objectMap [
+          rml:reference "paidinadvance"
+        ];
+      rml:predicate ex:paid
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Patient{id}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "org.postgresql.Driver";
+  d2rq:password "";
+  d2rq:username "postgres" .
+
+

Output

+
<http://example.com/Patient10> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Patient10> <http://example.com/paid> "false"^^<http://www.w3.org/2001/XMLSchema#boolean> .
+<http://example.com/Patient11> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Patient11> <http://example.com/paid> "true"^^<http://www.w3.org/2001/XMLSchema#boolean> .
+<http://example.com/Patient12> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Patient12> <http://example.com/paid> "true"^^<http://www.w3.org/2001/XMLSchema#boolean> .
+
+
+

295. RMLTC0016d-SQLServer

+

Title: "Table with datatypes, boolean conversions"

+

Description: "Tests the rr:termtype and datatype conversions: boolean"

+

Error expected? No

+

Input

+
USE TestDB;
+DROP TABLE IF EXISTS Patient;
+
+CREATE TABLE Patient (
+ID INTEGER,
+FirstName VARCHAR(50),
+LastName VARCHAR(50),
+Sex VARCHAR(6),
+Weight REAL,
+Height FLOAT,
+BirthDate DATE,
+EntranceDate DATETIME,
+PaidInAdvance BIT,
+Photo VARBINARY(200),
+PRIMARY KEY (ID)
+);
+
+INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo)
+VALUES (10,'Monica','Geller','female',80.25,1.65,'1981-10-10','2009-10-10 12:12:22',0,
+CAST('89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFEBFC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082' as VARBINARY));
+
+INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo)
+VALUES (11,'Rachel','Green','female',70.22,1.70,'1982-11-12','2008-11-12 09:45:44',1,
+CAST('89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFF3FC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082' as VARBINARY));
+
+INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo)
+VALUES (12,'Chandler','Bing','male',90.31,1.76,'1978-04-06','2007-03-12 02:13:14',1,
+CAST('89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFEBFC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082' as VARBINARY));
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "Patient"
+    ];
+  rml:predicateObjectMap [
+      rml:object foaf:Person;
+      rml:predicate rdf:type
+    ], [
+      rml:objectMap [
+          rml:reference "PaidInAdvance"
+        ];
+      rml:predicate ex:paid
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Patient{ID}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
+  d2rq:password "YourSTRONG!Passw0rd;";
+  d2rq:username "sa" .
+
+

Output

+
<http://example.com/Patient10> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Patient10> <http://example.com/paid> "false"^^<http://www.w3.org/2001/XMLSchema#boolean> .
+<http://example.com/Patient11> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Patient11> <http://example.com/paid> "true"^^<http://www.w3.org/2001/XMLSchema#boolean> .
+<http://example.com/Patient12> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Patient12> <http://example.com/paid> "true"^^<http://www.w3.org/2001/XMLSchema#boolean> .
+
+
+

296. RMLTC0016e-MySQL

+

Title: "Table with datatypes, binary column"

+

Description: "Tests the rr:termtype and datatype conversions: binary"

+

Error expected? No

+

Input

+
USE test;
+DROP TABLE IF EXISTS test.Patient;
+
+CREATE TABLE Patient (
+ID INTEGER,
+FirstName VARCHAR(50),
+LastName VARCHAR(50),
+Sex VARCHAR(6),
+Weight REAL,
+Height FLOAT,
+BirthDate DATE,
+EntranceDate TIMESTAMP,
+PaidInAdvance BOOLEAN,
+Photo VARBINARY(200),
+PRIMARY KEY (ID)
+);
+
+INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo)
+VALUES (10,'Monica','Geller','female',80.25,1.65,'1981-10-10','2009-10-10 12:12:22',FALSE,
+X'89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFEBFC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082');
+
+INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo)
+VALUES (11,'Rachel','Green','female',70.22,1.70,'1982-11-12','2008-11-12 09:45:44',TRUE,
+X'89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFF3FC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082');
+
+INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo)
+VALUES (12,'Chandler','Bing','male',90.31,1.76,'1978-04-06','2007-03-12 02:13:14',TRUE,
+X'89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFEBFC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "Patient"
+    ];
+  rml:predicateObjectMap [
+      rml:object foaf:Person;
+      rml:predicate rdf:type
+    ], [
+      rml:objectMap [
+          rml:template "data:image/png;hex,{Photo}"
+        ];
+      rml:predicate ex:photo
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Patient{ID}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
+  d2rq:password "";
+  d2rq:username "root" .
+
+

Output

+
<http://example.com/Patient10> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Patient10> <http://example.com/photo> <data:image/png;hex,89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFEBFC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082> .
+<http://example.com/Patient11> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Patient11> <http://example.com/photo> <data:image/png;hex,89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFF3FC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082> .
+<http://example.com/Patient12> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Patient12> <http://example.com/photo> <data:image/png;hex,89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFEBFC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082> .
+
+
+

297. RMLTC0016e-PostgreSQL

+

Title: "Table with datatypes, binary column"

+

Description: "Tests the rr:termtype and datatype conversions: binary"

+

Error expected? No

+

Input

+
DROP TABLE IF EXISTS Patient;
+
+CREATE TABLE Patient (
+ID INTEGER,
+FirstName VARCHAR(50),
+LastName VARCHAR(50),
+Sex VARCHAR(6),
+Weight REAL,
+Height FLOAT,
+BirthDate DATE,
+EntranceDate TIMESTAMP,
+PaidInAdvance BOOLEAN,
+Photo BYTEA,
+PRIMARY KEY (ID)
+);
+
+INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo)
+VALUES (10,'Monica','Geller','female',80.25,1.65,'1981-10-10','2009-10-10 12:12:22',FALSE,
+'\x89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFEBFC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082');
+
+INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo)
+VALUES (11,'Rachel','Green','female',70.22,1.70,'1982-11-12','2008-11-12 09:45:44',TRUE,
+'\x89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFF3FC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082');
+
+INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo)
+VALUES (12,'Chandler','Bing','male',90.31,1.76,'1978-04-06','2007-03-12 02:13:14',TRUE,
+'\x89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFEBFC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "Patient"
+    ];
+  rml:predicateObjectMap [
+      rml:object foaf:Person;
+      rml:predicate rdf:type
+    ], [
+      rml:objectMap [
+          rml:template "data:image/png;hex,{photo}"
+        ];
+      rml:predicate ex:photo
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Patient{id}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "org.postgresql.Driver";
+  d2rq:password "";
+  d2rq:username "postgres" .
+
+

Output

+
<http://example.com/Patient10> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Patient10> <http://example.com/photo> <data:image/png;hex,89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFEBFC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082> .
+<http://example.com/Patient11> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Patient11> <http://example.com/photo> <data:image/png;hex,89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFF3FC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082> .
+<http://example.com/Patient12> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Patient12> <http://example.com/photo> <data:image/png;hex,89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFEBFC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082> .
+
+
+

298. RMLTC0016e-SQLServer

+

Title: "Table with datatypes, binary column"

+

Description: "Tests the rr:termtype and datatype conversions: binary"

+

Error expected? No

+

Input

+
USE TestDB;
+DROP TABLE IF EXISTS Patient;
+
+CREATE TABLE Patient (
+ID INTEGER,
+FirstName VARCHAR(50),
+LastName VARCHAR(50),
+Sex VARCHAR(6),
+Weight REAL,
+Height FLOAT,
+BirthDate DATE,
+EntranceDate DATETIME,
+PaidInAdvance BIT,
+Photo VARBINARY(200),
+PRIMARY KEY (ID)
+);
+
+INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo)
+VALUES (10,'Monica','Geller','female',80.25,1.65,'1981-10-10','2009-10-10 12:12:22',0,
+CAST('89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFEBFC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082' as VARBINARY));
+
+INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo)
+VALUES (11,'Rachel','Green','female',70.22,1.70,'1982-11-12','2008-11-12 09:45:44',1,
+CAST('89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFF3FC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082' as VARBINARY));
+
+INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo)
+VALUES (12,'Chandler','Bing','male',90.31,1.76,'1978-04-06','2007-03-12 02:13:14',1,
+CAST('89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFEBFC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082' as VARBINARY));
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "Patient"
+    ];
+  rml:predicateObjectMap [
+      rml:object foaf:Person;
+      rml:predicate rdf:type
+    ], [
+      rml:objectMap [
+          rml:template "data:image/png;hex,{Photo}"
+        ];
+      rml:predicate ex:photo
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Patient{ID}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
+  d2rq:password "YourSTRONG!Passw0rd;";
+  d2rq:username "sa" .
+
+

Output

+
<http://example.com/Patient10> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Patient10> <http://example.com/photo> <data:image/png;hex,89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFEBFC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082> .
+<http://example.com/Patient11> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Patient11> <http://example.com/photo> <data:image/png;hex,89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFF3FC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082> .
+<http://example.com/Patient12> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Patient12> <http://example.com/photo> <data:image/png;hex,89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFEBFC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082> .
+
+
+

299. RMLTC0019a-CSV

+

Title: "Generation of triples by using IRI value in columns"

+

Description: "Test the generation of triples by using IRI value in columns"

+

Error expected? No

+

Input

+
ID,FirstName,LastName
+10,http://example.com/ns#Jhon,Smith
+20,Carlos,Mendoza
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:referenceFormulation rml:CSV;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "persons.csv"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "FirstName"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:reference "FirstName"
+    ] .
+
+

Output

+
<http://example.com/ns#Jhon> <http://xmlns.com/foaf/0.1/name> "http://example.com/ns#Jhon" .
+<http://example.com/base/Carlos> <http://xmlns.com/foaf/0.1/name> "Carlos" .
+
+
+

300. RMLTC0019a-JSON

+

Title: "Generation of triples by using IRI value in columns"

+

Description: "Test the generation of triples by using IRI value in attributes"

+

Error expected? No

+

Input

+
{
+  "persons": [
+    {
+      "ID": 10,
+      "FirstName": "http://example.com/ns#Jhon",
+      "LastName": "Smith"
+    },
+    {
+      "ID": 20,
+      "FirstName": "Carlos",
+      "LastName": "Mendoza"
+    }
+  ]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.persons[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "persons.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.FirstName"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:reference "$.FirstName"
+    ] .
+
+

Output

+
<http://example.com/ns#Jhon> <http://xmlns.com/foaf/0.1/name> "http://example.com/ns#Jhon" .
+<http://example.com/base/Carlos> <http://xmlns.com/foaf/0.1/name> "Carlos" .
+
+
+

301. RMLTC0019a-MySQL

+

Title: "Generation of triples by using IRI value in columns"

+

Description: "Test the generation of triples by using IRI value in columns"

+

Error expected? No

+

Input

+
USE test;
+DROP TABLE IF EXISTS test.Employee;
+
+CREATE TABLE Employee (
+ID INTEGER,
+FirstName VARCHAR(50),
+LastName VARCHAR(50)
+);
+INSERT INTO Employee (ID,FirstName,LastName) VALUES (10,'http://example.com/ns#Jhon','Smith');
+INSERT INTO Employee (ID,FirstName,LastName) VALUES (20,'Carlos','Mendoza');
+INSERT INTO Employee (ID,FirstName,LastName) VALUES (30,'Juan Daniel','Crespo');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator """
+        SELECT ID, FirstName, LastName
+        FROM Employee
+        WHERE ID < 30
+     """;
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Query
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "FirstName"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:reference "FirstName"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
+  d2rq:password "";
+  d2rq:username "root" .
+
+

Output

+
<http://example.com/ns#Jhon> <http://xmlns.com/foaf/0.1/name> "http://example.com/ns#Jhon" .
+<http://example.com/base/Carlos> <http://xmlns.com/foaf/0.1/name> "Carlos" .
+
+
+

302. RMLTC0019a-PostgreSQL

+

Title: "Generation of triples by using IRI value in columns"

+

Description: "Test the generation of triples by using IRI value in columns"

+

Error expected? No

+

Input

+
DROP TABLE IF EXISTS Employee;
+
+CREATE TABLE Employee (
+ID INTEGER,
+FirstName VARCHAR(50),
+LastName VARCHAR(50)
+);
+INSERT INTO Employee (ID,FirstName,LastName) VALUES (10,'http://example.com/ns#Jhon','Smith');
+INSERT INTO Employee (ID,FirstName,LastName) VALUES (20,'Carlos','Mendoza');
+INSERT INTO Employee (ID,FirstName,LastName) VALUES (30,'Juan Daniel','Crespo');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator """
+        SELECT ID, FirstName, LastName
+        FROM Employee
+        WHERE ID < 30
+     """;
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Query
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "firstname"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:reference "firstname"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "org.postgresql.Driver";
+  d2rq:password "";
+  d2rq:username "postgres" .
+
+

Output

+
<http://example.com/ns#Jhon> <http://xmlns.com/foaf/0.1/name> "http://example.com/ns#Jhon" .
+<http://example.com/base/Carlos> <http://xmlns.com/foaf/0.1/name> "Carlos" .
+
+
+

303. RMLTC0019a-SQLServer

+

Title: "Generation of triples by using IRI value in columns"

+

Description: "Test the generation of triples by using IRI value in columns"

+

Error expected? No

+

Input

+
USE TestDB;
+DROP TABLE IF EXISTS Employee;
+
+CREATE TABLE Employee (
+ID INTEGER,
+FirstName VARCHAR(50),
+LastName VARCHAR(50)
+);
+INSERT INTO Employee (ID,FirstName,LastName) VALUES (10,'http://example.com/ns#Jhon','Smith');
+INSERT INTO Employee (ID,FirstName,LastName) VALUES (20,'Carlos','Mendoza');
+INSERT INTO Employee (ID,FirstName,LastName) VALUES (30,'Juan Daniel','Crespo');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator """
+        SELECT ID, FirstName, LastName
+        FROM Employee
+        WHERE ID < 30
+     """;
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Query
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "FirstName"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:reference "FirstName"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
+  d2rq:password "YourSTRONG!Passw0rd;";
+  d2rq:username "sa" .
+
+

Output

+
<http://example.com/ns#Jhon> <http://xmlns.com/foaf/0.1/name> "http://example.com/ns#Jhon" .
+<http://example.com/base/Carlos> <http://xmlns.com/foaf/0.1/name> "Carlos" .
+
+
+

304. RMLTC0019a-XML

+

Title: "Generation of triples by using IRI value in columns"

+

Description: "Test the generation of triples by using IRI value in elements"

+

Error expected? No

+

Input

+
<?xml version="1.0"?>
+
+<persons>
+    <person>
+        <ID>10</ID>
+        <FirstName>http://example.com/ns#Jhon</FirstName>
+        <LastName>Smith</LastName>
+    </person>
+    <person>
+        <ID>20</ID>
+        <FirstName>Carlos</FirstName>
+        <LastName>Mendoza</LastName>
+    </person>
+</persons>
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "/persons/person";
+      rml:referenceFormulation rml:XPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "persons.xml"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "FirstName"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:reference "FirstName"
+    ] .
+
+

Output

+
<http://example.com/ns#Jhon> <http://xmlns.com/foaf/0.1/name> "http://example.com/ns#Jhon" .
+<http://example.com/base/Carlos> <http://xmlns.com/foaf/0.1/name> "Carlos" .
+
+
+

305. RMLTC0019b-CSV

+

Title: "Generation of triples by using IRI value in columns, with data error"

+

Description: "Test the generation of triples by using IRI value in columns, conforming RML mapping with data error (and limited results)"

+

Error expected? Yes

+

Input

+
ID,FirstName,LastName
+10,http://example.com/ns#Jhon,Smith
+20,Carlos,Mendoza
+30,Juan Daniel,Crespo
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:referenceFormulation rml:CSV;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "persons.csv"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "FirstName"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:reference "FirstName"
+    ] .
+
+
+

306. RMLTC0019b-JSON

+

Title: "Generation of triples by using IRI value in columns, with data error"

+

Description: "Test the generation of triples by using IRI value in attributes, conforming RML mapping with data error (and limited results)"

+

Error expected? Yes

+

Input

+
{
+  "persons": [
+    {
+      "ID": 10,
+      "FirstName": "http://example.com/ns#Jhon",
+      "LastName": "Smith"
+    },
+    {
+      "ID": 20,
+      "FirstName": "Carlos",
+      "LastName": "Mendoza"
+    },
+    {
+      "ID": 30,
+      "FirstName": "Juan Daniel",
+      "LastName": "Crespo"
+    }
+  ]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.persons[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "persons.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.FirstName"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:reference "$.FirstName"
+    ] .
+
+
+

307. RMLTC0019b-MySQL

+

Title: "Generation of triples by using IRI value in columns, with data error"

+

Description: "Test the generation of triples by using IRI value in columns, conforming RML mapping with data error (and limited results)"

+

Error expected? Yes

+

Input

+
USE test;
+DROP TABLE IF EXISTS test.Employee;
+
+CREATE TABLE Employee (
+ID INTEGER,
+FirstName VARCHAR(50),
+LastName VARCHAR(50)
+);
+INSERT INTO Employee (ID,FirstName,LastName) VALUES (10,'http://example.com/ns#Jhon','Smith');
+INSERT INTO Employee (ID,FirstName,LastName) VALUES (20,'Carlos','Mendoza');
+INSERT INTO Employee (ID,FirstName,LastName) VALUES (30,'Juan Daniel','Crespo');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "Employee"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "FirstName"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:reference "FirstName"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
+  d2rq:password "";
+  d2rq:username "root" .
+
+
+

308. RMLTC0019b-PostgreSQL

+

Title: "Generation of triples by using IRI value in columns, with data error"

+

Description: "Test the generation of triples by using IRI value in columns, conforming RML mapping with data error (and limited results)"

+

Error expected? Yes

+

Input

+
DROP TABLE IF EXISTS Employee;
+
+CREATE TABLE Employee (
+ID INTEGER,
+FirstName VARCHAR(50),
+LastName VARCHAR(50)
+);
+INSERT INTO Employee (ID,FirstName,LastName) VALUES (10,'http://example.com/ns#Jhon','Smith');
+INSERT INTO Employee (ID,FirstName,LastName) VALUES (20,'Carlos','Mendoza');
+INSERT INTO Employee (ID,FirstName,LastName) VALUES (30,'Juan Daniel','Crespo');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "Employee"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "firstname"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:reference "firstname"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "org.postgresql.Driver";
+  d2rq:password "";
+  d2rq:username "postgres" .
+
+
+

309. RMLTC0019b-SQLServer

+

Title: "Generation of triples by using IRI value in columns, with data error"

+

Description: "Test the generation of triples by using IRI value in columns, conforming RML mapping with data error (and limited results)"

+

Error expected? Yes

+

Input

+
USE TestDB;
+DROP TABLE IF EXISTS Employee;
+
+CREATE TABLE Employee (
+ID INTEGER,
+FirstName VARCHAR(50),
+LastName VARCHAR(50)
+);
+INSERT INTO Employee (ID,FirstName,LastName) VALUES (10,'http://example.com/ns#Jhon','Smith');
+INSERT INTO Employee (ID,FirstName,LastName) VALUES (20,'Carlos','Mendoza');
+INSERT INTO Employee (ID,FirstName,LastName) VALUES (30,'Juan Daniel','Crespo');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "Employee"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "FirstName"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:reference "FirstName"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
+  d2rq:password "YourSTRONG!Passw0rd;";
+  d2rq:username "sa" .
+
+
+

310. RMLTC0019b-XML

+

Title: "Generation of triples by using IRI value in columns, with data error"

+

Description: "Test the generation of triples by using IRI value in elements, conforming RML mapping with data error (and limited results)"

+

Error expected? Yes

+

Input

+
<?xml version="1.0"?>
+
+<persons>
+    <person>
+        <ID>10</ID>
+        <FirstName>http://example.com/ns#Jhon</FirstName>
+        <LastName>Smith</LastName>
+    </person>
+    <person>
+        <ID>20</ID>
+        <FirstName>Carlos</FirstName>
+        <LastName>Mendoza</LastName>
+    </person>
+    <person>
+        <ID>30</ID>
+        <FirstName>Juan Daniel</FirstName>
+        <LastName>Crespo</LastName>
+    </person>
+</persons>
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "/persons/person";
+      rml:referenceFormulation rml:XPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "persons.xml"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "FirstName"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:reference "FirstName"
+    ] .
+
+
+

311. RMLTC0020a-CSV

+

Title: "Generation of triples by using IRI value in columns"

+

Description: "Test the generation of triples by using IRI value in columns"

+

Error expected? No

+

Input

+
Name
+http://example.com/company/Alice
+Bob
+Bob/Charles
+path/../Danny
+Emily Smith
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:referenceFormulation rml:CSV;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.csv"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:object foaf:Person;
+      rml:predicate rdf:type
+    ];
+  rml:subjectMap [
+      rml:template "{Name}";
+      rml:termType rml:IRI
+    ] .
+
+

Output

+
<http://example.com/base/http%3A%2F%2Fexample.com%2Fcompany%2FAlice> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/base/Bob> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/base/Bob%2FCharles> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/base/path%2F..%2FDanny> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/base/Emily%20Smith> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+
+
+

312. RMLTC0020a-JSON

+

Title: "Generation of triples by using IRI value in columns"

+

Description: "Test the generation of triples by using IRI value in attributes"

+

Error expected? No

+

Input

+
{
+  "students": [
+    {"Name": "http://example.com/company/Alice"},
+    {"Name": "Bob"},
+    {"Name": "Bob/Charles"},
+    {"Name": "path/../Danny"},
+    {"Name": "Emily Smith"}
+  ]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:object foaf:Person;
+      rml:predicate rdf:type
+    ];
+  rml:subjectMap [
+      rml:template "{$.Name}";
+      rml:termType rml:IRI
+    ] .
+
+

Output

+
<http://example.com/base/http%3A%2F%2Fexample.com%2Fcompany%2FAlice> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/base/Bob> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/base/Bob%2FCharles> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/base/path%2F..%2FDanny> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/base/Emily%20Smith> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+
+
+

313. RMLTC0020a-MySQL

+

Title: "Generation of triples by using IRI value in columns"

+

Description: "Test the generation of triples by using IRI value in columns"

+

Error expected? No

+

Input

+
USE test;
+DROP TABLE IF EXISTS test.Student_Sport;
+DROP TABLE IF EXISTS test.Student;
+
+CREATE TABLE Student (
+Name VARCHAR(50)
+);
+
+INSERT INTO Student (Name) VALUES ('http://example.com/company/Alice');
+INSERT INTO Student (Name) VALUES ('Bob');
+INSERT INTO Student (Name) VALUES ('Bob/Charles');
+INSERT INTO Student (Name) VALUES ('path/../Danny');
+INSERT INTO Student (Name) VALUES ('Emily Smith');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "Student"
+    ];
+  rml:predicateObjectMap [
+      rml:object foaf:Person;
+      rml:predicate rdf:type
+    ];
+  rml:subjectMap [
+      rml:template "{Name}";
+      rml:termType rml:IRI
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
+  d2rq:password "";
+  d2rq:username "root" .
+
+

Output

+
<http://example.com/base/http%3A%2F%2Fexample.com%2Fcompany%2FAlice> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/base/Bob> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/base/Bob%2FCharles> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/base/path%2F..%2FDanny> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/base/Emily%20Smith> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+
+
+

314. RMLTC0020a-PostgreSQL

+

Title: "Generation of triples by using IRI value in columns"

+

Description: "Test the generation of triples by using IRI value in columns"

+

Error expected? No

+

Input

+
DROP TABLE IF EXISTS Student;
+
+CREATE TABLE Student (
+Name VARCHAR(50)
+);
+
+INSERT INTO Student (Name) VALUES ('http://example.com/company/Alice');
+INSERT INTO Student (Name) VALUES ('Bob');
+INSERT INTO Student (Name) VALUES ('Bob/Charles');
+INSERT INTO Student (Name) VALUES ('path/../Danny');
+INSERT INTO Student (Name) VALUES ('Emily Smith');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "Student"
+    ];
+  rml:predicateObjectMap [
+      rml:object foaf:Person;
+      rml:predicate rdf:type
+    ];
+  rml:subjectMap [
+      rml:template "{name}";
+      rml:termType rml:IRI
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "org.postgresql.Driver";
+  d2rq:password "password";
+  d2rq:username "postgres" .
+
+

Output

+
<http://example.com/base/http%3A%2F%2Fexample.com%2Fcompany%2FAlice> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/base/Bob> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/base/Bob%2FCharles> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/base/path%2F..%2FDanny> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/base/Emily%20Smith> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+
+
+

315. RMLTC0020a-SQLServer

+

Title: "Generation of triples by using IRI value in columns"

+

Description: "Test the generation of triples by using IRI value in columns"

+

Error expected? No

+

Input

+
USE TestDB;
+DROP TABLE IF EXISTS Student;
+
+CREATE TABLE Student (
+Name VARCHAR(50)
+);
+
+INSERT INTO Student (Name) VALUES ('http://example.com/company/Alice');
+INSERT INTO Student (Name) VALUES ('Bob');
+INSERT INTO Student (Name) VALUES ('Bob/Charles');
+INSERT INTO Student (Name) VALUES ('path/../Danny');
+INSERT INTO Student (Name) VALUES ('Emily Smith');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "Student"
+    ];
+  rml:predicateObjectMap [
+      rml:object foaf:Person;
+      rml:predicate rdf:type
+    ];
+  rml:subjectMap [
+      rml:template "{Name}";
+      rml:termType rml:IRI
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
+  d2rq:password "YourSTRONG!Passw0rd;";
+  d2rq:username "sa" .
+
+

Output

+
<http://example.com/base/http%3A%2F%2Fexample.com%2Fcompany%2FAlice> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/base/Bob> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/base/Bob%2FCharles> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/base/path%2F..%2FDanny> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/base/Emily%20Smith> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+
+
+

316. RMLTC0020a-XML

+

Title: "Generation of triples by using IRI value in columns"

+

Description: "Test the generation of triples by using IRI value in elements"

+

Error expected? No

+

Input

+
<?xml version="1.0"?>
+
+<students>
+  <student><Name>http://example.com/company/Alice</Name></student>
+  <student><Name>Bob</Name></student>
+  <student><Name>Bob/Charles</Name></student>
+  <student><Name>path/../Danny</Name></student>
+  <student><Name>Emily Smith</Name></student>
+</students>
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "/students/student";
+      rml:referenceFormulation rml:XPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.xml"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:object foaf:Person;
+      rml:predicate rdf:type
+    ];
+  rml:subjectMap [
+      rml:template "{Name}";
+      rml:termType rml:IRI
+    ] .
+
+

Output

+
<http://example.com/base/http%3A%2F%2Fexample.com%2Fcompany%2FAlice> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/base/Bob> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/base/Bob%2FCharles> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/base/path%2F..%2FDanny> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/base/Emily%20Smith> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+
+
+

317. RMLTC0021a-CSV

+

Title: "Generation of triples referencing object map"

+

Description: "Tests the mapping specification referencing object map with same logical source and join condition"

+

Error expected? No

+

Input

+
ID,Name,Sport
+10,Venus Williams,Tennis
+20,Serena Williams,Tennis
+30,Loena Hendrickx,Figure skating
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/RefObjectMap1> a rml:RefObjectMap;
+  rml:joinCondition [
+      rml:child "Sport";
+      rml:parent "Sport"
+    ];
+  rml:parentTriplesMap <http://example.com/base/TriplesMap1> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:referenceFormulation rml:CSV;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.csv"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap <http://example.com/base/RefObjectMap1>;
+      rml:predicate ex:sameSportAs
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Student/{ID}/{Name}"
+    ] .
+
+

Output

+
<http://example.com/Student/10/Venus%20Williams> <http://example.com/sameSportAs> <http://example.com/Student/10/Venus%20Williams> . 
+<http://example.com/Student/10/Venus%20Williams> <http://example.com/sameSportAs> <http://example.com/Student/20/Serena%20Williams> . 
+<http://example.com/Student/20/Serena%20Williams> <http://example.com/sameSportAs> <http://example.com/Student/20/Serena%20Williams> . 
+<http://example.com/Student/20/Serena%20Williams> <http://example.com/sameSportAs> <http://example.com/Student/10/Venus%20Williams> . 
+<http://example.com/Student/30/Loena%20Hendrickx> <http://example.com/sameSportAs> <http://example.com/Student/30/Loena%20Hendrickx> . 
+
+
+
+
+

318. RMLTC0021a-JSON

+

Title: "Generation of triples referencing object map"

+

Description: "Tests the mapping specification referencing object map with same logical source and join condition"

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "Name":"Venus Williams",
+    "Sport": "Tennis"
+  }, {
+    "ID": 20,
+    "Name":"Serena Williams",
+    "Sport": "Tennis"
+  }, {
+    "ID": 30,
+    "Name":"Loena Hendrickx",
+    "Sport": "Figure skating"
+  }]
+}
+
+

Mapping

+
@prefix activity: <http://example.com/activity/> .
+@prefix ex: <http://example.com/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/RefObjectMap1> a rml:RefObjectMap;
+  rml:joinCondition [
+      rml:child "$.Sport";
+      rml:parent "$.Sport"
+    ];
+  rml:parentTriplesMap <http://example.com/base/TriplesMap1> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap <http://example.com/base/RefObjectMap1>;
+      rml:predicate ex:sameSportAs
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Student/{$.ID}/{$.Name}"
+    ] .
+
+

Output

+
<http://example.com/Student/10/Venus%20Williams> <http://example.com/sameSportAs> <http://example.com/Student/10/Venus%20Williams> . 
+<http://example.com/Student/10/Venus%20Williams> <http://example.com/sameSportAs> <http://example.com/Student/20/Serena%20Williams> . 
+<http://example.com/Student/20/Serena%20Williams> <http://example.com/sameSportAs> <http://example.com/Student/20/Serena%20Williams> . 
+<http://example.com/Student/20/Serena%20Williams> <http://example.com/sameSportAs> <http://example.com/Student/10/Venus%20Williams> . 
+<http://example.com/Student/30/Loena%20Hendrickx> <http://example.com/sameSportAs> <http://example.com/Student/30/Loena%20Hendrickx> . 
+
+
+
+
+

319. RMLTC0021a-MySQL

+

Title: "Generation of triples referencing object map"

+

Description: "Tests the mapping specification referencing object map with same logical source and join condition"

+

Error expected? No

+

Input

+
USE test;
+DROP TABLE IF EXISTS test.student;
+
+CREATE TABLE student (
+  ID INTEGER,
+  Name VARCHAR(50),
+  Sport VARCHAR(50)
+);
+INSERT INTO student values ('10', 'Venus Williams', 'Tennis');
+INSERT INTO student values ('20', 'Serena Williams', 'Tennis');
+INSERT INTO student values ('30', 'Loena Hendrickx', 'Figure skating');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
+  d2rq:password "";
+  d2rq:username "root" .
+
+<http://example.com/base/RefObjectMap1> a rml:RefObjectMap;
+  rml:joinCondition [
+      rml:child "Sport";
+      rml:parent "Sport"
+    ];
+  rml:parentTriplesMap <http://example.com/base/TriplesMap1> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "student"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap <http://example.com/base/RefObjectMap1>;
+      rml:predicate ex:sameSportAs
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Student/{ID}/{Name}"
+    ] .
+
+

Output

+
<http://example.com/Student/10/Venus%20Williams> <http://example.com/sameSportAs> <http://example.com/Student/10/Venus%20Williams> . 
+<http://example.com/Student/10/Venus%20Williams> <http://example.com/sameSportAs> <http://example.com/Student/20/Serena%20Williams> . 
+<http://example.com/Student/20/Serena%20Williams> <http://example.com/sameSportAs> <http://example.com/Student/20/Serena%20Williams> . 
+<http://example.com/Student/20/Serena%20Williams> <http://example.com/sameSportAs> <http://example.com/Student/10/Venus%20Williams> . 
+<http://example.com/Student/30/Loena%20Hendrickx> <http://example.com/sameSportAs> <http://example.com/Student/30/Loena%20Hendrickx> . 
+
+
+
+
+

320. RMLTC0021a-PostgreSQL

+

Title: "Generation of triples referencing object map"

+

Description: "Tests the mapping specification referencing object map with same logical source and join condition"

+

Error expected? No

+

Input

+
DROP TABLE IF EXISTS student;
+
+CREATE TABLE student (
+  "ID" INTEGER,
+  "Name" VARCHAR(50),
+  "Sport" VARCHAR(50)
+);
+INSERT INTO student values ('10', 'Venus Williams', 'Tennis');
+INSERT INTO student values ('20', 'Serena Williams', 'Tennis');
+INSERT INTO student values ('30', 'Loena Hendrickx', 'Figure skating');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "org.postgresql.Driver";
+  d2rq:password "";
+  d2rq:username "postgres" .
+
+<http://example.com/base/RefObjectMap1> a rml:RefObjectMap;
+  rml:joinCondition [
+      rml:child "Sport";
+      rml:parent "Sport"
+    ];
+  rml:parentTriplesMap <http://example.com/base/TriplesMap1> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "student"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap <http://example.com/base/RefObjectMap1>;
+      rml:predicate ex:sameSportAs
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Student/{ID}/{Name}"
+    ] .
+
+

Output

+
<http://example.com/Student/10/Venus%20Williams> <http://example.com/sameSportAs> <http://example.com/Student/10/Venus%20Williams> . 
+<http://example.com/Student/10/Venus%20Williams> <http://example.com/sameSportAs> <http://example.com/Student/20/Serena%20Williams> . 
+<http://example.com/Student/20/Serena%20Williams> <http://example.com/sameSportAs> <http://example.com/Student/20/Serena%20Williams> . 
+<http://example.com/Student/20/Serena%20Williams> <http://example.com/sameSportAs> <http://example.com/Student/10/Venus%20Williams> . 
+<http://example.com/Student/30/Loena%20Hendrickx> <http://example.com/sameSportAs> <http://example.com/Student/30/Loena%20Hendrickx> . 
+
+
+
+
+

321. RMLTC0021a-SPARQL

+

Title: "Generation of triples referencing object map"

+

Description: "Tests the mapping specification referencing object map with same logical source and join condition"

+

Error expected? No

+

Input

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix ns1: <http://example.com/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+
+[] ns1:plays [ a ns1:Sport ;
+            foaf:name "Tennis" ] ;
+    rdf:ID "10" ;
+    foaf:name "Venus Williams" .
+
+[] ns1:plays [ a ns1:Sport ;
+            foaf:name "Tennis" ] ;
+    rdf:ID "20" ;
+    foaf:name "Serena Williams" .
+
+[] ns1:plays [ a ns1:Sport ;
+            foaf:name "Figure skating" ] ;
+    rdf:ID "30" ;
+    foaf:name "Loena Hendrickx" .
+
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix sd: <http://www.w3.org/ns/sparql-service-description#> .
+
+ex:RefObjectMap1 a rml:RefObjectMap;
+  rml:joinCondition [
+      rml:child "Sport.value";
+      rml:parent "Sport.value"
+    ];
+  rml:parentTriplesMap ex:TriplesMap1 .
+
+ex:TriplesMap1 a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator """
+            PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
+            PREFIX foaf: <http://xmlns.com/foaf/0.1/>
+            PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
+            SELECT ?Name ?ID
+            WHERE {
+                ?x  foaf:name ?Name ;
+                    rdf:ID    ?ID ;
+            } """;
+      rml:referenceFormulation formats:SPARQL_Results_JSON;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path <http://example.com/base#InputSPARQL>
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap ex:RefObjectMap1;
+      rml:predicate ex:sameSportAs
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Student/{ID.value}/{Name.value}"
+    ] .
+
+<http://example.com/base#InputSPARQL> a sd:Service;
+  sd:endpoint <http://HOST:PORT/ds1/sparql>;
+  sd:supportedLanguage sd:SPARQL11Query .
+
+

Output

+
<http://example.com/Student/10/Venus%20Williams> <http://example.com/sameSportAs> <http://example.com/Student/10/Venus%20Williams> . 
+<http://example.com/Student/10/Venus%20Williams> <http://example.com/sameSportAs> <http://example.com/Student/20/Serena%20Williams> . 
+<http://example.com/Student/20/Serena%20Williams> <http://example.com/sameSportAs> <http://example.com/Student/20/Serena%20Williams> . 
+<http://example.com/Student/20/Serena%20Williams> <http://example.com/sameSportAs> <http://example.com/Student/10/Venus%20Williams> . 
+<http://example.com/Student/30/Loena%20Hendrickx> <http://example.com/sameSportAs> <http://example.com/Student/30/Loena%20Hendrickx> . 
+
+
+
+
+

322. RMLTC0021a-SQLServer

+

Title: "Generation of triples referencing object map"

+

Description: "Tests the mapping specification referencing object map with same logical source and join condition"

+

Error expected? No

+

Input

+
USE TestDB;
+DROP TABLE IF EXISTS student;
+CREATE TABLE student (
+  "ID" INTEGER,
+  "Name" VARCHAR(50),
+  "Sport" VARCHAR(50)
+);
+INSERT INTO student values ('10', 'Venus Williams', 'Tennis');
+INSERT INTO student values ('20', 'Serena Williams', 'Tennis');
+INSERT INTO student values ('30', 'Loena Hendrickx', 'Figure skating');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
+  d2rq:password "YourSTRONG!Passw0rd;";
+  d2rq:username "sa" .
+
+<http://example.com/base/RefObjectMap1> a rml:RefObjectMap;
+  rml:joinCondition [
+      rml:child "Sport";
+      rml:parent "Sport"
+    ];
+  rml:parentTriplesMap <http://example.com/base/TriplesMap1> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "student"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap <http://example.com/base/RefObjectMap1>;
+      rml:predicate ex:sameSportAs
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Student/{ID}/{Name}"
+    ] .
+
+

Output

+
<http://example.com/Student/10/Venus%20Williams> <http://example.com/sameSportAs> <http://example.com/Student/10/Venus%20Williams> . 
+<http://example.com/Student/10/Venus%20Williams> <http://example.com/sameSportAs> <http://example.com/Student/20/Serena%20Williams> . 
+<http://example.com/Student/20/Serena%20Williams> <http://example.com/sameSportAs> <http://example.com/Student/20/Serena%20Williams> . 
+<http://example.com/Student/20/Serena%20Williams> <http://example.com/sameSportAs> <http://example.com/Student/10/Venus%20Williams> . 
+<http://example.com/Student/30/Loena%20Hendrickx> <http://example.com/sameSportAs> <http://example.com/Student/30/Loena%20Hendrickx> . 
+
+
+
+
+

323. RMLTC0021a-XML

+

Title: "Generation of triples referencing object map"

+

Description: "Tests the mapping specification referencing object map with same logical source and join condition"

+

Error expected? No

+

Input

+
<?xml version="1.0"?>
+
+<students>
+  <student>
+    <ID>10</ID>
+    <Name>Venus Williams</Name>
+    <Sport>Tennis</Sport>
+  </student>
+  <student>
+    <ID>20</ID>
+    <Name>Serena Williams</Name>
+    <Sport>Tennis</Sport>
+  </student>
+  <student>
+    <ID>30</ID>
+    <Name>Loena Hendrickx</Name>
+    <Sport>Figure skating</Sport>
+  </student>
+</students>
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/RefObjectMap1> a rml:RefObjectMap;
+  rml:joinCondition [
+      rml:child "Sport";
+      rml:parent "Sport"
+    ];
+  rml:parentTriplesMap <http://example.com/base/TriplesMap1> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "/students/student";
+      rml:referenceFormulation rml:XPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.xml"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap <http://example.com/base/RefObjectMap1>;
+      rml:predicate ex:sameSportAs
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Student/{ID}/{Name}"
+    ] .
+
+

Output

+
<http://example.com/Student/10/Venus%20Williams> <http://example.com/sameSportAs> <http://example.com/Student/10/Venus%20Williams> . 
+<http://example.com/Student/10/Venus%20Williams> <http://example.com/sameSportAs> <http://example.com/Student/20/Serena%20Williams> . 
+<http://example.com/Student/20/Serena%20Williams> <http://example.com/sameSportAs> <http://example.com/Student/20/Serena%20Williams> . 
+<http://example.com/Student/20/Serena%20Williams> <http://example.com/sameSportAs> <http://example.com/Student/10/Venus%20Williams> . 
+<http://example.com/Student/30/Loena%20Hendrickx> <http://example.com/sameSportAs> <http://example.com/Student/30/Loena%20Hendrickx> . 
+
+
+
+
+

324. RMLTC0022a-CSV

+

Title: "Generating of triples with constant datatype"

+

Description: "Test triples with a fixed constant datatype"

+

Error expected? No

+

Input

+
Name,Age
+Venus,21
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:referenceFormulation rml:CSV;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.csv"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:datatype xsd:string;
+          rml:reference "Name"
+        ];
+      rml:predicate foaf:name
+    ], [
+      rml:objectMap [
+          rml:datatype xsd:int;
+          rml:reference "Age"
+        ];
+      rml:predicate ex:age
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{Name}"
+    ] .
+
+

Output

+
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "Venus"^^<http://www.w3.org/2001/XMLSchema#string> .
+<http://example.com/Venus> <http://example.com/age> "21"^^<http://www.w3.org/2001/XMLSchema#int> .
+
+
+

325. RMLTC0022b-CSV

+

Title: "Generating of triples with datatypeMap"

+

Description: "Test triples with a XSD datatype generated from the data"

+

Error expected? No

+

Input

+
FOO,BAR
+1,string
+2,int
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:referenceFormulation rml:CSV;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "data.csv"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:datatypeMap [
+              rml:template "http://www.w3.org/2001/XMLSchema#{BAR}"
+            ];
+          rml:reference "FOO"
+        ];
+      rml:predicate ex:x
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{FOO}"
+    ] .
+
+

Output

+
<http://example.com/1> <http://example.com/x> "1"^^<http://www.w3.org/2001/XMLSchema#string> .
+<http://example.com/2> <http://example.com/x> "2"^^<http://www.w3.org/2001/XMLSchema#int> .
+
+
+

326. RMLTC0022c-CSV

+

Title: "Generating of triples with datatypeMap with custom datatype"

+

Description: "Test triples with a custom datype from the data"

+

Error expected? No

+

Input

+
FOO,BAR
+1,string
+2,int
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:referenceFormulation rml:CSV;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "data.csv"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:datatypeMap [
+              rml:template "datatype#{BAR}"
+            ];
+          rml:reference "FOO"
+        ];
+      rml:predicate ex:x
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{FOO}"
+    ] .
+
+

Output

+
<http://example.com/1> <http://example.com/x> "1"^^<http://example.com/base/datatype#string> .
+<http://example.com/2> <http://example.com/x> "2"^^<http://example.com/base/datatype#int> .
+
+
+

327. RMLTC0023a-XML

+

Title: "XML attributes selection"

+

Description: "Test generation of triples with selected XML attributes"

+

Error expected? No

+

Input

+
<?xml version="1.0"?>
+
+<persons>
+  <person fname="Bob" lname="Smith" amount="30.0E0">
+  </person>
+  <person fname="Sue" lname="Jones" amount="20.0E0">
+  </person>
+  <person fname="Bob" lname="Smith" amount="30.0E0">
+  </person>
+</persons>
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "/persons/person";
+      rml:referenceFormulation rml:XPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "ious.xml"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "@amount"
+        ];
+      rml:predicate ex:owes
+    ];
+  rml:subjectMap [
+      rml:class foaf:Person;
+      rml:template "http://example.com/{@fname};{@lname}"
+    ] .
+
+

Output

+
<http://example.com/Bob;Smith> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Bob;Smith> <http://example.com/owes> "30.0E0" .
+<http://example.com/Sue;Jones> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Sue;Jones> <http://example.com/owes> "20.0E0" .
+
+
+
+

328. RMLTC0024a-CSV

+

Title: "Invalid IRI template 1"

+

Description: "Test handling of invalid IRI template"

+

Error expected? Yes

+

Input

+
Name
+Venus
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:referenceFormulation rml:CSV;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.csv"
+        ]
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{NON_EXISTING_COLUMN}"
+      rml:class foaf:Person;
+    ] .
+
+
+

329. RMLTC0024b-CSV

+

Title: "Invalid IRI template 2"

+

Description: "Test handling of invalid IRI template"

+

Error expected? Yes

+

Input

+
{Name}
+Venus
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:referenceFormulation rml:CSV;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.csv"
+        ]
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{{Name}}"
+      rml:class foaf:Person;
+    ] .
+
+
+

330. RMLTC0024c-CSV

+

Title: "Invalid IRI template 3"

+

Description: "Test handling of invalid IRI template"

+

Error expected? Yes

+

Input

+
N\ame
+Venus
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:referenceFormulation rml:CSV;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.csv"
+        ]
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{N\ame}"
+      rml:class foaf:Person;
+    ] .
+
+
+

331. RMLTC0024d-CSV

+

Title: "Invalid IRI template 4"

+

Description: "Test handling of invalid IRI template"

+

Error expected? Yes

+

Input

+
Name
+Venus
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:referenceFormulation rml:CSV;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.csv"
+        ]
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{Name\}"
+      rml:class foaf:Person;
+    ] .
+
+
+

332. RMLTC0024e-CSV

+

Title: "Invalid IRI template 5"

+

Description: "Test handling of invalid IRI template"

+

Error expected? No

+

Input

+
{Name}
+Venus
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:referenceFormulation rml:CSV;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.csv"
+        ]
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{\\{Name\\}}";
+      rml:class foaf:Person;
+    ] .
+
+

Output

+
<http://example.com/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+
+
+
+

333. RMLTC0024f-CSV

+

Title: "Invalid IRI template 6"

+

Description: "Test handling of invalid IRI template"

+

Error expected? No

+

Input

+
N\ame
+Venus
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:referenceFormulation rml:CSV;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.csv"
+        ]
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{N\\\ame}";
+      rml:class foaf:Person;
+    ] .
+
+

Output

+
<http://example.com/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+
+
+
+ + + + + \ No newline at end of file diff --git a/src/test/resources/rml-core/docs/20250204/index.html b/src/test/resources/rml-core/docs/20250204/index.html new file mode 100644 index 00000000..8c6f0c29 --- /dev/null +++ b/src/test/resources/rml-core/docs/20250204/index.html @@ -0,0 +1,19356 @@ + + + + + + +RML-Core: Test Cases + + + + + + + + + + + + + + +
+ +

RML-Core: Test Cases

+

+ Draft Community Group Report + +

+
+ +
Latest published version:
+ https://www.w3.org/RML-Core-Testcases/ +
+
Latest editor's draft:
https://w3id.org/rml/core/test-cases/
+ + + + +
Editor:
+ Dylan Van Assche + + + + (IDLab – Ghent University – imec) +
+ +
Author:
+ Dylan Van Assche + + + + (IDLab – Ghent University – imec) +
+
Feedback:
+ GitHub kg-construct/rml-core + (pull requests, + new issue, + open issues) +
+ +
+ + +
+
+ + + +

Abstract

This document defines the RML-Core test cases to the determine the RML-Core specification conformance of tools.

+
+ +

Status of This Document

+ This specification was published by the + Knowledge Graph Construction Community Group. It is not a W3C Standard nor is it + on the W3C Standards Track. + + Please note that under the + W3C Community Contributor License Agreement (CLA) + there is a limited opt-out and other conditions apply. + + Learn more about + W3C Community and Business Groups. +

+ GitHub Issues are preferred for + discussion of this specification. + + +

+ +

1. Introduction

+

This document defines the RML-Core test cases, consisting of a collection of test case documents (input and expected output). +The purpose of the test cases is to determine the conformance of tools that execute RML rules to the RML-Core specification.

+
+ +

2. Data model

+

The test cases are semantically described for re-usability and shareability following the W3C Test case description. +Each test:Testcase as the following properties:

+
    +
  • dcterms:identifier: unique ID of the test case.
  • +
  • rmltest:hasError: if an error of the RML Processor is expected or not.
  • +
  • rmltest:input: One or more input data of the test case.
  • +
  • rmltest:output: One or more output data of the test case.
  • +
  • rmltest:inputFormat: the input data format.
  • +
  • rmltest:outputFormat: the output data format.
  • +
  • rmltest:mappingDocument: the RML mapping rules in Turtle.
  • +
+
+ +

3. Test cases

+

This section describes the RML-Core test cases. These descriptions are also available as RDF. +The files are available on GitHub in the folder test-cases. +Each test case is contained in a single folder, containing three types of files:

+
    +
  • Zero or more files containing the data sources, in the case of JSON, XML, CSV, or containing the SQL statements to create the necessary tables, in the case of MySQL, PostgreSQL, and SQL Server.
  • +
  • One file with the RML rules, called mapping.ttl, in the Turtle format.
  • +
  • Zero or more files with the expected RDF. No file is provided if an error is expected that must halt the generation of the RDF because of an error.
  • +
+
+ + +

4. RMLTC0000-CSV

+

Title: "one table, one column, zero rows"

+

Description: "Tests if an empty table produces an empty RDF graph"

+

Error expected? No

+

Input

+
Name
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:referenceFormulation rml:CSV;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.csv"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "Name"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{Name}"
+    ] .
+
+

Output

+
# empty database
+
+
+

5. RMLTC0000-JSON

+

Title: "one table, one column, zero rows"

+

Description: "Tests if an empty table produces an empty RDF graph"

+

Error expected? No

+

Input

+
{
+  "students": []
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.Name"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{$.Name}"
+    ] .
+
+

Output

+
# empty database
+
+
+

6. RMLTC0000-MySQL

+

Title: "one table, one column, zero rows"

+

Description: "Tests if an empty table produces an empty RDF graph"

+

Error expected? No

+

Input

+
USE test;
+DROP TABLE IF EXISTS test.student;
+CREATE TABLE student (
+  Name VARCHAR(50)
+);
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "student"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "Name"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{Name}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
+  d2rq:password "";
+  d2rq:username "root" .
+
+

Output

+
# empty database
+
+
+

7. RMLTC0000-PostgreSQL

+

Title: "one table, one column, zero rows"

+

Description: "Tests if an empty table produces an empty RDF graph"

+

Error expected? No

+

Input

+
DROP TABLE IF EXISTS student CASCADE ;
+CREATE TABLE student (
+  "Name" VARCHAR(50)
+);
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "student"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "Name"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{Name}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "org.postgresql.Driver";
+  d2rq:password "";
+  d2rq:username "postgres" .
+
+

Output

+
# empty database
+
+
+

8. RMLTC0000-SPARQL

+

Title: "Empty dataset"

+

Description: "Test if an empty dataset produces an empty RDF graph"

+

Error expected? No

+

Input

+

+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix sd: <http://www.w3.org/ns/sparql-service-description#> .
+
+<http://example.com/base#Country> rml:logicalSource [
+      rml:iterator """
+            PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
+            SELECT ?name
+            WHERE {
+                ?name a rdfs:Literal .
+            } """;
+      rml:referenceFormulation formats:SPARQL_Results_JSON;
+      rml:source <http://example.com/base#InputSPARQL>
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "name.value"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{name.value}"
+    ] .
+
+<http://example.com/base#InputSPARQL> a sd:Service;
+  sd:endpoint <http://HOST:PORT/ds1/sparql>;
+  sd:supportedLanguage sd:SPARQL11Query .
+
+

Output

+

+
+
+

9. RMLTC0000-SQLServer

+

Title: "one table, one column, zero rows"

+

Description: "Tests if an empty table produces an empty RDF graph"

+

Error expected? No

+

Input

+
USE TestDB;
+EXEC sp_msforeachtable 'ALTER TABLE ? NOCHECK CONSTRAINT all'
+EXEC sp_msforeachtable 'DROP TABLE ?'
+
+CREATE TABLE student (
+  "Name" VARCHAR(50)
+);
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "student"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "Name"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{Name}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
+  d2rq:password "YourSTRONG!Passw0rd;";
+  d2rq:username "sa" .
+
+

Output

+
# empty database
+
+
+

10. RMLTC0000-XML

+

Title: "one table, one column, zero rows"

+

Description: "Tests if an empty table produces an empty RDF graph"

+

Error expected? No

+

Input

+
<?xml version="1.0"?>
+
+<students>
+
+</students>
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "/students/student";
+      rml:referenceFormulation rml:XPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.xml"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "Name"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{Name}"
+    ] .
+
+

Output

+
# empty database
+
+
+

11. RMLTC0001a-CSV

+

Title: "One column mapping, subject URI generation by using rr:template"

+

Description: "Tests: (1) one column mapping; (2) subject URI generation by using rr:tmplate; (3) one column to one property"

+

Error expected? No

+

Input

+
Name
+Venus
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:referenceFormulation rml:CSV;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.csv"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "Name"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{Name}"
+    ] .
+
+

Output

+
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
+
+
+
+

12. RMLTC0001a-JSON

+

Title: "One column mapping, subject URI generation by using rr:template"

+

Description: "Tests: (1) one column mapping; (2) subject URI generation by using rr:tmplate; (3) one column to one property"

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "Name":"Venus"
+  }]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.Name"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap <http://example.com/base/#NameSubjectMap> .
+
+<http://example.com/base/#NameSubjectMap> rml:template "http://example.com/{$.Name}" .
+
+

Output

+
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
+
+
+
+

13. RMLTC0001a-MySQL

+

Title: "One column mapping, subject URI generation by using rr:template"

+

Description: "Tests: (1) one column mapping; (2) subject URI generation by using rr:tmplate; (3) one column to one property"

+

Error expected? No

+

Input

+
USE test;
+DROP TABLE IF EXISTS test.student;
+CREATE TABLE student (
+  Name VARCHAR(50)
+);
+INSERT INTO student values ('Venus');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "student"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "Name"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{Name}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
+  d2rq:password "";
+  d2rq:username "root" .
+
+

Output

+
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
+
+
+

14. RMLTC0001a-PostgreSQL

+

Title: "One column mapping, subject URI generation by using rr:template"

+

Description: "Tests: (1) one column mapping; (2) subject URI generation by using rr:tmplate; (3) one column to one property"

+

Error expected? No

+

Input

+
DROP TABLE IF EXISTS student CASCADE ;
+CREATE TABLE student (
+  "Name" VARCHAR(50)
+);
+INSERT INTO student values ('Venus');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "student"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "Name"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{Name}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "org.postgresql.Driver";
+  d2rq:password "";
+  d2rq:username "postgres" .
+
+

Output

+
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
+
+
+

15. RMLTC0001a-SPARQL

+

Title: "One tripple mapping, subject URI generation by using rr:template"

+

Description: "Tests: (1) one tripple mapping; (2) generation of a BlankNode subject by using rr:termType; (3) one tripple to one property"

+

Error expected? No

+

Input

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+
+[] foaf:name "Venus" .
+
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix sd: <http://www.w3.org/ns/sparql-service-description#> .
+
+<http://example.com/base#Country> rml:logicalSource [
+      rml:iterator """
+            PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
+            PREFIX foaf: <http://xmlns.com/foaf/0.1/>
+            SELECT ?name
+            WHERE {
+                ?x foaf:name ?name .
+            } """;
+      rml:referenceFormulation formats:SPARQL_Results_JSON;
+      rml:source <http://example.com/base#InputSPARQL>
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "name.value"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{name.value}"
+    ] .
+
+<http://example.com/base#InputSPARQL> a sd:Service;
+  sd:endpoint <http://HOST:PORT/ds1/sparql>;
+  sd:supportedLanguage sd:SPARQL11Query .
+
+

Output

+
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
+
+
+

16. RMLTC0001a-SQLServer

+

Title: "One column mapping, subject URI generation by using rr:template"

+

Description: "Tests: (1) one column mapping; (2) subject URI generation by using rr:tmplate; (3) one column to one property"

+

Error expected? No

+

Input

+
USE TestDB;
+EXEC sp_msforeachtable 'ALTER TABLE ? NOCHECK CONSTRAINT all'
+EXEC sp_msforeachtable 'DROP TABLE ?'
+
+CREATE TABLE student (
+  "Name" VARCHAR(50)
+);
+INSERT INTO student values ('Venus');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "student"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "Name"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{Name}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
+  d2rq:password "YourSTRONG!Passw0rd;";
+  d2rq:username "sa" .
+
+

Output

+
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
+
+
+

17. RMLTC0001a-XML

+

Title: "One column mapping, subject URI generation by using rr:template"

+

Description: "Tests: (1) one column mapping; (2) subject URI generation by using rr:tmplate; (3) one column to one property"

+

Error expected? No

+

Input

+
<?xml version="1.0"?>
+
+<students>
+  <student>
+    <Name>Venus</Name>
+  </student>
+</students>
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "/students/student";
+      rml:referenceFormulation rml:XPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.xml"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "Name"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{Name}"
+    ] .
+
+

Output

+
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
+
+
+
+

18. RMLTC0001b-CSV

+

Title: "One column mapping, generation of a BlankNode subject by using rr:termType"

+

Description: "Tests: (1) one column mapping; (2) generation of a BlankNode subject by using rr:termType; (3) one column to one property"

+

Error expected? No

+

Input

+
Name
+Venus
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:referenceFormulation rml:CSV;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.csv"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "Name"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "{Name}";
+      rml:termType rml:BlankNode
+    ] .
+
+

Output

+
_:Venus <http://xmlns.com/foaf/0.1/name> "Venus" .
+
+
+
+

19. RMLTC0001b-JSON

+

Title: "One column mapping, generation of a BlankNode subject by using rr:termType"

+

Description: "Tests: (1) one column mapping; (2) generation of a BlankNode subject by using rr:termType; (3) one column to one property"

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "Name":"Venus"
+  }]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.Name"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "{$.Name}";
+      rml:termType rml:BlankNode
+    ] .
+
+

Output

+
_:Venus <http://xmlns.com/foaf/0.1/name> "Venus" .
+
+
+
+

20. RMLTC0001b-MySQL

+

Title: "One column mapping, generation of a BlankNode subject by using rr:termType"

+

Description: "Tests: (1) one column mapping; (2) generation of a BlankNode subject by using rr:termType; (3) one column to one property"

+

Error expected? No

+

Input

+
USE test;
+DROP TABLE IF EXISTS test.student;
+CREATE TABLE student (
+  Name VARCHAR(50)
+);
+INSERT INTO student values ('Venus');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "SELECT Name FROM student";
+      rml:referenceFormulation rml:SQL2008Query;
+      rml:source <http://example.com/base/#DB_source>
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "Name"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{Name}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
+  d2rq:password "";
+  d2rq:username "root" .
+
+

Output

+
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
+
+
+

21. RMLTC0001b-PostgreSQL

+

Title: "One column mapping, generation of a BlankNode subject by using rr:termType"

+

Description: "Tests: (1) one column mapping; (2) generation of a BlankNode subject by using rr:termType; (3) one column to one property"

+

Error expected? No

+

Input

+
DROP TABLE IF EXISTS student CASCADE ;
+CREATE TABLE student (
+  name VARCHAR(50)
+);
+INSERT INTO student values ('Venus');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "SELECT Name FROM student";
+      rml:referenceFormulation rml:SQL2008Query;
+      rml:source <http://example.com/base/#DB_source>
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "name"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{name}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "org.postgresql.Driver";
+  d2rq:password "";
+  d2rq:username "postgres" .
+
+

Output

+
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
+
+
+

22. RMLTC0001b-SPARQL

+

Title: "One tripple mapping, generation of a BlankNode subject by using rr:termType"

+

Description: "Tests: (1) one tripple mapping; (2) generation of a BlankNode subject by using rr:termType; (3) one tripple to one property"

+

Error expected? No

+

Input

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+
+[] foaf:name "Venus" .
+
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix sd: <http://www.w3.org/ns/sparql-service-description#> .
+
+<http://example.com/base#Country> rml:logicalSource [
+      rml:iterator """
+            PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
+            PREFIX foaf: <http://xmlns.com/foaf/0.1/>
+            SELECT ?name
+            WHERE {
+                ?x foaf:name ?name .
+            } """;
+      rml:referenceFormulation formats:SPARQL_Results_JSON;
+      rml:source <http://example.com/base#InputSPARQL>
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "name.value"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{name.value}"
+    ] .
+
+<http://example.com/base#InputSPARQL> a sd:Service;
+  sd:endpoint <http://HOST:PORT/ds1/sparql>;
+  sd:supportedLanguage sd:SPARQL11Query .
+
+

Output

+
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
+
+
+

23. RMLTC0001b-SQLServer

+

Title: "One column mapping, generation of a BlankNode subject by using rr:termType"

+

Description: "Tests: (1) one column mapping; (2) generation of a BlankNode subject by using rr:termType; (3) one column to one property"

+

Error expected? No

+

Input

+
USE TestDB;
+EXEC sp_msforeachtable 'ALTER TABLE ? NOCHECK CONSTRAINT all'
+EXEC sp_msforeachtable 'DROP TABLE ?'
+
+CREATE TABLE student (
+  "Name" VARCHAR(50)
+);
+INSERT INTO student values ('Venus');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "SELECT Name FROM student";
+      rml:referenceFormulation rml:SQL2008Query;
+      rml:source <http://example.com/base/#DB_source>
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "Name"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{Name}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
+  d2rq:password "YourSTRONG!Passw0rd;";
+  d2rq:username "sa" .
+
+

Output

+
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
+
+
+

24. RMLTC0001b-XML

+

Title: "One column mapping, generation of a BlankNode subject by using rr:termType"

+

Description: "Tests: (1) one column mapping; (2) generation of a BlankNode subject by using rr:termType; (3) one column to one property"

+

Error expected? No

+

Input

+
<?xml version="1.0"?>
+
+<students>
+  <student>
+    <Name>Venus</Name>
+  </student>
+</students>
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "/students/student";
+      rml:referenceFormulation rml:XPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.xml"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "Name"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "{Name}";
+      rml:termType rml:BlankNode
+    ] .
+
+

Output

+
_:Venus <http://xmlns.com/foaf/0.1/name> "Venus" .
+
+
+
+

25. RMLTC0002a-CSV

+

Title: "Two columns mapping, generation of a subject URI by the concatenation of two column values"

+

Description: "Tests: (1) two column mapping, no primary key; (2) subject URI generated by the concatenation of two column values; (3) one column to one property"

+

Error expected? No

+

Input

+
ID,Name
+10,Venus
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:referenceFormulation rml:CSV;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.csv"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "ID"
+        ];
+      rml:predicate ex:id
+    ], [
+      rml:objectMap [
+          rml:reference "Name"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:class foaf:Person;
+      rml:template "http://example.com/{ID}/{Name}"
+    ] .
+
+

Output

+
<http://example.com/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
+<http://example.com/10/Venus> <http://example.com/id> "10" .
+<http://example.com/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+
+
+
+

26. RMLTC0002a-JSON

+

Title: "Two columns mapping, generation of a subject URI by the concatenation of two column values"

+

Description: "Tests: (1) two column mapping, no primary key; (2) subject URI generated by the concatenation of two column values; (3) one column to one property"

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "Name":"Venus"
+  }]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.ID"
+        ];
+      rml:predicate ex:id
+    ], [
+      rml:objectMap [
+          rml:reference "$.Name"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:class foaf:Person;
+      rml:template "http://example.com/{$.ID}/{$.Name}"
+    ] .
+
+

Output

+
<http://example.com/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
+<http://example.com/10/Venus> <http://example.com/id> "10" .
+<http://example.com/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+
+
+
+

27. RMLTC0002a-MySQL

+

Title: "Two columns mapping, generation of a subject URI by the concatenation of two column values"

+

Description: "Tests: (1) two column mapping, no primary key; (2) subject URI generated by the concatenation of two column values; (3) one column to one property"

+

Error expected? No

+

Input

+
USE test;
+DROP TABLE IF EXISTS test.student;
+CREATE TABLE student (
+  ID INTEGER,
+  Name VARCHAR(50)
+);
+INSERT INTO student values ('10', 'Venus');
+
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:source <http://example.com/base/#DB_source>;
+      rml:iterator "student"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "ID"
+        ];
+      rml:predicate ex:id
+    ], [
+      rml:objectMap [
+          rml:reference "Name"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:class foaf:Person;
+      rml:template "http://example.com/{ID}/{Name}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
+  d2rq:password "";
+  d2rq:username "root" .
+
+

Output

+
<http://example.com/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
+<http://example.com/10/Venus> <http://example.com/id> "10"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.com/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+
+
+

28. RMLTC0002a-PostgreSQL

+

Title: "Two columns mapping, generation of a subject URI by the concatenation of two column values"

+

Description: "Tests: (1) two column mapping, no primary key; (2) subject URI generated by the concatenation of two column values; (3) one column to one property"

+

Error expected? No

+

Input

+
DROP TABLE IF EXISTS student CASCADE ;
+CREATE TABLE student (
+  "ID" INTEGER,
+  "Name" VARCHAR(50)
+);
+INSERT INTO student values ('10', 'Venus');
+
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:source <http://example.com/base/#DB_source>;
+      rml:iterator "student"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "ID"
+        ];
+      rml:predicate ex:id
+    ], [
+      rml:objectMap [
+          rml:reference "Name"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:class foaf:Person;
+      rml:template "http://example.com/{ID}/{Name}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "org.postgresql.Driver";
+  d2rq:password "";
+  d2rq:username "postgres" .
+
+

Output

+
<http://example.com/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
+<http://example.com/10/Venus> <http://example.com/id> "10"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.com/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+
+
+

29. RMLTC0002a-SPARQL

+

Title: "Two tripples mapping, generation of a subject URI by the concatenation of two column values"

+

Description: "Tests: (1) two tripple mapping, no primary key; (2) subject URI generated by the concatenation of two tripple object values; (3) one tripple object to one property"

+

Error expected? No

+

Input

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+
+[] rdf:ID "10" ;
+    foaf:name "Venus" .
+
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix sd: <http://www.w3.org/ns/sparql-service-description#> .
+
+<http://example.com/base#Country> rml:logicalSource [
+      rml:iterator """
+            PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
+            PREFIX foaf: <http://xmlns.com/foaf/0.1/>
+            PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
+            SELECT ?Name ?ID
+            WHERE {
+                ?x foaf:name ?Name ;
+                   rdf:ID ?ID .
+            } """;
+      rml:referenceFormulation formats:SPARQL_Results_JSON;
+      rml:source <http://example.com/base#InputSPARQL>
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "ID.value"
+        ];
+      rml:predicate ex:id
+    ], [
+      rml:objectMap [
+          rml:reference "Name.value"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:class foaf:Person;
+      rml:template "http://example.com/{ID.value}/{Name.value}"
+    ] .
+
+<http://example.com/base#InputSPARQL> a sd:Service;
+  sd:endpoint <http://HOST:PORT/ds1/sparql>;
+  sd:supportedLanguage sd:SPARQL11Query .
+
+

Output

+
<http://example.com/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
+<http://example.com/10/Venus> <http://example.com/id> "10" .
+<http://example.com/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+
+
+

30. RMLTC0002a-SQLServer

+

Title: "Two columns mapping, generation of a subject URI by the concatenation of two column values"

+

Description: "Tests: (1) two column mapping, no primary key; (2) subject URI generated by the concatenation of two column values; (3) one column to one property"

+

Error expected? No

+

Input

+
USE TestDB;
+EXEC sp_msforeachtable 'ALTER TABLE ? NOCHECK CONSTRAINT all'
+EXEC sp_msforeachtable 'DROP TABLE ?'
+
+CREATE TABLE student (
+  "ID" INTEGER,
+  "Name" VARCHAR(50)
+);
+INSERT INTO student ("ID", "Name") values (10, 'Venus');
+
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:source <http://example.com/base/#DB_source>;
+      rml:iterator "student"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "ID"
+        ];
+      rml:predicate ex:id
+    ], [
+      rml:objectMap [
+          rml:reference "Name"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:class foaf:Person;
+      rml:template "http://example.com/{ID}/{Name}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
+  d2rq:password "YourSTRONG!Passw0rd;";
+  d2rq:username "sa" .
+
+

Output

+
<http://example.com/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
+<http://example.com/10/Venus> <http://example.com/id> "10"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.com/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+
+
+

31. RMLTC0002a-XML

+

Title: "Two columns mapping, generation of a subject URI by the concatenation of two column values"

+

Description: "Tests: (1) two column mapping, no primary key; (2) subject URI generated by the concatenation of two column values; (3) one column to one property"

+

Error expected? No

+

Input

+
<?xml version="1.0"?>
+
+<students>
+  <student>
+    <ID>10</ID>
+    <Name>Venus</Name>
+  </student>
+</students>
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "/students/student";
+      rml:referenceFormulation rml:XPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.xml"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "ID"
+        ];
+      rml:predicate ex:id
+    ], [
+      rml:objectMap [
+          rml:reference "Name"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:class foaf:Person;
+      rml:template "http://example.com/{ID}/{Name}"
+    ] .
+
+

Output

+
<http://example.com/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
+<http://example.com/10/Venus> <http://example.com/id> "10".
+<http://example.com/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+
+
+
+

32. RMLTC0002b-CSV

+

Title: "Two columns mapping, generation of a BlankNode subject by using rr:template and rr:termType"

+

Description: "Tests: (1) two column mapping, no primary key; (2) generation of a BlankNode subject by using rr:template; (3) one column to one property"

+

Error expected? No

+

Input

+
ID,Name
+10,Venus
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:referenceFormulation rml:CSV;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.csv"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "Name"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "students{ID}";
+      rml:termType rml:BlankNode
+    ] .
+
+

Output

+
_:students10 <http://xmlns.com/foaf/0.1/name> "Venus" .
+
+
+
+

33. RMLTC0002b-JSON

+

Title: "Two columns mapping, generation of a BlankNode subject by using rr:template and rr:termType"

+

Description: "Tests: (1) two column mapping, no primary key; (2) generation of a BlankNode subject by using rr:template; (3) one column to one property"

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "Name":"Venus"
+  }]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.Name"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "students{$.ID}";
+      rml:termType rml:BlankNode
+    ] .
+
+

Output

+
_:students10 <http://xmlns.com/foaf/0.1/name> "Venus" .
+
+
+
+

34. RMLTC0002b-MySQL

+

Title: "Two columns mapping, generation of a BlankNode subject by using rr:template and rr:termType"

+

Description: "Tests: (1) two column mapping, no primary key; (2) generation of a BlankNode subject by using rr:template; (3) one column to one property"

+

Error expected? No

+

Input

+
USE test;
+DROP TABLE IF EXISTS test.student;
+CREATE TABLE student (
+  ID INTEGER,
+  Name VARCHAR(50)
+);
+INSERT INTO student values ('10', 'Venus');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:source <http://example.com/base/#DB_source>;
+      rml:iterator "student"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "Name"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "students{ID}";
+      rml:termType rml:BlankNode
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
+  d2rq:password "";
+  d2rq:username "root" .
+
+

Output

+
_:students10 <http://xmlns.com/foaf/0.1/name> "Venus" .
+
+
+
+

35. RMLTC0002b-PostgreSQL

+

Title: "Two columns mapping, generation of a BlankNode subject by using rr:template and rr:termType"

+

Description: "Tests: (1) two column mapping, no primary key; (2) generation of a BlankNode subject by using rr:template; (3) one column to one property"

+

Error expected? No

+

Input

+
DROP TABLE IF EXISTS student CASCADE ;
+CREATE TABLE student (
+  "ID" INTEGER,
+  "Name" VARCHAR(50)
+);
+INSERT INTO student values ('10', 'Venus');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:source <http://example.com/base/#DB_source>;
+      rml:iterator "student"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "Name"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "students{ID}";
+      rml:termType rml:BlankNode
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "org.postgresql.Driver";
+  d2rq:password "";
+  d2rq:username "postgres" .
+
+

Output

+
_:students10 <http://xmlns.com/foaf/0.1/name> "Venus" .
+
+
+

36. RMLTC0002b-SPARQL

+

Title: "Two tripples maping, generation of a BlankNode subject by using rr:template and rr:termType"

+

Description: "Tests: (1) two tripple mapping, no primary key; (2) generation of a BlankNode subject by using rr:template; (3) one triple to one property"

+

Error expected? No

+

Input

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+
+[] rdf:ID "10" ;
+    foaf:name "Venus" .
+
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix sd: <http://www.w3.org/ns/sparql-service-description#> .
+
+<http://example.com/base#Country> rml:logicalSource [
+      rml:iterator """
+            PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
+            PREFIX foaf: <http://xmlns.com/foaf/0.1/>
+            PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
+            SELECT ?Name ?ID
+            WHERE {
+                ?x foaf:name ?Name ;
+                   rdf:ID ?ID .
+            } """;
+      rml:referenceFormulation formats:SPARQL_Results_JSON;
+      rml:source <http://example.com/base#InputSPARQL>
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "Name.value"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "students{ID.value}";
+      rml:termType rml:BlankNode
+    ] .
+
+<http://example.com/base#InputSPARQL> a sd:Service;
+  sd:endpoint <http://HOST:PORT/ds1/sparql>;
+  sd:supportedLanguage sd:SPARQL11Query .
+
+

Output

+
_:students10 <http://xmlns.com/foaf/0.1/name> "Venus" .
+
+
+

37. RMLTC0002b-SQLServer

+

Title: "Two columns mapping, generation of a BlankNode subject by using rr:template and rr:termType"

+

Description: "Tests: (1) two column mapping, no primary key; (2) generation of a BlankNode subject by using rr:template; (3) one column to one property"

+

Error expected? No

+

Input

+
USE TestDB;
+EXEC sp_msforeachtable 'ALTER TABLE ? NOCHECK CONSTRAINT all'
+EXEC sp_msforeachtable 'DROP TABLE ?'
+
+CREATE TABLE student (
+  "ID" INTEGER,
+  "Name" VARCHAR(50)
+);
+INSERT INTO student values ('10', 'Venus');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:source <http://example.com/base/#DB_source>;
+      rml:iterator "student"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "Name"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "students{ID}";
+      rml:termType rml:BlankNode
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
+  d2rq:password "YourSTRONG!Passw0rd;";
+  d2rq:username "sa" .
+
+

Output

+
_:students10 <http://xmlns.com/foaf/0.1/name> "Venus" .
+
+
+
+

38. RMLTC0002b-XML

+

Title: "Two columns mapping, generation of a BlankNode subject by using rr:template and rr:termType"

+

Description: "Tests: (1) two column mapping, no primary key; (2) generation of a BlankNode subject by using rr:template; (3) one column to one property"

+

Error expected? No

+

Input

+
<?xml version="1.0"?>
+
+<students>
+  <student>
+    <ID>10</ID>
+    <Name>Venus</Name>
+  </student>
+</students>
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "/students/student";
+      rml:referenceFormulation rml:XPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.xml"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "Name"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "students{ID}";
+      rml:termType rml:BlankNode
+    ] .
+
+

Output

+
_:students10 <http://xmlns.com/foaf/0.1/name> "Venus" .
+
+
+
+

39. RMLTC0002c-CSV

+

Title: "Two columns mapping, an undefined SQL identifier / logical reference"

+

Description: "Tests the presence of an undefined SQL identifier / logical reference"

+

Error expected? Yes

+

Input

+
ID,Name
+10,Venus
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:referenceFormulation rml:CSV;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.csv"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "IDs"
+        ];
+      rml:predicate ex:id
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{ID}/{Name}"
+    ] .
+
+
+

40. RMLTC0002c-MySQL

+

Title: "Two columns mapping, an undefined SQL identifier / logical reference"

+

Description: "Tests the presence of an undefined SQL identifier / logical reference"

+

Error expected? Yes

+

Input

+
USE test;
+DROP TABLE IF EXISTS test.student;
+CREATE TABLE student (
+  ID INTEGER,
+  Name VARCHAR(50)
+);
+INSERT INTO student values ('10', 'Venus');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:source <http://example.com/base/#DB_source>;
+      rml:iterator "student"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "IDs"
+        ];
+      rml:predicate ex:id
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{ID}/{Name}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
+  d2rq:password "";
+  d2rq:username "root" .
+
+
+

41. RMLTC0002c-PostgreSQL

+

Title: "Two columns mapping, an undefined SQL identifier / logical reference"

+

Description: "Tests the presence of an undefined SQL identifier / logical reference"

+

Error expected? Yes

+

Input

+
DROP TABLE IF EXISTS student CASCADE ;
+CREATE TABLE student (
+  "ID" INTEGER,
+  "Name" VARCHAR(50)
+);
+INSERT INTO student values ('10', 'Venus');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:source <http://example.com/base/#DB_source>;
+      rml:iterator "student"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "IDs"
+        ];
+      rml:predicate ex:id
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{ID}/{Name}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "org.postgresql.Driver";
+  d2rq:password "";
+  d2rq:username "postgres" .
+
+
+

42. RMLTC0002c-SQLServer

+

Title: "Two columns mapping, an undefined SQL identifier / logical reference"

+

Description: "Tests the presence of an undefined SQL identifier / logical reference"

+

Error expected? Yes

+

Input

+
USE TestDB;
+EXEC sp_msforeachtable 'ALTER TABLE ? NOCHECK CONSTRAINT all'
+EXEC sp_msforeachtable 'DROP TABLE ?'
+
+CREATE TABLE student (
+  "ID" INTEGER,
+  "Name" VARCHAR(50)
+);
+INSERT INTO student values ('10', 'Venus');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:source <http://example.com/base/#DB_source>;
+      rml:iterator "student"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "IDs"
+        ];
+      rml:predicate ex:id
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{ID}/{Name}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
+  d2rq:password "YourSTRONG!Passw0rd;";
+  d2rq:username "sa" .
+
+
+

43. RMLTC0002d-MySQL

+

Title: "Two columns mapping, generation of a BlankNode subject by using a SQL Query that concatenates two columns"

+

Description: "Tests (1) two column mapping, no primary key; (2) generation of a BlankNode subject by using a SQL Query that concatenates two columns; (3) one column to one property"

+

Error expected? No

+

Input

+
USE test;
+DROP TABLE IF EXISTS test.student;
+CREATE TABLE student (
+  ID INTEGER,
+  Name VARCHAR(50)
+);
+INSERT INTO student values ('10', 'Venus');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "SELECT CONCAT('Student', ID) AS StudentId, ID, Name FROM student";
+      rml:referenceFormulation rml:SQL2008Query;
+      rml:source <http://example.com/base/#DB_source>
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "Name"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:reference "StudentId";
+      rml:termType rml:BlankNode
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
+  d2rq:password "";
+  d2rq:username "root" .
+
+

Output

+
_:Student10 <http://xmlns.com/foaf/0.1/name> "Venus".
+
+
+

44. RMLTC0002d-PostgreSQL

+

Title: "Two columns mapping, generation of a BlankNode subject by using a SQL Query that concatenates two columns"

+

Description: "Tests (1) two column mapping, no primary key; (2) generation of a BlankNode subject by using a SQL Query that concatenates two columns; (3) one column to one property"

+

Error expected? No

+

Input

+
DROP TABLE IF EXISTS student CASCADE ;
+CREATE TABLE student (
+  ID INTEGER,
+  Name VARCHAR(50)
+);
+INSERT INTO student values ('10', 'Venus');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "SELECT ('Student' || ID) AS StudentId, ID, Name FROM student";
+      rml:referenceFormulation rml:SQL2008Query;
+      rml:source <http://example.com/base/#DB_source>
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "name"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:reference "studentid";
+      rml:termType rml:BlankNode
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "org.postgresql.Driver";
+  d2rq:password "";
+  d2rq:username "postgres" .
+
+

Output

+
_:Student10 <http://xmlns.com/foaf/0.1/name> "Venus".
+
+
+

45. RMLTC0002d-SQLServer

+

Title: "Two columns mapping, generation of a BlankNode subject by using a SQL Query that concatenates two columns"

+

Description: "Tests (1) two column mapping, no primary key; (2) generation of a BlankNode subject by using a SQL Query that concatenates two columns; (3) one column to one property"

+

Error expected? No

+

Input

+
USE TestDB;
+EXEC sp_msforeachtable 'ALTER TABLE ? NOCHECK CONSTRAINT all'
+EXEC sp_msforeachtable 'DROP TABLE ?'
+
+CREATE TABLE student (
+  ID INTEGER,
+  Name VARCHAR(50)
+);
+INSERT INTO student values ('10', 'Venus');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "SELECT CONCAT('Student', ID) AS StudentId, ID, Name FROM student";
+      rml:referenceFormulation rml:SQL2008Query;
+      rml:source <http://example.com/base/#DB_source>
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "Name"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:reference "StudentId";
+      rml:termType rml:BlankNode
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
+  d2rq:password "YourSTRONG!Passw0rd;";
+  d2rq:username "sa" .
+
+

Output

+
_:Student10 <http://xmlns.com/foaf/0.1/name> "Venus".
+
+
+

46. RMLTC0002e-CSV

+

Title: "Two columns mapping, an undefined rr:tableName"

+

Description: "Tests the presence of an undefined rr:tableName"

+

Error expected? Yes

+

Input

+
ID,Name
+10,Venus
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:referenceFormulation rml:CSV;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student2.csv"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "IDs"
+        ];
+      rml:predicate ex:id
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{ID}/{Name}"
+    ] .
+
+
+

47. RMLTC0002e-JSON

+

Title: "Two columns mapping, an undefined rr:tableName"

+

Description: "Tests the presence of an undefined rr:tableName"

+

Error expected? Yes

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "Name":"Venus"
+  }]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student2.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.IDs"
+        ];
+      rml:predicate ex:id
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{$.ID}/{$.Name}"
+    ] .
+
+
+

48. RMLTC0002e-MySQL

+

Title: "Two columns mapping, an undefined rr:tableName"

+

Description: "Tests the presence of an undefined rr:tableName"

+

Error expected? Yes

+

Input

+
USE test;
+DROP TABLE IF EXISTS test.student;
+CREATE TABLE student (
+  ID INTEGER,
+  Name VARCHAR(50)
+);
+INSERT INTO student values ('10', 'Venus');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:source <http://example.com/base/#DB_source>;
+      rml:iterator "\"Students\""
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "IDs"
+        ];
+      rml:predicate ex:id
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{ID}/{Name}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
+  d2rq:password "";
+  d2rq:username "root" .
+
+
+

49. RMLTC0002e-PostgreSQL

+

Title: "Two columns mapping, an undefined rr:tableName"

+

Description: "Tests the presence of an undefined rr:tableName"

+

Error expected? Yes

+

Input

+
DROP TABLE IF EXISTS student CASCADE ;
+CREATE TABLE student (
+  "ID" INTEGER,
+  "Name" VARCHAR(50)
+);
+INSERT INTO student values ('10', 'Venus');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:source <http://example.com/base/#DB_source>;
+      rml:iterator "\"Students\""
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "IDs"
+        ];
+      rml:predicate ex:id
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{ID}/{Name}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "org.postgresql.Driver";
+  d2rq:password "";
+  d2rq:username "postgres" .
+
+
+

50. RMLTC0002e-SQLServer

+

Title: "Two columns mapping, an undefined rr:tableName"

+

Description: "Tests the presence of an undefined rr:tableName"

+

Error expected? Yes

+

Input

+
USE TestDB;
+EXEC sp_msforeachtable 'ALTER TABLE ? NOCHECK CONSTRAINT all'
+EXEC sp_msforeachtable 'DROP TABLE ?'
+
+CREATE TABLE student (
+  "ID" INTEGER,
+  "Name" VARCHAR(50)
+);
+INSERT INTO student values ('10', 'Venus');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:source <http://example.com/base/#DB_source>;
+      rml:iterator "\"Students\""
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "IDs"
+        ];
+      rml:predicate ex:id
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{ID}/{Name}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
+  d2rq:password "YourSTRONG!Passw0rd;";
+  d2rq:username "sa" .
+
+
+

51. RMLTC0002e-XML

+

Title: "Two columns mapping, an undefined rr:tableName"

+

Description: "Tests the presence of an undefined rr:tableName"

+

Error expected? Yes

+

Input

+
<?xml version="1.0"?>
+
+<students>
+  <student>
+    <ID>10</ID>
+    <Name>Venus</Name>
+  </student>
+</students>
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "/students/student";
+      rml:referenceFormulation rml:XPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student2.xml"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "IDs"
+        ];
+      rml:predicate ex:id
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{ID}/{Name}"
+    ] .
+
+
+

52. RMLTC0002f-MySQL

+

Title: "Two columns mapping, delimited identifiers referenced as regular identifiers"

+

Description: "Tests the presence of delimited identifiers referenced as regular identifiers. Within rr:template ID is ok, but Name is not"

+

Error expected? Yes

+

Input

+
USE test;
+DROP TABLE IF EXISTS test.Student;
+CREATE TABLE Student (
+ID INTEGER,
+Name VARCHAR(15)
+);
+INSERT INTO Student (ID, Name) VALUES(10,'Venus');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:source <http://example.com/base/#DB_source>;
+      rml:iterator "\"Student\""
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "\"ID\""
+        ];
+      rml:predicate ex:id
+    ], [
+      rml:objectMap [
+          rml:reference "\"Name\""
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:class foaf:Person;
+      rml:template "http://example.com/{\"ID\"}/{\"Name\"}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
+  d2rq:password "";
+  d2rq:username "root" .
+
+
+

53. RMLTC0002f-PostgreSQL

+

Title: "Two columns mapping, delimited identifiers referenced as regular identifiers"

+

Description: "Tests the presence of delimited identifiers referenced as regular identifiers. Within rr:template ID is ok, but Name is not"

+

Error expected? Yes

+

Input

+
DROP TABLE IF EXISTS Student CASCADE;
+CREATE TABLE Student (
+ID INTEGER,
+Name VARCHAR(15)
+);
+INSERT INTO Student (ID, Name) VALUES(10,'Venus');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:source <http://example.com/base/#DB_source>;
+      rml:iterator "\"Student\""
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "\"ID\""
+        ];
+      rml:predicate ex:id
+    ], [
+      rml:objectMap [
+          rml:reference "\"Name\""
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:class foaf:Person;
+      rml:template "http://example.com/{\"ID\"}/{\"Name\"}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
+  d2rq:password "";
+  d2rq:username "root" .
+
+
+

54. RMLTC0002f-SQLServer

+

Title: "Two columns mapping, delimited identifiers referenced as regular identifiers"

+

Description: "Tests the presence of delimited identifiers referenced as regular identifiers. Within rr:template ID is ok, but Name is not"

+

Error expected? Yes

+

Input

+
USE TestDB;
+DROP TABLE IF EXISTS TestDB.Student;
+CREATE TABLE Student (
+ID INTEGER,
+Name VARCHAR(15)
+);
+INSERT INTO Student (ID, Name) VALUES(10,'Venus');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:source <http://example.com/base/#DB_source>;
+      rml:iterator "\"Student\""
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "\"ID\""
+        ];
+      rml:predicate ex:id
+    ], [
+      rml:objectMap [
+          rml:reference "\"Name\""
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:class foaf:Person;
+      rml:template "http://example.com/{\"ID\"}/{\"Name\"}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
+  d2rq:password "";
+  d2rq:username "root" .
+
+
+

55. RMLTC0002g-JSON

+

Title: "Two columns mapping, invalid JSONPath"

+

Description: "Test the presence of an invalid JSONPath"

+

Error expected? Yes

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "Name":"Venus"
+  }]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student2.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.IDs"
+        ];
+      rml:predicate ex:id
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{$.ID}/{$.Name}"
+    ] .
+
+
+

56. RMLTC0002g-MySQL

+

Title: "Two columns mapping, invalid SQL query"

+

Description: "Tests the presence of an invalid SQL query"

+

Error expected? Yes

+

Input

+
USE test;
+DROP TABLE IF EXISTS test.student;
+CREATE TABLE student (
+  ID INTEGER,
+  Name VARCHAR(50)
+);
+INSERT INTO student values ('10', 'Venus');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "SELECT kjnqsdjfbqsdjfmsdnfm FROM student";
+      rml:referenceFormulation rml:SQL2008Query;
+      rml:source <http://example.com/base/#DB_source>
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "IDs"
+        ];
+      rml:predicate ex:id
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{ID}/{Name}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
+  d2rq:password "";
+  d2rq:username "root" .
+
+
+

57. RMLTC0002g-PostgreSQL

+

Title: "Two columns mapping, invalid SQL query"

+

Description: "Tests the presence of an invalid SQL query"

+

Error expected? Yes

+

Input

+
DROP TABLE IF EXISTS student CASCADE ;
+CREATE TABLE student (
+  "ID" INTEGER,
+  "Name" VARCHAR(50)
+);
+INSERT INTO student values ('10', 'Venus');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "SELECT kjnqsdjfbqsdjfmsdnfm FROM student";
+      rml:referenceFormulation rml:SQL2008Query;
+      rml:source <http://example.com/base/#DB_source>
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "IDs"
+        ];
+      rml:predicate ex:id
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{ID}/{Name}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "org.postgresql.Driver";
+  d2rq:password "";
+  d2rq:username "postgres" .
+
+
+

58. RMLTC0002g-SPARQL

+

Title: "Two tripples mapping, invalid SPARQL query"

+

Description: "Tests the presence of an invalid SPARQL query"

+

Error expected? Yes

+

Input

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+
+[] rdf:ID "10" ;
+    foaf:name "Venus" .
+
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix sd: <http://www.w3.org/ns/sparql-service-description#> .
+
+<http://example.com/base#Country> rml:logicalSource [
+      rml:iterator """
+            PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
+            PREFIX foaf: <http://xmlns.com/foaf/0.1/>
+            PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
+            SELECT qsdfqsdf sqdfqsdfsd ?Nsdfqs ame ?ID qmsndfknqskfmdnemznfmkznfmizmnknfmz
+            WHERE {
+                ?x foaf:name ?Name ;
+                   rdf:ID ?ID .
+            } """;
+      rml:referenceFormulation formats:SPARQL_Results_JSON;
+      rml:source <http://example.com/base#InputSPARQL>
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "IDs"
+        ];
+      rml:predicate ex:id
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{ID.value}/{Name.value}"
+    ] .
+
+<http://example.com/base#InputSPARQL> a sd:Service;
+  sd:endpoint <http://HOST:PORT/ds1/sparql>;
+  sd:supportedLanguage sd:SPARQL11Query .
+
+
+

59. RMLTC0002g-SQLServer

+

Title: "Two columns mapping, invalid SQL query"

+

Description: "Tests the presence of an invalid SQL query"

+

Error expected? Yes

+

Input

+
USE TestDB;
+EXEC sp_msforeachtable 'ALTER TABLE ? NOCHECK CONSTRAINT all'
+EXEC sp_msforeachtable 'DROP TABLE ?'
+
+CREATE TABLE student (
+  "ID" INTEGER,
+  "Name" VARCHAR(50)
+);
+INSERT INTO student values ('10', 'Venus');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "SELECT kjnqsdjfbqsdjfmsdnfm FROM student";
+      rml:referenceFormulation rml:SQL2008Query;
+      rml:source <http://example.com/base/#DB_source>
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "IDs"
+        ];
+      rml:predicate ex:id
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{ID}/{Name}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
+  d2rq:password "YourSTRONG!Passw0rd;";
+  d2rq:username "sa" .
+
+
+

60. RMLTC0002h-MySQL

+

Title: "Two columns mapping, duplicate column name in SELECT"

+

Description: "Tests the presence of duplicate column names in the SELECT list of the SQL query"

+

Error expected? Yes

+

Input

+
USE test;
+DROP TABLE IF EXISTS test.student;
+CREATE TABLE student (
+  ID INTEGER,
+  Name VARCHAR(50)
+);
+INSERT INTO student values ('10', 'Venus');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:iterator "SELECT Name, Name FROM student";
+      rml:referenceFormulation rml:SQL2008Query;
+      rml:source <http://example.com/base/#DB_source>
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "IDs"
+        ];
+      rml:predicate ex:id
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{ID}/{Name}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
+  d2rq:password "";
+  d2rq:username "root" .
+
+
+

61. RMLTC0002h-PostgreSQL

+

Title: "Two columns mapping, duplicate column name in SELECT"

+

Description: "Tests the presence of duplicate column names in the SELECT list of the SQL query"

+

Error expected? Yes

+

Input

+
DROP TABLE IF EXISTS student CASCADE ;
+CREATE TABLE student (
+  "ID" INTEGER,
+  "Name" VARCHAR(50)
+);
+INSERT INTO student values ('10', 'Venus');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:iterator "SELECT Name, Name FROM student";
+      rml:referenceFormulation rml:SQL2008Query;
+      rml:source <http://example.com/base/#DB_source>
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "IDs"
+        ];
+      rml:predicate ex:id
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{ID}/{Name}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "org.postgresql.Driver";
+  d2rq:password "";
+  d2rq:username "postgres" .
+
+
+

62. RMLTC0002h-SPARQL

+

Title: "Two tripples mapping, duplicate variable name in SELECT"

+

Description: "Tests the presence of duplicate variable names in the SELECT list of the SPARQL query"

+

Error expected? Yes

+

Input

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+
+[] rdf:ID "10" ;
+    foaf:name "Venus" .
+
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix sd: <http://www.w3.org/ns/sparql-service-description#> .
+
+<http://example.com/base#Country> rml:logicalSource [
+      rml:iterator """
+            PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
+            PREFIX foaf: <http://xmlns.com/foaf/0.1/>
+            PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
+            SELECT ?Name ?Name
+            WHERE {
+                ?x foaf:name ?Name ;
+            } """;
+      rml:referenceFormulation formats:SPARQL_Results_JSON;
+      rml:source <http://example.com/base#InputSPARQL>
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "IDs"
+        ];
+      rml:predicate ex:id
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{ID.value}/{Name.value}"
+    ] .
+
+<http://example.com/base#InputSPARQL> a sd:Service;
+  sd:endpoint <http://HOST:PORT/ds1/sparql>;
+  sd:supportedLanguage sd:SPARQL11Query .
+
+
+

63. RMLTC0002h-SQLServer

+

Title: "Two columns mapping, duplicate column name in SELECT"

+

Description: "Tests the presence of duplicate column names in the SELECT list of the SQL query"

+

Error expected? Yes

+

Input

+
USE TestDB;
+EXEC sp_msforeachtable 'ALTER TABLE ? NOCHECK CONSTRAINT all'
+EXEC sp_msforeachtable 'DROP TABLE ?'
+CREATE TABLE student (
+  "ID" INTEGER,
+  "Name" VARCHAR(50)
+);
+INSERT INTO student values ('10', 'Venus');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:iterator "SELECT Name, Name FROM student";
+      rml:referenceFormulation rml:SQL2008Query;
+      rml:source <http://example.com/base/#DB_source>
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "IDs"
+        ];
+      rml:predicate ex:id
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{ID}/{Name}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
+  d2rq:password "YourSTRONG!Passw0rd;";
+  d2rq:username "sa" .
+
+
+

64. RMLTC0002i-MySQL

+

Title: "Two columns mapping, SQL Version identifier"

+

Description: "Tests the presence of a SQL Version identifier "

+

Error expected? Yes

+

Input

+
USE test;
+DROP TABLE IF EXISTS test.student;
+CREATE TABLE student (
+  ID INTEGER,
+  Name VARCHAR(50)
+);
+INSERT INTO student values ('10', 'Venus');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:iterator "SELECT Name FROM student";
+      rml:referenceFormulation rml:SQL2008Query;
+      rml:source <http://example.com/base/#DB_source>
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "IDs"
+        ];
+      rml:predicate ex:id
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{ID}/{Name}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
+  d2rq:password "";
+  d2rq:username "root" .
+
+
+

65. RMLTC0002i-PostgreSQL

+

Title: "Two columns mapping, SQL Version identifier"

+

Description: "Tests the presence of a SQL Version identifier "

+

Error expected? Yes

+

Input

+
DROP TABLE IF EXISTS student CASCADE ;
+CREATE TABLE student (
+  "ID" INTEGER,
+  "Name" VARCHAR(50)
+);
+INSERT INTO student values ('10', 'Venus');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:iterator "SELECT Name FROM student";
+      rml:referenceFormulation rml:SQL2008Query;
+      rml:source <http://example.com/base/#DB_source>
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "IDs"
+        ];
+      rml:predicate ex:id
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{ID}/{Name}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "org.postgresql.Driver";
+  d2rq:password "";
+  d2rq:username "postgres" .
+
+
+

66. RMLTC0002i-SQLServer

+

Title: "Two columns mapping, SQL Version identifier"

+

Description: "Tests the presence of a SQL Version identifier "

+

Error expected? Yes

+

Input

+
USE TestDB;
+EXEC sp_msforeachtable 'ALTER TABLE ? NOCHECK CONSTRAINT all'
+EXEC sp_msforeachtable 'DROP TABLE ?'
+
+CREATE TABLE student (
+  "ID" INTEGER,
+  "Name" VARCHAR(50)
+);
+INSERT INTO student values ('10', 'Venus');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:iterator "SELECT Name FROM student";
+      rml:referenceFormulation rml:SQL2008Query;
+      rml:source <http://example.com/base/#DB_source>
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "IDs"
+        ];
+      rml:predicate ex:id
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{ID}/{Name}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
+  d2rq:password "YourSTRONG!Passw0rd;";
+  d2rq:username "sa" .
+
+
+

67. RMLTC0002j-MySQL

+

Title: "Two columns mapping, qualified column names"

+

Description: "Tests the presence of qualified column names in the SELECT list of the SQL query"

+

Error expected? Yes

+

Input

+
USE test;
+DROP TABLE IF EXISTS test.student;
+CREATE TABLE student (
+  ID INTEGER,
+  Name VARCHAR(50)
+);
+INSERT INTO student values ('10', 'Venus');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:iterator "SELECT NoColumnName, Name FROM student";
+      rml:referenceFormulation rml:SQL2008Query;
+      rml:source <http://example.com/base/#DB_source>
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "IDs"
+        ];
+      rml:predicate ex:id
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{ID}/{Name}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
+  d2rq:password "";
+  d2rq:username "root" .
+
+
+

68. RMLTC0002j-PostgreSQL

+

Title: "Two columns mapping, qualified column names"

+

Description: "Tests the presence of qualified column names in the SELECT list of the SQL query"

+

Error expected? Yes

+

Input

+
DROP TABLE IF EXISTS student CASCADE ;
+CREATE TABLE student (
+  "ID" INTEGER,
+  "Name" VARCHAR(50)
+);
+INSERT INTO student values ('10', 'Venus');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:iterator "SELECT NoColumnName, Name FROM student";
+      rml:referenceFormulation rml:SQL2008Query;
+      rml:source <http://example.com/base/#DB_source>
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "IDs"
+        ];
+      rml:predicate ex:id
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{ID}/{Name}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "org.postgresql.Driver";
+  d2rq:password "";
+  d2rq:username "postgres" .
+
+
+

69. RMLTC0002j-SQLServer

+

Title: "Two columns mapping, qualified column names"

+

Description: "Tests the presence of qualified column names in the SELECT list of the SQL query"

+

Error expected? Yes

+

Input

+
USE TestDB;
+EXEC sp_msforeachtable 'ALTER TABLE ? NOCHECK CONSTRAINT all'
+EXEC sp_msforeachtable 'DROP TABLE ?'
+
+CREATE TABLE student (
+  "ID" INTEGER,
+  "Name" VARCHAR(50)
+);
+INSERT INTO student values ('10', 'Venus');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:iterator "SELECT NoColumnName, Name FROM student";
+      rml:referenceFormulation rml:SQL2008Query;
+      rml:source <http://example.com/base/#DB_source>
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "IDs"
+        ];
+      rml:predicate ex:id
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{ID}/{Name}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
+  d2rq:password "YourSTRONG!Passw0rd;";
+  d2rq:username "sa" .
+
+
+

70. RMLTC0003a-MySQL

+

Title: "Three columns mapping, undefined SQL Version identifier"

+

Description: "Tests the presence of an undefined SQL Version identifier"

+

Error expected? Yes

+

Input

+
USE test;
+DROP TABLE IF EXISTS test.student;
+CREATE TABLE student (
+  ID INTEGER,
+  FirstName VARCHAR(50),
+  LastName VARCHAR(50)
+);
+INSERT INTO student values ('10', 'Venus', 'Williams');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:iterator "SELECT FirstName, LastName FROM student";
+      rml:referenceFormulation rml:SQL2008Query;
+      rml:source <http://example.com/base/#DB_source>
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "IDs"
+        ];
+      rml:predicate ex:id
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{ID}/{Name}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
+  d2rq:password "";
+  d2rq:username "root" .
+
+
+

71. RMLTC0003a-PostgreSQL

+

Title: "Three columns mapping, undefined SQL Version identifier"

+

Description: "Tests the presence of an undefined SQL Version identifier"

+

Error expected? Yes

+

Input

+
DROP TABLE IF EXISTS student CASCADE ;
+CREATE TABLE student (
+  "ID" INTEGER,
+  "FirstName" VARCHAR(50),
+  "LastName" VARCHAR(50)
+);
+INSERT INTO student values ('10', 'Venus', 'Williams');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:iterator "SELECT FirstName, LastName FROM student";
+      rml:referenceFormulation rml:SQL2008Query;
+      rml:source <http://example.com/base/#DB_source>
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "IDs"
+        ];
+      rml:predicate ex:id
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{ID}/{Name}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "org.postgresql.Driver";
+  d2rq:password "";
+  d2rq:username "postgres" .
+
+
+

72. RMLTC0003a-SQLServer

+

Title: "Three columns mapping, undefined SQL Version identifier"

+

Description: "Tests the presence of an undefined SQL Version identifier"

+

Error expected? Yes

+

Input

+
USE TestDB;
+EXEC sp_msforeachtable 'ALTER TABLE ? NOCHECK CONSTRAINT all'
+EXEC sp_msforeachtable 'DROP TABLE ?'
+
+CREATE TABLE student (
+  "ID" INTEGER,
+  "FirstName" VARCHAR(50),
+  "LastName" VARCHAR(50)
+);
+INSERT INTO student values ('10', 'Venus', 'Williams');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:iterator "SELECT FirstName, LastName FROM student";
+      rml:referenceFormulation rml:SQL2008Query;
+      rml:source <http://example.com/base/#DB_source>
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "IDs"
+        ];
+      rml:predicate ex:id
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{ID}/{Name}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
+  d2rq:password "YourSTRONG!Passw0rd;";
+  d2rq:username "sa" .
+
+
+

73. RMLTC0003b-MySQL

+

Title: "Three columns mapping, concatenation of columns, by using a rr:sqlQuery to produce literal"

+

Description: "Tests: (1) three column mapping; and (2) concatenation of columns to produce literal, by using a rr:sqlQuery"

+

Error expected? No

+

Input

+
USE test;
+DROP TABLE IF EXISTS test.student;
+CREATE TABLE student (
+  ID INTEGER,
+  FirstName VARCHAR(50),
+  LastName VARCHAR(50)
+);
+INSERT INTO student values ('10', 'Venus', 'Williams');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:iterator "SELECT ID, LastName, CONCAT(`FirstName`, '', `LastName`) as Name FROM student";
+      rml:referenceFormulation rml:SQL2008Query;
+      rml:source <http://example.com/base/#DB_source>
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "Name";
+          rml:termType rml:Literal
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{ID}/{LastName}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
+  d2rq:password "";
+  d2rq:username "root" .
+
+

Output

+
<http://example.com/10/Williams> <http://xmlns.com/foaf/0.1/name> "VenusWilliams" .
+
+
+

74. RMLTC0003b-PostgreSQL

+

Title: "Three columns mapping, concatenation of columns, by using a rr:sqlQuery to produce literal"

+

Description: "Tests: (1) three column mapping; and (2) concatenation of columns to produce literal, by using a rr:sqlQuery"

+

Error expected? No

+

Input

+
DROP TABLE IF EXISTS student CASCADE ;
+CREATE TABLE student (
+  id INTEGER,
+  firstname VARCHAR(50),
+  lastname VARCHAR(50)
+);
+INSERT INTO student values ('10', 'Venus', 'Williams');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:iterator "SELECT id, lastname, concat_ws(firstname, '', lastname) as name FROM student";
+      rml:referenceFormulation rml:SQL2008Query;
+      rml:source <http://example.com/base/#DB_source>
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "name";
+          rml:termType rml:Literal
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{id}/{lastname}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "org.postgresql.Driver";
+  d2rq:password "";
+  d2rq:username "postgres" .
+
+

Output

+
<http://example.com/10/Williams> <http://xmlns.com/foaf/0.1/name> "VenusWilliams" .
+
+
+

75. RMLTC0003b-SQLServer

+

Title: "Three columns mapping, concatenation of columns, by using a rr:sqlQuery to produce literal"

+

Description: "Tests: (1) three column mapping; and (2) concatenation of columns to produce literal, by using a rr:sqlQuery"

+

Error expected? No

+

Input

+
USE TestDB;
+EXEC sp_msforeachtable 'ALTER TABLE ? NOCHECK CONSTRAINT all'
+EXEC sp_msforeachtable 'DROP TABLE ?'
+
+CREATE TABLE student (
+  "ID" INTEGER,
+  "FirstName" VARCHAR(50),
+  "LastName" VARCHAR(50)
+);
+INSERT INTO student values ('10', 'Venus', 'Williams');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:iterator "SELECT ID, LastName, concat_ws(FirstName, '', LastName) as Name FROM student";
+      rml:referenceFormulation rml:SQL2008Query;
+      rml:source <http://example.com/base/#DB_source>
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "Name";
+          rml:termType rml:Literal
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{ID}/{LastName}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
+  d2rq:password "YourSTRONG!Passw0rd;";
+  d2rq:username "sa" .
+
+

Output

+
<http://example.com/10/Williams> <http://xmlns.com/foaf/0.1/name> "VenusWilliams" .
+
+
+

76. RMLTC0003c-CSV

+

Title: "Three columns mapping, by using a rr:template to produce literal"

+

Description: "Tests: (1) three column mapping; and (2) the use of rr:template to produce literal"

+

Error expected? No

+

Input

+
ID,FirstName,LastName
+10,Venus,Williams
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:referenceFormulation rml:CSV;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.csv"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:template "{FirstName} {LastName}";
+          rml:termType rml:Literal
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Student{ID}"
+    ] .
+
+

Output

+
<http://example.com/Student10> <http://xmlns.com/foaf/0.1/name> "Venus Williams" .
+
+
+

77. RMLTC0003c-JSON

+

Title: "Three columns mapping, by using a rr:template to produce literal"

+

Description: "Tests: (1) three column mapping; and (2) the use of rr:template to produce literal"

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "FirstName":"Venus",
+    "LastName":"Williams"
+  }]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:template "{$.FirstName} {$.LastName}";
+          rml:termType rml:Literal
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Student{$.ID}"
+    ] .
+
+

Output

+
<http://example.com/Student10> <http://xmlns.com/foaf/0.1/name> "Venus Williams" .
+
+
+

78. RMLTC0003c-MySQL

+

Title: "Three columns mapping, by using a rr:template to produce literal"

+

Description: "Tests: (1) three column mapping; and (2) the use of rr:template to produce literal"

+

Error expected? No

+

Input

+
USE test;
+DROP TABLE IF EXISTS test.student;
+
+CREATE TABLE student (
+  ID INTEGER,
+  FirstName VARCHAR(50),
+  LastName VARCHAR(50)
+);
+INSERT INTO student values ('10', 'Venus', 'Williams');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "student"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:template "{FirstName} {LastName}";
+          rml:termType rml:Literal
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Student{ID}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
+  d2rq:password "";
+  d2rq:username "root" .
+
+

Output

+
<http://example.com/Student10> <http://xmlns.com/foaf/0.1/name> "Venus Williams" .
+
+
+

79. RMLTC0003c-PostgreSQL

+

Title: "Three columns mapping, by using a rr:template to produce literal"

+

Description: "Tests: (1) three column mapping; and (2) the use of rr:template to produce literal"

+

Error expected? No

+

Input

+
DROP TABLE IF EXISTS student CASCADE ;
+CREATE TABLE student (
+  "ID" INTEGER,
+  "FirstName" VARCHAR(50),
+  "LastName" VARCHAR(50)
+);
+INSERT INTO student values ('10', 'Venus', 'Williams');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "student"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:template "{FirstName} {LastName}";
+          rml:termType rml:Literal
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Student{ID}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "org.postgresql.Driver";
+  d2rq:password "";
+  d2rq:username "postgres" .
+
+

Output

+
<http://example.com/Student10> <http://xmlns.com/foaf/0.1/name> "Venus Williams" .
+
+
+

80. RMLTC0003c-SPARQL

+

Title: "Three tripple mapping, by using a rr:template to produce literal"

+

Description: "Tests: (1) three column mapping; and (2) the use of rr:template to produce literal"

+

Error expected? No

+

Input

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+
+[] rdf:ID "10" ;
+    foaf:firstName "Venus" ;
+    foaf:lastName "Williams" .
+
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix sd: <http://www.w3.org/ns/sparql-service-description#> .
+
+<http://example.com/base#Country> rml:logicalSource [
+      rml:iterator """
+            PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
+            PREFIX foaf: <http://xmlns.com/foaf/0.1/>
+            PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
+            SELECT ?FirstName ?LastName ?ID
+            WHERE {
+                ?x  foaf:firstName ?FirstName ;
+                    foaf:lastName  ?LastName ;
+                    rdf:ID         ?ID .
+            } """;
+      rml:referenceFormulation formats:SPARQL_Results_JSON;
+      rml:source <http://example.com/base#InputSPARQL>
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:template "{FirstName.value} {LastName.value}";
+          rml:termType rml:Literal
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Student{ID.value}"
+    ] .
+
+<http://example.com/base#InputSPARQL> a sd:Service;
+  sd:endpoint <http://HOST:PORT/ds1/sparql>;
+  sd:supportedLanguage sd:SPARQL11Query .
+
+

Output

+
<http://example.com/Student10> <http://xmlns.com/foaf/0.1/name> "Venus Williams" .
+
+
+

81. RMLTC0003c-SQLServer

+

Title: "Three columns mapping, by using a rr:template to produce literal"

+

Description: "Tests: (1) three column mapping; and (2) the use of rr:template to produce literal"

+

Error expected? No

+

Input

+
USE TestDB;
+EXEC sp_msforeachtable 'ALTER TABLE ? NOCHECK CONSTRAINT all'
+EXEC sp_msforeachtable 'DROP TABLE ?'
+
+CREATE TABLE student (
+  "ID" INTEGER,
+  "FirstName" VARCHAR(50),
+  "LastName" VARCHAR(50)
+);
+INSERT INTO student values ('10', 'Venus', 'Williams');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "student"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:template "{FirstName} {LastName}";
+          rml:termType rml:Literal
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Student{ID}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
+  d2rq:password "YourSTRONG!Passw0rd;";
+  d2rq:username "sa" .
+
+

Output

+
<http://example.com/Student10> <http://xmlns.com/foaf/0.1/name> "Venus Williams" .
+
+
+

82. RMLTC0003c-XML

+

Title: "Three columns mapping, by using a rr:template to produce literal"

+

Description: "Tests: (1) three column mapping; and (2) the use of rr:template to produce literal"

+

Error expected? No

+

Input

+
<?xml version="1.0"?>
+
+<students>
+  <student>
+    <ID>10</ID>
+    <FirstName>Venus</FirstName>
+    <LastName>Williams</LastName>
+  </student>
+</students>
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "/students/student";
+      rml:referenceFormulation rml:XPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.xml"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:template "{FirstName} {LastName}";
+          rml:termType rml:Literal
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Student{ID}"
+    ] .
+
+

Output

+
<http://example.com/Student10> <http://xmlns.com/foaf/0.1/name> "Venus Williams" .
+
+
+

83. RMLTC0004a-CSV

+

Title: "Two column mapping, from one row table to two different triples"

+

Description: "Tests: (1) two column mapping, (2) subject URI generated by a column value; (3) from one row table to two different triples (4) typing by using rr:class"

+

Error expected? No

+

Input

+
Student,Sport
+Venus,Tennis
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:referenceFormulation rml:CSV;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student_sport.csv"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "Student"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:class ex:Student;
+      rml:template "http://example.com/{Student}"
+    ] .
+
+<http://example.com/base/TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:referenceFormulation rml:CSV;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student_sport.csv"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "Sport"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:class ex:Sport;
+      rml:template "http://example.com/{Sport}"
+    ] .
+
+

Output

+
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
+<http://example.com/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/Student> .
+<http://example.com/Tennis> <http://xmlns.com/foaf/0.1/name> "Tennis" .
+<http://example.com/Tennis> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/Sport> .
+
+
+
+

84. RMLTC0004a-JSON

+

Title: "Two column mapping, from one row table to two different triples"

+

Description: "Tests: (1) two column mapping, (2) subject URI generated by a column value; (3) from one row table to two different triples (4) typing by using rr:class"

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "Student": "Venus",
+    "Sport":"Tennis"
+  }]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student_sport.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.Student"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:class ex:Student;
+      rml:template "http://example.com/{$.Student}"
+    ] .
+
+<http://example.com/base/TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student_sport.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.Sport"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:class ex:Sport;
+      rml:template "http://example.com/{$.Sport}"
+    ] .
+
+

Output

+
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
+<http://example.com/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/Student> .
+<http://example.com/Tennis> <http://xmlns.com/foaf/0.1/name> "Tennis" .
+<http://example.com/Tennis> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/Sport> .
+
+
+
+

85. RMLTC0004a-MySQL

+

Title: "Two column mapping, from one row table to two different triples"

+

Description: "Tests: (1) two column mapping, (2) subject URI generated by a column value; (3) from one row table to two different triples (4) typing by using rr:class"

+

Error expected? No

+

Input

+
Student,Sport
+Venus,Tennis
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "student_sport"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "Student"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:class ex:Student;
+      rml:template "http://example.com/{Student}"
+    ] .
+
+<http://example.com/base/TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "student_sport"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "Sport"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:class ex:Sport;
+      rml:template "http://example.com/{Sport}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
+  d2rq:password "";
+  d2rq:username "root" .
+
+

Output

+
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
+<http://example.com/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/Student> .
+<http://example.com/Tennis> <http://xmlns.com/foaf/0.1/name> "Tennis" .
+<http://example.com/Tennis> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/Sport> .
+
+
+
+

86. RMLTC0004a-PostgreSQL

+

Title: "Two column mapping, from one row table to two different triples"

+

Description: "Tests: (1) two column mapping, (2) subject URI generated by a column value; (3) from one row table to two different triples (4) typing by using rr:class"

+

Error expected? No

+

Input

+
Student,Sport
+Venus,Tennis
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "student_sport"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "Student"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:class ex:Student;
+      rml:template "http://example.com/{Student}"
+    ] .
+
+<http://example.com/base/TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "student_sport"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "Sport"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:class ex:Sport;
+      rml:template "http://example.com/{Sport}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "org.postgresql.Driver";
+  d2rq:password "";
+  d2rq:username "postgres" .
+
+

Output

+
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
+<http://example.com/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/Student> .
+<http://example.com/Tennis> <http://xmlns.com/foaf/0.1/name> "Tennis" .
+<http://example.com/Tennis> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/Sport> .
+
+
+

87. RMLTC0004a-SPARQL

+

Title: "Two BlankNodes mapping, from one object to two different triples"

+

Description: "Tests: (1) two BlankNodes mapping, (2) subject URI generated by a tripple object value; (3) from one BlankNode to two different triples (4) typing by using rr:class"

+

Error expected? No

+

Input

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix ns1: <http://example.com/> .
+
+[] a ns1:Student ;
+    ns1:plays [ a ns1:Sport ;
+            foaf:name "Tennis" ] ;
+    foaf:name "Venus" .
+
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix sd: <http://www.w3.org/ns/sparql-service-description#> .
+
+ex:TriplesMap1 a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator """
+            PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
+            PREFIX foaf: <http://xmlns.com/foaf/0.1/>
+            PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
+            SELECT ?Student
+            WHERE {
+                ?x  a <http://example.com/Student> ;
+                    foaf:name  ?Student .
+            } """;
+      rml:referenceFormulation formats:SPARQL_Results_JSON;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path <http://example.com/base#InputSPARQL>
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "Student.value"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:class ex:Student;
+      rml:template "http://example.com/{Student.value}"
+    ] .
+
+ex:TriplesMap2 a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator """
+                PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
+                PREFIX foaf: <http://xmlns.com/foaf/0.1/>
+                PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
+                SELECT ?Sport
+                WHERE {
+                    ?x  a <http://example.com/Student> ;
+                        <http://example.com/plays> ?sportObject .
+                    ?sportObject foaf:name ?Sport .
+                } """;
+      rml:referenceFormulation formats:SPARQL_Results_JSON;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path <http://example.com/base#InputSPARQL>
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "Sport.value"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:class ex:Sport;
+      rml:template "http://example.com/{Sport.value}"
+    ] .
+
+<http://example.com/base#InputSPARQL> a sd:Service;
+  sd:endpoint <http://HOST:PORT/ds1/sparql>;
+  sd:supportedLanguage sd:SPARQL11Query .
+
+

Output

+
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
+<http://example.com/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/Student> .
+<http://example.com/Tennis> <http://xmlns.com/foaf/0.1/name> "Tennis" .
+<http://example.com/Tennis> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/Sport> .
+
+
+

88. RMLTC0004a-SQLServer

+

Title: "Two column mapping, from one row table to two different triples"

+

Description: "Tests: (1) two column mapping, (2) subject URI generated by a column value; (3) from one row table to two different triples (4) typing by using rr:class"

+

Error expected? No

+

Input

+
Student,Sport
+Venus,Tennis
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "student_sport"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "Student"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:class ex:Student;
+      rml:template "http://example.com/{Student}"
+    ] .
+
+<http://example.com/base/TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "student_sport"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "Sport"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:class ex:Sport;
+      rml:template "http://example.com/{Sport}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
+  d2rq:password "YourSTRONG!Passw0rd;";
+  d2rq:username "sa" .
+
+

Output

+
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
+<http://example.com/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/Student> .
+<http://example.com/Tennis> <http://xmlns.com/foaf/0.1/name> "Tennis" .
+<http://example.com/Tennis> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/Sport> .
+
+
+
+

89. RMLTC0004a-XML

+

Title: "Two column mapping, from one row table to two different triples"

+

Description: "Tests: (1) two column mapping, (2) subject URI generated by a column value; (3) from one row table to two different triples (4) typing by using rr:class"

+

Error expected? No

+

Input

+
<?xml version="1.0"?>
+
+<students>
+  <student>
+    <Student>Venus</Student>
+    <Sport>Tennis</Sport>
+  </student>
+</students>
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "/students/student";
+      rml:referenceFormulation rml:XPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student_sport.xml"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "Student"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:class ex:Student;
+      rml:template "http://example.com/{Student}"
+    ] .
+
+<http://example.com/base/TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "/students/student";
+      rml:referenceFormulation rml:XPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student_sport.xml"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "Sport"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:class ex:Sport;
+      rml:template "http://example.com/{Sport}"
+    ] .
+
+

Output

+
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
+<http://example.com/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/Student> .
+<http://example.com/Tennis> <http://xmlns.com/foaf/0.1/name> "Tennis" .
+<http://example.com/Tennis> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/Sport> .
+
+
+
+

90. RMLTC0004b-CSV

+

Title: "One column mapping, presence of rr:termType rr:Literal on rr:subjectMap"

+

Description: "Tests: (1) one column mapping (2) the presence of rr:termType rr:Literal on rr:subjectMap, which is invalid"

+

Error expected? Yes

+

Input

+
Name
+Venus
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:referenceFormulation rml:CSV;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.csv"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "Name"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{Name}";
+      rml:termType rml:Literal
+    ] .
+
+
+

91. RMLTC0004b-JSON

+

Title: "One column mapping, presence of rr:termType rr:Literal on rr:subjectMap"

+

Description: "Tests: (1) one column mapping (2) the presence of rr:termType rr:Literal on rr:subjectMap, which is invalid"

+

Error expected? Yes

+

Input

+
{
+  "students": [{
+    "Name":"Venus"
+  }]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.Name"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{$.Name}";
+      rml:termType rml:Literal
+    ] .
+
+
+

92. RMLTC0004b-MySQL

+

Title: "One column mapping, presence of rr:termType rr:Literal on rr:subjectMap"

+

Description: "Tests: (1) one column mapping (2) the presence of rr:termType rr:Literal on rr:subjectMap, which is invalid"

+

Error expected? Yes

+

Input

+
USE test;
+DROP TABLE IF EXISTS test.student;
+CREATE TABLE student (
+  Name VARCHAR(50)
+);
+INSERT INTO student values ('Venus');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "student"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "Name"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{Name}";
+      rml:termType rml:Literal
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
+  d2rq:password "";
+  d2rq:username "root" .
+
+
+

93. RMLTC0004b-PostgreSQL

+

Title: "One column mapping, presence of rr:termType rr:Literal on rr:subjectMap"

+

Description: "Tests: (1) one column mapping (2) the presence of rr:termType rr:Literal on rr:subjectMap, which is invalid"

+

Error expected? Yes

+

Input

+
DROP TABLE IF EXISTS student;
+CREATE TABLE student (
+  "Name" VARCHAR(50)
+);
+INSERT INTO student values ('Venus');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "student"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "Name"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{Name}";
+      rml:termType rml:Literal
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "org.postgresql.Driver";
+  d2rq:password "";
+  d2rq:username "postgres" .
+
+
+

94. RMLTC0004b-SPARQL

+

Title: "One tripple mapping, presence of rr:termType rr:Literal on rr:subjectMap"

+

Description: "Tests: (1) one column mapping (2) the presence of rr:termType rr:Literal on rr:subjectMap, which is invalid"

+

Error expected? Yes

+

Input

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+
+[] foaf:name "Venus" .
+
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix sd: <http://www.w3.org/ns/sparql-service-description#> .
+
+ex:TriplesMap1 a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator """
+            PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
+            PREFIX foaf: <http://xmlns.com/foaf/0.1/>
+            PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
+            SELECT ?Name
+            WHERE {
+                ?x foaf:name ?Name .
+            } """;
+      rml:referenceFormulation formats:SPARQL_Results_JSON;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path <http://example.com/base#InputSPARQL>
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "Name.value"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{Name.value}";
+      rml:termType rml:Literal
+    ] .
+
+<http://example.com/base#InputSPARQL> a sd:Service;
+  sd:endpoint <http://HOST:PORT/ds1/sparql>;
+  sd:supportedLanguage sd:SPARQL11Query .
+
+
+

95. RMLTC0004b-SQLServer

+

Title: "One column mapping, presence of rr:termType rr:Literal on rr:subjectMap"

+

Description: "Tests: (1) one column mapping (2) the presence of rr:termType rr:Literal on rr:subjectMap, which is invalid"

+

Error expected? Yes

+

Input

+
USE TestDB;
+DROP TABLE IF EXISTS student;
+CREATE TABLE student (
+  "Name" VARCHAR(50)
+);
+INSERT INTO student values ('Venus');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "student"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "Name"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{Name}";
+      rml:termType rml:Literal
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
+  d2rq:password "YourSTRONG!Passw0rd;";
+  d2rq:username "sa" .
+
+
+

96. RMLTC0004b-XML

+

Title: "One column mapping, presence of rr:termType rr:Literal on rr:subjectMap"

+

Description: "Tests: (1) one column mapping (2) the presence of rr:termType rr:Literal on rr:subjectMap, which is invalid"

+

Error expected? Yes

+

Input

+
<?xml version="1.0"?>
+
+<students>
+  <student>
+    <Name>Venus</Name>
+  </student>
+</students>
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "/students/student";
+      rml:referenceFormulation rml:XPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.xml"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "Name"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{Name}";
+      rml:termType rml:Literal
+    ] .
+
+
+

97. RMLTC0005a-CSV

+

Title: "Typing of resources"

+

Description: "Tests the typing of resources"

+

Error expected? No

+

Input

+
fname,lname,amount
+Bob,Smith,30.0E0
+Sue,Jones,20.0E0
+Bob,Smith,30.0E0
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:referenceFormulation rml:CSV;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "ious.csv"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "amount"
+        ];
+      rml:predicate ex:owes
+    ];
+  rml:subjectMap [
+      rml:class foaf:Person;
+      rml:template "http://example.com/{fname};{lname}"
+    ] .
+
+

Output

+
<http://example.com/Bob;Smith> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Bob;Smith> <http://example.com/owes> "30.0E0" .
+<http://example.com/Sue;Jones> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Sue;Jones> <http://example.com/owes> "20.0E0" .
+
+
+
+

98. RMLTC0005a-JSON

+

Title: "Typing of resources"

+

Description: "Tests the typing of resources"

+

Error expected? No

+

Input

+
{
+  "persons": [
+    {
+      "fname": "Bob",
+      "lname": "Smith",
+      "amount": "30.0E0"
+    },
+    {
+      "fname": "Sue",
+      "lname": "Jones",
+      "amount": "20.0E0"
+    },
+    {
+      "fname": "Bob",
+      "lname": "Smith",
+      "amount": "30.0E0"
+    }
+  ]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.persons[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "ious.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.amount"
+        ];
+      rml:predicate ex:owes
+    ];
+  rml:subjectMap [
+      rml:class foaf:Person;
+      rml:template "http://example.com/{$.fname};{$.lname}"
+    ] .
+
+

Output

+
<http://example.com/Bob;Smith> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Bob;Smith> <http://example.com/owes> "30.0E0" .
+<http://example.com/Sue;Jones> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Sue;Jones> <http://example.com/owes> "20.0E0" .
+
+
+
+

99. RMLTC0005a-MySQL

+

Title: "Typing of resources"

+

Description: "Tests the typing of resources"

+

Error expected? No

+

Input

+
USE test;
+DROP TABLE IF EXISTS test.IOUs;
+CREATE TABLE IOUs (
+      fname VARCHAR(20),
+      lname  VARCHAR(20),
+      amount FLOAT);
+INSERT INTO IOUs (fname, lname, amount) VALUES ('Bob', 'Smith', 30);
+INSERT INTO IOUs (fname, lname, amount) VALUES ('Sue', 'Jones', 20);
+INSERT INTO IOUs (fname, lname, amount) VALUES ('Bob', 'Smith', 30);
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "IOUs"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "amount"
+        ];
+      rml:predicate ex:owes
+    ];
+  rml:subjectMap [
+      rml:class foaf:Person;
+      rml:template "http://example.com/{fname};{lname}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
+  d2rq:password "";
+  d2rq:username "root" .
+
+

Output

+
<http://example.com/Bob;Smith> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Bob;Smith> <http://example.com/owes> "3.0E1"^^<http://www.w3.org/2001/XMLSchema#double> .
+<http://example.com/Sue;Jones> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Sue;Jones> <http://example.com/owes> "2.0E1"^^<http://www.w3.org/2001/XMLSchema#double> .
+
+
+
+

100. RMLTC0005a-PostgreSQL

+

Title: "Typing of resources"

+

Description: "Tests the typing of resources"

+

Error expected? No

+

Input

+
DROP TABLE IF EXISTS IOUs;
+CREATE TABLE IOUs (
+      fname VARCHAR(20),
+      lname  VARCHAR(20),
+      amount FLOAT);
+INSERT INTO IOUs (fname, lname, amount) VALUES ('Bob', 'Smith', 30);
+INSERT INTO IOUs (fname, lname, amount) VALUES ('Sue', 'Jones', 20);
+INSERT INTO IOUs (fname, lname, amount) VALUES ('Bob', 'Smith', 30);
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "IOUs"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "amount"
+        ];
+      rml:predicate ex:owes
+    ];
+  rml:subjectMap [
+      rml:class foaf:Person;
+      rml:template "http://example.com/{fname};{lname}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "org.postgresql.Driver";
+  d2rq:password "";
+  d2rq:username "postgres" .
+
+

Output

+
<http://example.com/Bob;Smith> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Bob;Smith> <http://example.com/owes> "3.0E1"^^<http://www.w3.org/2001/XMLSchema#double> .
+<http://example.com/Sue;Jones> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Sue;Jones> <http://example.com/owes> "2.0E1"^^<http://www.w3.org/2001/XMLSchema#double> .
+
+
+
+

101. RMLTC0005a-SQLServer

+

Title: "Typing of resources"

+

Description: "Tests the typing of resources"

+

Error expected? No

+

Input

+
USE TestDB;
+DROP TABLE IF EXISTS IOUs;
+
+CREATE TABLE IOUs (
+      fname VARCHAR(20),
+      lname  VARCHAR(20),
+      amount FLOAT);
+INSERT INTO IOUs (fname, lname, amount) VALUES ('Bob', 'Smith', 30);
+INSERT INTO IOUs (fname, lname, amount) VALUES ('Sue', 'Jones', 20);
+INSERT INTO IOUs (fname, lname, amount) VALUES ('Bob', 'Smith', 30);
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "IOUs"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "amount"
+        ];
+      rml:predicate ex:owes
+    ];
+  rml:subjectMap [
+      rml:class foaf:Person;
+      rml:template "http://example.com/{fname};{lname}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
+  d2rq:password "YourSTRONG!Passw0rd;";
+  d2rq:username "sa" .
+
+

Output

+
<http://example.com/Bob;Smith> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Bob;Smith> <http://example.com/owes> "3.0E1"^^<http://www.w3.org/2001/XMLSchema#double> .
+<http://example.com/Sue;Jones> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Sue;Jones> <http://example.com/owes> "2.0E1"^^<http://www.w3.org/2001/XMLSchema#double> .
+
+
+
+

102. RMLTC0005a-XML

+

Title: "Typing of resources"

+

Description: "Tests the typing of resources"

+

Error expected? No

+

Input

+
<?xml version="1.0"?>
+
+<persons>
+  <person>
+    <fname>Bob</fname>
+    <lname>Smith</lname>
+    <amount>30.0E0</amount>
+  </person>
+  <person>
+    <fname>Sue</fname>
+    <lname>Jones</lname>
+    <amount>20.0E0</amount>
+  </person>
+  <person>
+    <fname>Bob</fname>
+    <lname>Smith</lname>
+    <amount>30.0E0</amount>
+  </person>
+</persons>
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "/persons/person";
+      rml:referenceFormulation rml:XPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "ious.xml"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "amount"
+        ];
+      rml:predicate ex:owes
+    ];
+  rml:subjectMap [
+      rml:class foaf:Person;
+      rml:template "http://example.com/{fname};{lname}"
+    ] .
+
+

Output

+
<http://example.com/Bob;Smith> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Bob;Smith> <http://example.com/owes> "30.0E0" .
+<http://example.com/Sue;Jones> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Sue;Jones> <http://example.com/owes> "20.0E0" .
+
+
+
+

103. RMLTC0005b-MySQL

+

Title: "Default mapping"

+

Description: "Tests the generation of a default mapping for tables without a primary key"

+

Error expected? No

+

Input

+
USE test;
+DROP TABLE IF EXISTS test.IOUs;
+CREATE TABLE IOUs (
+      fname VARCHAR(20),
+      lname  VARCHAR(20),
+      amount FLOAT);
+INSERT INTO IOUs (fname, lname, amount) VALUES ('Bob', 'Smith', 30);
+INSERT INTO IOUs (fname, lname, amount) VALUES ('Sue', 'Jones', 20);
+INSERT INTO IOUs (fname, lname, amount) VALUES ('Bob', 'Smith', 30);
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "IOUs"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "fname"
+        ];
+      rml:predicate <http://example.com/base/IOUs#fname>
+    ], [
+      rml:objectMap [
+          rml:reference "lname"
+        ];
+      rml:predicate <http://example.com/base/IOUs#lname>
+    ], [
+      rml:objectMap [
+          rml:reference "amount"
+        ];
+      rml:predicate <http://example.com/base/IOUs#amount>
+    ];
+  rml:subjectMap [
+      rml:class <http://example.com/base/IOUs>;
+      rml:template "{fname}_{lname}";
+      rml:termType rml:BlankNode
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
+  d2rq:password "";
+  d2rq:username "root" .
+
+

Output

+
_:Bob_Smith <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/base/IOUs> .
+_:Bob_Smith <http://example.com/base/IOUs#fname> "Bob" .
+_:Bob_Smith <http://example.com/base/IOUs#lname> "Smith" .
+_:Bob_Smith <http://example.com/base/IOUs#amount> "3.0E1"^^<http://www.w3.org/2001/XMLSchema#double> .
+_:Sue_Jones <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/base/IOUs> .
+_:Sue_Jones <http://example.com/base/IOUs#fname> "Sue" .
+_:Sue_Jones <http://example.com/base/IOUs#lname> "Jones" .
+_:Sue_Jones <http://example.com/base/IOUs#amount> "2.0E1"^^<http://www.w3.org/2001/XMLSchema#double> .
+    
+
+
+

104. RMLTC0005b-PostgreSQL

+

Title: "Default mapping"

+

Description: "Tests the generation of a default mapping for tables without a primary key"

+

Error expected? No

+

Input

+
DROP TABLE IF EXISTS IOUs;
+CREATE TABLE IOUs (
+      fname VARCHAR(20),
+      lname  VARCHAR(20),
+      amount FLOAT);
+INSERT INTO IOUs (fname, lname, amount) VALUES ('Bob', 'Smith', 30);
+INSERT INTO IOUs (fname, lname, amount) VALUES ('Sue', 'Jones', 20);
+INSERT INTO IOUs (fname, lname, amount) VALUES ('Bob', 'Smith', 30);
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "IOUs"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "fname"
+        ];
+      rml:predicate <http://example.com/base/IOUs#fname>
+    ], [
+      rml:objectMap [
+          rml:reference "lname"
+        ];
+      rml:predicate <http://example.com/base/IOUs#lname>
+    ], [
+      rml:objectMap [
+          rml:reference "amount"
+        ];
+      rml:predicate <http://example.com/base/IOUs#amount>
+    ];
+  rml:subjectMap [
+      rml:class <http://example.com/base/IOUs>;
+      rml:template "{fname}_{lname}";
+      rml:termType rml:BlankNode
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "org.postgresql.Driver";
+  d2rq:password "";
+  d2rq:username "postgres" .
+
+

Output

+
_:Bob_Smith <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/base/IOUs> .
+_:Bob_Smith <http://example.com/base/IOUs#fname> "Bob" .
+_:Bob_Smith <http://example.com/base/IOUs#lname> "Smith" .
+_:Bob_Smith <http://example.com/base/IOUs#amount> "3.0E1"^^<http://www.w3.org/2001/XMLSchema#double> .
+_:Sue_Jones <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/base/IOUs> .
+_:Sue_Jones <http://example.com/base/IOUs#fname> "Sue" .
+_:Sue_Jones <http://example.com/base/IOUs#lname> "Jones" .
+_:Sue_Jones <http://example.com/base/IOUs#amount> "2.0E1"^^<http://www.w3.org/2001/XMLSchema#double> .
+    
+
+
+

105. RMLTC0005b-SQLServer

+

Title: "Default mapping"

+

Description: "Tests the generation of a default mapping for tables without a primary key"

+

Error expected? No

+

Input

+
USE TestDB;
+DROP TABLE IF EXISTS IOUs;
+CREATE TABLE IOUs (
+      fname VARCHAR(20),
+      lname  VARCHAR(20),
+      amount FLOAT);
+INSERT INTO IOUs (fname, lname, amount) VALUES ('Bob', 'Smith', 30);
+INSERT INTO IOUs (fname, lname, amount) VALUES ('Sue', 'Jones', 20);
+INSERT INTO IOUs (fname, lname, amount) VALUES ('Bob', 'Smith', 30);
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "IOUs"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "fname"
+        ];
+      rml:predicate <http://example.com/base/IOUs#fname>
+    ], [
+      rml:objectMap [
+          rml:reference "lname"
+        ];
+      rml:predicate <http://example.com/base/IOUs#lname>
+    ], [
+      rml:objectMap [
+          rml:reference "amount"
+        ];
+      rml:predicate <http://example.com/base/IOUs#amount>
+    ];
+  rml:subjectMap [
+      rml:class <http://example.com/base/IOUs>;
+      rml:template "{fname}_{lname}";
+      rml:termType rml:BlankNode
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
+  d2rq:password "YourSTRONG!Passw0rd;";
+  d2rq:username "sa" .
+
+

Output

+
_:Bob_Smith <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/base/IOUs> .
+_:Bob_Smith <http://example.com/base/IOUs#fname> "Bob" .
+_:Bob_Smith <http://example.com/base/IOUs#lname> "Smith" .
+_:Bob_Smith <http://example.com/base/IOUs#amount> "3.0E1"^^<http://www.w3.org/2001/XMLSchema#double> .
+_:Sue_Jones <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/base/IOUs> .
+_:Sue_Jones <http://example.com/base/IOUs#fname> "Sue" .
+_:Sue_Jones <http://example.com/base/IOUs#lname> "Jones" .
+_:Sue_Jones <http://example.com/base/IOUs#amount> "2.0E1"^^<http://www.w3.org/2001/XMLSchema#double> .
+    
+
+
+

106. RMLTC0006a-CSV

+

Title: "Long form of R2RML by using rr:constant in rr:subjectMap, rr:predicateMap, rr:objectMap and rr:graphMap"

+

Description: "Tests the use of rr:constant in rr:subjectMap, rr:predicateMap, rr:objectMap and rr:graphMap"

+

Error expected? No

+

Input

+
ID,FirstName,LastName
+10,Venus,Williams
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:referenceFormulation rml:CSV;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.csv"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:constant "Bad Student"
+        ];
+      rml:predicateMap [
+          rml:constant ex:description
+        ]
+    ];
+  rml:subjectMap [
+      rml:constant ex:BadStudent;
+      rml:graphMap [
+          rml:constant <http://example.com/graph/student>
+        ]
+    ] .
+
+

Output

+
<http://example.com/BadStudent> <http://example.com/description> "Bad Student" <http://example.com/graph/student> .
+
+
+

107. RMLTC0006a-JSON

+

Title: "Long form of R2RML by using rr:constant in rr:subjectMap, rr:predicateMap, rr:objectMap and rr:graphMap"

+

Description: "Tests the use of rr:constant in rr:subjectMap, rr:predicateMap, rr:objectMap and rr:graphMap"

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "FirstName":"Venus",
+    "LastName":"Williams"
+  }]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:constant "Bad Student"
+        ];
+      rml:predicateMap [
+          rml:constant ex:description
+        ]
+    ];
+  rml:subjectMap [
+      rml:constant ex:BadStudent;
+      rml:graphMap [
+          rml:constant <http://example.com/graph/student>
+        ]
+    ] .
+
+

Output

+
<http://example.com/BadStudent> <http://example.com/description> "Bad Student" <http://example.com/graph/student> .
+
+
+

108. RMLTC0006a-MySQL

+

Title: "Long form of R2RML by using rr:constant in rr:subjectMap, rr:predicateMap, rr:objectMap and rr:graphMap"

+

Description: "Tests the use of rr:constant in rr:subjectMap, rr:predicateMap, rr:objectMap and rr:graphMap"

+

Error expected? No

+

Input

+
USE test;
+DROP TABLE IF EXISTS test.student;
+
+CREATE TABLE student (
+  ID INTEGER,
+  FirstName VARCHAR(50),
+  LastName VARCHAR(50)
+);
+INSERT INTO student values ('10', 'Venus', 'Williams');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "student"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:constant "Bad Student"
+        ];
+      rml:predicateMap [
+          rml:constant ex:description
+        ]
+    ];
+  rml:subjectMap [
+      rml:constant ex:BadStudent;
+      rml:graphMap [
+          rml:constant <http://example.com/graph/student>
+        ]
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
+  d2rq:password "";
+  d2rq:username "root" .
+
+

Output

+
<http://example.com/BadStudent> <http://example.com/description> "Bad Student" <http://example.com/graph/student> .
+
+
+

109. RMLTC0006a-PostgreSQL

+

Title: "Long form of R2RML by using rr:constant in rr:subjectMap, rr:predicateMap, rr:objectMap and rr:graphMap"

+

Description: "Tests the use of rr:constant in rr:subjectMap, rr:predicateMap, rr:objectMap and rr:graphMap"

+

Error expected? No

+

Input

+
DROP TABLE IF EXISTS student;
+
+CREATE TABLE student (
+  "ID" INTEGER,
+  "FirstName" VARCHAR(50),
+  "LastName" VARCHAR(50)
+);
+INSERT INTO student values ('10', 'Venus', 'Williams');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "student"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:constant "Bad Student"
+        ];
+      rml:predicateMap [
+          rml:constant ex:description
+        ]
+    ];
+  rml:subjectMap [
+      rml:constant ex:BadStudent;
+      rml:graphMap [
+          rml:constant <http://example.com/graph/student>
+        ]
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "org.postgresql.Driver";
+  d2rq:password "";
+  d2rq:username "postgres" .
+
+

Output

+
<http://example.com/BadStudent> <http://example.com/description> "Bad Student" <http://example.com/graph/student> .
+
+
+

110. RMLTC0006a-SPARQL

+

Title: "rr:constant in rr:subjectMap, rr:predicateMap, rr:objectMap and rr:graphMap"

+

Description: "Tests the use of rr:constant in rr:subjectMap, rr:predicateMap, rr:objectMap and rr:graphMap"

+

Error expected? No

+

Input

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+
+[] rdf:ID "10" ;
+    foaf:firstName "Venus" ;
+    foaf:lastName "Williams" .
+
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix sd: <http://www.w3.org/ns/sparql-service-description#> .
+
+ex:TriplesMap1 a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator """
+            PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
+            PREFIX foaf: <http://xmlns.com/foaf/0.1/>
+            PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
+            SELECT ?BadStudent ?LastName ?ID
+            WHERE {
+
+            } """;
+      rml:referenceFormulation formats:SPARQL_Results_JSON;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path <http://example.com/base#InputSPARQL>
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:constant "Bad Student"
+        ];
+      rml:predicateMap [
+          rml:constant ex:description
+        ]
+    ];
+  rml:subjectMap [
+      rml:constant ex:BadStudent;
+      rml:graphMap [
+          rml:constant <http://example.com/graph/student>
+        ]
+    ] .
+
+<http://example.com/base#InputSPARQL> a sd:Service;
+  sd:endpoint <http://HOST:PORT/ds1/sparql>;
+  sd:supportedLanguage sd:SPARQL11Query .
+
+

Output

+
<http://example.com/BadStudent> <http://example.com/description> "Bad Student" <http://example.com/graph/student> .
+
+
+

111. RMLTC0006a-SQLServer

+

Title: "Long form of R2RML by using rr:constant in rr:subjectMap, rr:predicateMap, rr:objectMap and rr:graphMap"

+

Description: "Tests the use of rr:constant in rr:subjectMap, rr:predicateMap, rr:objectMap and rr:graphMap"

+

Error expected? No

+

Input

+
USE TestDB;
+DROP TABLE IF EXISTS student;
+CREATE TABLE student (
+  "ID" INTEGER,
+  "FirstName" VARCHAR(50),
+  "LastName" VARCHAR(50)
+);
+INSERT INTO student values ('10', 'Venus', 'Williams');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "student"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:constant "Bad Student"
+        ];
+      rml:predicateMap [
+          rml:constant ex:description
+        ]
+    ];
+  rml:subjectMap [
+      rml:constant ex:BadStudent;
+      rml:graphMap [
+          rml:constant <http://example.com/graph/student>
+        ]
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
+  d2rq:password "YourSTRONG!Passw0rd;";
+  d2rq:username "sa" .
+
+

Output

+
<http://example.com/BadStudent> <http://example.com/description> "Bad Student" <http://example.com/graph/student> .
+
+
+

112. RMLTC0006a-XML

+

Title: "Long form of R2RML by using rr:constant in rr:subjectMap, rr:predicateMap, rr:objectMap and rr:graphMap"

+

Description: "Tests the use of rr:constant in rr:subjectMap, rr:predicateMap, rr:objectMap and rr:graphMap"

+

Error expected? No

+

Input

+
<?xml version="1.0"?>
+
+<students>
+  <student>
+    <ID>10</ID>
+    <FirstName>Venus</FirstName>
+    <LastName>Williams</LastName>
+  </student>
+</students>
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "/students/student";
+      rml:referenceFormulation rml:XPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.xml"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:constant "Bad Student"
+        ];
+      rml:predicateMap [
+          rml:constant ex:description
+        ]
+    ];
+  rml:subjectMap [
+      rml:constant ex:BadStudent;
+      rml:graphMap [
+          rml:constant <http://example.com/graph/student>
+        ]
+    ] .
+
+

Output

+
<http://example.com/BadStudent> <http://example.com/description> "Bad Student" <http://example.com/graph/student> .
+
+
+

113. RMLTC0007a-CSV

+

Title: "Typing resources by relying on rdf:type predicate"

+

Description: "Tests the typing resources by relying on rdf:type predicate"

+

Error expected? No

+

Input

+
ID,FirstName,LastName
+10,Venus,Williams
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:referenceFormulation rml:CSV;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.csv"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:object foaf:Person;
+      rml:predicate rdf:type
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Student/{ID}/{FirstName}"
+    ] .
+
+

Output

+
 <http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+
+
+
+

114. RMLTC0007a-JSON

+

Title: "Typing resources by relying on rdf:type predicate"

+

Description: "Tests the typing resources by relying on rdf:type predicate"

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "FirstName":"Venus",
+    "LastName":"Williams"
+  }]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:object foaf:Person;
+      rml:predicate rdf:type
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Student/{$.ID}/{$.FirstName}"
+    ] .
+
+

Output

+
 <http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+
+
+
+

115. RMLTC0007a-MySQL

+

Title: "Typing resources by relying on rdf:type predicate"

+

Description: "Tests the typing resources by relying on rdf:type predicate"

+

Error expected? No

+

Input

+
USE test;
+DROP TABLE IF EXISTS test.student;
+
+CREATE TABLE student (
+  ID INTEGER,
+  FirstName VARCHAR(50),
+  LastName VARCHAR(50)
+);
+INSERT INTO student values ('10', 'Venus', 'Williams');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "student"
+    ];
+  rml:predicateObjectMap [
+      rml:object foaf:Person;
+      rml:predicate rdf:type
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Student/{ID}/{FirstName}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
+  d2rq:password "";
+  d2rq:username "root" .
+
+

Output

+
 <http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+
+
+
+

116. RMLTC0007a-PostgreSQL

+

Title: "Typing resources by relying on rdf:type predicate"

+

Description: "Tests the typing resources by relying on rdf:type predicate"

+

Error expected? No

+

Input

+
DROP TABLE IF EXISTS student;
+
+CREATE TABLE student (
+  "ID" INTEGER,
+  "FirstName" VARCHAR(50),
+  "LastName" VARCHAR(50)
+);
+INSERT INTO student values ('10', 'Venus', 'Williams');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "student"
+    ];
+  rml:predicateObjectMap [
+      rml:object foaf:Person;
+      rml:predicate rdf:type
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Student/{ID}/{FirstName}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "org.postgresql.Driver";
+  d2rq:password "";
+  d2rq:username "postgres" .
+
+

Output

+
 <http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+
+
+
+

117. RMLTC0007a-SPARQL

+

Title: "Typing resources by relying on rdf:type predicate"

+

Description: "Tests the typing resources by relying on rdf:type predicate"

+

Error expected? No

+

Input

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+
+[] rdf:ID "10" ;
+    foaf:firstName "Venus" ;
+    foaf:lastName "Williams" .
+
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix sd: <http://www.w3.org/ns/sparql-service-description#> .
+
+<http://example.com/base#Country> rml:logicalSource [
+      rml:iterator """
+            PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
+            PREFIX foaf: <http://xmlns.com/foaf/0.1/>
+            PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
+            SELECT ?FirstName ?LastName ?ID
+            WHERE {
+                ?x  foaf:firstName ?FirstName ;
+                    foaf:lastName  ?LastName ;
+                    rdf:ID         ?ID .
+            } """;
+      rml:referenceFormulation formats:SPARQL_Results_JSON;
+      rml:source <http://example.com/base#InputSPARQL>
+    ];
+  rml:predicateObjectMap [
+      rml:object foaf:Person;
+      rml:predicate rdf:type
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Student/{ID.value}/{FirstName.value}"
+    ] .
+
+<http://example.com/base#InputSPARQL> a sd:Service;
+  sd:endpoint <http://HOST:PORT/ds1/sparql>;
+  sd:supportedLanguage sd:SPARQL11Query .
+
+

Output

+
 <http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+
+
+
+

118. RMLTC0007a-SQLServer

+

Title: "Typing resources by relying on rdf:type predicate"

+

Description: "Tests the typing resources by relying on rdf:type predicate"

+

Error expected? No

+

Input

+
USE TestDB;
+DROP TABLE IF EXISTS student;
+CREATE TABLE student (
+  "ID" INTEGER,
+  "FirstName" VARCHAR(50),
+  "LastName" VARCHAR(50)
+);
+INSERT INTO student values ('10', 'Venus', 'Williams');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "student"
+    ];
+  rml:predicateObjectMap [
+      rml:object foaf:Person;
+      rml:predicate rdf:type
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Student/{ID}/{FirstName}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
+  d2rq:password "YourSTRONG!Passw0rd;";
+  d2rq:username "sa" .
+
+

Output

+
 <http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+
+
+
+

119. RMLTC0007a-XML

+

Title: "Typing resources by relying on rdf:type predicate"

+

Description: "Tests the typing resources by relying on rdf:type predicate"

+

Error expected? No

+

Input

+
<?xml version="1.0"?>
+
+<students>
+  <student>
+    <ID>10</ID>
+    <FirstName>Venus</FirstName>
+    <LastName>Williams</LastName>
+  </student>
+</students>
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "/students/student";
+      rml:referenceFormulation rml:XPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.xml"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:object foaf:Person;
+      rml:predicate rdf:type
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Student/{ID}/{FirstName}"
+    ] .
+
+

Output

+
 <http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+
+
+
+

120. RMLTC0007b-CSV

+

Title: "Assigning triples to Named Graphs"

+

Description: "Tests the generation of triples to a named graph"

+

Error expected? No

+

Input

+
ID,FirstName,LastName
+10,Venus,Williams
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:referenceFormulation rml:CSV;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.csv"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:object foaf:Person;
+      rml:predicate rdf:type
+    ], [
+      rml:objectMap [
+          rml:reference "FirstName"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:graph ex:PersonGraph;
+      rml:template "http://example.com/Student/{ID}/{FirstName}"
+    ] .
+
+

Output

+
<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" <http://example.com/PersonGraph> . 
+<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person>  <http://example.com/PersonGraph> .
+
+
+
+

121. RMLTC0007b-JSON

+

Title: "Assigning triples to Named Graphs"

+

Description: "Tests the generation of triples to a named graph"

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "FirstName":"Venus",
+    "LastName":"Williams"
+  }]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:object foaf:Person;
+      rml:predicate rdf:type
+    ], [
+      rml:objectMap [
+          rml:reference "$.FirstName"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:graph ex:PersonGraph;
+      rml:template "http://example.com/Student/{$.ID}/{$.FirstName}"
+    ] .
+
+

Output

+
<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" <http://example.com/PersonGraph> . 
+<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person>  <http://example.com/PersonGraph> .
+
+
+
+

122. RMLTC0007b-MySQL

+

Title: "Assigning triples to Named Graphs"

+

Description: "Tests the generation of triples to a named graph"

+

Error expected? No

+

Input

+
USE test;
+DROP TABLE IF EXISTS test.student;
+
+CREATE TABLE student (
+  ID INTEGER,
+  FirstName VARCHAR(50),
+  LastName VARCHAR(50)
+);
+INSERT INTO student values ('10', 'Venus', 'Williams');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "student"
+    ];
+  rml:predicateObjectMap [
+      rml:object foaf:Person;
+      rml:predicate rdf:type
+    ], [
+      rml:objectMap [
+          rml:reference "FirstName"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:graph ex:PersonGraph;
+      rml:template "http://example.com/Student/{ID}/{FirstName}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
+  d2rq:password "";
+  d2rq:username "root" .
+
+

Output

+
<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" <http://example.com/PersonGraph> . 
+<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person>  <http://example.com/PersonGraph> .
+
+
+
+

123. RMLTC0007b-PostgreSQL

+

Title: "Assigning triples to Named Graphs"

+

Description: "Tests the generation of triples to a named graph"

+

Error expected? No

+

Input

+
DROP TABLE IF EXISTS student;
+
+CREATE TABLE student (
+  "ID" INTEGER,
+  "FirstName" VARCHAR(50),
+  "LastName" VARCHAR(50)
+);
+INSERT INTO student values ('10', 'Venus', 'Williams');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "student"
+    ];
+  rml:predicateObjectMap [
+      rml:object foaf:Person;
+      rml:predicate rdf:type
+    ], [
+      rml:objectMap [
+          rml:reference "FirstName"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:graph ex:PersonGraph;
+      rml:template "http://example.com/Student/{ID}/{FirstName}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "org.postgresql.Driver";
+  d2rq:password "";
+  d2rq:username "postgres" .
+
+

Output

+
<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" <http://example.com/PersonGraph> . 
+<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person>  <http://example.com/PersonGraph> .
+
+
+
+

124. RMLTC0007b-SPARQL

+

Title: "Assigning triples to Named Graphs"

+

Description: "Tests the generation of triples to a named graph"

+

Error expected? No

+

Input

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+
+[] rdf:ID "10" ;
+    foaf:firstName "Venus" ;
+    foaf:lastName "Williams" .
+
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix sd: <http://www.w3.org/ns/sparql-service-description#> .
+
+<http://example.com/base#Country> rml:logicalSource [
+      rml:iterator """
+            PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
+            PREFIX foaf: <http://xmlns.com/foaf/0.1/>
+            PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
+            SELECT ?FirstName ?LastName ?ID
+            WHERE {
+                ?x  foaf:firstName ?FirstName ;
+                    foaf:lastName  ?LastName ;
+                    rdf:ID         ?ID .
+            } """;
+      rml:referenceFormulation formats:SPARQL_Results_JSON;
+      rml:source <http://example.com/base#InputSPARQL>
+    ];
+  rml:predicateObjectMap [
+      rml:object foaf:Person;
+      rml:predicate rdf:type
+    ], [
+      rml:objectMap [
+          rml:reference "FirstName.value"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:graph ex:PersonGraph;
+      rml:template "http://example.com/Student/{ID.value}/{FirstName.value}"
+    ] .
+
+<http://example.com/base#InputSPARQL> a sd:Service;
+  sd:endpoint <http://HOST:PORT/ds1/sparql>;
+  sd:supportedLanguage sd:SPARQL11Query .
+
+

Output

+
<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" <http://example.com/PersonGraph> . 
+<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person>  <http://example.com/PersonGraph> .
+
+
+
+

125. RMLTC0007b-SQLServer

+

Title: "Assigning triples to Named Graphs"

+

Description: "Tests the generation of triples to a named graph"

+

Error expected? No

+

Input

+
USE TestDB;
+DROP TABLE IF EXISTS student;
+CREATE TABLE student (
+  "ID" INTEGER,
+  "FirstName" VARCHAR(50),
+  "LastName" VARCHAR(50)
+);
+INSERT INTO student values ('10', 'Venus', 'Williams');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "student"
+    ];
+  rml:predicateObjectMap [
+      rml:object foaf:Person;
+      rml:predicate rdf:type
+    ], [
+      rml:objectMap [
+          rml:reference "FirstName"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:graph ex:PersonGraph;
+      rml:template "http://example.com/Student/{ID}/{FirstName}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
+  d2rq:password "YourSTRONG!Passw0rd;";
+  d2rq:username "sa" .
+
+

Output

+
<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" <http://example.com/PersonGraph> . 
+<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person>  <http://example.com/PersonGraph> .
+
+
+
+

126. RMLTC0007b-XML

+

Title: "Assigning triples to Named Graphs"

+

Description: "Tests the generation of triples to a named graph"

+

Error expected? No

+

Input

+
<?xml version="1.0"?>
+
+<students>
+  <student>
+    <ID>10</ID>
+    <FirstName>Venus</FirstName>
+    <LastName>Williams</LastName>
+  </student>
+</students>
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "/students/student";
+      rml:referenceFormulation rml:XPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.xml"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:object foaf:Person;
+      rml:predicate rdf:type
+    ], [
+      rml:objectMap [
+          rml:reference "FirstName"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:graph ex:PersonGraph;
+      rml:template "http://example.com/Student/{ID}/{FirstName}"
+    ] .
+
+

Output

+
<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" <http://example.com/PersonGraph> . 
+<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person>  <http://example.com/PersonGraph> .
+
+
+
+

127. RMLTC0007c-CSV

+

Title: "One row mapping, using rr:class"

+

Description: "Tests subjectmap with more than one class IRIs, rr:class"

+

Error expected? No

+

Input

+
ID,FirstName,LastName
+10,Venus,Williams
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:referenceFormulation rml:CSV;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.csv"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "ID"
+        ];
+      rml:predicate ex:id
+    ], [
+      rml:objectMap [
+          rml:reference "FirstName"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:class ex:Student, foaf:Person;
+      rml:template "http://example.com/Student/{ID}/{FirstName}"
+    ] .
+
+

Output

+
<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
+<http://example.com/Student/10/Venus> <http://example.com/id> "10" . 
+<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/Student> .
+
+
+
+

128. RMLTC0007c-JSON

+

Title: "One row mapping, using rr:class"

+

Description: "Tests subjectmap with more than one class IRIs, rr:class"

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "FirstName":"Venus",
+    "LastName":"Williams"
+  }]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.ID"
+        ];
+      rml:predicate ex:id
+    ], [
+      rml:objectMap [
+          rml:reference "$.FirstName"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:class ex:Student, foaf:Person;
+      rml:template "http://example.com/Student/{$.ID}/{$.FirstName}"
+    ] .
+
+

Output

+
<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
+<http://example.com/Student/10/Venus> <http://example.com/id> "10" . 
+<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/Student> .
+
+
+
+

129. RMLTC0007c-MySQL

+

Title: "One row mapping, using rr:class"

+

Description: "Tests subjectmap with more than one class IRIs, rr:class"

+

Error expected? No

+

Input

+
USE test;
+DROP TABLE IF EXISTS test.student;
+
+CREATE TABLE student (
+  ID INTEGER,
+  FirstName VARCHAR(50),
+  LastName VARCHAR(50)
+);
+INSERT INTO student values ('10', 'Venus', 'Williams');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "student"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "ID"
+        ];
+      rml:predicate ex:id
+    ], [
+      rml:objectMap [
+          rml:reference "FirstName"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:class ex:Student, foaf:Person;
+      rml:template "http://example.com/Student/{ID}/{FirstName}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
+  d2rq:password "";
+  d2rq:username "root" .
+
+

Output

+
<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
+<http://example.com/Student/10/Venus> <http://example.com/id> "10"^^<http://www.w3.org/2001/XMLSchema#integer> . 
+<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/Student> .
+
+
+
+

130. RMLTC0007c-PostgreSQL

+

Title: "One row mapping, using rr:class"

+

Description: "Tests subjectmap with more than one class IRIs, rr:class"

+

Error expected? No

+

Input

+
DROP TABLE IF EXISTS student;
+
+CREATE TABLE student (
+  "ID" INTEGER,
+  "FirstName" VARCHAR(50),
+  "LastName" VARCHAR(50)
+);
+INSERT INTO student values ('10', 'Venus', 'Williams');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "student"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "ID"
+        ];
+      rml:predicate ex:id
+    ], [
+      rml:objectMap [
+          rml:reference "FirstName"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:class ex:Student, foaf:Person;
+      rml:template "http://example.com/Student/{ID}/{FirstName}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "org.postgresql.Driver";
+  d2rq:password "";
+  d2rq:username "postgres" .
+
+

Output

+
<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
+<http://example.com/Student/10/Venus> <http://example.com/id> "10"^^<http://www.w3.org/2001/XMLSchema#integer> . 
+<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/Student> .
+
+
+
+

131. RMLTC0007c-SPARQL

+

Title: "One object mapping, using rr:class"

+

Description: "Tests subjectmap with more than one class IRIs, rr:class"

+

Error expected? No

+

Input

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+
+[] rdf:ID "10" ;
+    foaf:firstName "Venus" ;
+    foaf:lastName "Williams" .
+
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix sd: <http://www.w3.org/ns/sparql-service-description#> .
+
+<http://example.com/base#Country> rml:logicalSource [
+      rml:iterator """
+            PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
+            PREFIX foaf: <http://xmlns.com/foaf/0.1/>
+            PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
+            SELECT ?FirstName ?LastName ?ID
+            WHERE {
+                ?x  foaf:firstName ?FirstName ;
+                    foaf:lastName  ?LastName ;
+                    rdf:ID         ?ID .
+            } """;
+      rml:referenceFormulation formats:SPARQL_Results_JSON;
+      rml:source <http://example.com/base#InputSPARQL>
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "FirstName.value"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:class ex:Student, foaf:Person;
+      rml:template "http://example.com/Student/{ID.value}/{FirstName.value}"
+    ] .
+
+<http://example.com/base#InputSPARQL> a sd:Service;
+  sd:endpoint <http://HOST:PORT/ds1/sparql>;
+  sd:supportedLanguage sd:SPARQL11Query .
+
+

Output

+
<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" . 
+<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/Student> .
+
+
+
+

132. RMLTC0007c-SQLServer

+

Title: "One row mapping, using rr:class"

+

Description: "Tests subjectmap with more than one class IRIs, rr:class"

+

Error expected? No

+

Input

+
USE TestDB;
+DROP TABLE IF EXISTS student;
+CREATE TABLE student (
+  "ID" INTEGER,
+  "FirstName" VARCHAR(50),
+  "LastName" VARCHAR(50)
+);
+INSERT INTO student values ('10', 'Venus', 'Williams');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "student"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "ID"
+        ];
+      rml:predicate ex:id
+    ], [
+      rml:objectMap [
+          rml:reference "FirstName"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:class ex:Student, foaf:Person;
+      rml:template "http://example.com/Student/{ID}/{FirstName}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
+  d2rq:password "YourSTRONG!Passw0rd;";
+  d2rq:username "sa" .
+
+

Output

+
<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
+<http://example.com/Student/10/Venus> <http://example.com/id> "10"^^<http://www.w3.org/2001/XMLSchema#integer> . 
+<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/Student> .
+
+
+
+

133. RMLTC0007c-XML

+

Title: "One row mapping, using rr:class"

+

Description: "Tests subjectmap with more than one class IRIs, rr:class"

+

Error expected? No

+

Input

+
<?xml version="1.0"?>
+
+<students>
+  <student>
+    <ID>10</ID>
+    <FirstName>Venus</FirstName>
+    <LastName>Williams</LastName>
+  </student>
+</students>
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "/students/student";
+      rml:referenceFormulation rml:XPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.xml"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "ID"
+        ];
+      rml:predicate ex:id
+    ], [
+      rml:objectMap [
+          rml:reference "FirstName"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:class ex:Student, foaf:Person;
+      rml:template "http://example.com/Student/{ID}/{FirstName}"
+    ] .
+
+

Output

+
<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
+<http://example.com/Student/10/Venus> <http://example.com/id> "10" . 
+<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/Student> .
+
+
+
+

134. RMLTC0007d-CSV

+

Title: "One column mapping, specifying an rr:predicateObjectMap with rdf:type"

+

Description: "Tests subjectmap with an alternative of having rr:class, i.e., by specifying an rr:predicateObjectMap with predicate rdf:type"

+

Error expected? No

+

Input

+
ID,FirstName,LastName
+10,Venus,Williams
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:referenceFormulation rml:CSV;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.csv"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:object foaf:Person;
+      rml:predicate rdf:type
+    ], [
+      rml:object ex:Student;
+      rml:predicate rdf:type
+    ], [
+      rml:objectMap [
+          rml:reference "ID"
+        ];
+      rml:predicate ex:id
+    ], [
+      rml:objectMap [
+          rml:reference "FirstName"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Student/{ID}/{FirstName}"
+    ] .
+
+

Output

+
<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" . 
+<http://example.com/Student/10/Venus> <http://example.com/id> "10" .
+<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/Student> .
+
+
+
+

135. RMLTC0007d-JSON

+

Title: "One column mapping, specifying an rr:predicateObjectMap with rdf:type"

+

Description: "Tests subjectmap with an alternative of having rr:class, i.e., by specifying an rr:predicateObjectMap with predicate rdf:type"

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "FirstName":"Venus",
+    "LastName":"Williams"
+  }]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:object foaf:Person;
+      rml:predicate rdf:type
+    ], [
+      rml:object ex:Student;
+      rml:predicate rdf:type
+    ], [
+      rml:objectMap [
+          rml:reference "$.ID"
+        ];
+      rml:predicate ex:id
+    ], [
+      rml:objectMap [
+          rml:reference "$.FirstName"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Student/{$.ID}/{$.FirstName}"
+    ] .
+
+

Output

+
<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" . 
+<http://example.com/Student/10/Venus> <http://example.com/id> "10" .
+<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/Student> .
+
+
+
+

136. RMLTC0007d-MySQL

+

Title: "One column mapping, specifying an rr:predicateObjectMap with rdf:type"

+

Description: "Tests subjectmap with an alternative of having rr:class, i.e., by specifying an rr:predicateObjectMap with predicate rdf:type"

+

Error expected? No

+

Input

+
USE test;
+DROP TABLE IF EXISTS test.student;
+
+CREATE TABLE student (
+  ID INTEGER,
+  FirstName VARCHAR(50),
+  LastName VARCHAR(50)
+);
+INSERT INTO student values ('10', 'Venus', 'Williams');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "student"
+    ];
+  rml:predicateObjectMap [
+      rml:object foaf:Person;
+      rml:predicate rdf:type
+    ], [
+      rml:object ex:Student;
+      rml:predicate rdf:type
+    ], [
+      rml:objectMap [
+          rml:reference "ID"
+        ];
+      rml:predicate ex:id
+    ], [
+      rml:objectMap [
+          rml:reference "FirstName"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Student/{ID}/{FirstName}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
+  d2rq:password "";
+  d2rq:username "root" .
+
+

Output

+
<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
+<http://example.com/Student/10/Venus> <http://example.com/id> "10"^^<http://www.w3.org/2001/XMLSchema#integer> . 
+<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/Student> .
+
+
+
+

137. RMLTC0007d-PostgreSQL

+

Title: "One column mapping, specifying an rr:predicateObjectMap with rdf:type"

+

Description: "Tests subjectmap with an alternative of having rr:class, i.e., by specifying an rr:predicateObjectMap with predicate rdf:type"

+

Error expected? No

+

Input

+
DROP TABLE IF EXISTS student;
+
+CREATE TABLE student (
+  "ID" INTEGER,
+  "FirstName" VARCHAR(50),
+  "LastName" VARCHAR(50)
+);
+INSERT INTO student values ('10', 'Venus', 'Williams');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "student"
+    ];
+  rml:predicateObjectMap [
+      rml:object foaf:Person;
+      rml:predicate rdf:type
+    ], [
+      rml:object ex:Student;
+      rml:predicate rdf:type
+    ], [
+      rml:objectMap [
+          rml:reference "ID"
+        ];
+      rml:predicate ex:id
+    ], [
+      rml:objectMap [
+          rml:reference "FirstName"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Student/{ID}/{FirstName}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "org.postgresql.Driver";
+  d2rq:password "";
+  d2rq:username "postgres" .
+
+

Output

+
<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
+<http://example.com/Student/10/Venus> <http://example.com/id> "10"^^<http://www.w3.org/2001/XMLSchema#integer> . 
+<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/Student> .
+
+
+
+

138. RMLTC0007d-SPARQL

+

Title: "One object mapping, specifying an rr:predicateObjectMap with rdf:type"

+

Description: "Tests subjectmap with an alternative of having rr:class, i.e., by specifying an rr:predicateObjectMap with predicate rdf:type"

+

Error expected? No

+

Input

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+
+[] rdf:ID "10" ;
+    foaf:firstName "Venus" ;
+    foaf:lastName "Williams" .
+
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix sd: <http://www.w3.org/ns/sparql-service-description#> .
+
+<http://example.com/base#Country> rml:logicalSource [
+      rml:iterator """
+            PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
+            PREFIX foaf: <http://xmlns.com/foaf/0.1/>
+            PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
+            SELECT ?FirstName ?LastName ?ID
+            WHERE {
+                ?x  foaf:firstName ?FirstName ;
+                    foaf:lastName  ?LastName ;
+                    rdf:ID         ?ID .
+            } """;
+      rml:referenceFormulation formats:SPARQL_Results_JSON;
+      rml:source <http://example.com/base#InputSPARQL>
+    ];
+  rml:predicateObjectMap [
+      rml:object foaf:Person;
+      rml:predicate rdf:type
+    ], [
+      rml:object ex:Student;
+      rml:predicate rdf:type
+    ], [
+      rml:objectMap [
+          rml:reference "FirstName.value"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Student/{ID.value}/{FirstName.value}"
+    ] .
+
+<http://example.com/base#InputSPARQL> a sd:Service;
+  sd:endpoint <http://HOST:PORT/ds1/sparql>;
+  sd:supportedLanguage sd:SPARQL11Query .
+
+

Output

+
<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" . 
+<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/Student> .
+
+
+
+

139. RMLTC0007d-SQLServer

+

Title: "One column mapping, specifying an rr:predicateObjectMap with rdf:type"

+

Description: "Tests subjectmap with an alternative of having rr:class, i.e., by specifying an rr:predicateObjectMap with predicate rdf:type"

+

Error expected? No

+

Input

+
USE TestDB;
+DROP TABLE IF EXISTS student;
+CREATE TABLE student (
+  "ID" INTEGER,
+  "FirstName" VARCHAR(50),
+  "LastName" VARCHAR(50)
+);
+INSERT INTO student values ('10', 'Venus', 'Williams');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "student"
+    ];
+  rml:predicateObjectMap [
+      rml:object foaf:Person;
+      rml:predicate rdf:type
+    ], [
+      rml:object ex:Student;
+      rml:predicate rdf:type
+    ], [
+      rml:objectMap [
+          rml:reference "ID"
+        ];
+      rml:predicate ex:id
+    ], [
+      rml:objectMap [
+          rml:reference "FirstName"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Student/{ID}/{FirstName}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
+  d2rq:password "YourSTRONG!Passw0rd;";
+  d2rq:username "sa" .
+
+

Output

+
<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
+<http://example.com/Student/10/Venus> <http://example.com/id> "10"^^<http://www.w3.org/2001/XMLSchema#integer> . 
+<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/Student> .
+
+
+
+

140. RMLTC0007d-XML

+

Title: "One column mapping, specifying an rr:predicateObjectMap with rdf:type"

+

Description: "Tests subjectmap with an alternative of having rr:class, i.e., by specifying an rr:predicateObjectMap with predicate rdf:type"

+

Error expected? No

+

Input

+
<?xml version="1.0"?>
+
+<students>
+  <student>
+    <ID>10</ID>
+    <FirstName>Venus</FirstName>
+    <LastName>Williams</LastName>
+  </student>
+</students>
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "/students/student";
+      rml:referenceFormulation rml:XPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.xml"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:object foaf:Person;
+      rml:predicate rdf:type
+    ], [
+      rml:object ex:Student;
+      rml:predicate rdf:type
+    ], [
+      rml:objectMap [
+          rml:reference "ID"
+        ];
+      rml:predicate ex:id
+    ], [
+      rml:objectMap [
+          rml:reference "FirstName"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Student/{ID}/{FirstName}"
+    ] .
+
+

Output

+
<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" . 
+<http://example.com/Student/10/Venus> <http://example.com/id> "10" .
+<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/Student> .
+
+
+
+

141. RMLTC0007e-CSV

+

Title: "One column mapping, using rr:graphMap and rr:class"

+

Description: "Tests subjectmap with rr:graphMap and rr:class"

+

Error expected? No

+

Input

+
ID,Name
+10,Venus
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:referenceFormulation rml:CSV;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.csv"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "ID"
+        ];
+      rml:predicate ex:id
+    ], [
+      rml:objectMap [
+          rml:reference "Name"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:class foaf:Person;
+      rml:graph ex:PersonGraph;
+      rml:template "http://example.com/Student/{ID}/{Name}"
+    ] .
+
+

Output

+
<http://example.com/Student/10/Venus> <http://example.com/id> "10" <http://example.com/PersonGraph> .
+<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" <http://example.com/PersonGraph> .
+<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> <http://example.com/PersonGraph> .
+
+
+
+

142. RMLTC0007e-JSON

+

Title: "One column mapping, using rr:graphMap and rr:class"

+

Description: "Tests subjectmap with rr:graphMap and rr:class"

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "Name":"Venus"
+  }]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.ID"
+        ];
+      rml:predicate ex:id
+    ], [
+      rml:objectMap [
+          rml:reference "$.Name"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:class foaf:Person;
+      rml:graph ex:PersonGraph;
+      rml:template "http://example.com/Student/{$.ID}/{$.Name}"
+    ] .
+
+

Output

+
<http://example.com/Student/10/Venus> <http://example.com/id> "10" <http://example.com/PersonGraph> .
+<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" <http://example.com/PersonGraph> .
+<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> <http://example.com/PersonGraph> .
+
+
+
+

143. RMLTC0007e-MySQL

+

Title: "One column mapping, using rr:graphMap and rr:class"

+

Description: "Tests subjectmap with rr:graphMap and rr:class"

+

Error expected? No

+

Input

+
USE test;
+DROP TABLE IF EXISTS test.student;
+
+CREATE TABLE student (
+  ID INTEGER,
+  FirstName VARCHAR(50),
+  LastName VARCHAR(50)
+);
+INSERT INTO student values ('10', 'Venus', 'Williams');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "student"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "ID"
+        ];
+      rml:predicate ex:id
+    ], [
+      rml:objectMap [
+          rml:reference "FirstName"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:class foaf:Person;
+      rml:graph ex:PersonGraph;
+      rml:template "http://example.com/Student/{ID}/{FirstName}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
+  d2rq:password "";
+  d2rq:username "root" .
+
+

Output

+
<http://example.com/Student/10/Venus> <http://example.com/id> "10"^^<http://www.w3.org/2001/XMLSchema#integer> <http://example.com/PersonGraph> .
+<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" <http://example.com/PersonGraph> .
+<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> <http://example.com/PersonGraph> .
+
+
+
+

144. RMLTC0007e-PostgreSQL

+

Title: "One column mapping, using rr:graphMap and rr:class"

+

Description: "Tests subjectmap with rr:graphMap and rr:class"

+

Error expected? No

+

Input

+
DROP TABLE IF EXISTS student;
+
+CREATE TABLE student (
+  "ID" INTEGER,
+  "FirstName" VARCHAR(50),
+  "LastName" VARCHAR(50)
+);
+INSERT INTO student values ('10', 'Venus', 'Williams');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "student"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "ID"
+        ];
+      rml:predicate ex:id
+    ], [
+      rml:objectMap [
+          rml:reference "FirstName"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:class foaf:Person;
+      rml:graph ex:PersonGraph;
+      rml:template "http://example.com/Student/{ID}/{FirstName}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "org.postgresql.Driver";
+  d2rq:password "";
+  d2rq:username "postgres" .
+
+

Output

+
<http://example.com/Student/10/Venus> <http://example.com/id> "10"^^<http://www.w3.org/2001/XMLSchema#integer> <http://example.com/PersonGraph> .
+<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" <http://example.com/PersonGraph> .
+<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> <http://example.com/PersonGraph> .
+
+
+
+

145. RMLTC0007e-SPARQL

+

Title: "One object mapping, using rr:graphMap and rr:class"

+

Description: "Tests subjectmap with rr:graphMap and rr:class"

+

Error expected? No

+

Input

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+
+[] rdf:ID "10" ;
+    foaf:firstName "Venus" ;
+    foaf:lastName "Williams" .
+
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix sd: <http://www.w3.org/ns/sparql-service-description#> .
+
+<http://example.com/base#Country> rml:logicalSource [
+      rml:iterator """
+            PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
+            PREFIX foaf: <http://xmlns.com/foaf/0.1/>
+            PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
+            SELECT ?FirstName ?LastName ?ID
+            WHERE {
+                ?x  foaf:firstName ?FirstName ;
+                    foaf:lastName  ?LastName ;
+                    rdf:ID         ?ID .
+            } """;
+      rml:referenceFormulation formats:SPARQL_Results_JSON;
+      rml:source <http://example.com/base#InputSPARQL>
+    ];
+  rml:subjectMap [
+      rml:class foaf:Person;
+      rml:graph ex:PersonGraph;
+      rml:template "http://example.com/Student/{ID.value}/{FirstName.value}"
+    ] .
+
+<http://example.com/base#InputSPARQL> a sd:Service;
+  sd:endpoint <http://HOST:PORT/ds1/sparql>;
+  sd:supportedLanguage sd:SPARQL11Query .
+
+

Output

+
<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> <http://example.com/PersonGraph> .
+
+
+
+

146. RMLTC0007e-SQLServer

+

Title: "One column mapping, using rr:graphMap and rr:class"

+

Description: "Tests subjectmap with rr:graphMap and rr:class"

+

Error expected? No

+

Input

+
USE TestDB;
+DROP TABLE IF EXISTS student;
+CREATE TABLE student (
+  "ID" INTEGER,
+  "FirstName" VARCHAR(50),
+  "LastName" VARCHAR(50)
+);
+INSERT INTO student values ('10', 'Venus', 'Williams');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "student"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "ID"
+        ];
+      rml:predicate ex:id
+    ], [
+      rml:objectMap [
+          rml:reference "FirstName"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:class foaf:Person;
+      rml:graph ex:PersonGraph;
+      rml:template "http://example.com/Student/{ID}/{FirstName}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
+  d2rq:password "YourSTRONG!Passw0rd;";
+  d2rq:username "sa" .
+
+

Output

+
<http://example.com/Student/10/Venus> <http://example.com/id> "10"^^<http://www.w3.org/2001/XMLSchema#integer> <http://example.com/PersonGraph> .
+<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" <http://example.com/PersonGraph> .
+<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> <http://example.com/PersonGraph> .
+
+
+
+

147. RMLTC0007e-XML

+

Title: "One column mapping, using rr:graphMap and rr:class"

+

Description: "Tests subjectmap with rr:graphMap and rr:class"

+

Error expected? No

+

Input

+
<?xml version="1.0"?>
+
+<students>
+  <student>
+    <ID>10</ID>
+    <Name>Venus</Name>
+  </student>
+</students>
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "/students/student";
+      rml:referenceFormulation rml:XPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.xml"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "ID"
+        ];
+      rml:predicate ex:id
+    ], [
+      rml:objectMap [
+          rml:reference "Name"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:class foaf:Person;
+      rml:graph ex:PersonGraph;
+      rml:template "http://example.com/Student/{ID}/{Name}"
+    ] .
+
+

Output

+
<http://example.com/Student/10/Venus> <http://example.com/id> "10" <http://example.com/PersonGraph> .
+<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" <http://example.com/PersonGraph> .
+<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> <http://example.com/PersonGraph> .
+
+
+
+

148. RMLTC0007f-CSV

+

Title: "One column mapping, using rr:graphMap and specifying an rr:predicateObjectMap with rdf:type"

+

Description: "Tests subjectmap with rr:graphMap and specifying an rr:predicateObjectMap with predicate rdf:type"

+

Error expected? No

+

Input

+
ID,FirstName,LastName
+10,Venus,Williams
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:referenceFormulation rml:CSV;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.csv"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:object foaf:Person;
+      rml:predicate rdf:type
+    ], [
+      rml:objectMap [
+          rml:reference "ID"
+        ];
+      rml:predicate ex:id
+    ], [
+      rml:objectMap [
+          rml:reference "FirstName"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:graph ex:PersonGraph;
+      rml:template "http://example.com/Student/{ID}/{FirstName}"
+    ] .
+
+

Output

+
<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> <http://example.com/PersonGraph> .
+<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" <http://example.com/PersonGraph> .
+<http://example.com/Student/10/Venus> <http://example.com/id> "10" <http://example.com/PersonGraph> .
+
+
+
+

149. RMLTC0007f-JSON

+

Title: "One column mapping, using rr:graphMap and specifying an rr:predicateObjectMap with rdf:type"

+

Description: "Tests subjectmap with rr:graphMap and specifying an rr:predicateObjectMap with predicate rdf:type"

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "FirstName":"Venus",
+    "LastName":"Williams"
+  }]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:object foaf:Person;
+      rml:predicate rdf:type
+    ], [
+      rml:objectMap [
+          rml:reference "$.ID"
+        ];
+      rml:predicate ex:id
+    ], [
+      rml:objectMap [
+          rml:reference "$.FirstName"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:graph ex:PersonGraph;
+      rml:template "http://example.com/Student/{$.ID}/{$.FirstName}"
+    ] .
+
+

Output

+
<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> <http://example.com/PersonGraph> .
+<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" <http://example.com/PersonGraph> .
+<http://example.com/Student/10/Venus> <http://example.com/id> "10" <http://example.com/PersonGraph> .
+
+
+
+

150. RMLTC0007f-MySQL

+

Title: "One column mapping, using rr:graphMap and specifying an rr:predicateObjectMap with rdf:type"

+

Description: "Tests subjectmap with rr:graphMap and specifying an rr:predicateObjectMap with predicate rdf:type"

+

Error expected? No

+

Input

+
USE test;
+DROP TABLE IF EXISTS test.student;
+
+CREATE TABLE student (
+  ID INTEGER,
+  FirstName VARCHAR(50),
+  LastName VARCHAR(50)
+);
+INSERT INTO student values ('10', 'Venus', 'Williams');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "student"
+    ];
+  rml:predicateObjectMap [
+      rml:object foaf:Person;
+      rml:predicate rdf:type
+    ], [
+      rml:objectMap [
+          rml:reference "ID"
+        ];
+      rml:predicate ex:id
+    ], [
+      rml:objectMap [
+          rml:reference "FirstName"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:graph ex:PersonGraph;
+      rml:template "http://example.com/Student/{ID}/{FirstName}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
+  d2rq:password "";
+  d2rq:username "root" .
+
+

Output

+
<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> <http://example.com/PersonGraph> .
+<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" <http://example.com/PersonGraph> .
+<http://example.com/Student/10/Venus> <http://example.com/id> "10"^^<http://www.w3.org/2001/XMLSchema#integer> <http://example.com/PersonGraph> .
+
+
+
+

151. RMLTC0007f-PostgreSQL

+

Title: "One column mapping, using rr:graphMap and specifying an rr:predicateObjectMap with rdf:type"

+

Description: "Tests subjectmap with rr:graphMap and specifying an rr:predicateObjectMap with predicate rdf:type"

+

Error expected? No

+

Input

+
DROP TABLE IF EXISTS student;
+
+CREATE TABLE student (
+  "ID" INTEGER,
+  "FirstName" VARCHAR(50),
+  "LastName" VARCHAR(50)
+);
+INSERT INTO student values ('10', 'Venus', 'Williams');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "student"
+    ];
+  rml:predicateObjectMap [
+      rml:object foaf:Person;
+      rml:predicate rdf:type
+    ], [
+      rml:objectMap [
+          rml:reference "ID"
+        ];
+      rml:predicate ex:id
+    ], [
+      rml:objectMap [
+          rml:reference "FirstName"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:graph ex:PersonGraph;
+      rml:template "http://example.com/Student/{ID}/{FirstName}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "org.postgresql.Driver";
+  d2rq:password "";
+  d2rq:username "postgres" .
+
+

Output

+
<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> <http://example.com/PersonGraph> .
+<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" <http://example.com/PersonGraph> .
+<http://example.com/Student/10/Venus> <http://example.com/id> "10"^^<http://www.w3.org/2001/XMLSchema#integer> <http://example.com/PersonGraph> .
+
+
+
+

152. RMLTC0007f-SPARQL

+

Title: "One object mapping, using rr:graphMap and specifying an rr:predicateObjectMap with rdf:type"

+

Description: "Tests subjectmap with rr:graphMap and specifying an rr:predicateObjectMap with predicate rdf:type"

+

Error expected? No

+

Input

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+
+[] rdf:ID "10" ;
+    foaf:firstName "Venus" ;
+    foaf:lastName "Williams" .
+
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix sd: <http://www.w3.org/ns/sparql-service-description#> .
+
+<http://example.com/base#Country> rml:logicalSource [
+      rml:iterator """
+            PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
+            PREFIX foaf: <http://xmlns.com/foaf/0.1/>
+            PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
+            SELECT ?FirstName ?LastName ?ID
+            WHERE {
+                ?x  foaf:firstName ?FirstName ;
+                    foaf:lastName  ?LastName ;
+                    rdf:ID         ?ID .
+            } """;
+      rml:referenceFormulation formats:SPARQL_Results_JSON;
+      rml:source <http://example.com/base#InputSPARQL>
+    ];
+  rml:predicateObjectMap [
+      rml:object foaf:Person;
+      rml:predicate rdf:type
+    ];
+  rml:subjectMap [
+      rml:graph ex:PersonGraph;
+      rml:template "http://example.com/Student/{ID.value}/{FirstName.value}"
+    ] .
+
+<http://example.com/base#InputSPARQL> a sd:Service;
+  sd:endpoint <http://HOST:PORT/ds1/sparql>;
+  sd:supportedLanguage sd:SPARQL11Query .
+
+

Output

+
<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> <http://example.com/PersonGraph> .
+
+
+
+

153. RMLTC0007f-SQLServer

+

Title: "One column mapping, using rr:graphMap and specifying an rr:predicateObjectMap with rdf:type"

+

Description: "Tests subjectmap with rr:graphMap and specifying an rr:predicateObjectMap with predicate rdf:type"

+

Error expected? No

+

Input

+
USE TestDB;
+DROP TABLE IF EXISTS student;
+CREATE TABLE student (
+  "ID" INTEGER,
+  "FirstName" VARCHAR(50),
+  "LastName" VARCHAR(50)
+);
+INSERT INTO student values ('10', 'Venus', 'Williams');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "student"
+    ];
+  rml:predicateObjectMap [
+      rml:object foaf:Person;
+      rml:predicate rdf:type
+    ], [
+      rml:objectMap [
+          rml:reference "ID"
+        ];
+      rml:predicate ex:id
+    ], [
+      rml:objectMap [
+          rml:reference "FirstName"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:graph ex:PersonGraph;
+      rml:template "http://example.com/Student/{ID}/{FirstName}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
+  d2rq:password "YourSTRONG!Passw0rd;";
+  d2rq:username "sa" .
+
+

Output

+
<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> <http://example.com/PersonGraph> .
+<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" <http://example.com/PersonGraph> .
+<http://example.com/Student/10/Venus> <http://example.com/id> "10"^^<http://www.w3.org/2001/XMLSchema#integer> <http://example.com/PersonGraph> .
+
+
+
+

154. RMLTC0007f-XML

+

Title: "One column mapping, using rr:graphMap and specifying an rr:predicateObjectMap with rdf:type"

+

Description: "Tests subjectmap with rr:graphMap and specifying an rr:predicateObjectMap with predicate rdf:type"

+

Error expected? No

+

Input

+
<?xml version="1.0"?>
+
+<students>
+  <student>
+    <ID>10</ID>
+    <FirstName>Venus</FirstName>
+    <LastName>Williams</LastName>
+  </student>
+</students>
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "/students/student";
+      rml:referenceFormulation rml:XPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.xml"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:object foaf:Person;
+      rml:predicate rdf:type
+    ], [
+      rml:objectMap [
+          rml:reference "ID"
+        ];
+      rml:predicate ex:id
+    ], [
+      rml:objectMap [
+          rml:reference "FirstName"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:graph ex:PersonGraph;
+      rml:template "http://example.com/Student/{ID}/{FirstName}"
+    ] .
+
+

Output

+
<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> <http://example.com/PersonGraph> .
+<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" <http://example.com/PersonGraph> .
+<http://example.com/Student/10/Venus> <http://example.com/id> "10" <http://example.com/PersonGraph> .
+
+
+
+

155. RMLTC0007g-CSV

+

Title: "Assigning triples to the default graph"

+

Description: "Tests the generation of triples to the default graph"

+

Error expected? No

+

Input

+
ID,FirstName,LastName
+10,Venus,Williams
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:referenceFormulation rml:CSV;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.csv"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "FirstName"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:graph rml:defaultGraph;
+      rml:template "http://example.com/Student/{ID}/{FirstName}"
+    ] .
+
+

Output

+
<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
+
+
+
+

156. RMLTC0007g-JSON

+

Title: "Assigning triples to the default graph"

+

Description: "Tests the generation of triples to the default graph"

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "FirstName":"Venus",
+    "LastName":"Williams"
+  }]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.FirstName"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:graph rml:defaultGraph;
+      rml:template "http://example.com/Student/{$.ID}/{$.FirstName}"
+    ] .
+
+

Output

+
<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
+
+
+
+

157. RMLTC0007g-MySQL

+

Title: "Assigning triples to the default graph"

+

Description: "Tests the generation of triples to the default graph"

+

Error expected? No

+

Input

+
USE test;
+DROP TABLE IF EXISTS test.student;
+
+CREATE TABLE student (
+  ID INTEGER,
+  FirstName VARCHAR(50),
+  LastName VARCHAR(50)
+);
+INSERT INTO student values ('10', 'Venus', 'Williams');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "student"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "FirstName"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:graph rml:defaultGraph;
+      rml:template "http://example.com/Student/{ID}/{FirstName}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
+  d2rq:password "";
+  d2rq:username "root" .
+
+

Output

+
<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
+
+
+
+

158. RMLTC0007g-PostgreSQL

+

Title: "Assigning triples to the default graph"

+

Description: "Tests the generation of triples to the default graph"

+

Error expected? No

+

Input

+
DROP TABLE IF EXISTS student;
+
+CREATE TABLE student (
+  "ID" INTEGER,
+  "FirstName" VARCHAR(50),
+  "LastName" VARCHAR(50)
+);
+INSERT INTO student values ('10', 'Venus', 'Williams');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "student"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "FirstName"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:graph rml:defaultGraph;
+      rml:template "http://example.com/Student/{ID}/{FirstName}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "org.postgresql.Driver";
+  d2rq:password "";
+  d2rq:username "postgres" .
+
+

Output

+
<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
+
+
+
+

159. RMLTC0007g-SPARQL

+

Title: "Assigning triples to the default graph"

+

Description: "Tests the generation of triples to the default graph"

+

Error expected? No

+

Input

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+
+[] rdf:ID "10" ;
+    foaf:firstName "Venus" ;
+    foaf:lastName "Williams" .
+
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix sd: <http://www.w3.org/ns/sparql-service-description#> .
+
+<http://example.com/base#Country> rml:logicalSource [
+      rml:iterator """
+            PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
+            PREFIX foaf: <http://xmlns.com/foaf/0.1/>
+            PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
+            SELECT ?FirstName ?LastName ?ID
+            WHERE {
+                ?x  foaf:firstName ?FirstName ;
+                    foaf:lastName  ?LastName ;
+                    rdf:ID         ?ID .
+            } """;
+      rml:referenceFormulation formats:SPARQL_Results_JSON;
+      rml:source <http://example.com/base#InputSPARQL>
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "FirstName.value"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:graph rml:defaultGraph;
+      rml:template "http://example.com/Student/{ID.value}/{FirstName.value}"
+    ] .
+
+<http://example.com/base#InputSPARQL> a sd:Service;
+  sd:endpoint <http://HOST:PORT/ds1/sparql>;
+  sd:supportedLanguage sd:SPARQL11Query .
+
+

Output

+
<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
+
+
+
+

160. RMLTC0007g-SQLServer

+

Title: "Assigning triples to the default graph"

+

Description: "Tests the generation of triples to the default graph"

+

Error expected? No

+

Input

+
USE TestDB;
+DROP TABLE IF EXISTS student;
+CREATE TABLE student (
+  "ID" INTEGER,
+  "FirstName" VARCHAR(50),
+  "LastName" VARCHAR(50)
+);
+INSERT INTO student values ('10', 'Venus', 'Williams');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "student"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "FirstName"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:graph rml:defaultGraph;
+      rml:template "http://example.com/Student/{ID}/{FirstName}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
+  d2rq:password "YourSTRONG!Passw0rd;";
+  d2rq:username "sa" .
+
+

Output

+
<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
+
+
+
+

161. RMLTC0007g-XML

+

Title: "Assigning triples to the default graph"

+

Description: "Tests the generation of triples to the default graph"

+

Error expected? No

+

Input

+
<?xml version="1.0"?>
+
+<students>
+  <student>
+    <ID>10</ID>
+    <FirstName>Venus</FirstName>
+    <LastName>Williams</LastName>
+  </student>
+</students>
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "/students/student";
+      rml:referenceFormulation rml:XPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.xml"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "FirstName"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:graph rml:defaultGraph;
+      rml:template "http://example.com/Student/{ID}/{FirstName}"
+    ] .
+
+

Output

+
<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
+
+
+
+

162. RMLTC0007h-CSV

+

Title: "Assigning triples to a non-IRI named graph"

+

Description: "Tests the generation of triples to a non-IRI named graph, which is an error"

+

Error expected? Yes

+

Input

+
ID,FirstName,LastName
+10,Venus,Williams
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:referenceFormulation rml:CSV;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.csv"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "Name"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:graphMap [
+          rml:reference "Name";
+          rml:termType rml:Literal
+        ];
+      rml:template "http://example.com/Student/{ID}/{FirstName}"
+    ] .
+
+
+

163. RMLTC0007h-JSON

+

Title: "Assigning triples to a non-IRI named graph"

+

Description: "Tests the generation of triples to a non-IRI named graph, which is an error"

+

Error expected? Yes

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "FirstName":"Venus",
+    "LastName":"Williams"
+  }]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.Name"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:graphMap [
+          rml:reference "$.Name";
+          rml:termType rml:Literal
+        ];
+      rml:template "http://example.com/Student/{$.ID}/{$.FirstName}"
+    ] .
+
+
+

164. RMLTC0007h-MySQL

+

Title: "Assigning triples to a non-IRI named graph"

+

Description: "Tests the generation of triples to a non-IRI named graph, which is an error"

+

Error expected? Yes

+

Input

+
USE test;
+DROP TABLE IF EXISTS test.student;
+
+CREATE TABLE student (
+  ID INTEGER,
+  FirstName VARCHAR(50),
+  LastName VARCHAR(50)
+);
+INSERT INTO student values ('10', 'Venus', 'Williams');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "student"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "Name"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:graphMap [
+          rml:reference "Name";
+          rml:termType rml:Literal
+        ];
+      rml:template "http://example.com/Student/{ID}/{FirstName}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
+  d2rq:password "";
+  d2rq:username "root" .
+
+
+

165. RMLTC0007h-PostgreSQL

+

Title: "Assigning triples to a non-IRI named graph"

+

Description: "Tests the generation of triples to a non-IRI named graph, which is an error"

+

Error expected? Yes

+

Input

+
DROP TABLE IF EXISTS student;
+
+CREATE TABLE student (
+  "ID" INTEGER,
+  "FirstName" VARCHAR(50),
+  "LastName" VARCHAR(50)
+);
+INSERT INTO student values ('10', 'Venus', 'Williams');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "student"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "Name"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:graphMap [
+          rml:reference "Name";
+          rml:termType rml:Literal
+        ];
+      rml:template "http://example.com/Student/{ID}/{FirstName}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "org.postgresql.Driver";
+  d2rq:password "";
+  d2rq:username "postgres" .
+
+
+

166. RMLTC0007h-SPARQL

+

Title: "Assigning triples to a non-IRI named graph"

+

Description: "Tests the generation of triples to a non-IRI named graph, which is an error"

+

Error expected? Yes

+

Input

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+
+[] rdf:ID "10" ;
+    foaf:firstName "Venus" ;
+    foaf:lastName "Williams" .
+
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix sd: <http://www.w3.org/ns/sparql-service-description#> .
+
+<http://example.com/base#Country> rml:logicalSource [
+      rml:iterator """
+            PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
+            PREFIX foaf: <http://xmlns.com/foaf/0.1/>
+            PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
+            SELECT ?FirstName ?LastName ?ID
+            WHERE {
+                ?x  foaf:firstName ?FirstName ;
+                    foaf:lastName  ?LastName ;
+                    rdf:ID         ?ID .
+            } """;
+      rml:referenceFormulation formats:SPARQL_Results_JSON;
+      rml:source <http://example.com/base#InputSPARQL>
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "Name.value"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:graphMap [
+          rml:reference "Name";
+          rml:termType rml:Literal
+        ];
+      rml:template "http://example.com/Student/{ID.value}/{FirstName.value}"
+    ] .
+
+<http://example.com/base#InputSPARQL> a sd:Service;
+  sd:endpoint <http://HOST:PORT/ds1/sparql>;
+  sd:supportedLanguage sd:SPARQL11Query .
+
+
+

167. RMLTC0007h-SQLServer

+

Title: "Assigning triples to a non-IRI named graph"

+

Description: "Tests the generation of triples to a non-IRI named graph, which is an error"

+

Error expected? Yes

+

Input

+
USE TestDB;
+DROP TABLE IF EXISTS student;
+CREATE TABLE student (
+  "ID" INTEGER,
+  "FirstName" VARCHAR(50),
+  "LastName" VARCHAR(50)
+);
+INSERT INTO student values ('10', 'Venus', 'Williams');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "student"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "Name"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:graphMap [
+          rml:reference "Name";
+          rml:termType rml:Literal
+        ];
+      rml:template "http://example.com/Student/{ID}/{FirstName}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
+  d2rq:password "YourSTRONG!Passw0rd;";
+  d2rq:username "sa" .
+
+
+

168. RMLTC0007h-XML

+

Title: "Assigning triples to a non-IRI named graph"

+

Description: "Tests the generation of triples to a non-IRI named graph, which is an error"

+

Error expected? Yes

+

Input

+
<?xml version="1.0"?>
+
+<students>
+  <student>
+    <ID>10</ID>
+    <FirstName>Venus</FirstName>
+    <LastName>Williams</LastName>
+  </student>
+</students>
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "/students/student";
+      rml:referenceFormulation rml:XPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.xml"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "Name"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:graphMap [
+          rml:reference "Name";
+          rml:termType rml:Literal
+        ];
+      rml:template "http://example.com/Student/{ID}/{FirstName}"
+    ] .
+
+
+

169. RMLTC0008a-CSV

+

Title: "Generation of triples to a target graph by using rr:graphMap and rr:template"

+

Description: "Test that results of the mapping can be directed to a target graph by using rr:graphMap and rr:template"

+

Error expected? No

+

Input

+
ID,Name,Sport
+10,Venus Williams,Tennis
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:referenceFormulation rml:CSV;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.csv"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:object foaf:Person;
+      rml:predicate rdf:type
+    ], [
+      rml:objectMap [
+          rml:reference "ID"
+        ];
+      rml:predicate ex:id
+    ], [
+      rml:objectMap [
+          rml:reference "Name"
+        ];
+      rml:predicate foaf:name
+    ], [
+      rml:objectMap [
+          rml:reference "Sport"
+        ];
+      rml:predicate ex:Sport
+    ];
+  rml:subjectMap [
+      rml:graphMap [
+          rml:template "http://example.com/graph/Student/{ID}/{Name}"
+        ];
+      rml:template "http://example.com/Student/{ID}/{Name}"
+    ] .
+
+

Output

+
<http://example.com/Student/10/Venus%20Williams> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> <http://example.com/graph/Student/10/Venus%20Williams> .
+<http://example.com/Student/10/Venus%20Williams> <http://xmlns.com/foaf/0.1/name> "Venus Williams" <http://example.com/graph/Student/10/Venus%20Williams> .
+<http://example.com/Student/10/Venus%20Williams> <http://example.com/id> "10" <http://example.com/graph/Student/10/Venus%20Williams> . 
+<http://example.com/Student/10/Venus%20Williams> <http://example.com/Sport> "Tennis" <http://example.com/graph/Student/10/Venus%20Williams> . 
+
+
+
+

170. RMLTC0008a-JSON

+

Title: "Generation of triples to a target graph by using rr:graphMap and rr:template"

+

Description: "Test that results of the mapping can be directed to a target graph by using rr:graphMap and rr:template"

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "Name":"Venus Williams",
+    "Sport": "Tennis"
+  }]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:object foaf:Person;
+      rml:predicate rdf:type
+    ], [
+      rml:objectMap [
+          rml:reference "$.ID"
+        ];
+      rml:predicate ex:id
+    ], [
+      rml:objectMap [
+          rml:reference "$.Name"
+        ];
+      rml:predicate foaf:name
+    ], [
+      rml:objectMap [
+          rml:reference "$.Sport"
+        ];
+      rml:predicate ex:Sport
+    ];
+  rml:subjectMap [
+      rml:graphMap [
+          rml:template "http://example.com/graph/Student/{$.ID}/{$.Name}"
+        ];
+      rml:template "http://example.com/Student/{$.ID}/{$.Name}"
+    ] .
+
+

Output

+
<http://example.com/Student/10/Venus%20Williams> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> <http://example.com/graph/Student/10/Venus%20Williams> .
+<http://example.com/Student/10/Venus%20Williams> <http://xmlns.com/foaf/0.1/name> "Venus Williams" <http://example.com/graph/Student/10/Venus%20Williams> .
+<http://example.com/Student/10/Venus%20Williams> <http://example.com/id> "10" <http://example.com/graph/Student/10/Venus%20Williams> . 
+<http://example.com/Student/10/Venus%20Williams> <http://example.com/Sport> "Tennis" <http://example.com/graph/Student/10/Venus%20Williams> . 
+
+
+
+

171. RMLTC0008a-MySQL

+

Title: "Generation of triples to a target graph by using rr:graphMap and rr:template"

+

Description: "Test that results of the mapping can be directed to a target graph by using rr:graphMap and rr:template"

+

Error expected? No

+

Input

+
USE test;
+DROP TABLE IF EXISTS test.student;
+
+CREATE TABLE student (
+  ID INTEGER,
+  Name VARCHAR(50),
+  Sport VARCHAR(50)
+);
+INSERT INTO student values ('10', 'Venus Williams', 'Tennis');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "student"
+    ];
+  rml:predicateObjectMap [
+      rml:object foaf:Person;
+      rml:predicate rdf:type
+    ], [
+      rml:objectMap [
+          rml:reference "ID"
+        ];
+      rml:predicate ex:id
+    ], [
+      rml:objectMap [
+          rml:reference "Name"
+        ];
+      rml:predicate foaf:name
+    ], [
+      rml:objectMap [
+          rml:reference "Sport"
+        ];
+      rml:predicate ex:Sport
+    ];
+  rml:subjectMap [
+      rml:graphMap [
+          rml:template "http://example.com/graph/Student/{ID}/{Name}"
+        ];
+      rml:template "http://example.com/Student/{ID}/{Name}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
+  d2rq:password "";
+  d2rq:username "root" .
+
+

Output

+
<http://example.com/Student/10/Venus%20Williams> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> <http://example.com/graph/Student/10/Venus%20Williams> .
+<http://example.com/Student/10/Venus%20Williams> <http://xmlns.com/foaf/0.1/name> "Venus Williams" <http://example.com/graph/Student/10/Venus%20Williams> .
+<http://example.com/Student/10/Venus%20Williams> <http://example.com/id> "10"^^<http://www.w3.org/2001/XMLSchema#integer> <http://example.com/graph/Student/10/Venus%20Williams> . 
+<http://example.com/Student/10/Venus%20Williams> <http://example.com/Sport> "Tennis" <http://example.com/graph/Student/10/Venus%20Williams> . 
+
+
+
+
+

172. RMLTC0008a-PostgreSQL

+

Title: "Generation of triples to a target graph by using rr:graphMap and rr:template"

+

Description: "Test that results of the mapping can be directed to a target graph by using rr:graphMap and rr:template"

+

Error expected? No

+

Input

+
DROP TABLE IF EXISTS student;
+
+CREATE TABLE student (
+  "ID" INTEGER,
+  "Name" VARCHAR(50),
+  "Sport" VARCHAR(50)
+);
+INSERT INTO student values ('10', 'Venus Williams', 'Tennis');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "student"
+    ];
+  rml:predicateObjectMap [
+      rml:object foaf:Person;
+      rml:predicate rdf:type
+    ], [
+      rml:objectMap [
+          rml:reference "ID"
+        ];
+      rml:predicate ex:id
+    ], [
+      rml:objectMap [
+          rml:reference "Name"
+        ];
+      rml:predicate foaf:name
+    ], [
+      rml:objectMap [
+          rml:reference "Sport"
+        ];
+      rml:predicate ex:Sport
+    ];
+  rml:subjectMap [
+      rml:graphMap [
+          rml:template "http://example.com/graph/Student/{ID}/{Name}"
+        ];
+      rml:template "http://example.com/Student/{ID}/{Name}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "org.postgresql.Driver";
+  d2rq:password "";
+  d2rq:username "postgres" .
+
+

Output

+
<http://example.com/Student/10/Venus%20Williams> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> <http://example.com/graph/Student/10/Venus%20Williams> .
+<http://example.com/Student/10/Venus%20Williams> <http://xmlns.com/foaf/0.1/name> "Venus Williams" <http://example.com/graph/Student/10/Venus%20Williams> .
+<http://example.com/Student/10/Venus%20Williams> <http://example.com/id> "10"^^<http://www.w3.org/2001/XMLSchema#integer> <http://example.com/graph/Student/10/Venus%20Williams> . 
+<http://example.com/Student/10/Venus%20Williams> <http://example.com/Sport> "Tennis" <http://example.com/graph/Student/10/Venus%20Williams> . 
+
+
+
+
+

173. RMLTC0008a-SPARQL

+

Title: "Generation of triples to a target graph by using rr:graphMap and rr:template"

+

Description: "Test that results of the mapping can be directed to a target graph by using rr:graphMap and rr:template"

+

Error expected? No

+

Input

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix ns1: <http://example.com/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+
+[] ns1:plays [ a ns1:Sport ;
+            foaf:name "Tennis" ] ;
+    rdf:ID "10" ;
+    foaf:name "Venus Williams" .
+
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix sd: <http://www.w3.org/ns/sparql-service-description#> .
+
+<http://example.com/base#Country> rml:logicalSource [
+      rml:iterator """
+            PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
+            PREFIX foaf: <http://xmlns.com/foaf/0.1/>
+            PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
+            SELECT ?Name ?Sport ?ID
+            WHERE {
+                ?x  foaf:name ?Name ;
+                    rdf:ID    ?ID ;
+                    <http://example.com/plays>  ?sportObject .
+                ?sportObject foaf:name ?Sport .
+            } """;
+      rml:referenceFormulation formats:SPARQL_Results_JSON;
+      rml:source <http://example.com/base#InputSPARQL>
+    ];
+  rml:predicateObjectMap [
+      rml:object foaf:Person;
+      rml:predicate rdf:type
+    ], [
+      rml:objectMap [
+          rml:reference "ID.value"
+        ];
+      rml:predicate ex:id
+    ], [
+      rml:objectMap [
+          rml:reference "Name.value"
+        ];
+      rml:predicate foaf:name
+    ], [
+      rml:objectMap [
+          rml:reference "Sport.value"
+        ];
+      rml:predicate ex:Sport
+    ];
+  rml:subjectMap [
+      rml:graphMap [
+          rml:template "http://example.com/graph/Student/{ID.value}/{Name.value}"
+        ];
+      rml:template "http://example.com/Student/{ID.value}/{Name.value}"
+    ] .
+
+<http://example.com/base#InputSPARQL> a sd:Service;
+  sd:endpoint <http://HOST:PORT/ds1/sparql>;
+  sd:supportedLanguage sd:SPARQL11Query .
+
+

Output

+
<http://example.com/Student/10/Venus%20Williams> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> <http://example.com/graph/Student/10/Venus%20Williams> .
+<http://example.com/Student/10/Venus%20Williams> <http://xmlns.com/foaf/0.1/name> "Venus Williams" <http://example.com/graph/Student/10/Venus%20Williams> .
+<http://example.com/Student/10/Venus%20Williams> <http://example.com/id> "10" <http://example.com/graph/Student/10/Venus%20Williams> . 
+<http://example.com/Student/10/Venus%20Williams> <http://example.com/Sport> "Tennis" <http://example.com/graph/Student/10/Venus%20Williams> . 
+
+
+
+

174. RMLTC0008a-SQLServer

+

Title: "Generation of triples to a target graph by using rr:graphMap and rr:template"

+

Description: "Test that results of the mapping can be directed to a target graph by using rr:graphMap and rr:template"

+

Error expected? No

+

Input

+
USE TestDB;
+DROP TABLE IF EXISTS student;
+CREATE TABLE student (
+  "ID" INTEGER,
+  "Name" VARCHAR(50),
+  "Sport" VARCHAR(50)
+);
+INSERT INTO student values ('10', 'Venus Williams', 'Tennis');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "student"
+    ];
+  rml:predicateObjectMap [
+      rml:object foaf:Person;
+      rml:predicate rdf:type
+    ], [
+      rml:objectMap [
+          rml:reference "ID"
+        ];
+      rml:predicate ex:id
+    ], [
+      rml:objectMap [
+          rml:reference "Name"
+        ];
+      rml:predicate foaf:name
+    ], [
+      rml:objectMap [
+          rml:reference "Sport"
+        ];
+      rml:predicate ex:Sport
+    ];
+  rml:subjectMap [
+      rml:graphMap [
+          rml:template "http://example.com/graph/Student/{ID}/{Name}"
+        ];
+      rml:template "http://example.com/Student/{ID}/{Name}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
+  d2rq:password "YourSTRONG!Passw0rd;";
+  d2rq:username "sa" .
+
+

Output

+
<http://example.com/Student/10/Venus%20Williams> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> <http://example.com/graph/Student/10/Venus%20Williams> .
+<http://example.com/Student/10/Venus%20Williams> <http://xmlns.com/foaf/0.1/name> "Venus Williams" <http://example.com/graph/Student/10/Venus%20Williams> .
+<http://example.com/Student/10/Venus%20Williams> <http://example.com/id> "10"^^<http://www.w3.org/2001/XMLSchema#integer> <http://example.com/graph/Student/10/Venus%20Williams> . 
+<http://example.com/Student/10/Venus%20Williams> <http://example.com/Sport> "Tennis" <http://example.com/graph/Student/10/Venus%20Williams> . 
+
+
+
+
+

175. RMLTC0008a-XML

+

Title: "Generation of triples to a target graph by using rr:graphMap and rr:template"

+

Description: "Test that results of the mapping can be directed to a target graph by using rr:graphMap and rr:template"

+

Error expected? No

+

Input

+
<?xml version="1.0"?>
+
+<students>
+  <student>
+    <ID>10</ID>
+    <Name>Venus Williams</Name>
+    <Sport>Tennis</Sport>
+  </student>
+</students>
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "/students/student";
+      rml:referenceFormulation rml:XPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.xml"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:object foaf:Person;
+      rml:predicate rdf:type
+    ], [
+      rml:objectMap [
+          rml:reference "ID"
+        ];
+      rml:predicate ex:id
+    ], [
+      rml:objectMap [
+          rml:reference "Name"
+        ];
+      rml:predicate foaf:name
+    ], [
+      rml:objectMap [
+          rml:reference "Sport"
+        ];
+      rml:predicate ex:Sport
+    ];
+  rml:subjectMap [
+      rml:graphMap [
+          rml:template "http://example.com/graph/Student/{ID}/{Name}"
+        ];
+      rml:template "http://example.com/Student/{ID}/{Name}"
+    ] .
+
+

Output

+
<http://example.com/Student/10/Venus%20Williams> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> <http://example.com/graph/Student/10/Venus%20Williams> .
+<http://example.com/Student/10/Venus%20Williams> <http://xmlns.com/foaf/0.1/name> "Venus Williams" <http://example.com/graph/Student/10/Venus%20Williams> .
+<http://example.com/Student/10/Venus%20Williams> <http://example.com/id> "10" <http://example.com/graph/Student/10/Venus%20Williams> . 
+<http://example.com/Student/10/Venus%20Williams> <http://example.com/Sport> "Tennis" <http://example.com/graph/Student/10/Venus%20Williams> . 
+
+
+
+

176. RMLTC0008b-CSV

+

Title: "Generation of triples referencing object map"

+

Description: "Tests the mapping specification referencing object map without join"

+

Error expected? No

+

Input

+
ID,Name,Sport
+10,Venus Williams,Tennis
+
+

Mapping

+
@prefix activity: <http://example.com/activity/> .
+@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:referenceFormulation rml:CSV;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.csv"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap <http://example.com/base/RefObjectMap1>;
+      rml:predicate ex:Sport
+    ], [
+      rml:object foaf:Person;
+      rml:predicate rdf:type
+    ], [
+      rml:objectMap [
+          rml:reference "ID"
+        ];
+      rml:predicate ex:id
+    ], [
+      rml:objectMap [
+          rml:reference "Name"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Student/{ID}/{Name}"
+    ] .
+
+<http://example.com/base/RefObjectMap1> a rml:RefObjectMap;
+  rml:parentTriplesMap <http://example.com/base/TriplesMap2> .
+
+<http://example.com/base/TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:referenceFormulation rml:CSV;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.csv"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:object activity:Sport;
+      rml:predicate rdf:type
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{Sport}"
+    ] .
+
+

Output

+
<http://example.com/Student/10/Venus%20Williams> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person>  .
+<http://example.com/Student/10/Venus%20Williams> <http://xmlns.com/foaf/0.1/name> "Venus Williams" .
+<http://example.com/Student/10/Venus%20Williams> <http://example.com/id> "10" . 
+<http://example.com/Student/10/Venus%20Williams> <http://example.com/Sport> <http://example.com/Tennis> . 
+<http://example.com/Tennis> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/activity/Sport> .
+
+
+
+
+

177. RMLTC0008b-JSON

+

Title: "Generation of triples referencing object map"

+

Description: "Tests the mapping specification referencing object map without join"

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "Name":"Venus Williams",
+    "Sport": "Tennis"
+  }]
+}
+
+

Mapping

+
@prefix activity: <http://example.com/activity/> .
+@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap <http://example.com/base/RefObjectMap1>;
+      rml:predicate ex:Sport
+    ], [
+      rml:object foaf:Person;
+      rml:predicate rdf:type
+    ], [
+      rml:objectMap [
+          rml:reference "$.ID"
+        ];
+      rml:predicate ex:id
+    ], [
+      rml:objectMap [
+          rml:reference "$.Name"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Student/{$.ID}/{$.Name}"
+    ] .
+
+<http://example.com/base/RefObjectMap1> a rml:RefObjectMap;
+  rml:parentTriplesMap <http://example.com/base/TriplesMap2> .
+
+<http://example.com/base/TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:object activity:Sport;
+      rml:predicate rdf:type
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{$.Sport}"
+    ] .
+
+

Output

+
<http://example.com/Student/10/Venus%20Williams> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person>  .
+<http://example.com/Student/10/Venus%20Williams> <http://xmlns.com/foaf/0.1/name> "Venus Williams" .
+<http://example.com/Student/10/Venus%20Williams> <http://example.com/id> "10" . 
+<http://example.com/Student/10/Venus%20Williams> <http://example.com/Sport> <http://example.com/Tennis> . 
+<http://example.com/Tennis> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/activity/Sport> .
+
+
+
+
+

178. RMLTC0008b-MySQL

+

Title: "Generation of triples referencing object map"

+

Description: "Tests the mapping specification referencing object map without join"

+

Error expected? No

+

Input

+
USE test;
+DROP TABLE IF EXISTS test.student;
+
+CREATE TABLE student (
+  ID INTEGER,
+  Name VARCHAR(50),
+  Sport VARCHAR(50)
+);
+INSERT INTO student values ('10', 'Venus Williams', 'Tennis');
+
+

Mapping

+
@prefix activity: <http://example.com/activity/> .
+@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "student"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap <http://example.com/base/RefObjectMap1>;
+      rml:predicate ex:Sport
+    ], [
+      rml:object foaf:Person;
+      rml:predicate rdf:type
+    ], [
+      rml:objectMap [
+          rml:reference "ID"
+        ];
+      rml:predicate ex:id
+    ], [
+      rml:objectMap [
+          rml:reference "Name"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Student/{ID}/{Name}"
+    ] .
+
+<http://example.com/base/RefObjectMap1> a rml:RefObjectMap;
+  rml:parentTriplesMap <http://example.com/base/TriplesMap2> .
+
+<http://example.com/base/TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "student"
+    ];
+  rml:predicateObjectMap [
+      rml:object activity:Sport;
+      rml:predicate rdf:type
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{Sport}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
+  d2rq:password "";
+  d2rq:username "root" .
+
+

Output

+
<http://example.com/Student/10/Venus%20Williams> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person>  .
+<http://example.com/Student/10/Venus%20Williams> <http://xmlns.com/foaf/0.1/name> "Venus Williams" .
+<http://example.com/Student/10/Venus%20Williams> <http://example.com/id> "10"^^<http://www.w3.org/2001/XMLSchema#integer>  . 
+<http://example.com/Student/10/Venus%20Williams> <http://example.com/Sport> <http://example.com/Tennis> . 
+<http://example.com/Tennis> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/activity/Sport> .
+
+
+
+
+

179. RMLTC0008b-PostgreSQL

+

Title: "Generation of triples referencing object map"

+

Description: "Tests the mapping specification referencing object map without join"

+

Error expected? No

+

Input

+
DROP TABLE IF EXISTS student;
+
+CREATE TABLE student (
+  "ID" INTEGER,
+  "Name" VARCHAR(50),
+  "Sport" VARCHAR(50)
+);
+INSERT INTO student values ('10', 'Venus Williams', 'Tennis');
+
+

Mapping

+
@prefix activity: <http://example.com/activity/> .
+@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "student"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap <http://example.com/base/RefObjectMap1>;
+      rml:predicate ex:Sport
+    ], [
+      rml:object foaf:Person;
+      rml:predicate rdf:type
+    ], [
+      rml:objectMap [
+          rml:reference "ID"
+        ];
+      rml:predicate ex:id
+    ], [
+      rml:objectMap [
+          rml:reference "Name"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Student/{ID}/{Name}"
+    ] .
+
+<http://example.com/base/RefObjectMap1> a rml:RefObjectMap;
+  rml:parentTriplesMap <http://example.com/base/TriplesMap2> .
+
+<http://example.com/base/TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "student"
+    ];
+  rml:predicateObjectMap [
+      rml:object activity:Sport;
+      rml:predicate rdf:type
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{Sport}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "org.postgresql.Driver";
+  d2rq:password "";
+  d2rq:username "postgres" .
+
+

Output

+
<http://example.com/Student/10/Venus%20Williams> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person>  .
+<http://example.com/Student/10/Venus%20Williams> <http://xmlns.com/foaf/0.1/name> "Venus Williams" .
+<http://example.com/Student/10/Venus%20Williams> <http://example.com/id> "10"^^<http://www.w3.org/2001/XMLSchema#integer>  . 
+<http://example.com/Student/10/Venus%20Williams> <http://example.com/Sport> <http://example.com/Tennis> . 
+<http://example.com/Tennis> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/activity/Sport> .
+
+
+
+
+

180. RMLTC0008b-SPARQL

+

Title: "Generation of triples referencing object map"

+

Description: "Tests the mapping specification referencing object map without join"

+

Error expected? No

+

Input

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix ns1: <http://example.com/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+
+[] ns1:plays [ a ns1:Sport ;
+            foaf:name "Tennis" ] ;
+    rdf:ID "10" ;
+    foaf:name "Venus Williams" .
+
+
+

Mapping

+
@prefix activity: <http://example.com/activity/> .
+@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix sd: <http://www.w3.org/ns/sparql-service-description#> .
+
+ex:TriplesMap1 a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator """
+            PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
+            PREFIX foaf: <http://xmlns.com/foaf/0.1/>
+            PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
+            SELECT ?Name ?ID
+            WHERE {
+                ?x  foaf:name ?Name ;
+                    rdf:ID    ?ID ;
+            } """;
+      rml:referenceFormulation formats:SPARQL_Results_JSON;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path <http://example.com/base#InputSPARQL>
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap ex:RefObjectMap1;
+      rml:predicate ex:Sport
+    ], [
+      rml:object foaf:Person;
+      rml:predicate rdf:type
+    ], [
+      rml:objectMap [
+          rml:reference "ID.value"
+        ];
+      rml:predicate ex:id
+    ], [
+      rml:objectMap [
+          rml:reference "Name.value"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Student/{ID.value}/{Name.value}"
+    ] .
+
+ex:RefObjectMap1 a rml:RefObjectMap;
+  rml:parentTriplesMap ex:TriplesMap2 .
+
+ex:TriplesMap2 a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator """
+                PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
+                PREFIX foaf: <http://xmlns.com/foaf/0.1/>
+                PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
+                SELECT ?Sport
+                WHERE {
+                    ?x a <http://example.com/Sport> .
+                    ?x foaf:name ?Sport .
+                } """;
+      rml:referenceFormulation formats:SPARQL_Results_JSON;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path <http://example.com/base#InputSPARQL>
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:object activity:Sport;
+      rml:predicate rdf:type
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{Sport.value}"
+    ] .
+
+<http://example.com/base#InputSPARQL> a sd:Service;
+  sd:endpoint <http://HOST:PORT/ds1/sparql>;
+  sd:supportedLanguage sd:SPARQL11Query .
+
+

Output

+
<http://example.com/Student/10/Venus%20Williams> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person>  .
+<http://example.com/Student/10/Venus%20Williams> <http://xmlns.com/foaf/0.1/name> "Venus Williams" .
+<http://example.com/Student/10/Venus%20Williams> <http://example.com/id> "10" . 
+<http://example.com/Student/10/Venus%20Williams> <http://example.com/Sport> <http://example.com/Tennis> . 
+<http://example.com/Tennis> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/activity/Sport> .
+
+
+
+
+

181. RMLTC0008b-SQLServer

+

Title: "Generation of triples referencing object map"

+

Description: "Tests the mapping specification referencing object map without join"

+

Error expected? No

+

Input

+
USE TestDB;
+DROP TABLE IF EXISTS student;
+CREATE TABLE student (
+  "ID" INTEGER,
+  "Name" VARCHAR(50),
+  "Sport" VARCHAR(50)
+);
+INSERT INTO student values ('10', 'Venus Williams', 'Tennis');
+
+

Mapping

+
@prefix activity: <http://example.com/activity/> .
+@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "student"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap <http://example.com/base/RefObjectMap1>;
+      rml:predicate ex:Sport
+    ], [
+      rml:object foaf:Person;
+      rml:predicate rdf:type
+    ], [
+      rml:objectMap [
+          rml:reference "ID"
+        ];
+      rml:predicate ex:id
+    ], [
+      rml:objectMap [
+          rml:reference "Name"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Student/{ID}/{Name}"
+    ] .
+
+<http://example.com/base/RefObjectMap1> a rml:RefObjectMap;
+  rml:parentTriplesMap <http://example.com/base/TriplesMap2> .
+
+<http://example.com/base/TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "student"
+    ];
+  rml:predicateObjectMap [
+      rml:object activity:Sport;
+      rml:predicate rdf:type
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{Sport}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
+  d2rq:password "YourSTRONG!Passw0rd;";
+  d2rq:username "sa" .
+
+

Output

+
<http://example.com/Student/10/Venus%20Williams> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person>  .
+<http://example.com/Student/10/Venus%20Williams> <http://xmlns.com/foaf/0.1/name> "Venus Williams" .
+<http://example.com/Student/10/Venus%20Williams> <http://example.com/id> "10"^^<http://www.w3.org/2001/XMLSchema#integer>  . 
+<http://example.com/Student/10/Venus%20Williams> <http://example.com/Sport> <http://example.com/Tennis> . 
+<http://example.com/Tennis> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/activity/Sport> .
+
+
+
+
+

182. RMLTC0008b-XML

+

Title: "Generation of triples referencing object map"

+

Description: "Tests the mapping specification referencing object map without join"

+

Error expected? No

+

Input

+
<?xml version="1.0"?>
+
+<students>
+  <student>
+    <ID>10</ID>
+    <Name>Venus Williams</Name>
+    <Sport>Tennis</Sport>
+  </student>
+</students>
+
+

Mapping

+
@prefix activity: <http://example.com/activity/> .
+@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "/students/student";
+      rml:referenceFormulation rml:XPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.xml"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap <http://example.com/base/RefObjectMap1>;
+      rml:predicate ex:Sport
+    ], [
+      rml:object foaf:Person;
+      rml:predicate rdf:type
+    ], [
+      rml:objectMap [
+          rml:reference "ID"
+        ];
+      rml:predicate ex:id
+    ], [
+      rml:objectMap [
+          rml:reference "Name"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Student/{ID}/{Name}"
+    ] .
+
+<http://example.com/base/RefObjectMap1> a rml:RefObjectMap;
+  rml:parentTriplesMap <http://example.com/base/TriplesMap2> .
+
+<http://example.com/base/TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "/students/student";
+      rml:referenceFormulation rml:XPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.xml"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:object activity:Sport;
+      rml:predicate rdf:type
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{Sport}"
+    ] .
+
+

Output

+
<http://example.com/Student/10/Venus%20Williams> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person>  .
+<http://example.com/Student/10/Venus%20Williams> <http://xmlns.com/foaf/0.1/name> "Venus Williams" .
+<http://example.com/Student/10/Venus%20Williams> <http://example.com/id> "10" . 
+<http://example.com/Student/10/Venus%20Williams> <http://example.com/Sport> <http://example.com/Tennis> . 
+<http://example.com/Tennis> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/activity/Sport> .
+
+
+
+
+

183. RMLTC0008c-CSV

+

Title: "Generation of triples by using multiple predicateMaps within a rr:predicateObjectMap"

+

Description: "Tests the generation of triples by using multiple predicateMaps within a rr:predicateObjectMap"

+

Error expected? No

+

Input

+
ID,Name,Sport
+10,Venus Williams,Tennis
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:referenceFormulation rml:CSV;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.csv"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "Name"
+        ];
+      rml:predicate ex:name, foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Student/{ID}/{Name}"
+    ] .
+
+

Output

+
<http://example.com/Student/10/Venus%20Williams> <http://xmlns.com/foaf/0.1/name> "Venus Williams"  .
+<http://example.com/Student/10/Venus%20Williams> <http://example.com/name> "Venus Williams"  .
+
+
+
+

184. RMLTC0008c-JSON

+

Title: "Generation of triples by using multiple predicateMaps within a rr:predicateObjectMap"

+

Description: "Tests the generation of triples by using multiple predicateMaps within a rr:predicateObjectMap"

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "Name":"Venus Williams",
+    "Sport": "Tennis"
+  }]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.Name"
+        ];
+      rml:predicate ex:name, foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Student/{$.ID}/{$.Name}"
+    ] .
+
+

Output

+
<http://example.com/Student/10/Venus%20Williams> <http://xmlns.com/foaf/0.1/name> "Venus Williams"  .
+<http://example.com/Student/10/Venus%20Williams> <http://example.com/name> "Venus Williams"  .
+
+
+
+

185. RMLTC0008c-MySQL

+

Title: "Generation of triples by using multiple predicateMaps within a rr:predicateObjectMap"

+

Description: "Tests the generation of triples by using multiple predicateMaps within a rr:predicateObjectMap"

+

Error expected? No

+

Input

+
USE test;
+DROP TABLE IF EXISTS test.student;
+
+CREATE TABLE student (
+  ID INTEGER,
+  Name VARCHAR(50),
+  Sport VARCHAR(50)
+);
+INSERT INTO student values ('10', 'Venus Williams', 'Tennis');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "student"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "Name"
+        ];
+      rml:predicate ex:name, foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Student/{ID}/{Name}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
+  d2rq:password "";
+  d2rq:username "root" .
+
+

Output

+
<http://example.com/Student/10/Venus%20Williams> <http://xmlns.com/foaf/0.1/name> "Venus Williams"  .
+<http://example.com/Student/10/Venus%20Williams> <http://example.com/name> "Venus Williams"  .
+
+
+
+

186. RMLTC0008c-PostgreSQL

+

Title: "Generation of triples by using multiple predicateMaps within a rr:predicateObjectMap"

+

Description: "Tests the generation of triples by using multiple predicateMaps within a rr:predicateObjectMap"

+

Error expected? No

+

Input

+
DROP TABLE IF EXISTS student;
+
+CREATE TABLE student (
+  "ID" INTEGER,
+  "Name" VARCHAR(50),
+  "Sport" VARCHAR(50)
+);
+INSERT INTO student values ('10', 'Venus Williams', 'Tennis');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "student"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "Name"
+        ];
+      rml:predicate ex:name, foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Student/{ID}/{Name}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "org.postgresql.Driver";
+  d2rq:password "";
+  d2rq:username "postgres" .
+
+

Output

+
<http://example.com/Student/10/Venus%20Williams> <http://xmlns.com/foaf/0.1/name> "Venus Williams"  .
+<http://example.com/Student/10/Venus%20Williams> <http://example.com/name> "Venus Williams"  .
+
+
+
+

187. RMLTC0008c-SPARQL

+

Title: "Generation of triples by using multiple predicateMaps within a rr:predicateObjectMap"

+

Description: "Tests the generation of triples by using multiple predicateMaps within a rr:predicateObjectMap"

+

Error expected? No

+

Input

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix ns1: <http://example.com/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+
+[] ns1:plays [ a ns1:Sport ;
+            foaf:name "Tennis" ] ;
+    rdf:ID "10" ;
+    foaf:name "Venus Williams" .
+
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix sd: <http://www.w3.org/ns/sparql-service-description#> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator """
+              PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
+              PREFIX foaf: <http://xmlns.com/foaf/0.1/>
+              PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
+              SELECT ?Name ?ID
+              WHERE {
+                  ?x  foaf:name ?Name ;
+                      rdf:ID    ?ID ;
+              } """;
+      rml:referenceFormulation formats:SPARQL_Results_JSON;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path <http://example.com/base/#InputSPARQL>
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "Name.value"
+        ];
+      rml:predicate ex:name, foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Student/{ID.value}/{Name.value}"
+    ] .
+
+<http://example.com/base/#InputSPARQL> a sd:Service;
+  sd:endpoint <http://HOST:PORT/ds1/sparql>;
+  sd:supportedLanguage sd:SPARQL11Query .
+
+

Output

+
<http://example.com/Student/10/Venus%20Williams> <http://xmlns.com/foaf/0.1/name> "Venus Williams"  .
+<http://example.com/Student/10/Venus%20Williams> <http://example.com/name> "Venus Williams"  .
+
+
+
+

188. RMLTC0008c-SQLServer

+

Title: "Generation of triples by using multiple predicateMaps within a rr:predicateObjectMap"

+

Description: "Tests the generation of triples by using multiple predicateMaps within a rr:predicateObjectMap"

+

Error expected? No

+

Input

+
USE TestDB;
+DROP TABLE IF EXISTS student;
+CREATE TABLE student (
+  "ID" INTEGER,
+  "Name" VARCHAR(50),
+  "Sport" VARCHAR(50)
+);
+INSERT INTO student values ('10', 'Venus Williams', 'Tennis');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "student"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "Name"
+        ];
+      rml:predicate ex:name, foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Student/{ID}/{Name}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
+  d2rq:password "YourSTRONG!Passw0rd;";
+  d2rq:username "sa" .
+
+

Output

+
<http://example.com/Student/10/Venus%20Williams> <http://xmlns.com/foaf/0.1/name> "Venus Williams"  .
+<http://example.com/Student/10/Venus%20Williams> <http://example.com/name> "Venus Williams"  .
+
+
+
+

189. RMLTC0008c-XML

+

Title: "Generation of triples by using multiple predicateMaps within a rr:predicateObjectMap"

+

Description: "Tests the generation of triples by using multiple predicateMaps within a rr:predicateObjectMap"

+

Error expected? No

+

Input

+
<?xml version="1.0"?>
+
+<students>
+  <student>
+    <ID>10</ID>
+    <Name>Venus Williams</Name>
+    <Sport>Tennis</Sport>
+  </student>
+</students>
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "/students/student";
+      rml:referenceFormulation rml:XPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.xml"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "Name"
+        ];
+      rml:predicate ex:name, foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Student/{ID}/{Name}"
+    ] .
+
+

Output

+
<http://example.com/Student/10/Venus%20Williams> <http://xmlns.com/foaf/0.1/name> "Venus Williams"  .
+<http://example.com/Student/10/Venus%20Williams> <http://example.com/name> "Venus Williams"  .
+
+
+
+

190. RMLTC0009a-CSV

+

Title: "Generation of triples from foreign key relations"

+

Description: "Test foreign key relationships among logical tables"

+

Error expected? No

+

Input

+
ID,Sport,Name
+10,100,Venus Williams
+20,,Demi Moore
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:referenceFormulation rml:CSV;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.csv"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "Name"
+        ];
+      rml:predicate foaf:name
+    ], [
+      rml:objectMap [ a rml:RefObjectMap;
+          rml:joinCondition [
+              rml:child "Sport";
+              rml:parent "ID"
+            ];
+          rml:parentTriplesMap <http://example.com/base/TriplesMap2>
+        ];
+      rml:predicate <http://example.com/ontology/practises>
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/resource/student_{ID}"
+    ] .
+
+<http://example.com/base/TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:referenceFormulation rml:CSV;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "sport.csv"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "Name"
+        ];
+      rml:predicate rdfs:label
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/resource/sport_{ID}"
+    ] .
+
+

Output

+
<http://example.com/resource/student_10> <http://xmlns.com/foaf/0.1/name> "Venus Williams"  .
+<http://example.com/resource/student_20> <http://xmlns.com/foaf/0.1/name> "Demi Moore"  .
+<http://example.com/resource/sport_100> <http://www.w3.org/2000/01/rdf-schema#label> "Tennis" .
+<http://example.com/resource/student_10> <http://example.com/ontology/practises> <http://example.com/resource/sport_100>  .
+
+
+

191. RMLTC0009a-JSON

+

Title: "Generation of triples from foreign key relations"

+

Description: "Test foreign key relationships among logical tables"

+

Error expected? No

+

Input

+
{
+  "students" : [
+    { 
+      "ID": 10,
+      "Sport": 100,
+      "Name": "Venus Williams"
+    },
+    { 
+      "ID": 20,
+      "Name": "Demi Moore"
+    }
+  ]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.Name"
+        ];
+      rml:predicate foaf:name
+    ], [
+      rml:objectMap [ a rml:RefObjectMap;
+          rml:joinCondition [
+              rml:child "$.Sport";
+              rml:parent "$.ID"
+            ];
+          rml:parentTriplesMap <http://example.com/base/TriplesMap2>
+        ];
+      rml:predicate <http://example.com/ontology/practises>
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/resource/student_{$.ID}"
+    ] .
+
+<http://example.com/base/TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.sports[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "sport.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.Name"
+        ];
+      rml:predicate rdfs:label
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/resource/sport_{$.ID}"
+    ] .
+
+

Output

+
<http://example.com/resource/student_10> <http://xmlns.com/foaf/0.1/name> "Venus Williams"  .
+<http://example.com/resource/student_20> <http://xmlns.com/foaf/0.1/name> "Demi Moore"  .
+<http://example.com/resource/sport_100> <http://www.w3.org/2000/01/rdf-schema#label> "Tennis" .
+<http://example.com/resource/student_10> <http://example.com/ontology/practises> <http://example.com/resource/sport_100>  .
+
+
+

192. RMLTC0009a-MySQL

+

Title: "Generation of triples from foreign key relations"

+

Description: "Test foreign key relationships among logical tables"

+

Error expected? No

+

Input

+
USE test;
+DROP TABLE IF EXISTS test.student;
+
+CREATE TABLE student (
+  ID INTEGER,
+  Sport VARCHAR(50),
+  Name VARCHAR(50)
+);
+INSERT INTO student values ('10', '100', 'Venus Williams');
+INSERT INTO student values ('20', NULL , 'Demi Moore');
+
+DROP TABLE IF EXISTS test.sport;
+
+CREATE TABLE sport (
+  ID INTEGER,
+  Name VARCHAR(50)
+);
+INSERT INTO sport values ('100', 'Tennis');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "student"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "Name"
+        ];
+      rml:predicate foaf:name
+    ], [
+      rml:objectMap [ a rml:RefObjectMap;
+          rml:joinCondition [
+              rml:child "Sport";
+              rml:parent "ID"
+            ];
+          rml:parentTriplesMap <http://example.com/base/TriplesMap2>
+        ];
+      rml:predicate <http://example.com/ontology/practises>
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/resource/student_{ID}"
+    ] .
+
+<http://example.com/base/TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "sport"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "Name"
+        ];
+      rml:predicate rdfs:label
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/resource/sport_{ID}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
+  d2rq:password "";
+  d2rq:username "root" .
+
+

Output

+
<http://example.com/resource/student_10> <http://xmlns.com/foaf/0.1/name> "Venus Williams"  .
+<http://example.com/resource/student_20> <http://xmlns.com/foaf/0.1/name> "Demi Moore"  .
+<http://example.com/resource/sport_100> <http://www.w3.org/2000/01/rdf-schema#label> "Tennis" .
+<http://example.com/resource/student_10> <http://example.com/ontology/practises> <http://example.com/resource/sport_100>  .
+
+
+

193. RMLTC0009a-PostgreSQL

+

Title: "Generation of triples from foreign key relations"

+

Description: "Test foreign key relationships among logical tables"

+

Error expected? No

+

Input

+
DROP TABLE IF EXISTS student;
+
+CREATE TABLE student (
+  "ID" INTEGER,
+  "Sport" VARCHAR(50),
+  "Name" VARCHAR(50)
+);
+INSERT INTO student values ('10', '100', 'Venus Williams');
+INSERT INTO student values ('20', NULL , 'Demi Moore');
+
+DROP TABLE IF EXISTS sport;
+
+CREATE TABLE sport (
+  "ID" VARCHAR(50),
+  "Name" VARCHAR(50)
+);
+INSERT INTO sport values ('100', 'Tennis');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "student"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "Name"
+        ];
+      rml:predicate foaf:name
+    ], [
+      rml:objectMap [ a rml:RefObjectMap;
+          rml:joinCondition [
+              rml:child "Sport";
+              rml:parent "ID"
+            ];
+          rml:parentTriplesMap <http://example.com/base/TriplesMap2>
+        ];
+      rml:predicate <http://example.com/ontology/practises>
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/resource/student_{ID}"
+    ] .
+
+<http://example.com/base/TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "sport"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "Name"
+        ];
+      rml:predicate rdfs:label
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/resource/sport_{ID}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "org.postgresql.Driver";
+  d2rq:password "";
+  d2rq:username "postgres" .
+
+

Output

+
<http://example.com/resource/student_10> <http://xmlns.com/foaf/0.1/name> "Venus Williams"  .
+<http://example.com/resource/student_20> <http://xmlns.com/foaf/0.1/name> "Demi Moore"  .
+<http://example.com/resource/sport_100> <http://www.w3.org/2000/01/rdf-schema#label> "Tennis" .
+<http://example.com/resource/student_10> <http://example.com/ontology/practises> <http://example.com/resource/sport_100>  .
+
+
+

194. RMLTC0009a-SPARQL

+

Title: "Generation of triples from foreign key relations"

+

Description: "Test foreign key relationships among logical tables"

+

Error expected? No

+

Input

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix ns1: <http://example.com/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+
+[] ns1:plays [ a ns1:Sport ;
+            rdf:ID "100" ] ;
+    rdf:ID "10" ;
+    foaf:name "Venus Williams" .
+
+[] ns1:plays [ a ns1:Sport ] ;
+    rdf:ID "20" ;
+    foaf:name "Demi Moore" .
+
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix sd: <http://www.w3.org/ns/sparql-service-description#> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator """
+              PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
+              PREFIX foaf: <http://xmlns.com/foaf/0.1/>
+              PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
+              SELECT ?Name ?ID ?Sport
+              WHERE {
+                  ?x  foaf:name ?Name ;
+                      rdf:ID    ?ID ;
+                      <http://example.com/plays> ?sportObject .
+                  OPTIONAL { ?sportObject a <http://example.com/Sport> ;
+                                            rdf:ID ?Sport . }
+              } """;
+      rml:referenceFormulation formats:SPARQL_Results_JSON;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path <http://example.com/base/#InputSPARQL1>
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "Name.value"
+        ];
+      rml:predicate foaf:name
+    ], [
+      rml:objectMap [ a rml:RefObjectMap;
+          rml:joinCondition [
+              rml:child "Sport";
+              rml:parent "ID"
+            ];
+          rml:parentTriplesMap <http://example.com/base/TriplesMap2>
+        ];
+      rml:predicate <http://example.com/ontology/practises>
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/resource/student_{ID.value}"
+    ] .
+
+<http://example.com/base/#InputSPARQL1> a sd:Service;
+  sd:endpoint <http://HOST:PORT/ds1/sparql>;
+  sd:supportedLanguage sd:SPARQL11Query .
+
+<http://example.com/base/#InputSPARQL2> a sd:Service;
+  sd:endpoint <http://HOST:PORT/ds2/sparql>;
+  sd:supportedLanguage sd:SPARQL11Query .
+
+<http://example.com/base/TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator """
+                PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
+                PREFIX foaf: <http://xmlns.com/foaf/0.1/>
+                PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
+                SELECT ?ID ?Name
+                WHERE {
+                    ?x  foaf:name ?Name ;
+                        rdf:ID    ?ID ;
+                } """;
+      rml:referenceFormulation formats:SPARQL_Results_JSON;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path <http://example.com/base/#InputSPARQL2>
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "Name.value"
+        ];
+      rml:predicate rdfs:label
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/resource/sport_{ID.value}"
+    ] .
+
+

Output

+
<http://example.com/resource/student_10> <http://xmlns.com/foaf/0.1/name> "Venus Williams"  .
+<http://example.com/resource/student_20> <http://xmlns.com/foaf/0.1/name> "Demi Moore"  .
+<http://example.com/resource/sport_100> <http://www.w3.org/2000/01/rdf-schema#label> "Tennis" .
+<http://example.com/resource/student_10> <http://example.com/ontology/practises> <http://example.com/resource/sport_100>  .
+
+
+

195. RMLTC0009a-SQLServer

+

Title: "Generation of triples from foreign key relations"

+

Description: "Test foreign key relationships among logical tables"

+

Error expected? No

+

Input

+
USE TestDB;
+DROP TABLE IF EXISTS student;
+CREATE TABLE student (
+  "ID" INTEGER,
+  "Sport" VARCHAR(50),
+  "Name" VARCHAR(50)
+);
+INSERT INTO student values ('10', '100', 'Venus Williams');
+INSERT INTO student values ('20', NULL , 'Demi Moore');
+
+DROP TABLE IF EXISTS sport;
+
+CREATE TABLE sport (
+  "ID" INTEGER,
+  "Name" VARCHAR(50)
+);
+INSERT INTO sport values ('100', 'Tennis');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "student"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "Name"
+        ];
+      rml:predicate foaf:name
+    ], [
+      rml:objectMap [ a rml:RefObjectMap;
+          rml:joinCondition [
+              rml:child "Sport";
+              rml:parent "ID"
+            ];
+          rml:parentTriplesMap <http://example.com/base/TriplesMap2>
+        ];
+      rml:predicate <http://example.com/ontology/practises>
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/resource/student_{ID}"
+    ] .
+
+<http://example.com/base/TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "sport"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "Name"
+        ];
+      rml:predicate rdfs:label
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/resource/sport_{ID}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
+  d2rq:password "YourSTRONG!Passw0rd;";
+  d2rq:username "sa" .
+
+

Output

+
<http://example.com/resource/student_10> <http://xmlns.com/foaf/0.1/name> "Venus Williams"  .
+<http://example.com/resource/student_20> <http://xmlns.com/foaf/0.1/name> "Demi Moore"  .
+<http://example.com/resource/sport_100> <http://www.w3.org/2000/01/rdf-schema#label> "Tennis" .
+<http://example.com/resource/student_10> <http://example.com/ontology/practises> <http://example.com/resource/sport_100>  .
+
+
+

196. RMLTC0009a-XML

+

Title: "Generation of triples from foreign key relations"

+

Description: "Test foreign key relationships among logical tables"

+

Error expected? No

+

Input

+
<?xml version="1.0"?>
+
+<students>
+  <student>
+    <ID>10</ID>
+    <Name>Venus Williams</Name>
+    <Sport>100</Sport>
+  </student>
+  <student>
+    <ID>20</ID>
+    <Name>Demi Moore</Name>
+  </student>
+</students>
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "/students/student";
+      rml:referenceFormulation rml:XPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.xml"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "Name"
+        ];
+      rml:predicate foaf:name
+    ], [
+      rml:objectMap [ a rml:RefObjectMap;
+          rml:joinCondition [
+              rml:child "Sport";
+              rml:parent "ID"
+            ];
+          rml:parentTriplesMap <http://example.com/base/TriplesMap2>
+        ];
+      rml:predicate <http://example.com/ontology/practises>
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/resource/student_{ID}"
+    ] .
+
+<http://example.com/base/TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "/sports/sport";
+      rml:referenceFormulation rml:XPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "sport.xml"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "Name"
+        ];
+      rml:predicate rdfs:label
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/resource/sport_{ID}"
+    ] .
+
+

Output

+
<http://example.com/resource/student_10> <http://xmlns.com/foaf/0.1/name> "Venus Williams"  .
+<http://example.com/resource/student_20> <http://xmlns.com/foaf/0.1/name> "Demi Moore"  .
+<http://example.com/resource/sport_100> <http://www.w3.org/2000/01/rdf-schema#label> "Tennis" .
+<http://example.com/resource/student_10> <http://example.com/ontology/practises> <http://example.com/resource/sport_100>  .
+
+
+

197. RMLTC0009b-CSV

+

Title: "Generation of triples to multiple graphs"

+

Description: "Test that results from distinct parts of the mapping can be directed to different target graphs."

+

Error expected? No

+

Input

+
ID,Sport,Name
+10,100,Venus Williams
+20,,Demi Moore
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:referenceFormulation rml:CSV;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.csv"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:graph <http://example.com/graph/students>;
+      rml:objectMap [
+          rml:reference "Name"
+        ];
+      rml:predicate foaf:name
+    ], [
+      rml:graph <http://example.com/graph/practise>;
+      rml:objectMap [ a rml:RefObjectMap;
+          rml:joinCondition [
+              rml:child "Sport";
+              rml:parent "ID"
+            ];
+          rml:parentTriplesMap <http://example.com/base/TriplesMap2>
+        ];
+      rml:predicate <http://example.com/ontology/practises>
+    ];
+  rml:subjectMap [
+      rml:class <http://example.com/ontology/Student>;
+      rml:graph <http://example.com/graph/students>;
+      rml:template "http://example.com/resource/student_{ID}"
+    ] .
+
+<http://example.com/base/TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:referenceFormulation rml:CSV;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "sport.csv"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "Name"
+        ];
+      rml:predicate rdfs:label
+    ];
+  rml:subjectMap [
+      rml:class <http://example.com/ontology/Sport>;
+      rml:graph <http://example.com/graph/sports>;
+      rml:template "http://example.com/resource/sport_{ID}"
+    ] .
+
+

Output

+
<http://example.com/resource/student_10> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/ontology/Student> <http://example.com/graph/students> .
+<http://example.com/resource/student_10> <http://xmlns.com/foaf/0.1/name> "Venus Williams" <http://example.com/graph/students> .
+<http://example.com/resource/student_20> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/ontology/Student> <http://example.com/graph/students> .
+<http://example.com/resource/student_20> <http://xmlns.com/foaf/0.1/name> "Demi Moore" <http://example.com/graph/students> .
+<http://example.com/resource/sport_100> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/ontology/Sport> <http://example.com/graph/sports> .
+<http://example.com/resource/sport_100> <http://www.w3.org/2000/01/rdf-schema#label> "Tennis" <http://example.com/graph/sports> .
+<http://example.com/resource/student_10> <http://example.com/ontology/practises> <http://example.com/resource/sport_100> <http://example.com/graph/practise> .
+<http://example.com/resource/student_10> <http://example.com/ontology/practises> <http://example.com/resource/sport_100> <http://example.com/graph/students> .
+
+
+

198. RMLTC0009b-JSON

+

Title: "Generation of triples to multiple graphs"

+

Description: "Test that results from distinct parts of the mapping can be directed to different target graphs."

+

Error expected? No

+

Input

+
{
+  "students" : [
+    { 
+      "ID": 10,
+      "Sport": 100,
+      "Name": "Venus Williams"
+    },
+    { 
+      "ID": 20,
+      "Name": "Demi Moore"
+    }
+  ]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:graph <http://example.com/graph/students>;
+      rml:objectMap [
+          rml:reference "$.Name"
+        ];
+      rml:predicate foaf:name
+    ], [
+      rml:graph <http://example.com/graph/practise>;
+      rml:objectMap [ a rml:RefObjectMap;
+          rml:joinCondition [
+              rml:child "$.Sport";
+              rml:parent "$.ID"
+            ];
+          rml:parentTriplesMap <http://example.com/base/TriplesMap2>
+        ];
+      rml:predicate <http://example.com/ontology/practises>
+    ];
+  rml:subjectMap [
+      rml:class <http://example.com/ontology/Student>;
+      rml:graph <http://example.com/graph/students>;
+      rml:template "http://example.com/resource/student_{$.ID}"
+    ] .
+
+<http://example.com/base/TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.sports[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "sport.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.Name"
+        ];
+      rml:predicate rdfs:label
+    ];
+  rml:subjectMap [
+      rml:class <http://example.com/ontology/Sport>;
+      rml:graph <http://example.com/graph/sports>;
+      rml:template "http://example.com/resource/sport_{$.ID}"
+    ] .
+
+

Output

+
<http://example.com/resource/student_10> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/ontology/Student> <http://example.com/graph/students> .
+<http://example.com/resource/student_10> <http://xmlns.com/foaf/0.1/name> "Venus Williams" <http://example.com/graph/students> .
+<http://example.com/resource/student_20> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/ontology/Student> <http://example.com/graph/students> .
+<http://example.com/resource/student_20> <http://xmlns.com/foaf/0.1/name> "Demi Moore" <http://example.com/graph/students> .
+<http://example.com/resource/sport_100> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/ontology/Sport> <http://example.com/graph/sports> .
+<http://example.com/resource/sport_100> <http://www.w3.org/2000/01/rdf-schema#label> "Tennis" <http://example.com/graph/sports> .
+<http://example.com/resource/student_10> <http://example.com/ontology/practises> <http://example.com/resource/sport_100> <http://example.com/graph/practise> .
+<http://example.com/resource/student_10> <http://example.com/ontology/practises> <http://example.com/resource/sport_100> <http://example.com/graph/students> .
+
+
+

199. RMLTC0009b-MySQL

+

Title: "Generation of triples to multiple graphs"

+

Description: "Test that results from distinct parts of the mapping can be directed to different target graphs."

+

Error expected? No

+

Input

+
USE test;
+DROP TABLE IF EXISTS test.student;
+
+CREATE TABLE student (
+  ID INTEGER,
+  Sport VARCHAR(50),
+  Name VARCHAR(50)
+);
+INSERT INTO student values ('10', '100', 'Venus Williams');
+INSERT INTO student values ('20', NULL, 'Demi Moore');
+
+DROP TABLE IF EXISTS test.sport;
+
+CREATE TABLE sport (
+  ID INTEGER,
+  Name VARCHAR(50)
+);
+INSERT INTO sport values ('100', 'Tennis');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "student"
+    ];
+  rml:predicateObjectMap [
+      rml:graph <http://example.com/graph/students>;
+      rml:objectMap [
+          rml:reference "Name"
+        ];
+      rml:predicate foaf:name
+    ], [
+      rml:graph <http://example.com/graph/practise>;
+      rml:objectMap [ a rml:RefObjectMap;
+          rml:joinCondition [
+              rml:child "Sport";
+              rml:parent "ID"
+            ];
+          rml:parentTriplesMap <http://example.com/base/TriplesMap2>
+        ];
+      rml:predicate <http://example.com/ontology/practises>
+    ];
+  rml:subjectMap [
+      rml:class <http://example.com/ontology/Student>;
+      rml:graph <http://example.com/graph/students>;
+      rml:template "http://example.com/resource/student_{ID}"
+    ] .
+
+<http://example.com/base/TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "sport"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "Name"
+        ];
+      rml:predicate rdfs:label
+    ];
+  rml:subjectMap [
+      rml:class <http://example.com/ontology/Sport>;
+      rml:graph <http://example.com/graph/sports>;
+      rml:template "http://example.com/resource/sport_{ID}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
+  d2rq:password "";
+  d2rq:username "root" .
+
+

Output

+
<http://example.com/resource/student_10> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/ontology/Student> <http://example.com/graph/students> .
+<http://example.com/resource/student_10> <http://xmlns.com/foaf/0.1/name> "Venus Williams" <http://example.com/graph/students> .
+<http://example.com/resource/student_20> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/ontology/Student> <http://example.com/graph/students> .
+<http://example.com/resource/student_20> <http://xmlns.com/foaf/0.1/name> "Demi Moore" <http://example.com/graph/students> .
+<http://example.com/resource/sport_100> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/ontology/Sport> <http://example.com/graph/sports> .
+<http://example.com/resource/sport_100> <http://www.w3.org/2000/01/rdf-schema#label> "Tennis" <http://example.com/graph/sports> .
+<http://example.com/resource/student_10> <http://example.com/ontology/practises> <http://example.com/resource/sport_100> <http://example.com/graph/practise> .
+<http://example.com/resource/student_10> <http://example.com/ontology/practises> <http://example.com/resource/sport_100> <http://example.com/graph/students> .
+
+
+

200. RMLTC0009b-PostgreSQL

+

Title: "Generation of triples to multiple graphs"

+

Description: "Test that results from distinct parts of the mapping can be directed to different target graphs."

+

Error expected? No

+

Input

+
DROP TABLE IF EXISTS student;
+
+CREATE TABLE student (
+  "ID" INTEGER,
+  "Sport" VARCHAR(50),
+  "Name" VARCHAR(50)
+);
+INSERT INTO student values ('10', '100', 'Venus Williams');
+INSERT INTO student values ('20', NULL, 'Demi Moore');
+
+DROP TABLE IF EXISTS sport;
+
+CREATE TABLE sport (
+  "ID" VARCHAR(50),
+  "Name" VARCHAR(50)
+);
+INSERT INTO sport values ('100', 'Tennis');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "student"
+    ];
+  rml:predicateObjectMap [
+      rml:graph <http://example.com/graph/students>;
+      rml:objectMap [
+          rml:reference "Name"
+        ];
+      rml:predicate foaf:name
+    ], [
+      rml:graph <http://example.com/graph/practise>;
+      rml:objectMap [ a rml:RefObjectMap;
+          rml:joinCondition [
+              rml:child "Sport";
+              rml:parent "ID"
+            ];
+          rml:parentTriplesMap <http://example.com/base/TriplesMap2>
+        ];
+      rml:predicate <http://example.com/ontology/practises>
+    ];
+  rml:subjectMap [
+      rml:class <http://example.com/ontology/Student>;
+      rml:graph <http://example.com/graph/students>;
+      rml:template "http://example.com/resource/student_{ID}"
+    ] .
+
+<http://example.com/base/TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "sport"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "Name"
+        ];
+      rml:predicate rdfs:label
+    ];
+  rml:subjectMap [
+      rml:class <http://example.com/ontology/Sport>;
+      rml:graph <http://example.com/graph/sports>;
+      rml:template "http://example.com/resource/sport_{ID}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "org.postgresql.Driver";
+  d2rq:password "";
+  d2rq:username "postgres" .
+
+

Output

+
<http://example.com/resource/student_10> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/ontology/Student> <http://example.com/graph/students> .
+<http://example.com/resource/student_10> <http://xmlns.com/foaf/0.1/name> "Venus Williams" <http://example.com/graph/students> .
+<http://example.com/resource/student_20> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/ontology/Student> <http://example.com/graph/students> .
+<http://example.com/resource/student_20> <http://xmlns.com/foaf/0.1/name> "Demi Moore" <http://example.com/graph/students> .
+<http://example.com/resource/sport_100> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/ontology/Sport> <http://example.com/graph/sports> .
+<http://example.com/resource/sport_100> <http://www.w3.org/2000/01/rdf-schema#label> "Tennis" <http://example.com/graph/sports> .
+<http://example.com/resource/student_10> <http://example.com/ontology/practises> <http://example.com/resource/sport_100> <http://example.com/graph/practise> .
+<http://example.com/resource/student_10> <http://example.com/ontology/practises> <http://example.com/resource/sport_100> <http://example.com/graph/students> .
+
+
+

201. RMLTC0009b-SPARQL

+

Title: "Generation of triples to multiple graphs"

+

Description: "Test that results from distinct parts of the mapping can be directed to different target graphs."

+

Error expected? No

+

Input

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix ns1: <http://example.com/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+
+[] ns1:plays [ a ns1:Sport ;
+            rdf:ID "100" ] ;
+    rdf:ID "10" ;
+    foaf:name "Venus Williams" .
+
+[] ns1:plays [ a ns1:Sport ] ;
+    rdf:ID "20" ;
+    foaf:name "Demi Moore" .
+
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix sd: <http://www.w3.org/ns/sparql-service-description#> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator """
+              PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
+              PREFIX foaf: <http://xmlns.com/foaf/0.1/>
+              PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
+              SELECT ?Name ?ID ?Sport
+              WHERE {
+                  ?x  foaf:name ?Name ;
+                      rdf:ID    ?ID ;
+                      <http://example.com/plays> ?sportObject .
+                  OPTIONAL { ?sportObject a <http://example.com/Sport> ;
+                                            rdf:ID ?Sport . }
+              } """;
+      rml:referenceFormulation formats:SPARQL_Results_JSON;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path <http://example.com/base/#InputSPARQL1>
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:graph <http://example.com/graph/students>;
+      rml:objectMap [
+          rml:reference "Name.value"
+        ];
+      rml:predicate foaf:name
+    ], [
+      rml:graph <http://example.com/graph/practise>;
+      rml:objectMap [ a rml:RefObjectMap;
+          rml:joinCondition [
+              rml:child "Sport.value";
+              rml:parent "ID.value"
+            ];
+          rml:parentTriplesMap <http://example.com/base/TriplesMap2>
+        ];
+      rml:predicate <http://example.com/ontology/practises>
+    ];
+  rml:subjectMap [
+      rml:class <http://example.com/ontology/Student>;
+      rml:graph <http://example.com/graph/students>;
+      rml:template "http://example.com/resource/student_{ID.value}"
+    ] .
+
+<http://example.com/base/#InputSPARQL1> a sd:Service;
+  sd:endpoint <http://HOST:PORT/ds1/sparql>;
+  sd:supportedLanguage sd:SPARQL11Query .
+
+<http://example.com/base/#InputSPARQL2> a sd:Service;
+  sd:endpoint <http://HOST:PORT/ds2/sparql>;
+  sd:supportedLanguage sd:SPARQL11Query .
+
+<http://example.com/base/TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator """
+                PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
+                PREFIX foaf: <http://xmlns.com/foaf/0.1/>
+                PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
+                SELECT ?ID ?Name
+                WHERE {
+                    ?x  foaf:name ?Name ;
+                        rdf:ID    ?ID ;
+                } """;
+      rml:referenceFormulation formats:SPARQL_Results_JSON;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path <http://example.com/base/#InputSPARQL2>
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "Name.value"
+        ];
+      rml:predicate rdfs:label
+    ];
+  rml:subjectMap [
+      rml:class <http://example.com/ontology/Sport>;
+      rml:graph <http://example.com/graph/sports>;
+      rml:template "http://example.com/resource/sport_{ID.value}"
+    ] .
+
+

Output

+
<http://example.com/resource/student_10> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/ontology/Student> <http://example.com/graph/students> .
+<http://example.com/resource/student_10> <http://xmlns.com/foaf/0.1/name> "Venus Williams" <http://example.com/graph/students> .
+<http://example.com/resource/student_20> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/ontology/Student> <http://example.com/graph/students> .
+<http://example.com/resource/student_20> <http://xmlns.com/foaf/0.1/name> "Demi Moore" <http://example.com/graph/students> .
+<http://example.com/resource/sport_100> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/ontology/Sport> <http://example.com/graph/sports> .
+<http://example.com/resource/sport_100> <http://www.w3.org/2000/01/rdf-schema#label> "Tennis" <http://example.com/graph/sports> .
+<http://example.com/resource/student_10> <http://example.com/ontology/practises> <http://example.com/resource/sport_100> <http://example.com/graph/practise> .
+<http://example.com/resource/student_10> <http://example.com/ontology/practises> <http://example.com/resource/sport_100> <http://example.com/graph/students> .
+
+
+

202. RMLTC0009b-SQLServer

+

Title: "Generation of triples to multiple graphs"

+

Description: "Test that results from distinct parts of the mapping can be directed to different target graphs."

+

Error expected? No

+

Input

+
USE TestDB;
+DROP TABLE IF EXISTS student;
+
+CREATE TABLE student (
+  "ID" INTEGER,
+  "Sport" VARCHAR(50),
+  "Name" VARCHAR(50)
+);
+INSERT INTO student values ('10', '100', 'Venus Williams');
+INSERT INTO student values ('20', NULL, 'Demi Moore');
+
+DROP TABLE IF EXISTS sport;
+
+CREATE TABLE sport (
+  "ID" INTEGER,
+  "Name" VARCHAR(50)
+);
+INSERT INTO sport values ('100', 'Tennis');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "student"
+    ];
+  rml:predicateObjectMap [
+      rml:graph <http://example.com/graph/students>;
+      rml:objectMap [
+          rml:reference "Name"
+        ];
+      rml:predicate foaf:name
+    ], [
+      rml:graph <http://example.com/graph/practise>;
+      rml:objectMap [ a rml:RefObjectMap;
+          rml:joinCondition [
+              rml:child "Sport";
+              rml:parent "ID"
+            ];
+          rml:parentTriplesMap <http://example.com/base/TriplesMap2>
+        ];
+      rml:predicate <http://example.com/ontology/practises>
+    ];
+  rml:subjectMap [
+      rml:class <http://example.com/ontology/Student>;
+      rml:graph <http://example.com/graph/students>;
+      rml:template "http://example.com/resource/student_{ID}"
+    ] .
+
+<http://example.com/base/TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "sport"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "Name"
+        ];
+      rml:predicate rdfs:label
+    ];
+  rml:subjectMap [
+      rml:class <http://example.com/ontology/Sport>;
+      rml:graph <http://example.com/graph/sports>;
+      rml:template "http://example.com/resource/sport_{ID}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
+  d2rq:password "YourSTRONG!Passw0rd;";
+  d2rq:username "sa" .
+
+

Output

+
<http://example.com/resource/student_10> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/ontology/Student> <http://example.com/graph/students> .
+<http://example.com/resource/student_10> <http://xmlns.com/foaf/0.1/name> "Venus Williams" <http://example.com/graph/students> .
+<http://example.com/resource/student_20> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/ontology/Student> <http://example.com/graph/students> .
+<http://example.com/resource/student_20> <http://xmlns.com/foaf/0.1/name> "Demi Moore" <http://example.com/graph/students> .
+<http://example.com/resource/sport_100> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/ontology/Sport> <http://example.com/graph/sports> .
+<http://example.com/resource/sport_100> <http://www.w3.org/2000/01/rdf-schema#label> "Tennis" <http://example.com/graph/sports> .
+<http://example.com/resource/student_10> <http://example.com/ontology/practises> <http://example.com/resource/sport_100> <http://example.com/graph/practise> .
+<http://example.com/resource/student_10> <http://example.com/ontology/practises> <http://example.com/resource/sport_100> <http://example.com/graph/students> .
+
+
+

203. RMLTC0009b-XML

+

Title: "Generation of triples to multiple graphs"

+

Description: "Test that results from distinct parts of the mapping can be directed to different target graphs."

+

Error expected? No

+

Input

+
<?xml version="1.0"?>
+
+<students>
+  <student>
+    <ID>10</ID>
+    <Name>Venus Williams</Name>
+    <Sport>100</Sport>
+  </student>
+  <student>
+    <ID>20</ID>
+    <Name>Demi Moore</Name>
+  </student>
+</students>
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "/students/student";
+      rml:referenceFormulation rml:XPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.xml"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:graph <http://example.com/graph/students>;
+      rml:objectMap [
+          rml:reference "Name"
+        ];
+      rml:predicate foaf:name
+    ], [
+      rml:graph <http://example.com/graph/practise>;
+      rml:objectMap [ a rml:RefObjectMap;
+          rml:joinCondition [
+              rml:child "Sport";
+              rml:parent "ID"
+            ];
+          rml:parentTriplesMap <http://example.com/base/TriplesMap2>
+        ];
+      rml:predicate <http://example.com/ontology/practises>
+    ];
+  rml:subjectMap [
+      rml:class <http://example.com/ontology/Student>;
+      rml:graph <http://example.com/graph/students>;
+      rml:template "http://example.com/resource/student_{ID}"
+    ] .
+
+<http://example.com/base/TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "/sports/sport";
+      rml:referenceFormulation rml:XPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "sport.xml"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "Name"
+        ];
+      rml:predicate rdfs:label
+    ];
+  rml:subjectMap [
+      rml:class <http://example.com/ontology/Sport>;
+      rml:graph <http://example.com/graph/sports>;
+      rml:template "http://example.com/resource/sport_{ID}"
+    ] .
+
+

Output

+
<http://example.com/resource/student_10> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/ontology/Student> <http://example.com/graph/students> .
+<http://example.com/resource/student_10> <http://xmlns.com/foaf/0.1/name> "Venus Williams" <http://example.com/graph/students> .
+<http://example.com/resource/student_20> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/ontology/Student> <http://example.com/graph/students> .
+<http://example.com/resource/student_20> <http://xmlns.com/foaf/0.1/name> "Demi Moore" <http://example.com/graph/students> .
+<http://example.com/resource/sport_100> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/ontology/Sport> <http://example.com/graph/sports> .
+<http://example.com/resource/sport_100> <http://www.w3.org/2000/01/rdf-schema#label> "Tennis" <http://example.com/graph/sports> .
+<http://example.com/resource/student_10> <http://example.com/ontology/practises> <http://example.com/resource/sport_100> <http://example.com/graph/practise> .
+<http://example.com/resource/student_10> <http://example.com/ontology/practises> <http://example.com/resource/sport_100> <http://example.com/graph/students> .
+
+
+

204. RMLTC0009c-MySQL

+

Title: "Unnamed column in a logical table"

+

Description: "Test a logical table with unnamed column."

+

Error expected? No

+

Input

+
USE test;
+DROP TABLE IF EXISTS test.Sport;
+DROP TABLE IF EXISTS test.Student;
+
+CREATE TABLE Sport (
+ID integer,
+Name varchar (50),
+PRIMARY KEY (ID)
+);
+
+CREATE TABLE Student (
+ID integer,
+Name varchar(50),
+Sport integer,
+PRIMARY KEY (ID),
+FOREIGN KEY(Sport) REFERENCES Sport(ID)
+);
+
+INSERT INTO Sport (ID, Name) VALUES (100,'Tennis');
+INSERT INTO Student (ID, Name, Sport) VALUES (10,'Venus Williams', 100);
+INSERT INTO Student (ID, Name, Sport) VALUES (20,'Demi Moore', NULL);
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator """
+        SELECT Name, COUNT(Sport)
+        FROM Student
+        GROUP BY Name
+        """;
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Query
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "Name"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/resource/student_{Name}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
+  d2rq:password "";
+  d2rq:username "root" .
+
+

Output

+
<http://example.com/resource/student_Venus%20Williams> <http://xmlns.com/foaf/0.1/name> "Venus Williams" . 
+<http://example.com/resource/student_Demi%20Moore> <http://xmlns.com/foaf/0.1/name> "Demi Moore" . 
+
+
+
+
+

205. RMLTC0009c-PostgreSQL

+

Title: "Unnamed column in a logical table"

+

Description: "Test a logical table with unnamed column."

+

Error expected? No

+

Input

+
DROP TABLE IF EXISTS Sport;
+DROP TABLE IF EXISTS Student;
+
+CREATE TABLE Sport (
+ID integer,
+Name varchar (50),
+PRIMARY KEY (ID)
+);
+
+CREATE TABLE Student (
+ID integer,
+Name varchar(50),
+Sport integer,
+PRIMARY KEY (ID),
+FOREIGN KEY(Sport) REFERENCES Sport(ID)
+);
+
+INSERT INTO Sport (ID, Name) VALUES (100,'Tennis');
+INSERT INTO Student (ID, Name, Sport) VALUES (10,'Venus Williams', 100);
+INSERT INTO Student (ID, Name, Sport) VALUES (20,'Demi Moore', NULL);
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator """
+        SELECT Name, COUNT(Sport)
+        FROM Student
+        GROUP BY Name
+        """;
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Query
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "name"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/resource/student_{name}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "org.postgresql.Driver";
+  d2rq:password "";
+  d2rq:username "postgres" .
+
+

Output

+
<http://example.com/resource/student_Venus%20Williams> <http://xmlns.com/foaf/0.1/name> "Venus Williams" . 
+<http://example.com/resource/student_Demi%20Moore> <http://xmlns.com/foaf/0.1/name> "Demi Moore" . 
+
+
+
+
+

206. RMLTC0009c-SQLServer

+

Title: "Unnamed column in a logical table"

+

Description: "Test a logical table with unnamed column."

+

Error expected? No

+

Input

+
USE TestDB;
+DROP TABLE IF EXISTS Sport;
+DROP TABLE IF EXISTS Student;
+
+CREATE TABLE Sport (
+ID integer,
+Name varchar (50),
+PRIMARY KEY (ID)
+);
+
+CREATE TABLE Student (
+ID integer,
+Name varchar(50),
+Sport integer,
+PRIMARY KEY (ID),
+FOREIGN KEY(Sport) REFERENCES Sport(ID)
+);
+
+INSERT INTO Sport (ID, Name) VALUES (100,'Tennis');
+INSERT INTO Student (ID, Name, Sport) VALUES (10,'Venus Williams', 100);
+INSERT INTO Student (ID, Name, Sport) VALUES (20,'Demi Moore', NULL);
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator """
+        SELECT Name, COUNT(Sport)
+        FROM Student
+        GROUP BY Name
+        """;
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Query
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "Name"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/resource/student_{Name}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
+  d2rq:password "YourSTRONG!Passw0rd;";
+  d2rq:username "sa" .
+
+

Output

+
<http://example.com/resource/student_Venus%20Williams> <http://xmlns.com/foaf/0.1/name> "Venus Williams" . 
+<http://example.com/resource/student_Demi%20Moore> <http://xmlns.com/foaf/0.1/name> "Demi Moore" . 
+
+
+
+
+

207. RMLTC0009d-MySQL

+

Title: "Named column in logical table"

+

Description: "Test a logical table named column."

+

Error expected? No

+

Input

+
USE test;
+DROP TABLE IF EXISTS test.Student;
+DROP TABLE IF EXISTS test.Sport;
+
+CREATE TABLE Sport (
+ID integer,
+Name varchar (50),
+PRIMARY KEY (ID)
+);
+
+CREATE TABLE Student (
+ID integer,
+Name varchar(50),
+Sport integer,
+PRIMARY KEY (ID),
+FOREIGN KEY(Sport) REFERENCES Sport(ID)
+);
+
+INSERT INTO Sport (ID, Name) VALUES (100,'Tennis');
+INSERT INTO Student (ID, Name, Sport) VALUES (10,'Venus Williams', 100);
+INSERT INTO Student (ID, Name, Sport) VALUES (20,'Demi Moore', NULL);
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator """
+        SELECT Name, COUNT(Sport) as SPORTCOUNT
+        FROM Student
+        GROUP BY Name
+        """;
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Query
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "Name"
+        ];
+      rml:predicate foaf:name
+    ], [
+      rml:objectMap [
+          rml:reference "SPORTCOUNT"
+        ];
+      rml:predicate ex:numSport
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/resource/student_{Name}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
+  d2rq:password "";
+  d2rq:username "root" .
+
+

Output

+
<http://example.com/resource/student_Venus%20Williams> <http://xmlns.com/foaf/0.1/name> "Venus Williams" . 
+<http://example.com/resource/student_Venus%20Williams> <http://example.com/numSport> "1"^^<http://www.w3.org/2001/XMLSchema#integer> . 
+<http://example.com/resource/student_Demi%20Moore> <http://xmlns.com/foaf/0.1/name> "Demi Moore" . 
+<http://example.com/resource/student_Demi%20Moore> <http://example.com/numSport> "0"^^<http://www.w3.org/2001/XMLSchema#integer> . 
+
+
+
+
+
+

208. RMLTC0009d-PostgreSQL

+

Title: "Named column in logical table"

+

Description: "Test a logical table named column."

+

Error expected? No

+

Input

+
DROP TABLE IF EXISTS Student;
+DROP TABLE IF EXISTS Sport;
+
+CREATE TABLE Sport (
+ID integer,
+Name varchar (50),
+PRIMARY KEY (ID)
+);
+
+CREATE TABLE Student (
+ID integer,
+Name varchar(50),
+Sport integer,
+PRIMARY KEY (ID),
+FOREIGN KEY(Sport) REFERENCES Sport(ID)
+);
+
+INSERT INTO Sport (ID, Name) VALUES (100,'Tennis');
+INSERT INTO Student (ID, Name, Sport) VALUES (10,'Venus Williams', 100);
+INSERT INTO Student (ID, Name, Sport) VALUES (20,'Demi Moore', NULL);
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator """
+        SELECT Name, COUNT(Sport) as SPORTCOUNT
+        FROM Student
+        GROUP BY Name
+        """;
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Query
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "name"
+        ];
+      rml:predicate foaf:name
+    ], [
+      rml:objectMap [
+          rml:reference "sportcount"
+        ];
+      rml:predicate ex:numSport
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/resource/student_{name}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "org.postgresql.Driver";
+  d2rq:password "";
+  d2rq:username "postgres" .
+
+

Output

+
<http://example.com/resource/student_Venus%20Williams> <http://xmlns.com/foaf/0.1/name> "Venus Williams" . 
+<http://example.com/resource/student_Venus%20Williams> <http://example.com/numSport> "1"^^<http://www.w3.org/2001/XMLSchema#integer> . 
+<http://example.com/resource/student_Demi%20Moore> <http://xmlns.com/foaf/0.1/name> "Demi Moore" . 
+<http://example.com/resource/student_Demi%20Moore> <http://example.com/numSport> "0"^^<http://www.w3.org/2001/XMLSchema#integer> . 
+
+
+
+
+
+

209. RMLTC0009d-SQLServer

+

Title: "Named column in logical table"

+

Description: "Test a logical table named column."

+

Error expected? No

+

Input

+
USE TestDB;
+DROP TABLE IF EXISTS Student;
+DROP TABLE IF EXISTS Sport;
+
+CREATE TABLE Sport (
+ID integer,
+Name varchar (50),
+PRIMARY KEY (ID)
+);
+
+CREATE TABLE Student (
+ID integer,
+Name varchar(50),
+Sport integer,
+PRIMARY KEY (ID),
+FOREIGN KEY(Sport) REFERENCES Sport(ID)
+);
+
+INSERT INTO Sport (ID, Name) VALUES (100,'Tennis');
+INSERT INTO Student (ID, Name, Sport) VALUES (10,'Venus Williams', 100);
+INSERT INTO Student (ID, Name, Sport) VALUES (20,'Demi Moore', NULL);
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator """
+        SELECT Name, COUNT(Sport) as SPORTCOUNT
+        FROM Student
+        GROUP BY Name
+        """;
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Query
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "Name"
+        ];
+      rml:predicate foaf:name
+    ], [
+      rml:objectMap [
+          rml:reference "SPORTCOUNT"
+        ];
+      rml:predicate ex:numSport
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/resource/student_{Name}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
+  d2rq:password "YourSTRONG!Passw0rd;";
+  d2rq:username "sa" .
+
+

Output

+
<http://example.com/resource/student_Venus%20Williams> <http://xmlns.com/foaf/0.1/name> "Venus Williams" . 
+<http://example.com/resource/student_Venus%20Williams> <http://example.com/numSport> "1"^^<http://www.w3.org/2001/XMLSchema#integer> . 
+<http://example.com/resource/student_Demi%20Moore> <http://xmlns.com/foaf/0.1/name> "Demi Moore" . 
+<http://example.com/resource/student_Demi%20Moore> <http://example.com/numSport> "0"^^<http://www.w3.org/2001/XMLSchema#integer> . 
+
+
+
+
+
+

210. RMLTC0010a-CSV

+

Title: "Template with table column with special chars"

+

Description: "Tests a template with blank space in column value"

+

Error expected? No

+

Input

+
Country Code,Name,ISO 3166
+1,"Bolivia, Plurinational State of",BO
+2,"Ireland",IE
+3,"Saint Martin (French part)",MF
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:referenceFormulation rml:CSV;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "country_info.csv"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "Name"
+        ];
+      rml:predicate ex:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{Country Code}"
+    ] .
+
+

Output

+
<http://example.com/1> <http://example.com/name> "Bolivia, Plurinational State of" .
+<http://example.com/2> <http://example.com/name> "Ireland" .
+<http://example.com/3> <http://example.com/name> "Saint Martin (French part)" .
+
+
+
+

211. RMLTC0010a-JSON

+

Title: "Template with table column with special chars"

+

Description: "Tests a template with blank space in column value"

+

Error expected? No

+

Input

+
{
+  "countries": [{
+    "Country Code": 1,
+    "Name":"Bolivia, Plurinational State of",
+    "ISO 3166": "BO"
+  }, {
+    "Country Code": 2,
+    "Name":"Ireland",
+    "ISO 3166": "IE"
+  }, {
+    "Country Code": 3,
+    "Name":"Saint Martin (French part)",
+    "ISO 3166": "MF"
+  }]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.countries[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "country_info.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.Name"
+        ];
+      rml:predicate ex:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{$.['Country Code']}"
+    ] .
+
+

Output

+
<http://example.com/1> <http://example.com/name> "Bolivia, Plurinational State of" .
+<http://example.com/2> <http://example.com/name> "Ireland" .
+<http://example.com/3> <http://example.com/name> "Saint Martin (French part)" .
+
+
+
+

212. RMLTC0010a-MySQL

+

Title: "Template with table column with special chars"

+

Description: "Tests a template with blank space in column value"

+

Error expected? No

+

Input

+
USE test;
+DROP TABLE IF EXISTS test.country_info;
+
+CREATE TABLE country_info (
+  `Country Code` INTEGER,
+  Name VARCHAR(100),
+  `ISO 3166` VARCHAR(10)
+);
+INSERT INTO country_info values ('1', 'Bolivia, Plurinational State of', 'BO');
+INSERT INTO country_info values ('2', 'Ireland', 'IE');
+INSERT INTO country_info values ('3', 'Saint Martin (French part)', 'MF');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "country_info"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "Name"
+        ];
+      rml:predicate ex:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{Country Code}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
+  d2rq:password "";
+  d2rq:username "root" .
+
+

Output

+
<http://example.com/1> <http://example.com/name> "Bolivia, Plurinational State of" .
+<http://example.com/2> <http://example.com/name> "Ireland" .
+<http://example.com/3> <http://example.com/name> "Saint Martin (French part)" .
+
+
+
+

213. RMLTC0010a-PostgreSQL

+

Title: "Template with table column with special chars"

+

Description: "Tests a template with blank space in column value"

+

Error expected? No

+

Input

+
DROP TABLE IF EXISTS country_info;
+
+CREATE TABLE country_info (
+  "Country Code" INTEGER,
+  "Name" VARCHAR(100),
+  "ISO 3166" VARCHAR(10)
+);
+INSERT INTO country_info values ('1', 'Bolivia, Plurinational State of', 'BO');
+INSERT INTO country_info values ('2', 'Ireland', 'IE');
+INSERT INTO country_info values ('3', 'Saint Martin (French part)', 'MF');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "country_info"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "Name"
+        ];
+      rml:predicate ex:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{Country Code}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "org.postgresql.Driver";
+  d2rq:password "";
+  d2rq:username "postgres" .
+
+

Output

+
<http://example.com/1> <http://example.com/name> "Bolivia, Plurinational State of" .
+<http://example.com/2> <http://example.com/name> "Ireland" .
+<http://example.com/3> <http://example.com/name> "Saint Martin (French part)" .
+
+
+
+

214. RMLTC0010a-SQLServer

+

Title: "Template with table column with special chars"

+

Description: "Tests a template with blank space in column value"

+

Error expected? No

+

Input

+
USE TestDB;
+DROP TABLE IF EXISTS country_info;
+
+CREATE TABLE country_info (
+  "Country Code" INTEGER,
+  "Name" VARCHAR(100),
+  "ISO 3166" VARCHAR(10)
+);
+INSERT INTO country_info values ('1', 'Bolivia, Plurinational State of', 'BO');
+INSERT INTO country_info values ('2', 'Ireland', 'IE');
+INSERT INTO country_info values ('3', 'Saint Martin (French part)', 'MF');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "country_info"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "Name"
+        ];
+      rml:predicate ex:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{Country Code}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
+  d2rq:password "YourSTRONG!Passw0rd;";
+  d2rq:username "sa" .
+
+

Output

+
<http://example.com/1> <http://example.com/name> "Bolivia, Plurinational State of" .
+<http://example.com/2> <http://example.com/name> "Ireland" .
+<http://example.com/3> <http://example.com/name> "Saint Martin (French part)" .
+
+
+
+

215. RMLTC0010b-CSV

+

Title: "Template with table columns with special chars"

+

Description: "Tests a template with special chars in column value"

+

Error expected? No

+

Input

+
Country Code,Name,ISO 3166
+1,"Bolivia, Plurinational State of",BO
+2,Ireland,IE
+3,"Saint Martin (French part)",MF
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:referenceFormulation rml:CSV;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "country_info.csv"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "Name"
+        ];
+      rml:predicate ex:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{Country Code}/{Name}"
+    ] .
+
+

Output

+
<http://example.com/1/Bolivia%2C%20Plurinational%20State%20of> <http://example.com/name> "Bolivia, Plurinational State of" .
+<http://example.com/2/Ireland> <http://example.com/name> "Ireland" .
+<http://example.com/3/Saint%20Martin%20%28French%20part%29> <http://example.com/name> "Saint Martin (French part)" .
+
+
+
+

216. RMLTC0010b-JSON

+

Title: "Template with table columns with special chars"

+

Description: "Tests a template with special chars in column value"

+

Error expected? No

+

Input

+
{
+  "countries": [{
+    "Country Code": 1,
+    "Name":"Bolivia, Plurinational State of",
+    "ISO 3166": "BO"
+  }, {
+    "Country Code": 2,
+    "Name":"Ireland",
+    "ISO 3166": "IE"
+  }, {
+    "Country Code": 3,
+    "Name":"Saint Martin (French part)",
+    "ISO 3166": "MF"
+  }]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.countries[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "country_info.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.Name"
+        ];
+      rml:predicate ex:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{$.['Country Code']}/{$.Name}"
+    ] .
+
+

Output

+
<http://example.com/1/Bolivia%2C%20Plurinational%20State%20of> <http://example.com/name> "Bolivia, Plurinational State of" .
+<http://example.com/2/Ireland> <http://example.com/name> "Ireland" .
+<http://example.com/3/Saint%20Martin%20%28French%20part%29> <http://example.com/name> "Saint Martin (French part)" .
+
+
+
+

217. RMLTC0010b-MySQL

+

Title: "Template with table columns with special chars"

+

Description: "Tests a template with special chars in column value"

+

Error expected? No

+

Input

+
USE test;
+DROP TABLE IF EXISTS test.country_info;
+
+CREATE TABLE country_info (
+  `Country Code` INTEGER,
+  Name VARCHAR(100),
+  `ISO 3166` VARCHAR(10)
+);
+INSERT INTO country_info values ('1', 'Bolivia, Plurinational State of', 'BO');
+INSERT INTO country_info values ('2', 'Ireland', 'IE');
+INSERT INTO country_info values ('3', 'Saint Martin (French part)', 'MF');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "country_info"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "Name"
+        ];
+      rml:predicate ex:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{Country Code}/{Name}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
+  d2rq:password "";
+  d2rq:username "root" .
+
+

Output

+
<http://example.com/1/Bolivia%2C%20Plurinational%20State%20of> <http://example.com/name> "Bolivia, Plurinational State of" .
+<http://example.com/2/Ireland> <http://example.com/name> "Ireland" .
+<http://example.com/3/Saint%20Martin%20%28French%20part%29> <http://example.com/name> "Saint Martin (French part)" .
+
+
+
+

218. RMLTC0010b-PostgreSQL

+

Title: "Template with table columns with special chars"

+

Description: "Tests a template with special chars in column value"

+

Error expected? No

+

Input

+
DROP TABLE IF EXISTS country_info;
+
+CREATE TABLE country_info (
+  "Country Code" INTEGER,
+  "Name" VARCHAR(100),
+  "ISO 3166" VARCHAR(10)
+);
+INSERT INTO country_info values ('1', 'Bolivia, Plurinational State of', 'BO');
+INSERT INTO country_info values ('2', 'Ireland', 'IE');
+INSERT INTO country_info values ('3', 'Saint Martin (French part)', 'MF');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "country_info"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "Name"
+        ];
+      rml:predicate ex:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{Country Code}/{Name}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "org.postgresql.Driver";
+  d2rq:password "";
+  d2rq:username "postgres" .
+
+

Output

+
<http://example.com/1/Bolivia%2C%20Plurinational%20State%20of> <http://example.com/name> "Bolivia, Plurinational State of" .
+<http://example.com/2/Ireland> <http://example.com/name> "Ireland" .
+<http://example.com/3/Saint%20Martin%20%28French%20part%29> <http://example.com/name> "Saint Martin (French part)" .
+
+
+
+

219. RMLTC0010b-SQLServer

+

Title: "Template with table columns with special chars"

+

Description: "Tests a template with special chars in column value"

+

Error expected? No

+

Input

+
USE TestDB;
+DROP TABLE IF EXISTS country_info;
+
+CREATE TABLE country_info (
+  "Country Code" INTEGER,
+  "Name" VARCHAR(100),
+  "ISO 3166" VARCHAR(10)
+);
+INSERT INTO country_info values ('1', 'Bolivia, Plurinational State of', 'BO');
+INSERT INTO country_info values ('2', 'Ireland', 'IE');
+INSERT INTO country_info values ('3', 'Saint Martin (French part)', 'MF');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "country_info"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "Name"
+        ];
+      rml:predicate ex:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{Country Code}/{Name}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
+  d2rq:password "YourSTRONG!Passw0rd;";
+  d2rq:username "sa" .
+
+

Output

+
<http://example.com/1/Bolivia%2C%20Plurinational%20State%20of> <http://example.com/name> "Bolivia, Plurinational State of" .
+<http://example.com/2/Ireland> <http://example.com/name> "Ireland" .
+<http://example.com/3/Saint%20Martin%20%28French%20part%29> <http://example.com/name> "Saint Martin (French part)" .
+
+
+
+

220. RMLTC0010b-XML

+

Title: "Template with table columns with special chars"

+

Description: "Tests a template with special chars in column value"

+

Error expected? No

+

Input

+
<?xml version="1.0"?>
+
+<countries>
+  <country>
+    <CountryCode>1</CountryCode>
+    <Name>Bolivia, Plurinational State of</Name>
+    <ISO3166>BO</ISO3166>
+  </country>
+  <country>
+    <CountryCode>2</CountryCode>
+    <Name>Ireland</Name>
+    <ISO3166>IE</ISO3166>
+  </country>
+  <country>
+    <CountryCode>3</CountryCode>
+    <Name>Saint Martin (French part)</Name>
+    <ISO3166>MF</ISO3166>
+  </country>
+</countries>
+
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "/countries/country";
+      rml:referenceFormulation rml:XPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "country_info.xml"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "Name"
+        ];
+      rml:predicate ex:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{CountryCode}/{Name}"
+    ] .
+
+

Output

+
<http://example.com/1/Bolivia%2C%20Plurinational%20State%20of> <http://example.com/name> "Bolivia, Plurinational State of" .
+<http://example.com/2/Ireland> <http://example.com/name> "Ireland" .
+<http://example.com/3/Saint%20Martin%20%28French%20part%29> <http://example.com/name> "Saint Martin (French part)" .
+
+
+
+

221. RMLTC0010c-CSV

+

Title: "Template with table columns with special chars and backslashes"

+

Description: "Tests a template with special chars in reference value and backslash escapes in string templates"

+

Error expected? No

+

Input

+
Country Code,Name,ISO 3166
+1,"Bolivia, Plurinational State of",BO
+2,Ireland,IE
+3,Saint Martin (French part),MF
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:referenceFormulation rml:CSV;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "country_info.csv"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:template "\\{\\{\\{ {ISO 3166} \\}\\}\\}";
+          rml:termType rml:Literal
+        ];
+      rml:predicate ex:code
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{Country Code}/{Name}"
+    ] .
+
+

Output

+
<http://example.com/1/Bolivia%2C%20Plurinational%20State%20of> <http://example.com/code> "{{{ BO }}}" .
+<http://example.com/2/Ireland> <http://example.com/code> "{{{ IE }}}" .
+<http://example.com/3/Saint%20Martin%20%28French%20part%29> <http://example.com/code> "{{{ MF }}}" .
+
+
+
+

222. RMLTC0010c-JSON

+

Title: "Template with table columns with special chars and backslashes"

+

Description: "Tests a template with special chars in reference value and backslash escapes in string templates"

+

Error expected? No

+

Input

+
{
+  "countries": [{
+    "Country Code": 1,
+    "Name":"Bolivia, Plurinational State of",
+    "ISO 3166": "BO"
+  }, {
+    "Country Code": 2,
+    "Name":"Ireland",
+    "ISO 3166": "IE"
+  }, {
+    "Country Code": 3,
+    "Name":"Saint Martin (French part)",
+    "ISO 3166": "MF"
+  }]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.countries[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "country_info.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:predicate ex:code;
+      rml:objectMap [
+          rml:template "\\{\\{\\{ {$.['ISO 3166']} \\}\\}\\}";
+          rml:termType rml:Literal
+        ]
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{$.['Country Code']}/{$.Name}"
+    ] .
+
+

Output

+
<http://example.com/1/Bolivia%2C%20Plurinational%20State%20of> <http://example.com/code> "{{{ BO }}}" .
+<http://example.com/2/Ireland> <http://example.com/code> "{{{ IE }}}" .
+<http://example.com/3/Saint%20Martin%20%28French%20part%29> <http://example.com/code> "{{{ MF }}}" .
+
+
+
+

223. RMLTC0010c-MySQL

+

Title: "Template with table columns with special chars and backslashes"

+

Description: "Tests a template with special chars in column value and backslash escapes in string templates"

+

Error expected? No

+

Input

+
USE test;
+DROP TABLE IF EXISTS test.country_info;
+
+CREATE TABLE country_info (
+  `Country Code` INTEGER,
+  Name VARCHAR(100),
+  `ISO 3166` VARCHAR(10)
+);
+INSERT INTO country_info values ('1', 'Bolivia, Plurinational State of', 'BO');
+INSERT INTO country_info values ('2', 'Ireland', 'IE');
+INSERT INTO country_info values ('3', 'Saint Martin (French part)', 'MF');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "country_info"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:template "\\{\\{\\{ {ISO 3166} \\}\\}\\}";
+          rml:termType rml:Literal
+        ];
+      rml:predicate ex:code
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{Country Code}/{Name}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
+  d2rq:password "";
+  d2rq:username "root" .
+
+

Output

+
<http://example.com/1/Bolivia%2C%20Plurinational%20State%20of> <http://example.com/code> "{{{ BO }}}" .
+<http://example.com/2/Ireland> <http://example.com/code> "{{{ IE }}}" .
+<http://example.com/3/Saint%20Martin%20%28French%20part%29> <http://example.com/code> "{{{ MF }}}" .
+
+
+
+

224. RMLTC0010c-PostgreSQL

+

Title: "Template with table columns with special chars and backslashes"

+

Description: "Tests a template with special chars in column value and backslash escapes in string templates"

+

Error expected? No

+

Input

+
DROP TABLE IF EXISTS country_info;
+
+CREATE TABLE country_info (
+  "Country Code" INTEGER,
+  "Name" VARCHAR(100),
+  "ISO 3166" VARCHAR(10)
+);
+INSERT INTO country_info values ('1', 'Bolivia, Plurinational State of', 'BO');
+INSERT INTO country_info values ('2', 'Ireland', 'IE');
+INSERT INTO country_info values ('3', 'Saint Martin (French part)', 'MF');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "country_info"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:template "\\{\\{\\{ {ISO 3166} \\}\\}\\}";
+          rml:termType rml:Literal
+        ];
+      rml:predicate ex:code
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{Country Code}/{Name}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "org.postgresql.Driver";
+  d2rq:password "";
+  d2rq:username "postgres" .
+
+

Output

+
<http://example.com/1/Bolivia%2C%20Plurinational%20State%20of> <http://example.com/code> "{{{ BO }}}" .
+<http://example.com/2/Ireland> <http://example.com/code> "{{{ IE }}}" .
+<http://example.com/3/Saint%20Martin%20%28French%20part%29> <http://example.com/code> "{{{ MF }}}" .
+
+
+
+

225. RMLTC0010c-SQLServer

+

Title: "Template with table columns with special chars and backslashes"

+

Description: "Tests a template with special chars in column value and backslash escapes in string templates"

+

Error expected? No

+

Input

+
USE TestDB;
+DROP TABLE IF EXISTS country_info;
+
+CREATE TABLE country_info (
+  "Country Code" INTEGER,
+  "Name" VARCHAR(100),
+  "ISO 3166" VARCHAR(10)
+);
+INSERT INTO country_info values ('1', 'Bolivia, Plurinational State of', 'BO');
+INSERT INTO country_info values ('2', 'Ireland', 'IE');
+INSERT INTO country_info values ('3', 'Saint Martin (French part)', 'MF');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "country_info"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:template "\\{\\{\\{ {ISO 3166} \\}\\}\\}";
+          rml:termType rml:Literal
+        ];
+      rml:predicate ex:code
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{Country Code}/{Name}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
+  d2rq:password "YourSTRONG!Passw0rd;";
+  d2rq:username "sa" .
+
+

Output

+
<http://example.com/1/Bolivia%2C%20Plurinational%20State%20of> <http://example.com/code> "{{{ BO }}}" .
+<http://example.com/2/Ireland> <http://example.com/code> "{{{ IE }}}" .
+<http://example.com/3/Saint%20Martin%20%28French%20part%29> <http://example.com/code> "{{{ MF }}}" .
+
+
+
+

226. RMLTC0010c-XML

+

Title: "Template with table columns with special chars and backslashes"

+

Description: "Tests a template with special chars in reference value and backslash escapes in string templates"

+

Error expected? No

+

Input

+
<?xml version="1.0"?>
+
+<countries>
+  <country>
+    <CountryCode>1</CountryCode>
+    <Name>Bolivia, Plurinational State of</Name>
+    <ISO3166>BO</ISO3166>
+  </country>
+  <country>
+    <CountryCode>2</CountryCode>
+    <Name>Ireland</Name>
+    <ISO3166>IE</ISO3166>
+  </country>
+  <country>
+    <CountryCode>3</CountryCode>
+    <Name>Saint Martin (French part)</Name>
+    <ISO3166>MF</ISO3166>
+  </country>
+</countries>
+
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "/countries/country";
+      rml:referenceFormulation rml:XPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "country_info.xml"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:template "\\{\\{\\{ {ISO3166} \\}\\}\\}";
+          rml:termType rml:Literal
+        ];
+      rml:predicate ex:code
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{CountryCode}/{Name}"
+    ] .
+
+

Output

+
<http://example.com/1/Bolivia%2C%20Plurinational%20State%20of> <http://example.com/code> "{{{ BO }}}" .
+<http://example.com/2/Ireland> <http://example.com/code> "{{{ IE }}}" .
+<http://example.com/3/Saint%20Martin%20%28French%20part%29> <http://example.com/code> "{{{ MF }}}" .
+
+
+
+

227. RMLTC0011a-MySQL

+

Title: "M to M relation, by using a SQL query"

+

Description: "Tests, M to M relations, by using a SQL query"

+

Error expected? No

+

Input

+
USE test;
+SET FOREIGN_KEY_CHECKS = 0;
+DROP TABLE IF EXISTS test.Student_Sport;
+DROP TABLE IF EXISTS test.Sport;
+DROP TABLE IF EXISTS test.Student;
+SET FOREIGN_KEY_CHECKS = 1;
+
+CREATE TABLE Student (
+ID integer PRIMARY KEY,
+FirstName varchar(50),
+LastName varchar(50)
+);
+CREATE TABLE Sport (
+ID integer PRIMARY KEY,
+Description varchar(50)
+);
+CREATE TABLE Student_Sport (
+ID_Student integer,
+ID_Sport integer,
+PRIMARY KEY (ID_Student,ID_Sport),
+FOREIGN KEY (ID_Student) REFERENCES Student(ID),
+FOREIGN KEY (ID_Sport) REFERENCES Sport(ID)
+);
+
+INSERT INTO Student (ID,FirstName,LastName) VALUES (10,'Venus', 'Williams');
+INSERT INTO Student (ID,FirstName,LastName) VALUES (11,'Fernando', 'Alonso');
+INSERT INTO Student (ID,FirstName,LastName) VALUES (12,'David', 'Villa');
+
+INSERT INTO Sport (ID, Description) VALUES (110,'Tennis');
+INSERT INTO Sport (ID, Description) VALUES (111,'Football');
+INSERT INTO Sport (ID, Description) VALUES (112,'Formula1');
+
+INSERT INTO Student_Sport (ID_Student, ID_Sport) VALUES (10,110);
+INSERT INTO Student_Sport (ID_Student, ID_Sport) VALUES (11,111);
+INSERT INTO Student_Sport (ID_Student, ID_Sport) VALUES (11,112);
+INSERT INTO Student_Sport (ID_Student, ID_Sport) VALUES (12,111);
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator """
+       SELECT Student.ID as ID,
+              Student.FirstName as FirstName,
+              Student.LastName as LastName,
+              Sport.Description as Description,
+              Sport.ID as Sport_ID
+       FROM Student,Sport,Student_Sport
+       WHERE Student.ID = Student_Sport.ID_Student
+       AND Sport.ID = Student_Sport.ID_Sport;
+       """;
+      rml:referenceFormulation rml:SQL2008Query;
+      rml:source <http://example.com/base/#DB_source>
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "ID"
+        ];
+      rml:predicate ex:id
+    ], [
+      rml:objectMap [
+          rml:reference "FirstName"
+        ];
+      rml:predicate ex:firstName
+    ], [
+      rml:objectMap [
+          rml:reference "LastName"
+        ];
+      rml:predicate ex:lastName
+    ], [
+      rml:objectMap [
+          rml:template "http://example.com/{Sport_ID}/{Description}"
+        ];
+      rml:predicate ex:plays
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{ID}/{FirstName};{LastName}"
+    ] .
+
+<http://example.com/base/TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator """
+       SELECT * FROM Sport;
+       """;
+      rml:referenceFormulation rml:SQL2008Query;
+      rml:source <http://example.com/base/#DB_source>
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "ID"
+        ];
+      rml:predicate ex:id
+    ], [
+      rml:objectMap [
+          rml:reference "Description"
+        ];
+      rml:predicate ex:description
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{ID}/{Description}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
+  d2rq:password "";
+  d2rq:username "root" .
+
+

Output

+
<http://example.com/110/Tennis> <http://example.com/description> "Tennis" .
+<http://example.com/110/Tennis> <http://example.com/id> "110"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.com/10/Venus;Williams> <http://example.com/plays> <http://example.com/110/Tennis> .
+<http://example.com/10/Venus;Williams> <http://example.com/lastName> "Williams" .
+<http://example.com/10/Venus;Williams> <http://example.com/firstName> "Venus" .
+<http://example.com/10/Venus;Williams> <http://example.com/id> "10"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.com/111/Football> <http://example.com/description> "Football" .
+<http://example.com/111/Football> <http://example.com/id> "111"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.com/12/David;Villa> <http://example.com/plays> <http://example.com/111/Football> .
+<http://example.com/12/David;Villa> <http://example.com/lastName> "Villa" .
+<http://example.com/12/David;Villa> <http://example.com/firstName> "David" .
+<http://example.com/12/David;Villa> <http://example.com/id> "12"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.com/112/Formula1> <http://example.com/description> "Formula1" .
+<http://example.com/112/Formula1> <http://example.com/id> "112"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.com/11/Fernando;Alonso> <http://example.com/lastName> "Alonso" .
+<http://example.com/11/Fernando;Alonso> <http://example.com/firstName> "Fernando" .
+<http://example.com/11/Fernando;Alonso> <http://example.com/id> "11"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.com/11/Fernando;Alonso> <http://example.com/plays> <http://example.com/111/Football> .
+<http://example.com/11/Fernando;Alonso> <http://example.com/plays> <http://example.com/112/Formula1> .
+
+
+
+

228. RMLTC0011a-PostgreSQL

+

Title: "M to M relation, by using a SQL query"

+

Description: "Tests, M to M relations, by using a SQL query"

+

Error expected? No

+

Input

+
DROP TABLE IF EXISTS Student_Sport;
+DROP TABLE IF EXISTS Sport CASCADE;
+DROP TABLE IF EXISTS Student;
+
+CREATE TABLE Student (
+ID integer PRIMARY KEY,
+FirstName varchar(50),
+LastName varchar(50)
+);
+CREATE TABLE Sport (
+ID integer PRIMARY KEY,
+Description varchar(50)
+);
+CREATE TABLE Student_Sport (
+ID_Student integer,
+ID_Sport integer,
+PRIMARY KEY (ID_Student,ID_Sport),
+FOREIGN KEY (ID_Student) REFERENCES Student(ID),
+FOREIGN KEY (ID_Sport) REFERENCES Sport(ID)
+);
+
+INSERT INTO Student (ID,FirstName,LastName) VALUES (10,'Venus', 'Williams');
+INSERT INTO Student (ID,FirstName,LastName) VALUES (11,'Fernando', 'Alonso');
+INSERT INTO Student (ID,FirstName,LastName) VALUES (12,'David', 'Villa');
+
+INSERT INTO Sport (ID, Description) VALUES (110,'Tennis');
+INSERT INTO Sport (ID, Description) VALUES (111,'Football');
+INSERT INTO Sport (ID, Description) VALUES (112,'Formula1');
+
+INSERT INTO Student_Sport (ID_Student, ID_Sport) VALUES (10,110);
+INSERT INTO Student_Sport (ID_Student, ID_Sport) VALUES (11,111);
+INSERT INTO Student_Sport (ID_Student, ID_Sport) VALUES (11,112);
+INSERT INTO Student_Sport (ID_Student, ID_Sport) VALUES (12,111);
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator """
+       SELECT Student.ID as ID,
+              Student.FirstName as FirstName,
+              Student.LastName as LastName,
+              Sport.Description as Description,
+              Sport.ID as Sport_ID
+       FROM Student,Sport,Student_Sport
+       WHERE Student.ID = Student_Sport.ID_Student
+       AND Sport.ID = Student_Sport.ID_Sport;
+       """;
+      rml:referenceFormulation rml:SQL2008Query;
+      rml:source <http://example.com/base/#DB_source>
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "id"
+        ];
+      rml:predicate ex:id
+    ], [
+      rml:objectMap [
+          rml:reference "firstname"
+        ];
+      rml:predicate ex:firstName
+    ], [
+      rml:objectMap [
+          rml:reference "lastname"
+        ];
+      rml:predicate ex:lastName
+    ], [
+      rml:objectMap [
+          rml:template "http://example.com/{sport_id}/{description}"
+        ];
+      rml:predicate ex:plays
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{id}/{firstname};{lastname}"
+    ] .
+
+<http://example.com/base/TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator """
+       SELECT * FROM Sport ;
+       """;
+      rml:referenceFormulation rml:SQL2008Query;
+      rml:source <http://example.com/base/#DB_source>
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "id"
+        ];
+      rml:predicate ex:id
+    ], [
+      rml:objectMap [
+          rml:reference "description"
+        ];
+      rml:predicate ex:description
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{id}/{description}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "org.postgresql.Driver";
+  d2rq:password "";
+  d2rq:username "postgres" .
+
+

Output

+
<http://example.com/110/Tennis> <http://example.com/description> "Tennis" .
+<http://example.com/110/Tennis> <http://example.com/id> "110"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.com/10/Venus;Williams> <http://example.com/plays> <http://example.com/110/Tennis> .
+<http://example.com/10/Venus;Williams> <http://example.com/lastName> "Williams" .
+<http://example.com/10/Venus;Williams> <http://example.com/firstName> "Venus" .
+<http://example.com/10/Venus;Williams> <http://example.com/id> "10"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.com/111/Football> <http://example.com/description> "Football" .
+<http://example.com/111/Football> <http://example.com/id> "111"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.com/12/David;Villa> <http://example.com/plays> <http://example.com/111/Football> .
+<http://example.com/12/David;Villa> <http://example.com/lastName> "Villa" .
+<http://example.com/12/David;Villa> <http://example.com/firstName> "David" .
+<http://example.com/12/David;Villa> <http://example.com/id> "12"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.com/112/Formula1> <http://example.com/description> "Formula1" .
+<http://example.com/112/Formula1> <http://example.com/id> "112"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.com/11/Fernando;Alonso> <http://example.com/lastName> "Alonso" .
+<http://example.com/11/Fernando;Alonso> <http://example.com/firstName> "Fernando" .
+<http://example.com/11/Fernando;Alonso> <http://example.com/id> "11"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.com/11/Fernando;Alonso> <http://example.com/plays> <http://example.com/111/Football> .
+<http://example.com/11/Fernando;Alonso> <http://example.com/plays> <http://example.com/112/Formula1> .
+
+
+
+

229. RMLTC0011a-SQLServer

+

Title: "M to M relation, by using a SQL query"

+

Description: "Tests, M to M relations, by using a SQL query"

+

Error expected? No

+

Input

+
USE TestDB;
+EXEC sp_msforeachtable 'ALTER TABLE ? NOCHECK CONSTRAINT all'
+EXEC sp_msforeachtable 'DROP TABLE ?'
+
+CREATE TABLE Student (
+ID integer PRIMARY KEY,
+FirstName varchar(50),
+LastName varchar(50)
+);
+CREATE TABLE Sport (
+ID integer PRIMARY KEY,
+Description varchar(50)
+);
+CREATE TABLE Student_Sport (
+ID_Student integer,
+ID_Sport integer,
+PRIMARY KEY (ID_Student,ID_Sport),
+FOREIGN KEY (ID_Student) REFERENCES Student(ID),
+FOREIGN KEY (ID_Sport) REFERENCES Sport(ID)
+);
+
+INSERT INTO Student (ID,FirstName,LastName) VALUES (10,'Venus', 'Williams');
+INSERT INTO Student (ID,FirstName,LastName) VALUES (11,'Fernando', 'Alonso');
+INSERT INTO Student (ID,FirstName,LastName) VALUES (12,'David', 'Villa');
+
+INSERT INTO Sport (ID, Description) VALUES (110,'Tennis');
+INSERT INTO Sport (ID, Description) VALUES (111,'Football');
+INSERT INTO Sport (ID, Description) VALUES (112,'Formula1');
+
+INSERT INTO Student_Sport (ID_Student, ID_Sport) VALUES (10,110);
+INSERT INTO Student_Sport (ID_Student, ID_Sport) VALUES (11,111);
+INSERT INTO Student_Sport (ID_Student, ID_Sport) VALUES (11,112);
+INSERT INTO Student_Sport (ID_Student, ID_Sport) VALUES (12,111);
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator """
+       SELECT Student.ID as ID,
+              Student.FirstName as FirstName,
+              Student.LastName as LastName,
+              Sport.Description as Description,
+              Sport.ID as Sport_ID
+       FROM Student,Sport,Student_Sport
+       WHERE Student.ID = Student_Sport.ID_Student
+       AND Sport.ID = Student_Sport.ID_Sport;
+       """;
+      rml:referenceFormulation rml:SQL2008Query;
+      rml:source <http://example.com/base/#DB_source>
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "ID"
+        ];
+      rml:predicate ex:id
+    ], [
+      rml:objectMap [
+          rml:reference "FirstName"
+        ];
+      rml:predicate ex:firstName
+    ], [
+      rml:objectMap [
+          rml:reference "LastName"
+        ];
+      rml:predicate ex:lastName
+    ], [
+      rml:objectMap [
+          rml:template "http://example.com/{Sport_ID}/{Description}"
+        ];
+      rml:predicate ex:plays
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{ID}/{FirstName};{LastName}"
+    ] .
+
+<http://example.com/base/TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator """
+       SELECT * FROM Sport ;
+       """;
+      rml:referenceFormulation rml:SQL2008Query;
+      rml:source <http://example.com/base/#DB_source>
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "ID"
+        ];
+      rml:predicate ex:id
+    ], [
+      rml:objectMap [
+          rml:reference "Description"
+        ];
+      rml:predicate ex:description
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{ID}/{Description}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
+  d2rq:password "YourSTRONG!Passw0rd;";
+  d2rq:username "sa" .
+
+

Output

+
<http://example.com/110/Tennis> <http://example.com/description> "Tennis" .
+<http://example.com/110/Tennis> <http://example.com/id> "110"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.com/10/Venus;Williams> <http://example.com/plays> <http://example.com/110/Tennis> .
+<http://example.com/10/Venus;Williams> <http://example.com/lastName> "Williams" .
+<http://example.com/10/Venus;Williams> <http://example.com/firstName> "Venus" .
+<http://example.com/10/Venus;Williams> <http://example.com/id> "10"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.com/111/Football> <http://example.com/description> "Football" .
+<http://example.com/111/Football> <http://example.com/id> "111"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.com/12/David;Villa> <http://example.com/plays> <http://example.com/111/Football> .
+<http://example.com/12/David;Villa> <http://example.com/lastName> "Villa" .
+<http://example.com/12/David;Villa> <http://example.com/firstName> "David" .
+<http://example.com/12/David;Villa> <http://example.com/id> "12"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.com/112/Formula1> <http://example.com/description> "Formula1" .
+<http://example.com/112/Formula1> <http://example.com/id> "112"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.com/11/Fernando;Alonso> <http://example.com/lastName> "Alonso" .
+<http://example.com/11/Fernando;Alonso> <http://example.com/firstName> "Fernando" .
+<http://example.com/11/Fernando;Alonso> <http://example.com/id> "11"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.com/11/Fernando;Alonso> <http://example.com/plays> <http://example.com/111/Football> .
+<http://example.com/11/Fernando;Alonso> <http://example.com/plays> <http://example.com/112/Formula1> .
+
+
+
+

230. RMLTC0011b-CSV

+

Title: "M to M relation, by using an additional Triples Map"

+

Description: "Tests, M to M relations, by using an additional Triples Map"

+

Error expected? No

+

Input

+
ID,FirstName,LastName
+10,Venus,Williams
+11,Fernando,Alonso
+12,David,Villa
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/LinkMap_1_2> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:referenceFormulation rml:CSV;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student_sport.csv"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:template "http://example.com/sport/{ID_Sport}"
+        ];
+      rml:predicate ex:plays
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/student/{ID_Student}"
+    ] .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:referenceFormulation rml:CSV;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.csv"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "FirstName"
+        ];
+      rml:predicate ex:firstName
+    ], [
+      rml:objectMap [
+          rml:reference "LastName"
+        ];
+      rml:predicate ex:lastName
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/student/{ID}"
+    ] .
+
+<http://example.com/base/TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:referenceFormulation rml:CSV;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "sport.csv"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "Description"
+        ];
+      rml:predicate ex:description
+    ], [
+      rml:objectMap [
+          rml:reference "ID"
+        ];
+      rml:predicate ex:id
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/sport/{ID}"
+    ] .
+
+

Output

+
<http://example.com/student/10> <http://example.com/lastName> "Williams" .
+<http://example.com/student/10> <http://example.com/firstName> "Venus" .
+<http://example.com/student/12> <http://example.com/lastName> "Villa" .
+<http://example.com/student/12> <http://example.com/firstName> "David" .
+<http://example.com/student/11> <http://example.com/lastName> "Alonso" .
+<http://example.com/student/11> <http://example.com/firstName> "Fernando" .
+<http://example.com/sport/110> <http://example.com/description> "Tennis" .
+<http://example.com/sport/110> <http://example.com/id> "110" .
+<http://example.com/sport/111> <http://example.com/description> "Football" .
+<http://example.com/sport/111> <http://example.com/id> "111" .
+<http://example.com/sport/112> <http://example.com/description> "Formula1" .
+<http://example.com/sport/112> <http://example.com/id> "112" .
+<http://example.com/student/10> <http://example.com/plays> <http://example.com/sport/110> .
+<http://example.com/student/12> <http://example.com/plays> <http://example.com/sport/111> .
+<http://example.com/student/11> <http://example.com/plays> <http://example.com/sport/112> .
+<http://example.com/student/11> <http://example.com/plays> <http://example.com/sport/111> .
+
+
+
+

231. RMLTC0011b-JSON

+

Title: "M to M relation, by using an additional Triples Map"

+

Description: "Tests, M to M relations, by using an additional Triples Map"

+

Error expected? No

+

Input

+
{
+  "students": [
+    {"ID":10, "FirstName":"Venus", "LastName":"Williams"},
+    {"ID":11, "FirstName":"Fernando", "LastName":"Alonso"},
+    {"ID":12, "FirstName":"David", "LastName":"Villa"}
+  ]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/LinkMap_1_2> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.links[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student_sport.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:template "http://example.com/sport/{$.ID_Sport}"
+        ];
+      rml:predicate ex:plays
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/student/{$.ID_Student}"
+    ] .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.FirstName"
+        ];
+      rml:predicate ex:firstName
+    ], [
+      rml:objectMap [
+          rml:reference "$.LastName"
+        ];
+      rml:predicate ex:lastName
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/student/{$.ID}"
+    ] .
+
+<http://example.com/base/TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.sports[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "sport.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.Description"
+        ];
+      rml:predicate ex:description
+    ], [
+      rml:objectMap [
+          rml:reference "$.ID"
+        ];
+      rml:predicate ex:id
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/sport/{$.ID}"
+    ] .
+
+

Output

+
<http://example.com/student/10> <http://example.com/lastName> "Williams" .
+<http://example.com/student/10> <http://example.com/firstName> "Venus" .
+<http://example.com/student/12> <http://example.com/lastName> "Villa" .
+<http://example.com/student/12> <http://example.com/firstName> "David" .
+<http://example.com/student/11> <http://example.com/lastName> "Alonso" .
+<http://example.com/student/11> <http://example.com/firstName> "Fernando" .
+<http://example.com/sport/110> <http://example.com/description> "Tennis" .
+<http://example.com/sport/110> <http://example.com/id> "110" .
+<http://example.com/sport/111> <http://example.com/description> "Football" .
+<http://example.com/sport/111> <http://example.com/id> "111" .
+<http://example.com/sport/112> <http://example.com/description> "Formula1" .
+<http://example.com/sport/112> <http://example.com/id> "112" .
+<http://example.com/student/10> <http://example.com/plays> <http://example.com/sport/110> .
+<http://example.com/student/12> <http://example.com/plays> <http://example.com/sport/111> .
+<http://example.com/student/11> <http://example.com/plays> <http://example.com/sport/112> .
+<http://example.com/student/11> <http://example.com/plays> <http://example.com/sport/111> .
+
+
+
+

232. RMLTC0011b-MySQL

+

Title: "M to M relation, by using an additional Triples Map"

+

Description: "Tests, M to M relations, by using an additional Triples Map"

+

Error expected? No

+

Input

+
USE test;
+SET FOREIGN_KEY_CHECKS = 0;
+DROP TABLE IF EXISTS test.student_sport;
+DROP TABLE IF EXISTS test.student;
+DROP TABLE IF EXISTS test.sport;
+SET FOREIGN_KEY_CHECKS = 1;
+
+CREATE TABLE sport (
+  ID INTEGER,
+  Description VARCHAR(200)
+);
+INSERT INTO sport values ('110','Tennis');
+INSERT INTO sport values ('111','Football');
+INSERT INTO sport values ('112','Formula1');
+
+
+CREATE TABLE student (
+  ID INTEGER,
+  FirstName VARCHAR(200),
+  LastName VARCHAR(200)
+);
+INSERT INTO student values ('10','Venus','Williams');
+INSERT INTO student values ('11','Fernando','Alonso');
+INSERT INTO student values ('12','David','Villa');
+
+
+CREATE TABLE student_sport (
+  ID_Student INTEGER,
+  ID_Sport INTEGER
+);
+INSERT INTO student_sport values ('10', '110');
+INSERT INTO student_sport values ('11','111');
+INSERT INTO student_sport values ('11','112');
+INSERT INTO student_sport values ('12','111');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/LinkMap_1_2> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "student_sport"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:template "http://example.com/sport/{ID_Sport}"
+        ];
+      rml:predicate ex:plays
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/student/{ID_Student}"
+    ] .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "student"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "FirstName"
+        ];
+      rml:predicate ex:firstName
+    ], [
+      rml:objectMap [
+          rml:reference "LastName"
+        ];
+      rml:predicate ex:lastName
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/student/{ID}"
+    ] .
+
+<http://example.com/base/TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "sport"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "Description"
+        ];
+      rml:predicate ex:description
+    ], [
+      rml:objectMap [
+          rml:reference "ID"
+        ];
+      rml:predicate ex:id
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/sport/{ID}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
+  d2rq:password "";
+  d2rq:username "root" .
+
+

Output

+
<http://example.com/student/10> <http://example.com/lastName> "Williams" .
+<http://example.com/student/10> <http://example.com/firstName> "Venus" .
+<http://example.com/student/12> <http://example.com/lastName> "Villa" .
+<http://example.com/student/12> <http://example.com/firstName> "David" .
+<http://example.com/student/11> <http://example.com/lastName> "Alonso" .
+<http://example.com/student/11> <http://example.com/firstName> "Fernando" .
+<http://example.com/sport/110> <http://example.com/description> "Tennis" .
+<http://example.com/sport/110> <http://example.com/id> "110"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.com/sport/111> <http://example.com/description> "Football" .
+<http://example.com/sport/111> <http://example.com/id> "111"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.com/sport/112> <http://example.com/description> "Formula1" .
+<http://example.com/sport/112> <http://example.com/id> "112"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.com/student/10> <http://example.com/plays> <http://example.com/sport/110> .
+<http://example.com/student/12> <http://example.com/plays> <http://example.com/sport/111> .
+<http://example.com/student/11> <http://example.com/plays> <http://example.com/sport/112> .
+<http://example.com/student/11> <http://example.com/plays> <http://example.com/sport/111> .
+
+
+
+

233. RMLTC0011b-PostgreSQL

+

Title: "M to M relation, by using an additional Triples Map"

+

Description: "Tests, M to M relations, by using an additional Triples Map"

+

Error expected? No

+

Input

+
DROP TABLE IF EXISTS student_sport;
+DROP TABLE IF EXISTS student;
+DROP TABLE IF EXISTS sport;
+
+CREATE TABLE sport (
+  ID INTEGER,
+  Description VARCHAR(200)
+);
+INSERT INTO sport values ('110','Tennis');
+INSERT INTO sport values ('111','Football');
+INSERT INTO sport values ('112','Formula1');
+
+
+CREATE TABLE student (
+  ID INTEGER,
+  FirstName VARCHAR(200),
+  LastName VARCHAR(200)
+);
+INSERT INTO student values ('10','Venus','Williams');
+INSERT INTO student values ('11','Fernando','Alonso');
+INSERT INTO student values ('12','David','Villa');
+
+
+CREATE TABLE student_sport (
+  ID_Student INTEGER,
+  ID_Sport INTEGER
+);
+INSERT INTO student_sport values ('10', '110');
+INSERT INTO student_sport values ('11','111');
+INSERT INTO student_sport values ('11','112');
+INSERT INTO student_sport values ('12','111');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/LinkMap_1_2> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "student_sport"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:template "http://example.com/sport/{id_sport}"
+        ];
+      rml:predicate ex:plays
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/student/{id_student}"
+    ] .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "student"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "firstname"
+        ];
+      rml:predicate ex:firstName
+    ], [
+      rml:objectMap [
+          rml:reference "lastname"
+        ];
+      rml:predicate ex:lastName
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/student/{id}"
+    ] .
+
+<http://example.com/base/TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "sport"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "description"
+        ];
+      rml:predicate ex:description
+    ], [
+      rml:objectMap [
+          rml:reference "id"
+        ];
+      rml:predicate ex:id
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/sport/{id}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "org.postgresql.Driver";
+  d2rq:password "";
+  d2rq:username "postgres" .
+
+

Output

+
<http://example.com/student/10> <http://example.com/lastName> "Williams" .
+<http://example.com/student/10> <http://example.com/firstName> "Venus" .
+<http://example.com/student/12> <http://example.com/lastName> "Villa" .
+<http://example.com/student/12> <http://example.com/firstName> "David" .
+<http://example.com/student/11> <http://example.com/lastName> "Alonso" .
+<http://example.com/student/11> <http://example.com/firstName> "Fernando" .
+<http://example.com/sport/110> <http://example.com/description> "Tennis" .
+<http://example.com/sport/110> <http://example.com/id> "110"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.com/sport/111> <http://example.com/description> "Football" .
+<http://example.com/sport/111> <http://example.com/id> "111"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.com/sport/112> <http://example.com/description> "Formula1" .
+<http://example.com/sport/112> <http://example.com/id> "112"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.com/student/10> <http://example.com/plays> <http://example.com/sport/110> .
+<http://example.com/student/12> <http://example.com/plays> <http://example.com/sport/111> .
+<http://example.com/student/11> <http://example.com/plays> <http://example.com/sport/112> .
+<http://example.com/student/11> <http://example.com/plays> <http://example.com/sport/111> .
+
+
+
+

234. RMLTC0011b-SQLServer

+

Title: "M to M relation, by using an additional Triples Map"

+

Description: "Tests, M to M relations, by using an additional Triples Map"

+

Error expected? No

+

Input

+
USE TestDB;
+DROP TABLE IF EXISTS student_sport;
+DROP TABLE IF EXISTS student;
+DROP TABLE IF EXISTS sport;
+
+CREATE TABLE sport (
+  ID INTEGER,
+  Description VARCHAR(200)
+);
+INSERT INTO sport values ('110','Tennis');
+INSERT INTO sport values ('111','Football');
+INSERT INTO sport values ('112','Formula1');
+
+
+CREATE TABLE student (
+  ID INTEGER,
+  FirstName VARCHAR(200),
+  LastName VARCHAR(200)
+);
+INSERT INTO student values ('10','Venus','Williams');
+INSERT INTO student values ('11','Fernando','Alonso');
+INSERT INTO student values ('12','David','Villa');
+
+
+CREATE TABLE student_sport (
+  ID_Student INTEGER,
+  ID_Sport INTEGER
+);
+INSERT INTO student_sport values ('10', '110');
+INSERT INTO student_sport values ('11','111');
+INSERT INTO student_sport values ('11','112');
+INSERT INTO student_sport values ('12','111');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/LinkMap_1_2> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "student_sport"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:template "http://example.com/sport/{ID_Sport}"
+        ];
+      rml:predicate ex:plays
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/student/{ID_Student}"
+    ] .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "student"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "FirstName"
+        ];
+      rml:predicate ex:firstName
+    ], [
+      rml:objectMap [
+          rml:reference "LastName"
+        ];
+      rml:predicate ex:lastName
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/student/{ID}"
+    ] .
+
+<http://example.com/base/TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "sport"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "Description"
+        ];
+      rml:predicate ex:description
+    ], [
+      rml:objectMap [
+          rml:reference "ID"
+        ];
+      rml:predicate ex:id
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/sport/{ID}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
+  d2rq:password "YourSTRONG!Passw0rd;";
+  d2rq:username "sa" .
+
+

Output

+
<http://example.com/student/10> <http://example.com/lastName> "Williams" .
+<http://example.com/student/10> <http://example.com/firstName> "Venus" .
+<http://example.com/student/12> <http://example.com/lastName> "Villa" .
+<http://example.com/student/12> <http://example.com/firstName> "David" .
+<http://example.com/student/11> <http://example.com/lastName> "Alonso" .
+<http://example.com/student/11> <http://example.com/firstName> "Fernando" .
+<http://example.com/sport/110> <http://example.com/description> "Tennis" .
+<http://example.com/sport/110> <http://example.com/id> "110"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.com/sport/111> <http://example.com/description> "Football" .
+<http://example.com/sport/111> <http://example.com/id> "111"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.com/sport/112> <http://example.com/description> "Formula1" .
+<http://example.com/sport/112> <http://example.com/id> "112"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.com/student/10> <http://example.com/plays> <http://example.com/sport/110> .
+<http://example.com/student/12> <http://example.com/plays> <http://example.com/sport/111> .
+<http://example.com/student/11> <http://example.com/plays> <http://example.com/sport/112> .
+<http://example.com/student/11> <http://example.com/plays> <http://example.com/sport/111> .
+
+
+
+

235. RMLTC0011b-XML

+

Title: "M to M relation, by using an additional Triples Map"

+

Description: "Tests, M to M relations, by using an additional Triples Map"

+

Error expected? No

+

Input

+
<?xml version="1.0"?>
+
+<Students>
+  <Student>
+    <ID>10</ID>
+    <FirstName>Venus</FirstName>
+    <LastName>Williams</LastName>
+  </Student>
+  <Student>
+    <ID>11</ID>
+    <FirstName>Fernando</FirstName>
+    <LastName>Alonso</LastName>
+  </Student>
+  <Student>
+    <ID>12</ID>
+    <FirstName>David</FirstName>
+    <LastName>Villa</LastName>
+  </Student>
+</Students>
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/LinkMap_1_2> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "/links/link";
+      rml:referenceFormulation rml:XPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student_sport.xml"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:template "http://example.com/sport/{ID_Sport}"
+        ];
+      rml:predicate ex:plays
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/student/{ID_Student}"
+    ] .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "/Students/Student";
+      rml:referenceFormulation rml:XPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.xml"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "FirstName"
+        ];
+      rml:predicate ex:firstName
+    ], [
+      rml:objectMap [
+          rml:reference "LastName"
+        ];
+      rml:predicate ex:lastName
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/student/{ID}"
+    ] .
+
+<http://example.com/base/TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "/Sports/Sport";
+      rml:referenceFormulation rml:XPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "sport.xml"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "Description"
+        ];
+      rml:predicate ex:description
+    ], [
+      rml:objectMap [
+          rml:reference "ID"
+        ];
+      rml:predicate ex:id
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/sport/{ID}"
+    ] .
+
+

Output

+
<http://example.com/student/10> <http://example.com/lastName> "Williams" .
+<http://example.com/student/10> <http://example.com/firstName> "Venus" .
+<http://example.com/student/12> <http://example.com/lastName> "Villa" .
+<http://example.com/student/12> <http://example.com/firstName> "David" .
+<http://example.com/student/11> <http://example.com/lastName> "Alonso" .
+<http://example.com/student/11> <http://example.com/firstName> "Fernando" .
+<http://example.com/sport/110> <http://example.com/description> "Tennis" .
+<http://example.com/sport/110> <http://example.com/id> "110" .
+<http://example.com/sport/111> <http://example.com/description> "Football" .
+<http://example.com/sport/111> <http://example.com/id> "111" .
+<http://example.com/sport/112> <http://example.com/description> "Formula1" .
+<http://example.com/sport/112> <http://example.com/id> "112" .
+<http://example.com/student/10> <http://example.com/plays> <http://example.com/sport/110> .
+<http://example.com/student/12> <http://example.com/plays> <http://example.com/sport/111> .
+<http://example.com/student/11> <http://example.com/plays> <http://example.com/sport/112> .
+<http://example.com/student/11> <http://example.com/plays> <http://example.com/sport/111> .
+
+
+
+

236. RMLTC0012a-CSV

+

Title: "Duplicate tuples generate same blank node"

+

Description: "Tests that blank nodes with same identifier and in the same graph but generated by different logical rows are considered equivalent."

+

Error expected? No

+

Input

+
fname,lname,amount
+Bob,Smith,30
+Sue,Jones,20
+Bob,Smith,30
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:referenceFormulation rml:CSV;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "persons.csv"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:template "{fname} {lname}";
+          rml:termType rml:Literal
+        ];
+      rml:predicate foaf:name
+    ], [
+      rml:objectMap [
+          rml:reference "amount"
+        ];
+      rml:predicate ex:amount
+    ];
+  rml:subjectMap [
+      rml:template "{fname}{lname}{amount}";
+      rml:termType rml:BlankNode
+    ] .
+
+

Output

+
_:BobSmith30 <http://example.com/amount> "30" .
+_:BobSmith30 <http://xmlns.com/foaf/0.1/name> "Bob Smith" .
+_:SueJones20 <http://example.com/amount> "20" .
+_:SueJones20 <http://xmlns.com/foaf/0.1/name> "Sue Jones" .
+
+
+
+

237. RMLTC0012a-JSON

+

Title: "Duplicate tuples generate same blank node"

+

Description: "Tests that blank nodes with same identifier and in the same graph but generated by different logical rows are considered equivalent."

+

Error expected? No

+

Input

+
{
+  "persons": [
+    {"fname":"Bob","lname":"Smith","amount":30},
+    {"fname":"Sue","lname":"Jones","amount":20},
+    {"fname":"Bob","lname":"Smith","amount":30}
+  ]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.persons[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "persons.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:template "{$.fname} {$.lname}";
+          rml:termType rml:Literal
+        ];
+      rml:predicate foaf:name
+    ], [
+      rml:objectMap [
+          rml:reference "$.amount"
+        ];
+      rml:predicate ex:amount
+    ];
+  rml:subjectMap [
+      rml:template "{$.fname}{$.lname}{$.amount}";
+      rml:termType rml:BlankNode
+    ] .
+
+

Output

+
_:BobSmith30 <http://example.com/amount> "30" .
+_:BobSmith30 <http://xmlns.com/foaf/0.1/name> "Bob Smith" .
+_:SueJones20 <http://example.com/amount> "20" .
+_:SueJones20 <http://xmlns.com/foaf/0.1/name> "Sue Jones" .
+
+
+
+

238. RMLTC0012a-MySQL

+

Title: "Duplicate tuples generate same blank node"

+

Description: "Tests that blank nodes with same identifier and in the same graph but generated by different logical rows are considered equivalent."

+

Error expected? No

+

Input

+
USE test;
+DROP TABLE IF EXISTS test.IOUs;
+DROP TABLE IF EXISTS test.Lives;
+
+CREATE TABLE IOUs (
+      fname VARCHAR(20),
+      lname VARCHAR(20),
+      amount INT);
+/* We replaced DOUBLE with INT, because the datatype conversion is different across databases, and this test case is not relevant to that aspect */
+INSERT INTO IOUs (fname, lname, amount) VALUES ('Bob', 'Smith', 30);
+INSERT INTO IOUs (fname, lname, amount) VALUES ('Sue', 'Jones', 20);
+INSERT INTO IOUs (fname, lname, amount) VALUES ('Bob', 'Smith', 30);
+CREATE TABLE Lives (
+      fname VARCHAR(20),
+      lname VARCHAR(20),
+      city VARCHAR(20));
+INSERT INTO Lives (fname, lname, city) VALUES ('Bob', 'Smith', 'London');
+INSERT INTO Lives (fname, lname, city) VALUES ('Sue', 'Jones', 'Madrid');
+INSERT INTO Lives (fname, lname, city) VALUES ('Bob', 'Smith', 'London');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "IOUs"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:template "{fname} {lname}";
+          rml:termType rml:Literal
+        ];
+      rml:predicate foaf:name
+    ], [
+      rml:objectMap [
+          rml:reference "amount"
+        ];
+      rml:predicate ex:amount
+    ];
+  rml:subjectMap [
+      rml:template "{fname}_{lname}_{amount}";
+      rml:termType rml:BlankNode
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
+  d2rq:password "";
+  d2rq:username "root" .
+
+

Output

+
_:Bob_Smith_30 <http://example.com/amount> "30"^^<http://www.w3.org/2001/XMLSchema#integer> .
+_:Bob_Smith_30 <http://xmlns.com/foaf/0.1/name> "Bob Smith" .
+_:Sue_Jones_20 <http://example.com/amount> "20"^^<http://www.w3.org/2001/XMLSchema#integer> .
+_:Sue_Jones_20 <http://xmlns.com/foaf/0.1/name> "Sue Jones" .
+
+
+
+

239. RMLTC0012a-PostgreSQL

+

Title: "Duplicate tuples generate same blank node"

+

Description: "Tests that blank nodes with same identifier and in the same graph but generated by different logical rows are considered equivalent."

+

Error expected? No

+

Input

+
DROP TABLE IF EXISTS IOUs;
+DROP TABLE IF EXISTS Lives;
+
+CREATE TABLE IOUs (
+      fname VARCHAR(20),
+      lname VARCHAR(20),
+      amount INT);
+INSERT INTO IOUs (fname, lname, amount) VALUES ('Bob', 'Smith', 30);
+INSERT INTO IOUs (fname, lname, amount) VALUES ('Sue', 'Jones', 20);
+INSERT INTO IOUs (fname, lname, amount) VALUES ('Bob', 'Smith', 30);
+CREATE TABLE Lives (
+      fname VARCHAR(20),
+      lname VARCHAR(20),
+      city VARCHAR(20));
+INSERT INTO Lives (fname, lname, city) VALUES ('Bob', 'Smith', 'London');
+INSERT INTO Lives (fname, lname, city) VALUES ('Sue', 'Jones', 'Madrid');
+INSERT INTO Lives (fname, lname, city) VALUES ('Bob', 'Smith', 'London');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "IOUs"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:template "{fname} {lname}";
+          rml:termType rml:Literal
+        ];
+      rml:predicate foaf:name
+    ], [
+      rml:objectMap [
+          rml:reference "amount"
+        ];
+      rml:predicate ex:amount
+    ];
+  rml:subjectMap [
+      rml:template "{fname}_{lname}_{amount}";
+      rml:termType rml:BlankNode
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "org.postgresql.Driver";
+  d2rq:password "";
+  d2rq:username "postgres" .
+
+

Output

+
_:Bob_Smith_30 <http://example.com/amount> "30"^^<http://www.w3.org/2001/XMLSchema#integer> .
+_:Bob_Smith_30 <http://xmlns.com/foaf/0.1/name> "Bob Smith" .
+_:Sue_Jones_20 <http://example.com/amount> "20"^^<http://www.w3.org/2001/XMLSchema#integer> .
+_:Sue_Jones_20 <http://xmlns.com/foaf/0.1/name> "Sue Jones" .
+
+
+
+

240. RMLTC0012a-SPARQL

+

Title: "Duplicate triples generate same blank node"

+

Description: "Tests that blank nodes with same identifier and in the same graph but generated by different logical rows are considered equivalent."

+

Error expected? No

+

Input

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix ns1: <http://example.com/> .
+
+[] ns1:amount "30" ;
+    foaf:firstName "Bob" ;
+    foaf:lastName "Smith" .
+
+[] ns1:amount "20" ;
+    foaf:firstName "Sue" ;
+    foaf:lastName "Jones" .
+
+[] ns1:amount "30" ;
+    foaf:firstName "Bob" ;
+    foaf:lastName "Smith" .
+
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix sd: <http://www.w3.org/ns/sparql-service-description#> .
+
+<http://example.com/base#Country> rml:logicalSource [
+      rml:iterator """
+            PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
+            PREFIX foaf: <http://xmlns.com/foaf/0.1/>
+            PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
+            SELECT ?fname ?lname ?amount
+            WHERE {
+                ?x  foaf:firstName ?fname ;
+                    foaf:lastName  ?lname ;
+                    <http://example.com/amount> ?amount .
+            } """;
+      rml:referenceFormulation formats:SPARQL_Results_JSON;
+      rml:source <http://example.com/base#InputSPARQL>
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:template "{fname.value} {lname.value}";
+          rml:termType rml:Literal
+        ];
+      rml:predicate foaf:name
+    ], [
+      rml:objectMap [
+          rml:reference "amount.value"
+        ];
+      rml:predicate ex:amount
+    ];
+  rml:subjectMap [
+      rml:template "{fname.value}{lname.value}{amount.value}";
+      rml:termType rml:BlankNode
+    ] .
+
+<http://example.com/base#InputSPARQL> a sd:Service;
+  sd:endpoint <http://HOST:PORT/ds1/sparql>;
+  sd:supportedLanguage sd:SPARQL11Query .
+
+

Output

+
_:BobSmith30 <http://example.com/amount> "30" .
+_:BobSmith30 <http://xmlns.com/foaf/0.1/name> "Bob Smith" .
+_:SueJones20 <http://example.com/amount> "20" .
+_:SueJones20 <http://xmlns.com/foaf/0.1/name> "Sue Jones" .
+
+
+
+

241. RMLTC0012a-SQLServer

+

Title: "Duplicate tuples generate same blank node"

+

Description: "Tests that blank nodes with same identifier and in the same graph but generated by different logical rows are considered equivalent."

+

Error expected? No

+

Input

+
USE TestDB;
+DROP TABLE IF EXISTS IOUs;
+DROP TABLE IF EXISTS Lives;
+
+CREATE TABLE IOUs (
+      fname VARCHAR(20),
+      lname VARCHAR(20),
+      amount INT);
+/* We replaced DOUBLE with INT, because the datatype conversion is different across databases, and this test case is not relevant to that aspect */
+INSERT INTO IOUs (fname, lname, amount) VALUES ('Bob', 'Smith', 30);
+INSERT INTO IOUs (fname, lname, amount) VALUES ('Sue', 'Jones', 20);
+INSERT INTO IOUs (fname, lname, amount) VALUES ('Bob', 'Smith', 30);
+CREATE TABLE Lives (
+      fname VARCHAR(20),
+      lname VARCHAR(20),
+      city VARCHAR(20));
+INSERT INTO Lives (fname, lname, city) VALUES ('Bob', 'Smith', 'London');
+INSERT INTO Lives (fname, lname, city) VALUES ('Sue', 'Jones', 'Madrid');
+INSERT INTO Lives (fname, lname, city) VALUES ('Bob', 'Smith', 'London');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "IOUs"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:template "{fname} {lname}";
+          rml:termType rml:Literal
+        ];
+      rml:predicate foaf:name
+    ], [
+      rml:objectMap [
+          rml:reference "amount"
+        ];
+      rml:predicate ex:amount
+    ];
+  rml:subjectMap [
+      rml:template "{fname}_{lname}_{amount}";
+      rml:termType rml:BlankNode
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
+  d2rq:password "YourSTRONG!Passw0rd;";
+  d2rq:username "sa" .
+
+

Output

+
_:Bob_Smith_30 <http://example.com/amount> "30"^^<http://www.w3.org/2001/XMLSchema#integer> .
+_:Bob_Smith_30 <http://xmlns.com/foaf/0.1/name> "Bob Smith" .
+_:Sue_Jones_20 <http://example.com/amount> "20"^^<http://www.w3.org/2001/XMLSchema#integer> .
+_:Sue_Jones_20 <http://xmlns.com/foaf/0.1/name> "Sue Jones" .
+
+
+
+

242. RMLTC0012a-XML

+

Title: "Duplicate tuples generate same blank node"

+

Description: "Tests that blank nodes with same identifier and in the same graph but generated by different logical rows are considered equivalent."

+

Error expected? No

+

Input

+
<?xml version="1.0"?>
+
+<Persons>
+  <Person>
+    <fname>Bob</fname>
+    <lname>Smith</lname>
+    <amount>30</amount>
+  </Person>
+  <Person>
+    <fname>Sue</fname>
+    <lname>Jones</lname>
+    <amount>20</amount>
+  </Person>
+  <Person>
+    <fname>Bob</fname>
+    <lname>Smith</lname>
+    <amount>30</amount>
+  </Person>
+</Persons>
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "/Persons/Person";
+      rml:referenceFormulation rml:XPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "persons.xml"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:template "{fname} {lname}";
+          rml:termType rml:Literal
+        ];
+      rml:predicate foaf:name
+    ], [
+      rml:objectMap [
+          rml:reference "amount"
+        ];
+      rml:predicate ex:amount
+    ];
+  rml:subjectMap [
+      rml:template "{fname}{lname}{amount}";
+      rml:termType rml:BlankNode
+    ] .
+
+

Output

+
_:BobSmith30 <http://example.com/amount> "30" .
+_:BobSmith30 <http://xmlns.com/foaf/0.1/name> "Bob Smith" .
+_:SueJones20 <http://example.com/amount> "20" .
+_:SueJones20 <http://xmlns.com/foaf/0.1/name> "Sue Jones" .
+
+
+
+

243. RMLTC0012b-CSV

+

Title: "Duplicate tuples generate same blank node"

+

Description: "Tests that blank nodes with same identifier and in the same graph but generated by different logical rows are considered equivalent."

+

Error expected? No

+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:referenceFormulation rml:CSV;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "persons.csv"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:template "{fname} {lname}";
+          rml:termType rml:Literal
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "{fname}{lname}";
+      rml:termType rml:BlankNode
+    ] .
+
+<http://example.com/base/TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:referenceFormulation rml:CSV;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "lives.csv"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "city"
+        ];
+      rml:predicate ex:city
+    ];
+  rml:subjectMap [
+      rml:template "{fname}{lname}";
+      rml:termType rml:BlankNode
+    ] .
+
+

Output

+
_:BobSmith <http://example.com/city> "London" .
+_:BobSmith <http://xmlns.com/foaf/0.1/name> "Bob Smith" .
+_:SueJones <http://example.com/city> "Madrid" .
+_:SueJones <http://xmlns.com/foaf/0.1/name> "Sue Jones" .
+
+
+
+

244. RMLTC0012b-JSON

+

Title: "Duplicate tuples generate same blank node"

+

Description: "Tests that blank nodes with same identifier and in the same graph but generated by different logical rows are considered equivalent."

+

Error expected? No

+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.persons[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "persons.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:template "{$.fname} {$.lname}";
+          rml:termType rml:Literal
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "{$.fname}{$.lname}";
+      rml:termType rml:BlankNode
+    ] .
+
+<http://example.com/base/TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.lives[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "lives.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.city"
+        ];
+      rml:predicate ex:city
+    ];
+  rml:subjectMap [
+      rml:template "{$.fname}{$.lname}";
+      rml:termType rml:BlankNode
+    ] .
+
+

Output

+
_:BobSmith <http://example.com/city> "London" .
+_:BobSmith <http://xmlns.com/foaf/0.1/name> "Bob Smith" .
+_:SueJones <http://example.com/city> "Madrid" .
+_:SueJones <http://xmlns.com/foaf/0.1/name> "Sue Jones" .
+
+
+
+

245. RMLTC0012b-MySQL

+

Title: "Duplicate tuples generate same blank node"

+

Description: "Tests that blank nodes with same identifier and in the same graph but generated by different logical rows are considered equivalent."

+

Error expected? No

+

Input

+
USE test;
+DROP TABLE IF EXISTS test.persons;
+
+CREATE TABLE persons (
+  fname VARCHAR(200),
+  lname VARCHAR(200),
+  amount INTEGER
+);
+INSERT INTO persons values ('Bob','Smith','30');
+INSERT INTO persons values ('Sue','Jones','20');
+INSERT INTO persons values ('Bob','Smith','30');
+
+DROP TABLE IF EXISTS test.lives;
+
+CREATE TABLE lives (
+  fname VARCHAR(200),
+  lname VARCHAR(200),
+  city VARCHAR(200)
+);
+INSERT INTO lives values ('Bob','Smith','London');
+INSERT INTO lives values ('Sue','Jones','Madrid');
+INSERT INTO lives values ('Bob','Smith','London');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "persons"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:template "{fname} {lname}";
+          rml:termType rml:Literal
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "{fname}{lname}";
+      rml:termType rml:BlankNode
+    ] .
+
+<http://example.com/base/TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "lives"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "city"
+        ];
+      rml:predicate ex:city
+    ];
+  rml:subjectMap [
+      rml:template "{fname}{lname}";
+      rml:termType rml:BlankNode
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
+  d2rq:password "";
+  d2rq:username "root" .
+
+

Output

+
_:BobSmith <http://example.com/city> "London" .
+_:BobSmith <http://xmlns.com/foaf/0.1/name> "Bob Smith" .
+_:SueJones <http://example.com/city> "Madrid" .
+_:SueJones <http://xmlns.com/foaf/0.1/name> "Sue Jones" .
+
+
+
+

246. RMLTC0012b-PostgreSQL

+

Title: "Duplicate tuples generate same blank node"

+

Description: "Tests that blank nodes with same identifier and in the same graph but generated by different logical rows are considered equivalent."

+

Error expected? No

+

Input

+
DROP TABLE IF EXISTS persons;
+
+CREATE TABLE persons (
+  "fname" VARCHAR(200),
+  "lname" VARCHAR(200),
+  "amount" INTEGER
+);
+INSERT INTO persons values ('Bob','Smith','30');
+INSERT INTO persons values ('Sue','Jones','20');
+INSERT INTO persons values ('Bob','Smith','30');
+
+DROP TABLE IF EXISTS lives;
+
+CREATE TABLE lives (
+  "fname" VARCHAR(200),
+  "lname" VARCHAR(200),
+  "city" VARCHAR(200)
+);
+INSERT INTO lives values ('Bob','Smith','London');
+INSERT INTO lives values ('Sue','Jones','Madrid');
+INSERT INTO lives values ('Bob','Smith','London');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "persons"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:template "{fname} {lname}";
+          rml:termType rml:Literal
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "{fname}{lname}";
+      rml:termType rml:BlankNode
+    ] .
+
+<http://example.com/base/TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "lives"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "city"
+        ];
+      rml:predicate ex:city
+    ];
+  rml:subjectMap [
+      rml:template "{fname}{lname}";
+      rml:termType rml:BlankNode
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "org.postgresql.Driver";
+  d2rq:password "password";
+  d2rq:username "postgres" .
+
+

Output

+
_:BobSmith <http://example.com/city> "London" .
+_:BobSmith <http://xmlns.com/foaf/0.1/name> "Bob Smith" .
+_:SueJones <http://example.com/city> "Madrid" .
+_:SueJones <http://xmlns.com/foaf/0.1/name> "Sue Jones" .
+
+
+
+

247. RMLTC0012b-SPARQL

+

Title: "Duplicate triples generate same blank node"

+

Description: "Tests that blank nodes with same identifier and in the same graph but generated by different logical rows are considered equivalent."

+

Error expected? No

+

Input

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix ns1: <http://example.com/> .
+
+[] ns1:amount "30" ;
+    foaf:firstName "Bob" ;
+    foaf:lastName "Smith" .
+
+[] ns1:amount "20" ;
+    foaf:firstName "Sue" ;
+    foaf:lastName "Jones" .
+
+[] ns1:amount "30" ;
+    foaf:firstName "Bob" ;
+    foaf:lastName "Smith" .
+
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix sd: <http://www.w3.org/ns/sparql-service-description#> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator """
+              PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
+              PREFIX foaf: <http://xmlns.com/foaf/0.1/>
+              PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
+              SELECT ?fname ?lname
+              WHERE {
+                   ?x  foaf:firstName ?fname ;
+                       foaf:lastName  ?lname ;
+              } """;
+      rml:referenceFormulation formats:SPARQL_Results_JSON;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path <http://example.com/base/#InputSPARQL1>
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:template "{fname.value} {lname.value}";
+          rml:termType rml:Literal
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "{fname.value}{lname.value}";
+      rml:termType rml:BlankNode
+    ] .
+
+<http://example.com/base/TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator """
+                PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
+                PREFIX foaf: <http://xmlns.com/foaf/0.1/>
+                PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
+                SELECT ?city ?fname ?lname
+                WHERE {
+                    ?x  foaf:firstName ?fname ;
+                        foaf:lastName  ?lname ;
+                        <http://example.com/city> ?city .
+                } """;
+      rml:referenceFormulation formats:SPARQL_Results_JSON;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path <http://example.com/base/#InputSPARQL2>
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "city.value"
+        ];
+      rml:predicate ex:city
+    ];
+  rml:subjectMap [
+      rml:template "{fname.value}{lname.value}";
+      rml:termType rml:BlankNode
+    ] .
+
+<http://example.com/base/#InputSPARQL1> a sd:Service;
+  sd:endpoint <http://HOST:PORT/ds1/sparql>;
+  sd:supportedLanguage sd:SPARQL11Query .
+
+<http://example.com/base/#InputSPARQL2> a sd:Service;
+  sd:endpoint <http://HOST:PORT/ds2/sparql>;
+  sd:supportedLanguage sd:SPARQL11Query .
+
+

Output

+
_:BobSmith <http://example.com/city> "London" .
+_:BobSmith <http://xmlns.com/foaf/0.1/name> "Bob Smith" .
+_:SueJones <http://example.com/city> "Madrid" .
+_:SueJones <http://xmlns.com/foaf/0.1/name> "Sue Jones" .
+
+
+
+

248. RMLTC0012b-SQLServer

+

Title: "Duplicate tuples generate same blank node"

+

Description: "Tests that blank nodes with same identifier and in the same graph but generated by different logical rows are considered equivalent."

+

Error expected? No

+

Input

+
USE TestDB;
+DROP TABLE IF EXISTS persons;
+
+CREATE TABLE persons (
+  "fname" VARCHAR(200),
+  "lname" VARCHAR(200),
+  "amount" INTEGER
+);
+INSERT INTO persons values ('Bob','Smith','30');
+INSERT INTO persons values ('Sue','Jones','20');
+INSERT INTO persons values ('Bob','Smith','30');
+
+DROP TABLE IF EXISTS lives;
+
+CREATE TABLE lives (
+  "fname" VARCHAR(200),
+  "lname" VARCHAR(200),
+  "city" VARCHAR(200)
+);
+INSERT INTO lives values ('Bob','Smith','London');
+INSERT INTO lives values ('Sue','Jones','Madrid');
+INSERT INTO lives values ('Bob','Smith','London');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "persons"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:template "{fname} {lname}";
+          rml:termType rml:Literal
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "{fname}{lname}";
+      rml:termType rml:BlankNode
+    ] .
+
+<http://example.com/base/TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "lives"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "city"
+        ];
+      rml:predicate ex:city
+    ];
+  rml:subjectMap [
+      rml:template "{fname}{lname}";
+      rml:termType rml:BlankNode
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
+  d2rq:password "YourSTRONG!Passw0rd;";
+  d2rq:username "sa" .
+
+

Output

+
_:BobSmith <http://example.com/city> "London" .
+_:BobSmith <http://xmlns.com/foaf/0.1/name> "Bob Smith" .
+_:SueJones <http://example.com/city> "Madrid" .
+_:SueJones <http://xmlns.com/foaf/0.1/name> "Sue Jones" .
+
+
+
+

249. RMLTC0012b-XML

+

Title: "Duplicate tuples generate same blank node"

+

Description: "Tests that blank nodes with same identifier and in the same graph but generated by different logical rows are considered equivalent."

+

Error expected? No

+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "/Persons/Person";
+      rml:referenceFormulation rml:XPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "persons.xml"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:template "{fname} {lname}";
+          rml:termType rml:Literal
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "{fname}{lname}";
+      rml:termType rml:BlankNode
+    ] .
+
+<http://example.com/base/TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "/Lives/Live";
+      rml:referenceFormulation rml:XPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "lives.xml"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "city"
+        ];
+      rml:predicate ex:city
+    ];
+  rml:subjectMap [
+      rml:template "{fname}{lname}";
+      rml:termType rml:BlankNode
+    ] .
+
+

Output

+
_:BobSmith <http://example.com/city> "London" .
+_:BobSmith <http://xmlns.com/foaf/0.1/name> "Bob Smith" .
+_:SueJones <http://example.com/city> "Madrid" .
+_:SueJones <http://xmlns.com/foaf/0.1/name> "Sue Jones" .
+
+
+
+

250. RMLTC0012c-CSV

+

Title: "TriplesMap without subjectMap"

+

Description: "Tests a RML with missing information, TriplesMap without subjectMap."

+

Error expected? Yes

+

Input

+
fname,lname,amount
+Bob,Smith,30
+Sue,Jones,20
+Bob,Smith,30
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:referenceFormulation rml:CSV;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "persons.csv"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:template "{fname} {lname}";
+          rml:termType rml:Literal
+        ];
+      rml:predicate foaf:name
+    ], [
+      rml:objectMap [
+          rml:reference "amount"
+        ];
+      rml:predicate ex:amount
+    ] .
+
+
+

251. RMLTC0012c-JSON

+

Title: "TriplesMap without subjectMap"

+

Description: "Tests a RML with missing information, TriplesMap without subjectMap."

+

Error expected? Yes

+

Input

+
{
+  "persons": [
+    {"fname":"Bob","lname":"Smith","amount":30},
+    {"fname":"Sue","lname":"Jones","amount":20},
+    {"fname":"Bob","lname":"Smith","amount":30}
+  ]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.persons[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "persons.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:template "{$.fname} {$.lname}";
+          rml:termType rml:Literal
+        ];
+      rml:predicate foaf:name
+    ], [
+      rml:objectMap [
+          rml:reference "$.amount"
+        ];
+      rml:predicate ex:amount
+    ] .
+
+
+

252. RMLTC0012c-MySQL

+

Title: "TriplesMap without subjectMap"

+

Description: "Tests a RML with missing information, TriplesMap without subjectMap."

+

Error expected? Yes

+

Input

+
USE test;
+DROP TABLE IF EXISTS test.IOUs;
+DROP TABLE IF EXISTS test.Lives;
+
+CREATE TABLE IOUs (
+      fname VARCHAR(20),
+      lname VARCHAR(20),
+      amount FLOAT);
+INSERT INTO IOUs (fname, lname, amount) VALUES ('Bob', 'Smith', 30);
+INSERT INTO IOUs (fname, lname, amount) VALUES ('Sue', 'Jones', 20);
+INSERT INTO IOUs (fname, lname, amount) VALUES ('Bob', 'Smith', 30);
+
+CREATE TABLE Lives (
+      fname VARCHAR(20),
+      lname VARCHAR(20),
+      city VARCHAR(20));
+INSERT INTO Lives (fname, lname, city) VALUES ('Bob', 'Smith', 'London');
+INSERT INTO Lives (fname, lname, city) VALUES ('Sue', 'Jones', 'Madrid');
+INSERT INTO Lives (fname, lname, city) VALUES ('Bob', 'Smith', 'London');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "IOUs"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:template "{fname} {lname}";
+          rml:termType rml:Literal
+        ];
+      rml:predicate foaf:name
+    ], [
+      rml:objectMap [
+          rml:reference "amount"
+        ];
+      rml:predicate ex:amount
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
+  d2rq:password "";
+  d2rq:username "root" .
+
+
+

253. RMLTC0012c-PostgreSQL

+

Title: "TriplesMap without subjectMap"

+

Description: "Tests a RML with missing information, TriplesMap without subjectMap."

+

Error expected? Yes

+

Input

+
DROP TABLE IF EXISTS IOUs;
+DROP TABLE IF EXISTS Lives;
+
+CREATE TABLE IOUs (
+      fname VARCHAR(20),
+      lname VARCHAR(20),
+      amount FLOAT);
+INSERT INTO IOUs (fname, lname, amount) VALUES ('Bob', 'Smith', 30);
+INSERT INTO IOUs (fname, lname, amount) VALUES ('Sue', 'Jones', 20);
+INSERT INTO IOUs (fname, lname, amount) VALUES ('Bob', 'Smith', 30);
+
+CREATE TABLE Lives (
+      fname VARCHAR(20),
+      lname VARCHAR(20),
+      city VARCHAR(20));
+INSERT INTO Lives (fname, lname, city) VALUES ('Bob', 'Smith', 'London');
+INSERT INTO Lives (fname, lname, city) VALUES ('Sue', 'Jones', 'Madrid');
+INSERT INTO Lives (fname, lname, city) VALUES ('Bob', 'Smith', 'London');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "IOUs"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:template "{fname} {lname}";
+          rml:termType rml:Literal
+        ];
+      rml:predicate foaf:name
+    ], [
+      rml:objectMap [
+          rml:reference "amount"
+        ];
+      rml:predicate ex:amount
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "org.postgresql.Driver";
+  d2rq:password "password";
+  d2rq:username "postgres" .
+
+
+

254. RMLTC0012c-SQLServer

+

Title: "TriplesMap without subjectMap"

+

Description: "Tests a RML with missing information, TriplesMap without subjectMap."

+

Error expected? Yes

+

Input

+
USE TestDB;
+DROP TABLE IF EXISTS IOUs;
+DROP TABLE IF EXISTS Lives;
+
+CREATE TABLE IOUs (
+      fname VARCHAR(20),
+      lname VARCHAR(20),
+      amount FLOAT);
+INSERT INTO IOUs (fname, lname, amount) VALUES ('Bob', 'Smith', 30);
+INSERT INTO IOUs (fname, lname, amount) VALUES ('Sue', 'Jones', 20);
+INSERT INTO IOUs (fname, lname, amount) VALUES ('Bob', 'Smith', 30);
+
+CREATE TABLE Lives (
+      fname VARCHAR(20),
+      lname VARCHAR(20),
+      city VARCHAR(20));
+INSERT INTO Lives (fname, lname, city) VALUES ('Bob', 'Smith', 'London');
+INSERT INTO Lives (fname, lname, city) VALUES ('Sue', 'Jones', 'Madrid');
+INSERT INTO Lives (fname, lname, city) VALUES ('Bob', 'Smith', 'London');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "IOUs"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:template "{fname} {lname}";
+          rml:termType rml:Literal
+        ];
+      rml:predicate foaf:name
+    ], [
+      rml:objectMap [
+          rml:reference "amount"
+        ];
+      rml:predicate ex:amount
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
+  d2rq:password "YourSTRONG!Passw0rd;";
+  d2rq:username "sa" .
+
+
+

255. RMLTC0012c-XML

+

Title: "TriplesMap without subjectMap"

+

Description: "Tests a RML with missing information, TriplesMap without subjectMap."

+

Error expected? Yes

+

Input

+
<?xml version="1.0"?>
+
+<Persons>
+  <Person>
+    <fname>Bob</fname>
+    <lname>Smith></lname>
+    <amount>30</amount>
+  </Person>
+  <Person>
+    <fname>Sue</fname>
+    <lname>Jones></lname>
+    <amount>20</amount>
+  </Person>
+  <Person>
+    <fname>Bob</fname>
+    <lname>Smith></lname>
+    <amount>30</amount>
+  </Person>
+</Persons>
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "/Persons/Person";
+      rml:referenceFormulation rml:XPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "persons.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:template "{fname} {lname}";
+          rml:termType rml:Literal
+        ];
+      rml:predicate foaf:name
+    ], [
+      rml:objectMap [
+          rml:reference "amount"
+        ];
+      rml:predicate ex:amount
+    ] .
+
+
+

256. RMLTC0012d-CSV

+

Title: "TriplesMap with two subjectMap"

+

Description: "Tests a RML with wrong information, TriplesMap with two subjectMap."

+

Error expected? Yes

+

Input

+
fname,lname,amount
+Bob,Smith,30
+Sue,Jones,20
+Bob,Smith,30
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:referenceFormulation rml:CSV;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "persons.csv"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:template "{fname} {lname}";
+          rml:termType rml:Literal
+        ];
+      rml:predicate foaf:name
+    ], [
+      rml:objectMap [
+          rml:reference "amount"
+        ];
+      rml:predicate ex:amount
+    ];
+  rml:subjectMap [
+      rml:template "{fname}_{lname}_{amount}";
+      rml:termType rml:BlankNode
+    ], [
+      rml:template "{amount}_{fname}_{lname}";
+      rml:termType rml:BlankNode
+    ] .
+
+
+

257. RMLTC0012d-JSON

+

Title: "TriplesMap with two subjectMap"

+

Description: "Tests a RML with wrong information, TriplesMap with two subjectMap."

+

Error expected? Yes

+

Input

+
{
+  "persons": [
+    {"fname":"Bob","lname":"Smith","amount":30},
+    {"fname":"Sue","lname":"Jones","amount":20},
+    {"fname":"Bob","lname":"Smith","amount":30}
+  ]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.persons[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "persons.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:template "{$.fname} {$.lname}";
+          rml:termType rml:Literal
+        ];
+      rml:predicate foaf:name
+    ], [
+      rml:objectMap [
+          rml:reference "$.amount"
+        ];
+      rml:predicate ex:amount
+    ];
+  rml:subjectMap [
+      rml:template "{$.fname}_{$.lname}_{$.amount}";
+      rml:termType rml:BlankNode
+    ], [
+      rml:template "{$.amount}_{$.fname}_{$.lname}";
+      rml:termType rml:BlankNode
+    ] .
+
+
+

258. RMLTC0012d-MySQL

+

Title: "TriplesMap with two subjectMap"

+

Description: "Tests a RML with wrong information, TriplesMap with two subjectMap."

+

Error expected? Yes

+

Input

+
USE test;
+DROP TABLE IF EXISTS test.IOUs;
+DROP TABLE IF EXISTS test.Lives;
+
+CREATE TABLE IOUs (
+      fname VARCHAR(20),
+      lname VARCHAR(20),
+      amount FLOAT);
+INSERT INTO IOUs (fname, lname, amount) VALUES ('Bob', 'Smith', 30);
+INSERT INTO IOUs (fname, lname, amount) VALUES ('Sue', 'Jones', 20);
+INSERT INTO IOUs (fname, lname, amount) VALUES ('Bob', 'Smith', 30);
+
+CREATE TABLE Lives (
+      fname VARCHAR(20),
+      lname VARCHAR(20),
+      city VARCHAR(20));
+INSERT INTO Lives (fname, lname, city) VALUES ('Bob', 'Smith', 'London');
+INSERT INTO Lives (fname, lname, city) VALUES ('Sue', 'Jones', 'Madrid');
+INSERT INTO Lives (fname, lname, city) VALUES ('Bob', 'Smith', 'London');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "IOUs"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "amount"
+        ];
+      rml:predicate ex:amount
+    ];
+  rml:subjectMap [
+      rml:template "{fname}_{lname}_{amount}"
+    ], [
+      rml:template "{amount}_{fname}_{lname}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
+  d2rq:password "";
+  d2rq:username "root" .
+
+
+

259. RMLTC0012d-PostgreSQL

+

Title: "TriplesMap with two subjectMap"

+

Description: "Tests a RML with wrong information, TriplesMap with two subjectMap."

+

Error expected? Yes

+

Input

+
DROP TABLE IF EXISTS IOUs;
+DROP TABLE IF EXISTS Lives;
+
+CREATE TABLE IOUs (
+      fname VARCHAR(20),
+      lname VARCHAR(20),
+      amount FLOAT);
+INSERT INTO IOUs (fname, lname, amount) VALUES ('Bob', 'Smith', 30);
+INSERT INTO IOUs (fname, lname, amount) VALUES ('Sue', 'Jones', 20);
+INSERT INTO IOUs (fname, lname, amount) VALUES ('Bob', 'Smith', 30);
+
+CREATE TABLE Lives (
+      fname VARCHAR(20),
+      lname VARCHAR(20),
+      city VARCHAR(20));
+INSERT INTO Lives (fname, lname, city) VALUES ('Bob', 'Smith', 'London');
+INSERT INTO Lives (fname, lname, city) VALUES ('Sue', 'Jones', 'Madrid');
+INSERT INTO Lives (fname, lname, city) VALUES ('Bob', 'Smith', 'London');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "IOUs"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "amount"
+        ];
+      rml:predicate ex:amount
+    ];
+  rml:subjectMap [
+      rml:template "{fname}_{lname}_{amount}"
+    ], [
+      rml:template "{amount}_{fname}_{lname}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "org.postgresql.Driver";
+  d2rq:password "password";
+  d2rq:username "postgres" .
+
+
+

260. RMLTC0012d-SQLServer

+

Title: "TriplesMap with two subjectMap"

+

Description: "Tests a RML with wrong information, TriplesMap with two subjectMap."

+

Error expected? Yes

+

Input

+
USE TestDB;
+DROP TABLE IF EXISTS IOUs;
+DROP TABLE IF EXISTS Lives;
+
+CREATE TABLE IOUs (
+      fname VARCHAR(20),
+      lname VARCHAR(20),
+      amount FLOAT);
+INSERT INTO IOUs (fname, lname, amount) VALUES ('Bob', 'Smith', 30);
+INSERT INTO IOUs (fname, lname, amount) VALUES ('Sue', 'Jones', 20);
+INSERT INTO IOUs (fname, lname, amount) VALUES ('Bob', 'Smith', 30);
+
+CREATE TABLE Lives (
+      fname VARCHAR(20),
+      lname VARCHAR(20),
+      city VARCHAR(20));
+INSERT INTO Lives (fname, lname, city) VALUES ('Bob', 'Smith', 'London');
+INSERT INTO Lives (fname, lname, city) VALUES ('Sue', 'Jones', 'Madrid');
+INSERT INTO Lives (fname, lname, city) VALUES ('Bob', 'Smith', 'London');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "IOUs"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "amount"
+        ];
+      rml:predicate ex:amount
+    ];
+  rml:subjectMap [
+      rml:template "{fname}_{lname}_{amount}"
+    ], [
+      rml:template "{amount}_{fname}_{lname}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
+  d2rq:password "YourSTRONG!Passw0rd;";
+  d2rq:username "sa" .
+
+
+

261. RMLTC0012d-XML

+

Title: "TriplesMap with two subjectMap"

+

Description: "Tests a RML with wrong information, TriplesMap with two subjectMap."

+

Error expected? Yes

+

Input

+
<?xml version="1.0"?>
+
+<Persons>
+  <Person>
+    <fname>Bob</fname>
+    <lname>Smith</lname>
+    <amount>30</amount>
+  </Person>
+  <Person>
+    <fname>Sue</fname>
+    <lname>Jones</lname>
+    <amount>20</amount>
+  </Person>
+  <Person>
+    <fname>Bob</fname>
+    <lname>Smith</lname>
+    <amount>30</amount>
+  </Person>
+</Persons>
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "/Persons/Person";
+      rml:referenceFormulation rml:XPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "persons.xml"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:template "{fname} {lname}";
+          rml:termType rml:Literal
+        ];
+      rml:predicate foaf:name
+    ], [
+      rml:objectMap [
+          rml:reference "amount"
+        ];
+      rml:predicate ex:amount
+    ];
+  rml:subjectMap [
+      rml:template "{fname}_{lname}_{amount}";
+      rml:termType rml:BlankNode
+    ], [
+      rml:template "{amount}_{fname}_{lname}";
+      rml:termType rml:BlankNode
+    ] .
+
+
+

262. RMLTC0012e-MySQL

+

Title: "Default mapping"

+

Description: "Tests the generation of a default mapping for tables without a primary key."

+

Error expected? No

+

Input

+
USE test;
+DROP TABLE IF EXISTS test.IOUs;
+DROP TABLE IF EXISTS test.Lives;
+
+CREATE TABLE IOUs (
+      fname VARCHAR(20),
+      lname VARCHAR(20),
+      amount FLOAT);
+INSERT INTO IOUs (fname, lname, amount) VALUES ('Bob', 'Smith', 30);
+INSERT INTO IOUs (fname, lname, amount) VALUES ('Sue', 'Jones', 20);
+INSERT INTO IOUs (fname, lname, amount) VALUES ('Bob', 'Smith', 30);
+
+CREATE TABLE Lives (
+      fname VARCHAR(20),
+      lname VARCHAR(20),
+      city VARCHAR(20));
+INSERT INTO Lives (fname, lname, city) VALUES ('Bob', 'Smith', 'London');
+INSERT INTO Lives (fname, lname, city) VALUES ('Sue', 'Jones', 'Madrid');
+INSERT INTO Lives (fname, lname, city) VALUES ('Bob', 'Smith', 'London');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "IOUs"
+    ];
+  rml:predicateObjectMap [
+      rml:object <http://example.com/base/IOUs>;
+      rml:predicate rdf:type
+    ], [
+      rml:objectMap [
+          rml:reference "fname"
+        ];
+      rml:predicate <http://example.com/base/IOUs#fname>
+    ], [
+      rml:objectMap [
+          rml:reference "lname"
+        ];
+      rml:predicate <http://example.com/base/IOUs#lname>
+    ], [
+      rml:objectMap [
+          rml:reference "amount"
+        ];
+      rml:predicate <http://example.com/base/IOUs#amount>
+    ];
+  rml:subjectMap [
+      rml:template "{fname}_{lname}_{amount}";
+      rml:termType rml:BlankNode
+    ] .
+
+<http://example.com/base/TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "Lives"
+    ];
+  rml:predicateObjectMap [
+      rml:object <http://example.com/base/Lives>;
+      rml:predicate rdf:type
+    ], [
+      rml:objectMap [
+          rml:reference "fname"
+        ];
+      rml:predicate <http://example.com/base/IOUs#fname>
+    ], [
+      rml:objectMap [
+          rml:reference "lname"
+        ];
+      rml:predicate <http://example.com/base/IOUs#lname>
+    ], [
+      rml:objectMap [
+          rml:reference "city"
+        ];
+      rml:predicate <http://example.com/base/IOUs#city>
+    ];
+  rml:subjectMap [
+      rml:template "{fname}_{lname}_{city}";
+      rml:termType rml:BlankNode
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
+  d2rq:password "";
+  d2rq:username "root" .
+
+

Output

+
_:Bob_Smith_30 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/base/IOUs> .
+_:Bob_Smith_30 <http://example.com/base/IOUs#fname> "Bob" .
+_:Bob_Smith_30 <http://example.com/base/IOUs#lname> "Smith" .
+_:Bob_Smith_30 <http://example.com/base/IOUs#amount> "3.0E1"^^<http://www.w3.org/2001/XMLSchema#double> .
+_:Sue_Jones_20 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/base/IOUs> .
+_:Sue_Jones_20 <http://example.com/base/IOUs#fname> "Sue" .
+_:Sue_Jones_20 <http://example.com/base/IOUs#lname> "Jones" .
+_:Sue_Jones_20 <http://example.com/base/IOUs#amount> "2.0E1"^^<http://www.w3.org/2001/XMLSchema#double> .
+_:Bob_Smith_London <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/base/Lives> .
+_:Bob_Smith_London <http://example.com/base/IOUs#fname> "Bob" .
+_:Bob_Smith_London <http://example.com/base/IOUs#lname> "Smith" .
+_:Bob_Smith_London <http://example.com/base/IOUs#city> "London" .
+_:Sue_Jones_Madrid <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/base/Lives> .
+_:Sue_Jones_Madrid <http://example.com/base/IOUs#fname> "Sue" .
+_:Sue_Jones_Madrid <http://example.com/base/IOUs#lname> "Jones" .
+_:Sue_Jones_Madrid <http://example.com/base/IOUs#city> "Madrid" .
+
+
+
+
+

263. RMLTC0012e-PostgreSQL

+

Title: "Default mapping"

+

Description: "Tests the generation of a default mapping for tables without a primary key."

+

Error expected? No

+

Input

+
DROP TABLE IF EXISTS IOUs;
+DROP TABLE IF EXISTS Lives;
+
+CREATE TABLE IOUs (
+      fname VARCHAR(20),
+      lname VARCHAR(20),
+      amount FLOAT);
+INSERT INTO IOUs (fname, lname, amount) VALUES ('Bob', 'Smith', 30);
+INSERT INTO IOUs (fname, lname, amount) VALUES ('Sue', 'Jones', 20);
+INSERT INTO IOUs (fname, lname, amount) VALUES ('Bob', 'Smith', 30);
+
+CREATE TABLE Lives (
+      fname VARCHAR(20),
+      lname VARCHAR(20),
+      city VARCHAR(20));
+INSERT INTO Lives (fname, lname, city) VALUES ('Bob', 'Smith', 'London');
+INSERT INTO Lives (fname, lname, city) VALUES ('Sue', 'Jones', 'Madrid');
+INSERT INTO Lives (fname, lname, city) VALUES ('Bob', 'Smith', 'London');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "IOUs"
+    ];
+  rml:predicateObjectMap [
+      rml:object <http://example.com/base/IOUs>;
+      rml:predicate rdf:type
+    ], [
+      rml:objectMap [
+          rml:reference "fname"
+        ];
+      rml:predicate <http://example.com/base/IOUs#fname>
+    ], [
+      rml:objectMap [
+          rml:reference "lname"
+        ];
+      rml:predicate <http://example.com/base/IOUs#lname>
+    ], [
+      rml:objectMap [
+          rml:reference "amount"
+        ];
+      rml:predicate <http://example.com/base/IOUs#amount>
+    ];
+  rml:subjectMap [
+      rml:template "{fname}_{lname}_{amount}";
+      rml:termType rml:BlankNode
+    ] .
+
+<http://example.com/base/TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "Lives"
+    ];
+  rml:predicateObjectMap [
+      rml:object <http://example.com/base/Lives>;
+      rml:predicate rdf:type
+    ], [
+      rml:objectMap [
+          rml:reference "fname"
+        ];
+      rml:predicate <http://example.com/base/IOUs#fname>
+    ], [
+      rml:objectMap [
+          rml:reference "lname"
+        ];
+      rml:predicate <http://example.com/base/IOUs#lname>
+    ], [
+      rml:objectMap [
+          rml:reference "city"
+        ];
+      rml:predicate <http://example.com/base/IOUs#city>
+    ];
+  rml:subjectMap [
+      rml:template "{fname}_{lname}_{city}";
+      rml:termType rml:BlankNode
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "org.postgresql.Driver";
+  d2rq:password "";
+  d2rq:username "postgres" .
+
+

Output

+
_:Bob_Smith_30 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/base/IOUs> .
+_:Bob_Smith_30 <http://example.com/base/IOUs#fname> "Bob" .
+_:Bob_Smith_30 <http://example.com/base/IOUs#lname> "Smith" .
+_:Bob_Smith_30 <http://example.com/base/IOUs#amount> "3.0E1"^^<http://www.w3.org/2001/XMLSchema#double> .
+_:Sue_Jones_20 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/base/IOUs> .
+_:Sue_Jones_20 <http://example.com/base/IOUs#fname> "Sue" .
+_:Sue_Jones_20 <http://example.com/base/IOUs#lname> "Jones" .
+_:Sue_Jones_20 <http://example.com/base/IOUs#amount> "2.0E1"^^<http://www.w3.org/2001/XMLSchema#double> .
+_:Bob_Smith_London <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/base/Lives> .
+_:Bob_Smith_London <http://example.com/base/IOUs#fname> "Bob" .
+_:Bob_Smith_London <http://example.com/base/IOUs#lname> "Smith" .
+_:Bob_Smith_London <http://example.com/base/IOUs#city> "London" .
+_:Sue_Jones_Madrid <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/base/Lives> .
+_:Sue_Jones_Madrid <http://example.com/base/IOUs#fname> "Sue" .
+_:Sue_Jones_Madrid <http://example.com/base/IOUs#lname> "Jones" .
+_:Sue_Jones_Madrid <http://example.com/base/IOUs#city> "Madrid" .
+
+
+
+
+

264. RMLTC0012e-SQLServer

+

Title: "Default mapping"

+

Description: "Tests the generation of a default mapping for tables without a primary key."

+

Error expected? No

+

Input

+
USE TestDB;
+DROP TABLE IF EXISTS IOUs;
+DROP TABLE IF EXISTS Lives;
+
+CREATE TABLE IOUs (
+      fname VARCHAR(20),
+      lname VARCHAR(20),
+      amount FLOAT);
+INSERT INTO IOUs (fname, lname, amount) VALUES ('Bob', 'Smith', 30);
+INSERT INTO IOUs (fname, lname, amount) VALUES ('Sue', 'Jones', 20);
+INSERT INTO IOUs (fname, lname, amount) VALUES ('Bob', 'Smith', 30);
+
+CREATE TABLE Lives (
+      fname VARCHAR(20),
+      lname VARCHAR(20),
+      city VARCHAR(20));
+INSERT INTO Lives (fname, lname, city) VALUES ('Bob', 'Smith', 'London');
+INSERT INTO Lives (fname, lname, city) VALUES ('Sue', 'Jones', 'Madrid');
+INSERT INTO Lives (fname, lname, city) VALUES ('Bob', 'Smith', 'London');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "IOUs"
+    ];
+  rml:predicateObjectMap [
+      rml:object <http://example.com/base/IOUs>;
+      rml:predicate rdf:type
+    ], [
+      rml:objectMap [
+          rml:reference "fname"
+        ];
+      rml:predicate <http://example.com/base/IOUs#fname>
+    ], [
+      rml:objectMap [
+          rml:reference "lname"
+        ];
+      rml:predicate <http://example.com/base/IOUs#lname>
+    ], [
+      rml:objectMap [
+          rml:reference "amount"
+        ];
+      rml:predicate <http://example.com/base/IOUs#amount>
+    ];
+  rml:subjectMap [
+      rml:template "{fname}_{lname}_{amount}";
+      rml:termType rml:BlankNode
+    ] .
+
+<http://example.com/base/TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "Lives"
+    ];
+  rml:predicateObjectMap [
+      rml:object <http://example.com/base/Lives>;
+      rml:predicate rdf:type
+    ], [
+      rml:objectMap [
+          rml:reference "fname"
+        ];
+      rml:predicate <http://example.com/base/IOUs#fname>
+    ], [
+      rml:objectMap [
+          rml:reference "lname"
+        ];
+      rml:predicate <http://example.com/base/IOUs#lname>
+    ], [
+      rml:objectMap [
+          rml:reference "city"
+        ];
+      rml:predicate <http://example.com/base/IOUs#city>
+    ];
+  rml:subjectMap [
+      rml:template "{fname}_{lname}_{city}";
+      rml:termType rml:BlankNode
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
+  d2rq:password "YourSTRONG!Passw0rd;";
+  d2rq:username "sa" .
+
+

Output

+
_:Bob_Smith_30 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/base/IOUs> .
+_:Bob_Smith_30 <http://example.com/base/IOUs#fname> "Bob" .
+_:Bob_Smith_30 <http://example.com/base/IOUs#lname> "Smith" .
+_:Bob_Smith_30 <http://example.com/base/IOUs#amount> "3.0E1"^^<http://www.w3.org/2001/XMLSchema#double> .
+_:Sue_Jones_20 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/base/IOUs> .
+_:Sue_Jones_20 <http://example.com/base/IOUs#fname> "Sue" .
+_:Sue_Jones_20 <http://example.com/base/IOUs#lname> "Jones" .
+_:Sue_Jones_20 <http://example.com/base/IOUs#amount> "2.0E1"^^<http://www.w3.org/2001/XMLSchema#double> .
+_:Bob_Smith_London <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/base/Lives> .
+_:Bob_Smith_London <http://example.com/base/IOUs#fname> "Bob" .
+_:Bob_Smith_London <http://example.com/base/IOUs#lname> "Smith" .
+_:Bob_Smith_London <http://example.com/base/IOUs#city> "London" .
+_:Sue_Jones_Madrid <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/base/Lives> .
+_:Sue_Jones_Madrid <http://example.com/base/IOUs#fname> "Sue" .
+_:Sue_Jones_Madrid <http://example.com/base/IOUs#lname> "Jones" .
+_:Sue_Jones_Madrid <http://example.com/base/IOUs#city> "Madrid" .
+
+
+
+
+

265. RMLTC0013a-JSON

+

Title: "Null value in JSON file"

+

Description: "Tests if null values in JSON files are handled correctly."

+

Error expected? No

+

Input

+
{
+  "persons": [
+    {"ID":"1","Name":"Alice","DateOfBirth":null},
+    {"ID":"2","Name":"Bob","DateOfBirth":"September, 2010"}
+  ]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.persons[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "persons.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.DateOfBirth"
+        ];
+      rml:predicate ex:BirthDay
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Person/{$.ID}/{$.Name}/{$.DateOfBirth}"
+    ] .
+
+

Output

+
<http://example.com/Person/2/Bob/September%2C%202010> <http://example.com/BirthDay> "September, 2010" .
+
+
+

266. RMLTC0013a-MySQL

+

Title: "Generation of empty triples from referenced columns that have null values"

+

Description: "Tests the generation of empty triples from referenced columns that have null values"

+

Error expected? No

+

Input

+
USE test;
+DROP TABLE IF EXISTS test.Person;
+
+CREATE TABLE Person (
+ID integer,
+Name varchar(50),
+DateOfBirth varchar(50),
+PRIMARY KEY (ID)
+);
+INSERT INTO Person (ID, Name, DateOfBirth) VALUES (1,'Alice', NULL);
+INSERT INTO Person (ID, Name, DateOfBirth) VALUES (2,'Bob', 'September, 2010');
+
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "Person"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "DateOfBirth"
+        ];
+      rml:predicate ex:BirthDay
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Person/{ID}/{Name}/{DateOfBirth}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
+  d2rq:password "";
+  d2rq:username "root" .
+
+

Output

+
<http://example.com/Person/2/Bob/September%2C%202010> <http://example.com/BirthDay> "September, 2010" .
+
+
+
+
+

267. RMLTC0013a-PostgreSQL

+

Title: "Generation of empty triples from referenced columns that have null values"

+

Description: "Tests the generation of empty triples from referenced columns that have null values"

+

Error expected? No

+

Input

+
DROP TABLE IF EXISTS Person;
+
+CREATE TABLE Person (
+"ID" integer,
+"Name" varchar(50),
+"DateOfBirth" varchar(50),
+PRIMARY KEY ("ID")
+);
+INSERT INTO Person ("ID", "Name", "DateOfBirth") VALUES (1,'Alice', NULL);
+INSERT INTO Person ("ID", "Name", "DateOfBirth") VALUES (2,'Bob', 'September, 2010');
+
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "Person"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "DateOfBirth"
+        ];
+      rml:predicate ex:BirthDay
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Person/{ID}/{Name}/{DateOfBirth}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "org.postgresql.Driver";
+  d2rq:password "password";
+  d2rq:username "postgres" .
+
+

Output

+
<http://example.com/Person/2/Bob/September%2C%202010> <http://example.com/BirthDay> "September, 2010" .
+
+
+
+
+

268. RMLTC0013a-SQLServer

+

Title: "Generation of empty triples from referenced columns that have null values"

+

Description: "Tests the generation of empty triples from referenced columns that have null values"

+

Error expected? No

+

Input

+
USE TestDB;
+DROP TABLE IF EXISTS Person;
+
+CREATE TABLE Person (
+ID integer,
+Name varchar(50),
+DateOfBirth varchar(50),
+PRIMARY KEY (ID)
+);
+INSERT INTO Person (ID, Name, DateOfBirth) VALUES (1,'Alice', NULL);
+INSERT INTO Person (ID, Name, DateOfBirth) VALUES (2,'Bob', 'September, 2010');
+
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "Person"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "DateOfBirth"
+        ];
+      rml:predicate ex:BirthDay
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Person/{ID}/{Name}/{DateOfBirth}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
+  d2rq:password "YourSTRONG!Passw0rd;";
+  d2rq:username "sa" .
+
+

Output

+
<http://example.com/Person/2/Bob/September%2C%202010> <http://example.com/BirthDay> "September, 2010" .
+
+
+
+
+

269. RMLTC0014d-MySQL

+

Title: "three tables, one primary key, one foreign key"

+

Description: "Test the translation of database type codes to IRIs"

+

Error expected? No

+

Input

+
USE test;
+DROP TABLE IF EXISTS test.DEPT;
+DROP TABLE IF EXISTS test.EMP;
+DROP TABLE IF EXISTS test.LIKES;
+
+CREATE TABLE DEPT (
+      deptno INTEGER UNIQUE,
+      dname VARCHAR(30),
+      loc VARCHAR(100));
+INSERT INTO DEPT (deptno, dname, loc) VALUES (10, 'APPSERVER', 'NEW YORK');
+
+CREATE TABLE EMP (
+      empno INTEGER PRIMARY KEY,
+      ename VARCHAR(100),
+      job VARCHAR(30),
+      deptno INTEGER REFERENCES DEPT (deptno),
+      etype VARCHAR(30));
+INSERT INTO EMP (empno, ename, job, deptno, etype ) VALUES (7369, 'SMITH', 'CLERK', 10, 'PART_TIME');
+
+CREATE TABLE LIKES (
+      id INTEGER,
+      likeType VARCHAR(30),
+      likedObj VARCHAR(100));
+INSERT INTO LIKES (id, likeType, likedObj) VALUES (7369, 'Playing', 'Soccer');
+INSERT INTO LIKES (id, likeType, likedObj) VALUES (7369, 'Watching', 'Basketball');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator """
+      SELECT EMP.*, (CASE job
+        WHEN 'CLERK' THEN 'general-office'
+        WHEN 'NIGHTGUARD' THEN 'security'
+        WHEN 'ENGINEER' THEN 'engineering'
+      END) AS ROLE FROM EMP
+    """;
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Query
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:template "http://data.example.com/roles/{ROLE}"
+        ];
+      rml:predicate ex:role
+    ];
+  rml:subjectMap [
+      rml:template "http://data.example.com/employee/{empno}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
+  d2rq:password "";
+  d2rq:username "root" .
+
+

Output

+
<http://data.example.com/employee/7369> <http://example.com/ns#role> <http://data.example.com/roles/general-office> .
+
+
+

270. RMLTC0014d-PostgreSQL

+

Title: "three tables, one primary key, one foreign key"

+

Description: "Test the translation of database type codes to IRIs"

+

Error expected? No

+

Input

+
DROP TABLE IF EXISTS LIKES;
+DROP TABLE IF EXISTS EMP;
+DROP TABLE IF EXISTS DEPT;
+
+CREATE TABLE DEPT (
+      deptno INTEGER UNIQUE,
+      dname VARCHAR(30),
+      loc VARCHAR(100));
+INSERT INTO DEPT (deptno, dname, loc) VALUES (10, 'APPSERVER', 'NEW YORK');
+
+CREATE TABLE EMP (
+      empno INTEGER PRIMARY KEY,
+      ename VARCHAR(100),
+      job VARCHAR(30),
+      deptno INTEGER REFERENCES DEPT (deptno),
+      etype VARCHAR(30));
+INSERT INTO EMP (empno, ename, job, deptno, etype ) VALUES (7369, 'SMITH', 'CLERK', 10, 'PART_TIME');
+
+CREATE TABLE LIKES (
+      id INTEGER,
+      likeType VARCHAR(30),
+      likedObj VARCHAR(100));
+INSERT INTO LIKES (id, likeType, likedObj) VALUES (7369, 'Playing', 'Soccer');
+INSERT INTO LIKES (id, likeType, likedObj) VALUES (7369, 'Watching', 'Basketball');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator """
+      SELECT EMP.*, (CASE job
+        WHEN 'CLERK' THEN 'general-office'
+        WHEN 'NIGHTGUARD' THEN 'security'
+        WHEN 'ENGINEER' THEN 'engineering'
+      END) AS ROLE FROM EMP
+    """;
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Query
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:template "http://data.example.com/roles/{role}"
+        ];
+      rml:predicate ex:role
+    ];
+  rml:subjectMap [
+      rml:template "http://data.example.com/employee/{empno}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "org.postgresql.Driver";
+  d2rq:password "";
+  d2rq:username "postgres" .
+
+

Output

+
<http://data.example.com/employee/7369> <http://example.com/ns#role> <http://data.example.com/roles/general-office> .
+
+
+

271. RMLTC0014d-SQLServer

+

Title: "three tables, one primary key, one foreign key"

+

Description: "Test the translation of database type codes to IRIs"

+

Error expected? No

+

Input

+
USE TestDB;
+EXEC sp_msforeachtable 'ALTER TABLE ? NOCHECK CONSTRAINT all'
+EXEC sp_msforeachtable 'DROP TABLE ?'
+
+CREATE TABLE DEPT (
+      deptno INTEGER UNIQUE,
+      dname VARCHAR(30),
+      loc VARCHAR(100));
+INSERT INTO DEPT (deptno, dname, loc) VALUES (10, 'APPSERVER', 'NEW YORK');
+
+CREATE TABLE EMP (
+      empno INTEGER PRIMARY KEY,
+      ename VARCHAR(100),
+      job VARCHAR(30),
+      deptno INTEGER REFERENCES DEPT (deptno),
+      etype VARCHAR(30));
+INSERT INTO EMP (empno, ename, job, deptno, etype ) VALUES (7369, 'SMITH', 'CLERK', 10, 'PART_TIME');
+
+CREATE TABLE LIKES (
+      id INTEGER,
+      likeType VARCHAR(30),
+      likedObj VARCHAR(100));
+INSERT INTO LIKES (id, likeType, likedObj) VALUES (7369, 'Playing', 'Soccer');
+INSERT INTO LIKES (id, likeType, likedObj) VALUES (7369, 'Watching', 'Basketball');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator """
+      SELECT EMP.*, (CASE job
+        WHEN 'CLERK' THEN 'general-office'
+        WHEN 'NIGHTGUARD' THEN 'security'
+        WHEN 'ENGINEER' THEN 'engineering'
+      END) AS ROLE FROM EMP
+    """;
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Query
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:template "http://data.example.com/roles/{ROLE}"
+        ];
+      rml:predicate ex:role
+    ];
+  rml:subjectMap [
+      rml:template "http://data.example.com/employee/{empno}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
+  d2rq:password "YourSTRONG!Passw0rd;";
+  d2rq:username "sa" .
+
+

Output

+
<http://data.example.com/employee/7369> <http://example.com/ns#role> <http://data.example.com/roles/general-office> .
+
+
+

272. RMLTC0015a-CSV

+

Title: "Generation of language tags from a table with language information"

+

Description: "Generation of language tags from a table with language information"

+

Error expected? No

+

Input

+
Code,Name
+BO,"Bolivia, Plurinational State of"
+IE,Ireland
+
+

Mapping

+
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:referenceFormulation rml:CSV;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "country_en.csv"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:language "en";
+          rml:reference "Name"
+        ];
+      rml:predicate rdfs:label
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{Code}"
+    ] .
+
+<http://example.com/base/TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:referenceFormulation rml:CSV;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "country_es.csv"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:language "es";
+          rml:reference "Name"
+        ];
+      rml:predicate rdfs:label
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{Code}"
+    ] .
+
+

Output

+
<http://example.com/BO> <http://www.w3.org/2000/01/rdf-schema#label> "Bolivia, Plurinational State of"@en .
+<http://example.com/BO> <http://www.w3.org/2000/01/rdf-schema#label> "Estado Plurinacional de Bolivia"@es .
+<http://example.com/IE> <http://www.w3.org/2000/01/rdf-schema#label> "Ireland"@en .
+<http://example.com/IE> <http://www.w3.org/2000/01/rdf-schema#label> "Irlanda"@es .
+
+
+
+
+

273. RMLTC0015a-JSON

+

Title: "Generation of language tags from a table with language information"

+

Description: "Generation of language tags from a table with language information"

+

Error expected? No

+

Input

+
{
+  "countries": [
+    {"Code": "BO", "Name": "Bolivia, Plurinational State of"},
+    {"Code": "IE", "Name": "Ireland"}
+  ]
+}
+
+

Mapping

+
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.countries[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "country_en.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:language "en";
+          rml:reference "$.Name"
+        ];
+      rml:predicate rdfs:label
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{$.Code}"
+    ] .
+
+<http://example.com/base/TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.countries[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "country_es.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:language "es";
+          rml:reference "$.Name"
+        ];
+      rml:predicate rdfs:label
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{$.Code}"
+    ] .
+
+

Output

+
<http://example.com/BO> <http://www.w3.org/2000/01/rdf-schema#label> "Bolivia, Plurinational State of"@en .
+<http://example.com/BO> <http://www.w3.org/2000/01/rdf-schema#label> "Estado Plurinacional de Bolivia"@es .
+<http://example.com/IE> <http://www.w3.org/2000/01/rdf-schema#label> "Ireland"@en .
+<http://example.com/IE> <http://www.w3.org/2000/01/rdf-schema#label> "Irlanda"@es .
+
+
+
+
+

274. RMLTC0015a-MySQL

+

Title: "Generation of language tags from a table with language information"

+

Description: "Generation of language tags from a table with language information"

+

Error expected? No

+

Input

+
USE test;
+DROP TABLE IF EXISTS test.Country;
+
+CREATE TABLE Country (
+  Code VARCHAR(2),
+  Name VARCHAR(100),
+  Lan VARCHAR(10),
+  PRIMARY KEY (Code,Lan)
+);
+INSERT INTO Country (Code, Name, Lan) VALUES ('BO', 'Bolivia, Plurinational State of', 'EN');
+INSERT INTO Country (Code, Name, Lan) VALUES ('BO', 'Estado Plurinacional de Bolivia', 'ES');
+INSERT INTO Country (Code, Name, Lan) VALUES ('IE', 'Ireland', 'EN');
+INSERT INTO Country (Code, Name, Lan) VALUES ('IE', 'Irlanda', 'ES');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator """
+        SELECT Code, Name, Lan
+        FROM Country
+        WHERE Lan = 'EN';
+       """;
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Query
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:language "en";
+          rml:reference "Name"
+        ];
+      rml:predicate rdfs:label
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{Code}"
+    ] .
+
+<http://example.com/base/TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator """
+        SELECT Code, Name, Lan
+        FROM Country
+        WHERE Lan = 'ES';
+       """;
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Query
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:language "es";
+          rml:reference "Name"
+        ];
+      rml:predicate rdfs:label
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{Code}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
+  d2rq:password "";
+  d2rq:username "root" .
+
+

Output

+
<http://example.com/BO> <http://www.w3.org/2000/01/rdf-schema#label> "Bolivia, Plurinational State of"@en .
+<http://example.com/BO> <http://www.w3.org/2000/01/rdf-schema#label> "Estado Plurinacional de Bolivia"@es .
+<http://example.com/IE> <http://www.w3.org/2000/01/rdf-schema#label> "Ireland"@en .
+<http://example.com/IE> <http://www.w3.org/2000/01/rdf-schema#label> "Irlanda"@es .
+
+
+
+
+

275. RMLTC0015a-PostgreSQL

+

Title: "Generation of language tags from a table with language information"

+

Description: "Generation of language tags from a table with language information"

+

Error expected? No

+

Input

+
DROP TABLE IF EXISTS Country;
+
+CREATE TABLE Country (
+  Code VARCHAR(2),
+  Name VARCHAR(100),
+  Lan VARCHAR(10),
+  PRIMARY KEY (Code,Lan)
+);
+INSERT INTO Country (Code, Name, Lan) VALUES ('BO', 'Bolivia, Plurinational State of', 'EN');
+INSERT INTO Country (Code, Name, Lan) VALUES ('BO', 'Estado Plurinacional de Bolivia', 'ES');
+INSERT INTO Country (Code, Name, Lan) VALUES ('IE', 'Ireland', 'EN');
+INSERT INTO Country (Code, Name, Lan) VALUES ('IE', 'Irlanda', 'ES');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator """
+        SELECT Code, Name, Lan
+        FROM Country
+        WHERE Lan = 'EN';
+       """;
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Query
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:language "en";
+          rml:reference "name"
+        ];
+      rml:predicate rdfs:label
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{code}"
+    ] .
+
+<http://example.com/base/TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator """
+        SELECT Code, Name, Lan
+        FROM Country
+        WHERE Lan = 'ES';
+       """;
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Query
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:language "es";
+          rml:reference "name"
+        ];
+      rml:predicate rdfs:label
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{code}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "org.postgresql.Driver";
+  d2rq:password "";
+  d2rq:username "postgres" .
+
+

Output

+
<http://example.com/BO> <http://www.w3.org/2000/01/rdf-schema#label> "Bolivia, Plurinational State of"@en .
+<http://example.com/BO> <http://www.w3.org/2000/01/rdf-schema#label> "Estado Plurinacional de Bolivia"@es .
+<http://example.com/IE> <http://www.w3.org/2000/01/rdf-schema#label> "Ireland"@en .
+<http://example.com/IE> <http://www.w3.org/2000/01/rdf-schema#label> "Irlanda"@es .
+
+
+
+
+

276. RMLTC0015a-SQLServer

+

Title: "Generation of language tags from a table with language information"

+

Description: "Generation of language tags from a table with language information"

+

Error expected? No

+

Input

+
USE TestDB;
+DROP TABLE IF EXISTS Country;
+
+CREATE TABLE Country (
+  Code VARCHAR(2),
+  Name VARCHAR(100),
+  Lan VARCHAR(10),
+  PRIMARY KEY (Code,Lan)
+);
+INSERT INTO Country (Code, Name, Lan) VALUES ('BO', 'Bolivia, Plurinational State of', 'EN');
+INSERT INTO Country (Code, Name, Lan) VALUES ('BO', 'Estado Plurinacional de Bolivia', 'ES');
+INSERT INTO Country (Code, Name, Lan) VALUES ('IE', 'Ireland', 'EN');
+INSERT INTO Country (Code, Name, Lan) VALUES ('IE', 'Irlanda', 'ES');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator """
+        SELECT Code, Name, Lan
+        FROM Country
+        WHERE Lan = 'EN';
+       """;
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Query
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:language "en";
+          rml:reference "Name"
+        ];
+      rml:predicate rdfs:label
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{Code}"
+    ] .
+
+<http://example.com/base/TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator """
+        SELECT \"Code\", \"Name\", \"Lan\"
+        FROM \"Country\"
+        WHERE \"Lan\" = 'ES';
+       """;
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Query
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:language "es";
+          rml:reference "Name"
+        ];
+      rml:predicate rdfs:label
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{Code}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
+  d2rq:password "YourSTRONG!Passw0rd;";
+  d2rq:username "sa" .
+
+

Output

+
<http://example.com/BO> <http://www.w3.org/2000/01/rdf-schema#label> "Bolivia, Plurinational State of"@en .
+<http://example.com/BO> <http://www.w3.org/2000/01/rdf-schema#label> "Estado Plurinacional de Bolivia"@es .
+<http://example.com/IE> <http://www.w3.org/2000/01/rdf-schema#label> "Ireland"@en .
+<http://example.com/IE> <http://www.w3.org/2000/01/rdf-schema#label> "Irlanda"@es .
+
+
+
+
+

277. RMLTC0015a-XML

+

Title: "Generation of language tags from a table with language information"

+

Description: "Generation of language tags from a table with language information"

+

Error expected? No

+

Input

+
<?xml version="1.0"?>
+
+<countries>
+  <country><Code>BO</Code><Name>Bolivia, Plurinational State of</Name></country>
+  <country><Code>IE</Code><Name>Ireland</Name></country>
+</countries>
+
+

Mapping

+
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "/countries/country";
+      rml:referenceFormulation rml:XPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "country_en.xml"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:language "en";
+          rml:reference "Name"
+        ];
+      rml:predicate rdfs:label
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{Code}"
+    ] .
+
+<http://example.com/base/TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "/countries/country";
+      rml:referenceFormulation rml:XPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "country_es.xml"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:language "es";
+          rml:reference "Name"
+        ];
+      rml:predicate rdfs:label
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{Code}"
+    ] .
+
+

Output

+
<http://example.com/BO> <http://www.w3.org/2000/01/rdf-schema#label> "Bolivia, Plurinational State of"@en .
+<http://example.com/BO> <http://www.w3.org/2000/01/rdf-schema#label> "Estado Plurinacional de Bolivia"@es .
+<http://example.com/IE> <http://www.w3.org/2000/01/rdf-schema#label> "Ireland"@en .
+<http://example.com/IE> <http://www.w3.org/2000/01/rdf-schema#label> "Irlanda"@es .
+
+
+
+
+

278. RMLTC0015b-CSV

+

Title: "Generation of language tags from a table with language information, and a term map with invalid rr:language value"

+

Description: "Tests a term map with an invalid rr:language value, which is an error"

+

Error expected? Yes

+

Input

+
Code,Name
+BO,"Bolivia, Plurinational State of"
+IE,Ireland
+
+

Mapping

+
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:referenceFormulation rml:CSV;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "country_en.csv"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:language "a-english";
+          rml:reference "Name"
+        ];
+      rml:predicate rdfs:label
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{Code}"
+    ] .
+
+<http://example.com/base/TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:referenceFormulation rml:CSV;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "country_es.csv"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:language "a-spanish";
+          rml:reference "Name"
+        ];
+      rml:predicate rdfs:label
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{Code}"
+    ] .
+
+
+

279. RMLTC0015b-JSON

+

Title: "Generation of language tags from a table with language information, and a term map with invalid rr:language value"

+

Description: "Tests a term map with an invalid rr:language value, which is an error"

+

Error expected? Yes

+

Input

+
{
+  "countries": [
+    {"Code": "BO", "Name": "Bolivia, Plurinational State of"},
+    {"Code": "IE", "Name": "Ireland"}
+  ]
+}
+
+

Mapping

+
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.countries[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "country_en.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:language "a-english";
+          rml:reference "$.Name"
+        ];
+      rml:predicate rdfs:label
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{$.Code}"
+    ] .
+
+<http://example.com/base/TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.countries[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "country_en.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:language "a-spanish";
+          rml:reference "$.Name"
+        ];
+      rml:predicate rdfs:label
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{$.Code}"
+    ] .
+
+
+

280. RMLTC0015b-MySQL

+

Title: "Generation of language tags from a table with language information, and a term map with invalid rr:language value"

+

Description: "Tests a term map with an invalid rr:language value, which is an error"

+

Error expected? Yes

+

Input

+
USE test;
+DROP TABLE IF EXISTS test.Country;
+
+CREATE TABLE Country (
+  Code VARCHAR(2),
+  Name VARCHAR(100),
+  Lan VARCHAR(10),
+  PRIMARY KEY (Code,Lan)
+);
+INSERT INTO Country (Code, Name, Lan) VALUES ('BO', 'Bolivia, Plurinational State of', 'EN');
+INSERT INTO Country (Code, Name, Lan) VALUES ('BO', 'Estado Plurinacional de Bolivia', 'ES');
+INSERT INTO Country (Code, Name, Lan) VALUES ('IE', 'Ireland', 'EN');
+INSERT INTO Country (Code, Name, Lan) VALUES ('IE', 'Irlanda', 'ES');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator """
+        SELECT Code, Name, Lan
+        FROM Country
+        WHERE Lan = 'EN';
+       """;
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Query
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:language "a-english";
+          rml:reference "Name"
+        ];
+      rml:predicate rdfs:label
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{Code}"
+    ] .
+
+<http://example.com/base/TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:iterator """
+        SELECT Code, Name, Lan
+        FROM Country
+        WHERE Lan = 'EN';
+       """;
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Query
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:language "a-spanish";
+          rml:reference "Name"
+        ];
+      rml:predicate rdfs:label
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{Code}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
+  d2rq:password "";
+  d2rq:username "root" .
+
+
+

281. RMLTC0015b-PostgreSQL

+

Title: "Generation of language tags from a table with language information, and a term map with invalid rr:language value"

+

Description: "Tests a term map with an invalid rr:language value, which is an error"

+

Error expected? Yes

+

Input

+
DROP TABLE IF EXISTS Country;
+
+CREATE TABLE Country (
+  Code VARCHAR(2),
+  Name VARCHAR(100),
+  Lan VARCHAR(10),
+  PRIMARY KEY (Code,Lan)
+);
+INSERT INTO Country (Code, Name, Lan) VALUES ('BO', 'Bolivia, Plurinational State of', 'EN');
+INSERT INTO Country (Code, Name, Lan) VALUES ('BO', 'Estado Plurinacional de Bolivia', 'ES');
+INSERT INTO Country (Code, Name, Lan) VALUES ('IE', 'Ireland', 'EN');
+INSERT INTO Country (Code, Name, Lan) VALUES ('IE', 'Irlanda', 'ES');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:iterator """
+        SELECT Code, Name, Lan
+        FROM Country
+        WHERE Lan = 'EN';
+       """;
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Query
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:language "a-english";
+          rml:reference "Name"
+        ];
+      rml:predicate rdfs:label
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{Code}"
+    ] .
+
+<http://example.com/base/TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:iterator """
+        SELECT Code, Name, Lan
+        FROM Country
+        WHERE Lan = 'EN';
+       """;
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Query
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:language "a-spanish";
+          rml:reference "Name"
+        ];
+      rml:predicate rdfs:label
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{Code}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "org.postgresql.Driver";
+  d2rq:password "";
+  d2rq:username "postgres" .
+
+
+

282. RMLTC0015b-SQLServer

+

Title: "Generation of language tags from a table with language information, and a term map with invalid rr:language value"

+

Description: "Tests a term map with an invalid rr:language value, which is an error"

+

Error expected? Yes

+

Input

+
USE TestDB;
+DROP TABLE IF EXISTS Country;
+
+CREATE TABLE Country (
+  Code VARCHAR(2),
+  Name VARCHAR(100),
+  Lan VARCHAR(10),
+  PRIMARY KEY (Code,Lan)
+);
+INSERT INTO Country (Code, Name, Lan) VALUES ('BO', 'Bolivia, Plurinational State of', 'EN');
+INSERT INTO Country (Code, Name, Lan) VALUES ('BO', 'Estado Plurinacional de Bolivia', 'ES');
+INSERT INTO Country (Code, Name, Lan) VALUES ('IE', 'Ireland', 'EN');
+INSERT INTO Country (Code, Name, Lan) VALUES ('IE', 'Irlanda', 'ES');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:iterator """
+        SELECT Code, Name, Lan
+        FROM Country
+        WHERE Lan = 'EN';
+       """;
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Query
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:language "a-english";
+          rml:reference "Name"
+        ];
+      rml:predicate rdfs:label
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{Code}"
+    ] .
+
+<http://example.com/base/TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:iterator """
+        SELECT Code, Name, Lan
+        FROM Country
+        WHERE Lan = 'EN';
+       """;
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Query
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:language "a-spanish";
+          rml:reference "Name"
+        ];
+      rml:predicate rdfs:label
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{Code}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
+  d2rq:password "YourSTRONG!Passw0rd;";
+  d2rq:username "sa" .
+
+
+

283. RMLTC0015b-XML

+

Title: "Generation of language tags from a table with language information, and a term map with invalid rr:language value"

+

Description: "Tests a term map with an invalid rr:language value, which is an error"

+

Error expected? Yes

+

Input

+
<?xml version="1.0"?>
+
+<countries>
+  <country><Code>BO</Code><Name>Bolivia, Plurinational State of</Name></country>
+  <country><Code>IE</Code><Name>Ireland</Name></country>
+</countries>
+
+

Mapping

+
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "/countries/country";
+      rml:referenceFormulation rml:XPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "country_en.xml"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:language "a-english";
+          rml:reference "Name"
+        ];
+      rml:predicate rdfs:label
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{Code}"
+    ] .
+
+<http://example.com/base/TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "/countries/country";
+      rml:referenceFormulation rml:XPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "country_es.xml"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:language "a-spanish";
+          rml:reference "Name"
+        ];
+      rml:predicate rdfs:label
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{Code}"
+    ] .
+
+
+

284. RMLTC0016a-MySQL

+

Title: "Table with datatypes: string and integer"

+

Description: "Tests the rr:termtype and datatype conversions: string and integer"

+

Error expected? No

+

Input

+
USE test;
+DROP TABLE IF EXISTS test.Patient;
+
+CREATE TABLE Patient (
+ID INTEGER,
+FirstName VARCHAR(50),
+LastName VARCHAR(50),
+Sex VARCHAR(6),
+Weight REAL,
+Height FLOAT,
+BirthDate DATE,
+EntranceDate TIMESTAMP,
+PaidInAdvance BOOLEAN,
+Photo VARBINARY(200),
+PRIMARY KEY (ID)
+);
+
+INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo)
+VALUES (10,'Monica','Geller','female',80.25,1.65,'1981-10-10','2009-10-10 12:12:22',FALSE,
+X'89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFEBFC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082');
+
+INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo)
+VALUES (11,'Rachel','Green','female',70.22,1.70,'1982-11-12','2008-11-12 09:45:44',TRUE,
+X'89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFF3FC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082');
+
+INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo)
+VALUES (12,'Chandler','Bing','male',90.31,1.76,'1978-04-06','2007-03-12 02:13:14',TRUE,
+X'89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFEBFC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "Patient"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "Sex"
+        ];
+      rml:predicate ex:gender
+    ], [
+      rml:object foaf:Person;
+      rml:predicate rdf:type
+    ], [
+      rml:objectMap [
+          rml:reference "ID"
+        ];
+      rml:predicate ex:id
+    ], [
+      rml:objectMap [
+          rml:reference "FirstName"
+        ];
+      rml:predicate ex:firstName
+    ], [
+      rml:objectMap [
+          rml:reference "LastName"
+        ];
+      rml:predicate ex:lastName
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Patient/{ID}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
+  d2rq:password "";
+  d2rq:username "root" .
+
+

Output

+
<http://example.com/Patient/10> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Patient/10> <http://example.com/id> "10"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.com/Patient/10> <http://example.com/firstName> "Monica" .
+<http://example.com/Patient/10> <http://example.com/lastName> "Geller" .
+<http://example.com/Patient/10> <http://example.com/gender> "female" .
+<http://example.com/Patient/11> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Patient/11> <http://example.com/id> "11"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.com/Patient/11> <http://example.com/firstName> "Rachel" .
+<http://example.com/Patient/11> <http://example.com/lastName> "Green" .
+<http://example.com/Patient/11> <http://example.com/gender> "female" .
+<http://example.com/Patient/12> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Patient/12> <http://example.com/id> "12"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.com/Patient/12> <http://example.com/firstName> "Chandler" .
+<http://example.com/Patient/12> <http://example.com/lastName> "Bing" .
+<http://example.com/Patient/12> <http://example.com/gender> "male" .
+
+
+
+

285. RMLTC0016a-PostgreSQL

+

Title: "Table with datatypes: string and integer"

+

Description: "Tests the rr:termtype and datatype conversions: string and integer"

+

Error expected? No

+

Input

+
DROP TABLE IF EXISTS Patient;
+
+CREATE TABLE Patient (
+ID INTEGER,
+FirstName VARCHAR(50),
+LastName VARCHAR(50),
+Sex VARCHAR(6),
+Weight REAL,
+Height FLOAT,
+BirthDate DATE,
+EntranceDate TIMESTAMP,
+PaidInAdvance BOOLEAN,
+Photo BYTEA,
+PRIMARY KEY (ID)
+);
+
+INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo)
+VALUES (10,'Monica','Geller','female',80.25,1.65,'1981-10-10','2009-10-10 12:12:22',FALSE,
+'\\x89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFEBFC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082');
+
+INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo)
+VALUES (11,'Rachel','Green','female',70.22,1.70,'1982-11-12','2008-11-12 09:45:44',TRUE,
+'\\x89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFF3FC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082');
+
+INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo)
+VALUES (12,'Chandler','Bing','male',90.31,1.76,'1978-04-06','2007-03-12 02:13:14',TRUE,
+'\\x89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFEBFC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "Patient"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "sex"
+        ];
+      rml:predicate ex:gender
+    ], [
+      rml:object foaf:Person;
+      rml:predicate rdf:type
+    ], [
+      rml:objectMap [
+          rml:reference "id"
+        ];
+      rml:predicate ex:id
+    ], [
+      rml:objectMap [
+          rml:reference "firstname"
+        ];
+      rml:predicate ex:firstName
+    ], [
+      rml:objectMap [
+          rml:reference "lastname"
+        ];
+      rml:predicate ex:lastName
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Patient/{id}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "org.postgresql.Driver";
+  d2rq:password "";
+  d2rq:username "postgres" .
+
+

Output

+
<http://example.com/Patient/10> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Patient/10> <http://example.com/id> "10"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.com/Patient/10> <http://example.com/firstName> "Monica" .
+<http://example.com/Patient/10> <http://example.com/lastName> "Geller" .
+<http://example.com/Patient/10> <http://example.com/gender> "female" .
+<http://example.com/Patient/11> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Patient/11> <http://example.com/id> "11"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.com/Patient/11> <http://example.com/firstName> "Rachel" .
+<http://example.com/Patient/11> <http://example.com/lastName> "Green" .
+<http://example.com/Patient/11> <http://example.com/gender> "female" .
+<http://example.com/Patient/12> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Patient/12> <http://example.com/id> "12"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.com/Patient/12> <http://example.com/firstName> "Chandler" .
+<http://example.com/Patient/12> <http://example.com/lastName> "Bing" .
+<http://example.com/Patient/12> <http://example.com/gender> "male" .
+
+
+
+

286. RMLTC0016a-SQLServer

+

Title: "Table with datatypes: string and integer"

+

Description: "Tests the rr:termtype and datatype conversions: string and integer"

+

Error expected? No

+

Input

+
USE TestDB;
+DROP TABLE IF EXISTS Patient;
+
+CREATE TABLE Patient (
+ID INTEGER,
+FirstName VARCHAR(50),
+LastName VARCHAR(50),
+Sex VARCHAR(6),
+Weight REAL,
+Height FLOAT,
+BirthDate DATE,
+EntranceDate DATETIME,
+PaidInAdvance BIT,
+Photo VARBINARY(200),
+PRIMARY KEY (ID)
+);
+
+INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo)
+VALUES (10,'Monica','Geller','female',80.25,1.65,'1981-10-10','2009-10-10 12:12:22',0,
+CAST('89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFEBFC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082' as VARBINARY));
+
+INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo)
+VALUES (11,'Rachel','Green','female',70.22,1.70,'1982-11-12','2008-11-12 09:45:44',1,
+CAST('89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFF3FC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082' as VARBINARY));
+
+INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo)
+VALUES (12,'Chandler','Bing','male',90.31,1.76,'1978-04-06','2007-03-12 02:13:14',1,
+CAST('89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFEBFC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082' as VARBINARY));
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "Patient"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "Sex"
+        ];
+      rml:predicate ex:gender
+    ], [
+      rml:object foaf:Person;
+      rml:predicate rdf:type
+    ], [
+      rml:objectMap [
+          rml:reference "ID"
+        ];
+      rml:predicate ex:id
+    ], [
+      rml:objectMap [
+          rml:reference "FirstName"
+        ];
+      rml:predicate ex:firstName
+    ], [
+      rml:objectMap [
+          rml:reference "LastName"
+        ];
+      rml:predicate ex:lastName
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Patient/{ID}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
+  d2rq:password "YourSTRONG!Passw0rd;";
+  d2rq:username "sa" .
+
+

Output

+
<http://example.com/Patient/10> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Patient/10> <http://example.com/id> "10"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.com/Patient/10> <http://example.com/firstName> "Monica" .
+<http://example.com/Patient/10> <http://example.com/lastName> "Geller" .
+<http://example.com/Patient/10> <http://example.com/gender> "female" .
+<http://example.com/Patient/11> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Patient/11> <http://example.com/id> "11"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.com/Patient/11> <http://example.com/firstName> "Rachel" .
+<http://example.com/Patient/11> <http://example.com/lastName> "Green" .
+<http://example.com/Patient/11> <http://example.com/gender> "female" .
+<http://example.com/Patient/12> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Patient/12> <http://example.com/id> "12"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.com/Patient/12> <http://example.com/firstName> "Chandler" .
+<http://example.com/Patient/12> <http://example.com/lastName> "Bing" .
+<http://example.com/Patient/12> <http://example.com/gender> "male" .
+
+
+
+

287. RMLTC0016b-MySQL

+

Title: "Table with datatypes: real and float"

+

Description: "Tests the rr:termtype and datatype conversions: real and float"

+

Error expected? No

+

Input

+
USE test;
+DROP TABLE IF EXISTS test.Patient;
+
+CREATE TABLE Patient (
+ID INTEGER,
+FirstName VARCHAR(50),
+LastName VARCHAR(50),
+Sex VARCHAR(6),
+Weight REAL,
+Height FLOAT,
+BirthDate DATE,
+EntranceDate TIMESTAMP,
+PaidInAdvance BOOLEAN,
+Photo VARBINARY(200),
+PRIMARY KEY (ID)
+);
+
+INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo)
+VALUES (10,'Monica','Geller','female',80.25,1.65,'1981-10-10','2009-10-10 12:12:22',FALSE,
+X'89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFEBFC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082');
+
+INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo)
+VALUES (11,'Rachel','Green','female',70.22,1.70,'1982-11-12','2008-11-12 09:45:44',TRUE,
+X'89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFF3FC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082');
+
+INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo)
+VALUES (12,'Chandler','Bing','male',90.31,1.76,'1978-04-06','2007-03-12 02:13:14',TRUE,
+X'89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFEBFC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "Patient"
+    ];
+  rml:predicateObjectMap [
+      rml:object foaf:Person;
+      rml:predicate rdf:type
+    ], [
+      rml:objectMap [
+          rml:reference "Weight"
+        ];
+      rml:predicate ex:weight
+    ], [
+      rml:objectMap [
+          rml:reference "Height"
+        ];
+      rml:predicate ex:height
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Patient{ID}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
+  d2rq:password "";
+  d2rq:username "root" .
+
+

Output

+
<http://example.com/Patient10> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Patient10> <http://example.com/weight> "8.025E1"^^<http://www.w3.org/2001/XMLSchema#double> .
+<http://example.com/Patient10> <http://example.com/height> "1.65E0"^^<http://www.w3.org/2001/XMLSchema#double> .
+<http://example.com/Patient11> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Patient11> <http://example.com/weight> "7.022E1"^^<http://www.w3.org/2001/XMLSchema#double> .
+<http://example.com/Patient11> <http://example.com/height> "1.7E0"^^<http://www.w3.org/2001/XMLSchema#double> .
+<http://example.com/Patient12> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Patient12> <http://example.com/weight> "9.031E1"^^<http://www.w3.org/2001/XMLSchema#double> .
+<http://example.com/Patient12> <http://example.com/height> "1.76E0"^^<http://www.w3.org/2001/XMLSchema#double> .
+
+
+

288. RMLTC0016b-PostgreSQL

+

Title: "Table with datatypes: real and float"

+

Description: "Tests the rr:termtype and datatype conversions: real and float"

+

Error expected? No

+

Input

+
DROP TABLE IF EXISTS Patient;
+
+CREATE TABLE Patient (
+ID INTEGER,
+FirstName VARCHAR(50),
+LastName VARCHAR(50),
+Sex VARCHAR(6),
+Weight REAL,
+Height FLOAT,
+BirthDate DATE,
+EntranceDate TIMESTAMP,
+PaidInAdvance BOOLEAN,
+Photo BYTEA,
+PRIMARY KEY (ID)
+);
+
+INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo)
+VALUES (10,'Monica','Geller','female',80.25,1.65,'1981-10-10','2009-10-10 12:12:22',FALSE,
+'\\x89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFEBFC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082');
+
+INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo)
+VALUES (11,'Rachel','Green','female',70.22,1.70,'1982-11-12','2008-11-12 09:45:44',TRUE,
+'\\x89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFF3FC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082');
+
+INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo)
+VALUES (12,'Chandler','Bing','male',90.31,1.76,'1978-04-06','2007-03-12 02:13:14',TRUE,
+'\\x89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFEBFC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "Patient"
+    ];
+  rml:predicateObjectMap [
+      rml:object foaf:Person;
+      rml:predicate rdf:type
+    ], [
+      rml:objectMap [
+          rml:reference "weight"
+        ];
+      rml:predicate ex:weight
+    ], [
+      rml:objectMap [
+          rml:reference "height"
+        ];
+      rml:predicate ex:height
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Patient{id}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "org.postgresql.Driver";
+  d2rq:password "";
+  d2rq:username "postgres" .
+
+

Output

+
<http://example.com/Patient10> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Patient10> <http://example.com/weight> "8.025E1"^^<http://www.w3.org/2001/XMLSchema#double> .
+<http://example.com/Patient10> <http://example.com/height> "1.65E0"^^<http://www.w3.org/2001/XMLSchema#double> .
+<http://example.com/Patient11> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Patient11> <http://example.com/weight> "7.022E1"^^<http://www.w3.org/2001/XMLSchema#double> .
+<http://example.com/Patient11> <http://example.com/height> "1.7E0"^^<http://www.w3.org/2001/XMLSchema#double> .
+<http://example.com/Patient12> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Patient12> <http://example.com/weight> "9.031E1"^^<http://www.w3.org/2001/XMLSchema#double> .
+<http://example.com/Patient12> <http://example.com/height> "1.76E0"^^<http://www.w3.org/2001/XMLSchema#double> .
+
+
+

289. RMLTC0016b-SQLServer

+

Title: "Table with datatypes: real and float"

+

Description: "Tests the rr:termtype and datatype conversions: real and float"

+

Error expected? No

+

Input

+
USE TestDB;
+DROP TABLE IF EXISTS Patient;
+
+CREATE TABLE Patient (
+ID INTEGER,
+FirstName VARCHAR(50),
+LastName VARCHAR(50),
+Sex VARCHAR(6),
+Weight REAL,
+Height FLOAT,
+BirthDate DATE,
+EntranceDate DATETIME,
+PaidInAdvance BIT,
+Photo VARBINARY(200),
+PRIMARY KEY (ID)
+);
+
+INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo)
+VALUES (10,'Monica','Geller','female',80.25,1.65,'1981-10-10','2009-10-10 12:12:22',0,
+CAST('89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFEBFC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082' as VARBINARY));
+
+INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo)
+VALUES (11,'Rachel','Green','female',70.22,1.70,'1982-11-12','2008-11-12 09:45:44',1,
+CAST('89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFF3FC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082' as VARBINARY));
+
+INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo)
+VALUES (12,'Chandler','Bing','male',90.31,1.76,'1978-04-06','2007-03-12 02:13:14',1,
+CAST('89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFEBFC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082' as VARBINARY));
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "Patient"
+    ];
+  rml:predicateObjectMap [
+      rml:object foaf:Person;
+      rml:predicate rdf:type
+    ], [
+      rml:objectMap [
+          rml:reference "Weight"
+        ];
+      rml:predicate ex:weight
+    ], [
+      rml:objectMap [
+          rml:reference "Height"
+        ];
+      rml:predicate ex:height
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Patient{ID}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
+  d2rq:password "YourSTRONG!Passw0rd;";
+  d2rq:username "sa" .
+
+

Output

+
<http://example.com/Patient10> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Patient10> <http://example.com/weight> "8.025E1"^^<http://www.w3.org/2001/XMLSchema#double> .
+<http://example.com/Patient10> <http://example.com/height> "1.65E0"^^<http://www.w3.org/2001/XMLSchema#double> .
+<http://example.com/Patient11> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Patient11> <http://example.com/weight> "7.022E1"^^<http://www.w3.org/2001/XMLSchema#double> .
+<http://example.com/Patient11> <http://example.com/height> "1.7E0"^^<http://www.w3.org/2001/XMLSchema#double> .
+<http://example.com/Patient12> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Patient12> <http://example.com/weight> "9.031E1"^^<http://www.w3.org/2001/XMLSchema#double> .
+<http://example.com/Patient12> <http://example.com/height> "1.76E0"^^<http://www.w3.org/2001/XMLSchema#double> .
+
+
+

290. RMLTC0016c-MySQL

+

Title: "Table with datatypes: date and timestamp"

+

Description: "Tests the rr:termtype and datatype conversions: date and timestamp"

+

Error expected? No

+

Input

+
USE test;
+DROP TABLE IF EXISTS test.Patient;
+
+CREATE TABLE Patient (
+ID INTEGER,
+FirstName VARCHAR(50),
+LastName VARCHAR(50),
+Sex VARCHAR(6),
+Weight REAL,
+Height FLOAT,
+BirthDate DATE,
+EntranceDate TIMESTAMP,
+PaidInAdvance BOOLEAN,
+Photo VARBINARY(200),
+PRIMARY KEY (ID)
+);
+
+INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo)
+VALUES (10,'Monica','Geller','female',80.25,1.65,'1981-10-10','2009-10-10 12:12:22',FALSE,
+X'89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFEBFC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082');
+
+INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo)
+VALUES (11,'Rachel','Green','female',70.22,1.70,'1982-11-12','2008-11-12 09:45:44',TRUE,
+X'89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFF3FC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082');
+
+INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo)
+VALUES (12,'Chandler','Bing','male',90.31,1.76,'1978-04-06','2007-03-12 02:13:14',TRUE,
+X'89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFEBFC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "Patient"
+    ];
+  rml:predicateObjectMap [
+      rml:object foaf:Person;
+      rml:predicate rdf:type
+    ], [
+      rml:objectMap [
+          rml:reference "BirthDate"
+        ];
+      rml:predicate ex:birthdate
+    ], [
+      rml:objectMap [
+          rml:reference "EntranceDate"
+        ];
+      rml:predicate ex:entrancedate
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Patient{ID}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
+  d2rq:password "";
+  d2rq:username "root" .
+
+

Output

+
<http://example.com/Patient10> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Patient10> <http://example.com/birthdate> "1981-10-10"^^<http://www.w3.org/2001/XMLSchema#date> .
+<http://example.com/Patient10> <http://example.com/entrancedate> "2009-10-10T12:12:22"^^<http://www.w3.org/2001/XMLSchema#dateTime> .
+<http://example.com/Patient11> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Patient11> <http://example.com/birthdate> "1982-11-12"^^<http://www.w3.org/2001/XMLSchema#date> .
+<http://example.com/Patient11> <http://example.com/entrancedate> "2008-11-12T09:45:44"^^<http://www.w3.org/2001/XMLSchema#dateTime> .
+<http://example.com/Patient12> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Patient12> <http://example.com/birthdate> "1978-04-06"^^<http://www.w3.org/2001/XMLSchema#date> .
+<http://example.com/Patient12> <http://example.com/entrancedate> "2007-03-12T02:13:14"^^<http://www.w3.org/2001/XMLSchema#dateTime> .
+
+
+

291. RMLTC0016c-PostgreSQL

+

Title: "Table with datatypes: date and timestamp"

+

Description: "Tests the rr:termtype and datatype conversions: date and timestamp"

+

Error expected? No

+

Input

+
DROP TABLE IF EXISTS Patient;
+
+CREATE TABLE Patient (
+ID INTEGER,
+FirstName VARCHAR(50),
+LastName VARCHAR(50),
+Sex VARCHAR(6),
+Weight REAL,
+Height FLOAT,
+BirthDate DATE,
+EntranceDate TIMESTAMP,
+PaidInAdvance BOOLEAN,
+Photo BYTEA,
+PRIMARY KEY (ID)
+);
+
+INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo)
+VALUES (10,'Monica','Geller','female',80.25,1.65,'1981-10-10','2009-10-10 12:12:22',FALSE,
+'\\x89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFEBFC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082');
+
+INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo)
+VALUES (11,'Rachel','Green','female',70.22,1.70,'1982-11-12','2008-11-12 09:45:44',TRUE,
+'\\x89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFF3FC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082');
+
+INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo)
+VALUES (12,'Chandler','Bing','male',90.31,1.76,'1978-04-06','2007-03-12 02:13:14',TRUE,
+'\\x89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFEBFC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "Patient"
+    ];
+  rml:predicateObjectMap [
+      rml:object foaf:Person;
+      rml:predicate rdf:type
+    ], [
+      rml:objectMap [
+          rml:reference "birthdate"
+        ];
+      rml:predicate ex:birthdate
+    ], [
+      rml:objectMap [
+          rml:reference "entrancedate"
+        ];
+      rml:predicate ex:entrancedate
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Patient{id}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "org.postgresql.Driver";
+  d2rq:password "";
+  d2rq:username "postgres" .
+
+

Output

+
<http://example.com/Patient10> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Patient10> <http://example.com/birthdate> "1981-10-10"^^<http://www.w3.org/2001/XMLSchema#date> .
+<http://example.com/Patient10> <http://example.com/entrancedate> "2009-10-10T12:12:22"^^<http://www.w3.org/2001/XMLSchema#dateTime> .
+<http://example.com/Patient11> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Patient11> <http://example.com/birthdate> "1982-11-12"^^<http://www.w3.org/2001/XMLSchema#date> .
+<http://example.com/Patient11> <http://example.com/entrancedate> "2008-11-12T09:45:44"^^<http://www.w3.org/2001/XMLSchema#dateTime> .
+<http://example.com/Patient12> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Patient12> <http://example.com/birthdate> "1978-04-06"^^<http://www.w3.org/2001/XMLSchema#date> .
+<http://example.com/Patient12> <http://example.com/entrancedate> "2007-03-12T02:13:14"^^<http://www.w3.org/2001/XMLSchema#dateTime> .
+
+
+

292. RMLTC0016c-SQLServer

+

Title: "Table with datatypes: date and timestamp"

+

Description: "Tests the rr:termtype and datatype conversions: date and timestamp"

+

Error expected? No

+

Input

+
USE TestDB;
+DROP TABLE IF EXISTS Patient;
+
+CREATE TABLE Patient (
+ID INTEGER,
+FirstName VARCHAR(50),
+LastName VARCHAR(50),
+Sex VARCHAR(6),
+Weight REAL,
+Height FLOAT,
+BirthDate DATE,
+EntranceDate DATETIME,
+PaidInAdvance BIT,
+Photo VARBINARY(200),
+PRIMARY KEY (ID)
+);
+
+INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo)
+VALUES (10,'Monica','Geller','female',80.25,1.65,'1981-10-10','2009-10-10 12:12:22',0,
+CAST('89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFEBFC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082' as VARBINARY));
+
+INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo)
+VALUES (11,'Rachel','Green','female',70.22,1.70,'1982-11-12','2008-11-12 09:45:44',1,
+CAST('89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFF3FC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082' as VARBINARY));
+
+INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo)
+VALUES (12,'Chandler','Bing','male',90.31,1.76,'1978-04-06','2007-03-12 02:13:14',1,
+CAST('89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFEBFC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082' as VARBINARY));
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "Patient"
+    ];
+  rml:predicateObjectMap [
+      rml:object foaf:Person;
+      rml:predicate rdf:type
+    ], [
+      rml:objectMap [
+          rml:reference "BirthDate"
+        ];
+      rml:predicate ex:birthdate
+    ], [
+      rml:objectMap [
+          rml:reference "EntranceDate"
+        ];
+      rml:predicate ex:entrancedate
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Patient{ID}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
+  d2rq:password "YourSTRONG!Passw0rd;";
+  d2rq:username "sa" .
+
+

Output

+
<http://example.com/Patient10> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Patient10> <http://example.com/birthdate> "1981-10-10"^^<http://www.w3.org/2001/XMLSchema#date> .
+<http://example.com/Patient10> <http://example.com/entrancedate> "2009-10-10T12:12:22"^^<http://www.w3.org/2001/XMLSchema#dateTime> .
+<http://example.com/Patient11> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Patient11> <http://example.com/birthdate> "1982-11-12"^^<http://www.w3.org/2001/XMLSchema#date> .
+<http://example.com/Patient11> <http://example.com/entrancedate> "2008-11-12T09:45:44"^^<http://www.w3.org/2001/XMLSchema#dateTime> .
+<http://example.com/Patient12> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Patient12> <http://example.com/birthdate> "1978-04-06"^^<http://www.w3.org/2001/XMLSchema#date> .
+<http://example.com/Patient12> <http://example.com/entrancedate> "2007-03-12T02:13:14"^^<http://www.w3.org/2001/XMLSchema#dateTime> .
+
+
+

293. RMLTC0016d-MySQL

+

Title: "Table with datatypes, boolean conversions"

+

Description: "Tests the rr:termtype and datatype conversions: boolean"

+

Error expected? No

+

Input

+
USE test;
+DROP TABLE IF EXISTS test.Patient;
+
+CREATE TABLE Patient (
+ID INTEGER,
+FirstName VARCHAR(50),
+LastName VARCHAR(50),
+Sex VARCHAR(6),
+Weight REAL,
+Height FLOAT,
+BirthDate DATE,
+EntranceDate TIMESTAMP,
+PaidInAdvance BOOLEAN,
+Photo VARBINARY(200),
+PRIMARY KEY (ID)
+);
+
+INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo)
+VALUES (10,'Monica','Geller','female',80.25,1.65,'1981-10-10','2009-10-10 12:12:22',FALSE,
+X'89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFEBFC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082');
+
+INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo)
+VALUES (11,'Rachel','Green','female',70.22,1.70,'1982-11-12','2008-11-12 09:45:44',TRUE,
+X'89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFF3FC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082');
+
+INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo)
+VALUES (12,'Chandler','Bing','male',90.31,1.76,'1978-04-06','2007-03-12 02:13:14',TRUE,
+X'89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFEBFC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "Patient"
+    ];
+  rml:predicateObjectMap [
+      rml:object foaf:Person;
+      rml:predicate rdf:type
+    ], [
+      rml:objectMap [
+          rml:reference "PaidInAdvance"
+        ];
+      rml:predicate ex:paid
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Patient{ID}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
+  d2rq:password "";
+  d2rq:username "root" .
+
+

Output

+
<http://example.com/Patient10> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Patient10> <http://example.com/paid> "false"^^<http://www.w3.org/2001/XMLSchema#boolean> .
+<http://example.com/Patient11> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Patient11> <http://example.com/paid> "true"^^<http://www.w3.org/2001/XMLSchema#boolean> .
+<http://example.com/Patient12> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Patient12> <http://example.com/paid> "true"^^<http://www.w3.org/2001/XMLSchema#boolean> .
+
+
+

294. RMLTC0016d-PostgreSQL

+

Title: "Table with datatypes, boolean conversions"

+

Description: "Tests the rr:termtype and datatype conversions: boolean"

+

Error expected? No

+

Input

+
DROP TABLE IF EXISTS Patient;
+
+CREATE TABLE Patient (
+ID INTEGER,
+FirstName VARCHAR(50),
+LastName VARCHAR(50),
+Sex VARCHAR(6),
+Weight REAL,
+Height FLOAT,
+BirthDate DATE,
+EntranceDate TIMESTAMP,
+PaidInAdvance BOOLEAN,
+Photo BYTEA,
+PRIMARY KEY (ID)
+);
+
+INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo)
+VALUES (10,'Monica','Geller','female',80.25,1.65,'1981-10-10','2009-10-10 12:12:22',FALSE,
+'\\x89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFEBFC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082');
+
+INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo)
+VALUES (11,'Rachel','Green','female',70.22,1.70,'1982-11-12','2008-11-12 09:45:44',TRUE,
+'\\x89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFF3FC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082');
+
+INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo)
+VALUES (12,'Chandler','Bing','male',90.31,1.76,'1978-04-06','2007-03-12 02:13:14',TRUE,
+'\\x89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFEBFC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "Patient"
+    ];
+  rml:predicateObjectMap [
+      rml:object foaf:Person;
+      rml:predicate rdf:type
+    ], [
+      rml:objectMap [
+          rml:reference "paidinadvance"
+        ];
+      rml:predicate ex:paid
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Patient{id}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "org.postgresql.Driver";
+  d2rq:password "";
+  d2rq:username "postgres" .
+
+

Output

+
<http://example.com/Patient10> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Patient10> <http://example.com/paid> "false"^^<http://www.w3.org/2001/XMLSchema#boolean> .
+<http://example.com/Patient11> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Patient11> <http://example.com/paid> "true"^^<http://www.w3.org/2001/XMLSchema#boolean> .
+<http://example.com/Patient12> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Patient12> <http://example.com/paid> "true"^^<http://www.w3.org/2001/XMLSchema#boolean> .
+
+
+

295. RMLTC0016d-SQLServer

+

Title: "Table with datatypes, boolean conversions"

+

Description: "Tests the rr:termtype and datatype conversions: boolean"

+

Error expected? No

+

Input

+
USE TestDB;
+DROP TABLE IF EXISTS Patient;
+
+CREATE TABLE Patient (
+ID INTEGER,
+FirstName VARCHAR(50),
+LastName VARCHAR(50),
+Sex VARCHAR(6),
+Weight REAL,
+Height FLOAT,
+BirthDate DATE,
+EntranceDate DATETIME,
+PaidInAdvance BIT,
+Photo VARBINARY(200),
+PRIMARY KEY (ID)
+);
+
+INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo)
+VALUES (10,'Monica','Geller','female',80.25,1.65,'1981-10-10','2009-10-10 12:12:22',0,
+CAST('89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFEBFC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082' as VARBINARY));
+
+INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo)
+VALUES (11,'Rachel','Green','female',70.22,1.70,'1982-11-12','2008-11-12 09:45:44',1,
+CAST('89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFF3FC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082' as VARBINARY));
+
+INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo)
+VALUES (12,'Chandler','Bing','male',90.31,1.76,'1978-04-06','2007-03-12 02:13:14',1,
+CAST('89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFEBFC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082' as VARBINARY));
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "Patient"
+    ];
+  rml:predicateObjectMap [
+      rml:object foaf:Person;
+      rml:predicate rdf:type
+    ], [
+      rml:objectMap [
+          rml:reference "PaidInAdvance"
+        ];
+      rml:predicate ex:paid
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Patient{ID}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
+  d2rq:password "YourSTRONG!Passw0rd;";
+  d2rq:username "sa" .
+
+

Output

+
<http://example.com/Patient10> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Patient10> <http://example.com/paid> "false"^^<http://www.w3.org/2001/XMLSchema#boolean> .
+<http://example.com/Patient11> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Patient11> <http://example.com/paid> "true"^^<http://www.w3.org/2001/XMLSchema#boolean> .
+<http://example.com/Patient12> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Patient12> <http://example.com/paid> "true"^^<http://www.w3.org/2001/XMLSchema#boolean> .
+
+
+

296. RMLTC0016e-MySQL

+

Title: "Table with datatypes, binary column"

+

Description: "Tests the rr:termtype and datatype conversions: binary"

+

Error expected? No

+

Input

+
USE test;
+DROP TABLE IF EXISTS test.Patient;
+
+CREATE TABLE Patient (
+ID INTEGER,
+FirstName VARCHAR(50),
+LastName VARCHAR(50),
+Sex VARCHAR(6),
+Weight REAL,
+Height FLOAT,
+BirthDate DATE,
+EntranceDate TIMESTAMP,
+PaidInAdvance BOOLEAN,
+Photo VARBINARY(200),
+PRIMARY KEY (ID)
+);
+
+INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo)
+VALUES (10,'Monica','Geller','female',80.25,1.65,'1981-10-10','2009-10-10 12:12:22',FALSE,
+X'89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFEBFC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082');
+
+INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo)
+VALUES (11,'Rachel','Green','female',70.22,1.70,'1982-11-12','2008-11-12 09:45:44',TRUE,
+X'89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFF3FC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082');
+
+INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo)
+VALUES (12,'Chandler','Bing','male',90.31,1.76,'1978-04-06','2007-03-12 02:13:14',TRUE,
+X'89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFEBFC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "Patient"
+    ];
+  rml:predicateObjectMap [
+      rml:object foaf:Person;
+      rml:predicate rdf:type
+    ], [
+      rml:objectMap [
+          rml:template "data:image/png;hex,{Photo}"
+        ];
+      rml:predicate ex:photo
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Patient{ID}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
+  d2rq:password "";
+  d2rq:username "root" .
+
+

Output

+
<http://example.com/Patient10> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Patient10> <http://example.com/photo> <data:image/png;hex,89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFEBFC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082> .
+<http://example.com/Patient11> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Patient11> <http://example.com/photo> <data:image/png;hex,89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFF3FC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082> .
+<http://example.com/Patient12> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Patient12> <http://example.com/photo> <data:image/png;hex,89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFEBFC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082> .
+
+
+

297. RMLTC0016e-PostgreSQL

+

Title: "Table with datatypes, binary column"

+

Description: "Tests the rr:termtype and datatype conversions: binary"

+

Error expected? No

+

Input

+
DROP TABLE IF EXISTS Patient;
+
+CREATE TABLE Patient (
+ID INTEGER,
+FirstName VARCHAR(50),
+LastName VARCHAR(50),
+Sex VARCHAR(6),
+Weight REAL,
+Height FLOAT,
+BirthDate DATE,
+EntranceDate TIMESTAMP,
+PaidInAdvance BOOLEAN,
+Photo BYTEA,
+PRIMARY KEY (ID)
+);
+
+INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo)
+VALUES (10,'Monica','Geller','female',80.25,1.65,'1981-10-10','2009-10-10 12:12:22',FALSE,
+'\x89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFEBFC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082');
+
+INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo)
+VALUES (11,'Rachel','Green','female',70.22,1.70,'1982-11-12','2008-11-12 09:45:44',TRUE,
+'\x89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFF3FC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082');
+
+INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo)
+VALUES (12,'Chandler','Bing','male',90.31,1.76,'1978-04-06','2007-03-12 02:13:14',TRUE,
+'\x89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFEBFC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "Patient"
+    ];
+  rml:predicateObjectMap [
+      rml:object foaf:Person;
+      rml:predicate rdf:type
+    ], [
+      rml:objectMap [
+          rml:template "data:image/png;hex,{photo}"
+        ];
+      rml:predicate ex:photo
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Patient{id}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "org.postgresql.Driver";
+  d2rq:password "";
+  d2rq:username "postgres" .
+
+

Output

+
<http://example.com/Patient10> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Patient10> <http://example.com/photo> <data:image/png;hex,89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFEBFC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082> .
+<http://example.com/Patient11> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Patient11> <http://example.com/photo> <data:image/png;hex,89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFF3FC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082> .
+<http://example.com/Patient12> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Patient12> <http://example.com/photo> <data:image/png;hex,89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFEBFC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082> .
+
+
+

298. RMLTC0016e-SQLServer

+

Title: "Table with datatypes, binary column"

+

Description: "Tests the rr:termtype and datatype conversions: binary"

+

Error expected? No

+

Input

+
USE TestDB;
+DROP TABLE IF EXISTS Patient;
+
+CREATE TABLE Patient (
+ID INTEGER,
+FirstName VARCHAR(50),
+LastName VARCHAR(50),
+Sex VARCHAR(6),
+Weight REAL,
+Height FLOAT,
+BirthDate DATE,
+EntranceDate DATETIME,
+PaidInAdvance BIT,
+Photo VARBINARY(200),
+PRIMARY KEY (ID)
+);
+
+INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo)
+VALUES (10,'Monica','Geller','female',80.25,1.65,'1981-10-10','2009-10-10 12:12:22',0,
+CAST('89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFEBFC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082' as VARBINARY));
+
+INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo)
+VALUES (11,'Rachel','Green','female',70.22,1.70,'1982-11-12','2008-11-12 09:45:44',1,
+CAST('89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFF3FC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082' as VARBINARY));
+
+INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo)
+VALUES (12,'Chandler','Bing','male',90.31,1.76,'1978-04-06','2007-03-12 02:13:14',1,
+CAST('89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFEBFC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082' as VARBINARY));
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "Patient"
+    ];
+  rml:predicateObjectMap [
+      rml:object foaf:Person;
+      rml:predicate rdf:type
+    ], [
+      rml:objectMap [
+          rml:template "data:image/png;hex,{Photo}"
+        ];
+      rml:predicate ex:photo
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Patient{ID}"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
+  d2rq:password "YourSTRONG!Passw0rd;";
+  d2rq:username "sa" .
+
+

Output

+
<http://example.com/Patient10> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Patient10> <http://example.com/photo> <data:image/png;hex,89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFEBFC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082> .
+<http://example.com/Patient11> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Patient11> <http://example.com/photo> <data:image/png;hex,89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFF3FC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082> .
+<http://example.com/Patient12> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Patient12> <http://example.com/photo> <data:image/png;hex,89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFEBFC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082> .
+
+
+

299. RMLTC0019a-CSV

+

Title: "Generation of triples by using IRI value in columns"

+

Description: "Test the generation of triples by using IRI value in columns"

+

Error expected? No

+

Input

+
ID,FirstName,LastName
+10,http://example.com/ns#Jhon,Smith
+20,Carlos,Mendoza
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:referenceFormulation rml:CSV;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "persons.csv"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "FirstName"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:reference "FirstName"
+    ] .
+
+

Output

+
<http://example.com/ns#Jhon> <http://xmlns.com/foaf/0.1/name> "http://example.com/ns#Jhon" .
+<http://example.com/base/Carlos> <http://xmlns.com/foaf/0.1/name> "Carlos" .
+
+
+

300. RMLTC0019a-JSON

+

Title: "Generation of triples by using IRI value in columns"

+

Description: "Test the generation of triples by using IRI value in attributes"

+

Error expected? No

+

Input

+
{
+  "persons": [
+    {
+      "ID": 10,
+      "FirstName": "http://example.com/ns#Jhon",
+      "LastName": "Smith"
+    },
+    {
+      "ID": 20,
+      "FirstName": "Carlos",
+      "LastName": "Mendoza"
+    }
+  ]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.persons[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "persons.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.FirstName"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:reference "$.FirstName"
+    ] .
+
+

Output

+
<http://example.com/ns#Jhon> <http://xmlns.com/foaf/0.1/name> "http://example.com/ns#Jhon" .
+<http://example.com/base/Carlos> <http://xmlns.com/foaf/0.1/name> "Carlos" .
+
+
+

301. RMLTC0019a-MySQL

+

Title: "Generation of triples by using IRI value in columns"

+

Description: "Test the generation of triples by using IRI value in columns"

+

Error expected? No

+

Input

+
USE test;
+DROP TABLE IF EXISTS test.Employee;
+
+CREATE TABLE Employee (
+ID INTEGER,
+FirstName VARCHAR(50),
+LastName VARCHAR(50)
+);
+INSERT INTO Employee (ID,FirstName,LastName) VALUES (10,'http://example.com/ns#Jhon','Smith');
+INSERT INTO Employee (ID,FirstName,LastName) VALUES (20,'Carlos','Mendoza');
+INSERT INTO Employee (ID,FirstName,LastName) VALUES (30,'Juan Daniel','Crespo');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator """
+        SELECT ID, FirstName, LastName
+        FROM Employee
+        WHERE ID < 30
+     """;
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Query
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "FirstName"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:reference "FirstName"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
+  d2rq:password "";
+  d2rq:username "root" .
+
+

Output

+
<http://example.com/ns#Jhon> <http://xmlns.com/foaf/0.1/name> "http://example.com/ns#Jhon" .
+<http://example.com/base/Carlos> <http://xmlns.com/foaf/0.1/name> "Carlos" .
+
+
+

302. RMLTC0019a-PostgreSQL

+

Title: "Generation of triples by using IRI value in columns"

+

Description: "Test the generation of triples by using IRI value in columns"

+

Error expected? No

+

Input

+
DROP TABLE IF EXISTS Employee;
+
+CREATE TABLE Employee (
+ID INTEGER,
+FirstName VARCHAR(50),
+LastName VARCHAR(50)
+);
+INSERT INTO Employee (ID,FirstName,LastName) VALUES (10,'http://example.com/ns#Jhon','Smith');
+INSERT INTO Employee (ID,FirstName,LastName) VALUES (20,'Carlos','Mendoza');
+INSERT INTO Employee (ID,FirstName,LastName) VALUES (30,'Juan Daniel','Crespo');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator """
+        SELECT ID, FirstName, LastName
+        FROM Employee
+        WHERE ID < 30
+     """;
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Query
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "firstname"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:reference "firstname"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "org.postgresql.Driver";
+  d2rq:password "";
+  d2rq:username "postgres" .
+
+

Output

+
<http://example.com/ns#Jhon> <http://xmlns.com/foaf/0.1/name> "http://example.com/ns#Jhon" .
+<http://example.com/base/Carlos> <http://xmlns.com/foaf/0.1/name> "Carlos" .
+
+
+

303. RMLTC0019a-SQLServer

+

Title: "Generation of triples by using IRI value in columns"

+

Description: "Test the generation of triples by using IRI value in columns"

+

Error expected? No

+

Input

+
USE TestDB;
+DROP TABLE IF EXISTS Employee;
+
+CREATE TABLE Employee (
+ID INTEGER,
+FirstName VARCHAR(50),
+LastName VARCHAR(50)
+);
+INSERT INTO Employee (ID,FirstName,LastName) VALUES (10,'http://example.com/ns#Jhon','Smith');
+INSERT INTO Employee (ID,FirstName,LastName) VALUES (20,'Carlos','Mendoza');
+INSERT INTO Employee (ID,FirstName,LastName) VALUES (30,'Juan Daniel','Crespo');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator """
+        SELECT ID, FirstName, LastName
+        FROM Employee
+        WHERE ID < 30
+     """;
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Query
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "FirstName"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:reference "FirstName"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
+  d2rq:password "YourSTRONG!Passw0rd;";
+  d2rq:username "sa" .
+
+

Output

+
<http://example.com/ns#Jhon> <http://xmlns.com/foaf/0.1/name> "http://example.com/ns#Jhon" .
+<http://example.com/base/Carlos> <http://xmlns.com/foaf/0.1/name> "Carlos" .
+
+
+

304. RMLTC0019a-XML

+

Title: "Generation of triples by using IRI value in columns"

+

Description: "Test the generation of triples by using IRI value in elements"

+

Error expected? No

+

Input

+
<?xml version="1.0"?>
+
+<persons>
+    <person>
+        <ID>10</ID>
+        <FirstName>http://example.com/ns#Jhon</FirstName>
+        <LastName>Smith</LastName>
+    </person>
+    <person>
+        <ID>20</ID>
+        <FirstName>Carlos</FirstName>
+        <LastName>Mendoza</LastName>
+    </person>
+</persons>
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "/persons/person";
+      rml:referenceFormulation rml:XPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "persons.xml"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "FirstName"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:reference "FirstName"
+    ] .
+
+

Output

+
<http://example.com/ns#Jhon> <http://xmlns.com/foaf/0.1/name> "http://example.com/ns#Jhon" .
+<http://example.com/base/Carlos> <http://xmlns.com/foaf/0.1/name> "Carlos" .
+
+
+

305. RMLTC0019b-CSV

+

Title: "Generation of triples by using IRI value in columns, with data error"

+

Description: "Test the generation of triples by using IRI value in columns, conforming RML mapping with data error (and limited results)"

+

Error expected? Yes

+

Input

+
ID,FirstName,LastName
+10,http://example.com/ns#Jhon,Smith
+20,Carlos,Mendoza
+30,Juan Daniel,Crespo
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:referenceFormulation rml:CSV;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "persons.csv"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "FirstName"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:reference "FirstName"
+    ] .
+
+
+

306. RMLTC0019b-JSON

+

Title: "Generation of triples by using IRI value in columns, with data error"

+

Description: "Test the generation of triples by using IRI value in attributes, conforming RML mapping with data error (and limited results)"

+

Error expected? Yes

+

Input

+
{
+  "persons": [
+    {
+      "ID": 10,
+      "FirstName": "http://example.com/ns#Jhon",
+      "LastName": "Smith"
+    },
+    {
+      "ID": 20,
+      "FirstName": "Carlos",
+      "LastName": "Mendoza"
+    },
+    {
+      "ID": 30,
+      "FirstName": "Juan Daniel",
+      "LastName": "Crespo"
+    }
+  ]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.persons[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "persons.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.FirstName"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:reference "$.FirstName"
+    ] .
+
+
+

307. RMLTC0019b-MySQL

+

Title: "Generation of triples by using IRI value in columns, with data error"

+

Description: "Test the generation of triples by using IRI value in columns, conforming RML mapping with data error (and limited results)"

+

Error expected? Yes

+

Input

+
USE test;
+DROP TABLE IF EXISTS test.Employee;
+
+CREATE TABLE Employee (
+ID INTEGER,
+FirstName VARCHAR(50),
+LastName VARCHAR(50)
+);
+INSERT INTO Employee (ID,FirstName,LastName) VALUES (10,'http://example.com/ns#Jhon','Smith');
+INSERT INTO Employee (ID,FirstName,LastName) VALUES (20,'Carlos','Mendoza');
+INSERT INTO Employee (ID,FirstName,LastName) VALUES (30,'Juan Daniel','Crespo');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "Employee"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "FirstName"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:reference "FirstName"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
+  d2rq:password "";
+  d2rq:username "root" .
+
+
+

308. RMLTC0019b-PostgreSQL

+

Title: "Generation of triples by using IRI value in columns, with data error"

+

Description: "Test the generation of triples by using IRI value in columns, conforming RML mapping with data error (and limited results)"

+

Error expected? Yes

+

Input

+
DROP TABLE IF EXISTS Employee;
+
+CREATE TABLE Employee (
+ID INTEGER,
+FirstName VARCHAR(50),
+LastName VARCHAR(50)
+);
+INSERT INTO Employee (ID,FirstName,LastName) VALUES (10,'http://example.com/ns#Jhon','Smith');
+INSERT INTO Employee (ID,FirstName,LastName) VALUES (20,'Carlos','Mendoza');
+INSERT INTO Employee (ID,FirstName,LastName) VALUES (30,'Juan Daniel','Crespo');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "Employee"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "firstname"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:reference "firstname"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "org.postgresql.Driver";
+  d2rq:password "";
+  d2rq:username "postgres" .
+
+
+

309. RMLTC0019b-SQLServer

+

Title: "Generation of triples by using IRI value in columns, with data error"

+

Description: "Test the generation of triples by using IRI value in columns, conforming RML mapping with data error (and limited results)"

+

Error expected? Yes

+

Input

+
USE TestDB;
+DROP TABLE IF EXISTS Employee;
+
+CREATE TABLE Employee (
+ID INTEGER,
+FirstName VARCHAR(50),
+LastName VARCHAR(50)
+);
+INSERT INTO Employee (ID,FirstName,LastName) VALUES (10,'http://example.com/ns#Jhon','Smith');
+INSERT INTO Employee (ID,FirstName,LastName) VALUES (20,'Carlos','Mendoza');
+INSERT INTO Employee (ID,FirstName,LastName) VALUES (30,'Juan Daniel','Crespo');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "Employee"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "FirstName"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:reference "FirstName"
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
+  d2rq:password "YourSTRONG!Passw0rd;";
+  d2rq:username "sa" .
+
+
+

310. RMLTC0019b-XML

+

Title: "Generation of triples by using IRI value in columns, with data error"

+

Description: "Test the generation of triples by using IRI value in elements, conforming RML mapping with data error (and limited results)"

+

Error expected? Yes

+

Input

+
<?xml version="1.0"?>
+
+<persons>
+    <person>
+        <ID>10</ID>
+        <FirstName>http://example.com/ns#Jhon</FirstName>
+        <LastName>Smith</LastName>
+    </person>
+    <person>
+        <ID>20</ID>
+        <FirstName>Carlos</FirstName>
+        <LastName>Mendoza</LastName>
+    </person>
+    <person>
+        <ID>30</ID>
+        <FirstName>Juan Daniel</FirstName>
+        <LastName>Crespo</LastName>
+    </person>
+</persons>
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "/persons/person";
+      rml:referenceFormulation rml:XPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "persons.xml"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "FirstName"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:reference "FirstName"
+    ] .
+
+
+

311. RMLTC0020a-CSV

+

Title: "Generation of triples by using IRI value in columns"

+

Description: "Test the generation of triples by using IRI value in columns"

+

Error expected? No

+

Input

+
Name
+http://example.com/company/Alice
+Bob
+Bob/Charles
+path/../Danny
+Emily Smith
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:referenceFormulation rml:CSV;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.csv"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:object foaf:Person;
+      rml:predicate rdf:type
+    ];
+  rml:subjectMap [
+      rml:template "{Name}";
+      rml:termType rml:IRI
+    ] .
+
+

Output

+
<http://example.com/base/http%3A%2F%2Fexample.com%2Fcompany%2FAlice> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/base/Bob> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/base/Bob%2FCharles> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/base/path%2F..%2FDanny> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/base/Emily%20Smith> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+
+
+

312. RMLTC0020a-JSON

+

Title: "Generation of triples by using IRI value in columns"

+

Description: "Test the generation of triples by using IRI value in attributes"

+

Error expected? No

+

Input

+
{
+  "students": [
+    {"Name": "http://example.com/company/Alice"},
+    {"Name": "Bob"},
+    {"Name": "Bob/Charles"},
+    {"Name": "path/../Danny"},
+    {"Name": "Emily Smith"}
+  ]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:object foaf:Person;
+      rml:predicate rdf:type
+    ];
+  rml:subjectMap [
+      rml:template "{$.Name}";
+      rml:termType rml:IRI
+    ] .
+
+

Output

+
<http://example.com/base/http%3A%2F%2Fexample.com%2Fcompany%2FAlice> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/base/Bob> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/base/Bob%2FCharles> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/base/path%2F..%2FDanny> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/base/Emily%20Smith> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+
+
+

313. RMLTC0020a-MySQL

+

Title: "Generation of triples by using IRI value in columns"

+

Description: "Test the generation of triples by using IRI value in columns"

+

Error expected? No

+

Input

+
USE test;
+DROP TABLE IF EXISTS test.Student_Sport;
+DROP TABLE IF EXISTS test.Student;
+
+CREATE TABLE Student (
+Name VARCHAR(50)
+);
+
+INSERT INTO Student (Name) VALUES ('http://example.com/company/Alice');
+INSERT INTO Student (Name) VALUES ('Bob');
+INSERT INTO Student (Name) VALUES ('Bob/Charles');
+INSERT INTO Student (Name) VALUES ('path/../Danny');
+INSERT INTO Student (Name) VALUES ('Emily Smith');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "Student"
+    ];
+  rml:predicateObjectMap [
+      rml:object foaf:Person;
+      rml:predicate rdf:type
+    ];
+  rml:subjectMap [
+      rml:template "{Name}";
+      rml:termType rml:IRI
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
+  d2rq:password "";
+  d2rq:username "root" .
+
+

Output

+
<http://example.com/base/http%3A%2F%2Fexample.com%2Fcompany%2FAlice> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/base/Bob> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/base/Bob%2FCharles> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/base/path%2F..%2FDanny> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/base/Emily%20Smith> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+
+
+

314. RMLTC0020a-PostgreSQL

+

Title: "Generation of triples by using IRI value in columns"

+

Description: "Test the generation of triples by using IRI value in columns"

+

Error expected? No

+

Input

+
DROP TABLE IF EXISTS Student;
+
+CREATE TABLE Student (
+Name VARCHAR(50)
+);
+
+INSERT INTO Student (Name) VALUES ('http://example.com/company/Alice');
+INSERT INTO Student (Name) VALUES ('Bob');
+INSERT INTO Student (Name) VALUES ('Bob/Charles');
+INSERT INTO Student (Name) VALUES ('path/../Danny');
+INSERT INTO Student (Name) VALUES ('Emily Smith');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "Student"
+    ];
+  rml:predicateObjectMap [
+      rml:object foaf:Person;
+      rml:predicate rdf:type
+    ];
+  rml:subjectMap [
+      rml:template "{name}";
+      rml:termType rml:IRI
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "org.postgresql.Driver";
+  d2rq:password "password";
+  d2rq:username "postgres" .
+
+

Output

+
<http://example.com/base/http%3A%2F%2Fexample.com%2Fcompany%2FAlice> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/base/Bob> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/base/Bob%2FCharles> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/base/path%2F..%2FDanny> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/base/Emily%20Smith> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+
+
+

315. RMLTC0020a-SQLServer

+

Title: "Generation of triples by using IRI value in columns"

+

Description: "Test the generation of triples by using IRI value in columns"

+

Error expected? No

+

Input

+
USE TestDB;
+DROP TABLE IF EXISTS Student;
+
+CREATE TABLE Student (
+Name VARCHAR(50)
+);
+
+INSERT INTO Student (Name) VALUES ('http://example.com/company/Alice');
+INSERT INTO Student (Name) VALUES ('Bob');
+INSERT INTO Student (Name) VALUES ('Bob/Charles');
+INSERT INTO Student (Name) VALUES ('path/../Danny');
+INSERT INTO Student (Name) VALUES ('Emily Smith');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "Student"
+    ];
+  rml:predicateObjectMap [
+      rml:object foaf:Person;
+      rml:predicate rdf:type
+    ];
+  rml:subjectMap [
+      rml:template "{Name}";
+      rml:termType rml:IRI
+    ] .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
+  d2rq:password "YourSTRONG!Passw0rd;";
+  d2rq:username "sa" .
+
+

Output

+
<http://example.com/base/http%3A%2F%2Fexample.com%2Fcompany%2FAlice> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/base/Bob> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/base/Bob%2FCharles> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/base/path%2F..%2FDanny> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/base/Emily%20Smith> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+
+
+

316. RMLTC0020a-XML

+

Title: "Generation of triples by using IRI value in columns"

+

Description: "Test the generation of triples by using IRI value in elements"

+

Error expected? No

+

Input

+
<?xml version="1.0"?>
+
+<students>
+  <student><Name>http://example.com/company/Alice</Name></student>
+  <student><Name>Bob</Name></student>
+  <student><Name>Bob/Charles</Name></student>
+  <student><Name>path/../Danny</Name></student>
+  <student><Name>Emily Smith</Name></student>
+</students>
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "/students/student";
+      rml:referenceFormulation rml:XPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.xml"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:object foaf:Person;
+      rml:predicate rdf:type
+    ];
+  rml:subjectMap [
+      rml:template "{Name}";
+      rml:termType rml:IRI
+    ] .
+
+

Output

+
<http://example.com/base/http%3A%2F%2Fexample.com%2Fcompany%2FAlice> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/base/Bob> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/base/Bob%2FCharles> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/base/path%2F..%2FDanny> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/base/Emily%20Smith> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+
+
+

317. RMLTC0021a-CSV

+

Title: "Generation of triples referencing object map"

+

Description: "Tests the mapping specification referencing object map with same logical source and join condition"

+

Error expected? No

+

Input

+
ID,Name,Sport
+10,Venus Williams,Tennis
+20,Serena Williams,Tennis
+30,Loena Hendrickx,Figure skating
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/RefObjectMap1> a rml:RefObjectMap;
+  rml:joinCondition [
+      rml:child "Sport";
+      rml:parent "Sport"
+    ];
+  rml:parentTriplesMap <http://example.com/base/TriplesMap1> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:referenceFormulation rml:CSV;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.csv"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap <http://example.com/base/RefObjectMap1>;
+      rml:predicate ex:sameSportAs
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Student/{ID}/{Name}"
+    ] .
+
+

Output

+
<http://example.com/Student/10/Venus%20Williams> <http://example.com/sameSportAs> <http://example.com/Student/10/Venus%20Williams> . 
+<http://example.com/Student/10/Venus%20Williams> <http://example.com/sameSportAs> <http://example.com/Student/20/Serena%20Williams> . 
+<http://example.com/Student/20/Serena%20Williams> <http://example.com/sameSportAs> <http://example.com/Student/20/Serena%20Williams> . 
+<http://example.com/Student/20/Serena%20Williams> <http://example.com/sameSportAs> <http://example.com/Student/10/Venus%20Williams> . 
+<http://example.com/Student/30/Loena%20Hendrickx> <http://example.com/sameSportAs> <http://example.com/Student/30/Loena%20Hendrickx> . 
+
+
+
+
+

318. RMLTC0021a-JSON

+

Title: "Generation of triples referencing object map"

+

Description: "Tests the mapping specification referencing object map with same logical source and join condition"

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "Name":"Venus Williams",
+    "Sport": "Tennis"
+  }, {
+    "ID": 20,
+    "Name":"Serena Williams",
+    "Sport": "Tennis"
+  }, {
+    "ID": 30,
+    "Name":"Loena Hendrickx",
+    "Sport": "Figure skating"
+  }]
+}
+
+

Mapping

+
@prefix activity: <http://example.com/activity/> .
+@prefix ex: <http://example.com/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/RefObjectMap1> a rml:RefObjectMap;
+  rml:joinCondition [
+      rml:child "$.Sport";
+      rml:parent "$.Sport"
+    ];
+  rml:parentTriplesMap <http://example.com/base/TriplesMap1> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap <http://example.com/base/RefObjectMap1>;
+      rml:predicate ex:sameSportAs
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Student/{$.ID}/{$.Name}"
+    ] .
+
+

Output

+
<http://example.com/Student/10/Venus%20Williams> <http://example.com/sameSportAs> <http://example.com/Student/10/Venus%20Williams> . 
+<http://example.com/Student/10/Venus%20Williams> <http://example.com/sameSportAs> <http://example.com/Student/20/Serena%20Williams> . 
+<http://example.com/Student/20/Serena%20Williams> <http://example.com/sameSportAs> <http://example.com/Student/20/Serena%20Williams> . 
+<http://example.com/Student/20/Serena%20Williams> <http://example.com/sameSportAs> <http://example.com/Student/10/Venus%20Williams> . 
+<http://example.com/Student/30/Loena%20Hendrickx> <http://example.com/sameSportAs> <http://example.com/Student/30/Loena%20Hendrickx> . 
+
+
+
+
+

319. RMLTC0021a-MySQL

+

Title: "Generation of triples referencing object map"

+

Description: "Tests the mapping specification referencing object map with same logical source and join condition"

+

Error expected? No

+

Input

+
USE test;
+DROP TABLE IF EXISTS test.student;
+
+CREATE TABLE student (
+  ID INTEGER,
+  Name VARCHAR(50),
+  Sport VARCHAR(50)
+);
+INSERT INTO student values ('10', 'Venus Williams', 'Tennis');
+INSERT INTO student values ('20', 'Serena Williams', 'Tennis');
+INSERT INTO student values ('30', 'Loena Hendrickx', 'Figure skating');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
+  d2rq:password "";
+  d2rq:username "root" .
+
+<http://example.com/base/RefObjectMap1> a rml:RefObjectMap;
+  rml:joinCondition [
+      rml:child "Sport";
+      rml:parent "Sport"
+    ];
+  rml:parentTriplesMap <http://example.com/base/TriplesMap1> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "student"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap <http://example.com/base/RefObjectMap1>;
+      rml:predicate ex:sameSportAs
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Student/{ID}/{Name}"
+    ] .
+
+

Output

+
<http://example.com/Student/10/Venus%20Williams> <http://example.com/sameSportAs> <http://example.com/Student/10/Venus%20Williams> . 
+<http://example.com/Student/10/Venus%20Williams> <http://example.com/sameSportAs> <http://example.com/Student/20/Serena%20Williams> . 
+<http://example.com/Student/20/Serena%20Williams> <http://example.com/sameSportAs> <http://example.com/Student/20/Serena%20Williams> . 
+<http://example.com/Student/20/Serena%20Williams> <http://example.com/sameSportAs> <http://example.com/Student/10/Venus%20Williams> . 
+<http://example.com/Student/30/Loena%20Hendrickx> <http://example.com/sameSportAs> <http://example.com/Student/30/Loena%20Hendrickx> . 
+
+
+
+
+

320. RMLTC0021a-PostgreSQL

+

Title: "Generation of triples referencing object map"

+

Description: "Tests the mapping specification referencing object map with same logical source and join condition"

+

Error expected? No

+

Input

+
DROP TABLE IF EXISTS student;
+
+CREATE TABLE student (
+  "ID" INTEGER,
+  "Name" VARCHAR(50),
+  "Sport" VARCHAR(50)
+);
+INSERT INTO student values ('10', 'Venus Williams', 'Tennis');
+INSERT INTO student values ('20', 'Serena Williams', 'Tennis');
+INSERT INTO student values ('30', 'Loena Hendrickx', 'Figure skating');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "org.postgresql.Driver";
+  d2rq:password "";
+  d2rq:username "postgres" .
+
+<http://example.com/base/RefObjectMap1> a rml:RefObjectMap;
+  rml:joinCondition [
+      rml:child "Sport";
+      rml:parent "Sport"
+    ];
+  rml:parentTriplesMap <http://example.com/base/TriplesMap1> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "student"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap <http://example.com/base/RefObjectMap1>;
+      rml:predicate ex:sameSportAs
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Student/{ID}/{Name}"
+    ] .
+
+

Output

+
<http://example.com/Student/10/Venus%20Williams> <http://example.com/sameSportAs> <http://example.com/Student/10/Venus%20Williams> . 
+<http://example.com/Student/10/Venus%20Williams> <http://example.com/sameSportAs> <http://example.com/Student/20/Serena%20Williams> . 
+<http://example.com/Student/20/Serena%20Williams> <http://example.com/sameSportAs> <http://example.com/Student/20/Serena%20Williams> . 
+<http://example.com/Student/20/Serena%20Williams> <http://example.com/sameSportAs> <http://example.com/Student/10/Venus%20Williams> . 
+<http://example.com/Student/30/Loena%20Hendrickx> <http://example.com/sameSportAs> <http://example.com/Student/30/Loena%20Hendrickx> . 
+
+
+
+
+

321. RMLTC0021a-SPARQL

+

Title: "Generation of triples referencing object map"

+

Description: "Tests the mapping specification referencing object map with same logical source and join condition"

+

Error expected? No

+

Input

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix ns1: <http://example.com/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+
+[] ns1:plays [ a ns1:Sport ;
+            foaf:name "Tennis" ] ;
+    rdf:ID "10" ;
+    foaf:name "Venus Williams" .
+
+[] ns1:plays [ a ns1:Sport ;
+            foaf:name "Tennis" ] ;
+    rdf:ID "20" ;
+    foaf:name "Serena Williams" .
+
+[] ns1:plays [ a ns1:Sport ;
+            foaf:name "Figure skating" ] ;
+    rdf:ID "30" ;
+    foaf:name "Loena Hendrickx" .
+
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix sd: <http://www.w3.org/ns/sparql-service-description#> .
+
+ex:RefObjectMap1 a rml:RefObjectMap;
+  rml:joinCondition [
+      rml:child "Sport.value";
+      rml:parent "Sport.value"
+    ];
+  rml:parentTriplesMap ex:TriplesMap1 .
+
+ex:TriplesMap1 a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator """
+            PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
+            PREFIX foaf: <http://xmlns.com/foaf/0.1/>
+            PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
+            SELECT ?Name ?ID
+            WHERE {
+                ?x  foaf:name ?Name ;
+                    rdf:ID    ?ID ;
+            } """;
+      rml:referenceFormulation formats:SPARQL_Results_JSON;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path <http://example.com/base#InputSPARQL>
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap ex:RefObjectMap1;
+      rml:predicate ex:sameSportAs
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Student/{ID.value}/{Name.value}"
+    ] .
+
+<http://example.com/base#InputSPARQL> a sd:Service;
+  sd:endpoint <http://HOST:PORT/ds1/sparql>;
+  sd:supportedLanguage sd:SPARQL11Query .
+
+

Output

+
<http://example.com/Student/10/Venus%20Williams> <http://example.com/sameSportAs> <http://example.com/Student/10/Venus%20Williams> . 
+<http://example.com/Student/10/Venus%20Williams> <http://example.com/sameSportAs> <http://example.com/Student/20/Serena%20Williams> . 
+<http://example.com/Student/20/Serena%20Williams> <http://example.com/sameSportAs> <http://example.com/Student/20/Serena%20Williams> . 
+<http://example.com/Student/20/Serena%20Williams> <http://example.com/sameSportAs> <http://example.com/Student/10/Venus%20Williams> . 
+<http://example.com/Student/30/Loena%20Hendrickx> <http://example.com/sameSportAs> <http://example.com/Student/30/Loena%20Hendrickx> . 
+
+
+
+
+

322. RMLTC0021a-SQLServer

+

Title: "Generation of triples referencing object map"

+

Description: "Tests the mapping specification referencing object map with same logical source and join condition"

+

Error expected? No

+

Input

+
USE TestDB;
+DROP TABLE IF EXISTS student;
+CREATE TABLE student (
+  "ID" INTEGER,
+  "Name" VARCHAR(50),
+  "Sport" VARCHAR(50)
+);
+INSERT INTO student values ('10', 'Venus Williams', 'Tennis');
+INSERT INTO student values ('20', 'Serena Williams', 'Tennis');
+INSERT INTO student values ('30', 'Loena Hendrickx', 'Figure skating');
+
+

Mapping

+
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/#DB_source> a d2rq:Database;
+  d2rq:jdbcDSN "CONNECTIONDSN";
+  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
+  d2rq:password "YourSTRONG!Passw0rd;";
+  d2rq:username "sa" .
+
+<http://example.com/base/RefObjectMap1> a rml:RefObjectMap;
+  rml:joinCondition [
+      rml:child "Sport";
+      rml:parent "Sport"
+    ];
+  rml:parentTriplesMap <http://example.com/base/TriplesMap1> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [
+      rml:source <http://example.com/base/#DB_source>;
+      rml:referenceFormulation rml:SQL2008Table;
+      rml:iterator "student"
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap <http://example.com/base/RefObjectMap1>;
+      rml:predicate ex:sameSportAs
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Student/{ID}/{Name}"
+    ] .
+
+

Output

+
<http://example.com/Student/10/Venus%20Williams> <http://example.com/sameSportAs> <http://example.com/Student/10/Venus%20Williams> . 
+<http://example.com/Student/10/Venus%20Williams> <http://example.com/sameSportAs> <http://example.com/Student/20/Serena%20Williams> . 
+<http://example.com/Student/20/Serena%20Williams> <http://example.com/sameSportAs> <http://example.com/Student/20/Serena%20Williams> . 
+<http://example.com/Student/20/Serena%20Williams> <http://example.com/sameSportAs> <http://example.com/Student/10/Venus%20Williams> . 
+<http://example.com/Student/30/Loena%20Hendrickx> <http://example.com/sameSportAs> <http://example.com/Student/30/Loena%20Hendrickx> . 
+
+
+
+
+

323. RMLTC0021a-XML

+

Title: "Generation of triples referencing object map"

+

Description: "Tests the mapping specification referencing object map with same logical source and join condition"

+

Error expected? No

+

Input

+
<?xml version="1.0"?>
+
+<students>
+  <student>
+    <ID>10</ID>
+    <Name>Venus Williams</Name>
+    <Sport>Tennis</Sport>
+  </student>
+  <student>
+    <ID>20</ID>
+    <Name>Serena Williams</Name>
+    <Sport>Tennis</Sport>
+  </student>
+  <student>
+    <ID>30</ID>
+    <Name>Loena Hendrickx</Name>
+    <Sport>Figure skating</Sport>
+  </student>
+</students>
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/RefObjectMap1> a rml:RefObjectMap;
+  rml:joinCondition [
+      rml:child "Sport";
+      rml:parent "Sport"
+    ];
+  rml:parentTriplesMap <http://example.com/base/TriplesMap1> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "/students/student";
+      rml:referenceFormulation rml:XPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.xml"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap <http://example.com/base/RefObjectMap1>;
+      rml:predicate ex:sameSportAs
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Student/{ID}/{Name}"
+    ] .
+
+

Output

+
<http://example.com/Student/10/Venus%20Williams> <http://example.com/sameSportAs> <http://example.com/Student/10/Venus%20Williams> . 
+<http://example.com/Student/10/Venus%20Williams> <http://example.com/sameSportAs> <http://example.com/Student/20/Serena%20Williams> . 
+<http://example.com/Student/20/Serena%20Williams> <http://example.com/sameSportAs> <http://example.com/Student/20/Serena%20Williams> . 
+<http://example.com/Student/20/Serena%20Williams> <http://example.com/sameSportAs> <http://example.com/Student/10/Venus%20Williams> . 
+<http://example.com/Student/30/Loena%20Hendrickx> <http://example.com/sameSportAs> <http://example.com/Student/30/Loena%20Hendrickx> . 
+
+
+
+
+

324. RMLTC0022a-CSV

+

Title: "Generating of triples with constant datatype"

+

Description: "Test triples with a fixed constant datatype"

+

Error expected? No

+

Input

+
Name,Age
+Venus,21
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:referenceFormulation rml:CSV;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.csv"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:datatype xsd:string;
+          rml:reference "Name"
+        ];
+      rml:predicate foaf:name
+    ], [
+      rml:objectMap [
+          rml:datatype xsd:int;
+          rml:reference "Age"
+        ];
+      rml:predicate ex:age
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{Name}"
+    ] .
+
+

Output

+
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "Venus"^^<http://www.w3.org/2001/XMLSchema#string> .
+<http://example.com/Venus> <http://example.com/age> "21"^^<http://www.w3.org/2001/XMLSchema#int> .
+
+
+

325. RMLTC0022b-CSV

+

Title: "Generating of triples with datatypeMap"

+

Description: "Test triples with a XSD datatype generated from the data"

+

Error expected? No

+

Input

+
FOO,BAR
+1,string
+2,int
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:referenceFormulation rml:CSV;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "data.csv"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:datatypeMap [
+              rml:template "http://www.w3.org/2001/XMLSchema#{BAR}"
+            ];
+          rml:reference "FOO"
+        ];
+      rml:predicate ex:x
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{FOO}"
+    ] .
+
+

Output

+
<http://example.com/1> <http://example.com/x> "1"^^<http://www.w3.org/2001/XMLSchema#string> .
+<http://example.com/2> <http://example.com/x> "2"^^<http://www.w3.org/2001/XMLSchema#int> .
+
+
+

326. RMLTC0022c-CSV

+

Title: "Generating of triples with datatypeMap with custom datatype"

+

Description: "Test triples with a custom datype from the data"

+

Error expected? No

+

Input

+
FOO,BAR
+1,string
+2,int
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:referenceFormulation rml:CSV;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "data.csv"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:datatypeMap [
+              rml:template "datatype#{BAR}"
+            ];
+          rml:reference "FOO"
+        ];
+      rml:predicate ex:x
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{FOO}"
+    ] .
+
+

Output

+
<http://example.com/1> <http://example.com/x> "1"^^<http://example.com/base/datatype#string> .
+<http://example.com/2> <http://example.com/x> "2"^^<http://example.com/base/datatype#int> .
+
+
+

327. RMLTC0023a-XML

+

Title: "XML attributes selection"

+

Description: "Test generation of triples with selected XML attributes"

+

Error expected? No

+

Input

+
<?xml version="1.0"?>
+
+<persons>
+  <person fname="Bob" lname="Smith" amount="30.0E0">
+  </person>
+  <person fname="Sue" lname="Jones" amount="20.0E0">
+  </person>
+  <person fname="Bob" lname="Smith" amount="30.0E0">
+  </person>
+</persons>
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "/persons/person";
+      rml:referenceFormulation rml:XPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "ious.xml"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "@amount"
+        ];
+      rml:predicate ex:owes
+    ];
+  rml:subjectMap [
+      rml:class foaf:Person;
+      rml:template "http://example.com/{@fname};{@lname}"
+    ] .
+
+

Output

+
<http://example.com/Bob;Smith> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Bob;Smith> <http://example.com/owes> "30.0E0" .
+<http://example.com/Sue;Jones> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Sue;Jones> <http://example.com/owes> "20.0E0" .
+
+
+
+

328. RMLTC0024a-CSV

+

Title: "Invalid IRI template 1"

+

Description: "Test handling of invalid IRI template"

+

Error expected? Yes

+

Input

+
Name
+Venus
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:referenceFormulation rml:CSV;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.csv"
+        ]
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{NON_EXISTING_COLUMN}"
+      rml:class foaf:Person;
+    ] .
+
+
+

329. RMLTC0024b-CSV

+

Title: "Invalid IRI template 2"

+

Description: "Test handling of invalid IRI template"

+

Error expected? Yes

+

Input

+
{Name}
+Venus
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:referenceFormulation rml:CSV;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.csv"
+        ]
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{{Name}}"
+      rml:class foaf:Person;
+    ] .
+
+
+

330. RMLTC0024c-CSV

+

Title: "Invalid IRI template 3"

+

Description: "Test handling of invalid IRI template"

+

Error expected? Yes

+

Input

+
N\ame
+Venus
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:referenceFormulation rml:CSV;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.csv"
+        ]
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{N\ame}"
+      rml:class foaf:Person;
+    ] .
+
+
+

331. RMLTC0024d-CSV

+

Title: "Invalid IRI template 4"

+

Description: "Test handling of invalid IRI template"

+

Error expected? Yes

+

Input

+
Name
+Venus
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:referenceFormulation rml:CSV;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.csv"
+        ]
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{Name\}"
+      rml:class foaf:Person;
+    ] .
+
+
+

332. RMLTC0024e-CSV

+

Title: "Invalid IRI template 5"

+

Description: "Test handling of invalid IRI template"

+

Error expected? No

+

Input

+
{Name}
+Venus
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:referenceFormulation rml:CSV;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.csv"
+        ]
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{\\{Name\\}}";
+      rml:class foaf:Person;
+    ] .
+
+

Output

+
<http://example.com/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+
+
+
+

333. RMLTC0024f-CSV

+

Title: "Invalid IRI template 6"

+

Description: "Test handling of invalid IRI template"

+

Error expected? No

+

Input

+
N\ame
+Venus
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:referenceFormulation rml:CSV;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.csv"
+        ]
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{N\\\ame}";
+      rml:class foaf:Person;
+    ] .
+
+

Output

+
<http://example.com/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+
+
+
+ + + + + \ No newline at end of file diff --git a/src/test/resources/rml-core/docs/20250217/index.html b/src/test/resources/rml-core/docs/20250217/index.html new file mode 100644 index 00000000..128b077d --- /dev/null +++ b/src/test/resources/rml-core/docs/20250217/index.html @@ -0,0 +1,2988 @@ + + + + + + +RML-Core: Test Cases + + + + + + + + + + + + + + +
+ +

RML-Core: Test Cases

+

+ Draft Community Group Report + +

+
+ +
Latest published version:
+ https://www.w3.org/RML-Core-Testcases/ +
+
Latest editor's draft:
https://w3id.org/rml/core/test-cases/
+ + + + +
Editor:
+ Dylan Van Assche + + + + (IDLab – Ghent University – imec) +
+ +
Author:
+ Dylan Van Assche + + + + (IDLab – Ghent University – imec) +
+
Feedback:
+ GitHub kg-construct/rml-core + (pull requests, + new issue, + open issues) +
+ +
+ + +
+
+ + + +

Abstract

This document defines the RML-Core test cases to the determine the RML-Core specification conformance of tools.

+
+ +

Status of This Document

+ This specification was published by the + Knowledge Graph Construction Community Group. It is not a W3C Standard nor is it + on the W3C Standards Track. + + Please note that under the + W3C Community Contributor License Agreement (CLA) + there is a limited opt-out and other conditions apply. + + Learn more about + W3C Community and Business Groups. +

+ GitHub Issues are preferred for + discussion of this specification. + + +

+ +

1. Introduction

+

This document defines the RML-Core test cases, consisting of a collection of test case documents (input and expected output). +The purpose of the test cases is to determine the conformance of tools that execute RML rules to the RML-Core specification.

+
+ +

2. Data model

+

The test cases are semantically described for re-usability and shareability following the W3C Test case description. +Each test:Testcase as the following properties:

+
    +
  • dcterms:identifier: unique ID of the test case.
  • +
  • rmltest:hasError: if an error of the RML Processor is expected or not.
  • +
  • rmltest:input: One or more input data of the test case.
  • +
  • rmltest:output: One or more output data of the test case.
  • +
  • rmltest:inputFormat: the input data format.
  • +
  • rmltest:outputFormat: the output data format.
  • +
  • rmltest:mappingDocument: the RML mapping rules in Turtle.
  • +
+
+ +

3. Test cases

+

This section describes the RML-Core test cases. These descriptions are also available as RDF. +The files are available on GitHub in the folder test-cases. +Each test case is contained in a single folder, containing three types of files:

+
    +
  • Zero or more files containing the data sources, in the case of JSON, XML, CSV, or containing the SQL statements to create the necessary tables, in the case of MySQL, PostgreSQL, and SQL Server.
  • +
  • One file with the RML rules, called mapping.ttl, in the Turtle format.
  • +
  • Zero or more files with the expected RDF. No file is provided if an error is expected that must halt the generation of the RDF because of an error.
  • +
+
+ + +

4. RMLTC0000-JSON

+

Title: "one table, one column, zero rows"

+

Description: "Tests if an empty table produces an empty RDF graph"

+

Error expected? No

+

Input

+
{
+  "students": []
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.Name"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{$.Name}"
+    ] .
+
+

Output

+
# empty database
+
+
+

5. RMLTC0001a-JSON

+

Title: "One column mapping, subject URI generation by using rml:template"

+

Description: "Tests: (1) one column mapping; (2) subject URI generation by using rml:template; (3) one column to one property"

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "Name":"Venus"
+  }]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.Name"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap <http://example.com/base/#NameSubjectMap> .
+
+<http://example.com/base/#NameSubjectMap> rml:template "http://example.com/{$.Name}" .
+
+

Output

+
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
+
+
+
+

6. RMLTC0001b-JSON

+

Title: "One column mapping, generation of a BlankNode subject by using rml:termType"

+

Description: "Tests: (1) one column mapping; (2) generation of a BlankNode subject by using rml:termType; (3) one column to one property"

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "Name":"Venus"
+  }]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.Name"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "{$.Name}";
+      rml:termType rml:BlankNode
+    ] .
+
+

Output

+
_:Venus <http://xmlns.com/foaf/0.1/name> "Venus" .
+
+
+
+

7. RMLTC0002a-JSON

+

Title: "Two columns mapping, generation of a subject URI by the concatenation of two column values"

+

Description: "Tests: (1) two column mapping, no primary key; (2) subject URI generated by the concatenation of two column values; (3) one column to one property"

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "Name":"Venus"
+  }]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.ID"
+        ];
+      rml:predicate ex:id
+    ], [
+      rml:objectMap [
+          rml:reference "$.Name"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:class foaf:Person;
+      rml:template "http://example.com/{$.ID}/{$.Name}"
+    ] .
+
+

Output

+
<http://example.com/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
+<http://example.com/10/Venus> <http://example.com/id> "10" .
+<http://example.com/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+
+
+
+

8. RMLTC0002b-JSON

+

Title: "Two columns mapping, generation of a BlankNode subject by using rml:template and rml:termType"

+

Description: "Tests: (1) two column mapping, no primary key; (2) generation of a BlankNode subject by using rml:template; (3) one column to one property"

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "Name":"Venus"
+  }]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.Name"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "students{$.ID}";
+      rml:termType rml:BlankNode
+    ] .
+
+

Output

+
_:students10 <http://xmlns.com/foaf/0.1/name> "Venus" .
+
+
+
+

9. RMLTC0002e-JSON

+

Title: "Two columns mapping, an undefined rml:path"

+

Description: "Tests the presence of an undefined rml:path"

+

Error expected? Yes

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "Name":"Venus"
+  }]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student2.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.IDs"
+        ];
+      rml:predicate ex:id
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{$.ID}/{$.Name}"
+    ] .
+
+
+

10. RMLTC0002g-JSON

+

Title: "Two columns mapping, invalid JSONPath"

+

Description: "Test the presence of an invalid JSONPath"

+

Error expected? Yes

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "Name":"Venus"
+  }]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student2.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.IDs"
+        ];
+      rml:predicate ex:id
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{$.ID}/{$.Name}"
+    ] .
+
+
+

11. RMLTC0003c-JSON

+

Title: "Three columns mapping, by using a rml:template to produce literal"

+

Description: "Tests: (1) three column mapping; and (2) the use of rml:template to produce literal"

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "FirstName":"Venus",
+    "LastName":"Williams"
+  }]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:template "{$.FirstName} {$.LastName}";
+          rml:termType rml:Literal
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Student{$.ID}"
+    ] .
+
+

Output

+
<http://example.com/Student10> <http://xmlns.com/foaf/0.1/name> "Venus Williams" .
+
+
+

12. RMLTC0004a-JSON

+

Title: "Two column mapping, from one row table to two different triples"

+

Description: "Tests: (1) two column mapping, (2) subject URI generated by a column value; (3) from one row table to two different triples (4) typing by using rml:class"

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "Student": "Venus",
+    "Sport":"Tennis"
+  }]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student_sport.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.Student"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:class ex:Student;
+      rml:template "http://example.com/{$.Student}"
+    ] .
+
+<http://example.com/base/TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student_sport.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.Sport"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:class ex:Sport;
+      rml:template "http://example.com/{$.Sport}"
+    ] .
+
+

Output

+
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
+<http://example.com/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/Student> .
+<http://example.com/Tennis> <http://xmlns.com/foaf/0.1/name> "Tennis" .
+<http://example.com/Tennis> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/Sport> .
+
+
+
+

13. RMLTC0004b-JSON

+

Title: "One column mapping, presence of rml:termType rml:Literal on rml:subjectMap"

+

Description: "Tests: (1) one column mapping (2) the presence of rml:termType rml:Literal on rml:subjectMap, which is invalid"

+

Error expected? Yes

+

Input

+
{
+  "students": [{
+    "Name":"Venus"
+  }]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.Name"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{$.Name}";
+      rml:termType rml:Literal
+    ] .
+
+
+

14. RMLTC0005a-JSON

+

Title: "Typing of resources"

+

Description: "Tests the typing of resources"

+

Error expected? No

+

Input

+
{
+  "persons": [
+    {
+      "fname": "Bob",
+      "lname": "Smith",
+      "amount": "30.0E0"
+    },
+    {
+      "fname": "Sue",
+      "lname": "Jones",
+      "amount": "20.0E0"
+    },
+    {
+      "fname": "Bob",
+      "lname": "Smith",
+      "amount": "30.0E0"
+    }
+  ]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.persons[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "ious.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.amount"
+        ];
+      rml:predicate ex:owes
+    ];
+  rml:subjectMap [
+      rml:class foaf:Person;
+      rml:template "http://example.com/{$.fname};{$.lname}"
+    ] .
+
+

Output

+
<http://example.com/Bob;Smith> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Bob;Smith> <http://example.com/owes> "30.0E0" .
+<http://example.com/Sue;Jones> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Sue;Jones> <http://example.com/owes> "20.0E0" .
+
+
+
+

15. RMLTC0006a-JSON

+

Title: "Use of rml:constant in rml:subjectMap, rml:predicateMap, rml:objectMap and rml:graphMap"

+

Description: "Tests the use of rml:constant in rml:subjectMap, rml:predicateMap, rml:objectMap and rml:graphMap"

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "FirstName":"Venus",
+    "LastName":"Williams"
+  }]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:constant "Bad Student"
+        ];
+      rml:predicateMap [
+          rml:constant ex:description
+        ]
+    ];
+  rml:subjectMap [
+      rml:constant ex:BadStudent;
+      rml:graphMap [
+          rml:constant <http://example.com/graph/student>
+        ]
+    ] .
+
+

Output

+
<http://example.com/BadStudent> <http://example.com/description> "Bad Student" <http://example.com/graph/student> .
+
+
+

16. RMLTC0007a-JSON

+

Title: "Typing resources by relying on rdf:type predicate"

+

Description: "Tests the typing resources by relying on rdf:type predicate"

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "FirstName":"Venus",
+    "LastName":"Williams"
+  }]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:object foaf:Person;
+      rml:predicate rdf:type
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Student/{$.ID}/{$.FirstName}"
+    ] .
+
+

Output

+
 <http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+
+
+
+

17. RMLTC0007b-JSON

+

Title: "Assigning triples to Named Graphs"

+

Description: "Tests the generation of triples to a named graph"

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "FirstName":"Venus",
+    "LastName":"Williams"
+  }]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:object foaf:Person;
+      rml:predicate rdf:type
+    ], [
+      rml:objectMap [
+          rml:reference "$.FirstName"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:graph ex:PersonGraph;
+      rml:template "http://example.com/Student/{$.ID}/{$.FirstName}"
+    ] .
+
+

Output

+
<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" <http://example.com/PersonGraph> . 
+<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person>  <http://example.com/PersonGraph> .
+
+
+
+

18. RMLTC0007c-JSON

+

Title: "One row mapping, using rml:class"

+

Description: "Tests subjectmap with more than one class IRIs, rml:class"

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "FirstName":"Venus",
+    "LastName":"Williams"
+  }]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.ID"
+        ];
+      rml:predicate ex:id
+    ], [
+      rml:objectMap [
+          rml:reference "$.FirstName"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:class ex:Student, foaf:Person;
+      rml:template "http://example.com/Student/{$.ID}/{$.FirstName}"
+    ] .
+
+

Output

+
<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
+<http://example.com/Student/10/Venus> <http://example.com/id> "10" . 
+<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/Student> .
+
+
+
+

19. RMLTC0007d-JSON

+

Title: "One column mapping, specifying an rml:predicateObjectMap with rdf:type"

+

Description: "Tests subjectmap with an alternative of having rml:class, i.e., by specifying an rml:predicateObjectMap with predicate rdf:type"

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "FirstName":"Venus",
+    "LastName":"Williams"
+  }]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:object foaf:Person;
+      rml:predicate rdf:type
+    ], [
+      rml:object ex:Student;
+      rml:predicate rdf:type
+    ], [
+      rml:objectMap [
+          rml:reference "$.ID"
+        ];
+      rml:predicate ex:id
+    ], [
+      rml:objectMap [
+          rml:reference "$.FirstName"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Student/{$.ID}/{$.FirstName}"
+    ] .
+
+

Output

+
<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" . 
+<http://example.com/Student/10/Venus> <http://example.com/id> "10" .
+<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/Student> .
+
+
+
+

20. RMLTC0007e-JSON

+

Title: "One column mapping, using rml:graphMap and rml:class"

+

Description: "Tests subjectmap with rml:graphMap and rml:class"

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "Name":"Venus"
+  }]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.ID"
+        ];
+      rml:predicate ex:id
+    ], [
+      rml:objectMap [
+          rml:reference "$.Name"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:class foaf:Person;
+      rml:graph ex:PersonGraph;
+      rml:template "http://example.com/Student/{$.ID}/{$.Name}"
+    ] .
+
+

Output

+
<http://example.com/Student/10/Venus> <http://example.com/id> "10" <http://example.com/PersonGraph> .
+<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" <http://example.com/PersonGraph> .
+<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> <http://example.com/PersonGraph> .
+
+
+
+

21. RMLTC0007f-JSON

+

Title: "One column mapping, using rml:graphMap and specifying an rml:predicateObjectMap with rdf:type"

+

Description: "Tests subjectmap with rml:graphMap and specifying an rml:predicateObjectMap with predicate rdf:type"

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "FirstName":"Venus",
+    "LastName":"Williams"
+  }]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:object foaf:Person;
+      rml:predicate rdf:type
+    ], [
+      rml:objectMap [
+          rml:reference "$.ID"
+        ];
+      rml:predicate ex:id
+    ], [
+      rml:objectMap [
+          rml:reference "$.FirstName"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:graph ex:PersonGraph;
+      rml:template "http://example.com/Student/{$.ID}/{$.FirstName}"
+    ] .
+
+

Output

+
<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> <http://example.com/PersonGraph> .
+<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" <http://example.com/PersonGraph> .
+<http://example.com/Student/10/Venus> <http://example.com/id> "10" <http://example.com/PersonGraph> .
+
+
+
+

22. RMLTC0007g-JSON

+

Title: "Assigning triples to the default graph"

+

Description: "Tests the generation of triples to the default graph"

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "FirstName":"Venus",
+    "LastName":"Williams"
+  }]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.FirstName"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:graph rml:defaultGraph;
+      rml:template "http://example.com/Student/{$.ID}/{$.FirstName}"
+    ] .
+
+

Output

+
<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
+
+
+
+

23. RMLTC0007h-JSON

+

Title: "Assigning triples to a non-IRI named graph"

+

Description: "Tests the generation of triples to a non-IRI named graph, which is an error"

+

Error expected? Yes

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "FirstName":"Venus",
+    "LastName":"Williams"
+  }]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.Name"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:graphMap [
+          rml:reference "$.Name";
+          rml:termType rml:Literal
+        ];
+      rml:template "http://example.com/Student/{$.ID}/{$.FirstName}"
+    ] .
+
+
+

24. RMLTC0008a-JSON

+

Title: "Generation of triples to a target graph by using rml:graphMap and rml:template"

+

Description: "Test that results of the mapping can be directed to a target graph by using rml:graphMap and rml:template"

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "Name":"Venus Williams",
+    "Sport": "Tennis"
+  }]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:object foaf:Person;
+      rml:predicate rdf:type
+    ], [
+      rml:objectMap [
+          rml:reference "$.ID"
+        ];
+      rml:predicate ex:id
+    ], [
+      rml:objectMap [
+          rml:reference "$.Name"
+        ];
+      rml:predicate foaf:name
+    ], [
+      rml:objectMap [
+          rml:reference "$.Sport"
+        ];
+      rml:predicate ex:Sport
+    ];
+  rml:subjectMap [
+      rml:graphMap [
+          rml:template "http://example.com/graph/Student/{$.ID}/{$.Name}"
+        ];
+      rml:template "http://example.com/Student/{$.ID}/{$.Name}"
+    ] .
+
+

Output

+
<http://example.com/Student/10/Venus%20Williams> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> <http://example.com/graph/Student/10/Venus%20Williams> .
+<http://example.com/Student/10/Venus%20Williams> <http://xmlns.com/foaf/0.1/name> "Venus Williams" <http://example.com/graph/Student/10/Venus%20Williams> .
+<http://example.com/Student/10/Venus%20Williams> <http://example.com/id> "10" <http://example.com/graph/Student/10/Venus%20Williams> . 
+<http://example.com/Student/10/Venus%20Williams> <http://example.com/Sport> "Tennis" <http://example.com/graph/Student/10/Venus%20Williams> . 
+
+
+
+

25. RMLTC0008b-JSON

+

Title: "Generation of triples referencing object map"

+

Description: "Tests the mapping specification referencing object map without join"

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "Name":"Venus Williams",
+    "Sport": "Tennis"
+  }]
+}
+
+

Mapping

+
@prefix activity: <http://example.com/activity/> .
+@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap <http://example.com/base/RefObjectMap1>;
+      rml:predicate ex:Sport
+    ], [
+      rml:object foaf:Person;
+      rml:predicate rdf:type
+    ], [
+      rml:objectMap [
+          rml:reference "$.ID"
+        ];
+      rml:predicate ex:id
+    ], [
+      rml:objectMap [
+          rml:reference "$.Name"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Student/{$.ID}/{$.Name}"
+    ] .
+
+<http://example.com/base/RefObjectMap1> a rml:RefObjectMap;
+  rml:parentTriplesMap <http://example.com/base/TriplesMap2> .
+
+<http://example.com/base/TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:object activity:Sport;
+      rml:predicate rdf:type
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{$.Sport}"
+    ] .
+
+

Output

+
<http://example.com/Student/10/Venus%20Williams> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person>  .
+<http://example.com/Student/10/Venus%20Williams> <http://xmlns.com/foaf/0.1/name> "Venus Williams" .
+<http://example.com/Student/10/Venus%20Williams> <http://example.com/id> "10" . 
+<http://example.com/Student/10/Venus%20Williams> <http://example.com/Sport> <http://example.com/Tennis> . 
+<http://example.com/Tennis> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/activity/Sport> .
+
+
+
+
+

26. RMLTC0008c-JSON

+

Title: "Generation of triples by using multiple predicateMaps within a rml:predicateObjectMap"

+

Description: "Tests the generation of triples by using multiple predicateMaps within a rml:predicateObjectMap"

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "Name":"Venus Williams",
+    "Sport": "Tennis"
+  }]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.Name"
+        ];
+      rml:predicate ex:name, foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Student/{$.ID}/{$.Name}"
+    ] .
+
+

Output

+
<http://example.com/Student/10/Venus%20Williams> <http://xmlns.com/foaf/0.1/name> "Venus Williams"  .
+<http://example.com/Student/10/Venus%20Williams> <http://example.com/name> "Venus Williams"  .
+
+
+
+

27. RMLTC0009a-JSON

+

Title: "Generation of triples from foreign key relations"

+

Description: "Test foreign key relationships among logical tables"

+

Error expected? No

+

Input

+
{
+  "students" : [
+    { 
+      "ID": 10,
+      "Sport": 100,
+      "Name": "Venus Williams"
+    },
+    { 
+      "ID": 20,
+      "Name": "Demi Moore"
+    }
+  ]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.Name"
+        ];
+      rml:predicate foaf:name
+    ], [
+      rml:objectMap [ a rml:RefObjectMap;
+          rml:joinCondition [
+              rml:child "$.Sport";
+              rml:parent "$.ID"
+            ];
+          rml:parentTriplesMap <http://example.com/base/TriplesMap2>
+        ];
+      rml:predicate <http://example.com/ontology/practises>
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/resource/student_{$.ID}"
+    ] .
+
+<http://example.com/base/TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.sports[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "sport.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.Name"
+        ];
+      rml:predicate rdfs:label
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/resource/sport_{$.ID}"
+    ] .
+
+

Output

+
<http://example.com/resource/student_10> <http://xmlns.com/foaf/0.1/name> "Venus Williams"  .
+<http://example.com/resource/student_20> <http://xmlns.com/foaf/0.1/name> "Demi Moore"  .
+<http://example.com/resource/sport_100> <http://www.w3.org/2000/01/rdf-schema#label> "Tennis" .
+<http://example.com/resource/student_10> <http://example.com/ontology/practises> <http://example.com/resource/sport_100>  .
+
+
+

28. RMLTC0009b-JSON

+

Title: "Generation of triples to multiple graphs"

+

Description: "Test that results from distinct parts of the mapping can be directed to different target graphs."

+

Error expected? No

+

Input

+
{
+  "students" : [
+    { 
+      "ID": 10,
+      "Sport": 100,
+      "Name": "Venus Williams"
+    },
+    { 
+      "ID": 20,
+      "Name": "Demi Moore"
+    }
+  ]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:graph <http://example.com/graph/students>;
+      rml:objectMap [
+          rml:reference "$.Name"
+        ];
+      rml:predicate foaf:name
+    ], [
+      rml:graph <http://example.com/graph/practise>;
+      rml:objectMap [ a rml:RefObjectMap;
+          rml:joinCondition [
+              rml:child "$.Sport";
+              rml:parent "$.ID"
+            ];
+          rml:parentTriplesMap <http://example.com/base/TriplesMap2>
+        ];
+      rml:predicate <http://example.com/ontology/practises>
+    ];
+  rml:subjectMap [
+      rml:class <http://example.com/ontology/Student>;
+      rml:graph <http://example.com/graph/students>;
+      rml:template "http://example.com/resource/student_{$.ID}"
+    ] .
+
+<http://example.com/base/TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.sports[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "sport.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.Name"
+        ];
+      rml:predicate rdfs:label
+    ];
+  rml:subjectMap [
+      rml:class <http://example.com/ontology/Sport>;
+      rml:graph <http://example.com/graph/sports>;
+      rml:template "http://example.com/resource/sport_{$.ID}"
+    ] .
+
+

Output

+
<http://example.com/resource/student_10> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/ontology/Student> <http://example.com/graph/students> .
+<http://example.com/resource/student_10> <http://xmlns.com/foaf/0.1/name> "Venus Williams" <http://example.com/graph/students> .
+<http://example.com/resource/student_20> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/ontology/Student> <http://example.com/graph/students> .
+<http://example.com/resource/student_20> <http://xmlns.com/foaf/0.1/name> "Demi Moore" <http://example.com/graph/students> .
+<http://example.com/resource/sport_100> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/ontology/Sport> <http://example.com/graph/sports> .
+<http://example.com/resource/sport_100> <http://www.w3.org/2000/01/rdf-schema#label> "Tennis" <http://example.com/graph/sports> .
+<http://example.com/resource/student_10> <http://example.com/ontology/practises> <http://example.com/resource/sport_100> <http://example.com/graph/practise> .
+<http://example.com/resource/student_10> <http://example.com/ontology/practises> <http://example.com/resource/sport_100> <http://example.com/graph/students> .
+
+
+

29. RMLTC0010a-JSON

+

Title: "Template with table column with blank space"

+

Description: "Tests a template with blank space in column value"

+

Error expected? No

+

Input

+
{
+  "countries": [{
+    "Country Code": 1,
+    "Name":"Bolivia, Plurinational State of",
+    "ISO 3166": "BO"
+  }, {
+    "Country Code": 2,
+    "Name":"Ireland",
+    "ISO 3166": "IE"
+  }, {
+    "Country Code": 3,
+    "Name":"Saint Martin (French part)",
+    "ISO 3166": "MF"
+  }]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.countries[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "country_info.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.Name"
+        ];
+      rml:predicate ex:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{$.['Country Code']}"
+    ] .
+
+

Output

+
<http://example.com/1> <http://example.com/name> "Bolivia, Plurinational State of" .
+<http://example.com/2> <http://example.com/name> "Ireland" .
+<http://example.com/3> <http://example.com/name> "Saint Martin (French part)" .
+
+
+
+

30. RMLTC0010b-JSON

+

Title: "Template with table columns with special chars"

+

Description: "Tests a template with special chars in column value"

+

Error expected? No

+

Input

+
{
+  "countries": [{
+    "Country Code": 1,
+    "Name":"Bolivia, Plurinational State of",
+    "ISO 3166": "BO"
+  }, {
+    "Country Code": 2,
+    "Name":"Ireland",
+    "ISO 3166": "IE"
+  }, {
+    "Country Code": 3,
+    "Name":"Saint Martin (French part)",
+    "ISO 3166": "MF"
+  }]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.countries[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "country_info.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.Name"
+        ];
+      rml:predicate ex:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{$.['Country Code']}/{$.Name}"
+    ] .
+
+

Output

+
<http://example.com/1/Bolivia%2C%20Plurinational%20State%20of> <http://example.com/name> "Bolivia, Plurinational State of" .
+<http://example.com/2/Ireland> <http://example.com/name> "Ireland" .
+<http://example.com/3/Saint%20Martin%20%28French%20part%29> <http://example.com/name> "Saint Martin (French part)" .
+
+
+
+

31. RMLTC0010c-JSON

+

Title: "Template with table columns with special chars and backslashes"

+

Description: "Tests a template with special chars in reference value and backslash escapes in string templates"

+

Error expected? No

+

Input

+
{
+  "countries": [{
+    "Country Code": 1,
+    "Name":"Bolivia, Plurinational State of",
+    "ISO 3166": "BO"
+  }, {
+    "Country Code": 2,
+    "Name":"Ireland",
+    "ISO 3166": "IE"
+  }, {
+    "Country Code": 3,
+    "Name":"Saint Martin (French part)",
+    "ISO 3166": "MF"
+  }]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.countries[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "country_info.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:predicate ex:code;
+      rml:objectMap [
+          rml:template "\\{\\{\\{ {$.['ISO 3166']} \\}\\}\\}";
+          rml:termType rml:Literal
+        ]
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{$.['Country Code']}/{$.Name}"
+    ] .
+
+

Output

+
<http://example.com/1/Bolivia%2C%20Plurinational%20State%20of> <http://example.com/code> "{{{ BO }}}" .
+<http://example.com/2/Ireland> <http://example.com/code> "{{{ IE }}}" .
+<http://example.com/3/Saint%20Martin%20%28French%20part%29> <http://example.com/code> "{{{ MF }}}" .
+
+
+
+

32. RMLTC0011b-JSON

+

Title: "M to M relation, by using an additional Triples Map"

+

Description: "Tests, M to M relations, by using an additional Triples Map"

+

Error expected? No

+

Input

+
{
+  "students": [
+    {"ID":10, "FirstName":"Venus", "LastName":"Williams"},
+    {"ID":11, "FirstName":"Fernando", "LastName":"Alonso"},
+    {"ID":12, "FirstName":"David", "LastName":"Villa"}
+  ]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/LinkMap_1_2> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.links[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student_sport.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:template "http://example.com/sport/{$.ID_Sport}"
+        ];
+      rml:predicate ex:plays
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/student/{$.ID_Student}"
+    ] .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.FirstName"
+        ];
+      rml:predicate ex:firstName
+    ], [
+      rml:objectMap [
+          rml:reference "$.LastName"
+        ];
+      rml:predicate ex:lastName
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/student/{$.ID}"
+    ] .
+
+<http://example.com/base/TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.sports[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "sport.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.Description"
+        ];
+      rml:predicate ex:description
+    ], [
+      rml:objectMap [
+          rml:reference "$.ID"
+        ];
+      rml:predicate ex:id
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/sport/{$.ID}"
+    ] .
+
+

Output

+
<http://example.com/student/10> <http://example.com/lastName> "Williams" .
+<http://example.com/student/10> <http://example.com/firstName> "Venus" .
+<http://example.com/student/12> <http://example.com/lastName> "Villa" .
+<http://example.com/student/12> <http://example.com/firstName> "David" .
+<http://example.com/student/11> <http://example.com/lastName> "Alonso" .
+<http://example.com/student/11> <http://example.com/firstName> "Fernando" .
+<http://example.com/sport/110> <http://example.com/description> "Tennis" .
+<http://example.com/sport/110> <http://example.com/id> "110" .
+<http://example.com/sport/111> <http://example.com/description> "Football" .
+<http://example.com/sport/111> <http://example.com/id> "111" .
+<http://example.com/sport/112> <http://example.com/description> "Formula1" .
+<http://example.com/sport/112> <http://example.com/id> "112" .
+<http://example.com/student/10> <http://example.com/plays> <http://example.com/sport/110> .
+<http://example.com/student/12> <http://example.com/plays> <http://example.com/sport/111> .
+<http://example.com/student/11> <http://example.com/plays> <http://example.com/sport/112> .
+<http://example.com/student/11> <http://example.com/plays> <http://example.com/sport/111> .
+
+
+
+

33. RMLTC0012a-JSON

+

Title: "Blank node referencing multiple columns"

+

Description: "Tests that blank nodes can be generated by referencing multiple columns"

+

Error expected? No

+

Input

+
{
+  "persons": [
+    {"fname":"Bob","lname":"Smith","amount":30},
+    {"fname":"Sue","lname":"Jones","amount":20},
+    {"fname":"Bob","lname":"Smith","amount":30}
+  ]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.persons[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "persons.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:template "{$.fname} {$.lname}";
+          rml:termType rml:Literal
+        ];
+      rml:predicate foaf:name
+    ], [
+      rml:objectMap [
+          rml:reference "$.amount"
+        ];
+      rml:predicate ex:amount
+    ];
+  rml:subjectMap [
+      rml:template "{$.fname}{$.lname}{$.amount}";
+      rml:termType rml:BlankNode
+    ] .
+
+

Output

+
_:BobSmith30 <http://example.com/amount> "30" .
+_:BobSmith30 <http://xmlns.com/foaf/0.1/name> "Bob Smith" .
+_:SueJones20 <http://example.com/amount> "20" .
+_:SueJones20 <http://xmlns.com/foaf/0.1/name> "Sue Jones" .
+
+
+
+

34. RMLTC0012b-JSON

+

Title: "Duplicate tuples generate same blank node"

+

Description: "Tests that blank nodes with same identifier and in the same graph but generated by different logical rows are considered equivalent."

+

Error expected? No

+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.persons[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "persons.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:template "{$.fname} {$.lname}";
+          rml:termType rml:Literal
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "{$.fname}{$.lname}";
+      rml:termType rml:BlankNode
+    ] .
+
+<http://example.com/base/TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.lives[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "lives.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.city"
+        ];
+      rml:predicate ex:city
+    ];
+  rml:subjectMap [
+      rml:template "{$.fname}{$.lname}";
+      rml:termType rml:BlankNode
+    ] .
+
+

Output

+
_:BobSmith <http://example.com/city> "London" .
+_:BobSmith <http://xmlns.com/foaf/0.1/name> "Bob Smith" .
+_:SueJones <http://example.com/city> "Madrid" .
+_:SueJones <http://xmlns.com/foaf/0.1/name> "Sue Jones" .
+
+
+
+

35. RMLTC0012c-JSON

+

Title: "TriplesMap without subjectMap"

+

Description: "Tests a RML with missing information, TriplesMap without subjectMap."

+

Error expected? Yes

+

Input

+
{
+  "persons": [
+    {"fname":"Bob","lname":"Smith","amount":30},
+    {"fname":"Sue","lname":"Jones","amount":20},
+    {"fname":"Bob","lname":"Smith","amount":30}
+  ]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.persons[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "persons.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:template "{$.fname} {$.lname}";
+          rml:termType rml:Literal
+        ];
+      rml:predicate foaf:name
+    ], [
+      rml:objectMap [
+          rml:reference "$.amount"
+        ];
+      rml:predicate ex:amount
+    ] .
+
+
+

36. RMLTC0012d-JSON

+

Title: "TriplesMap with two subjectMap"

+

Description: "Tests a RML with wrong information, TriplesMap with two subjectMap."

+

Error expected? Yes

+

Input

+
{
+  "persons": [
+    {"fname":"Bob","lname":"Smith","amount":30},
+    {"fname":"Sue","lname":"Jones","amount":20},
+    {"fname":"Bob","lname":"Smith","amount":30}
+  ]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.persons[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "persons.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:template "{$.fname} {$.lname}";
+          rml:termType rml:Literal
+        ];
+      rml:predicate foaf:name
+    ], [
+      rml:objectMap [
+          rml:reference "$.amount"
+        ];
+      rml:predicate ex:amount
+    ];
+  rml:subjectMap [
+      rml:template "{$.fname}_{$.lname}_{$.amount}";
+      rml:termType rml:BlankNode
+    ], [
+      rml:template "{$.amount}_{$.fname}_{$.lname}";
+      rml:termType rml:BlankNode
+    ] .
+
+
+

37. RMLTC0013a-JSON

+

Title: "Null value in JSON file"

+

Description: "Tests if null values in JSON files are handled correctly."

+

Error expected? No

+

Input

+
{
+  "persons": [
+    {"ID":"1","Name":"Alice","DateOfBirth":null},
+    {"ID":"2","Name":"Bob","DateOfBirth":"September, 2010"}
+  ]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.persons[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "persons.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.DateOfBirth"
+        ];
+      rml:predicate ex:BirthDay
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Person/{$.ID}/{$.Name}/{$.DateOfBirth}"
+    ] .
+
+

Output

+
<http://example.com/Person/2/Bob/September%2C%202010> <http://example.com/BirthDay> "September, 2010" .
+
+
+

38. RMLTC0015a-JSON

+

Title: "Generation of language tags from a table with language information"

+

Description: "Generation of language tags from a table with language information"

+

Error expected? No

+

Input

+
{
+  "countries": [
+    {"Code": "BO", "Name": "Bolivia, Plurinational State of"},
+    {"Code": "IE", "Name": "Ireland"}
+  ]
+}
+
+

Mapping

+
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.countries[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "country_en.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:language "en";
+          rml:reference "$.Name"
+        ];
+      rml:predicate rdfs:label
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{$.Code}"
+    ] .
+
+<http://example.com/base/TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.countries[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "country_es.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:language "es";
+          rml:reference "$.Name"
+        ];
+      rml:predicate rdfs:label
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{$.Code}"
+    ] .
+
+

Output

+
<http://example.com/BO> <http://www.w3.org/2000/01/rdf-schema#label> "Bolivia, Plurinational State of"@en .
+<http://example.com/BO> <http://www.w3.org/2000/01/rdf-schema#label> "Estado Plurinacional de Bolivia"@es .
+<http://example.com/IE> <http://www.w3.org/2000/01/rdf-schema#label> "Ireland"@en .
+<http://example.com/IE> <http://www.w3.org/2000/01/rdf-schema#label> "Irlanda"@es .
+
+
+
+
+

39. RMLTC0015b-JSON

+

Title: "Generation of language tags from a table with language information, and a term map with invalid rml:language value"

+

Description: "Tests a term map with an invalid rml:language value, which is an error"

+

Error expected? Yes

+

Input

+
{
+  "countries": [
+    {"Code": "BO", "Name": "Bolivia, Plurinational State of"},
+    {"Code": "IE", "Name": "Ireland"}
+  ]
+}
+
+

Mapping

+
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.countries[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "country_en.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:language "a-english";
+          rml:reference "$.Name"
+        ];
+      rml:predicate rdfs:label
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{$.Code}"
+    ] .
+
+<http://example.com/base/TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.countries[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "country_en.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:language "a-spanish";
+          rml:reference "$.Name"
+        ];
+      rml:predicate rdfs:label
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{$.Code}"
+    ] .
+
+
+

40. RMLTC0019a-JSON

+

Title: "Generation of triples by using IRI value in columns"

+

Description: "Test the generation of triples by using IRI value in attributes"

+

Error expected? No

+

Input

+
{
+  "persons": [
+    {
+      "ID": 10,
+      "FirstName": "http://example.com/ns#Jhon",
+      "LastName": "Smith"
+    },
+    {
+      "ID": 20,
+      "FirstName": "Carlos",
+      "LastName": "Mendoza"
+    }
+  ]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.persons[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "persons.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.FirstName"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:reference "$.FirstName"
+    ] .
+
+

Output

+
<http://example.com/ns#Jhon> <http://xmlns.com/foaf/0.1/name> "http://example.com/ns#Jhon" .
+<http://example.com/base/Carlos> <http://xmlns.com/foaf/0.1/name> "Carlos" .
+
+
+

41. RMLTC0019b-JSON

+

Title: "Generation of triples by using IRI value in columns, with data error"

+

Description: "Test the generation of triples by using IRI value in attributes, conforming RML mapping with data error (and limited results)"

+

Error expected? Yes

+

Input

+
{
+  "persons": [
+    {
+      "ID": 10,
+      "FirstName": "http://example.com/ns#Jhon",
+      "LastName": "Smith"
+    },
+    {
+      "ID": 20,
+      "FirstName": "Carlos",
+      "LastName": "Mendoza"
+    },
+    {
+      "ID": 30,
+      "FirstName": "Juan Daniel",
+      "LastName": "Crespo"
+    }
+  ]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.persons[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "persons.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.FirstName"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:reference "$.FirstName"
+    ] .
+
+
+

42. RMLTC0020a-JSON

+

Title: "Generation of triples by using IRI value in columns"

+

Description: "Test the generation of triples by using IRI value in attributes"

+

Error expected? No

+

Input

+
{
+  "students": [
+    {"Name": "http://example.com/company/Alice"},
+    {"Name": "Bob"},
+    {"Name": "Bob/Charles"},
+    {"Name": "path/../Danny"},
+    {"Name": "Emily Smith"}
+  ]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:object foaf:Person;
+      rml:predicate rdf:type
+    ];
+  rml:subjectMap [
+      rml:template "{$.Name}";
+      rml:termType rml:IRI
+    ] .
+
+

Output

+
<http://example.com/base/http%3A%2F%2Fexample.com%2Fcompany%2FAlice> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/base/Bob> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/base/Bob%2FCharles> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/base/path%2F..%2FDanny> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/base/Emily%20Smith> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+
+
+

43. RMLTC0021a-JSON

+

Title: "Generation of triples referencing object map"

+

Description: "Tests the mapping specification referencing object map with same logical source and join condition"

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "Name":"Venus Williams",
+    "Sport": "Tennis"
+  }, {
+    "ID": 20,
+    "Name":"Serena Williams",
+    "Sport": "Tennis"
+  }, {
+    "ID": 30,
+    "Name":"Loena Hendrickx",
+    "Sport": "Figure skating"
+  }]
+}
+
+

Mapping

+
@prefix activity: <http://example.com/activity/> .
+@prefix ex: <http://example.com/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/RefObjectMap1> a rml:RefObjectMap;
+  rml:joinCondition [
+      rml:child "$.Sport";
+      rml:parent "$.Sport"
+    ];
+  rml:parentTriplesMap <http://example.com/base/TriplesMap1> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap <http://example.com/base/RefObjectMap1>;
+      rml:predicate ex:sameSportAs
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Student/{$.ID}/{$.Name}"
+    ] .
+
+

Output

+
<http://example.com/Student/10/Venus%20Williams> <http://example.com/sameSportAs> <http://example.com/Student/10/Venus%20Williams> . 
+<http://example.com/Student/10/Venus%20Williams> <http://example.com/sameSportAs> <http://example.com/Student/20/Serena%20Williams> . 
+<http://example.com/Student/20/Serena%20Williams> <http://example.com/sameSportAs> <http://example.com/Student/20/Serena%20Williams> . 
+<http://example.com/Student/20/Serena%20Williams> <http://example.com/sameSportAs> <http://example.com/Student/10/Venus%20Williams> . 
+<http://example.com/Student/30/Loena%20Hendrickx> <http://example.com/sameSportAs> <http://example.com/Student/30/Loena%20Hendrickx> . 
+
+
+
+
+

44. RMLTC0022a-JSON

+

Title: "Generating of triples with constant datatype"

+

Description: "Test triples with a fixed constant datatype"

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "Name":"Venus"
+  }]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:datatype xsd:string;
+          rml:reference "$.Name"
+        ];
+      rml:predicate foaf:name
+    ], [
+      rml:objectMap [
+          rml:datatype xsd:int;
+          rml:reference "$.Age"
+        ];
+      rml:predicate ex:age
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{$.Name}"
+    ] .
+
+

Output

+
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "Venus"^^<http://www.w3.org/2001/XMLSchema#string> .
+<http://example.com/Venus> <http://example.com/age> "21"^^<http://www.w3.org/2001/XMLSchema#int> .
+
+
+

45. RMLTC0022b-JSON

+

Title: "Generating of triples with datatypeMap"

+

Description: "Test triples with a XSD datatype generated from the data"

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "Name":"Venus"
+  }]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:referenceFormulation rml:JSONPath;
+      rml:iterator "$.[*]"
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "data.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:datatypeMap [
+              rml:template "http://www.w3.org/2001/XMLSchema#{$.BAR}"
+            ];
+          rml:reference "$.FOO"
+        ];
+      rml:predicate ex:x
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{$.FOO}"
+    ] .
+
+
+

Output

+
<http://example.com/1> <http://example.com/x> "1"^^<http://www.w3.org/2001/XMLSchema#string> .
+<http://example.com/2> <http://example.com/x> "2"^^<http://www.w3.org/2001/XMLSchema#int> .
+
+
+

46. RMLTC0022c-JSON

+

Title: "Generating of triples with datatypeMap with custom datatype"

+

Description: "Test triples with a custom datype from the data"

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "Name":"Venus"
+  }]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:referenceFormulation rml:JSONPath;
+      rml:iterator "$.[*]";
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "data.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:datatypeMap [
+              rml:template "datatype#{$.BAR}"
+            ];
+          rml:reference "$.FOO"
+        ];
+      rml:predicate ex:x
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{$.FOO}"
+    ] .
+
+

Output

+
<http://example.com/1> <http://example.com/x> "1"^^<http://www.w3.org/2001/XMLSchema#string> .
+<http://example.com/2> <http://example.com/x> "2"^^<http://www.w3.org/2001/XMLSchema#int> .
+
+
+

47. RMLTC0023a-JSON

+

Title: "Invalid IRI template 1"

+

Description: "Test handling of invalid IRI template"

+

Error expected? Yes

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "Name":"Venus"
+  }]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:referenceFormulation rml:JSONPath;
+      rml:iterator "$.students[*]";
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{NON_EXISTING_COLUMN}"
+      rml:class foaf:Person;
+    ] .
+
+
+

48. RMLTC0023b-JSON

+

Title: "Invalid IRI template 2"

+

Description: "Test handling of invalid IRI template"

+

Error expected? Yes

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "{Name}":"Venus"
+  }]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:referenceFormulation rml:JSONPath;
+      rml:iterator "$.students[*]";
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{{Name}}"
+      rml:class foaf:Person;
+    ] .
+
+
+

49. RMLTC0023c-JSON

+

Title: "Invalid IRI template 3"

+

Description: "Test handling of invalid IRI template"

+

Error expected? Yes

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "N\ame":"Venus"
+  }]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:referenceFormulation rml:JSONPath;
+      rml:iterator "$.students[*]";
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{N\ame}"
+      rml:class foaf:Person;
+    ] .
+
+
+
+

50. RMLTC0023d-JSON

+

Title: "Invalid IRI template 4"

+

Description: "Test handling of invalid IRI template"

+

Error expected? Yes

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "Name":"Venus"
+  }]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:referenceFormulation rml:JSONPath;
+      rml:iterator "$.students[*]";
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{Name\}"
+      rml:class foaf:Person;
+    ] .
+
+
+
+

51. RMLTC0023e-JSON

+

Title: "Invalid IRI template 5"

+

Description: "Test handling of invalid IRI template"

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "{Name}":"Venus"
+  }]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+     rml:referenceFormulation rml:JSONPath;
+     rml:iterator "$.students[*]";
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{\\{Name\\}}";
+      rml:class foaf:Person;
+    ] .
+
+
+

Output

+
<http://example.com/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+
+
+

52. RMLTC0023f-JSON

+

Title: "Invalid IRI template 6"

+

Description: "Test handling of invalid IRI template"

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "N\ame":"Venus"
+  }]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:referenceFormulation rml:JSONPath;
+      rml:iterator "$.students[*]";
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{N\\\ame}";
+      rml:class foaf:Person;
+    ] .
+
+

Output

+
<http://example.com/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+
+
+ + + + + \ No newline at end of file diff --git a/src/test/resources/rml-core/docs/20250224/index.html b/src/test/resources/rml-core/docs/20250224/index.html new file mode 100644 index 00000000..b1e604bb --- /dev/null +++ b/src/test/resources/rml-core/docs/20250224/index.html @@ -0,0 +1,3113 @@ + + + + + + +RML-Core: Test Cases + + + + + + + + + + + + + + +
+ +

RML-Core: Test Cases

+

+ Draft Community Group Report + +

+
+ +
Latest published version:
+ https://www.w3.org/RML-Core-Testcases/ +
+
Latest editor's draft:
https://w3id.org/rml/core/test-cases/
+ + + + +
Editor:
+ Dylan Van Assche + + + + (IDLab – Ghent University – imec) +
+ +
Author:
+ Dylan Van Assche + + + + (IDLab – Ghent University – imec) +
+
Feedback:
+ GitHub kg-construct/rml-core + (pull requests, + new issue, + open issues) +
+ +
+ + +
+
+ + + +

Abstract

This document defines the RML-Core test cases to the determine the RML-Core specification conformance of tools.

+
+ +

Status of This Document

+ This specification was published by the + Knowledge Graph Construction Community Group. It is not a W3C Standard nor is it + on the W3C Standards Track. + + Please note that under the + W3C Community Contributor License Agreement (CLA) + there is a limited opt-out and other conditions apply. + + Learn more about + W3C Community and Business Groups. +

+ GitHub Issues are preferred for + discussion of this specification. + + +

+ +

1. Introduction

+

This document defines the RML-Core test cases, consisting of a collection of test case documents (input and expected output). +The purpose of the test cases is to determine the conformance of tools that execute RML rules to the RML-Core specification.

+
+ +

2. Data model

+

The test cases are semantically described for re-usability and shareability following the W3C Test case description. +Each test:Testcase as the following properties:

+
    +
  • dcterms:identifier: unique ID of the test case.
  • +
  • rmltest:hasError: if an error of the RML Processor is expected or not.
  • +
  • rmltest:input: One or more input data of the test case.
  • +
  • rmltest:output: One or more output data of the test case.
  • +
  • rmltest:inputFormat: the input data format.
  • +
  • rmltest:outputFormat: the output data format.
  • +
  • rmltest:mappingDocument: the RML mapping rules in Turtle.
  • +
+
+ +

3. Test cases

+

This section describes the RML-Core test cases. These descriptions are also available as RDF. +The files are available on GitHub in the folder test-cases. +Each test case is contained in a single folder, containing three types of files:

+
    +
  • Zero or more files containing the data sources, in the case of JSON, XML, CSV, or containing the SQL statements to create the necessary tables, in the case of MySQL, PostgreSQL, and SQL Server.
  • +
  • One file with the RML rules, called mapping.ttl, in the Turtle format.
  • +
  • Zero or more files with the expected RDF. No file is provided if an error is expected that must halt the generation of the RDF because of an error.
  • +
+
+ + +

4. RMLTC0000-JSON

+

Title: "one table, one column, zero rows"

+

Description: "Tests if an empty table produces an empty RDF graph"

+

Error expected? No

+

Input

+
{
+  "students": []
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.Name"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{$.Name}"
+    ] .
+
+

Output

+
# empty database
+
+
+

5. RMLTC0001a-JSON

+

Title: "One column mapping, subject URI generation by using rml:template"

+

Description: "Tests: (1) one column mapping; (2) subject URI generation by using rml:template; (3) one column to one property"

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "Name":"Venus"
+  }]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.Name"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap <http://example.com/base/#NameSubjectMap> .
+
+<http://example.com/base/#NameSubjectMap> rml:template "http://example.com/{$.Name}" .
+
+

Output

+
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
+
+
+
+

6. RMLTC0001b-JSON

+

Title: "One column mapping, generation of a BlankNode subject by using rml:termType"

+

Description: "Tests: (1) one column mapping; (2) generation of a BlankNode subject by using rml:termType; (3) one column to one property"

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "Name":"Venus"
+  }]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.Name"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "{$.Name}";
+      rml:termType rml:BlankNode
+    ] .
+
+

Output

+
_:Venus <http://xmlns.com/foaf/0.1/name> "Venus" .
+
+
+
+

7. RMLTC0002a-JSON

+

Title: "Two columns mapping, generation of a subject URI by the concatenation of two column values"

+

Description: "Tests: (1) two column mapping, no primary key; (2) subject URI generated by the concatenation of two column values; (3) one column to one property"

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "Name":"Venus"
+  }]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.ID"
+        ];
+      rml:predicate ex:id
+    ], [
+      rml:objectMap [
+          rml:reference "$.Name"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:class foaf:Person;
+      rml:template "http://example.com/{$.ID}/{$.Name}"
+    ] .
+
+

Output

+
<http://example.com/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
+<http://example.com/10/Venus> <http://example.com/id> "10" .
+<http://example.com/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+
+
+
+

8. RMLTC0002b-JSON

+

Title: "Two columns mapping, generation of a BlankNode subject by using rml:template and rml:termType"

+

Description: "Tests: (1) two column mapping, no primary key; (2) generation of a BlankNode subject by using rml:template; (3) one column to one property"

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "Name":"Venus"
+  }]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.Name"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "students{$.ID}";
+      rml:termType rml:BlankNode
+    ] .
+
+

Output

+
_:students10 <http://xmlns.com/foaf/0.1/name> "Venus" .
+
+
+
+

9. RMLTC0002e-JSON

+

Title: "Two columns mapping, an undefined rml:path"

+

Description: "Tests the presence of an undefined rml:path"

+

Error expected? Yes

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "Name":"Venus"
+  }]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student2.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.IDs"
+        ];
+      rml:predicate ex:id
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{$.ID}/{$.Name}"
+    ] .
+
+
+

10. RMLTC0002g-JSON

+

Title: "Two columns mapping, invalid JSONPath"

+

Description: "Test the presence of an invalid JSONPath"

+

Error expected? Yes

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "Name":"Venus"
+  }]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student2.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.IDs"
+        ];
+      rml:predicate ex:id
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{$.ID}/{$.Name}"
+    ] .
+
+
+

11. RMLTC0003c-JSON

+

Title: "Three columns mapping, by using a rml:template to produce literal"

+

Description: "Tests: (1) three column mapping; and (2) the use of rml:template to produce literal"

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "FirstName":"Venus",
+    "LastName":"Williams"
+  }]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:template "{$.FirstName} {$.LastName}";
+          rml:termType rml:Literal
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Student{$.ID}"
+    ] .
+
+

Output

+
<http://example.com/Student10> <http://xmlns.com/foaf/0.1/name> "Venus Williams" .
+
+
+

12. RMLTC0004a-JSON

+

Title: "Two column mapping, from one row table to two different triples"

+

Description: "Tests: (1) two column mapping, (2) subject URI generated by a column value; (3) from one row table to two different triples (4) typing by using rml:class"

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "Student": "Venus",
+    "Sport":"Tennis"
+  }]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student_sport.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.Student"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:class ex:Student;
+      rml:template "http://example.com/{$.Student}"
+    ] .
+
+<http://example.com/base/TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student_sport.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.Sport"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:class ex:Sport;
+      rml:template "http://example.com/{$.Sport}"
+    ] .
+
+

Output

+
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
+<http://example.com/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/Student> .
+<http://example.com/Tennis> <http://xmlns.com/foaf/0.1/name> "Tennis" .
+<http://example.com/Tennis> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/Sport> .
+
+
+
+

13. RMLTC0004b-JSON

+

Title: "One column mapping, presence of rml:termType rml:Literal on rml:subjectMap"

+

Description: "Tests: (1) one column mapping (2) the presence of rml:termType rml:Literal on rml:subjectMap, which is invalid"

+

Error expected? Yes

+

Input

+
{
+  "students": [{
+    "Name":"Venus"
+  }]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.Name"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{$.Name}";
+      rml:termType rml:Literal
+    ] .
+
+
+

14. RMLTC0005a-JSON

+

Title: "Typing of resources"

+

Description: "Tests the typing of resources"

+

Error expected? No

+

Input

+
{
+  "persons": [
+    {
+      "fname": "Bob",
+      "lname": "Smith",
+      "amount": "30.0E0"
+    },
+    {
+      "fname": "Sue",
+      "lname": "Jones",
+      "amount": "20.0E0"
+    },
+    {
+      "fname": "Bob",
+      "lname": "Smith",
+      "amount": "30.0E0"
+    }
+  ]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.persons[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "ious.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.amount"
+        ];
+      rml:predicate ex:owes
+    ];
+  rml:subjectMap [
+      rml:class foaf:Person;
+      rml:template "http://example.com/{$.fname};{$.lname}"
+    ] .
+
+

Output

+
<http://example.com/Bob;Smith> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Bob;Smith> <http://example.com/owes> "30.0E0" .
+<http://example.com/Sue;Jones> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Sue;Jones> <http://example.com/owes> "20.0E0" .
+
+
+
+

15. RMLTC0006a-JSON

+

Title: "Use of rml:constant in rml:subjectMap, rml:predicateMap, rml:objectMap and rml:graphMap"

+

Description: "Tests the use of rml:constant in rml:subjectMap, rml:predicateMap, rml:objectMap and rml:graphMap"

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "FirstName":"Venus",
+    "LastName":"Williams"
+  }]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:constant "Bad Student"
+        ];
+      rml:predicateMap [
+          rml:constant ex:description
+        ]
+    ];
+  rml:subjectMap [
+      rml:constant ex:BadStudent;
+      rml:graphMap [
+          rml:constant <http://example.com/graph/student>
+        ]
+    ] .
+
+

Output

+
<http://example.com/BadStudent> <http://example.com/description> "Bad Student" <http://example.com/graph/student> .
+
+
+

16. RMLTC0007a-JSON

+

Title: "Typing resources by relying on rdf:type predicate"

+

Description: "Tests the typing resources by relying on rdf:type predicate"

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "FirstName":"Venus",
+    "LastName":"Williams"
+  }]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:object foaf:Person;
+      rml:predicate rdf:type
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Student/{$.ID}/{$.FirstName}"
+    ] .
+
+

Output

+
 <http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+
+
+
+

17. RMLTC0007b-JSON

+

Title: "Assigning triples to Named Graphs"

+

Description: "Tests the generation of triples to a named graph"

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "FirstName":"Venus",
+    "LastName":"Williams"
+  }]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:object foaf:Person;
+      rml:predicate rdf:type
+    ], [
+      rml:objectMap [
+          rml:reference "$.FirstName"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:graph ex:PersonGraph;
+      rml:template "http://example.com/Student/{$.ID}/{$.FirstName}"
+    ] .
+
+

Output

+
<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" <http://example.com/PersonGraph> . 
+<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person>  <http://example.com/PersonGraph> .
+
+
+
+

18. RMLTC0007c-JSON

+

Title: "One row mapping, using rml:class"

+

Description: "Tests subjectmap with more than one class IRIs, rml:class"

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "FirstName":"Venus",
+    "LastName":"Williams"
+  }]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.ID"
+        ];
+      rml:predicate ex:id
+    ], [
+      rml:objectMap [
+          rml:reference "$.FirstName"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:class ex:Student, foaf:Person;
+      rml:template "http://example.com/Student/{$.ID}/{$.FirstName}"
+    ] .
+
+

Output

+
<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
+<http://example.com/Student/10/Venus> <http://example.com/id> "10" . 
+<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/Student> .
+
+
+
+

19. RMLTC0007d-JSON

+

Title: "One column mapping, specifying an rml:predicateObjectMap with rdf:type"

+

Description: "Tests subjectmap with an alternative of having rml:class, i.e., by specifying an rml:predicateObjectMap with predicate rdf:type"

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "FirstName":"Venus",
+    "LastName":"Williams"
+  }]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:object foaf:Person;
+      rml:predicate rdf:type
+    ], [
+      rml:object ex:Student;
+      rml:predicate rdf:type
+    ], [
+      rml:objectMap [
+          rml:reference "$.ID"
+        ];
+      rml:predicate ex:id
+    ], [
+      rml:objectMap [
+          rml:reference "$.FirstName"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Student/{$.ID}/{$.FirstName}"
+    ] .
+
+

Output

+
<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" . 
+<http://example.com/Student/10/Venus> <http://example.com/id> "10" .
+<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/Student> .
+
+
+
+

20. RMLTC0007e-JSON

+

Title: "One column mapping, using rml:graphMap and rml:class"

+

Description: "Tests subjectmap with rml:graphMap and rml:class"

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "Name":"Venus"
+  }]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.ID"
+        ];
+      rml:predicate ex:id
+    ], [
+      rml:objectMap [
+          rml:reference "$.Name"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:class foaf:Person;
+      rml:graph ex:PersonGraph;
+      rml:template "http://example.com/Student/{$.ID}/{$.Name}"
+    ] .
+
+

Output

+
<http://example.com/Student/10/Venus> <http://example.com/id> "10" <http://example.com/PersonGraph> .
+<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" <http://example.com/PersonGraph> .
+<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> <http://example.com/PersonGraph> .
+
+
+
+

21. RMLTC0007f-JSON

+

Title: "One column mapping, using rml:graphMap and specifying an rml:predicateObjectMap with rdf:type"

+

Description: "Tests subjectmap with rml:graphMap and specifying an rml:predicateObjectMap with predicate rdf:type"

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "FirstName":"Venus",
+    "LastName":"Williams"
+  }]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:object foaf:Person;
+      rml:predicate rdf:type
+    ], [
+      rml:objectMap [
+          rml:reference "$.ID"
+        ];
+      rml:predicate ex:id
+    ], [
+      rml:objectMap [
+          rml:reference "$.FirstName"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:graph ex:PersonGraph;
+      rml:template "http://example.com/Student/{$.ID}/{$.FirstName}"
+    ] .
+
+

Output

+
<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> <http://example.com/PersonGraph> .
+<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" <http://example.com/PersonGraph> .
+<http://example.com/Student/10/Venus> <http://example.com/id> "10" <http://example.com/PersonGraph> .
+
+
+
+

22. RMLTC0007g-JSON

+

Title: "Assigning triples to the default graph"

+

Description: "Tests the generation of triples to the default graph"

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "FirstName":"Venus",
+    "LastName":"Williams"
+  }]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.FirstName"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:graph rml:defaultGraph;
+      rml:template "http://example.com/Student/{$.ID}/{$.FirstName}"
+    ] .
+
+

Output

+
<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
+
+
+
+

23. RMLTC0007h-JSON

+

Title: "Assigning triples to a non-IRI named graph"

+

Description: "Tests the generation of triples to a non-IRI named graph, which is an error"

+

Error expected? Yes

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "FirstName":"Venus",
+    "LastName":"Williams"
+  }]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.Name"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:graphMap [
+          rml:reference "$.Name";
+          rml:termType rml:Literal
+        ];
+      rml:template "http://example.com/Student/{$.ID}/{$.FirstName}"
+    ] .
+
+
+

24. RMLTC0008a-JSON

+

Title: "Generation of triples to a target graph by using rml:graphMap and rml:template"

+

Description: "Test that results of the mapping can be directed to a target graph by using rml:graphMap and rml:template"

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "Name":"Venus Williams",
+    "Sport": "Tennis"
+  }]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:object foaf:Person;
+      rml:predicate rdf:type
+    ], [
+      rml:objectMap [
+          rml:reference "$.ID"
+        ];
+      rml:predicate ex:id
+    ], [
+      rml:objectMap [
+          rml:reference "$.Name"
+        ];
+      rml:predicate foaf:name
+    ], [
+      rml:objectMap [
+          rml:reference "$.Sport"
+        ];
+      rml:predicate ex:Sport
+    ];
+  rml:subjectMap [
+      rml:graphMap [
+          rml:template "http://example.com/graph/Student/{$.ID}/{$.Name}"
+        ];
+      rml:template "http://example.com/Student/{$.ID}/{$.Name}"
+    ] .
+
+

Output

+
<http://example.com/Student/10/Venus%20Williams> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> <http://example.com/graph/Student/10/Venus%20Williams> .
+<http://example.com/Student/10/Venus%20Williams> <http://xmlns.com/foaf/0.1/name> "Venus Williams" <http://example.com/graph/Student/10/Venus%20Williams> .
+<http://example.com/Student/10/Venus%20Williams> <http://example.com/id> "10" <http://example.com/graph/Student/10/Venus%20Williams> . 
+<http://example.com/Student/10/Venus%20Williams> <http://example.com/Sport> "Tennis" <http://example.com/graph/Student/10/Venus%20Williams> . 
+
+
+
+

25. RMLTC0008b-JSON

+

Title: "Generation of triples referencing object map"

+

Description: "Tests the mapping specification referencing object map without join"

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "Name":"Venus Williams",
+    "Sport": "Tennis"
+  }]
+}
+
+

Mapping

+
@prefix activity: <http://example.com/activity/> .
+@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap <http://example.com/base/RefObjectMap1>;
+      rml:predicate ex:Sport
+    ], [
+      rml:object foaf:Person;
+      rml:predicate rdf:type
+    ], [
+      rml:objectMap [
+          rml:reference "$.ID"
+        ];
+      rml:predicate ex:id
+    ], [
+      rml:objectMap [
+          rml:reference "$.Name"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Student/{$.ID}/{$.Name}"
+    ] .
+
+<http://example.com/base/RefObjectMap1> a rml:RefObjectMap;
+  rml:parentTriplesMap <http://example.com/base/TriplesMap2> .
+
+<http://example.com/base/TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:object activity:Sport;
+      rml:predicate rdf:type
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{$.Sport}"
+    ] .
+
+

Output

+
<http://example.com/Student/10/Venus%20Williams> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person>  .
+<http://example.com/Student/10/Venus%20Williams> <http://xmlns.com/foaf/0.1/name> "Venus Williams" .
+<http://example.com/Student/10/Venus%20Williams> <http://example.com/id> "10" . 
+<http://example.com/Student/10/Venus%20Williams> <http://example.com/Sport> <http://example.com/Tennis> . 
+<http://example.com/Tennis> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/activity/Sport> .
+
+
+
+
+

26. RMLTC0008c-JSON

+

Title: "Generation of triples by using multiple predicateMaps within a rml:predicateObjectMap"

+

Description: "Tests the generation of triples by using multiple predicateMaps within a rml:predicateObjectMap"

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "Name":"Venus Williams",
+    "Sport": "Tennis"
+  }]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.Name"
+        ];
+      rml:predicate ex:name, foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Student/{$.ID}/{$.Name}"
+    ] .
+
+

Output

+
<http://example.com/Student/10/Venus%20Williams> <http://xmlns.com/foaf/0.1/name> "Venus Williams"  .
+<http://example.com/Student/10/Venus%20Williams> <http://example.com/name> "Venus Williams"  .
+
+
+
+

27. RMLTC0009a-JSON

+

Title: "Generation of triples from foreign key relations"

+

Description: "Test foreign key relationships among logical tables"

+

Error expected? No

+

Input

+
{
+  "students" : [
+    { 
+      "ID": 10,
+      "Sport": 100,
+      "Name": "Venus Williams"
+    },
+    { 
+      "ID": 20,
+      "Name": "Demi Moore"
+    }
+  ]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.Name"
+        ];
+      rml:predicate foaf:name
+    ], [
+      rml:objectMap [ a rml:RefObjectMap;
+          rml:joinCondition [
+              rml:child "$.Sport";
+              rml:parent "$.ID"
+            ];
+          rml:parentTriplesMap <http://example.com/base/TriplesMap2>
+        ];
+      rml:predicate <http://example.com/ontology/practises>
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/resource/student_{$.ID}"
+    ] .
+
+<http://example.com/base/TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.sports[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "sport.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.Name"
+        ];
+      rml:predicate rdfs:label
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/resource/sport_{$.ID}"
+    ] .
+
+

Output

+
<http://example.com/resource/student_10> <http://xmlns.com/foaf/0.1/name> "Venus Williams"  .
+<http://example.com/resource/student_20> <http://xmlns.com/foaf/0.1/name> "Demi Moore"  .
+<http://example.com/resource/sport_100> <http://www.w3.org/2000/01/rdf-schema#label> "Tennis" .
+<http://example.com/resource/student_10> <http://example.com/ontology/practises> <http://example.com/resource/sport_100>  .
+
+
+

28. RMLTC0009b-JSON

+

Title: "Generation of triples to multiple graphs"

+

Description: "Test that results from distinct parts of the mapping can be directed to different target graphs."

+

Error expected? No

+

Input

+
{
+  "students" : [
+    { 
+      "ID": 10,
+      "Sport": 100,
+      "Name": "Venus Williams"
+    },
+    { 
+      "ID": 20,
+      "Name": "Demi Moore"
+    }
+  ]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:graph <http://example.com/graph/students>;
+      rml:objectMap [
+          rml:reference "$.Name"
+        ];
+      rml:predicate foaf:name
+    ], [
+      rml:graph <http://example.com/graph/practise>;
+      rml:objectMap [ a rml:RefObjectMap;
+          rml:joinCondition [
+              rml:child "$.Sport";
+              rml:parent "$.ID"
+            ];
+          rml:parentTriplesMap <http://example.com/base/TriplesMap2>
+        ];
+      rml:predicate <http://example.com/ontology/practises>
+    ];
+  rml:subjectMap [
+      rml:class <http://example.com/ontology/Student>;
+      rml:graph <http://example.com/graph/students>;
+      rml:template "http://example.com/resource/student_{$.ID}"
+    ] .
+
+<http://example.com/base/TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.sports[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "sport.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.Name"
+        ];
+      rml:predicate rdfs:label
+    ];
+  rml:subjectMap [
+      rml:class <http://example.com/ontology/Sport>;
+      rml:graph <http://example.com/graph/sports>;
+      rml:template "http://example.com/resource/sport_{$.ID}"
+    ] .
+
+

Output

+
<http://example.com/resource/student_10> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/ontology/Student> <http://example.com/graph/students> .
+<http://example.com/resource/student_10> <http://xmlns.com/foaf/0.1/name> "Venus Williams" <http://example.com/graph/students> .
+<http://example.com/resource/student_20> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/ontology/Student> <http://example.com/graph/students> .
+<http://example.com/resource/student_20> <http://xmlns.com/foaf/0.1/name> "Demi Moore" <http://example.com/graph/students> .
+<http://example.com/resource/sport_100> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/ontology/Sport> <http://example.com/graph/sports> .
+<http://example.com/resource/sport_100> <http://www.w3.org/2000/01/rdf-schema#label> "Tennis" <http://example.com/graph/sports> .
+<http://example.com/resource/student_10> <http://example.com/ontology/practises> <http://example.com/resource/sport_100> <http://example.com/graph/practise> .
+<http://example.com/resource/student_10> <http://example.com/ontology/practises> <http://example.com/resource/sport_100> <http://example.com/graph/students> .
+
+
+

29. RMLTC0010a-JSON

+

Title: "Template with table column with blank space"

+

Description: "Tests a template with blank space in column value"

+

Error expected? No

+

Input

+
{
+  "countries": [{
+    "Country Code": 1,
+    "Name":"Bolivia, Plurinational State of",
+    "ISO 3166": "BO"
+  }, {
+    "Country Code": 2,
+    "Name":"Ireland",
+    "ISO 3166": "IE"
+  }, {
+    "Country Code": 3,
+    "Name":"Saint Martin (French part)",
+    "ISO 3166": "MF"
+  }]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.countries[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "country_info.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.Name"
+        ];
+      rml:predicate ex:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{$.['Country Code']}"
+    ] .
+
+

Output

+
<http://example.com/1> <http://example.com/name> "Bolivia, Plurinational State of" .
+<http://example.com/2> <http://example.com/name> "Ireland" .
+<http://example.com/3> <http://example.com/name> "Saint Martin (French part)" .
+
+
+
+

30. RMLTC0010b-JSON

+

Title: "Template with table columns with special chars"

+

Description: "Tests a template with special chars in column value"

+

Error expected? No

+

Input

+
{
+  "countries": [{
+    "Country Code": 1,
+    "Name":"Bolivia, Plurinational State of",
+    "ISO 3166": "BO"
+  }, {
+    "Country Code": 2,
+    "Name":"Ireland",
+    "ISO 3166": "IE"
+  }, {
+    "Country Code": 3,
+    "Name":"Saint Martin (French part)",
+    "ISO 3166": "MF"
+  }]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.countries[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "country_info.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.Name"
+        ];
+      rml:predicate ex:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{$.['Country Code']}/{$.Name}"
+    ] .
+
+

Output

+
<http://example.com/1/Bolivia%2C%20Plurinational%20State%20of> <http://example.com/name> "Bolivia, Plurinational State of" .
+<http://example.com/2/Ireland> <http://example.com/name> "Ireland" .
+<http://example.com/3/Saint%20Martin%20%28French%20part%29> <http://example.com/name> "Saint Martin (French part)" .
+
+
+
+

31. RMLTC0010c-JSON

+

Title: "Template with table columns with special chars and backslashes"

+

Description: "Tests a template with special chars in reference value and backslash escapes in string templates"

+

Error expected? No

+

Input

+
{
+  "countries": [{
+    "Country Code": 1,
+    "Name":"Bolivia, Plurinational State of",
+    "ISO 3166": "BO"
+  }, {
+    "Country Code": 2,
+    "Name":"Ireland",
+    "ISO 3166": "IE"
+  }, {
+    "Country Code": 3,
+    "Name":"Saint Martin (French part)",
+    "ISO 3166": "MF"
+  }]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.countries[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "country_info.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:predicate ex:code;
+      rml:objectMap [
+          rml:template "\\{\\{\\{ {$.['ISO 3166']} \\}\\}\\}";
+          rml:termType rml:Literal
+        ]
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{$.['Country Code']}/{$.Name}"
+    ] .
+
+

Output

+
<http://example.com/1/Bolivia%2C%20Plurinational%20State%20of> <http://example.com/code> "{{{ BO }}}" .
+<http://example.com/2/Ireland> <http://example.com/code> "{{{ IE }}}" .
+<http://example.com/3/Saint%20Martin%20%28French%20part%29> <http://example.com/code> "{{{ MF }}}" .
+
+
+
+

32. RMLTC0011b-JSON

+

Title: "M to M relation, by using an additional Triples Map"

+

Description: "Tests, M to M relations, by using an additional Triples Map"

+

Error expected? No

+

Input

+
{
+  "students": [
+    {"ID":10, "FirstName":"Venus", "LastName":"Williams"},
+    {"ID":11, "FirstName":"Fernando", "LastName":"Alonso"},
+    {"ID":12, "FirstName":"David", "LastName":"Villa"}
+  ]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/LinkMap_1_2> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.links[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student_sport.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:template "http://example.com/sport/{$.ID_Sport}"
+        ];
+      rml:predicate ex:plays
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/student/{$.ID_Student}"
+    ] .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.FirstName"
+        ];
+      rml:predicate ex:firstName
+    ], [
+      rml:objectMap [
+          rml:reference "$.LastName"
+        ];
+      rml:predicate ex:lastName
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/student/{$.ID}"
+    ] .
+
+<http://example.com/base/TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.sports[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "sport.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.Description"
+        ];
+      rml:predicate ex:description
+    ], [
+      rml:objectMap [
+          rml:reference "$.ID"
+        ];
+      rml:predicate ex:id
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/sport/{$.ID}"
+    ] .
+
+

Output

+
<http://example.com/student/10> <http://example.com/lastName> "Williams" .
+<http://example.com/student/10> <http://example.com/firstName> "Venus" .
+<http://example.com/student/12> <http://example.com/lastName> "Villa" .
+<http://example.com/student/12> <http://example.com/firstName> "David" .
+<http://example.com/student/11> <http://example.com/lastName> "Alonso" .
+<http://example.com/student/11> <http://example.com/firstName> "Fernando" .
+<http://example.com/sport/110> <http://example.com/description> "Tennis" .
+<http://example.com/sport/110> <http://example.com/id> "110" .
+<http://example.com/sport/111> <http://example.com/description> "Football" .
+<http://example.com/sport/111> <http://example.com/id> "111" .
+<http://example.com/sport/112> <http://example.com/description> "Formula1" .
+<http://example.com/sport/112> <http://example.com/id> "112" .
+<http://example.com/student/10> <http://example.com/plays> <http://example.com/sport/110> .
+<http://example.com/student/12> <http://example.com/plays> <http://example.com/sport/111> .
+<http://example.com/student/11> <http://example.com/plays> <http://example.com/sport/112> .
+<http://example.com/student/11> <http://example.com/plays> <http://example.com/sport/111> .
+
+
+
+

33. RMLTC0012a-JSON

+

Title: "Blank node referencing multiple columns"

+

Description: "Tests that blank nodes can be generated by referencing multiple columns"

+

Error expected? No

+

Input

+
{
+  "persons": [
+    {"fname":"Bob","lname":"Smith","amount":30},
+    {"fname":"Sue","lname":"Jones","amount":20},
+    {"fname":"Bob","lname":"Smith","amount":30}
+  ]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.persons[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "persons.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:template "{$.fname} {$.lname}";
+          rml:termType rml:Literal
+        ];
+      rml:predicate foaf:name
+    ], [
+      rml:objectMap [
+          rml:reference "$.amount"
+        ];
+      rml:predicate ex:amount
+    ];
+  rml:subjectMap [
+      rml:template "{$.fname}{$.lname}{$.amount}";
+      rml:termType rml:BlankNode
+    ] .
+
+

Output

+
_:BobSmith30 <http://example.com/amount> "30" .
+_:BobSmith30 <http://xmlns.com/foaf/0.1/name> "Bob Smith" .
+_:SueJones20 <http://example.com/amount> "20" .
+_:SueJones20 <http://xmlns.com/foaf/0.1/name> "Sue Jones" .
+
+
+
+

34. RMLTC0012b-JSON

+

Title: "Duplicate tuples generate same blank node"

+

Description: "Tests that blank nodes with same identifier and in the same graph but generated by different logical rows are considered equivalent."

+

Error expected? No

+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.persons[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "persons.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:template "{$.fname} {$.lname}";
+          rml:termType rml:Literal
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "{$.fname}{$.lname}";
+      rml:termType rml:BlankNode
+    ] .
+
+<http://example.com/base/TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.lives[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "lives.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.city"
+        ];
+      rml:predicate ex:city
+    ];
+  rml:subjectMap [
+      rml:template "{$.fname}{$.lname}";
+      rml:termType rml:BlankNode
+    ] .
+
+

Output

+
_:BobSmith <http://example.com/city> "London" .
+_:BobSmith <http://xmlns.com/foaf/0.1/name> "Bob Smith" .
+_:SueJones <http://example.com/city> "Madrid" .
+_:SueJones <http://xmlns.com/foaf/0.1/name> "Sue Jones" .
+
+
+
+

35. RMLTC0012c-JSON

+

Title: "TriplesMap without subjectMap"

+

Description: "Tests a RML with missing information, TriplesMap without subjectMap."

+

Error expected? Yes

+

Input

+
{
+  "persons": [
+    {"fname":"Bob","lname":"Smith","amount":30},
+    {"fname":"Sue","lname":"Jones","amount":20},
+    {"fname":"Bob","lname":"Smith","amount":30}
+  ]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.persons[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "persons.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:template "{$.fname} {$.lname}";
+          rml:termType rml:Literal
+        ];
+      rml:predicate foaf:name
+    ], [
+      rml:objectMap [
+          rml:reference "$.amount"
+        ];
+      rml:predicate ex:amount
+    ] .
+
+
+

36. RMLTC0012d-JSON

+

Title: "TriplesMap with two subjectMap"

+

Description: "Tests a RML with wrong information, TriplesMap with two subjectMap."

+

Error expected? Yes

+

Input

+
{
+  "persons": [
+    {"fname":"Bob","lname":"Smith","amount":30},
+    {"fname":"Sue","lname":"Jones","amount":20},
+    {"fname":"Bob","lname":"Smith","amount":30}
+  ]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.persons[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "persons.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:template "{$.fname} {$.lname}";
+          rml:termType rml:Literal
+        ];
+      rml:predicate foaf:name
+    ], [
+      rml:objectMap [
+          rml:reference "$.amount"
+        ];
+      rml:predicate ex:amount
+    ];
+  rml:subjectMap [
+      rml:template "{$.fname}_{$.lname}_{$.amount}";
+      rml:termType rml:BlankNode
+    ], [
+      rml:template "{$.amount}_{$.fname}_{$.lname}";
+      rml:termType rml:BlankNode
+    ] .
+
+
+

37. RMLTC0013a-JSON

+

Title: "Null value in JSON file"

+

Description: "Tests if null values in JSON files are handled correctly."

+

Error expected? No

+

Input

+
{
+  "persons": [
+    {"ID":"1","Name":"Alice","DateOfBirth":null},
+    {"ID":"2","Name":"Bob","DateOfBirth":"September, 2010"}
+  ]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.persons[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "persons.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.DateOfBirth"
+        ];
+      rml:predicate ex:BirthDay
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Person/{$.ID}/{$.Name}/{$.DateOfBirth}"
+    ] .
+
+

Output

+
<http://example.com/Person/2/Bob/September%2C%202010> <http://example.com/BirthDay> "September, 2010" .
+
+
+

38. RMLTC0015a-JSON

+

Title: "Generation of language tags from a table with language information"

+

Description: "Generation of language tags from a table with language information"

+

Error expected? No

+

Input

+
{
+  "countries": [
+    {"Code": "BO", "Name": "Bolivia, Plurinational State of"},
+    {"Code": "IE", "Name": "Ireland"}
+  ]
+}
+
+

Mapping

+
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.countries[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "country_en.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:language "en";
+          rml:reference "$.Name"
+        ];
+      rml:predicate rdfs:label
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{$.Code}"
+    ] .
+
+<http://example.com/base/TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.countries[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "country_es.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:language "es";
+          rml:reference "$.Name"
+        ];
+      rml:predicate rdfs:label
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{$.Code}"
+    ] .
+
+

Output

+
<http://example.com/BO> <http://www.w3.org/2000/01/rdf-schema#label> "Bolivia, Plurinational State of"@en .
+<http://example.com/BO> <http://www.w3.org/2000/01/rdf-schema#label> "Estado Plurinacional de Bolivia"@es .
+<http://example.com/IE> <http://www.w3.org/2000/01/rdf-schema#label> "Ireland"@en .
+<http://example.com/IE> <http://www.w3.org/2000/01/rdf-schema#label> "Irlanda"@es .
+
+
+
+
+

39. RMLTC0015b-JSON

+

Title: "Generation of language tags from a table with language information, and a term map with invalid rml:language value"

+

Description: "Tests a term map with an invalid rml:language value, which is an error"

+

Error expected? Yes

+

Input

+
{
+  "countries": [
+    {"Code": "BO", "Name": "Bolivia, Plurinational State of"},
+    {"Code": "IE", "Name": "Ireland"}
+  ]
+}
+
+

Mapping

+
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.countries[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "country_en.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:language "a-english";
+          rml:reference "$.Name"
+        ];
+      rml:predicate rdfs:label
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{$.Code}"
+    ] .
+
+<http://example.com/base/TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.countries[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "country_en.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:language "a-spanish";
+          rml:reference "$.Name"
+        ];
+      rml:predicate rdfs:label
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{$.Code}"
+    ] .
+
+
+

40. RMLTC0019a-JSON

+

Title: "Generation of triples by using IRI value in columns"

+

Description: "Test the generation of triples by using IRI value in attributes"

+

Error expected? No

+

Input

+
{
+  "persons": [
+    {
+      "ID": 10,
+      "FirstName": "http://example.com/ns#Jhon",
+      "LastName": "Smith"
+    },
+    {
+      "ID": 20,
+      "FirstName": "Carlos",
+      "LastName": "Mendoza"
+    }
+  ]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.persons[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "persons.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.FirstName"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:reference "$.FirstName"
+    ] .
+
+

Output

+
<http://example.com/ns#Jhon> <http://xmlns.com/foaf/0.1/name> "http://example.com/ns#Jhon" .
+<http://example.com/base/Carlos> <http://xmlns.com/foaf/0.1/name> "Carlos" .
+
+
+

41. RMLTC0019b-JSON

+

Title: "Generation of triples by using IRI value in columns, with data error"

+

Description: "Test the generation of triples by using IRI value in attributes, conforming RML mapping with data error (and limited results)"

+

Error expected? No

+

Input

+
{
+  "persons": [
+    {
+      "ID": 10,
+      "FirstName": "http://example.com/ns#Jhon",
+      "LastName": "Smith"
+    },
+    {
+      "ID": 20,
+      "FirstName": "Carlos",
+      "LastName": "Mendoza"
+    },
+    {
+      "ID": 30,
+      "FirstName": "Juan Daniel",
+      "LastName": "Crespo"
+    }
+  ]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.persons[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "persons.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.FirstName"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:reference "$.FirstName"
+    ] .
+
+

Output

+

+
+
+

42. RMLTC0020a-JSON

+

Title: "Generation of triples by using IRI value in columns"

+

Description: "Test the generation of triples by using IRI value in attributes"

+

Error expected? No

+

Input

+
{
+  "students": [
+    {"Name": "http://example.com/company/Alice"},
+    {"Name": "Bob"},
+    {"Name": "Bob/Charles"},
+    {"Name": "path/../Danny"},
+    {"Name": "Emily Smith"}
+  ]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:object foaf:Person;
+      rml:predicate rdf:type
+    ];
+  rml:subjectMap [
+      rml:template "{$.Name}";
+      rml:termType rml:IRI
+    ] .
+
+

Output

+
<http://example.com/base/http%3A%2F%2Fexample.com%2Fcompany%2FAlice> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/base/Bob> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/base/Bob%2FCharles> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/base/path%2F..%2FDanny> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/base/Emily%20Smith> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+
+
+

43. RMLTC0021a-JSON

+

Title: "Generation of triples referencing object map"

+

Description: "Tests the mapping specification referencing object map with same logical source and join condition"

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "Name":"Venus Williams",
+    "Sport": "Tennis"
+  }, {
+    "ID": 20,
+    "Name":"Serena Williams",
+    "Sport": "Tennis"
+  }, {
+    "ID": 30,
+    "Name":"Loena Hendrickx",
+    "Sport": "Figure skating"
+  }]
+}
+
+

Mapping

+
@prefix activity: <http://example.com/activity/> .
+@prefix ex: <http://example.com/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/RefObjectMap1> a rml:RefObjectMap;
+  rml:joinCondition [
+      rml:child "$.Sport";
+      rml:parent "$.Sport"
+    ];
+  rml:parentTriplesMap <http://example.com/base/TriplesMap1> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap <http://example.com/base/RefObjectMap1>;
+      rml:predicate ex:sameSportAs
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Student/{$.ID}/{$.Name}"
+    ] .
+
+

Output

+
<http://example.com/Student/10/Venus%20Williams> <http://example.com/sameSportAs> <http://example.com/Student/10/Venus%20Williams> . 
+<http://example.com/Student/10/Venus%20Williams> <http://example.com/sameSportAs> <http://example.com/Student/20/Serena%20Williams> . 
+<http://example.com/Student/20/Serena%20Williams> <http://example.com/sameSportAs> <http://example.com/Student/20/Serena%20Williams> . 
+<http://example.com/Student/20/Serena%20Williams> <http://example.com/sameSportAs> <http://example.com/Student/10/Venus%20Williams> . 
+<http://example.com/Student/30/Loena%20Hendrickx> <http://example.com/sameSportAs> <http://example.com/Student/30/Loena%20Hendrickx> . 
+
+
+
+
+

44. RMLTC0022a-JSON

+

Title: "Generating of triples with constant datatype"

+

Description: "Test triples with a fixed constant datatype"

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "Name":"Venus"
+  }]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:datatype xsd:string;
+          rml:reference "$.Name"
+        ];
+      rml:predicate foaf:name
+    ], [
+      rml:objectMap [
+          rml:datatype xsd:int;
+          rml:reference "$.Age"
+        ];
+      rml:predicate ex:age
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{$.Name}"
+    ] .
+
+

Output

+
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "Venus"^^<http://www.w3.org/2001/XMLSchema#string> .
+<http://example.com/Venus> <http://example.com/age> "21"^^<http://www.w3.org/2001/XMLSchema#int> .
+
+
+

45. RMLTC0022b-JSON

+

Title: "Generating of triples with datatypeMap"

+

Description: "Test triples with a XSD datatype generated from the data"

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "Name":"Venus"
+  }]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:referenceFormulation rml:JSONPath;
+      rml:iterator "$.[*]";
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "data.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:datatypeMap [
+              rml:template "http://www.w3.org/2001/XMLSchema#{$.BAR}"
+            ];
+          rml:reference "$.FOO"
+        ];
+      rml:predicate ex:x
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{$.FOO}"
+    ] .
+
+
+

Output

+
<http://example.com/1> <http://example.com/x> "1"^^<http://www.w3.org/2001/XMLSchema#string> .
+<http://example.com/2> <http://example.com/x> "2"^^<http://www.w3.org/2001/XMLSchema#int> .
+
+
+

46. RMLTC0022c-JSON

+

Title: "Generating of triples with datatypeMap with custom datatype"

+

Description: "Test triples with a custom datype from the data"

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "Name":"Venus"
+  }]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:referenceFormulation rml:JSONPath;
+      rml:iterator "$.[*]";
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "data.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:datatypeMap [
+              rml:template "datatype#{$.BAR}"
+            ];
+          rml:reference "$.FOO"
+        ];
+      rml:predicate ex:x
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{$.FOO}"
+    ] .
+
+

Output

+
<http://example.com/1> <http://example.com/x> "1"^^<http://www.w3.org/2001/XMLSchema#string> .
+<http://example.com/2> <http://example.com/x> "2"^^<http://www.w3.org/2001/XMLSchema#int> .
+
+
+

47. RMLTC0023a-JSON

+

Title: "Invalid IRI template 1"

+

Description: "Test handling of invalid IRI template"

+

Error expected? Yes

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "Name":"Venus"
+  }]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:referenceFormulation rml:JSONPath;
+      rml:iterator "$.students[*]";
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{NON_EXISTING_COLUMN}";
+      rml:class foaf:Person;
+    ] .
+
+
+

48. RMLTC0023b-JSON

+

Title: "Invalid IRI template 2"

+

Description: "Test handling of invalid IRI template"

+

Error expected? Yes

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "{Name}":"Venus"
+  }]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:referenceFormulation rml:JSONPath;
+      rml:iterator "$.students[*]";
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{{Name}}";
+      rml:class foaf:Person;
+    ] .
+
+
+

49. RMLTC0023c-JSON

+

Title: "Invalid IRI template 3"

+

Description: "Test handling of invalid IRI template"

+

Error expected? Yes

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "N\ame":"Venus"
+  }]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:referenceFormulation rml:JSONPath;
+      rml:iterator "$.students[*]";
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{N\ame}";
+      rml:class foaf:Person;
+    ] .
+
+
+
+

50. RMLTC0023d-JSON

+

Title: "Invalid IRI template 4"

+

Description: "Test handling of invalid IRI template"

+

Error expected? Yes

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "Name":"Venus"
+  }]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:referenceFormulation rml:JSONPath;
+      rml:iterator "$.students[*]";
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{Name\}";
+      rml:class foaf:Person;
+    ] .
+
+
+
+

51. RMLTC0023e-JSON

+

Title: "Invalid IRI template 5"

+

Description: "Test handling of invalid IRI template"

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "{Name}":"Venus"
+  }]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+     rml:referenceFormulation rml:JSONPath;
+     rml:iterator "$.students[*]";
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{\\{Name\\}}";
+      rml:class foaf:Person;
+    ] .
+
+
+

Output

+
<http://example.com/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+
+
+

52. RMLTC0023f-JSON

+

Title: "Invalid IRI template 6"

+

Description: "Test handling of invalid IRI template"

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "N\ame":"Venus"
+  }]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:referenceFormulation rml:JSONPath;
+      rml:iterator "$.students[*]";
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{N\\\ame}";
+      rml:class foaf:Person;
+    ] .
+
+

Output

+
<http://example.com/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+
+
+

53. RMLTC0025a-JSON

+

Title: "Generation of triples with constant blank node "

+

Description: "Tests the generation of triples with a constant blank node"

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "Name":"Venus"
+  },
+  {
+    "Name":"Julio"
+  }]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix ex: <http://example.com/>.
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.Name"
+        ];
+      rml:predicate ex:student
+    ];
+  rml:subject _:School .
+
+

Output

+
_:School <http://example.com/student> "Julio" .
+_:School <http://example.com/student> "Venus" .
+
+
+

54. RMLTC0025b-JSON

+

Title: "Usage of constant term maps in combination with explicitly defined term types"

+

Description: "Tests the usage of constant term maps in combination with explicitly defined term types"

+

Error expected? Yes

+

Input

+
{
+  "students": [{
+    "Name":"Venus"
+  },
+  {
+    "Name":"Julio"
+  }]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix ex: <http://example.com/>.
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.Name"
+        ];
+      rml:predicate ex:student
+    ];
+  rml:subjectMap [
+      rml:constant "School";
+      rml:termType rml:BlankNode
+  ] .
+
+
+

55. RMLTC0026a-JSON

+

Title: "Generation of triples from arrays"

+

Description: "Tests the generation of triples from array input data structures"

+

Error expected? No

+

Input

+
{
+  "persons": [
+    {"fname":"Bob","lname":"Smith","amounts":[30, 40, 50]}
+  ]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.persons[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "persons.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.amounts"
+        ];
+      rml:predicate ex:amount
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Student/{$.fname}/{$.lname}"
+    ] .
+
+

Output

+
<http://example.com/Student/Bob/Smith> <http://example.com/amount> "30" .
+<http://example.com/Student/Bob/Smith> <http://example.com/amount> "40" .
+<http://example.com/Student/Bob/Smith> <http://example.com/amount> "50" .
+
+
+ + + + + \ No newline at end of file diff --git a/src/test/resources/rml-core/docs/20250228/index.html b/src/test/resources/rml-core/docs/20250228/index.html new file mode 100644 index 00000000..d298e7e3 --- /dev/null +++ b/src/test/resources/rml-core/docs/20250228/index.html @@ -0,0 +1,3113 @@ + + + + + + +RML-Core: Test Cases + + + + + + + + + + + + + + +
+ +

RML-Core: Test Cases

+

+ Draft Community Group Report + +

+
+ +
Latest published version:
+ https://www.w3.org/RML-Core-Testcases/ +
+
Latest editor's draft:
https://w3id.org/rml/core/test-cases/
+ + + + +
Editor:
+ Dylan Van Assche + + + + (IDLab – Ghent University – imec) +
+ +
Author:
+ Dylan Van Assche + + + + (IDLab – Ghent University – imec) +
+
Feedback:
+ GitHub kg-construct/rml-core + (pull requests, + new issue, + open issues) +
+ +
+ + +
+
+ + + +

Abstract

This document defines the RML-Core test cases to the determine the RML-Core specification conformance of tools.

+
+ +

Status of This Document

+ This specification was published by the + Knowledge Graph Construction Community Group. It is not a W3C Standard nor is it + on the W3C Standards Track. + + Please note that under the + W3C Community Contributor License Agreement (CLA) + there is a limited opt-out and other conditions apply. + + Learn more about + W3C Community and Business Groups. +

+ GitHub Issues are preferred for + discussion of this specification. + + +

+ +

1. Introduction

+

This document defines the RML-Core test cases, consisting of a collection of test case documents (input and expected output). +The purpose of the test cases is to determine the conformance of tools that execute RML rules to the RML-Core specification.

+
+ +

2. Data model

+

The test cases are semantically described for re-usability and shareability following the W3C Test case description. +Each test:Testcase as the following properties:

+
    +
  • dcterms:identifier: unique ID of the test case.
  • +
  • rmltest:hasError: if an error of the RML Processor is expected or not.
  • +
  • rmltest:input: One or more input data of the test case.
  • +
  • rmltest:output: One or more output data of the test case.
  • +
  • rmltest:inputFormat: the input data format.
  • +
  • rmltest:outputFormat: the output data format.
  • +
  • rmltest:mappingDocument: the RML mapping rules in Turtle.
  • +
+
+ +

3. Test cases

+

This section describes the RML-Core test cases. These descriptions are also available as RDF. +The files are available on GitHub in the folder test-cases. +Each test case is contained in a single folder, containing three types of files:

+
    +
  • Zero or more files containing the data sources, in the case of JSON, XML, CSV, or containing the SQL statements to create the necessary tables, in the case of MySQL, PostgreSQL, and SQL Server.
  • +
  • One file with the RML rules, called mapping.ttl, in the Turtle format.
  • +
  • Zero or more files with the expected RDF. No file is provided if an error is expected that must halt the generation of the RDF because of an error.
  • +
+
+ + +

4. RMLTC0000-JSON

+

Title: "one table, one column, zero rows"

+

Description: "Tests if an empty table produces an empty RDF graph"

+

Error expected? No

+

Input

+
{
+  "students": []
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.Name"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{$.Name}"
+    ] .
+
+

Output

+
# empty database
+
+
+

5. RMLTC0001a-JSON

+

Title: "One column mapping, subject URI generation by using rml:template"

+

Description: "Tests: (1) one column mapping; (2) subject URI generation by using rml:template; (3) one column to one property"

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "Name":"Venus"
+  }]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.Name"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap <http://example.com/base/#NameSubjectMap> .
+
+<http://example.com/base/#NameSubjectMap> rml:template "http://example.com/{$.Name}" .
+
+

Output

+
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
+
+
+
+

6. RMLTC0001b-JSON

+

Title: "One column mapping, generation of a BlankNode subject by using rml:termType"

+

Description: "Tests: (1) one column mapping; (2) generation of a BlankNode subject by using rml:termType; (3) one column to one property"

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "Name":"Venus"
+  }]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.Name"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "{$.Name}";
+      rml:termType rml:BlankNode
+    ] .
+
+

Output

+
_:Venus <http://xmlns.com/foaf/0.1/name> "Venus" .
+
+
+
+

7. RMLTC0002a-JSON

+

Title: "Two columns mapping, generation of a subject URI by the concatenation of two column values"

+

Description: "Tests: (1) two column mapping, no primary key; (2) subject URI generated by the concatenation of two column values; (3) one column to one property"

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "Name":"Venus"
+  }]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.ID"
+        ];
+      rml:predicate ex:id
+    ], [
+      rml:objectMap [
+          rml:reference "$.Name"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:class foaf:Person;
+      rml:template "http://example.com/{$.ID}/{$.Name}"
+    ] .
+
+

Output

+
<http://example.com/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
+<http://example.com/10/Venus> <http://example.com/id> "10" .
+<http://example.com/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+
+
+
+

8. RMLTC0002b-JSON

+

Title: "Two columns mapping, generation of a BlankNode subject by using rml:template and rml:termType"

+

Description: "Tests: (1) two column mapping, no primary key; (2) generation of a BlankNode subject by using rml:template; (3) one column to one property"

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "Name":"Venus"
+  }]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.Name"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "students{$.ID}";
+      rml:termType rml:BlankNode
+    ] .
+
+

Output

+
_:students10 <http://xmlns.com/foaf/0.1/name> "Venus" .
+
+
+
+

9. RMLTC0002e-JSON

+

Title: "Two columns mapping, an undefined rml:path"

+

Description: "Tests the presence of an undefined rml:path"

+

Error expected? Yes

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "Name":"Venus"
+  }]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student2.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.IDs"
+        ];
+      rml:predicate ex:id
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{$.ID}/{$.Name}"
+    ] .
+
+
+

10. RMLTC0002g-JSON

+

Title: "Two columns mapping, invalid JSONPath"

+

Description: "Test the presence of an invalid JSONPath"

+

Error expected? Yes

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "Name":"Venus"
+  }]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student2.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.IDs"
+        ];
+      rml:predicate ex:id
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{$.ID}/{$.Name}"
+    ] .
+
+
+

11. RMLTC0003c-JSON

+

Title: "Three columns mapping, by using a rml:template to produce literal"

+

Description: "Tests: (1) three column mapping; and (2) the use of rml:template to produce literal"

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "FirstName":"Venus",
+    "LastName":"Williams"
+  }]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:template "{$.FirstName} {$.LastName}";
+          rml:termType rml:Literal
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Student{$.ID}"
+    ] .
+
+

Output

+
<http://example.com/Student10> <http://xmlns.com/foaf/0.1/name> "Venus Williams" .
+
+
+

12. RMLTC0004a-JSON

+

Title: "Two column mapping, from one row table to two different triples"

+

Description: "Tests: (1) two column mapping, (2) subject URI generated by a column value; (3) from one row table to two different triples (4) typing by using rml:class"

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "Student": "Venus",
+    "Sport":"Tennis"
+  }]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student_sport.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.Student"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:class ex:Student;
+      rml:template "http://example.com/{$.Student}"
+    ] .
+
+<http://example.com/base/TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student_sport.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.Sport"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:class ex:Sport;
+      rml:template "http://example.com/{$.Sport}"
+    ] .
+
+

Output

+
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
+<http://example.com/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/Student> .
+<http://example.com/Tennis> <http://xmlns.com/foaf/0.1/name> "Tennis" .
+<http://example.com/Tennis> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/Sport> .
+
+
+
+

13. RMLTC0004b-JSON

+

Title: "One column mapping, presence of rml:termType rml:Literal on rml:subjectMap"

+

Description: "Tests: (1) one column mapping (2) the presence of rml:termType rml:Literal on rml:subjectMap, which is invalid"

+

Error expected? Yes

+

Input

+
{
+  "students": [{
+    "Name":"Venus"
+  }]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.Name"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{$.Name}";
+      rml:termType rml:Literal
+    ] .
+
+
+

14. RMLTC0005a-JSON

+

Title: "Typing of resources"

+

Description: "Tests the typing of resources"

+

Error expected? No

+

Input

+
{
+  "persons": [
+    {
+      "fname": "Bob",
+      "lname": "Smith",
+      "amount": "30.0E0"
+    },
+    {
+      "fname": "Sue",
+      "lname": "Jones",
+      "amount": "20.0E0"
+    },
+    {
+      "fname": "Bob",
+      "lname": "Smith",
+      "amount": "30.0E0"
+    }
+  ]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.persons[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "ious.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.amount"
+        ];
+      rml:predicate ex:owes
+    ];
+  rml:subjectMap [
+      rml:class foaf:Person;
+      rml:template "http://example.com/{$.fname};{$.lname}"
+    ] .
+
+

Output

+
<http://example.com/Bob;Smith> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Bob;Smith> <http://example.com/owes> "30.0E0" .
+<http://example.com/Sue;Jones> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Sue;Jones> <http://example.com/owes> "20.0E0" .
+
+
+
+

15. RMLTC0006a-JSON

+

Title: "Use of rml:constant in rml:subjectMap, rml:predicateMap, rml:objectMap and rml:graphMap"

+

Description: "Tests the use of rml:constant in rml:subjectMap, rml:predicateMap, rml:objectMap and rml:graphMap"

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "FirstName":"Venus",
+    "LastName":"Williams"
+  }]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:constant "Bad Student"
+        ];
+      rml:predicateMap [
+          rml:constant ex:description
+        ]
+    ];
+  rml:subjectMap [
+      rml:constant ex:BadStudent;
+      rml:graphMap [
+          rml:constant <http://example.com/graph/student>
+        ]
+    ] .
+
+

Output

+
<http://example.com/BadStudent> <http://example.com/description> "Bad Student" <http://example.com/graph/student> .
+
+
+

16. RMLTC0007a-JSON

+

Title: "Typing resources by relying on rdf:type predicate"

+

Description: "Tests the typing resources by relying on rdf:type predicate"

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "FirstName":"Venus",
+    "LastName":"Williams"
+  }]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:object foaf:Person;
+      rml:predicate rdf:type
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Student/{$.ID}/{$.FirstName}"
+    ] .
+
+

Output

+
 <http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+
+
+
+

17. RMLTC0007b-JSON

+

Title: "Assigning triples to Named Graphs"

+

Description: "Tests the generation of triples to a named graph"

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "FirstName":"Venus",
+    "LastName":"Williams"
+  }]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:object foaf:Person;
+      rml:predicate rdf:type
+    ], [
+      rml:objectMap [
+          rml:reference "$.FirstName"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:graph ex:PersonGraph;
+      rml:template "http://example.com/Student/{$.ID}/{$.FirstName}"
+    ] .
+
+

Output

+
<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" <http://example.com/PersonGraph> . 
+<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person>  <http://example.com/PersonGraph> .
+
+
+
+

18. RMLTC0007c-JSON

+

Title: "One row mapping, using rml:class"

+

Description: "Tests subjectmap with more than one class IRIs, rml:class"

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "FirstName":"Venus",
+    "LastName":"Williams"
+  }]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.ID"
+        ];
+      rml:predicate ex:id
+    ], [
+      rml:objectMap [
+          rml:reference "$.FirstName"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:class ex:Student, foaf:Person;
+      rml:template "http://example.com/Student/{$.ID}/{$.FirstName}"
+    ] .
+
+

Output

+
<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
+<http://example.com/Student/10/Venus> <http://example.com/id> "10" . 
+<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/Student> .
+
+
+
+

19. RMLTC0007d-JSON

+

Title: "One column mapping, specifying an rml:predicateObjectMap with rdf:type"

+

Description: "Tests subjectmap with an alternative of having rml:class, i.e., by specifying an rml:predicateObjectMap with predicate rdf:type"

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "FirstName":"Venus",
+    "LastName":"Williams"
+  }]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:object foaf:Person;
+      rml:predicate rdf:type
+    ], [
+      rml:object ex:Student;
+      rml:predicate rdf:type
+    ], [
+      rml:objectMap [
+          rml:reference "$.ID"
+        ];
+      rml:predicate ex:id
+    ], [
+      rml:objectMap [
+          rml:reference "$.FirstName"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Student/{$.ID}/{$.FirstName}"
+    ] .
+
+

Output

+
<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" . 
+<http://example.com/Student/10/Venus> <http://example.com/id> "10" .
+<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/Student> .
+
+
+
+

20. RMLTC0007e-JSON

+

Title: "One column mapping, using rml:graphMap and rml:class"

+

Description: "Tests subjectmap with rml:graphMap and rml:class"

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "Name":"Venus"
+  }]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.ID"
+        ];
+      rml:predicate ex:id
+    ], [
+      rml:objectMap [
+          rml:reference "$.Name"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:class foaf:Person;
+      rml:graph ex:PersonGraph;
+      rml:template "http://example.com/Student/{$.ID}/{$.Name}"
+    ] .
+
+

Output

+
<http://example.com/Student/10/Venus> <http://example.com/id> "10" <http://example.com/PersonGraph> .
+<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" <http://example.com/PersonGraph> .
+<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> <http://example.com/PersonGraph> .
+
+
+
+

21. RMLTC0007f-JSON

+

Title: "One column mapping, using rml:graphMap and specifying an rml:predicateObjectMap with rdf:type"

+

Description: "Tests subjectmap with rml:graphMap and specifying an rml:predicateObjectMap with predicate rdf:type"

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "FirstName":"Venus",
+    "LastName":"Williams"
+  }]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:object foaf:Person;
+      rml:predicate rdf:type
+    ], [
+      rml:objectMap [
+          rml:reference "$.ID"
+        ];
+      rml:predicate ex:id
+    ], [
+      rml:objectMap [
+          rml:reference "$.FirstName"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:graph ex:PersonGraph;
+      rml:template "http://example.com/Student/{$.ID}/{$.FirstName}"
+    ] .
+
+

Output

+
<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> <http://example.com/PersonGraph> .
+<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" <http://example.com/PersonGraph> .
+<http://example.com/Student/10/Venus> <http://example.com/id> "10" <http://example.com/PersonGraph> .
+
+
+
+

22. RMLTC0007g-JSON

+

Title: "Assigning triples to the default graph"

+

Description: "Tests the generation of triples to the default graph"

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "FirstName":"Venus",
+    "LastName":"Williams"
+  }]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.FirstName"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:graph rml:defaultGraph;
+      rml:template "http://example.com/Student/{$.ID}/{$.FirstName}"
+    ] .
+
+

Output

+
<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
+
+
+
+

23. RMLTC0007h-JSON

+

Title: "Assigning triples to a non-IRI named graph"

+

Description: "Tests the generation of triples to a non-IRI named graph, which is an error"

+

Error expected? Yes

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "FirstName":"Venus",
+    "LastName":"Williams"
+  }]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.FirstName"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:graphMap [
+          rml:reference "$.ID";
+          rml:termType rml:Literal
+        ];
+      rml:template "http://example.com/Student/{$.ID}/{$.FirstName}"
+    ] .
+
+
+

24. RMLTC0008a-JSON

+

Title: "Generation of triples to a target graph by using rml:graphMap and rml:template"

+

Description: "Test that results of the mapping can be directed to a target graph by using rml:graphMap and rml:template"

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "Name":"Venus Williams",
+    "Sport": "Tennis"
+  }]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:object foaf:Person;
+      rml:predicate rdf:type
+    ], [
+      rml:objectMap [
+          rml:reference "$.ID"
+        ];
+      rml:predicate ex:id
+    ], [
+      rml:objectMap [
+          rml:reference "$.Name"
+        ];
+      rml:predicate foaf:name
+    ], [
+      rml:objectMap [
+          rml:reference "$.Sport"
+        ];
+      rml:predicate ex:Sport
+    ];
+  rml:subjectMap [
+      rml:graphMap [
+          rml:template "http://example.com/graph/Student/{$.ID}/{$.Name}"
+        ];
+      rml:template "http://example.com/Student/{$.ID}/{$.Name}"
+    ] .
+
+

Output

+
<http://example.com/Student/10/Venus%20Williams> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> <http://example.com/graph/Student/10/Venus%20Williams> .
+<http://example.com/Student/10/Venus%20Williams> <http://xmlns.com/foaf/0.1/name> "Venus Williams" <http://example.com/graph/Student/10/Venus%20Williams> .
+<http://example.com/Student/10/Venus%20Williams> <http://example.com/id> "10" <http://example.com/graph/Student/10/Venus%20Williams> . 
+<http://example.com/Student/10/Venus%20Williams> <http://example.com/Sport> "Tennis" <http://example.com/graph/Student/10/Venus%20Williams> . 
+
+
+
+

25. RMLTC0008b-JSON

+

Title: "Generation of triples referencing object map"

+

Description: "Tests the mapping specification referencing object map without join"

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "Name":"Venus Williams",
+    "Sport": "Tennis"
+  }]
+}
+
+

Mapping

+
@prefix activity: <http://example.com/activity/> .
+@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap <http://example.com/base/RefObjectMap1>;
+      rml:predicate ex:Sport
+    ], [
+      rml:object foaf:Person;
+      rml:predicate rdf:type
+    ], [
+      rml:objectMap [
+          rml:reference "$.ID"
+        ];
+      rml:predicate ex:id
+    ], [
+      rml:objectMap [
+          rml:reference "$.Name"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Student/{$.ID}/{$.Name}"
+    ] .
+
+<http://example.com/base/RefObjectMap1> a rml:RefObjectMap;
+  rml:parentTriplesMap <http://example.com/base/TriplesMap2> .
+
+<http://example.com/base/TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:object activity:Sport;
+      rml:predicate rdf:type
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{$.Sport}"
+    ] .
+
+

Output

+
<http://example.com/Student/10/Venus%20Williams> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person>  .
+<http://example.com/Student/10/Venus%20Williams> <http://xmlns.com/foaf/0.1/name> "Venus Williams" .
+<http://example.com/Student/10/Venus%20Williams> <http://example.com/id> "10" . 
+<http://example.com/Student/10/Venus%20Williams> <http://example.com/Sport> <http://example.com/Tennis> . 
+<http://example.com/Tennis> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/activity/Sport> .
+
+
+
+
+

26. RMLTC0008c-JSON

+

Title: "Generation of triples by using multiple predicateMaps within a rml:predicateObjectMap"

+

Description: "Tests the generation of triples by using multiple predicateMaps within a rml:predicateObjectMap"

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "Name":"Venus Williams",
+    "Sport": "Tennis"
+  }]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.Name"
+        ];
+      rml:predicate ex:name, foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Student/{$.ID}/{$.Name}"
+    ] .
+
+

Output

+
<http://example.com/Student/10/Venus%20Williams> <http://xmlns.com/foaf/0.1/name> "Venus Williams"  .
+<http://example.com/Student/10/Venus%20Williams> <http://example.com/name> "Venus Williams"  .
+
+
+
+

27. RMLTC0009a-JSON

+

Title: "Generation of triples from foreign key relations"

+

Description: "Test foreign key relationships among logical tables"

+

Error expected? No

+

Input

+
{
+  "students" : [
+    { 
+      "ID": 10,
+      "Sport": 100,
+      "Name": "Venus Williams"
+    },
+    { 
+      "ID": 20,
+      "Name": "Demi Moore"
+    }
+  ]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.Name"
+        ];
+      rml:predicate foaf:name
+    ], [
+      rml:objectMap [ a rml:RefObjectMap;
+          rml:joinCondition [
+              rml:child "$.Sport";
+              rml:parent "$.ID"
+            ];
+          rml:parentTriplesMap <http://example.com/base/TriplesMap2>
+        ];
+      rml:predicate <http://example.com/ontology/practises>
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/resource/student_{$.ID}"
+    ] .
+
+<http://example.com/base/TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.sports[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "sport.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.Name"
+        ];
+      rml:predicate rdfs:label
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/resource/sport_{$.ID}"
+    ] .
+
+

Output

+
<http://example.com/resource/student_10> <http://xmlns.com/foaf/0.1/name> "Venus Williams"  .
+<http://example.com/resource/student_20> <http://xmlns.com/foaf/0.1/name> "Demi Moore"  .
+<http://example.com/resource/sport_100> <http://www.w3.org/2000/01/rdf-schema#label> "Tennis" .
+<http://example.com/resource/student_10> <http://example.com/ontology/practises> <http://example.com/resource/sport_100>  .
+
+
+

28. RMLTC0009b-JSON

+

Title: "Generation of triples to multiple graphs"

+

Description: "Test that results from distinct parts of the mapping can be directed to different target graphs."

+

Error expected? No

+

Input

+
{
+  "students" : [
+    { 
+      "ID": 10,
+      "Sport": 100,
+      "Name": "Venus Williams"
+    },
+    { 
+      "ID": 20,
+      "Name": "Demi Moore"
+    }
+  ]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:graph <http://example.com/graph/students>;
+      rml:objectMap [
+          rml:reference "$.Name"
+        ];
+      rml:predicate foaf:name
+    ], [
+      rml:graph <http://example.com/graph/practise>;
+      rml:objectMap [ a rml:RefObjectMap;
+          rml:joinCondition [
+              rml:child "$.Sport";
+              rml:parent "$.ID"
+            ];
+          rml:parentTriplesMap <http://example.com/base/TriplesMap2>
+        ];
+      rml:predicate <http://example.com/ontology/practises>
+    ];
+  rml:subjectMap [
+      rml:class <http://example.com/ontology/Student>;
+      rml:graph <http://example.com/graph/students>;
+      rml:template "http://example.com/resource/student_{$.ID}"
+    ] .
+
+<http://example.com/base/TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.sports[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "sport.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.Name"
+        ];
+      rml:predicate rdfs:label
+    ];
+  rml:subjectMap [
+      rml:class <http://example.com/ontology/Sport>;
+      rml:graph <http://example.com/graph/sports>;
+      rml:template "http://example.com/resource/sport_{$.ID}"
+    ] .
+
+

Output

+
<http://example.com/resource/student_10> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/ontology/Student> <http://example.com/graph/students> .
+<http://example.com/resource/student_10> <http://xmlns.com/foaf/0.1/name> "Venus Williams" <http://example.com/graph/students> .
+<http://example.com/resource/student_20> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/ontology/Student> <http://example.com/graph/students> .
+<http://example.com/resource/student_20> <http://xmlns.com/foaf/0.1/name> "Demi Moore" <http://example.com/graph/students> .
+<http://example.com/resource/sport_100> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/ontology/Sport> <http://example.com/graph/sports> .
+<http://example.com/resource/sport_100> <http://www.w3.org/2000/01/rdf-schema#label> "Tennis" <http://example.com/graph/sports> .
+<http://example.com/resource/student_10> <http://example.com/ontology/practises> <http://example.com/resource/sport_100> <http://example.com/graph/practise> .
+<http://example.com/resource/student_10> <http://example.com/ontology/practises> <http://example.com/resource/sport_100> <http://example.com/graph/students> .
+
+
+

29. RMLTC0010a-JSON

+

Title: "Template with table column with blank space"

+

Description: "Tests a template with blank space in column value"

+

Error expected? No

+

Input

+
{
+  "countries": [{
+    "Country Code": 1,
+    "Name":"Bolivia, Plurinational State of",
+    "ISO 3166": "BO"
+  }, {
+    "Country Code": 2,
+    "Name":"Ireland",
+    "ISO 3166": "IE"
+  }, {
+    "Country Code": 3,
+    "Name":"Saint Martin (French part)",
+    "ISO 3166": "MF"
+  }]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.countries[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "country_info.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.Name"
+        ];
+      rml:predicate ex:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{$.['Country Code']}"
+    ] .
+
+

Output

+
<http://example.com/1> <http://example.com/name> "Bolivia, Plurinational State of" .
+<http://example.com/2> <http://example.com/name> "Ireland" .
+<http://example.com/3> <http://example.com/name> "Saint Martin (French part)" .
+
+
+
+

30. RMLTC0010b-JSON

+

Title: "Template with table columns with special chars"

+

Description: "Tests a template with special chars in column value"

+

Error expected? No

+

Input

+
{
+  "countries": [{
+    "Country Code": 1,
+    "Name":"Bolivia, Plurinational State of",
+    "ISO 3166": "BO"
+  }, {
+    "Country Code": 2,
+    "Name":"Ireland",
+    "ISO 3166": "IE"
+  }, {
+    "Country Code": 3,
+    "Name":"Saint Martin (French part)",
+    "ISO 3166": "MF"
+  }]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.countries[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "country_info.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.Name"
+        ];
+      rml:predicate ex:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{$.['Country Code']}/{$.Name}"
+    ] .
+
+

Output

+
<http://example.com/1/Bolivia%2C%20Plurinational%20State%20of> <http://example.com/name> "Bolivia, Plurinational State of" .
+<http://example.com/2/Ireland> <http://example.com/name> "Ireland" .
+<http://example.com/3/Saint%20Martin%20%28French%20part%29> <http://example.com/name> "Saint Martin (French part)" .
+
+
+
+

31. RMLTC0010c-JSON

+

Title: "Template with table columns with special chars and backslashes"

+

Description: "Tests a template with special chars in reference value and backslash escapes in string templates"

+

Error expected? No

+

Input

+
{
+  "countries": [{
+    "Country Code": 1,
+    "Name":"Bolivia, Plurinational State of",
+    "ISO 3166": "BO"
+  }, {
+    "Country Code": 2,
+    "Name":"Ireland",
+    "ISO 3166": "IE"
+  }, {
+    "Country Code": 3,
+    "Name":"Saint Martin (French part)",
+    "ISO 3166": "MF"
+  }]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.countries[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "country_info.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:predicate ex:code;
+      rml:objectMap [
+          rml:template "\\{\\{\\{ {$.['ISO 3166']} \\}\\}\\}";
+          rml:termType rml:Literal
+        ]
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{$.['Country Code']}/{$.Name}"
+    ] .
+
+

Output

+
<http://example.com/1/Bolivia%2C%20Plurinational%20State%20of> <http://example.com/code> "{{{ BO }}}" .
+<http://example.com/2/Ireland> <http://example.com/code> "{{{ IE }}}" .
+<http://example.com/3/Saint%20Martin%20%28French%20part%29> <http://example.com/code> "{{{ MF }}}" .
+
+
+
+

32. RMLTC0011b-JSON

+

Title: "M to M relation, by using an additional Triples Map"

+

Description: "Tests, M to M relations, by using an additional Triples Map"

+

Error expected? No

+

Input

+
{
+  "students": [
+    {"ID":10, "FirstName":"Venus", "LastName":"Williams"},
+    {"ID":11, "FirstName":"Fernando", "LastName":"Alonso"},
+    {"ID":12, "FirstName":"David", "LastName":"Villa"}
+  ]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/LinkMap_1_2> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.links[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student_sport.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:template "http://example.com/sport/{$.ID_Sport}"
+        ];
+      rml:predicate ex:plays
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/student/{$.ID_Student}"
+    ] .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.FirstName"
+        ];
+      rml:predicate ex:firstName
+    ], [
+      rml:objectMap [
+          rml:reference "$.LastName"
+        ];
+      rml:predicate ex:lastName
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/student/{$.ID}"
+    ] .
+
+<http://example.com/base/TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.sports[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "sport.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.Description"
+        ];
+      rml:predicate ex:description
+    ], [
+      rml:objectMap [
+          rml:reference "$.ID"
+        ];
+      rml:predicate ex:id
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/sport/{$.ID}"
+    ] .
+
+

Output

+
<http://example.com/student/10> <http://example.com/lastName> "Williams" .
+<http://example.com/student/10> <http://example.com/firstName> "Venus" .
+<http://example.com/student/12> <http://example.com/lastName> "Villa" .
+<http://example.com/student/12> <http://example.com/firstName> "David" .
+<http://example.com/student/11> <http://example.com/lastName> "Alonso" .
+<http://example.com/student/11> <http://example.com/firstName> "Fernando" .
+<http://example.com/sport/110> <http://example.com/description> "Tennis" .
+<http://example.com/sport/110> <http://example.com/id> "110" .
+<http://example.com/sport/111> <http://example.com/description> "Football" .
+<http://example.com/sport/111> <http://example.com/id> "111" .
+<http://example.com/sport/112> <http://example.com/description> "Formula1" .
+<http://example.com/sport/112> <http://example.com/id> "112" .
+<http://example.com/student/10> <http://example.com/plays> <http://example.com/sport/110> .
+<http://example.com/student/12> <http://example.com/plays> <http://example.com/sport/111> .
+<http://example.com/student/11> <http://example.com/plays> <http://example.com/sport/112> .
+<http://example.com/student/11> <http://example.com/plays> <http://example.com/sport/111> .
+
+
+
+

33. RMLTC0012a-JSON

+

Title: "Blank node referencing multiple columns"

+

Description: "Tests that blank nodes can be generated by referencing multiple columns"

+

Error expected? No

+

Input

+
{
+  "persons": [
+    {"fname":"Bob","lname":"Smith","amount":30},
+    {"fname":"Sue","lname":"Jones","amount":20},
+    {"fname":"Bob","lname":"Smith","amount":30}
+  ]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.persons[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "persons.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:template "{$.fname} {$.lname}";
+          rml:termType rml:Literal
+        ];
+      rml:predicate foaf:name
+    ], [
+      rml:objectMap [
+          rml:reference "$.amount"
+        ];
+      rml:predicate ex:amount
+    ];
+  rml:subjectMap [
+      rml:template "{$.fname}{$.lname}{$.amount}";
+      rml:termType rml:BlankNode
+    ] .
+
+

Output

+
_:BobSmith30 <http://example.com/amount> "30" .
+_:BobSmith30 <http://xmlns.com/foaf/0.1/name> "Bob Smith" .
+_:SueJones20 <http://example.com/amount> "20" .
+_:SueJones20 <http://xmlns.com/foaf/0.1/name> "Sue Jones" .
+
+
+
+

34. RMLTC0012b-JSON

+

Title: "Duplicate tuples generate same blank node"

+

Description: "Tests that blank nodes with same identifier and in the same graph but generated by different logical rows are considered equivalent."

+

Error expected? No

+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.persons[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "persons.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:template "{$.fname} {$.lname}";
+          rml:termType rml:Literal
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "{$.fname}{$.lname}";
+      rml:termType rml:BlankNode
+    ] .
+
+<http://example.com/base/TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.lives[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "lives.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.city"
+        ];
+      rml:predicate ex:city
+    ];
+  rml:subjectMap [
+      rml:template "{$.fname}{$.lname}";
+      rml:termType rml:BlankNode
+    ] .
+
+

Output

+
_:BobSmith <http://example.com/city> "London" .
+_:BobSmith <http://xmlns.com/foaf/0.1/name> "Bob Smith" .
+_:SueJones <http://example.com/city> "Madrid" .
+_:SueJones <http://xmlns.com/foaf/0.1/name> "Sue Jones" .
+
+
+
+

35. RMLTC0012c-JSON

+

Title: "TriplesMap without subjectMap"

+

Description: "Tests a RML with missing information, TriplesMap without subjectMap."

+

Error expected? Yes

+

Input

+
{
+  "persons": [
+    {"fname":"Bob","lname":"Smith","amount":30},
+    {"fname":"Sue","lname":"Jones","amount":20},
+    {"fname":"Bob","lname":"Smith","amount":30}
+  ]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.persons[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "persons.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:template "{$.fname} {$.lname}";
+          rml:termType rml:Literal
+        ];
+      rml:predicate foaf:name
+    ], [
+      rml:objectMap [
+          rml:reference "$.amount"
+        ];
+      rml:predicate ex:amount
+    ] .
+
+
+

36. RMLTC0012d-JSON

+

Title: "TriplesMap with two subjectMap"

+

Description: "Tests a RML with wrong information, TriplesMap with two subjectMap."

+

Error expected? Yes

+

Input

+
{
+  "persons": [
+    {"fname":"Bob","lname":"Smith","amount":30},
+    {"fname":"Sue","lname":"Jones","amount":20},
+    {"fname":"Bob","lname":"Smith","amount":30}
+  ]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.persons[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "persons.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:template "{$.fname} {$.lname}";
+          rml:termType rml:Literal
+        ];
+      rml:predicate foaf:name
+    ], [
+      rml:objectMap [
+          rml:reference "$.amount"
+        ];
+      rml:predicate ex:amount
+    ];
+  rml:subjectMap [
+      rml:template "{$.fname}_{$.lname}_{$.amount}";
+      rml:termType rml:BlankNode
+    ], [
+      rml:template "{$.amount}_{$.fname}_{$.lname}";
+      rml:termType rml:BlankNode
+    ] .
+
+
+

37. RMLTC0013a-JSON

+

Title: "Null value in JSON file"

+

Description: "Tests if null values in JSON files are handled correctly."

+

Error expected? No

+

Input

+
{
+  "persons": [
+    {"ID":"1","Name":"Alice","DateOfBirth":null},
+    {"ID":"2","Name":"Bob","DateOfBirth":"September, 2010"}
+  ]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.persons[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "persons.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.DateOfBirth"
+        ];
+      rml:predicate ex:BirthDay
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Person/{$.ID}/{$.Name}/{$.DateOfBirth}"
+    ] .
+
+

Output

+
<http://example.com/Person/2/Bob/September%2C%202010> <http://example.com/BirthDay> "September, 2010" .
+
+
+

38. RMLTC0015a-JSON

+

Title: "Generation of language tags from a table with language information"

+

Description: "Generation of language tags from a table with language information"

+

Error expected? No

+

Input

+
{
+  "countries": [
+    {"Code": "BO", "Name": "Bolivia, Plurinational State of"},
+    {"Code": "IE", "Name": "Ireland"}
+  ]
+}
+
+

Mapping

+
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.countries[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "country_en.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:language "en";
+          rml:reference "$.Name"
+        ];
+      rml:predicate rdfs:label
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{$.Code}"
+    ] .
+
+<http://example.com/base/TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.countries[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "country_es.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:language "es";
+          rml:reference "$.Name"
+        ];
+      rml:predicate rdfs:label
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{$.Code}"
+    ] .
+
+

Output

+
<http://example.com/BO> <http://www.w3.org/2000/01/rdf-schema#label> "Bolivia, Plurinational State of"@en .
+<http://example.com/BO> <http://www.w3.org/2000/01/rdf-schema#label> "Estado Plurinacional de Bolivia"@es .
+<http://example.com/IE> <http://www.w3.org/2000/01/rdf-schema#label> "Ireland"@en .
+<http://example.com/IE> <http://www.w3.org/2000/01/rdf-schema#label> "Irlanda"@es .
+
+
+
+
+

39. RMLTC0015b-JSON

+

Title: "Generation of language tags from a table with language information, and a term map with invalid rml:language value"

+

Description: "Tests a term map with an invalid rml:language value, which is an error"

+

Error expected? Yes

+

Input

+
{
+  "countries": [
+    {"Code": "BO", "Name": "Bolivia, Plurinational State of"},
+    {"Code": "IE", "Name": "Ireland"}
+  ]
+}
+
+

Mapping

+
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.countries[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "country_en.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:language "a-english";
+          rml:reference "$.Name"
+        ];
+      rml:predicate rdfs:label
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{$.Code}"
+    ] .
+
+<http://example.com/base/TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.countries[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "country_en.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:language "a-spanish";
+          rml:reference "$.Name"
+        ];
+      rml:predicate rdfs:label
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{$.Code}"
+    ] .
+
+
+

40. RMLTC0019a-JSON

+

Title: "Generation of triples by using IRI value in columns"

+

Description: "Test the generation of triples by using IRI value in attributes"

+

Error expected? No

+

Input

+
{
+  "persons": [
+    {
+      "ID": 10,
+      "FirstName": "http://example.com/ns#Jhon",
+      "LastName": "Smith"
+    },
+    {
+      "ID": 20,
+      "FirstName": "Carlos",
+      "LastName": "Mendoza"
+    }
+  ]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.persons[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "persons.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.FirstName"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:reference "$.FirstName"
+    ] .
+
+

Output

+
<http://example.com/ns#Jhon> <http://xmlns.com/foaf/0.1/name> "http://example.com/ns#Jhon" .
+<http://example.com/base/Carlos> <http://xmlns.com/foaf/0.1/name> "Carlos" .
+
+
+

41. RMLTC0019b-JSON

+

Title: "Generation of triples by using IRI value in columns, with data error"

+

Description: "Test the generation of triples by using IRI value in attributes, conforming RML mapping with data error (and limited results)"

+

Error expected? No

+

Input

+
{
+  "persons": [
+    {
+      "ID": 10,
+      "FirstName": "http://example.com/ns#Jhon",
+      "LastName": "Smith"
+    },
+    {
+      "ID": 20,
+      "FirstName": "Carlos",
+      "LastName": "Mendoza"
+    },
+    {
+      "ID": 30,
+      "FirstName": "Juan Daniel",
+      "LastName": "Crespo"
+    }
+  ]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.persons[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "persons.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.FirstName"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:reference "$.FirstName"
+    ] .
+
+

Output

+

+
+
+

42. RMLTC0020a-JSON

+

Title: "Generation of triples by using IRI value in columns"

+

Description: "Test the generation of triples by using IRI value in attributes"

+

Error expected? No

+

Input

+
{
+  "students": [
+    {"Name": "http://example.com/company/Alice"},
+    {"Name": "Bob"},
+    {"Name": "Bob/Charles"},
+    {"Name": "path/../Danny"},
+    {"Name": "Emily Smith"}
+  ]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:object foaf:Person;
+      rml:predicate rdf:type
+    ];
+  rml:subjectMap [
+      rml:template "{$.Name}";
+      rml:termType rml:IRI
+    ] .
+
+

Output

+
<http://example.com/base/http%3A%2F%2Fexample.com%2Fcompany%2FAlice> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/base/Bob> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/base/Bob%2FCharles> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/base/path%2F..%2FDanny> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/base/Emily%20Smith> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+
+
+

43. RMLTC0021a-JSON

+

Title: "Generation of triples referencing object map"

+

Description: "Tests the mapping specification referencing object map with same logical source and join condition"

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "Name":"Venus Williams",
+    "Sport": "Tennis"
+  }, {
+    "ID": 20,
+    "Name":"Serena Williams",
+    "Sport": "Tennis"
+  }, {
+    "ID": 30,
+    "Name":"Loena Hendrickx",
+    "Sport": "Figure skating"
+  }]
+}
+
+

Mapping

+
@prefix activity: <http://example.com/activity/> .
+@prefix ex: <http://example.com/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/RefObjectMap1> a rml:RefObjectMap;
+  rml:joinCondition [
+      rml:child "$.Sport";
+      rml:parent "$.Sport"
+    ];
+  rml:parentTriplesMap <http://example.com/base/TriplesMap1> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap <http://example.com/base/RefObjectMap1>;
+      rml:predicate ex:sameSportAs
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Student/{$.ID}/{$.Name}"
+    ] .
+
+

Output

+
<http://example.com/Student/10/Venus%20Williams> <http://example.com/sameSportAs> <http://example.com/Student/10/Venus%20Williams> . 
+<http://example.com/Student/10/Venus%20Williams> <http://example.com/sameSportAs> <http://example.com/Student/20/Serena%20Williams> . 
+<http://example.com/Student/20/Serena%20Williams> <http://example.com/sameSportAs> <http://example.com/Student/20/Serena%20Williams> . 
+<http://example.com/Student/20/Serena%20Williams> <http://example.com/sameSportAs> <http://example.com/Student/10/Venus%20Williams> . 
+<http://example.com/Student/30/Loena%20Hendrickx> <http://example.com/sameSportAs> <http://example.com/Student/30/Loena%20Hendrickx> . 
+
+
+
+
+

44. RMLTC0022a-JSON

+

Title: "Generating of triples with constant datatype"

+

Description: "Test triples with a fixed constant datatype"

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "Name":"Venus"
+  }]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:datatype xsd:string;
+          rml:reference "$.Name"
+        ];
+      rml:predicate foaf:name
+    ], [
+      rml:objectMap [
+          rml:datatype xsd:int;
+          rml:reference "$.Age"
+        ];
+      rml:predicate ex:age
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{$.Name}"
+    ] .
+
+

Output

+
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "Venus"^^<http://www.w3.org/2001/XMLSchema#string> .
+<http://example.com/Venus> <http://example.com/age> "21"^^<http://www.w3.org/2001/XMLSchema#int> .
+
+
+

45. RMLTC0022b-JSON

+

Title: "Generating of triples with datatypeMap"

+

Description: "Test triples with a XSD datatype generated from the data"

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "Name":"Venus"
+  }]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:referenceFormulation rml:JSONPath;
+      rml:iterator "$.[*]";
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "data.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:datatypeMap [
+              rml:template "http://www.w3.org/2001/XMLSchema#{$.BAR}"
+            ];
+          rml:reference "$.FOO"
+        ];
+      rml:predicate ex:x
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{$.FOO}"
+    ] .
+
+
+

Output

+
<http://example.com/1> <http://example.com/x> "1"^^<http://www.w3.org/2001/XMLSchema#string> .
+<http://example.com/2> <http://example.com/x> "2"^^<http://www.w3.org/2001/XMLSchema#int> .
+
+
+

46. RMLTC0022c-JSON

+

Title: "Generating of triples with datatypeMap with custom datatype"

+

Description: "Test triples with a custom datype from the data"

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "Name":"Venus"
+  }]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:referenceFormulation rml:JSONPath;
+      rml:iterator "$.[*]";
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "data.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:datatypeMap [
+              rml:template "datatype#{$.BAR}"
+            ];
+          rml:reference "$.FOO"
+        ];
+      rml:predicate ex:x
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{$.FOO}"
+    ] .
+
+

Output

+
<http://example.com/1> <http://example.com/x> "1"^^<http://www.w3.org/2001/XMLSchema#string> .
+<http://example.com/2> <http://example.com/x> "2"^^<http://www.w3.org/2001/XMLSchema#int> .
+
+
+

47. RMLTC0023a-JSON

+

Title: "Invalid IRI template 1"

+

Description: "Test handling of invalid IRI template"

+

Error expected? Yes

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "Name":"Venus"
+  }]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:referenceFormulation rml:JSONPath;
+      rml:iterator "$.students[*]";
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{NON_EXISTING_COLUMN}";
+      rml:class foaf:Person;
+    ] .
+
+
+

48. RMLTC0023b-JSON

+

Title: "Invalid IRI template 2"

+

Description: "Test handling of invalid IRI template"

+

Error expected? Yes

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "{Name}":"Venus"
+  }]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:referenceFormulation rml:JSONPath;
+      rml:iterator "$.students[*]";
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{{Name}}";
+      rml:class foaf:Person;
+    ] .
+
+
+

49. RMLTC0023c-JSON

+

Title: "Invalid IRI template 3"

+

Description: "Test handling of invalid IRI template"

+

Error expected? Yes

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "N\ame":"Venus"
+  }]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:referenceFormulation rml:JSONPath;
+      rml:iterator "$.students[*]";
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{N\ame}";
+      rml:class foaf:Person;
+    ] .
+
+
+
+

50. RMLTC0023d-JSON

+

Title: "Invalid IRI template 4"

+

Description: "Test handling of invalid IRI template"

+

Error expected? Yes

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "Name":"Venus"
+  }]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:referenceFormulation rml:JSONPath;
+      rml:iterator "$.students[*]";
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{Name\}";
+      rml:class foaf:Person;
+    ] .
+
+
+
+

51. RMLTC0023e-JSON

+

Title: "Invalid IRI template 5"

+

Description: "Test handling of invalid IRI template"

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "{Name}":"Venus"
+  }]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+     rml:referenceFormulation rml:JSONPath;
+     rml:iterator "$.students[*]";
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{\\{Name\\}}";
+      rml:class foaf:Person;
+    ] .
+
+
+

Output

+
<http://example.com/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+
+
+

52. RMLTC0023f-JSON

+

Title: "Invalid IRI template 6"

+

Description: "Test handling of invalid IRI template"

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "N\ame":"Venus"
+  }]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:referenceFormulation rml:JSONPath;
+      rml:iterator "$.students[*]";
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{N\\\ame}";
+      rml:class foaf:Person;
+    ] .
+
+

Output

+
<http://example.com/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+
+
+

53. RMLTC0025a-JSON

+

Title: "Generation of triples with constant blank node "

+

Description: "Tests the generation of triples with a constant blank node"

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "Name":"Venus"
+  },
+  {
+    "Name":"Julio"
+  }]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix ex: <http://example.com/>.
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.Name"
+        ];
+      rml:predicate ex:student
+    ];
+  rml:subject _:School .
+
+

Output

+
_:School <http://example.com/student> "Julio" .
+_:School <http://example.com/student> "Venus" .
+
+
+

54. RMLTC0025b-JSON

+

Title: "Usage of constant term maps in combination with explicitly defined term types"

+

Description: "Tests the usage of constant term maps in combination with explicitly defined term types"

+

Error expected? Yes

+

Input

+
{
+  "students": [{
+    "Name":"Venus"
+  },
+  {
+    "Name":"Julio"
+  }]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix ex: <http://example.com/>.
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.Name"
+        ];
+      rml:predicate ex:student
+    ];
+  rml:subjectMap [
+      rml:constant "School";
+      rml:termType rml:BlankNode
+  ] .
+
+
+

55. RMLTC0026a-JSON

+

Title: "Generation of triples from arrays"

+

Description: "Tests the generation of triples from array input data structures"

+

Error expected? No

+

Input

+
{
+  "persons": [
+    {"fname":"Bob","lname":"Smith","amounts":[30, 40, 50]}
+  ]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.persons[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "persons.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.amounts"
+        ];
+      rml:predicate ex:amount
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Student/{$.fname}/{$.lname}"
+    ] .
+
+

Output

+
<http://example.com/Student/Bob/Smith> <http://example.com/amount> "30" .
+<http://example.com/Student/Bob/Smith> <http://example.com/amount> "40" .
+<http://example.com/Student/Bob/Smith> <http://example.com/amount> "50" .
+
+
+ + + + + \ No newline at end of file diff --git a/src/test/resources/rml-core/docs/20250908/index.html b/src/test/resources/rml-core/docs/20250908/index.html new file mode 100644 index 00000000..ba5fb3da --- /dev/null +++ b/src/test/resources/rml-core/docs/20250908/index.html @@ -0,0 +1,3906 @@ + + + + + + +RML-Core: Test Cases + + + + + + + + + + + + + + + + + + + +

Abstract

This document defines the RML-Core test cases to the determine the RML-Core specification conformance of tools.

+
+ +

Status of This Document

+ This specification was published by the + Knowledge Graph Construction Community Group. It is not a W3C Standard nor is it + on the W3C Standards Track. + + Please note that under the + W3C Community Contributor License Agreement (CLA) + there is a limited opt-out and other conditions apply. + + Learn more about + W3C Community and Business Groups. +

+ GitHub Issues are preferred for + discussion of this specification. + + +

+ +

1. Introduction

+

This document defines the RML-Core test cases, consisting of a collection of test case documents (input and expected output). +The purpose of the test cases is to determine the conformance of tools that execute RML rules to the RML-Core specification.

+
+ +

2. Data model

+

The test cases are semantically described for re-usability and shareability following the W3C Test case description. +Each test:Testcase as the following properties:

+
    +
  • dcterms:identifier: unique ID of the test case.
  • +
  • rmltest:hasError: if an error of the RML Processor is expected or not.
  • +
  • rmltest:input: One or more input data of the test case.
  • +
  • rmltest:output: One or more output data of the test case.
  • +
  • rmltest:inputFormat: the input data format.
  • +
  • rmltest:outputFormat: the output data format.
  • +
  • rmltest:mappingDocument: the RML mapping rules in Turtle.
  • +
+
+ +

3. Test cases

+

This section describes the RML-Core test cases. These descriptions are also available as RDF. +The files are available on GitHub in the folder test-cases. +Each test case is contained in a single folder, containing three types of files:

+
    +
  • Zero or more files containing the data sources, in the case of JSON, XML, CSV, or containing the SQL statements to create the necessary tables, in the case of MySQL, PostgreSQL, and SQL Server.
  • +
  • One file with the RML rules, called mapping.ttl, in the Turtle format.
  • +
  • Zero or more files with the expected RDF. No file is provided if an error is expected that must halt the generation of the RDF because of an error.
  • +
+
+ + +

4. RMLTC0000-JSON

+

Title: "one table, one column, zero rows"

+

Description: "Tests if an empty table produces an empty RDF graph"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "students": []
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.Name"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{$.Name}"
+    ] .
+
+

Output

+
# empty database
+
+
+

5. RMLTC0001a-JSON

+

Title: "One column mapping, subject URI generation by using rml:template"

+

Description: "Tests: (1) one column mapping; (2) subject URI generation by using rml:template; (3) one column to one property"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "Name":"Venus"
+  }]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.Name"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap <http://example.com/base/#NameSubjectMap> .
+
+<http://example.com/base/#NameSubjectMap> rml:template "http://example.com/{$.Name}" .
+
+

Output

+
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
+
+
+
+

6. RMLTC0001b-JSON

+

Title: "One column mapping, generation of a BlankNode subject by using rml:termType"

+

Description: "Tests: (1) one column mapping; (2) generation of a BlankNode subject by using rml:termType; (3) one column to one property"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "Name":"Venus"
+  }]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.Name"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "{$.Name}";
+      rml:termType rml:BlankNode
+    ] .
+
+

Output

+
_:Venus <http://xmlns.com/foaf/0.1/name> "Venus" .
+
+
+
+

7. RMLTC0002a-JSON

+

Title: "Two columns mapping, generation of a subject URI by the concatenation of two column values"

+

Description: "Tests: (1) two column mapping, no primary key; (2) subject URI generated by the concatenation of two column values; (3) one column to one property"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "Name":"Venus"
+  }]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.ID"
+        ];
+      rml:predicate ex:id
+    ], [
+      rml:objectMap [
+          rml:reference "$.Name"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:class foaf:Person;
+      rml:template "http://example.com/{$.ID}/{$.Name}"
+    ] .
+
+

Output

+
<http://example.com/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
+<http://example.com/10/Venus> <http://example.com/id> "10"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.com/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+
+
+
+

8. RMLTC0002b-JSON

+

Title: "Two columns mapping, generation of a BlankNode subject by using rml:template and rml:termType"

+

Description: "Tests: (1) two column mapping, no primary key; (2) generation of a BlankNode subject by using rml:template; (3) one column to one property"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "Name":"Venus"
+  }]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.Name"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "students{$.ID}";
+      rml:termType rml:BlankNode
+    ] .
+
+

Output

+
_:students10 <http://xmlns.com/foaf/0.1/name> "Venus" .
+
+
+
+

9. RMLTC0002e-JSON

+

Title: "Two columns mapping, an undefined rml:path"

+

Description: "Tests the presence of an undefined rml:path"

+

Default Base IRI: http://example.com/

+

Error expected? Yes

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "Name":"Venus"
+  }]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student2.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.IDs"
+        ];
+      rml:predicate ex:id
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{$.ID}/{$.Name}"
+    ] .
+
+
+

10. RMLTC0002g-JSON

+

Title: "Two columns mapping, invalid JSONPath"

+

Description: "Test the presence of an invalid JSONPath"

+

Default Base IRI: http://example.com/

+

Error expected? Yes

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "Name":"Venus"
+  }]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student2.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.IDs"
+        ];
+      rml:predicate ex:id
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{$.ID}/{$.Name}"
+    ] .
+
+
+

11. RMLTC0003c-JSON

+

Title: "Three columns mapping, by using a rml:template to produce literal"

+

Description: "Tests: (1) three column mapping; and (2) the use of rml:template to produce literal"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "FirstName":"Venus",
+    "LastName":"Williams"
+  }]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:template "{$.FirstName} {$.LastName}";
+          rml:termType rml:Literal
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Student{$.ID}"
+    ] .
+
+

Output

+
<http://example.com/Student10> <http://xmlns.com/foaf/0.1/name> "Venus Williams" .
+
+
+

12. RMLTC0004a-JSON

+

Title: "Two column mapping, from one row table to two different triples"

+

Description: "Tests: (1) two column mapping, (2) subject URI generated by a column value; (3) from one row table to two different triples (4) typing by using rml:class"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "Student": "Venus",
+    "Sport":"Tennis"
+  }]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student_sport.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.Student"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:class ex:Student;
+      rml:template "http://example.com/{$.Student}"
+    ] .
+
+<http://example.com/base/TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student_sport.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.Sport"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:class ex:Sport;
+      rml:template "http://example.com/{$.Sport}"
+    ] .
+
+

Output

+
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
+<http://example.com/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/Student> .
+<http://example.com/Tennis> <http://xmlns.com/foaf/0.1/name> "Tennis" .
+<http://example.com/Tennis> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/Sport> .
+
+
+
+

13. RMLTC0004b-JSON

+

Title: "One column mapping, presence of rml:termType rml:Literal on rml:subjectMap"

+

Description: "Tests: (1) one column mapping (2) the presence of rml:termType rml:Literal on rml:subjectMap, which is invalid"

+

Default Base IRI: http://example.com/

+

Error expected? Yes

+

Input

+
{
+  "students": [{
+    "Name":"Venus"
+  }]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.Name"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{$.Name}";
+      rml:termType rml:Literal
+    ] .
+
+
+

14. RMLTC0005a-JSON

+

Title: "Typing of resources"

+

Description: "Tests the typing of resources"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "persons": [
+    {
+      "fname": "Bob",
+      "lname": "Smith",
+      "amount": "30.0E0"
+    },
+    {
+      "fname": "Sue",
+      "lname": "Jones",
+      "amount": "20.0E0"
+    },
+    {
+      "fname": "Bob",
+      "lname": "Smith",
+      "amount": "30.0E0"
+    }
+  ]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.persons[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "ious.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.amount"
+        ];
+      rml:predicate ex:owes
+    ];
+  rml:subjectMap [
+      rml:class foaf:Person;
+      rml:template "http://example.com/{$.fname};{$.lname}"
+    ] .
+
+

Output

+
<http://example.com/Bob;Smith> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Bob;Smith> <http://example.com/owes> "30.0E0" .
+<http://example.com/Sue;Jones> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Sue;Jones> <http://example.com/owes> "20.0E0" .
+
+
+
+

15. RMLTC0006a-JSON

+

Title: "Use of rml:constant in rml:subjectMap, rml:predicateMap, rml:objectMap and rml:graphMap"

+

Description: "Tests the use of rml:constant in rml:subjectMap, rml:predicateMap, rml:objectMap and rml:graphMap"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "FirstName":"Venus",
+    "LastName":"Williams"
+  }]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:constant "Bad Student"
+        ];
+      rml:predicateMap [
+          rml:constant ex:description
+        ]
+    ];
+  rml:subjectMap [
+      rml:constant ex:BadStudent;
+      rml:graphMap [
+          rml:constant <http://example.com/graph/student>
+        ]
+    ] .
+
+

Output

+
<http://example.com/BadStudent> <http://example.com/description> "Bad Student" <http://example.com/graph/student> .
+
+
+

16. RMLTC0007a-JSON

+

Title: "Typing resources by relying on rdf:type predicate"

+

Description: "Tests the typing resources by relying on rdf:type predicate"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "FirstName":"Venus",
+    "LastName":"Williams"
+  }]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:object foaf:Person;
+      rml:predicate rdf:type
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Student/{$.ID}/{$.FirstName}"
+    ] .
+
+

Output

+
 <http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+
+
+
+

17. RMLTC0007b-JSON

+

Title: "Assigning triples to Named Graphs"

+

Description: "Tests the generation of triples to a named graph"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "FirstName":"Venus",
+    "LastName":"Williams"
+  }]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:object foaf:Person;
+      rml:predicate rdf:type
+    ], [
+      rml:objectMap [
+          rml:reference "$.FirstName"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:graph ex:PersonGraph;
+      rml:template "http://example.com/Student/{$.ID}/{$.FirstName}"
+    ] .
+
+

Output

+
<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" <http://example.com/PersonGraph> . 
+<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person>  <http://example.com/PersonGraph> .
+
+
+
+

18. RMLTC0007c-JSON

+

Title: "One row mapping, using rml:class"

+

Description: "Tests subjectmap with more than one class IRIs, rml:class"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "FirstName":"Venus",
+    "LastName":"Williams"
+  }]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.ID"
+        ];
+      rml:predicate ex:id
+    ], [
+      rml:objectMap [
+          rml:reference "$.FirstName"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:class ex:Student, foaf:Person;
+      rml:template "http://example.com/Student/{$.ID}/{$.FirstName}"
+    ] .
+
+

Output

+
<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
+<http://example.com/Student/10/Venus> <http://example.com/id> "10"^^<http://www.w3.org/2001/XMLSchema#integer> . 
+<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/Student> .
+
+
+
+

19. RMLTC0007d-JSON

+

Title: "One column mapping, specifying an rml:predicateObjectMap with rdf:type"

+

Description: "Tests subjectmap with an alternative of having rml:class, i.e., by specifying an rml:predicateObjectMap with predicate rdf:type"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "FirstName":"Venus",
+    "LastName":"Williams"
+  }]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:object foaf:Person;
+      rml:predicate rdf:type
+    ], [
+      rml:object ex:Student;
+      rml:predicate rdf:type
+    ], [
+      rml:objectMap [
+          rml:reference "$.ID"
+        ];
+      rml:predicate ex:id
+    ], [
+      rml:objectMap [
+          rml:reference "$.FirstName"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Student/{$.ID}/{$.FirstName}"
+    ] .
+
+

Output

+
<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" . 
+<http://example.com/Student/10/Venus> <http://example.com/id> "10"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/Student> .
+
+
+
+

20. RMLTC0007e-JSON

+

Title: "One column mapping, using rml:graphMap and rml:class"

+

Description: "Tests subjectmap with rml:graphMap and rml:class"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "Name":"Venus"
+  }]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.ID"
+        ];
+      rml:predicate ex:id
+    ], [
+      rml:objectMap [
+          rml:reference "$.Name"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:class foaf:Person;
+      rml:graph ex:PersonGraph;
+      rml:template "http://example.com/Student/{$.ID}/{$.Name}"
+    ] .
+
+

Output

+
<http://example.com/Student/10/Venus> <http://example.com/id> "10"^^<http://www.w3.org/2001/XMLSchema#integer> <http://example.com/PersonGraph> .
+<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" <http://example.com/PersonGraph> .
+<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> <http://example.com/PersonGraph> .
+
+
+
+

21. RMLTC0007f-JSON

+

Title: "One column mapping, using rml:graphMap and specifying an rml:predicateObjectMap with rdf:type"

+

Description: "Tests subjectmap with rml:graphMap and specifying an rml:predicateObjectMap with predicate rdf:type"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "FirstName":"Venus",
+    "LastName":"Williams"
+  }]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:object foaf:Person;
+      rml:predicate rdf:type
+    ], [
+      rml:objectMap [
+          rml:reference "$.ID"
+        ];
+      rml:predicate ex:id
+    ], [
+      rml:objectMap [
+          rml:reference "$.FirstName"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:graph ex:PersonGraph;
+      rml:template "http://example.com/Student/{$.ID}/{$.FirstName}"
+    ] .
+
+

Output

+
<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> <http://example.com/PersonGraph> .
+<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" <http://example.com/PersonGraph> .
+<http://example.com/Student/10/Venus> <http://example.com/id> "10"^^<http://www.w3.org/2001/XMLSchema#integer> <http://example.com/PersonGraph> .
+
+
+
+

22. RMLTC0007g-JSON

+

Title: "Assigning triples to the default graph"

+

Description: "Tests the generation of triples to the default graph"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "FirstName":"Venus",
+    "LastName":"Williams"
+  }]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.FirstName"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:graph rml:defaultGraph;
+      rml:template "http://example.com/Student/{$.ID}/{$.FirstName}"
+    ] .
+
+

Output

+
<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
+
+
+
+

23. RMLTC0007h-JSON

+

Title: "Assigning triples to a non-IRI named graph"

+

Description: "Tests the generation of triples to a non-IRI named graph, which is an error"

+

Default Base IRI: http://example.com/

+

Error expected? Yes

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "FirstName":"Venus",
+    "LastName":"Williams"
+  }]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.FirstName"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:graphMap [
+          rml:reference "$.ID";
+          rml:termType rml:Literal
+        ];
+      rml:template "http://example.com/Student/{$.ID}/{$.FirstName}"
+    ] .
+
+
+

24. RMLTC0008a-JSON

+

Title: "Generation of triples to a target graph by using rml:graphMap and rml:template"

+

Description: "Test that results of the mapping can be directed to a target graph by using rml:graphMap and rml:template"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "Name":"Venus Williams",
+    "Sport": "Tennis"
+  }]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:object foaf:Person;
+      rml:predicate rdf:type
+    ], [
+      rml:objectMap [
+          rml:reference "$.ID"
+        ];
+      rml:predicate ex:id
+    ], [
+      rml:objectMap [
+          rml:reference "$.Name"
+        ];
+      rml:predicate foaf:name
+    ], [
+      rml:objectMap [
+          rml:reference "$.Sport"
+        ];
+      rml:predicate ex:Sport
+    ];
+  rml:subjectMap [
+      rml:graphMap [
+          rml:template "http://example.com/graph/Student/{$.ID}/{$.Name}"
+        ];
+      rml:template "http://example.com/Student/{$.ID}/{$.Name}"
+    ] .
+
+

Output

+
<http://example.com/Student/10/Venus%20Williams> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> <http://example.com/graph/Student/10/Venus%20Williams> .
+<http://example.com/Student/10/Venus%20Williams> <http://xmlns.com/foaf/0.1/name> "Venus Williams" <http://example.com/graph/Student/10/Venus%20Williams> .
+<http://example.com/Student/10/Venus%20Williams> <http://example.com/id> "10" <http://example.com/graph/Student/10/Venus%20Williams> . 
+<http://example.com/Student/10/Venus%20Williams> <http://example.com/Sport> "Tennis" <http://example.com/graph/Student/10/Venus%20Williams> . 
+
+
+
+

25. RMLTC0008b-JSON

+

Title: "Generation of triples referencing object map"

+

Description: "Tests the mapping specification referencing object map without join"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "Name":"Venus Williams",
+    "Sport": "Tennis"
+  }]
+}
+
+

Mapping

+
@prefix activity: <http://example.com/activity/> .
+@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap <http://example.com/base/RefObjectMap1>;
+      rml:predicate ex:Sport
+    ], [
+      rml:object foaf:Person;
+      rml:predicate rdf:type
+    ], [
+      rml:objectMap [
+          rml:reference "$.ID"
+        ];
+      rml:predicate ex:id
+    ], [
+      rml:objectMap [
+          rml:reference "$.Name"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Student/{$.ID}/{$.Name}"
+    ] .
+
+<http://example.com/base/RefObjectMap1> a rml:RefObjectMap;
+  rml:parentTriplesMap <http://example.com/base/TriplesMap2> .
+
+<http://example.com/base/TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:object activity:Sport;
+      rml:predicate rdf:type
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{$.Sport}"
+    ] .
+
+

Output

+
<http://example.com/Student/10/Venus%20Williams> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person>  .
+<http://example.com/Student/10/Venus%20Williams> <http://xmlns.com/foaf/0.1/name> "Venus Williams" .
+<http://example.com/Student/10/Venus%20Williams> <http://example.com/id> "10" . 
+<http://example.com/Student/10/Venus%20Williams> <http://example.com/Sport> <http://example.com/Tennis> . 
+<http://example.com/Tennis> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/activity/Sport> .
+
+
+
+
+

26. RMLTC0008c-JSON

+

Title: "Generation of triples by using multiple predicateMaps within a rml:predicateObjectMap"

+

Description: "Tests the generation of triples by using multiple predicateMaps within a rml:predicateObjectMap"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "Name":"Venus Williams",
+    "Sport": "Tennis"
+  }]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.Name"
+        ];
+      rml:predicate ex:name, foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Student/{$.ID}/{$.Name}"
+    ] .
+
+

Output

+
<http://example.com/Student/10/Venus%20Williams> <http://xmlns.com/foaf/0.1/name> "Venus Williams"  .
+<http://example.com/Student/10/Venus%20Williams> <http://example.com/name> "Venus Williams"  .
+
+
+
+

27. RMLTC0009a-JSON

+

Title: "Generation of triples from foreign key relations"

+

Description: "Test foreign key relationships among logical tables"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "students" : [
+    { 
+      "ID": 10,
+      "Sport": 100,
+      "Name": "Venus Williams"
+    },
+    { 
+      "ID": 20,
+      "Name": "Demi Moore"
+    }
+  ]
+}
+
+

Input 1

+
{
+  "sports": [
+    {
+      "ID": 100,
+      "Name": "Tennis"
+    }
+  ]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.Name"
+        ];
+      rml:predicate foaf:name
+    ], [
+      rml:objectMap [ a rml:RefObjectMap;
+          rml:joinCondition [
+              rml:child "$.Sport";
+              rml:parent "$.ID"
+            ];
+          rml:parentTriplesMap <http://example.com/base/TriplesMap2>
+        ];
+      rml:predicate <http://example.com/ontology/practises>
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/resource/student_{$.ID}"
+    ] .
+
+<http://example.com/base/TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.sports[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "sport.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.Name"
+        ];
+      rml:predicate rdfs:label
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/resource/sport_{$.ID}"
+    ] .
+
+

Output

+
<http://example.com/resource/student_10> <http://xmlns.com/foaf/0.1/name> "Venus Williams"  .
+<http://example.com/resource/student_20> <http://xmlns.com/foaf/0.1/name> "Demi Moore"  .
+<http://example.com/resource/sport_100> <http://www.w3.org/2000/01/rdf-schema#label> "Tennis" .
+<http://example.com/resource/student_10> <http://example.com/ontology/practises> <http://example.com/resource/sport_100>  .
+
+
+

28. RMLTC0009b-JSON

+

Title: "Generation of triples to multiple graphs"

+

Description: "Test that results from distinct parts of the mapping can be directed to different target graphs."

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "students" : [
+    { 
+      "ID": 10,
+      "Sport": 100,
+      "Name": "Venus Williams"
+    },
+    { 
+      "ID": 20,
+      "Name": "Demi Moore"
+    }
+  ]
+}
+
+

Input 1

+
{
+  "sports": [
+    {
+      "ID": 100,
+      "Name": "Tennis"
+    }
+  ]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:graph <http://example.com/graph/students>;
+      rml:objectMap [
+          rml:reference "$.Name"
+        ];
+      rml:predicate foaf:name
+    ], [
+      rml:graph <http://example.com/graph/practise>;
+      rml:objectMap [ a rml:RefObjectMap;
+          rml:joinCondition [
+              rml:child "$.Sport";
+              rml:parent "$.ID"
+            ];
+          rml:parentTriplesMap <http://example.com/base/TriplesMap2>
+        ];
+      rml:predicate <http://example.com/ontology/practises>
+    ];
+  rml:subjectMap [
+      rml:class <http://example.com/ontology/Student>;
+      rml:graph <http://example.com/graph/students>;
+      rml:template "http://example.com/resource/student_{$.ID}"
+    ] .
+
+<http://example.com/base/TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.sports[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "sport.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.Name"
+        ];
+      rml:predicate rdfs:label
+    ];
+  rml:subjectMap [
+      rml:class <http://example.com/ontology/Sport>;
+      rml:graph <http://example.com/graph/sports>;
+      rml:template "http://example.com/resource/sport_{$.ID}"
+    ] .
+
+

Output

+
<http://example.com/resource/student_10> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/ontology/Student> <http://example.com/graph/students> .
+<http://example.com/resource/student_10> <http://xmlns.com/foaf/0.1/name> "Venus Williams" <http://example.com/graph/students> .
+<http://example.com/resource/student_20> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/ontology/Student> <http://example.com/graph/students> .
+<http://example.com/resource/student_20> <http://xmlns.com/foaf/0.1/name> "Demi Moore" <http://example.com/graph/students> .
+<http://example.com/resource/sport_100> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/ontology/Sport> <http://example.com/graph/sports> .
+<http://example.com/resource/sport_100> <http://www.w3.org/2000/01/rdf-schema#label> "Tennis" <http://example.com/graph/sports> .
+<http://example.com/resource/student_10> <http://example.com/ontology/practises> <http://example.com/resource/sport_100> <http://example.com/graph/practise> .
+<http://example.com/resource/student_10> <http://example.com/ontology/practises> <http://example.com/resource/sport_100> <http://example.com/graph/students> .
+
+
+

29. RMLTC0010a-JSON

+

Title: "Template with table column with blank space"

+

Description: "Tests a template with blank space in column value"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "countries": [{
+    "Country Code": 1,
+    "Name":"Bolivia, Plurinational State of",
+    "ISO 3166": "BO"
+  }, {
+    "Country Code": 2,
+    "Name":"Ireland",
+    "ISO 3166": "IE"
+  }, {
+    "Country Code": 3,
+    "Name":"Saint Martin (French part)",
+    "ISO 3166": "MF"
+  }]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.countries[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "country_info.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.Name"
+        ];
+      rml:predicate ex:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{$.['Country Code']}"
+    ] .
+
+

Output

+
<http://example.com/1> <http://example.com/name> "Bolivia, Plurinational State of" .
+<http://example.com/2> <http://example.com/name> "Ireland" .
+<http://example.com/3> <http://example.com/name> "Saint Martin (French part)" .
+
+
+
+

30. RMLTC0010b-JSON

+

Title: "Template with table columns with special chars"

+

Description: "Tests a template with special chars in column value"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "countries": [{
+    "Country Code": 1,
+    "Name":"Bolivia, Plurinational State of",
+    "ISO 3166": "BO"
+  }, {
+    "Country Code": 2,
+    "Name":"Ireland",
+    "ISO 3166": "IE"
+  }, {
+    "Country Code": 3,
+    "Name":"Saint Martin (French part)",
+    "ISO 3166": "MF"
+  }]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.countries[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "country_info.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.Name"
+        ];
+      rml:predicate ex:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{$.['Country Code']}/{$.Name}"
+    ] .
+
+

Output

+
<http://example.com/1/Bolivia%2C%20Plurinational%20State%20of> <http://example.com/name> "Bolivia, Plurinational State of" .
+<http://example.com/2/Ireland> <http://example.com/name> "Ireland" .
+<http://example.com/3/Saint%20Martin%20%28French%20part%29> <http://example.com/name> "Saint Martin (French part)" .
+
+
+
+

31. RMLTC0010c-JSON

+

Title: "Template with table columns with special chars and backslashes"

+

Description: "Tests a template with special chars in reference value and backslash escapes in string templates"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "countries": [{
+    "Country Code": 1,
+    "Name":"Bolivia, Plurinational State of",
+    "ISO 3166": "BO"
+  }, {
+    "Country Code": 2,
+    "Name":"Ireland",
+    "ISO 3166": "IE"
+  }, {
+    "Country Code": 3,
+    "Name":"Saint Martin (French part)",
+    "ISO 3166": "MF"
+  }]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.countries[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "country_info.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:predicate ex:code;
+      rml:objectMap [
+          rml:template "\\{\\{\\{ {$.['ISO 3166']} \\}\\}\\}";
+          rml:termType rml:Literal
+        ]
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{$.['Country Code']}/{$.Name}"
+    ] .
+
+

Output

+
<http://example.com/1/Bolivia%2C%20Plurinational%20State%20of> <http://example.com/code> "{{{ BO }}}" .
+<http://example.com/2/Ireland> <http://example.com/code> "{{{ IE }}}" .
+<http://example.com/3/Saint%20Martin%20%28French%20part%29> <http://example.com/code> "{{{ MF }}}" .
+
+
+
+

32. RMLTC0011b-JSON

+

Title: "M to M relation, by using an additional Triples Map"

+

Description: "Tests, M to M relations, by using an additional Triples Map"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "students": [
+    {"ID":10, "FirstName":"Venus", "LastName":"Williams"},
+    {"ID":11, "FirstName":"Fernando", "LastName":"Alonso"},
+    {"ID":12, "FirstName":"David", "LastName":"Villa"}
+  ]
+}
+
+

Input 1

+
{
+  "sports": [
+    {"ID":110, "Description":"Tennis"},
+    {"ID":111, "Description":"Football"},
+    {"ID":112, "Description":"Formula1"}
+  ]
+}
+
+

Input 2

+
{
+  "links": [
+    {"ID_Student":10, "ID_Sport":110},
+    {"ID_Student":11, "ID_Sport":111},
+    {"ID_Student":11, "ID_Sport":112},
+    {"ID_Student":12, "ID_Sport":111}
+  ]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/LinkMap_1_2> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.links[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student_sport.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:template "http://example.com/sport/{$.ID_Sport}"
+        ];
+      rml:predicate ex:plays
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/student/{$.ID_Student}"
+    ] .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.FirstName"
+        ];
+      rml:predicate ex:firstName
+    ], [
+      rml:objectMap [
+          rml:reference "$.LastName"
+        ];
+      rml:predicate ex:lastName
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/student/{$.ID}"
+    ] .
+
+<http://example.com/base/TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.sports[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "sport.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.Description"
+        ];
+      rml:predicate ex:description
+    ], [
+      rml:objectMap [
+          rml:reference "$.ID"
+        ];
+      rml:predicate ex:id
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/sport/{$.ID}"
+    ] .
+
+

Output

+
<http://example.com/student/10> <http://example.com/lastName> "Williams" .
+<http://example.com/student/10> <http://example.com/firstName> "Venus" .
+<http://example.com/student/12> <http://example.com/lastName> "Villa" .
+<http://example.com/student/12> <http://example.com/firstName> "David" .
+<http://example.com/student/11> <http://example.com/lastName> "Alonso" .
+<http://example.com/student/11> <http://example.com/firstName> "Fernando" .
+<http://example.com/sport/110> <http://example.com/description> "Tennis" .
+<http://example.com/sport/110> <http://example.com/id> "110" .
+<http://example.com/sport/111> <http://example.com/description> "Football" .
+<http://example.com/sport/111> <http://example.com/id> "111" .
+<http://example.com/sport/112> <http://example.com/description> "Formula1" .
+<http://example.com/sport/112> <http://example.com/id> "112" .
+<http://example.com/student/10> <http://example.com/plays> <http://example.com/sport/110> .
+<http://example.com/student/12> <http://example.com/plays> <http://example.com/sport/111> .
+<http://example.com/student/11> <http://example.com/plays> <http://example.com/sport/112> .
+<http://example.com/student/11> <http://example.com/plays> <http://example.com/sport/111> .
+
+
+
+

33. RMLTC0012a-JSON

+

Title: "Blank node referencing multiple columns"

+

Description: "Tests that blank nodes can be generated by referencing multiple columns"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "persons": [
+    {"fname":"Bob","lname":"Smith","amount":30},
+    {"fname":"Sue","lname":"Jones","amount":20},
+    {"fname":"Bob","lname":"Smith","amount":30}
+  ]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.persons[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "persons.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:template "{$.fname} {$.lname}";
+          rml:termType rml:Literal
+        ];
+      rml:predicate foaf:name
+    ], [
+      rml:objectMap [
+          rml:reference "$.amount"
+        ];
+      rml:predicate ex:amount
+    ];
+  rml:subjectMap [
+      rml:template "{$.fname}{$.lname}{$.amount}";
+      rml:termType rml:BlankNode
+    ] .
+
+

Output

+
_:BobSmith30 <http://example.com/amount> "30" .
+_:BobSmith30 <http://xmlns.com/foaf/0.1/name> "Bob Smith" .
+_:SueJones20 <http://example.com/amount> "20" .
+_:SueJones20 <http://xmlns.com/foaf/0.1/name> "Sue Jones" .
+
+
+
+

34. RMLTC0012b-JSON

+

Title: "Duplicate tuples generate same blank node"

+

Description: "Tests that blank nodes with same identifier and in the same graph but generated by different logical rows are considered equivalent."

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "lives": [
+    {"fname":"Bob","lname":"Smith","city":"London"},
+    {"fname":"Sue","lname":"Jones","city":"Madrid"},
+    {"fname":"Bob","lname":"Smith","city":"London"}
+  ]
+}
+
+

Input 1

+
{
+  "persons": [
+    {"fname":"Bob","lname":"Smith","amount":30},
+    {"fname":"Sue","lname":"Jones","amount":20},
+    {"fname":"Bob","lname":"Smith","amount":30}
+  ]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.persons[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "persons.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:template "{$.fname} {$.lname}";
+          rml:termType rml:Literal
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "{$.fname}{$.lname}";
+      rml:termType rml:BlankNode
+    ] .
+
+<http://example.com/base/TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.lives[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "lives.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.city"
+        ];
+      rml:predicate ex:city
+    ];
+  rml:subjectMap [
+      rml:template "{$.fname}{$.lname}";
+      rml:termType rml:BlankNode
+    ] .
+
+

Output

+
_:BobSmith <http://example.com/city> "London" .
+_:BobSmith <http://xmlns.com/foaf/0.1/name> "Bob Smith" .
+_:SueJones <http://example.com/city> "Madrid" .
+_:SueJones <http://xmlns.com/foaf/0.1/name> "Sue Jones" .
+
+
+
+

35. RMLTC0012c-JSON

+

Title: "TriplesMap without subjectMap"

+

Description: "Tests a RML with missing information, TriplesMap without subjectMap."

+

Default Base IRI: http://example.com/

+

Error expected? Yes

+

Input

+
{
+  "persons": [
+    {"fname":"Bob","lname":"Smith","amount":30},
+    {"fname":"Sue","lname":"Jones","amount":20},
+    {"fname":"Bob","lname":"Smith","amount":30}
+  ]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.persons[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "persons.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:template "{$.fname} {$.lname}";
+          rml:termType rml:Literal
+        ];
+      rml:predicate foaf:name
+    ], [
+      rml:objectMap [
+          rml:reference "$.amount"
+        ];
+      rml:predicate ex:amount
+    ] .
+
+
+

36. RMLTC0012d-JSON

+

Title: "TriplesMap with two subjectMap"

+

Description: "Tests a RML with wrong information, TriplesMap with two subjectMap."

+

Default Base IRI: http://example.com/

+

Error expected? Yes

+

Input

+
{
+  "persons": [
+    {"fname":"Bob","lname":"Smith","amount":30},
+    {"fname":"Sue","lname":"Jones","amount":20},
+    {"fname":"Bob","lname":"Smith","amount":30}
+  ]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.persons[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "persons.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:template "{$.fname} {$.lname}";
+          rml:termType rml:Literal
+        ];
+      rml:predicate foaf:name
+    ], [
+      rml:objectMap [
+          rml:reference "$.amount"
+        ];
+      rml:predicate ex:amount
+    ];
+  rml:subjectMap [
+      rml:template "{$.fname}_{$.lname}_{$.amount}";
+      rml:termType rml:BlankNode
+    ], [
+      rml:template "{$.amount}_{$.fname}_{$.lname}";
+      rml:termType rml:BlankNode
+    ] .
+
+
+

37. RMLTC0013a-JSON

+

Title: "Null value in JSON file"

+

Description: "Tests if null values in JSON files are handled correctly."

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "persons": [
+    {"ID":"1","Name":"Alice","DateOfBirth":null},
+    {"ID":"2","Name":"Bob","DateOfBirth":"September, 2010"}
+  ]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.persons[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "persons.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.DateOfBirth"
+        ];
+      rml:predicate ex:BirthDay
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Person/{$.ID}/{$.Name}/{$.DateOfBirth}"
+    ] .
+
+

Output

+
<http://example.com/Person/2/Bob/September%2C%202010> <http://example.com/BirthDay> "September, 2010" .
+
+
+

38. RMLTC0015a-JSON

+

Title: "Generation of language tags from a table with language information"

+

Description: "Generation of language tags from a table with language information"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "countries": [
+    {"Code": "BO", "Name": "Estado Plurinacional de Bolivia"},
+    {"Code": "IE", "Name": "Irlanda"}
+  ]
+}
+
+

Mapping

+
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.countries[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "country_en.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:language "en";
+          rml:reference "$.Name"
+        ];
+      rml:predicate rdfs:label
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{$.Code}"
+    ] .
+
+<http://example.com/base/TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.countries[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "country_es.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:language "es";
+          rml:reference "$.Name"
+        ];
+      rml:predicate rdfs:label
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{$.Code}"
+    ] .
+
+

Output

+
<http://example.com/BO> <http://www.w3.org/2000/01/rdf-schema#label> "Bolivia, Plurinational State of"@en .
+<http://example.com/BO> <http://www.w3.org/2000/01/rdf-schema#label> "Estado Plurinacional de Bolivia"@es .
+<http://example.com/IE> <http://www.w3.org/2000/01/rdf-schema#label> "Ireland"@en .
+<http://example.com/IE> <http://www.w3.org/2000/01/rdf-schema#label> "Irlanda"@es .
+
+
+
+
+

39. RMLTC0015b-JSON

+

Title: "Generation of language tags from a table with language information, and a term map with invalid rml:language value"

+

Description: "Tests a term map with an invalid rml:language value, which is an error"

+

Default Base IRI: http://example.com/

+

Error expected? Yes

+

Input

+
{
+  "countries": [
+    {"Code": "BO", "Name": "Estado Plurinacional de Bolivia"},
+    {"Code": "IE", "Name": "Irlanda"}
+  ]
+}
+
+

Mapping

+
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.countries[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "country_en.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:language "a-english";
+          rml:reference "$.Name"
+        ];
+      rml:predicate rdfs:label
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{$.Code}"
+    ] .
+
+<http://example.com/base/TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.countries[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "country_en.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:language "a-spanish";
+          rml:reference "$.Name"
+        ];
+      rml:predicate rdfs:label
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{$.Code}"
+    ] .
+
+
+

40. RMLTC0019a-JSON

+

Title: "Generation of triples by using IRI value in columns"

+

Description: "Test the generation of triples by using IRI value in attributes"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "persons": [
+    {
+      "ID": 10,
+      "FirstName": "http://example.com/ns#Jhon",
+      "LastName": "Smith"
+    },
+    {
+      "ID": 20,
+      "FirstName": "Carlos",
+      "LastName": "Mendoza"
+    }
+  ]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.persons[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "persons.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.FirstName"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:reference "$.FirstName"
+    ] .
+
+

Output

+
<http://example.com/ns#Jhon> <http://xmlns.com/foaf/0.1/name> "http://example.com/ns#Jhon" .
+<http://example.com/Carlos> <http://xmlns.com/foaf/0.1/name> "Carlos" .
+
+
+

41. RMLTC0019b-JSON

+

Title: "Generation of triples by using IRI value in columns, with data error"

+

Description: "Test the generation of triples by using IRI value in attributes, conforming RML mapping with data error (and limited results)"

+

Default Base IRI: http://example.com/

+

Error expected? Yes

+

Input

+
{
+  "persons": [
+    {
+      "ID": 30,
+      "FirstName": "Juan Daniel",
+      "LastName": "Crespo"
+    }
+  ]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.persons[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "persons.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.FirstName"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:reference "$.FirstName"
+    ] .
+
+
+

42. RMLTC0020a-JSON

+

Title: "Generation of triples by using IRI value in columns"

+

Description: "Test the generation of triples by using IRI value in attributes"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "students": [
+    {"Name": "http://example.com/company/Alice"},
+    {"Name": "Bob"},
+    {"Name": "Bob/Charles"},
+    {"Name": "path/../Danny"},
+    {"Name": "Emily Smith"}
+  ]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:object foaf:Person;
+      rml:predicate rdf:type
+    ];
+  rml:subjectMap [
+      rml:template "{$.Name}";
+      rml:termType rml:IRI
+    ] .
+
+

Output

+
<http://example.com/http%3A%2F%2Fexample.com%2Fcompany%2FAlice> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Bob> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Bob%2FCharles> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/path%2F..%2FDanny> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Emily%20Smith> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+
+
+

43. RMLTC0021a-JSON

+

Title: "Generation of triples referencing object map"

+

Description: "Tests the mapping specification referencing object map with same logical source and join condition"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "Name":"Venus Williams",
+    "Sport": "Tennis"
+  }, {
+    "ID": 20,
+    "Name":"Serena Williams",
+    "Sport": "Tennis"
+  }, {
+    "ID": 30,
+    "Name":"Loena Hendrickx",
+    "Sport": "Figure skating"
+  }]
+}
+
+

Mapping

+
@prefix activity: <http://example.com/activity/> .
+@prefix ex: <http://example.com/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/RefObjectMap1> a rml:RefObjectMap;
+  rml:joinCondition [
+      rml:child "$.Sport";
+      rml:parent "$.Sport"
+    ];
+  rml:parentTriplesMap <http://example.com/base/TriplesMap1> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap <http://example.com/base/RefObjectMap1>;
+      rml:predicate ex:sameSportAs
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Student/{$.ID}/{$.Name}"
+    ] .
+
+

Output

+
<http://example.com/Student/10/Venus%20Williams> <http://example.com/sameSportAs> <http://example.com/Student/10/Venus%20Williams> . 
+<http://example.com/Student/10/Venus%20Williams> <http://example.com/sameSportAs> <http://example.com/Student/20/Serena%20Williams> . 
+<http://example.com/Student/20/Serena%20Williams> <http://example.com/sameSportAs> <http://example.com/Student/20/Serena%20Williams> . 
+<http://example.com/Student/20/Serena%20Williams> <http://example.com/sameSportAs> <http://example.com/Student/10/Venus%20Williams> . 
+<http://example.com/Student/30/Loena%20Hendrickx> <http://example.com/sameSportAs> <http://example.com/Student/30/Loena%20Hendrickx> . 
+
+
+
+
+

44. RMLTC0022a-JSON

+

Title: "Generating of triples with constant datatype"

+

Description: "Test triples with a fixed constant datatype"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "Name":"Venus",
+    "Age": 21
+  }]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:datatype xsd:string;
+          rml:reference "$.Name"
+        ];
+      rml:predicate foaf:name
+    ], [
+      rml:objectMap [
+          rml:datatype xsd:int;
+          rml:reference "$.Age"
+        ];
+      rml:predicate ex:age
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{$.Name}"
+    ] .
+
+

Output

+
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "Venus"^^<http://www.w3.org/2001/XMLSchema#string> .
+<http://example.com/Venus> <http://example.com/age> "21"^^<http://www.w3.org/2001/XMLSchema#int> .
+
+
+

45. RMLTC0022b-JSON

+

Title: "Generating of triples with datatypeMap"

+

Description: "Test triples with a XSD datatype generated from the data"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
[
+    { "FOO": 1, "BAR": "string"},
+    { "FOO": 2, "BAR": "int"}
+]
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:referenceFormulation rml:JSONPath;
+      rml:iterator "$[*]";
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "data.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:datatypeMap [
+              rml:template "http://www.w3.org/2001/XMLSchema#{$.BAR}"
+            ];
+          rml:reference "$.FOO"
+        ];
+      rml:predicate ex:x
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{$.FOO}"
+    ] .
+
+
+

Output

+
<http://example.com/1> <http://example.com/x> "1"^^<http://www.w3.org/2001/XMLSchema#string> .
+<http://example.com/2> <http://example.com/x> "2"^^<http://www.w3.org/2001/XMLSchema#int> .
+
+
+

46. RMLTC0022c-JSON

+

Title: "Generating of triples with datatypeMap with custom datatype"

+

Description: "Test triples with a custom datype from the data"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
[
+    { "FOO": 1, "BAR": "string"},
+    { "FOO": 2, "BAR": "int"}
+]
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:referenceFormulation rml:JSONPath;
+      rml:iterator "$[*]";
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "data.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:datatypeMap [
+              rml:template "datatype#{$.BAR}"
+            ];
+          rml:reference "$.FOO"
+        ];
+      rml:predicate ex:x
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{$.FOO}"
+    ] .
+
+

Output

+
<http://example.com/1> <http://example.com/x> "1"^^<http://example.com/datatype#string> .
+<http://example.com/2> <http://example.com/x> "2"^^<http://example.com/datatype#int> .
+
+
+

47. RMLTC0023a-JSON

+

Title: "Invalid IRI template 1"

+

Description: "Test handling of invalid IRI template"

+

Default Base IRI: http://example.com/

+

Error expected? Yes

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "Name":"Venus"
+  }]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:referenceFormulation rml:JSONPath;
+      rml:iterator "$.students[*]";
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{NON_EXISTING_COLUMN}";
+      rml:class foaf:Person;
+    ] .
+
+
+

48. RMLTC0023b-JSON

+

Title: "Invalid IRI template 2"

+

Description: "Test handling of invalid IRI template"

+

Default Base IRI: http://example.com/

+

Error expected? Yes

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "{Name}":"Venus"
+  }]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:referenceFormulation rml:JSONPath;
+      rml:iterator "$.students[*]";
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{{Name}}";
+      rml:class foaf:Person;
+    ] .
+
+
+

49. RMLTC0023c-JSON

+

Title: "Invalid IRI template 3"

+

Description: "Test handling of invalid IRI template"

+

Default Base IRI: http://example.com/

+

Error expected? Yes

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "N\ame":"Venus"
+  }]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:referenceFormulation rml:JSONPath;
+      rml:iterator "$.students[*]";
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{N\ame}";
+      rml:class foaf:Person;
+    ] .
+
+
+
+

50. RMLTC0023d-JSON

+

Title: "Invalid IRI template 4"

+

Description: "Test handling of invalid IRI template"

+

Default Base IRI: http://example.com/

+

Error expected? Yes

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "Name":"Venus"
+  }]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:referenceFormulation rml:JSONPath;
+      rml:iterator "$.students[*]";
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{Name\}";
+      rml:class foaf:Person;
+    ] .
+
+
+
+

51. RMLTC0023e-JSON

+

Title: "Invalid IRI template 5"

+

Description: "Test handling of invalid IRI template"

+

Default Base IRI: http://example.com/

+

Error expected? Yes

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "{Name}":"Venus"
+  }]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+     rml:referenceFormulation rml:JSONPath;
+     rml:iterator "$.students[*]";
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{\\\\{Name\\\\}}";
+      rml:class foaf:Person;
+    ] .
+
+
+
+

52. RMLTC0023f-JSON

+

Title: "Invalid IRI template 6"

+

Description: "Test handling of invalid IRI template"

+

Default Base IRI: http://example.com/

+

Error expected? Yes

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "N\ame":"Venus"
+  }]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:referenceFormulation rml:JSONPath;
+      rml:iterator "$.students[*]";
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{N\\\ame}";
+      rml:class foaf:Person;
+    ] .
+
+
+

53. RMLTC0023g-JSON

+

Title: "Valid IRI template with backslash-escape"

+

Description: "Test handling of a valid IRI template using backslash-escape"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "{Name}":"Venus"
+  }]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+     rml:referenceFormulation rml:JSONPath;
+     rml:iterator "$.students[*]";
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{\\{Name\\}}";
+      rml:class foaf:Person;
+    ] .
+
+
+

Output

+
<http://example.com/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+
+
+

54. RMLTC0024a-JSON

+

Title: "Usage of constant term maps in combination with explicitly defined term types"

+

Description: "Tests the usage of constant term maps in combination with explicitly defined term types"

+

Default Base IRI: http://example.com/

+

Error expected? Yes

+

Input

+
{
+  "students": [{
+    "Name":"Venus"
+  },
+  {
+    "Name":"Julio"
+  }]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix ex: <http://example.com/>.
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.Name"
+        ];
+      rml:predicate ex:student
+    ];
+  rml:subjectMap [
+      rml:constant "School";
+      rml:termType rml:BlankNode
+  ] .
+
+
+

55. RMLTC0025a-JSON

+

Title: "Generation of triples from arrays"

+

Description: "Tests the generation of triples from array input data structures"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "persons": [
+    {"fname":"Bob","lname":"Smith","amounts":[30, 40, 50]}
+  ]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.persons[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "persons.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.amounts[*]"
+        ];
+      rml:predicate ex:amount
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Student/{$.fname}/{$.lname}"
+    ] .
+
+

Output

+
<http://example.com/Student/Bob/Smith> <http://example.com/amount> "30"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.com/Student/Bob/Smith> <http://example.com/amount> "40"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.com/Student/Bob/Smith> <http://example.com/amount> "50"^^<http://www.w3.org/2001/XMLSchema#integer> .
+
+
+

56. RMLTC0025b-JSON

+

Title: "Generation of triples from arrays with wrong reference"

+

Description: "Tests the generation of triples from array input data structures. Test should fail as reference points to the array and not the values of the array"

+

Default Base IRI: http://example.com/

+

Error expected? Yes

+

Input

+
{
+  "persons": [
+    {"fname":"Bob","lname":"Smith","amounts":[30, 40, 50]}
+  ]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.persons[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "persons.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.amounts"
+        ];
+      rml:predicate ex:amount
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Student/{$.fname}/{$.lname}"
+    ] .
+
+
+

57. RMLTC0025c-JSON

+

Title: "Generation of triples from arrays in subject and object"

+

Description: "Tests the generation of triples from array input data structures in subject and object"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "persons": [
+    {"names":["Bob", "Smith"],"amounts":[30, 40, 50]}
+  ]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.persons[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "persons.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.amounts[*]"
+        ];
+      rml:predicate ex:amount
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Student/{$.names[*]}"
+    ] .
+
+

Output

+
<http://example.com/Student/Smith> <http://example.com/amount> "30"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.com/Student/Smith> <http://example.com/amount> "40"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.com/Student/Smith> <http://example.com/amount> "50"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.com/Student/Bob> <http://example.com/amount> "30"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.com/Student/Bob> <http://example.com/amount> "40"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.com/Student/Bob> <http://example.com/amount> "50"^^<http://www.w3.org/2001/XMLSchema#integer> .
+
+
+

58. RMLTC0026a-JSON

+

Title: "Two triples maps, one with rml:baseIRI and one without and generating absolute IRIs"

+

Description: "Tests the generation of triples from relative IRIs using base IRI"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "persons": [
+    {"fname":"Bob","lname":"Smith","amount":30},
+    {"fname":"Sue","lname":"Jones","amount":20}
+  ]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:baseIRI <http://example.com/>;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.persons[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "persons.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.amount"
+        ];
+      rml:predicate ex:amount
+    ];
+  rml:subjectMap [
+      rml:template "{$.fname}"
+    ] .
+
+<http://example.com/base/TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.persons[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "persons.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.amount"
+        ];
+      rml:predicate ex:amount
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{$.lname}"
+    ] .
+
+

Output

+
<http://example.com/Bob> <http://example.com/amount> "30"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.com/Jones> <http://example.com/amount> "20"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.com/Smith> <http://example.com/amount> "30"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.com/Sue> <http://example.com/amount> "20"^^<http://www.w3.org/2001/XMLSchema#integer> .
+
+
+

59. RMLTC0026b-JSON

+

Title: "Two triples maps, one with rml:baseIRI one one without and generating relative IRIs using baseIRI parameter"

+

Description: "Tests the generation of triples from relative IRI using base IRI parameter"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "persons": [
+    {"fname":"Bob","lname":"Smith","amount":30},
+    {"fname":"Sue","lname":"Jones","amount":20}
+  ]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:baseIRI <http://tp1.com/>;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.persons[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "persons.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.amount"
+        ];
+      rml:predicate ex:amount
+    ];
+  rml:subjectMap [
+      rml:template "{$.fname}"
+    ] .
+
+<http://example.com/base/TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.persons[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "persons.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.amount"
+        ];
+      rml:predicate ex:amount
+    ];
+  rml:subjectMap [
+      rml:template "{$.lname}"
+    ] .
+
+

Output

+
<http://tp1.com/Bob> <http://example.com/amount> "30"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.com/Jones> <http://example.com/amount> "20"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.com/Smith> <http://example.com/amount> "30"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://tp1.com/Sue> <http://example.com/amount> "20"^^<http://www.w3.org/2001/XMLSchema#integer> .
+
+
+

60. RMLTC0026c-JSON

+

Title: "Two triples maps, both with rml:baseIRI defined"

+

Description: "Tests the generation of triples using relative IRIs with base IRIs defined only in triples maps, without base IRI parameter"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "persons": [
+    {"fname":"Bob","lname":"Smith","amount":30},
+    {"fname":"Sue","lname":"Jones","amount":20}
+  ]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:baseIRI <http://example.com/>;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.persons[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "persons.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.amount"
+        ];
+      rml:predicate ex:amount
+    ];
+  rml:subjectMap [
+      rml:template "{$.fname}"
+    ] .
+
+<http://example.com/base/TriplesMap2> a rml:TriplesMap;
+  rml:baseIRI <http://example.com/>;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.persons[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "persons.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.amount"
+        ];
+      rml:predicate ex:amount
+    ];
+  rml:subjectMap [
+      rml:template "{$.lname}"
+    ] .
+
+

Output

+
<http://example.com/Bob> <http://example.com/amount> "30"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.com/Jones> <http://example.com/amount> "20"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.com/Smith> <http://example.com/amount> "30"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.com/Sue> <http://example.com/amount> "20"^^<http://www.w3.org/2001/XMLSchema#integer> .
+
+
+

61. RMLTC0026d-JSON

+

Title: "Two triples maps,both with rml:bseIRI defined and baseIRI parameter defined"

+

Description: "Tests the generation of triples by with base IRIs different than the base IRI parameter"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "persons": [
+    {"fname":"Bob","lname":"Smith","amount":30},
+    {"fname":"Sue","lname":"Jones","amount":20}
+  ]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:baseIRI <http://example2.com/>;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.persons[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "persons.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.amount"
+        ];
+      rml:predicate ex:amount
+    ];
+  rml:subjectMap [
+      rml:template "{$.fname}"
+    ] .
+
+<http://example.com/base/TriplesMap2> a rml:TriplesMap;
+  rml:baseIRI <http://example2.com/>;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.persons[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "persons.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.amount"
+        ];
+      rml:predicate ex:amount
+    ];
+  rml:subjectMap [
+      rml:template "{$.lname}"
+    ] .
+
+

Output

+
<http://example2.com/Bob> <http://example.com/amount> "30"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example2.com/Jones> <http://example.com/amount> "20"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example2.com/Smith> <http://example.com/amount> "30"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example2.com/Sue> <http://example.com/amount> "20"^^<http://www.w3.org/2001/XMLSchema#integer> .
+
+
+

62. RMLTC0027a-JSON

+

Title: "Generation of triples using the URI term type"

+

Description: "Tests the generation of triples with a URI term type in the subject or object"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "students": [
+    {"Name": "Alice"},
+    {"Name": "Bob"},
+    {"Name": "Bob/Charles"},
+    {"Name": "Danny"},
+    {"Name": "Emily Smith"}
+  ]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:object foaf:Person;
+      rml:predicate rdf:type
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Person/{$.Name}";
+      rml:termType rml:URI
+    ] .
+
+

Output

+
<http://example.com/Person/Alice> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Person/Bob> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Person/Bob%2FCharles> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Person/Danny> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Person/Emily%20Smith> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+
+
+

63. RMLTC0027b-JSON

+

Title: "Generation of triples using the UnsafeURI term type"

+

Description: "Tests the generation of triples with a UnsafeURI term type in the subject or object"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "students": [
+    {"Name": "Alice"},
+    {"Name": "Bob"},
+    {"Name": "Bob/Charles"},
+    {"Name": "Danny"},
+    {"Name": "Emily Smith"}
+  ]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:object foaf:Person;
+      rml:predicate rdf:type
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Person/{$.Name}";
+      rml:termType rml:UnsafeURI
+    ] .
+
+

Output

+
<http://example.com/Person/Alice> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Person/Bob> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Person/Bob%2FCharles> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Person/Danny> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Person/Emily%20Smith> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+
+
+

64. RMLTC0027c-JSON

+

Title: "Generation of triples using the UnsafeIRI term type"

+

Description: "Tests the generation of triples with a UnsafeIRI term type in the subject or object"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "students": [
+    {"Name": "Alice"},
+    {"Name": "Bob"},
+    {"Name": "Bob/Charles"},
+    {"Name": "Danny"},
+    {"Name": "Emily Smith"}
+  ]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:object foaf:Person;
+      rml:predicate rdf:type
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Person/{$.Name}";
+      rml:termType rml:UnsafeIRI
+    ] .
+
+

Output

+
<http://example.com/Person/Alice> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Person/Bob> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Person/Bob%2FCharles> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Person/Danny> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Person/Emily%20Smith> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+
+
+

65. RMLTC0028a-JSON

+

Title: "Generation of the right datatype for a constant in the mapping"

+

Description: "Test the honoring of the datatype specified by the constant term in the mapping"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
[ { "id": "0", "foo": "bar"  } ] 
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+
+ [
+    a rml:TriplesMap;
+    rml:logicalSource [
+      rml:source "data.json" ;
+      rml:referenceFormulation rml:JSONPath ;
+      rml:iterator "$[*]";
+    ];
+    rml:subjectMap [
+      rml:template "https://example.org/instances/{id}";
+    ];
+    rml:predicateObjectMap [
+      rml:predicate <http://example.org/ns/p> ;
+      rml:object true ; # datatype is boolean
+    ];
+  ] .
+
+

Output

+
<https://example.org/instances/0> <http://example.org/ns/p> "true"^^<http://www.w3.org/2001/XMLSchema#boolean> .
+
+
+

66. RMLTC0028b-JSON

+

Title: "Generation of all named graphs when rml:defaultGraph is involved"

+

Description: "Test if the default graph is also generated correctly."

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
[ { "id": "0", "name": "Alice"  } ] 
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix s: <http://schema.org/> .
+
+ [
+    a rml:TriplesMap;
+    rml:logicalSource [
+      rml:source "data.json" ;
+      rml:referenceFormulation rml:JSONPath ;
+      rml:iterator "$[*]";
+    ];
+    rml:subjectMap [
+      rml:template "https://example.org/instances/{id}";
+      rml:class s:Person ;
+      rml:graph <graph:1> ;
+    ];
+    rml:predicateObjectMap [
+      rml:predicate s:givenName ;
+      rml:objectMap [ rml:reference "name" ] ;
+      rml:graph rml:defaultGraph ;
+    ];
+  ] .
+
+

Output

+
<https://example.org/instances/0> <http://schema.org/givenName> "Alice".
+<https://example.org/instances/0> <http://schema.org/givenName> "Alice" <graph:1> .
+<https://example.org/instances/0> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://schema.org/Person> <graph:1> .
+
+
+

67. RMLTC0028c-JSON

+

Title: "Generation of the right language tag for a constant in the mapping"

+

Description: "Test the honoring of the language tag specified by the constant term in the mapping"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
[ { "id": "0", "foo": "bar"  } ] 
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+ [
+    a rml:TriplesMap;
+    rml:logicalSource [
+      rml:source "data.json" ;
+      rml:referenceFormulation rml:JSONPath ;
+      rml:iterator "$[*]";
+    ];
+    rml:subjectMap [
+      rml:template "https://example.org/instances/{id}";
+    ];
+    rml:predicateObjectMap [
+      rml:predicate <http://example.org/ns/p> ;
+      rml:object "train"@en ;
+    ];
+  ] .
+
+

Output

+
<https://example.org/instances/0> <http://example.org/ns/p> "train"@en .
+
+
+ + + + + \ No newline at end of file diff --git a/src/test/resources/rml-core/docs/20250927/index.html b/src/test/resources/rml-core/docs/20250927/index.html new file mode 100644 index 00000000..7039cea4 --- /dev/null +++ b/src/test/resources/rml-core/docs/20250927/index.html @@ -0,0 +1,3891 @@ + + + + + + +RML-Core: Test Cases + + + + + + + + + + + + + + + + + + + +

Abstract

This document defines the RML-Core test cases to the determine the RML-Core specification conformance of tools.

+
+ +

Status of This Document

+ This specification was published by the + Knowledge Graph Construction Community Group. It is not a W3C Standard nor is it + on the W3C Standards Track. + + Please note that under the + W3C Community Contributor License Agreement (CLA) + there is a limited opt-out and other conditions apply. + + Learn more about + W3C Community and Business Groups. +

+ GitHub Issues are preferred for + discussion of this specification. + + +

+ +

1. Introduction

+

This document defines the RML-Core test cases, consisting of a collection of test case documents (input and expected output). +The purpose of the test cases is to determine the conformance of tools that execute RML rules to the RML-Core specification.

+
+ +

2. Data model

+

The test cases are semantically described for re-usability and shareability following the W3C Test case description. +Each test:Testcase as the following properties:

+
    +
  • dcterms:identifier: unique ID of the test case.
  • +
  • rmltest:hasError: if an error of the RML Processor is expected or not.
  • +
  • rmltest:input: One or more input data of the test case.
  • +
  • rmltest:output: One or more output data of the test case.
  • +
  • rmltest:inputFormat: the input data format.
  • +
  • rmltest:outputFormat: the output data format.
  • +
  • rmltest:mappingDocument: the RML mapping rules in Turtle.
  • +
+
+ +

3. Test cases

+

This section describes the RML-Core test cases. These descriptions are also available as RDF. +The files are available on GitHub in the folder test-cases. +Each test case is contained in a single folder, containing three types of files:

+
    +
  • Zero or more files containing the data sources, in the case of JSON, XML, CSV, or containing the SQL statements to create the necessary tables, in the case of MySQL, PostgreSQL, and SQL Server.
  • +
  • One file with the RML rules, called mapping.ttl, in the Turtle format.
  • +
  • Zero or more files with the expected RDF. No file is provided if an error is expected that must halt the generation of the RDF because of an error.
  • +
+
+ + +

4. RMLTC0000-JSON

+

Title: "one table, one column, zero rows"

+

Description: "Tests if an empty table produces an empty RDF graph"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "students": []
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.Name"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{$.Name}"
+    ] .
+
+

Output

+
# empty database
+
+
+

5. RMLTC0001a-JSON

+

Title: "One column mapping, subject URI generation by using rml:template"

+

Description: "Tests: (1) one column mapping; (2) subject URI generation by using rml:template; (3) one column to one property"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "Name":"Venus"
+  }]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.Name"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap <http://example.com/base/#NameSubjectMap> .
+
+<http://example.com/base/#NameSubjectMap> rml:template "http://example.com/{$.Name}" .
+
+

Output

+
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
+
+
+
+

6. RMLTC0001b-JSON

+

Title: "One column mapping, generation of a BlankNode subject by using rml:termType"

+

Description: "Tests: (1) one column mapping; (2) generation of a BlankNode subject by using rml:termType; (3) one column to one property"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "Name":"Venus"
+  }]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.Name"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "{$.Name}";
+      rml:termType rml:BlankNode
+    ] .
+
+

Output

+
_:Venus <http://xmlns.com/foaf/0.1/name> "Venus" .
+
+
+
+

7. RMLTC0002a-JSON

+

Title: "Two columns mapping, generation of a subject URI by the concatenation of two column values"

+

Description: "Tests: (1) two column mapping, no primary key; (2) subject URI generated by the concatenation of two column values; (3) one column to one property"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "Name":"Venus"
+  }]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.ID"
+        ];
+      rml:predicate ex:id
+    ], [
+      rml:objectMap [
+          rml:reference "$.Name"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:class foaf:Person;
+      rml:template "http://example.com/{$.ID}/{$.Name}"
+    ] .
+
+

Output

+
<http://example.com/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
+<http://example.com/10/Venus> <http://example.com/id> "10"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.com/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+
+
+
+

8. RMLTC0002b-JSON

+

Title: "Two columns mapping, generation of a BlankNode subject by using rml:template and rml:termType"

+

Description: "Tests: (1) two column mapping, no primary key; (2) generation of a BlankNode subject by using rml:template; (3) one column to one property"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "Name":"Venus"
+  }]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.Name"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "students{$.ID}";
+      rml:termType rml:BlankNode
+    ] .
+
+

Output

+
_:students10 <http://xmlns.com/foaf/0.1/name> "Venus" .
+
+
+
+

9. RMLTC0002e-JSON

+

Title: "Two columns mapping, an undefined rml:path"

+

Description: "Tests the presence of an undefined rml:path"

+

Default Base IRI: http://example.com/

+

Error expected? Yes

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "Name":"Venus"
+  }]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student2.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.IDs"
+        ];
+      rml:predicate ex:id
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{$.ID}/{$.Name}"
+    ] .
+
+
+

10. RMLTC0002g-JSON

+

Title: "Two columns mapping, invalid JSONPath"

+

Description: "Test the presence of an invalid JSONPath"

+

Default Base IRI: http://example.com/

+

Error expected? Yes

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "Name":"Venus"
+  }]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student2.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.IDs"
+        ];
+      rml:predicate ex:id
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{$.ID}/{$.Name}"
+    ] .
+
+
+

11. RMLTC0003c-JSON

+

Title: "Three columns mapping, by using a rml:template to produce literal"

+

Description: "Tests: (1) three column mapping; and (2) the use of rml:template to produce literal"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "FirstName":"Venus",
+    "LastName":"Williams"
+  }]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:template "{$.FirstName} {$.LastName}";
+          rml:termType rml:Literal
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Student{$.ID}"
+    ] .
+
+

Output

+
<http://example.com/Student10> <http://xmlns.com/foaf/0.1/name> "Venus Williams" .
+
+
+

12. RMLTC0004a-JSON

+

Title: "Two column mapping, from one row table to two different triples"

+

Description: "Tests: (1) two column mapping, (2) subject URI generated by a column value; (3) from one row table to two different triples (4) typing by using rml:class"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "Student": "Venus",
+    "Sport":"Tennis"
+  }]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student_sport.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.Student"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:class ex:Student;
+      rml:template "http://example.com/{$.Student}"
+    ] .
+
+<http://example.com/base/TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student_sport.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.Sport"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:class ex:Sport;
+      rml:template "http://example.com/{$.Sport}"
+    ] .
+
+

Output

+
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
+<http://example.com/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/Student> .
+<http://example.com/Tennis> <http://xmlns.com/foaf/0.1/name> "Tennis" .
+<http://example.com/Tennis> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/Sport> .
+
+
+
+

13. RMLTC0004b-JSON

+

Title: "One column mapping, presence of rml:termType rml:Literal on rml:subjectMap"

+

Description: "Tests: (1) one column mapping (2) the presence of rml:termType rml:Literal on rml:subjectMap, which is invalid"

+

Default Base IRI: http://example.com/

+

Error expected? Yes

+

Input

+
{
+  "students": [{
+    "Name":"Venus"
+  }]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.Name"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{$.Name}";
+      rml:termType rml:Literal
+    ] .
+
+
+

14. RMLTC0005a-JSON

+

Title: "Typing of resources"

+

Description: "Tests the typing of resources"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "persons": [
+    {
+      "fname": "Bob",
+      "lname": "Smith",
+      "amount": "30.0E0"
+    },
+    {
+      "fname": "Sue",
+      "lname": "Jones",
+      "amount": "20.0E0"
+    },
+    {
+      "fname": "Bob",
+      "lname": "Smith",
+      "amount": "30.0E0"
+    }
+  ]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.persons[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "ious.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.amount"
+        ];
+      rml:predicate ex:owes
+    ];
+  rml:subjectMap [
+      rml:class foaf:Person;
+      rml:template "http://example.com/{$.fname};{$.lname}"
+    ] .
+
+

Output

+
<http://example.com/Bob;Smith> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Bob;Smith> <http://example.com/owes> "30.0E0" .
+<http://example.com/Sue;Jones> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Sue;Jones> <http://example.com/owes> "20.0E0" .
+
+
+
+

15. RMLTC0006a-JSON

+

Title: "Use of rml:constant in rml:subjectMap, rml:predicateMap, rml:objectMap and rml:graphMap"

+

Description: "Tests the use of rml:constant in rml:subjectMap, rml:predicateMap, rml:objectMap and rml:graphMap"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "FirstName":"Venus",
+    "LastName":"Williams"
+  }]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:constant "Bad Student"
+        ];
+      rml:predicateMap [
+          rml:constant ex:description
+        ]
+    ];
+  rml:subjectMap [
+      rml:constant ex:BadStudent;
+      rml:graphMap [
+          rml:constant <http://example.com/graph/student>
+        ]
+    ] .
+
+

Output

+
<http://example.com/BadStudent> <http://example.com/description> "Bad Student" <http://example.com/graph/student> .
+
+
+

16. RMLTC0007a-JSON

+

Title: "Typing resources by relying on rdf:type predicate"

+

Description: "Tests the typing resources by relying on rdf:type predicate"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "FirstName":"Venus",
+    "LastName":"Williams"
+  }]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:object foaf:Person;
+      rml:predicate rdf:type
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Student/{$.ID}/{$.FirstName}"
+    ] .
+
+

Output

+
 <http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+
+
+
+

17. RMLTC0007b-JSON

+

Title: "Assigning triples to Named Graphs"

+

Description: "Tests the generation of triples to a named graph"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "FirstName":"Venus",
+    "LastName":"Williams"
+  }]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:object foaf:Person;
+      rml:predicate rdf:type
+    ], [
+      rml:objectMap [
+          rml:reference "$.FirstName"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:graph ex:PersonGraph;
+      rml:template "http://example.com/Student/{$.ID}/{$.FirstName}"
+    ] .
+
+

Output

+
<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" <http://example.com/PersonGraph> . 
+<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person>  <http://example.com/PersonGraph> .
+
+
+
+

18. RMLTC0007c-JSON

+

Title: "One row mapping, using rml:class"

+

Description: "Tests subjectmap with more than one class IRIs, rml:class"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "FirstName":"Venus",
+    "LastName":"Williams"
+  }]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.ID"
+        ];
+      rml:predicate ex:id
+    ], [
+      rml:objectMap [
+          rml:reference "$.FirstName"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:class ex:Student, foaf:Person;
+      rml:template "http://example.com/Student/{$.ID}/{$.FirstName}"
+    ] .
+
+

Output

+
<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
+<http://example.com/Student/10/Venus> <http://example.com/id> "10"^^<http://www.w3.org/2001/XMLSchema#integer> . 
+<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/Student> .
+
+
+
+

19. RMLTC0007d-JSON

+

Title: "One column mapping, specifying an rml:predicateObjectMap with rdf:type"

+

Description: "Tests subjectmap with an alternative of having rml:class, i.e., by specifying an rml:predicateObjectMap with predicate rdf:type"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "FirstName":"Venus",
+    "LastName":"Williams"
+  }]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:object foaf:Person;
+      rml:predicate rdf:type
+    ], [
+      rml:object ex:Student;
+      rml:predicate rdf:type
+    ], [
+      rml:objectMap [
+          rml:reference "$.ID"
+        ];
+      rml:predicate ex:id
+    ], [
+      rml:objectMap [
+          rml:reference "$.FirstName"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Student/{$.ID}/{$.FirstName}"
+    ] .
+
+

Output

+
<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" . 
+<http://example.com/Student/10/Venus> <http://example.com/id> "10"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/Student> .
+
+
+
+

20. RMLTC0007e-JSON

+

Title: "One column mapping, using rml:graphMap and rml:class"

+

Description: "Tests subjectmap with rml:graphMap and rml:class"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "Name":"Venus"
+  }]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.ID"
+        ];
+      rml:predicate ex:id
+    ], [
+      rml:objectMap [
+          rml:reference "$.Name"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:class foaf:Person;
+      rml:graph ex:PersonGraph;
+      rml:template "http://example.com/Student/{$.ID}/{$.Name}"
+    ] .
+
+

Output

+
<http://example.com/Student/10/Venus> <http://example.com/id> "10"^^<http://www.w3.org/2001/XMLSchema#integer> <http://example.com/PersonGraph> .
+<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" <http://example.com/PersonGraph> .
+<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> <http://example.com/PersonGraph> .
+
+
+
+

21. RMLTC0007f-JSON

+

Title: "One column mapping, using rml:graphMap and specifying an rml:predicateObjectMap with rdf:type"

+

Description: "Tests subjectmap with rml:graphMap and specifying an rml:predicateObjectMap with predicate rdf:type"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "FirstName":"Venus",
+    "LastName":"Williams"
+  }]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:object foaf:Person;
+      rml:predicate rdf:type
+    ], [
+      rml:objectMap [
+          rml:reference "$.ID"
+        ];
+      rml:predicate ex:id
+    ], [
+      rml:objectMap [
+          rml:reference "$.FirstName"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:graph ex:PersonGraph;
+      rml:template "http://example.com/Student/{$.ID}/{$.FirstName}"
+    ] .
+
+

Output

+
<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> <http://example.com/PersonGraph> .
+<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" <http://example.com/PersonGraph> .
+<http://example.com/Student/10/Venus> <http://example.com/id> "10"^^<http://www.w3.org/2001/XMLSchema#integer> <http://example.com/PersonGraph> .
+
+
+
+

22. RMLTC0007g-JSON

+

Title: "Assigning triples to the default graph"

+

Description: "Tests the generation of triples to the default graph"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "FirstName":"Venus",
+    "LastName":"Williams"
+  }]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.FirstName"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:graph rml:defaultGraph;
+      rml:template "http://example.com/Student/{$.ID}/{$.FirstName}"
+    ] .
+
+

Output

+
<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
+
+
+
+

23. RMLTC0007h-JSON

+

Title: "Assigning triples to a non-IRI named graph"

+

Description: "Tests the generation of triples to a non-IRI named graph, which is an error"

+

Default Base IRI: http://example.com/

+

Error expected? Yes

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "FirstName":"Venus",
+    "LastName":"Williams"
+  }]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.FirstName"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:graphMap [
+          rml:reference "$.ID";
+          rml:termType rml:Literal
+        ];
+      rml:template "http://example.com/Student/{$.ID}/{$.FirstName}"
+    ] .
+
+
+

24. RMLTC0008a-JSON

+

Title: "Generation of triples to a target graph by using rml:graphMap and rml:template"

+

Description: "Test that results of the mapping can be directed to a target graph by using rml:graphMap and rml:template"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "Name":"Venus Williams",
+    "Sport": "Tennis"
+  }]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:object foaf:Person;
+      rml:predicate rdf:type
+    ], [
+      rml:objectMap [
+          rml:reference "$.ID"
+        ];
+      rml:predicate ex:id
+    ], [
+      rml:objectMap [
+          rml:reference "$.Name"
+        ];
+      rml:predicate foaf:name
+    ], [
+      rml:objectMap [
+          rml:reference "$.Sport"
+        ];
+      rml:predicate ex:Sport
+    ];
+  rml:subjectMap [
+      rml:graphMap [
+          rml:template "http://example.com/graph/Student/{$.ID}/{$.Name}"
+        ];
+      rml:template "http://example.com/Student/{$.ID}/{$.Name}"
+    ] .
+
+

Output

+
<http://example.com/Student/10/Venus%20Williams> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> <http://example.com/graph/Student/10/Venus%20Williams> .
+<http://example.com/Student/10/Venus%20Williams> <http://xmlns.com/foaf/0.1/name> "Venus Williams" <http://example.com/graph/Student/10/Venus%20Williams> .
+<http://example.com/Student/10/Venus%20Williams> <http://example.com/id> "10" <http://example.com/graph/Student/10/Venus%20Williams> . 
+<http://example.com/Student/10/Venus%20Williams> <http://example.com/Sport> "Tennis" <http://example.com/graph/Student/10/Venus%20Williams> . 
+
+
+
+

25. RMLTC0008b-JSON

+

Title: "Generation of triples referencing object map"

+

Description: "Tests the mapping specification referencing object map without join"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "Name":"Venus Williams",
+    "Sport": "Tennis"
+  }]
+}
+
+

Mapping

+
@prefix activity: <http://example.com/activity/> .
+@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap <http://example.com/base/RefObjectMap1>;
+      rml:predicate ex:Sport
+    ], [
+      rml:object foaf:Person;
+      rml:predicate rdf:type
+    ], [
+      rml:objectMap [
+          rml:reference "$.ID"
+        ];
+      rml:predicate ex:id
+    ], [
+      rml:objectMap [
+          rml:reference "$.Name"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Student/{$.ID}/{$.Name}"
+    ] .
+
+<http://example.com/base/RefObjectMap1> a rml:RefObjectMap;
+  rml:parentTriplesMap <http://example.com/base/TriplesMap2> .
+
+<http://example.com/base/TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:object activity:Sport;
+      rml:predicate rdf:type
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{$.Sport}"
+    ] .
+
+

Output

+
<http://example.com/Student/10/Venus%20Williams> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person>  .
+<http://example.com/Student/10/Venus%20Williams> <http://xmlns.com/foaf/0.1/name> "Venus Williams" .
+<http://example.com/Student/10/Venus%20Williams> <http://example.com/id> "10"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.com/Student/10/Venus%20Williams> <http://example.com/Sport> <http://example.com/Tennis> . 
+<http://example.com/Tennis> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/activity/Sport> .
+
+
+
+
+

26. RMLTC0008c-JSON

+

Title: "Generation of triples by using multiple predicateMaps within a rml:predicateObjectMap"

+

Description: "Tests the generation of triples by using multiple predicateMaps within a rml:predicateObjectMap"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "Name":"Venus Williams",
+    "Sport": "Tennis"
+  }]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.Name"
+        ];
+      rml:predicate ex:name, foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Student/{$.ID}/{$.Name}"
+    ] .
+
+

Output

+
<http://example.com/Student/10/Venus%20Williams> <http://xmlns.com/foaf/0.1/name> "Venus Williams"  .
+<http://example.com/Student/10/Venus%20Williams> <http://example.com/name> "Venus Williams"  .
+
+
+
+

27. RMLTC0009a-JSON

+

Title: "Generation of triples from foreign key relations"

+

Description: "Test foreign key relationships among logical tables"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "students" : [
+    { 
+      "ID": 10,
+      "Sport": 100,
+      "Name": "Venus Williams"
+    },
+    { 
+      "ID": 20,
+      "Name": "Demi Moore"
+    }
+  ]
+}
+
+

Input 1

+
{
+  "sports": [
+    {
+      "ID": 100,
+      "Name": "Tennis"
+    }
+  ]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.Name"
+        ];
+      rml:predicate foaf:name
+    ], [
+      rml:objectMap [ a rml:RefObjectMap;
+          rml:joinCondition [
+              rml:child "$.Sport";
+              rml:parent "$.ID"
+            ];
+          rml:parentTriplesMap <http://example.com/base/TriplesMap2>
+        ];
+      rml:predicate <http://example.com/ontology/practises>
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/resource/student_{$.ID}"
+    ] .
+
+<http://example.com/base/TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.sports[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "sport.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.Name"
+        ];
+      rml:predicate rdfs:label
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/resource/sport_{$.ID}"
+    ] .
+
+

Output

+
<http://example.com/resource/student_10> <http://xmlns.com/foaf/0.1/name> "Venus Williams"  .
+<http://example.com/resource/student_20> <http://xmlns.com/foaf/0.1/name> "Demi Moore"  .
+<http://example.com/resource/sport_100> <http://www.w3.org/2000/01/rdf-schema#label> "Tennis" .
+<http://example.com/resource/student_10> <http://example.com/ontology/practises> <http://example.com/resource/sport_100>  .
+
+
+

28. RMLTC0009b-JSON

+

Title: "Generation of triples to multiple graphs"

+

Description: "Test that results from distinct parts of the mapping can be directed to different target graphs."

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "students" : [
+    { 
+      "ID": 10,
+      "Sport": 100,
+      "Name": "Venus Williams"
+    },
+    { 
+      "ID": 20,
+      "Name": "Demi Moore"
+    }
+  ]
+}
+
+

Input 1

+
{
+  "sports": [
+    {
+      "ID": 100,
+      "Name": "Tennis"
+    }
+  ]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:graph <http://example.com/graph/students>;
+      rml:objectMap [
+          rml:reference "$.Name"
+        ];
+      rml:predicate foaf:name
+    ], [
+      rml:graph <http://example.com/graph/practise>;
+      rml:objectMap [ a rml:RefObjectMap;
+          rml:joinCondition [
+              rml:child "$.Sport";
+              rml:parent "$.ID"
+            ];
+          rml:parentTriplesMap <http://example.com/base/TriplesMap2>
+        ];
+      rml:predicate <http://example.com/ontology/practises>
+    ];
+  rml:subjectMap [
+      rml:class <http://example.com/ontology/Student>;
+      rml:graph <http://example.com/graph/students>;
+      rml:template "http://example.com/resource/student_{$.ID}"
+    ] .
+
+<http://example.com/base/TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.sports[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "sport.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.Name"
+        ];
+      rml:predicate rdfs:label
+    ];
+  rml:subjectMap [
+      rml:class <http://example.com/ontology/Sport>;
+      rml:graph <http://example.com/graph/sports>;
+      rml:template "http://example.com/resource/sport_{$.ID}"
+    ] .
+
+

Output

+
<http://example.com/resource/student_10> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/ontology/Student> <http://example.com/graph/students> .
+<http://example.com/resource/student_10> <http://xmlns.com/foaf/0.1/name> "Venus Williams" <http://example.com/graph/students> .
+<http://example.com/resource/student_20> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/ontology/Student> <http://example.com/graph/students> .
+<http://example.com/resource/student_20> <http://xmlns.com/foaf/0.1/name> "Demi Moore" <http://example.com/graph/students> .
+<http://example.com/resource/sport_100> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/ontology/Sport> <http://example.com/graph/sports> .
+<http://example.com/resource/sport_100> <http://www.w3.org/2000/01/rdf-schema#label> "Tennis" <http://example.com/graph/sports> .
+<http://example.com/resource/student_10> <http://example.com/ontology/practises> <http://example.com/resource/sport_100> <http://example.com/graph/practise> .
+<http://example.com/resource/student_10> <http://example.com/ontology/practises> <http://example.com/resource/sport_100> <http://example.com/graph/students> .
+
+
+

29. RMLTC0010a-JSON

+

Title: "Template with table column with blank space"

+

Description: "Tests a template with blank space in column value"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "countries": [{
+    "Country Code": 1,
+    "Name":"Bolivia, Plurinational State of",
+    "ISO 3166": "BO"
+  }, {
+    "Country Code": 2,
+    "Name":"Ireland",
+    "ISO 3166": "IE"
+  }, {
+    "Country Code": 3,
+    "Name":"Saint Martin (French part)",
+    "ISO 3166": "MF"
+  }]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.countries[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "country_info.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.Name"
+        ];
+      rml:predicate ex:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{$.['Country Code']}"
+    ] .
+
+

Output

+
<http://example.com/1> <http://example.com/name> "Bolivia, Plurinational State of" .
+<http://example.com/2> <http://example.com/name> "Ireland" .
+<http://example.com/3> <http://example.com/name> "Saint Martin (French part)" .
+
+
+
+

30. RMLTC0010b-JSON

+

Title: "Template with table columns with special chars"

+

Description: "Tests a template with special chars in column value"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "countries": [{
+    "Country Code": 1,
+    "Name":"Bolivia, Plurinational State of",
+    "ISO 3166": "BO"
+  }, {
+    "Country Code": 2,
+    "Name":"Ireland",
+    "ISO 3166": "IE"
+  }, {
+    "Country Code": 3,
+    "Name":"Saint Martin (French part)",
+    "ISO 3166": "MF"
+  }]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.countries[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "country_info.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.Name"
+        ];
+      rml:predicate ex:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{$.['Country Code']}/{$.Name}"
+    ] .
+
+

Output

+
<http://example.com/1/Bolivia%2C%20Plurinational%20State%20of> <http://example.com/name> "Bolivia, Plurinational State of" .
+<http://example.com/2/Ireland> <http://example.com/name> "Ireland" .
+<http://example.com/3/Saint%20Martin%20%28French%20part%29> <http://example.com/name> "Saint Martin (French part)" .
+
+
+
+

31. RMLTC0010c-JSON

+

Title: "Template with table columns with special chars and backslashes"

+

Description: "Tests a template with special chars in reference value and backslash escapes in string templates"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "countries": [{
+    "Country Code": 1,
+    "Name":"Bolivia, Plurinational State of",
+    "ISO 3166": "BO"
+  }, {
+    "Country Code": 2,
+    "Name":"Ireland",
+    "ISO 3166": "IE"
+  }, {
+    "Country Code": 3,
+    "Name":"Saint Martin (French part)",
+    "ISO 3166": "MF"
+  }]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.countries[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "country_info.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:predicate ex:code;
+      rml:objectMap [
+          rml:template "\\{\\{\\{ {$.['ISO 3166']} \\}\\}\\}";
+          rml:termType rml:Literal
+        ]
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{$.['Country Code']}/{$.Name}"
+    ] .
+
+

Output

+
<http://example.com/1/Bolivia%2C%20Plurinational%20State%20of> <http://example.com/code> "{{{ BO }}}" .
+<http://example.com/2/Ireland> <http://example.com/code> "{{{ IE }}}" .
+<http://example.com/3/Saint%20Martin%20%28French%20part%29> <http://example.com/code> "{{{ MF }}}" .
+
+
+
+

32. RMLTC0011b-JSON

+

Title: "M to M relation, by using an additional Triples Map"

+

Description: "Tests, M to M relations, by using an additional Triples Map"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "students": [
+    {"ID":10, "FirstName":"Venus", "LastName":"Williams"},
+    {"ID":11, "FirstName":"Fernando", "LastName":"Alonso"},
+    {"ID":12, "FirstName":"David", "LastName":"Villa"}
+  ]
+}
+
+

Input 1

+
{
+  "sports": [
+    {"ID":110, "Description":"Tennis"},
+    {"ID":111, "Description":"Football"},
+    {"ID":112, "Description":"Formula1"}
+  ]
+}
+
+

Input 2

+
{
+  "links": [
+    {"ID_Student":10, "ID_Sport":110},
+    {"ID_Student":11, "ID_Sport":111},
+    {"ID_Student":11, "ID_Sport":112},
+    {"ID_Student":12, "ID_Sport":111}
+  ]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/LinkMap_1_2> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.links[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student_sport.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:template "http://example.com/sport/{$.ID_Sport}"
+        ];
+      rml:predicate ex:plays
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/student/{$.ID_Student}"
+    ] .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.FirstName"
+        ];
+      rml:predicate ex:firstName
+    ], [
+      rml:objectMap [
+          rml:reference "$.LastName"
+        ];
+      rml:predicate ex:lastName
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/student/{$.ID}"
+    ] .
+
+<http://example.com/base/TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.sports[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "sport.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.Description"
+        ];
+      rml:predicate ex:description
+    ], [
+      rml:objectMap [
+          rml:reference "$.ID"
+        ];
+      rml:predicate ex:id
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/sport/{$.ID}"
+    ] .
+
+

Output

+
<http://example.com/student/10> <http://example.com/lastName> "Williams" .
+<http://example.com/student/10> <http://example.com/firstName> "Venus" .
+<http://example.com/student/12> <http://example.com/lastName> "Villa" .
+<http://example.com/student/12> <http://example.com/firstName> "David" .
+<http://example.com/student/11> <http://example.com/lastName> "Alonso" .
+<http://example.com/student/11> <http://example.com/firstName> "Fernando" .
+<http://example.com/sport/110> <http://example.com/description> "Tennis" .
+<http://example.com/sport/110> <http://example.com/id> "110"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.com/sport/111> <http://example.com/description> "Football" .
+<http://example.com/sport/111> <http://example.com/id> "111"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.com/sport/112> <http://example.com/description> "Formula1" .
+<http://example.com/sport/112> <http://example.com/id> "112"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.com/student/10> <http://example.com/plays> <http://example.com/sport/110> .
+<http://example.com/student/12> <http://example.com/plays> <http://example.com/sport/111> .
+<http://example.com/student/11> <http://example.com/plays> <http://example.com/sport/112> .
+<http://example.com/student/11> <http://example.com/plays> <http://example.com/sport/111> .
+
+
+
+

33. RMLTC0012a-JSON

+

Title: "Blank node referencing multiple columns"

+

Description: "Tests that blank nodes can be generated by referencing multiple columns"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "persons": [
+    {"fname":"Bob","lname":"Smith","amount":30},
+    {"fname":"Sue","lname":"Jones","amount":20},
+    {"fname":"Bob","lname":"Smith","amount":30}
+  ]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.persons[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "persons.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:template "{$.fname} {$.lname}";
+          rml:termType rml:Literal
+        ];
+      rml:predicate foaf:name
+    ], [
+      rml:objectMap [
+          rml:reference "$.amount"
+        ];
+      rml:predicate ex:amount
+    ];
+  rml:subjectMap [
+      rml:template "{$.fname}{$.lname}{$.amount}";
+      rml:termType rml:BlankNode
+    ] .
+
+

Output

+
_:BobSmith30 <http://example.com/amount> "30" .
+_:BobSmith30 <http://xmlns.com/foaf/0.1/name> "Bob Smith" .
+_:SueJones20 <http://example.com/amount> "20" .
+_:SueJones20 <http://xmlns.com/foaf/0.1/name> "Sue Jones" .
+
+
+
+

34. RMLTC0012b-JSON

+

Title: "Duplicate tuples generate same blank node"

+

Description: "Tests that blank nodes with same identifier and in the same graph but generated by different logical rows are considered equivalent."

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "lives": [
+    {"fname":"Bob","lname":"Smith","city":"London"},
+    {"fname":"Sue","lname":"Jones","city":"Madrid"},
+    {"fname":"Bob","lname":"Smith","city":"London"}
+  ]
+}
+
+

Input 1

+
{
+  "persons": [
+    {"fname":"Bob","lname":"Smith","amount":30},
+    {"fname":"Sue","lname":"Jones","amount":20},
+    {"fname":"Bob","lname":"Smith","amount":30}
+  ]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.persons[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "persons.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:template "{$.fname} {$.lname}";
+          rml:termType rml:Literal
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "{$.fname}{$.lname}";
+      rml:termType rml:BlankNode
+    ] .
+
+<http://example.com/base/TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.lives[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "lives.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.city"
+        ];
+      rml:predicate ex:city
+    ];
+  rml:subjectMap [
+      rml:template "{$.fname}{$.lname}";
+      rml:termType rml:BlankNode
+    ] .
+
+

Output

+
_:BobSmith <http://example.com/city> "London" .
+_:BobSmith <http://xmlns.com/foaf/0.1/name> "Bob Smith" .
+_:SueJones <http://example.com/city> "Madrid" .
+_:SueJones <http://xmlns.com/foaf/0.1/name> "Sue Jones" .
+
+
+
+

35. RMLTC0012c-JSON

+

Title: "TriplesMap without subjectMap"

+

Description: "Tests a RML with missing information, TriplesMap without subjectMap."

+

Default Base IRI: http://example.com/

+

Error expected? Yes

+

Input

+
{
+  "persons": [
+    {"fname":"Bob","lname":"Smith","amount":30},
+    {"fname":"Sue","lname":"Jones","amount":20},
+    {"fname":"Bob","lname":"Smith","amount":30}
+  ]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.persons[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "persons.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:template "{$.fname} {$.lname}";
+          rml:termType rml:Literal
+        ];
+      rml:predicate foaf:name
+    ], [
+      rml:objectMap [
+          rml:reference "$.amount"
+        ];
+      rml:predicate ex:amount
+    ] .
+
+
+

36. RMLTC0012d-JSON

+

Title: "TriplesMap with two subjectMap"

+

Description: "Tests a RML with wrong information, TriplesMap with two subjectMap."

+

Default Base IRI: http://example.com/

+

Error expected? Yes

+

Input

+
{
+  "persons": [
+    {"fname":"Bob","lname":"Smith","amount":30},
+    {"fname":"Sue","lname":"Jones","amount":20},
+    {"fname":"Bob","lname":"Smith","amount":30}
+  ]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.persons[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "persons.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:template "{$.fname} {$.lname}";
+          rml:termType rml:Literal
+        ];
+      rml:predicate foaf:name
+    ], [
+      rml:objectMap [
+          rml:reference "$.amount"
+        ];
+      rml:predicate ex:amount
+    ];
+  rml:subjectMap [
+      rml:template "{$.fname}_{$.lname}_{$.amount}";
+      rml:termType rml:BlankNode
+    ], [
+      rml:template "{$.amount}_{$.fname}_{$.lname}";
+      rml:termType rml:BlankNode
+    ] .
+
+
+

37. RMLTC0013a-JSON

+

Title: "Null value in JSON file"

+

Description: "Tests if null values in JSON files are handled correctly."

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "persons": [
+    {"ID":"1","Name":"Alice","DateOfBirth":null},
+    {"ID":"2","Name":"Bob","DateOfBirth":"September, 2010"}
+  ]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.persons[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "persons.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.DateOfBirth"
+        ];
+      rml:predicate ex:BirthDay
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Person/{$.ID}/{$.Name}/{$.DateOfBirth}"
+    ] .
+
+

Output

+
<http://example.com/Person/2/Bob/September%2C%202010> <http://example.com/BirthDay> "September, 2010" .
+
+
+

38. RMLTC0015a-JSON

+

Title: "Generation of language tags from a table with language information"

+

Description: "Generation of language tags from a table with language information"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "countries": [
+    {"Code": "BO", "Name": "Estado Plurinacional de Bolivia"},
+    {"Code": "IE", "Name": "Irlanda"}
+  ]
+}
+
+

Mapping

+
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.countries[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "country_en.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:language "en";
+          rml:reference "$.Name"
+        ];
+      rml:predicate rdfs:label
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{$.Code}"
+    ] .
+
+<http://example.com/base/TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.countries[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "country_es.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:language "es";
+          rml:reference "$.Name"
+        ];
+      rml:predicate rdfs:label
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{$.Code}"
+    ] .
+
+

Output

+
<http://example.com/BO> <http://www.w3.org/2000/01/rdf-schema#label> "Bolivia, Plurinational State of"@en .
+<http://example.com/BO> <http://www.w3.org/2000/01/rdf-schema#label> "Estado Plurinacional de Bolivia"@es .
+<http://example.com/IE> <http://www.w3.org/2000/01/rdf-schema#label> "Ireland"@en .
+<http://example.com/IE> <http://www.w3.org/2000/01/rdf-schema#label> "Irlanda"@es .
+
+
+
+
+

39. RMLTC0015b-JSON

+

Title: "Generation of language tags from a table with language information, and a term map with invalid rml:language value"

+

Description: "Tests a term map with an invalid rml:language value, which is an error"

+

Default Base IRI: http://example.com/

+

Error expected? Yes

+

Input

+
{
+  "countries": [
+    {"Code": "BO", "Name": "Estado Plurinacional de Bolivia"},
+    {"Code": "IE", "Name": "Irlanda"}
+  ]
+}
+
+

Mapping

+
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.countries[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "country_en.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:language "a-english";
+          rml:reference "$.Name"
+        ];
+      rml:predicate rdfs:label
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{$.Code}"
+    ] .
+
+<http://example.com/base/TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.countries[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "country_en.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:language "a-spanish";
+          rml:reference "$.Name"
+        ];
+      rml:predicate rdfs:label
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{$.Code}"
+    ] .
+
+
+

40. RMLTC0019a-JSON

+

Title: "Generation of triples by using IRI value in columns"

+

Description: "Test the generation of triples by using IRI value in attributes"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "persons": [
+    {
+      "ID": 10,
+      "FirstName": "http://example.com/ns#Jhon",
+      "LastName": "Smith"
+    },
+    {
+      "ID": 20,
+      "FirstName": "Carlos",
+      "LastName": "Mendoza"
+    }
+  ]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.persons[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "persons.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.FirstName"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:reference "$.FirstName"
+    ] .
+
+

Output

+
<http://example.com/ns#Jhon> <http://xmlns.com/foaf/0.1/name> "http://example.com/ns#Jhon" .
+<http://example.com/Carlos> <http://xmlns.com/foaf/0.1/name> "Carlos" .
+
+
+

41. RMLTC0019b-JSON

+

Title: "Generation of triples by using IRI value in columns, with data error"

+

Description: "Test the generation of triples by using IRI value in attributes, conforming RML mapping with data error (and limited results)"

+

Default Base IRI: http://example.com/

+

Error expected? Yes

+

Input

+
{
+  "persons": [
+    {
+      "ID": 30,
+      "FirstName": "Juan Daniel",
+      "LastName": "Crespo"
+    }
+  ]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.persons[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "persons.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.FirstName"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:reference "$.FirstName"
+    ] .
+
+
+

42. RMLTC0020a-JSON

+

Title: "Generation of triples by using IRI value in columns"

+

Description: "Test the generation of triples by using IRI value in attributes"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "students": [
+    {"Name": "http://example.com/company/Alice"},
+    {"Name": "Bob"},
+    {"Name": "Bob/Charles"},
+    {"Name": "path/../Danny"},
+    {"Name": "Emily Smith"}
+  ]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:object foaf:Person;
+      rml:predicate rdf:type
+    ];
+  rml:subjectMap [
+      rml:template "{$.Name}";
+      rml:termType rml:IRI
+    ] .
+
+

Output

+
<http://example.com/http%3A%2F%2Fexample.com%2Fcompany%2FAlice> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Bob> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Bob%2FCharles> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/path%2F..%2FDanny> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Emily%20Smith> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+
+
+

43. RMLTC0021a-JSON

+

Title: "Generation of triples referencing object map"

+

Description: "Tests the mapping specification referencing object map with same logical source and join condition"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "Name":"Venus Williams",
+    "Sport": "Tennis"
+  }, {
+    "ID": 20,
+    "Name":"Serena Williams",
+    "Sport": "Tennis"
+  }, {
+    "ID": 30,
+    "Name":"Loena Hendrickx",
+    "Sport": "Figure skating"
+  }]
+}
+
+

Mapping

+
@prefix activity: <http://example.com/activity/> .
+@prefix ex: <http://example.com/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/RefObjectMap1> a rml:RefObjectMap;
+  rml:joinCondition [
+      rml:child "$.Sport";
+      rml:parent "$.Sport"
+    ];
+  rml:parentTriplesMap <http://example.com/base/TriplesMap1> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap <http://example.com/base/RefObjectMap1>;
+      rml:predicate ex:sameSportAs
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Student/{$.ID}/{$.Name}"
+    ] .
+
+

Output

+
<http://example.com/Student/10/Venus%20Williams> <http://example.com/sameSportAs> <http://example.com/Student/10/Venus%20Williams> . 
+<http://example.com/Student/10/Venus%20Williams> <http://example.com/sameSportAs> <http://example.com/Student/20/Serena%20Williams> . 
+<http://example.com/Student/20/Serena%20Williams> <http://example.com/sameSportAs> <http://example.com/Student/20/Serena%20Williams> . 
+<http://example.com/Student/20/Serena%20Williams> <http://example.com/sameSportAs> <http://example.com/Student/10/Venus%20Williams> . 
+<http://example.com/Student/30/Loena%20Hendrickx> <http://example.com/sameSportAs> <http://example.com/Student/30/Loena%20Hendrickx> . 
+
+
+
+
+

44. RMLTC0022a-JSON

+

Title: "Generating of triples with constant datatype"

+

Description: "Test triples with a fixed constant datatype"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "Name":"Venus",
+    "Age": 21
+  }]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:datatype xsd:string;
+          rml:reference "$.Name"
+        ];
+      rml:predicate foaf:name
+    ], [
+      rml:objectMap [
+          rml:datatype xsd:int;
+          rml:reference "$.Age"
+        ];
+      rml:predicate ex:age
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{$.Name}"
+    ] .
+
+

Output

+
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "Venus"^^<http://www.w3.org/2001/XMLSchema#string> .
+<http://example.com/Venus> <http://example.com/age> "21"^^<http://www.w3.org/2001/XMLSchema#int> .
+
+
+

45. RMLTC0022b-JSON

+

Title: "Generating of triples with datatypeMap"

+

Description: "Test triples with a XSD datatype generated from the data"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
[
+    { "FOO": 1, "BAR": "string"},
+    { "FOO": 2, "BAR": "int"}
+]
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:referenceFormulation rml:JSONPath;
+      rml:iterator "$[*]";
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "data.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:datatypeMap [
+              rml:template "http://www.w3.org/2001/XMLSchema#{$.BAR}"
+            ];
+          rml:reference "$.FOO"
+        ];
+      rml:predicate ex:x
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{$.FOO}"
+    ] .
+
+
+

Output

+
<http://example.com/1> <http://example.com/x> "1"^^<http://www.w3.org/2001/XMLSchema#string> .
+<http://example.com/2> <http://example.com/x> "2"^^<http://www.w3.org/2001/XMLSchema#int> .
+
+
+

46. RMLTC0022c-JSON

+

Title: "Generating of triples with datatypeMap with custom datatype"

+

Description: "Test triples with a custom datype from the data"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
[
+    { "FOO": 1, "BAR": "string"},
+    { "FOO": 2, "BAR": "int"}
+]
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:referenceFormulation rml:JSONPath;
+      rml:iterator "$[*]";
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "data.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:datatypeMap [
+              rml:template "datatype#{$.BAR}"
+            ];
+          rml:reference "$.FOO"
+        ];
+      rml:predicate ex:x
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{$.FOO}"
+    ] .
+
+

Output

+
<http://example.com/1> <http://example.com/x> "1"^^<http://example.com/datatype#string> .
+<http://example.com/2> <http://example.com/x> "2"^^<http://example.com/datatype#int> .
+
+
+

47. RMLTC0023a-JSON

+

Title: "Invalid IRI template 1"

+

Description: "Test handling of invalid IRI template"

+

Default Base IRI: http://example.com/

+

Error expected? Yes

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "{Name}":"Venus"
+  }]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:referenceFormulation rml:JSONPath;
+      rml:iterator "$.students[*]";
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{{Name}}";
+      rml:class foaf:Person;
+    ] .
+
+
+

48. RMLTC0023b-JSON

+

Title: "Invalid IRI template 2"

+

Description: "Test handling of invalid IRI template"

+

Default Base IRI: http://example.com/

+

Error expected? Yes

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "N\ame":"Venus"
+  }]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:referenceFormulation rml:JSONPath;
+      rml:iterator "$.students[*]";
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{N\ame}";
+      rml:class foaf:Person;
+    ] .
+
+
+
+

49. RMLTC0023c-JSON

+

Title: "Invalid IRI template 3"

+

Description: "Test handling of invalid IRI template"

+

Default Base IRI: http://example.com/

+

Error expected? Yes

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "Name":"Venus"
+  }]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:referenceFormulation rml:JSONPath;
+      rml:iterator "$.students[*]";
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{Name\}";
+      rml:class foaf:Person;
+    ] .
+
+
+
+

50. RMLTC0023d-JSON

+

Title: "Invalid IRI template 4"

+

Description: "Test handling of invalid IRI template"

+

Default Base IRI: http://example.com/

+

Error expected? Yes

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "{Name}":"Venus"
+  }]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+     rml:referenceFormulation rml:JSONPath;
+     rml:iterator "$.students[*]";
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{\\\\{Name\\\\}}";
+      rml:class foaf:Person;
+    ] .
+
+
+
+

51. RMLTC0023e-JSON

+

Title: "Invalid IRI template 5"

+

Description: "Test handling of invalid IRI template"

+

Default Base IRI: http://example.com/

+

Error expected? Yes

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "N\ame":"Venus"
+  }]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:referenceFormulation rml:JSONPath;
+      rml:iterator "$.students[*]";
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{N\\\ame}";
+      rml:class foaf:Person;
+    ] .
+
+
+

52. RMLTC0023f-JSON

+

Title: "Valid IRI template with backslash-escape"

+

Description: "Test handling of a valid IRI template using backslash-escape"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "{Name}":"Venus"
+  }]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+     rml:referenceFormulation rml:JSONPath;
+     rml:iterator "$.students[*]";
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{\\{Name\\}}";
+      rml:class foaf:Person;
+    ] .
+
+
+

Output

+
<http://example.com/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+
+
+
+ + + + Error response + + +

Error response

+

Error code: 404

+

Message: File not found.

+

Error code explanation: 404 - Nothing matches the given URI.

+ +
+

53. RMLTC0024a-JSON

+

Title: "Usage of constant term maps in combination with explicitly defined term types"

+

Description: "Tests the usage of constant term maps in combination with explicitly defined term types"

+

Default Base IRI: http://example.com/

+

Error expected? Yes

+

Input

+
{
+  "students": [{
+    "Name":"Venus"
+  },
+  {
+    "Name":"Julio"
+  }]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix ex: <http://example.com/>.
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.Name"
+        ];
+      rml:predicate ex:student
+    ];
+  rml:subjectMap [
+      rml:constant "School";
+      rml:termType rml:BlankNode
+  ] .
+
+
+

54. RMLTC0025a-JSON

+

Title: "Generation of triples from arrays"

+

Description: "Tests the generation of triples from array input data structures"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "persons": [
+    {"fname":"Bob","lname":"Smith","amounts":[30, 40, 50]}
+  ]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.persons[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "persons.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.amounts[*]"
+        ];
+      rml:predicate ex:amount
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Student/{$.fname}/{$.lname}"
+    ] .
+
+

Output

+
<http://example.com/Student/Bob/Smith> <http://example.com/amount> "30"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.com/Student/Bob/Smith> <http://example.com/amount> "40"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.com/Student/Bob/Smith> <http://example.com/amount> "50"^^<http://www.w3.org/2001/XMLSchema#integer> .
+
+
+

55. RMLTC0025b-JSON

+

Title: "Generation of triples from arrays with wrong reference"

+

Description: "Tests the generation of triples from array input data structures. Test should fail as reference points to the array and not the values of the array"

+

Default Base IRI: http://example.com/

+

Error expected? Yes

+

Input

+
{
+  "persons": [
+    {"fname":"Bob","lname":"Smith","amounts":[30, 40, 50]}
+  ]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.persons[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "persons.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.amounts"
+        ];
+      rml:predicate ex:amount
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Student/{$.fname}/{$.lname}"
+    ] .
+
+
+

56. RMLTC0025c-JSON

+

Title: "Generation of triples from arrays in subject and object"

+

Description: "Tests the generation of triples from array input data structures in subject and object"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "persons": [
+    {"names":["Bob", "Smith"],"amounts":[30, 40, 50]}
+  ]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.persons[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "persons.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.amounts[*]"
+        ];
+      rml:predicate ex:amount
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Student/{$.names[*]}"
+    ] .
+
+

Output

+
<http://example.com/Student/Smith> <http://example.com/amount> "30"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.com/Student/Smith> <http://example.com/amount> "40"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.com/Student/Smith> <http://example.com/amount> "50"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.com/Student/Bob> <http://example.com/amount> "30"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.com/Student/Bob> <http://example.com/amount> "40"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.com/Student/Bob> <http://example.com/amount> "50"^^<http://www.w3.org/2001/XMLSchema#integer> .
+
+
+

57. RMLTC0026a-JSON

+

Title: "Two triples maps, one with rml:baseIRI and one without and generating absolute IRIs"

+

Description: "Tests the generation of triples from relative IRIs using base IRI"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "persons": [
+    {"fname":"Bob","lname":"Smith","amount":30},
+    {"fname":"Sue","lname":"Jones","amount":20}
+  ]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:baseIRI <http://example.com/>;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.persons[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "persons.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.amount"
+        ];
+      rml:predicate ex:amount
+    ];
+  rml:subjectMap [
+      rml:template "{$.fname}"
+    ] .
+
+<http://example.com/base/TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.persons[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "persons.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.amount"
+        ];
+      rml:predicate ex:amount
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{$.lname}"
+    ] .
+
+

Output

+
<http://example.com/Bob> <http://example.com/amount> "30"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.com/Jones> <http://example.com/amount> "20"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.com/Smith> <http://example.com/amount> "30"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.com/Sue> <http://example.com/amount> "20"^^<http://www.w3.org/2001/XMLSchema#integer> .
+
+
+

58. RMLTC0026b-JSON

+

Title: "Two triples maps, one with rml:baseIRI one one without and generating relative IRIs using baseIRI parameter"

+

Description: "Tests the generation of triples from relative IRI using base IRI parameter"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "persons": [
+    {"fname":"Bob","lname":"Smith","amount":30},
+    {"fname":"Sue","lname":"Jones","amount":20}
+  ]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:baseIRI <http://tp1.com/>;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.persons[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "persons.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.amount"
+        ];
+      rml:predicate ex:amount
+    ];
+  rml:subjectMap [
+      rml:template "{$.fname}"
+    ] .
+
+<http://example.com/base/TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.persons[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "persons.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.amount"
+        ];
+      rml:predicate ex:amount
+    ];
+  rml:subjectMap [
+      rml:template "{$.lname}"
+    ] .
+
+

Output

+
<http://tp1.com/Bob> <http://example.com/amount> "30"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.com/Jones> <http://example.com/amount> "20"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.com/Smith> <http://example.com/amount> "30"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://tp1.com/Sue> <http://example.com/amount> "20"^^<http://www.w3.org/2001/XMLSchema#integer> .
+
+
+

59. RMLTC0026c-JSON

+

Title: "Two triples maps, both with rml:baseIRI defined"

+

Description: "Tests the generation of triples using relative IRIs with base IRIs defined only in triples maps, without base IRI parameter"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "persons": [
+    {"fname":"Bob","lname":"Smith","amount":30},
+    {"fname":"Sue","lname":"Jones","amount":20}
+  ]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:baseIRI <http://example.com/>;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.persons[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "persons.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.amount"
+        ];
+      rml:predicate ex:amount
+    ];
+  rml:subjectMap [
+      rml:template "{$.fname}"
+    ] .
+
+<http://example.com/base/TriplesMap2> a rml:TriplesMap;
+  rml:baseIRI <http://example.com/>;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.persons[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "persons.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.amount"
+        ];
+      rml:predicate ex:amount
+    ];
+  rml:subjectMap [
+      rml:template "{$.lname}"
+    ] .
+
+

Output

+
<http://example.com/Bob> <http://example.com/amount> "30"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.com/Jones> <http://example.com/amount> "20"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.com/Smith> <http://example.com/amount> "30"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.com/Sue> <http://example.com/amount> "20"^^<http://www.w3.org/2001/XMLSchema#integer> .
+
+
+

60. RMLTC0026d-JSON

+

Title: "Two triples maps,both with rml:bseIRI defined and baseIRI parameter defined"

+

Description: "Tests the generation of triples by with base IRIs different than the base IRI parameter"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "persons": [
+    {"fname":"Bob","lname":"Smith","amount":30},
+    {"fname":"Sue","lname":"Jones","amount":20}
+  ]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:baseIRI <http://example2.com/>;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.persons[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "persons.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.amount"
+        ];
+      rml:predicate ex:amount
+    ];
+  rml:subjectMap [
+      rml:template "{$.fname}"
+    ] .
+
+<http://example.com/base/TriplesMap2> a rml:TriplesMap;
+  rml:baseIRI <http://example2.com/>;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.persons[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "persons.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.amount"
+        ];
+      rml:predicate ex:amount
+    ];
+  rml:subjectMap [
+      rml:template "{$.lname}"
+    ] .
+
+

Output

+
<http://example2.com/Bob> <http://example.com/amount> "30"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example2.com/Jones> <http://example.com/amount> "20"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example2.com/Smith> <http://example.com/amount> "30"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example2.com/Sue> <http://example.com/amount> "20"^^<http://www.w3.org/2001/XMLSchema#integer> .
+
+
+

61. RMLTC0027a-JSON

+

Title: "Generation of triples using the URI term type"

+

Description: "Tests the generation of triples with a URI term type in the subject or object"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "students": [
+    {"Name": "Alice"},
+    {"Name": "Bob"},
+    {"Name": "Bob/Charles"},
+    {"Name": "Danny"},
+    {"Name": "Emily Smith"}
+  ]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:object foaf:Person;
+      rml:predicate rdf:type
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Person/{$.Name}";
+      rml:termType rml:URI
+    ] .
+
+

Output

+
<http://example.com/Person/Alice> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Person/Bob> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Person/Bob%2FCharles> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Person/Danny> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Person/Emily%20Smith> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+
+
+

62. RMLTC0027b-JSON

+

Title: "Generation of triples using the UnsafeURI term type"

+

Description: "Tests the generation of triples with a UnsafeURI term type in the subject or object"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "students": [
+    {"Name": "Alice"},
+    {"Name": "Bob"},
+    {"Name": "Bob/Charles"},
+    {"Name": "Danny"},
+    {"Name": "Emily Smith"}
+  ]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:object foaf:Person;
+      rml:predicate rdf:type
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Person/{$.Name}";
+      rml:termType rml:UnsafeURI
+    ] .
+
+

Output

+
<http://example.com/Person/Alice> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Person/Bob> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Person/Bob%2FCharles> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Person/Danny> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Person/Emily%20Smith> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+
+
+

63. RMLTC0027c-JSON

+

Title: "Generation of triples using the UnsafeIRI term type"

+

Description: "Tests the generation of triples with a UnsafeIRI term type in the subject or object"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "students": [
+    {"Name": "Alice"},
+    {"Name": "Bob"},
+    {"Name": "Bob/Charles"},
+    {"Name": "Danny"},
+    {"Name": "Emily Smith"}
+  ]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:object foaf:Person;
+      rml:predicate rdf:type
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Person/{$.Name}";
+      rml:termType rml:UnsafeIRI
+    ] .
+
+

Output

+
<http://example.com/Person/Alice> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Person/Bob> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Person/Bob%2FCharles> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Person/Danny> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Person/Emily%20Smith> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+
+
+

64. RMLTC0028a-JSON

+

Title: "Generation of the right datatype for a constant in the mapping"

+

Description: "Test the honoring of the datatype specified by the constant term in the mapping"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
[ { "id": "0", "foo": "bar"  } ] 
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+    rml:logicalSource [
+      rml:referenceFormulation rml:JSONPath ;
+      rml:iterator "$[*]";
+      rml:source [ a rml:RelativePathSource;
+        rml:root rml:MappingDirectory;
+        rml:path "data.json"
+      ]
+    ];
+    rml:subjectMap [
+      rml:template "https://example.org/instances/{id}";
+    ];
+    rml:predicateObjectMap [
+      rml:predicate <http://example.org/ns/p> ;
+      rml:object true ; # datatype is boolean
+    ] .
+
+

Output

+
<https://example.org/instances/0> <http://example.org/ns/p> "true"^^<http://www.w3.org/2001/XMLSchema#boolean> .
+
+
+

65. RMLTC0028b-JSON

+

Title: "Generation of all named graphs when rml:defaultGraph is involved"

+

Description: "Test if the default graph is also generated correctly."

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
[ { "id": "0", "name": "Alice"  } ] 
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix s: <http://schema.org/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+    rml:logicalSource [
+      rml:referenceFormulation rml:JSONPath ;
+      rml:iterator "$[*]";
+      rml:source [ a rml:RelativePathSource;
+        rml:root rml:MappingDirectory;
+        rml:path "data.json"
+      ]
+    ];
+    rml:subjectMap [
+      rml:template "https://example.org/instances/{id}";
+      rml:class s:Person ;
+      rml:graph <graph:1> ;
+    ];
+    rml:predicateObjectMap [
+      rml:predicate s:givenName ;
+      rml:objectMap [ rml:reference "name" ] ;
+      rml:graph rml:defaultGraph ;
+    ].
+
+

Output

+
<https://example.org/instances/0> <http://schema.org/givenName> "Alice".
+<https://example.org/instances/0> <http://schema.org/givenName> "Alice" <graph:1> .
+<https://example.org/instances/0> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://schema.org/Person> <graph:1> .
+
+
+

66. RMLTC0028c-JSON

+

Title: "Generation of the right language tag for a constant in the mapping"

+

Description: "Test the honoring of the language tag specified by the constant term in the mapping"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
[ { "id": "0", "foo": "bar"  } ] 
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+    rml:logicalSource [
+      rml:referenceFormulation rml:JSONPath ;
+      rml:iterator "$[*]";
+      rml:source [ a rml:RelativePathSource;
+        rml:root rml:MappingDirectory;
+        rml:path "data.json"
+      ]
+    ];
+    rml:subjectMap [
+      rml:template "https://example.org/instances/{id}";
+    ];
+    rml:predicateObjectMap [
+      rml:predicate <http://example.org/ns/p> ;
+      rml:object "train"@en ;
+    ] .
+
+

Output

+
<https://example.org/instances/0> <http://example.org/ns/p> "train"@en .
+
+
+ + + + + \ No newline at end of file diff --git a/src/test/resources/rml-core/docs/20250930/index.html b/src/test/resources/rml-core/docs/20250930/index.html new file mode 100644 index 00000000..782b75e6 --- /dev/null +++ b/src/test/resources/rml-core/docs/20250930/index.html @@ -0,0 +1,3878 @@ + + + + + + +RML-Core: Test Cases + + + + + + + + + + + + + + + + + + + +

Abstract

This document defines the RML-Core test cases to the determine the RML-Core specification conformance of tools.

+
+ +

Status of This Document

+ This specification was published by the + Knowledge Graph Construction Community Group. It is not a W3C Standard nor is it + on the W3C Standards Track. + + Please note that under the + W3C Community Contributor License Agreement (CLA) + there is a limited opt-out and other conditions apply. + + Learn more about + W3C Community and Business Groups. +

+ GitHub Issues are preferred for + discussion of this specification. + + +

+ +

1. Introduction

+

This document defines the RML-Core test cases, consisting of a collection of test case documents (input and expected output). +The purpose of the test cases is to determine the conformance of tools that execute RML rules to the RML-Core specification.

+
+ +

2. Data model

+

The test cases are semantically described for re-usability and shareability following the W3C Test case description. +Each test:Testcase as the following properties:

+
    +
  • dcterms:identifier: unique ID of the test case.
  • +
  • rmltest:hasError: if an error of the RML Processor is expected or not.
  • +
  • rmltest:input: One or more input data of the test case.
  • +
  • rmltest:output: One or more output data of the test case.
  • +
  • rmltest:inputFormat: the input data format.
  • +
  • rmltest:outputFormat: the output data format.
  • +
  • rmltest:mappingDocument: the RML mapping rules in Turtle.
  • +
+
+ +

3. Test cases

+

This section describes the RML-Core test cases. These descriptions are also available as RDF. +The files are available on GitHub in the folder test-cases. +Each test case is contained in a single folder, containing three types of files:

+
    +
  • Zero or more files containing the data sources, in the case of JSON, XML, CSV, or containing the SQL statements to create the necessary tables, in the case of MySQL, PostgreSQL, and SQL Server.
  • +
  • One file with the RML rules, called mapping.ttl, in the Turtle format.
  • +
  • Zero or more files with the expected RDF. No file is provided if an error is expected that must halt the generation of the RDF because of an error.
  • +
+
+ + +

4. RMLTC0000-JSON

+

Title: "one table, one column, zero rows"

+

Description: "Tests if an empty table produces an empty RDF graph"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "students": []
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.Name"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{$.Name}"
+    ] .
+
+

Output

+
# empty database
+
+
+

5. RMLTC0001a-JSON

+

Title: "One column mapping, subject URI generation by using rml:template"

+

Description: "Tests: (1) one column mapping; (2) subject URI generation by using rml:template; (3) one column to one property"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "Name":"Venus"
+  }]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.Name"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap <http://example.com/base/#NameSubjectMap> .
+
+<http://example.com/base/#NameSubjectMap> rml:template "http://example.com/{$.Name}" .
+
+

Output

+
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
+
+
+
+

6. RMLTC0001b-JSON

+

Title: "One column mapping, generation of a BlankNode subject by using rml:termType"

+

Description: "Tests: (1) one column mapping; (2) generation of a BlankNode subject by using rml:termType; (3) one column to one property"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "Name":"Venus"
+  }]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.Name"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "{$.Name}";
+      rml:termType rml:BlankNode
+    ] .
+
+

Output

+
_:Venus <http://xmlns.com/foaf/0.1/name> "Venus" .
+
+
+
+

7. RMLTC0002a-JSON

+

Title: "Two columns mapping, generation of a subject URI by the concatenation of two column values"

+

Description: "Tests: (1) two column mapping, no primary key; (2) subject URI generated by the concatenation of two column values; (3) one column to one property"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "Name":"Venus"
+  }]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.ID"
+        ];
+      rml:predicate ex:id
+    ], [
+      rml:objectMap [
+          rml:reference "$.Name"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:class foaf:Person;
+      rml:template "http://example.com/{$.ID}/{$.Name}"
+    ] .
+
+

Output

+
<http://example.com/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
+<http://example.com/10/Venus> <http://example.com/id> "10"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.com/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+
+
+
+

8. RMLTC0002b-JSON

+

Title: "Two columns mapping, generation of a BlankNode subject by using rml:template and rml:termType"

+

Description: "Tests: (1) two column mapping, no primary key; (2) generation of a BlankNode subject by using rml:template; (3) one column to one property"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "Name":"Venus"
+  }]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.Name"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "students{$.ID}";
+      rml:termType rml:BlankNode
+    ] .
+
+

Output

+
_:students10 <http://xmlns.com/foaf/0.1/name> "Venus" .
+
+
+
+

9. RMLTC0002e-JSON

+

Title: "Two columns mapping, an undefined rml:path"

+

Description: "Tests the presence of an undefined rml:path"

+

Default Base IRI: http://example.com/

+

Error expected? Yes

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "Name":"Venus"
+  }]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student2.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.IDs"
+        ];
+      rml:predicate ex:id
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{$.ID}/{$.Name}"
+    ] .
+
+
+

10. RMLTC0002g-JSON

+

Title: "Two columns mapping, invalid JSONPath"

+

Description: "Test the presence of an invalid JSONPath"

+

Default Base IRI: http://example.com/

+

Error expected? Yes

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "Name":"Venus"
+  }]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student2.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.IDs"
+        ];
+      rml:predicate ex:id
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{$.ID}/{$.Name}"
+    ] .
+
+
+

11. RMLTC0003c-JSON

+

Title: "Three columns mapping, by using a rml:template to produce literal"

+

Description: "Tests: (1) three column mapping; and (2) the use of rml:template to produce literal"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "FirstName":"Venus",
+    "LastName":"Williams"
+  }]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:template "{$.FirstName} {$.LastName}";
+          rml:termType rml:Literal
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Student{$.ID}"
+    ] .
+
+

Output

+
<http://example.com/Student10> <http://xmlns.com/foaf/0.1/name> "Venus Williams" .
+
+
+

12. RMLTC0004a-JSON

+

Title: "Two column mapping, from one row table to two different triples"

+

Description: "Tests: (1) two column mapping, (2) subject URI generated by a column value; (3) from one row table to two different triples (4) typing by using rml:class"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "Student": "Venus",
+    "Sport":"Tennis"
+  }]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student_sport.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.Student"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:class ex:Student;
+      rml:template "http://example.com/{$.Student}"
+    ] .
+
+<http://example.com/base/TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student_sport.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.Sport"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:class ex:Sport;
+      rml:template "http://example.com/{$.Sport}"
+    ] .
+
+

Output

+
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
+<http://example.com/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/Student> .
+<http://example.com/Tennis> <http://xmlns.com/foaf/0.1/name> "Tennis" .
+<http://example.com/Tennis> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/Sport> .
+
+
+
+

13. RMLTC0004b-JSON

+

Title: "One column mapping, presence of rml:termType rml:Literal on rml:subjectMap"

+

Description: "Tests: (1) one column mapping (2) the presence of rml:termType rml:Literal on rml:subjectMap, which is invalid"

+

Default Base IRI: http://example.com/

+

Error expected? Yes

+

Input

+
{
+  "students": [{
+    "Name":"Venus"
+  }]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.Name"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{$.Name}";
+      rml:termType rml:Literal
+    ] .
+
+
+

14. RMLTC0005a-JSON

+

Title: "Typing of resources"

+

Description: "Tests the typing of resources"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "persons": [
+    {
+      "fname": "Bob",
+      "lname": "Smith",
+      "amount": "30.0E0"
+    },
+    {
+      "fname": "Sue",
+      "lname": "Jones",
+      "amount": "20.0E0"
+    },
+    {
+      "fname": "Bob",
+      "lname": "Smith",
+      "amount": "30.0E0"
+    }
+  ]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.persons[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "ious.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.amount"
+        ];
+      rml:predicate ex:owes
+    ];
+  rml:subjectMap [
+      rml:class foaf:Person;
+      rml:template "http://example.com/{$.fname};{$.lname}"
+    ] .
+
+

Output

+
<http://example.com/Bob;Smith> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Bob;Smith> <http://example.com/owes> "30.0E0" .
+<http://example.com/Sue;Jones> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Sue;Jones> <http://example.com/owes> "20.0E0" .
+
+
+
+

15. RMLTC0006a-JSON

+

Title: "Use of rml:constant in rml:subjectMap, rml:predicateMap, rml:objectMap and rml:graphMap"

+

Description: "Tests the use of rml:constant in rml:subjectMap, rml:predicateMap, rml:objectMap and rml:graphMap"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "FirstName":"Venus",
+    "LastName":"Williams"
+  }]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:constant "Bad Student"
+        ];
+      rml:predicateMap [
+          rml:constant ex:description
+        ]
+    ];
+  rml:subjectMap [
+      rml:constant ex:BadStudent;
+      rml:graphMap [
+          rml:constant <http://example.com/graph/student>
+        ]
+    ] .
+
+

Output

+
<http://example.com/BadStudent> <http://example.com/description> "Bad Student" <http://example.com/graph/student> .
+
+
+

16. RMLTC0007a-JSON

+

Title: "Typing resources by relying on rdf:type predicate"

+

Description: "Tests the typing resources by relying on rdf:type predicate"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "FirstName":"Venus",
+    "LastName":"Williams"
+  }]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:object foaf:Person;
+      rml:predicate rdf:type
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Student/{$.ID}/{$.FirstName}"
+    ] .
+
+

Output

+
 <http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+
+
+
+

17. RMLTC0007b-JSON

+

Title: "Assigning triples to Named Graphs"

+

Description: "Tests the generation of triples to a named graph"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "FirstName":"Venus",
+    "LastName":"Williams"
+  }]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:object foaf:Person;
+      rml:predicate rdf:type
+    ], [
+      rml:objectMap [
+          rml:reference "$.FirstName"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:graph ex:PersonGraph;
+      rml:template "http://example.com/Student/{$.ID}/{$.FirstName}"
+    ] .
+
+

Output

+
<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" <http://example.com/PersonGraph> . 
+<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person>  <http://example.com/PersonGraph> .
+
+
+
+

18. RMLTC0007c-JSON

+

Title: "One row mapping, using rml:class"

+

Description: "Tests subjectmap with more than one class IRIs, rml:class"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "FirstName":"Venus",
+    "LastName":"Williams"
+  }]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.ID"
+        ];
+      rml:predicate ex:id
+    ], [
+      rml:objectMap [
+          rml:reference "$.FirstName"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:class ex:Student, foaf:Person;
+      rml:template "http://example.com/Student/{$.ID}/{$.FirstName}"
+    ] .
+
+

Output

+
<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
+<http://example.com/Student/10/Venus> <http://example.com/id> "10"^^<http://www.w3.org/2001/XMLSchema#integer> . 
+<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/Student> .
+
+
+
+

19. RMLTC0007d-JSON

+

Title: "One column mapping, specifying an rml:predicateObjectMap with rdf:type"

+

Description: "Tests subjectmap with an alternative of having rml:class, i.e., by specifying an rml:predicateObjectMap with predicate rdf:type"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "FirstName":"Venus",
+    "LastName":"Williams"
+  }]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:object foaf:Person;
+      rml:predicate rdf:type
+    ], [
+      rml:object ex:Student;
+      rml:predicate rdf:type
+    ], [
+      rml:objectMap [
+          rml:reference "$.ID"
+        ];
+      rml:predicate ex:id
+    ], [
+      rml:objectMap [
+          rml:reference "$.FirstName"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Student/{$.ID}/{$.FirstName}"
+    ] .
+
+

Output

+
<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" . 
+<http://example.com/Student/10/Venus> <http://example.com/id> "10"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/Student> .
+
+
+
+

20. RMLTC0007e-JSON

+

Title: "One column mapping, using rml:graphMap and rml:class"

+

Description: "Tests subjectmap with rml:graphMap and rml:class"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "Name":"Venus"
+  }]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.ID"
+        ];
+      rml:predicate ex:id
+    ], [
+      rml:objectMap [
+          rml:reference "$.Name"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:class foaf:Person;
+      rml:graph ex:PersonGraph;
+      rml:template "http://example.com/Student/{$.ID}/{$.Name}"
+    ] .
+
+

Output

+
<http://example.com/Student/10/Venus> <http://example.com/id> "10"^^<http://www.w3.org/2001/XMLSchema#integer> <http://example.com/PersonGraph> .
+<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" <http://example.com/PersonGraph> .
+<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> <http://example.com/PersonGraph> .
+
+
+
+

21. RMLTC0007f-JSON

+

Title: "One column mapping, using rml:graphMap and specifying an rml:predicateObjectMap with rdf:type"

+

Description: "Tests subjectmap with rml:graphMap and specifying an rml:predicateObjectMap with predicate rdf:type"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "FirstName":"Venus",
+    "LastName":"Williams"
+  }]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:object foaf:Person;
+      rml:predicate rdf:type
+    ], [
+      rml:objectMap [
+          rml:reference "$.ID"
+        ];
+      rml:predicate ex:id
+    ], [
+      rml:objectMap [
+          rml:reference "$.FirstName"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:graph ex:PersonGraph;
+      rml:template "http://example.com/Student/{$.ID}/{$.FirstName}"
+    ] .
+
+

Output

+
<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> <http://example.com/PersonGraph> .
+<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" <http://example.com/PersonGraph> .
+<http://example.com/Student/10/Venus> <http://example.com/id> "10"^^<http://www.w3.org/2001/XMLSchema#integer> <http://example.com/PersonGraph> .
+
+
+
+

22. RMLTC0007g-JSON

+

Title: "Assigning triples to the default graph"

+

Description: "Tests the generation of triples to the default graph"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "FirstName":"Venus",
+    "LastName":"Williams"
+  }]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.FirstName"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:graph rml:defaultGraph;
+      rml:template "http://example.com/Student/{$.ID}/{$.FirstName}"
+    ] .
+
+

Output

+
<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
+
+
+
+

23. RMLTC0007h-JSON

+

Title: "Assigning triples to a non-IRI named graph"

+

Description: "Tests the generation of triples to a non-IRI named graph, which is an error"

+

Default Base IRI: http://example.com/

+

Error expected? Yes

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "FirstName":"Venus",
+    "LastName":"Williams"
+  }]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.FirstName"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:graphMap [
+          rml:reference "$.ID";
+          rml:termType rml:Literal
+        ];
+      rml:template "http://example.com/Student/{$.ID}/{$.FirstName}"
+    ] .
+
+
+

24. RMLTC0008a-JSON

+

Title: "Generation of triples to a target graph by using rml:graphMap and rml:template"

+

Description: "Test that results of the mapping can be directed to a target graph by using rml:graphMap and rml:template"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "Name":"Venus Williams",
+    "Sport": "Tennis"
+  }]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:object foaf:Person;
+      rml:predicate rdf:type
+    ], [
+      rml:objectMap [
+          rml:reference "$.ID"
+        ];
+      rml:predicate ex:id
+    ], [
+      rml:objectMap [
+          rml:reference "$.Name"
+        ];
+      rml:predicate foaf:name
+    ], [
+      rml:objectMap [
+          rml:reference "$.Sport"
+        ];
+      rml:predicate ex:Sport
+    ];
+  rml:subjectMap [
+      rml:graphMap [
+          rml:template "http://example.com/graph/Student/{$.ID}/{$.Name}"
+        ];
+      rml:template "http://example.com/Student/{$.ID}/{$.Name}"
+    ] .
+
+

Output

+
<http://example.com/Student/10/Venus%20Williams> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> <http://example.com/graph/Student/10/Venus%20Williams> .
+<http://example.com/Student/10/Venus%20Williams> <http://xmlns.com/foaf/0.1/name> "Venus Williams" <http://example.com/graph/Student/10/Venus%20Williams> .
+<http://example.com/Student/10/Venus%20Williams> <http://example.com/id> "10" <http://example.com/graph/Student/10/Venus%20Williams> . 
+<http://example.com/Student/10/Venus%20Williams> <http://example.com/Sport> "Tennis" <http://example.com/graph/Student/10/Venus%20Williams> . 
+
+
+
+

25. RMLTC0008b-JSON

+

Title: "Generation of triples referencing object map"

+

Description: "Tests the mapping specification referencing object map without join"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "Name":"Venus Williams",
+    "Sport": "Tennis"
+  }]
+}
+
+

Mapping

+
@prefix activity: <http://example.com/activity/> .
+@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap <http://example.com/base/RefObjectMap1>;
+      rml:predicate ex:Sport
+    ], [
+      rml:object foaf:Person;
+      rml:predicate rdf:type
+    ], [
+      rml:objectMap [
+          rml:reference "$.ID"
+        ];
+      rml:predicate ex:id
+    ], [
+      rml:objectMap [
+          rml:reference "$.Name"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Student/{$.ID}/{$.Name}"
+    ] .
+
+<http://example.com/base/RefObjectMap1> a rml:RefObjectMap;
+  rml:parentTriplesMap <http://example.com/base/TriplesMap2> .
+
+<http://example.com/base/TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:object activity:Sport;
+      rml:predicate rdf:type
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{$.Sport}"
+    ] .
+
+

Output

+
<http://example.com/Student/10/Venus%20Williams> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person>  .
+<http://example.com/Student/10/Venus%20Williams> <http://xmlns.com/foaf/0.1/name> "Venus Williams" .
+<http://example.com/Student/10/Venus%20Williams> <http://example.com/id> "10"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.com/Student/10/Venus%20Williams> <http://example.com/Sport> <http://example.com/Tennis> . 
+<http://example.com/Tennis> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/activity/Sport> .
+
+
+
+
+

26. RMLTC0008c-JSON

+

Title: "Generation of triples by using multiple predicateMaps within a rml:predicateObjectMap"

+

Description: "Tests the generation of triples by using multiple predicateMaps within a rml:predicateObjectMap"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "Name":"Venus Williams",
+    "Sport": "Tennis"
+  }]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.Name"
+        ];
+      rml:predicate ex:name, foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Student/{$.ID}/{$.Name}"
+    ] .
+
+

Output

+
<http://example.com/Student/10/Venus%20Williams> <http://xmlns.com/foaf/0.1/name> "Venus Williams"  .
+<http://example.com/Student/10/Venus%20Williams> <http://example.com/name> "Venus Williams"  .
+
+
+
+

27. RMLTC0009a-JSON

+

Title: "Generation of triples from foreign key relations"

+

Description: "Test foreign key relationships among logical tables"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "students" : [
+    { 
+      "ID": 10,
+      "Sport": 100,
+      "Name": "Venus Williams"
+    },
+    { 
+      "ID": 20,
+      "Name": "Demi Moore"
+    }
+  ]
+}
+
+

Input 1

+
{
+  "sports": [
+    {
+      "ID": 100,
+      "Name": "Tennis"
+    }
+  ]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.Name"
+        ];
+      rml:predicate foaf:name
+    ], [
+      rml:objectMap [ a rml:RefObjectMap;
+          rml:joinCondition [
+              rml:child "$.Sport";
+              rml:parent "$.ID"
+            ];
+          rml:parentTriplesMap <http://example.com/base/TriplesMap2>
+        ];
+      rml:predicate <http://example.com/ontology/practises>
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/resource/student_{$.ID}"
+    ] .
+
+<http://example.com/base/TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.sports[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "sport.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.Name"
+        ];
+      rml:predicate rdfs:label
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/resource/sport_{$.ID}"
+    ] .
+
+

Output

+
<http://example.com/resource/student_10> <http://xmlns.com/foaf/0.1/name> "Venus Williams"  .
+<http://example.com/resource/student_20> <http://xmlns.com/foaf/0.1/name> "Demi Moore"  .
+<http://example.com/resource/sport_100> <http://www.w3.org/2000/01/rdf-schema#label> "Tennis" .
+<http://example.com/resource/student_10> <http://example.com/ontology/practises> <http://example.com/resource/sport_100>  .
+
+
+

28. RMLTC0009b-JSON

+

Title: "Generation of triples to multiple graphs"

+

Description: "Test that results from distinct parts of the mapping can be directed to different target graphs."

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "students" : [
+    { 
+      "ID": 10,
+      "Sport": 100,
+      "Name": "Venus Williams"
+    },
+    { 
+      "ID": 20,
+      "Name": "Demi Moore"
+    }
+  ]
+}
+
+

Input 1

+
{
+  "sports": [
+    {
+      "ID": 100,
+      "Name": "Tennis"
+    }
+  ]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:graph <http://example.com/graph/students>;
+      rml:objectMap [
+          rml:reference "$.Name"
+        ];
+      rml:predicate foaf:name
+    ], [
+      rml:graph <http://example.com/graph/practise>;
+      rml:objectMap [ a rml:RefObjectMap;
+          rml:joinCondition [
+              rml:child "$.Sport";
+              rml:parent "$.ID"
+            ];
+          rml:parentTriplesMap <http://example.com/base/TriplesMap2>
+        ];
+      rml:predicate <http://example.com/ontology/practises>
+    ];
+  rml:subjectMap [
+      rml:class <http://example.com/ontology/Student>;
+      rml:graph <http://example.com/graph/students>;
+      rml:template "http://example.com/resource/student_{$.ID}"
+    ] .
+
+<http://example.com/base/TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.sports[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "sport.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.Name"
+        ];
+      rml:predicate rdfs:label
+    ];
+  rml:subjectMap [
+      rml:class <http://example.com/ontology/Sport>;
+      rml:graph <http://example.com/graph/sports>;
+      rml:template "http://example.com/resource/sport_{$.ID}"
+    ] .
+
+

Output

+
<http://example.com/resource/student_10> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/ontology/Student> <http://example.com/graph/students> .
+<http://example.com/resource/student_10> <http://xmlns.com/foaf/0.1/name> "Venus Williams" <http://example.com/graph/students> .
+<http://example.com/resource/student_20> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/ontology/Student> <http://example.com/graph/students> .
+<http://example.com/resource/student_20> <http://xmlns.com/foaf/0.1/name> "Demi Moore" <http://example.com/graph/students> .
+<http://example.com/resource/sport_100> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/ontology/Sport> <http://example.com/graph/sports> .
+<http://example.com/resource/sport_100> <http://www.w3.org/2000/01/rdf-schema#label> "Tennis" <http://example.com/graph/sports> .
+<http://example.com/resource/student_10> <http://example.com/ontology/practises> <http://example.com/resource/sport_100> <http://example.com/graph/practise> .
+<http://example.com/resource/student_10> <http://example.com/ontology/practises> <http://example.com/resource/sport_100> <http://example.com/graph/students> .
+
+
+

29. RMLTC0010a-JSON

+

Title: "Template with table column with blank space"

+

Description: "Tests a template with blank space in column value"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "countries": [{
+    "Country Code": 1,
+    "Name":"Bolivia, Plurinational State of",
+    "ISO 3166": "BO"
+  }, {
+    "Country Code": 2,
+    "Name":"Ireland",
+    "ISO 3166": "IE"
+  }, {
+    "Country Code": 3,
+    "Name":"Saint Martin (French part)",
+    "ISO 3166": "MF"
+  }]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.countries[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "country_info.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.Name"
+        ];
+      rml:predicate ex:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{$.['Country Code']}"
+    ] .
+
+

Output

+
<http://example.com/1> <http://example.com/name> "Bolivia, Plurinational State of" .
+<http://example.com/2> <http://example.com/name> "Ireland" .
+<http://example.com/3> <http://example.com/name> "Saint Martin (French part)" .
+
+
+
+

30. RMLTC0010b-JSON

+

Title: "Template with table columns with special chars"

+

Description: "Tests a template with special chars in column value"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "countries": [{
+    "Country Code": 1,
+    "Name":"Bolivia, Plurinational State of",
+    "ISO 3166": "BO"
+  }, {
+    "Country Code": 2,
+    "Name":"Ireland",
+    "ISO 3166": "IE"
+  }, {
+    "Country Code": 3,
+    "Name":"Saint Martin (French part)",
+    "ISO 3166": "MF"
+  }]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.countries[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "country_info.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.Name"
+        ];
+      rml:predicate ex:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{$.['Country Code']}/{$.Name}"
+    ] .
+
+

Output

+
<http://example.com/1/Bolivia%2C%20Plurinational%20State%20of> <http://example.com/name> "Bolivia, Plurinational State of" .
+<http://example.com/2/Ireland> <http://example.com/name> "Ireland" .
+<http://example.com/3/Saint%20Martin%20%28French%20part%29> <http://example.com/name> "Saint Martin (French part)" .
+
+
+
+

31. RMLTC0010c-JSON

+

Title: "Template with table columns with special chars and backslashes"

+

Description: "Tests a template with special chars in reference value and backslash escapes in string templates"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "countries": [{
+    "Country Code": 1,
+    "Name":"Bolivia, Plurinational State of",
+    "ISO 3166": "BO"
+  }, {
+    "Country Code": 2,
+    "Name":"Ireland",
+    "ISO 3166": "IE"
+  }, {
+    "Country Code": 3,
+    "Name":"Saint Martin (French part)",
+    "ISO 3166": "MF"
+  }]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.countries[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "country_info.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:predicate ex:code;
+      rml:objectMap [
+          rml:template "\\{\\{\\{ {$.['ISO 3166']} \\}\\}\\}";
+          rml:termType rml:Literal
+        ]
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{$.['Country Code']}/{$.Name}"
+    ] .
+
+

Output

+
<http://example.com/1/Bolivia%2C%20Plurinational%20State%20of> <http://example.com/code> "{{{ BO }}}" .
+<http://example.com/2/Ireland> <http://example.com/code> "{{{ IE }}}" .
+<http://example.com/3/Saint%20Martin%20%28French%20part%29> <http://example.com/code> "{{{ MF }}}" .
+
+
+
+

32. RMLTC0011b-JSON

+

Title: "M to M relation, by using an additional Triples Map"

+

Description: "Tests, M to M relations, by using an additional Triples Map"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "students": [
+    {"ID":10, "FirstName":"Venus", "LastName":"Williams"},
+    {"ID":11, "FirstName":"Fernando", "LastName":"Alonso"},
+    {"ID":12, "FirstName":"David", "LastName":"Villa"}
+  ]
+}
+
+

Input 1

+
{
+  "sports": [
+    {"ID":110, "Description":"Tennis"},
+    {"ID":111, "Description":"Football"},
+    {"ID":112, "Description":"Formula1"}
+  ]
+}
+
+

Input 2

+
{
+  "links": [
+    {"ID_Student":10, "ID_Sport":110},
+    {"ID_Student":11, "ID_Sport":111},
+    {"ID_Student":11, "ID_Sport":112},
+    {"ID_Student":12, "ID_Sport":111}
+  ]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/LinkMap_1_2> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.links[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student_sport.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:template "http://example.com/sport/{$.ID_Sport}"
+        ];
+      rml:predicate ex:plays
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/student/{$.ID_Student}"
+    ] .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.FirstName"
+        ];
+      rml:predicate ex:firstName
+    ], [
+      rml:objectMap [
+          rml:reference "$.LastName"
+        ];
+      rml:predicate ex:lastName
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/student/{$.ID}"
+    ] .
+
+<http://example.com/base/TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.sports[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "sport.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.Description"
+        ];
+      rml:predicate ex:description
+    ], [
+      rml:objectMap [
+          rml:reference "$.ID"
+        ];
+      rml:predicate ex:id
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/sport/{$.ID}"
+    ] .
+
+

Output

+
<http://example.com/student/10> <http://example.com/lastName> "Williams" .
+<http://example.com/student/10> <http://example.com/firstName> "Venus" .
+<http://example.com/student/12> <http://example.com/lastName> "Villa" .
+<http://example.com/student/12> <http://example.com/firstName> "David" .
+<http://example.com/student/11> <http://example.com/lastName> "Alonso" .
+<http://example.com/student/11> <http://example.com/firstName> "Fernando" .
+<http://example.com/sport/110> <http://example.com/description> "Tennis" .
+<http://example.com/sport/110> <http://example.com/id> "110"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.com/sport/111> <http://example.com/description> "Football" .
+<http://example.com/sport/111> <http://example.com/id> "111"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.com/sport/112> <http://example.com/description> "Formula1" .
+<http://example.com/sport/112> <http://example.com/id> "112"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.com/student/10> <http://example.com/plays> <http://example.com/sport/110> .
+<http://example.com/student/12> <http://example.com/plays> <http://example.com/sport/111> .
+<http://example.com/student/11> <http://example.com/plays> <http://example.com/sport/112> .
+<http://example.com/student/11> <http://example.com/plays> <http://example.com/sport/111> .
+
+
+
+

33. RMLTC0012a-JSON

+

Title: "Blank node referencing multiple columns"

+

Description: "Tests that blank nodes can be generated by referencing multiple columns"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "persons": [
+    {"fname":"Bob","lname":"Smith","amount":30},
+    {"fname":"Sue","lname":"Jones","amount":20},
+    {"fname":"Bob","lname":"Smith","amount":30}
+  ]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.persons[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "persons.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:template "{$.fname} {$.lname}";
+          rml:termType rml:Literal
+        ];
+      rml:predicate foaf:name
+    ], [
+      rml:objectMap [
+          rml:reference "$.amount"
+        ];
+      rml:predicate ex:amount
+    ];
+  rml:subjectMap [
+      rml:template "{$.fname}{$.lname}{$.amount}";
+      rml:termType rml:BlankNode
+    ] .
+
+

Output

+
_:BobSmith30 <http://example.com/amount> "30"^^<http://www.w3.org/2001/XMLSchema#integer> .
+_:BobSmith30 <http://xmlns.com/foaf/0.1/name> "Bob Smith" .
+_:SueJones20 <http://example.com/amount> "20"^^<http://www.w3.org/2001/XMLSchema#integer> .
+_:SueJones20 <http://xmlns.com/foaf/0.1/name> "Sue Jones" .
+
+
+
+

34. RMLTC0012b-JSON

+

Title: "Duplicate tuples generate same blank node"

+

Description: "Tests that blank nodes with same identifier and in the same graph but generated by different logical rows are considered equivalent."

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "lives": [
+    {"fname":"Bob","lname":"Smith","city":"London"},
+    {"fname":"Sue","lname":"Jones","city":"Madrid"},
+    {"fname":"Bob","lname":"Smith","city":"London"}
+  ]
+}
+
+

Input 1

+
{
+  "persons": [
+    {"fname":"Bob","lname":"Smith","amount":30},
+    {"fname":"Sue","lname":"Jones","amount":20},
+    {"fname":"Bob","lname":"Smith","amount":30}
+  ]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.persons[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "persons.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:template "{$.fname} {$.lname}";
+          rml:termType rml:Literal
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "{$.fname}{$.lname}";
+      rml:termType rml:BlankNode
+    ] .
+
+<http://example.com/base/TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.lives[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "lives.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.city"
+        ];
+      rml:predicate ex:city
+    ];
+  rml:subjectMap [
+      rml:template "{$.fname}{$.lname}";
+      rml:termType rml:BlankNode
+    ] .
+
+

Output

+
_:BobSmith <http://example.com/city> "London" .
+_:BobSmith <http://xmlns.com/foaf/0.1/name> "Bob Smith" .
+_:SueJones <http://example.com/city> "Madrid" .
+_:SueJones <http://xmlns.com/foaf/0.1/name> "Sue Jones" .
+
+
+
+

35. RMLTC0012c-JSON

+

Title: "TriplesMap without subjectMap"

+

Description: "Tests a RML with missing information, TriplesMap without subjectMap."

+

Default Base IRI: http://example.com/

+

Error expected? Yes

+

Input

+
{
+  "persons": [
+    {"fname":"Bob","lname":"Smith","amount":30},
+    {"fname":"Sue","lname":"Jones","amount":20},
+    {"fname":"Bob","lname":"Smith","amount":30}
+  ]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.persons[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "persons.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:template "{$.fname} {$.lname}";
+          rml:termType rml:Literal
+        ];
+      rml:predicate foaf:name
+    ], [
+      rml:objectMap [
+          rml:reference "$.amount"
+        ];
+      rml:predicate ex:amount
+    ] .
+
+
+

36. RMLTC0012d-JSON

+

Title: "TriplesMap with two subjectMap"

+

Description: "Tests a RML with wrong information, TriplesMap with two subjectMap."

+

Default Base IRI: http://example.com/

+

Error expected? Yes

+

Input

+
{
+  "persons": [
+    {"fname":"Bob","lname":"Smith","amount":30},
+    {"fname":"Sue","lname":"Jones","amount":20},
+    {"fname":"Bob","lname":"Smith","amount":30}
+  ]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.persons[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "persons.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:template "{$.fname} {$.lname}";
+          rml:termType rml:Literal
+        ];
+      rml:predicate foaf:name
+    ], [
+      rml:objectMap [
+          rml:reference "$.amount"
+        ];
+      rml:predicate ex:amount
+    ];
+  rml:subjectMap [
+      rml:template "{$.fname}_{$.lname}_{$.amount}";
+      rml:termType rml:BlankNode
+    ], [
+      rml:template "{$.amount}_{$.fname}_{$.lname}";
+      rml:termType rml:BlankNode
+    ] .
+
+
+

37. RMLTC0013a-JSON

+

Title: "Null value in JSON file"

+

Description: "Tests if null values in JSON files are handled correctly."

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "persons": [
+    {"ID":"1","Name":"Alice","DateOfBirth":null},
+    {"ID":"2","Name":"Bob","DateOfBirth":"September, 2010"}
+  ]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.persons[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "persons.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.DateOfBirth"
+        ];
+      rml:predicate ex:BirthDay
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Person/{$.ID}/{$.Name}/{$.DateOfBirth}"
+    ] .
+
+

Output

+
<http://example.com/Person/2/Bob/September%2C%202010> <http://example.com/BirthDay> "September, 2010" .
+
+
+

38. RMLTC0015a-JSON

+

Title: "Generation of language tags from a table with language information"

+

Description: "Generation of language tags from a table with language information"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "countries": [
+    {"Code": "BO", "Name": "Estado Plurinacional de Bolivia"},
+    {"Code": "IE", "Name": "Irlanda"}
+  ]
+}
+
+

Mapping

+
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.countries[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "country_en.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:language "en";
+          rml:reference "$.Name"
+        ];
+      rml:predicate rdfs:label
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{$.Code}"
+    ] .
+
+<http://example.com/base/TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.countries[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "country_es.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:language "es";
+          rml:reference "$.Name"
+        ];
+      rml:predicate rdfs:label
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{$.Code}"
+    ] .
+
+

Output

+
<http://example.com/BO> <http://www.w3.org/2000/01/rdf-schema#label> "Bolivia, Plurinational State of"@en .
+<http://example.com/BO> <http://www.w3.org/2000/01/rdf-schema#label> "Estado Plurinacional de Bolivia"@es .
+<http://example.com/IE> <http://www.w3.org/2000/01/rdf-schema#label> "Ireland"@en .
+<http://example.com/IE> <http://www.w3.org/2000/01/rdf-schema#label> "Irlanda"@es .
+
+
+
+
+

39. RMLTC0015b-JSON

+

Title: "Generation of language tags from a table with language information, and a term map with invalid rml:language value"

+

Description: "Tests a term map with an invalid rml:language value, which is an error"

+

Default Base IRI: http://example.com/

+

Error expected? Yes

+

Input

+
{
+  "countries": [
+    {"Code": "BO", "Name": "Estado Plurinacional de Bolivia"},
+    {"Code": "IE", "Name": "Irlanda"}
+  ]
+}
+
+

Mapping

+
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.countries[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "country_en.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:language "a-english";
+          rml:reference "$.Name"
+        ];
+      rml:predicate rdfs:label
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{$.Code}"
+    ] .
+
+<http://example.com/base/TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.countries[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "country_en.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:language "a-spanish";
+          rml:reference "$.Name"
+        ];
+      rml:predicate rdfs:label
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{$.Code}"
+    ] .
+
+
+

40. RMLTC0019a-JSON

+

Title: "Generation of triples by using IRI value in columns"

+

Description: "Test the generation of triples by using IRI value in attributes"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "persons": [
+    {
+      "ID": 10,
+      "FirstName": "http://example.com/ns#Jhon",
+      "LastName": "Smith"
+    },
+    {
+      "ID": 20,
+      "FirstName": "Carlos",
+      "LastName": "Mendoza"
+    }
+  ]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.persons[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "persons.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.FirstName"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:reference "$.FirstName"
+    ] .
+
+

Output

+
<http://example.com/ns#Jhon> <http://xmlns.com/foaf/0.1/name> "http://example.com/ns#Jhon" .
+<http://example.com/Carlos> <http://xmlns.com/foaf/0.1/name> "Carlos" .
+
+
+

41. RMLTC0019b-JSON

+

Title: "Generation of triples by using IRI value in columns, with data error"

+

Description: "Test the generation of triples by using IRI value in attributes, conforming RML mapping with data error (and limited results)"

+

Default Base IRI: http://example.com/

+

Error expected? Yes

+

Input

+
{
+  "persons": [
+    {
+      "ID": 30,
+      "FirstName": "Juan Daniel",
+      "LastName": "Crespo"
+    }
+  ]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.persons[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "persons.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.FirstName"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:reference "$.FirstName"
+    ] .
+
+
+

42. RMLTC0020a-JSON

+

Title: "Generation of triples by using IRI value in columns"

+

Description: "Test the generation of triples by using IRI value in attributes"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "students": [
+    {"Name": "http://example.com/company/Alice"},
+    {"Name": "Bob"},
+    {"Name": "Bob/Charles"},
+    {"Name": "path/../Danny"},
+    {"Name": "Emily Smith"}
+  ]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:object foaf:Person;
+      rml:predicate rdf:type
+    ];
+  rml:subjectMap [
+      rml:template "{$.Name}";
+      rml:termType rml:IRI
+    ] .
+
+

Output

+
<http://example.com/http%3A%2F%2Fexample.com%2Fcompany%2FAlice> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Bob> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Bob%2FCharles> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/path%2F..%2FDanny> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Emily%20Smith> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+
+
+

43. RMLTC0021a-JSON

+

Title: "Generation of triples referencing object map"

+

Description: "Tests the mapping specification referencing object map with same logical source and join condition"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "Name":"Venus Williams",
+    "Sport": "Tennis"
+  }, {
+    "ID": 20,
+    "Name":"Serena Williams",
+    "Sport": "Tennis"
+  }, {
+    "ID": 30,
+    "Name":"Loena Hendrickx",
+    "Sport": "Figure skating"
+  }]
+}
+
+

Mapping

+
@prefix activity: <http://example.com/activity/> .
+@prefix ex: <http://example.com/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/RefObjectMap1> a rml:RefObjectMap;
+  rml:joinCondition [
+      rml:child "$.Sport";
+      rml:parent "$.Sport"
+    ];
+  rml:parentTriplesMap <http://example.com/base/TriplesMap1> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap <http://example.com/base/RefObjectMap1>;
+      rml:predicate ex:sameSportAs
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Student/{$.ID}/{$.Name}"
+    ] .
+
+

Output

+
<http://example.com/Student/10/Venus%20Williams> <http://example.com/sameSportAs> <http://example.com/Student/10/Venus%20Williams> . 
+<http://example.com/Student/10/Venus%20Williams> <http://example.com/sameSportAs> <http://example.com/Student/20/Serena%20Williams> . 
+<http://example.com/Student/20/Serena%20Williams> <http://example.com/sameSportAs> <http://example.com/Student/20/Serena%20Williams> . 
+<http://example.com/Student/20/Serena%20Williams> <http://example.com/sameSportAs> <http://example.com/Student/10/Venus%20Williams> . 
+<http://example.com/Student/30/Loena%20Hendrickx> <http://example.com/sameSportAs> <http://example.com/Student/30/Loena%20Hendrickx> . 
+
+
+
+
+

44. RMLTC0022a-JSON

+

Title: "Generating of triples with constant datatype"

+

Description: "Test triples with a fixed constant datatype"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "Name":"Venus",
+    "Age": 21
+  }]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:datatype xsd:string;
+          rml:reference "$.Name"
+        ];
+      rml:predicate foaf:name
+    ], [
+      rml:objectMap [
+          rml:datatype xsd:int;
+          rml:reference "$.Age"
+        ];
+      rml:predicate ex:age
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{$.Name}"
+    ] .
+
+

Output

+
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "Venus"^^<http://www.w3.org/2001/XMLSchema#string> .
+<http://example.com/Venus> <http://example.com/age> "21"^^<http://www.w3.org/2001/XMLSchema#int> .
+
+
+

45. RMLTC0022b-JSON

+

Title: "Generating of triples with datatypeMap"

+

Description: "Test triples with a XSD datatype generated from the data"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
[
+    { "FOO": 1, "BAR": "string"},
+    { "FOO": 2, "BAR": "int"}
+]
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:referenceFormulation rml:JSONPath;
+      rml:iterator "$[*]";
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "data.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:datatypeMap [
+              rml:template "http://www.w3.org/2001/XMLSchema#{$.BAR}"
+            ];
+          rml:reference "$.FOO"
+        ];
+      rml:predicate ex:x
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{$.FOO}"
+    ] .
+
+
+

Output

+
<http://example.com/1> <http://example.com/x> "1"^^<http://www.w3.org/2001/XMLSchema#string> .
+<http://example.com/2> <http://example.com/x> "2"^^<http://www.w3.org/2001/XMLSchema#int> .
+
+
+

46. RMLTC0022c-JSON

+

Title: "Generating of triples with datatypeMap with custom datatype"

+

Description: "Test triples with a custom datype from the data"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
[
+    { "FOO": 1, "BAR": "string"},
+    { "FOO": 2, "BAR": "int"}
+]
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:referenceFormulation rml:JSONPath;
+      rml:iterator "$[*]";
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "data.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:datatypeMap [
+              rml:template "datatype#{$.BAR}"
+            ];
+          rml:reference "$.FOO"
+        ];
+      rml:predicate ex:x
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{$.FOO}"
+    ] .
+
+

Output

+
<http://example.com/1> <http://example.com/x> "1"^^<http://example.com/datatype#string> .
+<http://example.com/2> <http://example.com/x> "2"^^<http://example.com/datatype#int> .
+
+
+

47. RMLTC0023a-JSON

+

Title: "Invalid IRI template 1"

+

Description: "Test handling of invalid IRI template"

+

Default Base IRI: http://example.com/

+

Error expected? Yes

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "{Name}":"Venus"
+  }]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:referenceFormulation rml:JSONPath;
+      rml:iterator "$.students[*]";
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{{Name}}";
+      rml:class foaf:Person;
+    ] .
+
+
+

48. RMLTC0023b-JSON

+

Title: "Invalid IRI template 2"

+

Description: "Test handling of invalid IRI template"

+

Default Base IRI: http://example.com/

+

Error expected? Yes

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "N\ame":"Venus"
+  }]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:referenceFormulation rml:JSONPath;
+      rml:iterator "$.students[*]";
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{N\ame}";
+      rml:class foaf:Person;
+    ] .
+
+
+
+

49. RMLTC0023c-JSON

+

Title: "Invalid IRI template 3"

+

Description: "Test handling of invalid IRI template"

+

Default Base IRI: http://example.com/

+

Error expected? Yes

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "Name":"Venus"
+  }]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:referenceFormulation rml:JSONPath;
+      rml:iterator "$.students[*]";
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{Name\}";
+      rml:class foaf:Person;
+    ] .
+
+
+
+

50. RMLTC0023d-JSON

+

Title: "Invalid IRI template 4"

+

Description: "Test handling of invalid IRI template"

+

Default Base IRI: http://example.com/

+

Error expected? Yes

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "{Name}":"Venus"
+  }]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+     rml:referenceFormulation rml:JSONPath;
+     rml:iterator "$.students[*]";
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{\\\\{Name\\\\}}";
+      rml:class foaf:Person;
+    ] .
+
+
+
+

51. RMLTC0023e-JSON

+

Title: "Invalid IRI template 5"

+

Description: "Test handling of invalid IRI template"

+

Default Base IRI: http://example.com/

+

Error expected? Yes

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "N\ame":"Venus"
+  }]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:referenceFormulation rml:JSONPath;
+      rml:iterator "$.students[*]";
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{N\\\ame}";
+      rml:class foaf:Person;
+    ] .
+
+
+

52. RMLTC0023f-JSON

+

Title: "Valid IRI template with backslash-escape"

+

Description: "Test handling of a valid IRI template using backslash-escape"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "{Name}":"Venus"
+  }]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+     rml:referenceFormulation rml:JSONPath;
+     rml:iterator "$.students[*]";
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{\\{Name\\}}";
+      rml:class foaf:Person;
+    ] .
+
+
+

Output

+
<http://example.com/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+
+
+

53. RMLTC0024a-JSON

+

Title: "Usage of constant term maps in combination with explicitly defined term types"

+

Description: "Tests the usage of constant term maps in combination with explicitly defined term types"

+

Default Base IRI: http://example.com/

+

Error expected? Yes

+

Input

+
{
+  "students": [{
+    "Name":"Venus"
+  },
+  {
+    "Name":"Julio"
+  }]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix ex: <http://example.com/>.
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.Name"
+        ];
+      rml:predicate ex:student
+    ];
+  rml:subjectMap [
+      rml:constant "School";
+      rml:termType rml:BlankNode
+  ] .
+
+
+

54. RMLTC0025a-JSON

+

Title: "Generation of triples from arrays"

+

Description: "Tests the generation of triples from array input data structures"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "persons": [
+    {"fname":"Bob","lname":"Smith","amounts":[30, 40, 50]}
+  ]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.persons[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "persons.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.amounts[*]"
+        ];
+      rml:predicate ex:amount
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Student/{$.fname}/{$.lname}"
+    ] .
+
+

Output

+
<http://example.com/Student/Bob/Smith> <http://example.com/amount> "30"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.com/Student/Bob/Smith> <http://example.com/amount> "40"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.com/Student/Bob/Smith> <http://example.com/amount> "50"^^<http://www.w3.org/2001/XMLSchema#integer> .
+
+
+

55. RMLTC0025b-JSON

+

Title: "Generation of triples from arrays with wrong reference"

+

Description: "Tests the generation of triples from array input data structures. Test should fail as reference points to the array and not the values of the array"

+

Default Base IRI: http://example.com/

+

Error expected? Yes

+

Input

+
{
+  "persons": [
+    {"fname":"Bob","lname":"Smith","amounts":[30, 40, 50]}
+  ]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.persons[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "persons.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.amounts"
+        ];
+      rml:predicate ex:amount
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Student/{$.fname}/{$.lname}"
+    ] .
+
+
+

56. RMLTC0025c-JSON

+

Title: "Generation of triples from arrays in subject and object"

+

Description: "Tests the generation of triples from array input data structures in subject and object"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "persons": [
+    {"names":["Bob", "Smith"],"amounts":[30, 40, 50]}
+  ]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.persons[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "persons.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.amounts[*]"
+        ];
+      rml:predicate ex:amount
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Student/{$.names[*]}"
+    ] .
+
+

Output

+
<http://example.com/Student/Smith> <http://example.com/amount> "30"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.com/Student/Smith> <http://example.com/amount> "40"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.com/Student/Smith> <http://example.com/amount> "50"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.com/Student/Bob> <http://example.com/amount> "30"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.com/Student/Bob> <http://example.com/amount> "40"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.com/Student/Bob> <http://example.com/amount> "50"^^<http://www.w3.org/2001/XMLSchema#integer> .
+
+
+

57. RMLTC0026a-JSON

+

Title: "Two triples maps, one with rml:baseIRI and one without and generating absolute IRIs"

+

Description: "Tests the generation of triples from relative IRIs using base IRI"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "persons": [
+    {"fname":"Bob","lname":"Smith","amount":30},
+    {"fname":"Sue","lname":"Jones","amount":20}
+  ]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:baseIRI <http://example.com/>;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.persons[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "persons.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.amount"
+        ];
+      rml:predicate ex:amount
+    ];
+  rml:subjectMap [
+      rml:template "{$.fname}"
+    ] .
+
+<http://example.com/base/TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.persons[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "persons.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.amount"
+        ];
+      rml:predicate ex:amount
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{$.lname}"
+    ] .
+
+

Output

+
<http://example.com/Bob> <http://example.com/amount> "30"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.com/Jones> <http://example.com/amount> "20"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.com/Smith> <http://example.com/amount> "30"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.com/Sue> <http://example.com/amount> "20"^^<http://www.w3.org/2001/XMLSchema#integer> .
+
+
+

58. RMLTC0026b-JSON

+

Title: "Two triples maps, one with rml:baseIRI one one without and generating relative IRIs using baseIRI parameter"

+

Description: "Tests the generation of triples from relative IRI using base IRI parameter"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "persons": [
+    {"fname":"Bob","lname":"Smith","amount":30},
+    {"fname":"Sue","lname":"Jones","amount":20}
+  ]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:baseIRI <http://tp1.com/>;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.persons[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "persons.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.amount"
+        ];
+      rml:predicate ex:amount
+    ];
+  rml:subjectMap [
+      rml:template "{$.fname}"
+    ] .
+
+<http://example.com/base/TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.persons[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "persons.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.amount"
+        ];
+      rml:predicate ex:amount
+    ];
+  rml:subjectMap [
+      rml:template "{$.lname}"
+    ] .
+
+

Output

+
<http://tp1.com/Bob> <http://example.com/amount> "30"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.com/Jones> <http://example.com/amount> "20"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.com/Smith> <http://example.com/amount> "30"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://tp1.com/Sue> <http://example.com/amount> "20"^^<http://www.w3.org/2001/XMLSchema#integer> .
+
+
+

59. RMLTC0026c-JSON

+

Title: "Two triples maps, both with rml:baseIRI defined"

+

Description: "Tests the generation of triples using relative IRIs with base IRIs defined only in triples maps, without base IRI parameter"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "persons": [
+    {"fname":"Bob","lname":"Smith","amount":30},
+    {"fname":"Sue","lname":"Jones","amount":20}
+  ]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:baseIRI <http://example.com/>;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.persons[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "persons.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.amount"
+        ];
+      rml:predicate ex:amount
+    ];
+  rml:subjectMap [
+      rml:template "{$.fname}"
+    ] .
+
+<http://example.com/base/TriplesMap2> a rml:TriplesMap;
+  rml:baseIRI <http://example.com/>;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.persons[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "persons.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.amount"
+        ];
+      rml:predicate ex:amount
+    ];
+  rml:subjectMap [
+      rml:template "{$.lname}"
+    ] .
+
+

Output

+
<http://example.com/Bob> <http://example.com/amount> "30"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.com/Jones> <http://example.com/amount> "20"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.com/Smith> <http://example.com/amount> "30"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.com/Sue> <http://example.com/amount> "20"^^<http://www.w3.org/2001/XMLSchema#integer> .
+
+
+

60. RMLTC0026d-JSON

+

Title: "Two triples maps,both with rml:bseIRI defined and baseIRI parameter defined"

+

Description: "Tests the generation of triples by with base IRIs different than the base IRI parameter"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "persons": [
+    {"fname":"Bob","lname":"Smith","amount":30},
+    {"fname":"Sue","lname":"Jones","amount":20}
+  ]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:baseIRI <http://example2.com/>;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.persons[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "persons.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.amount"
+        ];
+      rml:predicate ex:amount
+    ];
+  rml:subjectMap [
+      rml:template "{$.fname}"
+    ] .
+
+<http://example.com/base/TriplesMap2> a rml:TriplesMap;
+  rml:baseIRI <http://example2.com/>;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.persons[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "persons.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.amount"
+        ];
+      rml:predicate ex:amount
+    ];
+  rml:subjectMap [
+      rml:template "{$.lname}"
+    ] .
+
+

Output

+
<http://example2.com/Bob> <http://example.com/amount> "30"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example2.com/Jones> <http://example.com/amount> "20"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example2.com/Smith> <http://example.com/amount> "30"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example2.com/Sue> <http://example.com/amount> "20"^^<http://www.w3.org/2001/XMLSchema#integer> .
+
+
+

61. RMLTC0027a-JSON

+

Title: "Generation of triples using the URI term type"

+

Description: "Tests the generation of triples with a URI term type in the subject or object"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "students": [
+    {"Name": "Alice"},
+    {"Name": "Bob"},
+    {"Name": "Bob/Charles"},
+    {"Name": "Danny"},
+    {"Name": "Emily Smith"}
+  ]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:object foaf:Person;
+      rml:predicate rdf:type
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Person/{$.Name}";
+      rml:termType rml:URI
+    ] .
+
+

Output

+
<http://example.com/Person/Alice> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Person/Bob> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Person/Bob%2FCharles> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Person/Danny> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Person/Emily%20Smith> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+
+
+

62. RMLTC0027b-JSON

+

Title: "Generation of triples using the UnsafeURI term type"

+

Description: "Tests the generation of triples with a UnsafeURI term type in the subject or object"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "students": [
+    {"Name": "Alice"},
+    {"Name": "Bob"},
+    {"Name": "Bob/Charles"},
+    {"Name": "Danny"},
+    {"Name": "Emily Smith"}
+  ]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:object foaf:Person;
+      rml:predicate rdf:type
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Person/{$.Name}";
+      rml:termType rml:UnsafeURI
+    ] .
+
+

Output

+
<http://example.com/Person/Alice> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Person/Bob> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Person/Bob%2FCharles> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Person/Danny> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Person/Emily%20Smith> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+
+
+

63. RMLTC0027c-JSON

+

Title: "Generation of triples using the UnsafeIRI term type"

+

Description: "Tests the generation of triples with a UnsafeIRI term type in the subject or object"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "students": [
+    {"Name": "Alice"},
+    {"Name": "Bob"},
+    {"Name": "Bob/Charles"},
+    {"Name": "Danny"},
+    {"Name": "Emily Smith"}
+  ]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:object foaf:Person;
+      rml:predicate rdf:type
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Person/{$.Name}";
+      rml:termType rml:UnsafeIRI
+    ] .
+
+

Output

+
<http://example.com/Person/Alice> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Person/Bob> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Person/Bob%2FCharles> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Person/Danny> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Person/Emily%20Smith> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+
+
+

64. RMLTC0028a-JSON

+

Title: "Generation of the right datatype for a constant in the mapping"

+

Description: "Test the honoring of the datatype specified by the constant term in the mapping"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
[ { "id": "0", "foo": "bar"  } ] 
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+    rml:logicalSource [
+      rml:referenceFormulation rml:JSONPath ;
+      rml:iterator "$[*]";
+      rml:source [ a rml:RelativePathSource;
+        rml:root rml:MappingDirectory;
+        rml:path "data.json"
+      ]
+    ];
+    rml:subjectMap [
+      rml:template "https://example.org/instances/{id}";
+    ];
+    rml:predicateObjectMap [
+      rml:predicate <http://example.org/ns/p> ;
+      rml:object true ; # datatype is boolean
+    ] .
+
+

Output

+
<https://example.org/instances/0> <http://example.org/ns/p> "true"^^<http://www.w3.org/2001/XMLSchema#boolean> .
+
+
+

65. RMLTC0028b-JSON

+

Title: "Generation of all named graphs when rml:defaultGraph is involved"

+

Description: "Test if the default graph is also generated correctly."

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
[ { "id": "0", "name": "Alice"  } ] 
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix s: <http://schema.org/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+    rml:logicalSource [
+      rml:referenceFormulation rml:JSONPath ;
+      rml:iterator "$[*]";
+      rml:source [ a rml:RelativePathSource;
+        rml:root rml:MappingDirectory;
+        rml:path "data.json"
+      ]
+    ];
+    rml:subjectMap [
+      rml:template "https://example.org/instances/{id}";
+      rml:class s:Person ;
+      rml:graph <graph:1> ;
+    ];
+    rml:predicateObjectMap [
+      rml:predicate s:givenName ;
+      rml:objectMap [ rml:reference "name" ] ;
+      rml:graph rml:defaultGraph ;
+    ].
+
+

Output

+
<https://example.org/instances/0> <http://schema.org/givenName> "Alice".
+<https://example.org/instances/0> <http://schema.org/givenName> "Alice" <graph:1> .
+<https://example.org/instances/0> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://schema.org/Person> <graph:1> .
+
+
+

66. RMLTC0028c-JSON

+

Title: "Generation of the right language tag for a constant in the mapping"

+

Description: "Test the honoring of the language tag specified by the constant term in the mapping"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
[ { "id": "0", "foo": "bar"  } ] 
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+    rml:logicalSource [
+      rml:referenceFormulation rml:JSONPath ;
+      rml:iterator "$[*]";
+      rml:source [ a rml:RelativePathSource;
+        rml:root rml:MappingDirectory;
+        rml:path "data.json"
+      ]
+    ];
+    rml:subjectMap [
+      rml:template "https://example.org/instances/{id}";
+    ];
+    rml:predicateObjectMap [
+      rml:predicate <http://example.org/ns/p> ;
+      rml:object "train"@en ;
+    ] .
+
+

Output

+
<https://example.org/instances/0> <http://example.org/ns/p> "train"@en .
+
+
+ + + + + \ No newline at end of file diff --git a/src/test/resources/rml-core/docs/index.html b/src/test/resources/rml-core/docs/index.html new file mode 100644 index 00000000..782b75e6 --- /dev/null +++ b/src/test/resources/rml-core/docs/index.html @@ -0,0 +1,3878 @@ + + + + + + +RML-Core: Test Cases + + + + + + + + + + + + + + + + + + + +

Abstract

This document defines the RML-Core test cases to the determine the RML-Core specification conformance of tools.

+
+ +

Status of This Document

+ This specification was published by the + Knowledge Graph Construction Community Group. It is not a W3C Standard nor is it + on the W3C Standards Track. + + Please note that under the + W3C Community Contributor License Agreement (CLA) + there is a limited opt-out and other conditions apply. + + Learn more about + W3C Community and Business Groups. +

+ GitHub Issues are preferred for + discussion of this specification. + + +

+ +

1. Introduction

+

This document defines the RML-Core test cases, consisting of a collection of test case documents (input and expected output). +The purpose of the test cases is to determine the conformance of tools that execute RML rules to the RML-Core specification.

+
+ +

2. Data model

+

The test cases are semantically described for re-usability and shareability following the W3C Test case description. +Each test:Testcase as the following properties:

+
    +
  • dcterms:identifier: unique ID of the test case.
  • +
  • rmltest:hasError: if an error of the RML Processor is expected or not.
  • +
  • rmltest:input: One or more input data of the test case.
  • +
  • rmltest:output: One or more output data of the test case.
  • +
  • rmltest:inputFormat: the input data format.
  • +
  • rmltest:outputFormat: the output data format.
  • +
  • rmltest:mappingDocument: the RML mapping rules in Turtle.
  • +
+
+ +

3. Test cases

+

This section describes the RML-Core test cases. These descriptions are also available as RDF. +The files are available on GitHub in the folder test-cases. +Each test case is contained in a single folder, containing three types of files:

+
    +
  • Zero or more files containing the data sources, in the case of JSON, XML, CSV, or containing the SQL statements to create the necessary tables, in the case of MySQL, PostgreSQL, and SQL Server.
  • +
  • One file with the RML rules, called mapping.ttl, in the Turtle format.
  • +
  • Zero or more files with the expected RDF. No file is provided if an error is expected that must halt the generation of the RDF because of an error.
  • +
+
+ + +

4. RMLTC0000-JSON

+

Title: "one table, one column, zero rows"

+

Description: "Tests if an empty table produces an empty RDF graph"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "students": []
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.Name"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{$.Name}"
+    ] .
+
+

Output

+
# empty database
+
+
+

5. RMLTC0001a-JSON

+

Title: "One column mapping, subject URI generation by using rml:template"

+

Description: "Tests: (1) one column mapping; (2) subject URI generation by using rml:template; (3) one column to one property"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "Name":"Venus"
+  }]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.Name"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap <http://example.com/base/#NameSubjectMap> .
+
+<http://example.com/base/#NameSubjectMap> rml:template "http://example.com/{$.Name}" .
+
+

Output

+
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
+
+
+
+

6. RMLTC0001b-JSON

+

Title: "One column mapping, generation of a BlankNode subject by using rml:termType"

+

Description: "Tests: (1) one column mapping; (2) generation of a BlankNode subject by using rml:termType; (3) one column to one property"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "Name":"Venus"
+  }]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.Name"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "{$.Name}";
+      rml:termType rml:BlankNode
+    ] .
+
+

Output

+
_:Venus <http://xmlns.com/foaf/0.1/name> "Venus" .
+
+
+
+

7. RMLTC0002a-JSON

+

Title: "Two columns mapping, generation of a subject URI by the concatenation of two column values"

+

Description: "Tests: (1) two column mapping, no primary key; (2) subject URI generated by the concatenation of two column values; (3) one column to one property"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "Name":"Venus"
+  }]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.ID"
+        ];
+      rml:predicate ex:id
+    ], [
+      rml:objectMap [
+          rml:reference "$.Name"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:class foaf:Person;
+      rml:template "http://example.com/{$.ID}/{$.Name}"
+    ] .
+
+

Output

+
<http://example.com/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
+<http://example.com/10/Venus> <http://example.com/id> "10"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.com/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+
+
+
+

8. RMLTC0002b-JSON

+

Title: "Two columns mapping, generation of a BlankNode subject by using rml:template and rml:termType"

+

Description: "Tests: (1) two column mapping, no primary key; (2) generation of a BlankNode subject by using rml:template; (3) one column to one property"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "Name":"Venus"
+  }]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.Name"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "students{$.ID}";
+      rml:termType rml:BlankNode
+    ] .
+
+

Output

+
_:students10 <http://xmlns.com/foaf/0.1/name> "Venus" .
+
+
+
+

9. RMLTC0002e-JSON

+

Title: "Two columns mapping, an undefined rml:path"

+

Description: "Tests the presence of an undefined rml:path"

+

Default Base IRI: http://example.com/

+

Error expected? Yes

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "Name":"Venus"
+  }]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student2.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.IDs"
+        ];
+      rml:predicate ex:id
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{$.ID}/{$.Name}"
+    ] .
+
+
+

10. RMLTC0002g-JSON

+

Title: "Two columns mapping, invalid JSONPath"

+

Description: "Test the presence of an invalid JSONPath"

+

Default Base IRI: http://example.com/

+

Error expected? Yes

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "Name":"Venus"
+  }]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student2.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.IDs"
+        ];
+      rml:predicate ex:id
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{$.ID}/{$.Name}"
+    ] .
+
+
+

11. RMLTC0003c-JSON

+

Title: "Three columns mapping, by using a rml:template to produce literal"

+

Description: "Tests: (1) three column mapping; and (2) the use of rml:template to produce literal"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "FirstName":"Venus",
+    "LastName":"Williams"
+  }]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:template "{$.FirstName} {$.LastName}";
+          rml:termType rml:Literal
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Student{$.ID}"
+    ] .
+
+

Output

+
<http://example.com/Student10> <http://xmlns.com/foaf/0.1/name> "Venus Williams" .
+
+
+

12. RMLTC0004a-JSON

+

Title: "Two column mapping, from one row table to two different triples"

+

Description: "Tests: (1) two column mapping, (2) subject URI generated by a column value; (3) from one row table to two different triples (4) typing by using rml:class"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "Student": "Venus",
+    "Sport":"Tennis"
+  }]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student_sport.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.Student"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:class ex:Student;
+      rml:template "http://example.com/{$.Student}"
+    ] .
+
+<http://example.com/base/TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student_sport.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.Sport"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:class ex:Sport;
+      rml:template "http://example.com/{$.Sport}"
+    ] .
+
+

Output

+
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
+<http://example.com/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/Student> .
+<http://example.com/Tennis> <http://xmlns.com/foaf/0.1/name> "Tennis" .
+<http://example.com/Tennis> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/Sport> .
+
+
+
+

13. RMLTC0004b-JSON

+

Title: "One column mapping, presence of rml:termType rml:Literal on rml:subjectMap"

+

Description: "Tests: (1) one column mapping (2) the presence of rml:termType rml:Literal on rml:subjectMap, which is invalid"

+

Default Base IRI: http://example.com/

+

Error expected? Yes

+

Input

+
{
+  "students": [{
+    "Name":"Venus"
+  }]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.Name"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{$.Name}";
+      rml:termType rml:Literal
+    ] .
+
+
+

14. RMLTC0005a-JSON

+

Title: "Typing of resources"

+

Description: "Tests the typing of resources"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "persons": [
+    {
+      "fname": "Bob",
+      "lname": "Smith",
+      "amount": "30.0E0"
+    },
+    {
+      "fname": "Sue",
+      "lname": "Jones",
+      "amount": "20.0E0"
+    },
+    {
+      "fname": "Bob",
+      "lname": "Smith",
+      "amount": "30.0E0"
+    }
+  ]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.persons[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "ious.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.amount"
+        ];
+      rml:predicate ex:owes
+    ];
+  rml:subjectMap [
+      rml:class foaf:Person;
+      rml:template "http://example.com/{$.fname};{$.lname}"
+    ] .
+
+

Output

+
<http://example.com/Bob;Smith> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Bob;Smith> <http://example.com/owes> "30.0E0" .
+<http://example.com/Sue;Jones> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Sue;Jones> <http://example.com/owes> "20.0E0" .
+
+
+
+

15. RMLTC0006a-JSON

+

Title: "Use of rml:constant in rml:subjectMap, rml:predicateMap, rml:objectMap and rml:graphMap"

+

Description: "Tests the use of rml:constant in rml:subjectMap, rml:predicateMap, rml:objectMap and rml:graphMap"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "FirstName":"Venus",
+    "LastName":"Williams"
+  }]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:constant "Bad Student"
+        ];
+      rml:predicateMap [
+          rml:constant ex:description
+        ]
+    ];
+  rml:subjectMap [
+      rml:constant ex:BadStudent;
+      rml:graphMap [
+          rml:constant <http://example.com/graph/student>
+        ]
+    ] .
+
+

Output

+
<http://example.com/BadStudent> <http://example.com/description> "Bad Student" <http://example.com/graph/student> .
+
+
+

16. RMLTC0007a-JSON

+

Title: "Typing resources by relying on rdf:type predicate"

+

Description: "Tests the typing resources by relying on rdf:type predicate"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "FirstName":"Venus",
+    "LastName":"Williams"
+  }]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:object foaf:Person;
+      rml:predicate rdf:type
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Student/{$.ID}/{$.FirstName}"
+    ] .
+
+

Output

+
 <http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+
+
+
+

17. RMLTC0007b-JSON

+

Title: "Assigning triples to Named Graphs"

+

Description: "Tests the generation of triples to a named graph"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "FirstName":"Venus",
+    "LastName":"Williams"
+  }]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:object foaf:Person;
+      rml:predicate rdf:type
+    ], [
+      rml:objectMap [
+          rml:reference "$.FirstName"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:graph ex:PersonGraph;
+      rml:template "http://example.com/Student/{$.ID}/{$.FirstName}"
+    ] .
+
+

Output

+
<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" <http://example.com/PersonGraph> . 
+<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person>  <http://example.com/PersonGraph> .
+
+
+
+

18. RMLTC0007c-JSON

+

Title: "One row mapping, using rml:class"

+

Description: "Tests subjectmap with more than one class IRIs, rml:class"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "FirstName":"Venus",
+    "LastName":"Williams"
+  }]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.ID"
+        ];
+      rml:predicate ex:id
+    ], [
+      rml:objectMap [
+          rml:reference "$.FirstName"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:class ex:Student, foaf:Person;
+      rml:template "http://example.com/Student/{$.ID}/{$.FirstName}"
+    ] .
+
+

Output

+
<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
+<http://example.com/Student/10/Venus> <http://example.com/id> "10"^^<http://www.w3.org/2001/XMLSchema#integer> . 
+<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/Student> .
+
+
+
+

19. RMLTC0007d-JSON

+

Title: "One column mapping, specifying an rml:predicateObjectMap with rdf:type"

+

Description: "Tests subjectmap with an alternative of having rml:class, i.e., by specifying an rml:predicateObjectMap with predicate rdf:type"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "FirstName":"Venus",
+    "LastName":"Williams"
+  }]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:object foaf:Person;
+      rml:predicate rdf:type
+    ], [
+      rml:object ex:Student;
+      rml:predicate rdf:type
+    ], [
+      rml:objectMap [
+          rml:reference "$.ID"
+        ];
+      rml:predicate ex:id
+    ], [
+      rml:objectMap [
+          rml:reference "$.FirstName"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Student/{$.ID}/{$.FirstName}"
+    ] .
+
+

Output

+
<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" . 
+<http://example.com/Student/10/Venus> <http://example.com/id> "10"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/Student> .
+
+
+
+

20. RMLTC0007e-JSON

+

Title: "One column mapping, using rml:graphMap and rml:class"

+

Description: "Tests subjectmap with rml:graphMap and rml:class"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "Name":"Venus"
+  }]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.ID"
+        ];
+      rml:predicate ex:id
+    ], [
+      rml:objectMap [
+          rml:reference "$.Name"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:class foaf:Person;
+      rml:graph ex:PersonGraph;
+      rml:template "http://example.com/Student/{$.ID}/{$.Name}"
+    ] .
+
+

Output

+
<http://example.com/Student/10/Venus> <http://example.com/id> "10"^^<http://www.w3.org/2001/XMLSchema#integer> <http://example.com/PersonGraph> .
+<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" <http://example.com/PersonGraph> .
+<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> <http://example.com/PersonGraph> .
+
+
+
+

21. RMLTC0007f-JSON

+

Title: "One column mapping, using rml:graphMap and specifying an rml:predicateObjectMap with rdf:type"

+

Description: "Tests subjectmap with rml:graphMap and specifying an rml:predicateObjectMap with predicate rdf:type"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "FirstName":"Venus",
+    "LastName":"Williams"
+  }]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:object foaf:Person;
+      rml:predicate rdf:type
+    ], [
+      rml:objectMap [
+          rml:reference "$.ID"
+        ];
+      rml:predicate ex:id
+    ], [
+      rml:objectMap [
+          rml:reference "$.FirstName"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:graph ex:PersonGraph;
+      rml:template "http://example.com/Student/{$.ID}/{$.FirstName}"
+    ] .
+
+

Output

+
<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> <http://example.com/PersonGraph> .
+<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" <http://example.com/PersonGraph> .
+<http://example.com/Student/10/Venus> <http://example.com/id> "10"^^<http://www.w3.org/2001/XMLSchema#integer> <http://example.com/PersonGraph> .
+
+
+
+

22. RMLTC0007g-JSON

+

Title: "Assigning triples to the default graph"

+

Description: "Tests the generation of triples to the default graph"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "FirstName":"Venus",
+    "LastName":"Williams"
+  }]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.FirstName"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:graph rml:defaultGraph;
+      rml:template "http://example.com/Student/{$.ID}/{$.FirstName}"
+    ] .
+
+

Output

+
<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
+
+
+
+

23. RMLTC0007h-JSON

+

Title: "Assigning triples to a non-IRI named graph"

+

Description: "Tests the generation of triples to a non-IRI named graph, which is an error"

+

Default Base IRI: http://example.com/

+

Error expected? Yes

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "FirstName":"Venus",
+    "LastName":"Williams"
+  }]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.FirstName"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:graphMap [
+          rml:reference "$.ID";
+          rml:termType rml:Literal
+        ];
+      rml:template "http://example.com/Student/{$.ID}/{$.FirstName}"
+    ] .
+
+
+

24. RMLTC0008a-JSON

+

Title: "Generation of triples to a target graph by using rml:graphMap and rml:template"

+

Description: "Test that results of the mapping can be directed to a target graph by using rml:graphMap and rml:template"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "Name":"Venus Williams",
+    "Sport": "Tennis"
+  }]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:object foaf:Person;
+      rml:predicate rdf:type
+    ], [
+      rml:objectMap [
+          rml:reference "$.ID"
+        ];
+      rml:predicate ex:id
+    ], [
+      rml:objectMap [
+          rml:reference "$.Name"
+        ];
+      rml:predicate foaf:name
+    ], [
+      rml:objectMap [
+          rml:reference "$.Sport"
+        ];
+      rml:predicate ex:Sport
+    ];
+  rml:subjectMap [
+      rml:graphMap [
+          rml:template "http://example.com/graph/Student/{$.ID}/{$.Name}"
+        ];
+      rml:template "http://example.com/Student/{$.ID}/{$.Name}"
+    ] .
+
+

Output

+
<http://example.com/Student/10/Venus%20Williams> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> <http://example.com/graph/Student/10/Venus%20Williams> .
+<http://example.com/Student/10/Venus%20Williams> <http://xmlns.com/foaf/0.1/name> "Venus Williams" <http://example.com/graph/Student/10/Venus%20Williams> .
+<http://example.com/Student/10/Venus%20Williams> <http://example.com/id> "10" <http://example.com/graph/Student/10/Venus%20Williams> . 
+<http://example.com/Student/10/Venus%20Williams> <http://example.com/Sport> "Tennis" <http://example.com/graph/Student/10/Venus%20Williams> . 
+
+
+
+

25. RMLTC0008b-JSON

+

Title: "Generation of triples referencing object map"

+

Description: "Tests the mapping specification referencing object map without join"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "Name":"Venus Williams",
+    "Sport": "Tennis"
+  }]
+}
+
+

Mapping

+
@prefix activity: <http://example.com/activity/> .
+@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap <http://example.com/base/RefObjectMap1>;
+      rml:predicate ex:Sport
+    ], [
+      rml:object foaf:Person;
+      rml:predicate rdf:type
+    ], [
+      rml:objectMap [
+          rml:reference "$.ID"
+        ];
+      rml:predicate ex:id
+    ], [
+      rml:objectMap [
+          rml:reference "$.Name"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Student/{$.ID}/{$.Name}"
+    ] .
+
+<http://example.com/base/RefObjectMap1> a rml:RefObjectMap;
+  rml:parentTriplesMap <http://example.com/base/TriplesMap2> .
+
+<http://example.com/base/TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:object activity:Sport;
+      rml:predicate rdf:type
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{$.Sport}"
+    ] .
+
+

Output

+
<http://example.com/Student/10/Venus%20Williams> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person>  .
+<http://example.com/Student/10/Venus%20Williams> <http://xmlns.com/foaf/0.1/name> "Venus Williams" .
+<http://example.com/Student/10/Venus%20Williams> <http://example.com/id> "10"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.com/Student/10/Venus%20Williams> <http://example.com/Sport> <http://example.com/Tennis> . 
+<http://example.com/Tennis> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/activity/Sport> .
+
+
+
+
+

26. RMLTC0008c-JSON

+

Title: "Generation of triples by using multiple predicateMaps within a rml:predicateObjectMap"

+

Description: "Tests the generation of triples by using multiple predicateMaps within a rml:predicateObjectMap"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "Name":"Venus Williams",
+    "Sport": "Tennis"
+  }]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.Name"
+        ];
+      rml:predicate ex:name, foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Student/{$.ID}/{$.Name}"
+    ] .
+
+

Output

+
<http://example.com/Student/10/Venus%20Williams> <http://xmlns.com/foaf/0.1/name> "Venus Williams"  .
+<http://example.com/Student/10/Venus%20Williams> <http://example.com/name> "Venus Williams"  .
+
+
+
+

27. RMLTC0009a-JSON

+

Title: "Generation of triples from foreign key relations"

+

Description: "Test foreign key relationships among logical tables"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "students" : [
+    { 
+      "ID": 10,
+      "Sport": 100,
+      "Name": "Venus Williams"
+    },
+    { 
+      "ID": 20,
+      "Name": "Demi Moore"
+    }
+  ]
+}
+
+

Input 1

+
{
+  "sports": [
+    {
+      "ID": 100,
+      "Name": "Tennis"
+    }
+  ]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.Name"
+        ];
+      rml:predicate foaf:name
+    ], [
+      rml:objectMap [ a rml:RefObjectMap;
+          rml:joinCondition [
+              rml:child "$.Sport";
+              rml:parent "$.ID"
+            ];
+          rml:parentTriplesMap <http://example.com/base/TriplesMap2>
+        ];
+      rml:predicate <http://example.com/ontology/practises>
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/resource/student_{$.ID}"
+    ] .
+
+<http://example.com/base/TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.sports[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "sport.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.Name"
+        ];
+      rml:predicate rdfs:label
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/resource/sport_{$.ID}"
+    ] .
+
+

Output

+
<http://example.com/resource/student_10> <http://xmlns.com/foaf/0.1/name> "Venus Williams"  .
+<http://example.com/resource/student_20> <http://xmlns.com/foaf/0.1/name> "Demi Moore"  .
+<http://example.com/resource/sport_100> <http://www.w3.org/2000/01/rdf-schema#label> "Tennis" .
+<http://example.com/resource/student_10> <http://example.com/ontology/practises> <http://example.com/resource/sport_100>  .
+
+
+

28. RMLTC0009b-JSON

+

Title: "Generation of triples to multiple graphs"

+

Description: "Test that results from distinct parts of the mapping can be directed to different target graphs."

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "students" : [
+    { 
+      "ID": 10,
+      "Sport": 100,
+      "Name": "Venus Williams"
+    },
+    { 
+      "ID": 20,
+      "Name": "Demi Moore"
+    }
+  ]
+}
+
+

Input 1

+
{
+  "sports": [
+    {
+      "ID": 100,
+      "Name": "Tennis"
+    }
+  ]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:graph <http://example.com/graph/students>;
+      rml:objectMap [
+          rml:reference "$.Name"
+        ];
+      rml:predicate foaf:name
+    ], [
+      rml:graph <http://example.com/graph/practise>;
+      rml:objectMap [ a rml:RefObjectMap;
+          rml:joinCondition [
+              rml:child "$.Sport";
+              rml:parent "$.ID"
+            ];
+          rml:parentTriplesMap <http://example.com/base/TriplesMap2>
+        ];
+      rml:predicate <http://example.com/ontology/practises>
+    ];
+  rml:subjectMap [
+      rml:class <http://example.com/ontology/Student>;
+      rml:graph <http://example.com/graph/students>;
+      rml:template "http://example.com/resource/student_{$.ID}"
+    ] .
+
+<http://example.com/base/TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.sports[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "sport.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.Name"
+        ];
+      rml:predicate rdfs:label
+    ];
+  rml:subjectMap [
+      rml:class <http://example.com/ontology/Sport>;
+      rml:graph <http://example.com/graph/sports>;
+      rml:template "http://example.com/resource/sport_{$.ID}"
+    ] .
+
+

Output

+
<http://example.com/resource/student_10> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/ontology/Student> <http://example.com/graph/students> .
+<http://example.com/resource/student_10> <http://xmlns.com/foaf/0.1/name> "Venus Williams" <http://example.com/graph/students> .
+<http://example.com/resource/student_20> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/ontology/Student> <http://example.com/graph/students> .
+<http://example.com/resource/student_20> <http://xmlns.com/foaf/0.1/name> "Demi Moore" <http://example.com/graph/students> .
+<http://example.com/resource/sport_100> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/ontology/Sport> <http://example.com/graph/sports> .
+<http://example.com/resource/sport_100> <http://www.w3.org/2000/01/rdf-schema#label> "Tennis" <http://example.com/graph/sports> .
+<http://example.com/resource/student_10> <http://example.com/ontology/practises> <http://example.com/resource/sport_100> <http://example.com/graph/practise> .
+<http://example.com/resource/student_10> <http://example.com/ontology/practises> <http://example.com/resource/sport_100> <http://example.com/graph/students> .
+
+
+

29. RMLTC0010a-JSON

+

Title: "Template with table column with blank space"

+

Description: "Tests a template with blank space in column value"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "countries": [{
+    "Country Code": 1,
+    "Name":"Bolivia, Plurinational State of",
+    "ISO 3166": "BO"
+  }, {
+    "Country Code": 2,
+    "Name":"Ireland",
+    "ISO 3166": "IE"
+  }, {
+    "Country Code": 3,
+    "Name":"Saint Martin (French part)",
+    "ISO 3166": "MF"
+  }]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.countries[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "country_info.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.Name"
+        ];
+      rml:predicate ex:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{$.['Country Code']}"
+    ] .
+
+

Output

+
<http://example.com/1> <http://example.com/name> "Bolivia, Plurinational State of" .
+<http://example.com/2> <http://example.com/name> "Ireland" .
+<http://example.com/3> <http://example.com/name> "Saint Martin (French part)" .
+
+
+
+

30. RMLTC0010b-JSON

+

Title: "Template with table columns with special chars"

+

Description: "Tests a template with special chars in column value"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "countries": [{
+    "Country Code": 1,
+    "Name":"Bolivia, Plurinational State of",
+    "ISO 3166": "BO"
+  }, {
+    "Country Code": 2,
+    "Name":"Ireland",
+    "ISO 3166": "IE"
+  }, {
+    "Country Code": 3,
+    "Name":"Saint Martin (French part)",
+    "ISO 3166": "MF"
+  }]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.countries[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "country_info.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.Name"
+        ];
+      rml:predicate ex:name
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{$.['Country Code']}/{$.Name}"
+    ] .
+
+

Output

+
<http://example.com/1/Bolivia%2C%20Plurinational%20State%20of> <http://example.com/name> "Bolivia, Plurinational State of" .
+<http://example.com/2/Ireland> <http://example.com/name> "Ireland" .
+<http://example.com/3/Saint%20Martin%20%28French%20part%29> <http://example.com/name> "Saint Martin (French part)" .
+
+
+
+

31. RMLTC0010c-JSON

+

Title: "Template with table columns with special chars and backslashes"

+

Description: "Tests a template with special chars in reference value and backslash escapes in string templates"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "countries": [{
+    "Country Code": 1,
+    "Name":"Bolivia, Plurinational State of",
+    "ISO 3166": "BO"
+  }, {
+    "Country Code": 2,
+    "Name":"Ireland",
+    "ISO 3166": "IE"
+  }, {
+    "Country Code": 3,
+    "Name":"Saint Martin (French part)",
+    "ISO 3166": "MF"
+  }]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.countries[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "country_info.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:predicate ex:code;
+      rml:objectMap [
+          rml:template "\\{\\{\\{ {$.['ISO 3166']} \\}\\}\\}";
+          rml:termType rml:Literal
+        ]
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{$.['Country Code']}/{$.Name}"
+    ] .
+
+

Output

+
<http://example.com/1/Bolivia%2C%20Plurinational%20State%20of> <http://example.com/code> "{{{ BO }}}" .
+<http://example.com/2/Ireland> <http://example.com/code> "{{{ IE }}}" .
+<http://example.com/3/Saint%20Martin%20%28French%20part%29> <http://example.com/code> "{{{ MF }}}" .
+
+
+
+

32. RMLTC0011b-JSON

+

Title: "M to M relation, by using an additional Triples Map"

+

Description: "Tests, M to M relations, by using an additional Triples Map"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "students": [
+    {"ID":10, "FirstName":"Venus", "LastName":"Williams"},
+    {"ID":11, "FirstName":"Fernando", "LastName":"Alonso"},
+    {"ID":12, "FirstName":"David", "LastName":"Villa"}
+  ]
+}
+
+

Input 1

+
{
+  "sports": [
+    {"ID":110, "Description":"Tennis"},
+    {"ID":111, "Description":"Football"},
+    {"ID":112, "Description":"Formula1"}
+  ]
+}
+
+

Input 2

+
{
+  "links": [
+    {"ID_Student":10, "ID_Sport":110},
+    {"ID_Student":11, "ID_Sport":111},
+    {"ID_Student":11, "ID_Sport":112},
+    {"ID_Student":12, "ID_Sport":111}
+  ]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/LinkMap_1_2> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.links[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student_sport.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:template "http://example.com/sport/{$.ID_Sport}"
+        ];
+      rml:predicate ex:plays
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/student/{$.ID_Student}"
+    ] .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.FirstName"
+        ];
+      rml:predicate ex:firstName
+    ], [
+      rml:objectMap [
+          rml:reference "$.LastName"
+        ];
+      rml:predicate ex:lastName
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/student/{$.ID}"
+    ] .
+
+<http://example.com/base/TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.sports[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "sport.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.Description"
+        ];
+      rml:predicate ex:description
+    ], [
+      rml:objectMap [
+          rml:reference "$.ID"
+        ];
+      rml:predicate ex:id
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/sport/{$.ID}"
+    ] .
+
+

Output

+
<http://example.com/student/10> <http://example.com/lastName> "Williams" .
+<http://example.com/student/10> <http://example.com/firstName> "Venus" .
+<http://example.com/student/12> <http://example.com/lastName> "Villa" .
+<http://example.com/student/12> <http://example.com/firstName> "David" .
+<http://example.com/student/11> <http://example.com/lastName> "Alonso" .
+<http://example.com/student/11> <http://example.com/firstName> "Fernando" .
+<http://example.com/sport/110> <http://example.com/description> "Tennis" .
+<http://example.com/sport/110> <http://example.com/id> "110"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.com/sport/111> <http://example.com/description> "Football" .
+<http://example.com/sport/111> <http://example.com/id> "111"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.com/sport/112> <http://example.com/description> "Formula1" .
+<http://example.com/sport/112> <http://example.com/id> "112"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.com/student/10> <http://example.com/plays> <http://example.com/sport/110> .
+<http://example.com/student/12> <http://example.com/plays> <http://example.com/sport/111> .
+<http://example.com/student/11> <http://example.com/plays> <http://example.com/sport/112> .
+<http://example.com/student/11> <http://example.com/plays> <http://example.com/sport/111> .
+
+
+
+

33. RMLTC0012a-JSON

+

Title: "Blank node referencing multiple columns"

+

Description: "Tests that blank nodes can be generated by referencing multiple columns"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "persons": [
+    {"fname":"Bob","lname":"Smith","amount":30},
+    {"fname":"Sue","lname":"Jones","amount":20},
+    {"fname":"Bob","lname":"Smith","amount":30}
+  ]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.persons[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "persons.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:template "{$.fname} {$.lname}";
+          rml:termType rml:Literal
+        ];
+      rml:predicate foaf:name
+    ], [
+      rml:objectMap [
+          rml:reference "$.amount"
+        ];
+      rml:predicate ex:amount
+    ];
+  rml:subjectMap [
+      rml:template "{$.fname}{$.lname}{$.amount}";
+      rml:termType rml:BlankNode
+    ] .
+
+

Output

+
_:BobSmith30 <http://example.com/amount> "30"^^<http://www.w3.org/2001/XMLSchema#integer> .
+_:BobSmith30 <http://xmlns.com/foaf/0.1/name> "Bob Smith" .
+_:SueJones20 <http://example.com/amount> "20"^^<http://www.w3.org/2001/XMLSchema#integer> .
+_:SueJones20 <http://xmlns.com/foaf/0.1/name> "Sue Jones" .
+
+
+
+

34. RMLTC0012b-JSON

+

Title: "Duplicate tuples generate same blank node"

+

Description: "Tests that blank nodes with same identifier and in the same graph but generated by different logical rows are considered equivalent."

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "lives": [
+    {"fname":"Bob","lname":"Smith","city":"London"},
+    {"fname":"Sue","lname":"Jones","city":"Madrid"},
+    {"fname":"Bob","lname":"Smith","city":"London"}
+  ]
+}
+
+

Input 1

+
{
+  "persons": [
+    {"fname":"Bob","lname":"Smith","amount":30},
+    {"fname":"Sue","lname":"Jones","amount":20},
+    {"fname":"Bob","lname":"Smith","amount":30}
+  ]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.persons[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "persons.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:template "{$.fname} {$.lname}";
+          rml:termType rml:Literal
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:template "{$.fname}{$.lname}";
+      rml:termType rml:BlankNode
+    ] .
+
+<http://example.com/base/TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.lives[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "lives.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.city"
+        ];
+      rml:predicate ex:city
+    ];
+  rml:subjectMap [
+      rml:template "{$.fname}{$.lname}";
+      rml:termType rml:BlankNode
+    ] .
+
+

Output

+
_:BobSmith <http://example.com/city> "London" .
+_:BobSmith <http://xmlns.com/foaf/0.1/name> "Bob Smith" .
+_:SueJones <http://example.com/city> "Madrid" .
+_:SueJones <http://xmlns.com/foaf/0.1/name> "Sue Jones" .
+
+
+
+

35. RMLTC0012c-JSON

+

Title: "TriplesMap without subjectMap"

+

Description: "Tests a RML with missing information, TriplesMap without subjectMap."

+

Default Base IRI: http://example.com/

+

Error expected? Yes

+

Input

+
{
+  "persons": [
+    {"fname":"Bob","lname":"Smith","amount":30},
+    {"fname":"Sue","lname":"Jones","amount":20},
+    {"fname":"Bob","lname":"Smith","amount":30}
+  ]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.persons[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "persons.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:template "{$.fname} {$.lname}";
+          rml:termType rml:Literal
+        ];
+      rml:predicate foaf:name
+    ], [
+      rml:objectMap [
+          rml:reference "$.amount"
+        ];
+      rml:predicate ex:amount
+    ] .
+
+
+

36. RMLTC0012d-JSON

+

Title: "TriplesMap with two subjectMap"

+

Description: "Tests a RML with wrong information, TriplesMap with two subjectMap."

+

Default Base IRI: http://example.com/

+

Error expected? Yes

+

Input

+
{
+  "persons": [
+    {"fname":"Bob","lname":"Smith","amount":30},
+    {"fname":"Sue","lname":"Jones","amount":20},
+    {"fname":"Bob","lname":"Smith","amount":30}
+  ]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.persons[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "persons.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:template "{$.fname} {$.lname}";
+          rml:termType rml:Literal
+        ];
+      rml:predicate foaf:name
+    ], [
+      rml:objectMap [
+          rml:reference "$.amount"
+        ];
+      rml:predicate ex:amount
+    ];
+  rml:subjectMap [
+      rml:template "{$.fname}_{$.lname}_{$.amount}";
+      rml:termType rml:BlankNode
+    ], [
+      rml:template "{$.amount}_{$.fname}_{$.lname}";
+      rml:termType rml:BlankNode
+    ] .
+
+
+

37. RMLTC0013a-JSON

+

Title: "Null value in JSON file"

+

Description: "Tests if null values in JSON files are handled correctly."

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "persons": [
+    {"ID":"1","Name":"Alice","DateOfBirth":null},
+    {"ID":"2","Name":"Bob","DateOfBirth":"September, 2010"}
+  ]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.persons[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "persons.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.DateOfBirth"
+        ];
+      rml:predicate ex:BirthDay
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Person/{$.ID}/{$.Name}/{$.DateOfBirth}"
+    ] .
+
+

Output

+
<http://example.com/Person/2/Bob/September%2C%202010> <http://example.com/BirthDay> "September, 2010" .
+
+
+

38. RMLTC0015a-JSON

+

Title: "Generation of language tags from a table with language information"

+

Description: "Generation of language tags from a table with language information"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "countries": [
+    {"Code": "BO", "Name": "Estado Plurinacional de Bolivia"},
+    {"Code": "IE", "Name": "Irlanda"}
+  ]
+}
+
+

Mapping

+
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.countries[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "country_en.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:language "en";
+          rml:reference "$.Name"
+        ];
+      rml:predicate rdfs:label
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{$.Code}"
+    ] .
+
+<http://example.com/base/TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.countries[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "country_es.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:language "es";
+          rml:reference "$.Name"
+        ];
+      rml:predicate rdfs:label
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{$.Code}"
+    ] .
+
+

Output

+
<http://example.com/BO> <http://www.w3.org/2000/01/rdf-schema#label> "Bolivia, Plurinational State of"@en .
+<http://example.com/BO> <http://www.w3.org/2000/01/rdf-schema#label> "Estado Plurinacional de Bolivia"@es .
+<http://example.com/IE> <http://www.w3.org/2000/01/rdf-schema#label> "Ireland"@en .
+<http://example.com/IE> <http://www.w3.org/2000/01/rdf-schema#label> "Irlanda"@es .
+
+
+
+
+

39. RMLTC0015b-JSON

+

Title: "Generation of language tags from a table with language information, and a term map with invalid rml:language value"

+

Description: "Tests a term map with an invalid rml:language value, which is an error"

+

Default Base IRI: http://example.com/

+

Error expected? Yes

+

Input

+
{
+  "countries": [
+    {"Code": "BO", "Name": "Estado Plurinacional de Bolivia"},
+    {"Code": "IE", "Name": "Irlanda"}
+  ]
+}
+
+

Mapping

+
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.countries[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "country_en.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:language "a-english";
+          rml:reference "$.Name"
+        ];
+      rml:predicate rdfs:label
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{$.Code}"
+    ] .
+
+<http://example.com/base/TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.countries[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "country_en.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:language "a-spanish";
+          rml:reference "$.Name"
+        ];
+      rml:predicate rdfs:label
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{$.Code}"
+    ] .
+
+
+

40. RMLTC0019a-JSON

+

Title: "Generation of triples by using IRI value in columns"

+

Description: "Test the generation of triples by using IRI value in attributes"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "persons": [
+    {
+      "ID": 10,
+      "FirstName": "http://example.com/ns#Jhon",
+      "LastName": "Smith"
+    },
+    {
+      "ID": 20,
+      "FirstName": "Carlos",
+      "LastName": "Mendoza"
+    }
+  ]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.persons[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "persons.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.FirstName"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:reference "$.FirstName"
+    ] .
+
+

Output

+
<http://example.com/ns#Jhon> <http://xmlns.com/foaf/0.1/name> "http://example.com/ns#Jhon" .
+<http://example.com/Carlos> <http://xmlns.com/foaf/0.1/name> "Carlos" .
+
+
+

41. RMLTC0019b-JSON

+

Title: "Generation of triples by using IRI value in columns, with data error"

+

Description: "Test the generation of triples by using IRI value in attributes, conforming RML mapping with data error (and limited results)"

+

Default Base IRI: http://example.com/

+

Error expected? Yes

+

Input

+
{
+  "persons": [
+    {
+      "ID": 30,
+      "FirstName": "Juan Daniel",
+      "LastName": "Crespo"
+    }
+  ]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.persons[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "persons.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.FirstName"
+        ];
+      rml:predicate foaf:name
+    ];
+  rml:subjectMap [
+      rml:reference "$.FirstName"
+    ] .
+
+
+

42. RMLTC0020a-JSON

+

Title: "Generation of triples by using IRI value in columns"

+

Description: "Test the generation of triples by using IRI value in attributes"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "students": [
+    {"Name": "http://example.com/company/Alice"},
+    {"Name": "Bob"},
+    {"Name": "Bob/Charles"},
+    {"Name": "path/../Danny"},
+    {"Name": "Emily Smith"}
+  ]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:object foaf:Person;
+      rml:predicate rdf:type
+    ];
+  rml:subjectMap [
+      rml:template "{$.Name}";
+      rml:termType rml:IRI
+    ] .
+
+

Output

+
<http://example.com/http%3A%2F%2Fexample.com%2Fcompany%2FAlice> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Bob> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Bob%2FCharles> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/path%2F..%2FDanny> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Emily%20Smith> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+
+
+

43. RMLTC0021a-JSON

+

Title: "Generation of triples referencing object map"

+

Description: "Tests the mapping specification referencing object map with same logical source and join condition"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "Name":"Venus Williams",
+    "Sport": "Tennis"
+  }, {
+    "ID": 20,
+    "Name":"Serena Williams",
+    "Sport": "Tennis"
+  }, {
+    "ID": 30,
+    "Name":"Loena Hendrickx",
+    "Sport": "Figure skating"
+  }]
+}
+
+

Mapping

+
@prefix activity: <http://example.com/activity/> .
+@prefix ex: <http://example.com/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/RefObjectMap1> a rml:RefObjectMap;
+  rml:joinCondition [
+      rml:child "$.Sport";
+      rml:parent "$.Sport"
+    ];
+  rml:parentTriplesMap <http://example.com/base/TriplesMap1> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap <http://example.com/base/RefObjectMap1>;
+      rml:predicate ex:sameSportAs
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Student/{$.ID}/{$.Name}"
+    ] .
+
+

Output

+
<http://example.com/Student/10/Venus%20Williams> <http://example.com/sameSportAs> <http://example.com/Student/10/Venus%20Williams> . 
+<http://example.com/Student/10/Venus%20Williams> <http://example.com/sameSportAs> <http://example.com/Student/20/Serena%20Williams> . 
+<http://example.com/Student/20/Serena%20Williams> <http://example.com/sameSportAs> <http://example.com/Student/20/Serena%20Williams> . 
+<http://example.com/Student/20/Serena%20Williams> <http://example.com/sameSportAs> <http://example.com/Student/10/Venus%20Williams> . 
+<http://example.com/Student/30/Loena%20Hendrickx> <http://example.com/sameSportAs> <http://example.com/Student/30/Loena%20Hendrickx> . 
+
+
+
+
+

44. RMLTC0022a-JSON

+

Title: "Generating of triples with constant datatype"

+

Description: "Test triples with a fixed constant datatype"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "Name":"Venus",
+    "Age": 21
+  }]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:datatype xsd:string;
+          rml:reference "$.Name"
+        ];
+      rml:predicate foaf:name
+    ], [
+      rml:objectMap [
+          rml:datatype xsd:int;
+          rml:reference "$.Age"
+        ];
+      rml:predicate ex:age
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{$.Name}"
+    ] .
+
+

Output

+
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "Venus"^^<http://www.w3.org/2001/XMLSchema#string> .
+<http://example.com/Venus> <http://example.com/age> "21"^^<http://www.w3.org/2001/XMLSchema#int> .
+
+
+

45. RMLTC0022b-JSON

+

Title: "Generating of triples with datatypeMap"

+

Description: "Test triples with a XSD datatype generated from the data"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
[
+    { "FOO": 1, "BAR": "string"},
+    { "FOO": 2, "BAR": "int"}
+]
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:referenceFormulation rml:JSONPath;
+      rml:iterator "$[*]";
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "data.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:datatypeMap [
+              rml:template "http://www.w3.org/2001/XMLSchema#{$.BAR}"
+            ];
+          rml:reference "$.FOO"
+        ];
+      rml:predicate ex:x
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{$.FOO}"
+    ] .
+
+
+

Output

+
<http://example.com/1> <http://example.com/x> "1"^^<http://www.w3.org/2001/XMLSchema#string> .
+<http://example.com/2> <http://example.com/x> "2"^^<http://www.w3.org/2001/XMLSchema#int> .
+
+
+

46. RMLTC0022c-JSON

+

Title: "Generating of triples with datatypeMap with custom datatype"

+

Description: "Test triples with a custom datype from the data"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
[
+    { "FOO": 1, "BAR": "string"},
+    { "FOO": 2, "BAR": "int"}
+]
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:referenceFormulation rml:JSONPath;
+      rml:iterator "$[*]";
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "data.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:datatypeMap [
+              rml:template "datatype#{$.BAR}"
+            ];
+          rml:reference "$.FOO"
+        ];
+      rml:predicate ex:x
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{$.FOO}"
+    ] .
+
+

Output

+
<http://example.com/1> <http://example.com/x> "1"^^<http://example.com/datatype#string> .
+<http://example.com/2> <http://example.com/x> "2"^^<http://example.com/datatype#int> .
+
+
+

47. RMLTC0023a-JSON

+

Title: "Invalid IRI template 1"

+

Description: "Test handling of invalid IRI template"

+

Default Base IRI: http://example.com/

+

Error expected? Yes

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "{Name}":"Venus"
+  }]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:referenceFormulation rml:JSONPath;
+      rml:iterator "$.students[*]";
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{{Name}}";
+      rml:class foaf:Person;
+    ] .
+
+
+

48. RMLTC0023b-JSON

+

Title: "Invalid IRI template 2"

+

Description: "Test handling of invalid IRI template"

+

Default Base IRI: http://example.com/

+

Error expected? Yes

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "N\ame":"Venus"
+  }]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:referenceFormulation rml:JSONPath;
+      rml:iterator "$.students[*]";
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{N\ame}";
+      rml:class foaf:Person;
+    ] .
+
+
+
+

49. RMLTC0023c-JSON

+

Title: "Invalid IRI template 3"

+

Description: "Test handling of invalid IRI template"

+

Default Base IRI: http://example.com/

+

Error expected? Yes

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "Name":"Venus"
+  }]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:referenceFormulation rml:JSONPath;
+      rml:iterator "$.students[*]";
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{Name\}";
+      rml:class foaf:Person;
+    ] .
+
+
+
+

50. RMLTC0023d-JSON

+

Title: "Invalid IRI template 4"

+

Description: "Test handling of invalid IRI template"

+

Default Base IRI: http://example.com/

+

Error expected? Yes

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "{Name}":"Venus"
+  }]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+     rml:referenceFormulation rml:JSONPath;
+     rml:iterator "$.students[*]";
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{\\\\{Name\\\\}}";
+      rml:class foaf:Person;
+    ] .
+
+
+
+

51. RMLTC0023e-JSON

+

Title: "Invalid IRI template 5"

+

Description: "Test handling of invalid IRI template"

+

Default Base IRI: http://example.com/

+

Error expected? Yes

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "N\ame":"Venus"
+  }]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:referenceFormulation rml:JSONPath;
+      rml:iterator "$.students[*]";
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{N\\\ame}";
+      rml:class foaf:Person;
+    ] .
+
+
+

52. RMLTC0023f-JSON

+

Title: "Valid IRI template with backslash-escape"

+

Description: "Test handling of a valid IRI template using backslash-escape"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "students": [{
+    "ID": 10,
+    "{Name}":"Venus"
+  }]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+     rml:referenceFormulation rml:JSONPath;
+     rml:iterator "$.students[*]";
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{\\{Name\\}}";
+      rml:class foaf:Person;
+    ] .
+
+
+

Output

+
<http://example.com/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+
+
+

53. RMLTC0024a-JSON

+

Title: "Usage of constant term maps in combination with explicitly defined term types"

+

Description: "Tests the usage of constant term maps in combination with explicitly defined term types"

+

Default Base IRI: http://example.com/

+

Error expected? Yes

+

Input

+
{
+  "students": [{
+    "Name":"Venus"
+  },
+  {
+    "Name":"Julio"
+  }]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix ex: <http://example.com/>.
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.Name"
+        ];
+      rml:predicate ex:student
+    ];
+  rml:subjectMap [
+      rml:constant "School";
+      rml:termType rml:BlankNode
+  ] .
+
+
+

54. RMLTC0025a-JSON

+

Title: "Generation of triples from arrays"

+

Description: "Tests the generation of triples from array input data structures"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "persons": [
+    {"fname":"Bob","lname":"Smith","amounts":[30, 40, 50]}
+  ]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.persons[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "persons.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.amounts[*]"
+        ];
+      rml:predicate ex:amount
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Student/{$.fname}/{$.lname}"
+    ] .
+
+

Output

+
<http://example.com/Student/Bob/Smith> <http://example.com/amount> "30"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.com/Student/Bob/Smith> <http://example.com/amount> "40"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.com/Student/Bob/Smith> <http://example.com/amount> "50"^^<http://www.w3.org/2001/XMLSchema#integer> .
+
+
+

55. RMLTC0025b-JSON

+

Title: "Generation of triples from arrays with wrong reference"

+

Description: "Tests the generation of triples from array input data structures. Test should fail as reference points to the array and not the values of the array"

+

Default Base IRI: http://example.com/

+

Error expected? Yes

+

Input

+
{
+  "persons": [
+    {"fname":"Bob","lname":"Smith","amounts":[30, 40, 50]}
+  ]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.persons[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "persons.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.amounts"
+        ];
+      rml:predicate ex:amount
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Student/{$.fname}/{$.lname}"
+    ] .
+
+
+

56. RMLTC0025c-JSON

+

Title: "Generation of triples from arrays in subject and object"

+

Description: "Tests the generation of triples from array input data structures in subject and object"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "persons": [
+    {"names":["Bob", "Smith"],"amounts":[30, 40, 50]}
+  ]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.persons[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "persons.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.amounts[*]"
+        ];
+      rml:predicate ex:amount
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Student/{$.names[*]}"
+    ] .
+
+

Output

+
<http://example.com/Student/Smith> <http://example.com/amount> "30"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.com/Student/Smith> <http://example.com/amount> "40"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.com/Student/Smith> <http://example.com/amount> "50"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.com/Student/Bob> <http://example.com/amount> "30"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.com/Student/Bob> <http://example.com/amount> "40"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.com/Student/Bob> <http://example.com/amount> "50"^^<http://www.w3.org/2001/XMLSchema#integer> .
+
+
+

57. RMLTC0026a-JSON

+

Title: "Two triples maps, one with rml:baseIRI and one without and generating absolute IRIs"

+

Description: "Tests the generation of triples from relative IRIs using base IRI"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "persons": [
+    {"fname":"Bob","lname":"Smith","amount":30},
+    {"fname":"Sue","lname":"Jones","amount":20}
+  ]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:baseIRI <http://example.com/>;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.persons[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "persons.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.amount"
+        ];
+      rml:predicate ex:amount
+    ];
+  rml:subjectMap [
+      rml:template "{$.fname}"
+    ] .
+
+<http://example.com/base/TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.persons[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "persons.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.amount"
+        ];
+      rml:predicate ex:amount
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/{$.lname}"
+    ] .
+
+

Output

+
<http://example.com/Bob> <http://example.com/amount> "30"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.com/Jones> <http://example.com/amount> "20"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.com/Smith> <http://example.com/amount> "30"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.com/Sue> <http://example.com/amount> "20"^^<http://www.w3.org/2001/XMLSchema#integer> .
+
+
+

58. RMLTC0026b-JSON

+

Title: "Two triples maps, one with rml:baseIRI one one without and generating relative IRIs using baseIRI parameter"

+

Description: "Tests the generation of triples from relative IRI using base IRI parameter"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "persons": [
+    {"fname":"Bob","lname":"Smith","amount":30},
+    {"fname":"Sue","lname":"Jones","amount":20}
+  ]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:baseIRI <http://tp1.com/>;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.persons[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "persons.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.amount"
+        ];
+      rml:predicate ex:amount
+    ];
+  rml:subjectMap [
+      rml:template "{$.fname}"
+    ] .
+
+<http://example.com/base/TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.persons[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "persons.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.amount"
+        ];
+      rml:predicate ex:amount
+    ];
+  rml:subjectMap [
+      rml:template "{$.lname}"
+    ] .
+
+

Output

+
<http://tp1.com/Bob> <http://example.com/amount> "30"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.com/Jones> <http://example.com/amount> "20"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.com/Smith> <http://example.com/amount> "30"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://tp1.com/Sue> <http://example.com/amount> "20"^^<http://www.w3.org/2001/XMLSchema#integer> .
+
+
+

59. RMLTC0026c-JSON

+

Title: "Two triples maps, both with rml:baseIRI defined"

+

Description: "Tests the generation of triples using relative IRIs with base IRIs defined only in triples maps, without base IRI parameter"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "persons": [
+    {"fname":"Bob","lname":"Smith","amount":30},
+    {"fname":"Sue","lname":"Jones","amount":20}
+  ]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:baseIRI <http://example.com/>;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.persons[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "persons.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.amount"
+        ];
+      rml:predicate ex:amount
+    ];
+  rml:subjectMap [
+      rml:template "{$.fname}"
+    ] .
+
+<http://example.com/base/TriplesMap2> a rml:TriplesMap;
+  rml:baseIRI <http://example.com/>;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.persons[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "persons.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.amount"
+        ];
+      rml:predicate ex:amount
+    ];
+  rml:subjectMap [
+      rml:template "{$.lname}"
+    ] .
+
+

Output

+
<http://example.com/Bob> <http://example.com/amount> "30"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.com/Jones> <http://example.com/amount> "20"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.com/Smith> <http://example.com/amount> "30"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.com/Sue> <http://example.com/amount> "20"^^<http://www.w3.org/2001/XMLSchema#integer> .
+
+
+

60. RMLTC0026d-JSON

+

Title: "Two triples maps,both with rml:bseIRI defined and baseIRI parameter defined"

+

Description: "Tests the generation of triples by with base IRIs different than the base IRI parameter"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "persons": [
+    {"fname":"Bob","lname":"Smith","amount":30},
+    {"fname":"Sue","lname":"Jones","amount":20}
+  ]
+}
+
+

Mapping

+
@prefix ex: <http://example.com/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:baseIRI <http://example2.com/>;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.persons[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "persons.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.amount"
+        ];
+      rml:predicate ex:amount
+    ];
+  rml:subjectMap [
+      rml:template "{$.fname}"
+    ] .
+
+<http://example.com/base/TriplesMap2> a rml:TriplesMap;
+  rml:baseIRI <http://example2.com/>;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.persons[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "persons.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:objectMap [
+          rml:reference "$.amount"
+        ];
+      rml:predicate ex:amount
+    ];
+  rml:subjectMap [
+      rml:template "{$.lname}"
+    ] .
+
+

Output

+
<http://example2.com/Bob> <http://example.com/amount> "30"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example2.com/Jones> <http://example.com/amount> "20"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example2.com/Smith> <http://example.com/amount> "30"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example2.com/Sue> <http://example.com/amount> "20"^^<http://www.w3.org/2001/XMLSchema#integer> .
+
+
+

61. RMLTC0027a-JSON

+

Title: "Generation of triples using the URI term type"

+

Description: "Tests the generation of triples with a URI term type in the subject or object"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "students": [
+    {"Name": "Alice"},
+    {"Name": "Bob"},
+    {"Name": "Bob/Charles"},
+    {"Name": "Danny"},
+    {"Name": "Emily Smith"}
+  ]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:object foaf:Person;
+      rml:predicate rdf:type
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Person/{$.Name}";
+      rml:termType rml:URI
+    ] .
+
+

Output

+
<http://example.com/Person/Alice> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Person/Bob> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Person/Bob%2FCharles> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Person/Danny> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Person/Emily%20Smith> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+
+
+

62. RMLTC0027b-JSON

+

Title: "Generation of triples using the UnsafeURI term type"

+

Description: "Tests the generation of triples with a UnsafeURI term type in the subject or object"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "students": [
+    {"Name": "Alice"},
+    {"Name": "Bob"},
+    {"Name": "Bob/Charles"},
+    {"Name": "Danny"},
+    {"Name": "Emily Smith"}
+  ]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:object foaf:Person;
+      rml:predicate rdf:type
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Person/{$.Name}";
+      rml:termType rml:UnsafeURI
+    ] .
+
+

Output

+
<http://example.com/Person/Alice> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Person/Bob> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Person/Bob%2FCharles> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Person/Danny> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Person/Emily%20Smith> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+
+
+

63. RMLTC0027c-JSON

+

Title: "Generation of triples using the UnsafeIRI term type"

+

Description: "Tests the generation of triples with a UnsafeIRI term type in the subject or object"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
{
+  "students": [
+    {"Name": "Alice"},
+    {"Name": "Bob"},
+    {"Name": "Bob/Charles"},
+    {"Name": "Danny"},
+    {"Name": "Emily Smith"}
+  ]
+}
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+      rml:iterator "$.students[*]";
+      rml:referenceFormulation rml:JSONPath;
+      rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.json"
+        ]
+    ];
+  rml:predicateObjectMap [
+      rml:object foaf:Person;
+      rml:predicate rdf:type
+    ];
+  rml:subjectMap [
+      rml:template "http://example.com/Person/{$.Name}";
+      rml:termType rml:UnsafeIRI
+    ] .
+
+

Output

+
<http://example.com/Person/Alice> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Person/Bob> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Person/Bob%2FCharles> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Person/Danny> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<http://example.com/Person/Emily%20Smith> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+
+
+

64. RMLTC0028a-JSON

+

Title: "Generation of the right datatype for a constant in the mapping"

+

Description: "Test the honoring of the datatype specified by the constant term in the mapping"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
[ { "id": "0", "foo": "bar"  } ] 
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+    rml:logicalSource [
+      rml:referenceFormulation rml:JSONPath ;
+      rml:iterator "$[*]";
+      rml:source [ a rml:RelativePathSource;
+        rml:root rml:MappingDirectory;
+        rml:path "data.json"
+      ]
+    ];
+    rml:subjectMap [
+      rml:template "https://example.org/instances/{id}";
+    ];
+    rml:predicateObjectMap [
+      rml:predicate <http://example.org/ns/p> ;
+      rml:object true ; # datatype is boolean
+    ] .
+
+

Output

+
<https://example.org/instances/0> <http://example.org/ns/p> "true"^^<http://www.w3.org/2001/XMLSchema#boolean> .
+
+
+

65. RMLTC0028b-JSON

+

Title: "Generation of all named graphs when rml:defaultGraph is involved"

+

Description: "Test if the default graph is also generated correctly."

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
[ { "id": "0", "name": "Alice"  } ] 
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix s: <http://schema.org/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+    rml:logicalSource [
+      rml:referenceFormulation rml:JSONPath ;
+      rml:iterator "$[*]";
+      rml:source [ a rml:RelativePathSource;
+        rml:root rml:MappingDirectory;
+        rml:path "data.json"
+      ]
+    ];
+    rml:subjectMap [
+      rml:template "https://example.org/instances/{id}";
+      rml:class s:Person ;
+      rml:graph <graph:1> ;
+    ];
+    rml:predicateObjectMap [
+      rml:predicate s:givenName ;
+      rml:objectMap [ rml:reference "name" ] ;
+      rml:graph rml:defaultGraph ;
+    ].
+
+

Output

+
<https://example.org/instances/0> <http://schema.org/givenName> "Alice".
+<https://example.org/instances/0> <http://schema.org/givenName> "Alice" <graph:1> .
+<https://example.org/instances/0> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://schema.org/Person> <graph:1> .
+
+
+

66. RMLTC0028c-JSON

+

Title: "Generation of the right language tag for a constant in the mapping"

+

Description: "Test the honoring of the language tag specified by the constant term in the mapping"

+

Default Base IRI: http://example.com/

+

Error expected? No

+

Input

+
[ { "id": "0", "foo": "bar"  } ] 
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+
+<http://example.com/base/TriplesMap1> a rml:TriplesMap;
+    rml:logicalSource [
+      rml:referenceFormulation rml:JSONPath ;
+      rml:iterator "$[*]";
+      rml:source [ a rml:RelativePathSource;
+        rml:root rml:MappingDirectory;
+        rml:path "data.json"
+      ]
+    ];
+    rml:subjectMap [
+      rml:template "https://example.org/instances/{id}";
+    ];
+    rml:predicateObjectMap [
+      rml:predicate <http://example.org/ns/p> ;
+      rml:object "train"@en ;
+    ] .
+
+

Output

+
<https://example.org/instances/0> <http://example.org/ns/p> "train"@en .
+
+
+ + + + + \ No newline at end of file diff --git a/src/test/resources/rml-core/list.sh b/src/test/resources/rml-core/list.sh new file mode 100755 index 00000000..12c32031 --- /dev/null +++ b/src/test/resources/rml-core/list.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +for i in RML*; do + echo "
" +done diff --git a/src/test/resources/rml-core/make-metadata.py b/src/test/resources/rml-core/make-metadata.py new file mode 100755 index 00000000..48374aac --- /dev/null +++ b/src/test/resources/rml-core/make-metadata.py @@ -0,0 +1,180 @@ +#!/usr/bin/env python3 + +import os +import sys +import glob +import csv + +def get_title_description(testcase: str): + with open ('descriptions.csv') as csvfile: + reader = csv.reader(csvfile) + for row in reader: + if row[0] == testcase: + return row[1], row[2] + print(f'{testcase} not found in descriptions.csv') + sys.exit(1) + +def main(spec: str): + with open ('metadata.csv', 'w') as csvfile: + writer = csv.writer(csvfile) + writer.writerow(['ID', 'title', 'description', 'specification','base_iri', + 'mapping', 'input_format1', 'input_format2', + 'input_format3', 'output_format1', 'output_format2', + 'output_format3', 'input1', 'input2', 'input3', + 'output1', 'output2', 'output3', 'error']) + testcases = sorted(glob.glob("RML*")) + for testcase in testcases: + print(f'Generating the description of {testcase}') + title, description = get_title_description(testcase) + title = '"' + title + '"' + description = '"' + description + '"' + error = 'false' + base_iri = 'http://example.org/' + input1 = '' + input2 = '' + input3 = '' + input_format1 = '' + input_format2 = '' + input_format3 = '' + output1 = '' + output2 = '' + output3 = '' + output_format1 = '' + output_format2 = '' + output_format3 = '' + + # Input file + if os.path.exists(os.path.join(testcase, 'student.json')): + input1 = 'student.json' + input_format1 = 'application/json' + + if os.path.exists(os.path.join(testcase, 'student_sport.json')): + if testcase == 'RMLTC0009a-JSON' or testcase == 'RMLTC0009b-JSON' or testcase == 'RMLTC0011b-JSON': + input3 = 'student_sport.json' + input_format3 = 'application/json' + else: + input1 = 'student_sport.json' + input_format1 = 'application/json' + if os.path.exists(os.path.join(testcase, 'sport.json')): + input2 = 'sport.json' + input_format2 = 'application/json' + if os.path.exists(os.path.join(testcase, 'ious.json')): + input1 = 'ious.json' + input_format1 = 'application/json' + if os.path.exists(os.path.join(testcase, 'country_info.json')): + input1 = 'country_info.json' + input_format1 = 'application/json' + if os.path.exists(os.path.join(testcase, 'persons.json')): + if testcase == 'RMLTC0012b-JSON': + input2 = 'persons.json' + input_format2 = 'application/json' + else: + input1 = 'persons.json' + input_format1 = 'application/json' + if os.path.exists(os.path.join(testcase, 'country_en.json')): + input1 = 'country_en.json' + input_format1 = 'application/json' + if os.path.exists(os.path.join(testcase, 'country_es.json')): + input1 = 'country_es.json' + input_format1 = 'application/json' + if os.path.exists(os.path.join(testcase, 'data.json')): + input1 = 'data.json' + input_format1 = 'application/json' + if os.path.exists(os.path.join(testcase, 'lives.json')): + input1 = 'lives.json' + input_format1 = 'application/json' + + #print(input1, input2, input3) + + # Mapping file + if os.path.exists(os.path.join(testcase, 'mapping.ttl')): + mapping_file = 'mapping.ttl' + else: + raise ValueError('Mapping file missing!') + + # Output files + if os.path.exists(os.path.join(testcase, 'output.nq')): + output1 = 'output.nq' + output_format1 = 'application/n-quads' + else: + error = 'true' + + writer.writerow([testcase, title, description, spec, base_iri, mapping_file, + input_format1, input_format2, input_format3, + output_format1, output_format2, output_format3, + input1, input2, input3, output1, output2, + output3, error]) + lines = [] + # Title and description + lines.append(f'## {testcase}\n\n') + lines.append(f'**Title**: {title}\n\n') + lines.append(f'**Description**: {description}\n\n') + lines.append(f'**Default Base IRI**: http://example.com/\n\n') + if error == 'true': + error_html = 'Yes' + else: + error_html = 'No' + lines.append(f'**Error expected?** {error_html}\n\n') + + # Input + inputCount = '' + + for index, i in enumerate([input1, input2, input3]): + if not i: + break + + if 'http://w3id.org/rml/resources' in i: + input_html = f'**Input{inputCount}**\n [{i}]({i})\n\n' + else: + try: + with open(os.path.join(testcase, i)) as f: + input_html = f'**Input{inputCount}**\n```\n{f.read()}\n```\n\n' + except UnicodeDecodeError: + try: + with open(os.path.join(testcase, i), encoding='utf-16') as f: + input_html = f'**Input{inputCount}**\n```\n{f.read()}\n```\n\n' + except UnicodeDecodeError: + input_html = f'**Input{inputCount}**\n `{i}`\n\n' + + lines.append(input_html) + inputCount = f' {index + 1}' + + # Mapping + with open(os.path.join(testcase, mapping_file)) as f: + mapping_html = f'**Mapping**\n```\n{f.read()}\n```\n\n' + lines.append(mapping_html) + + # Output + outputCount = '' + if output2 or output3: + outputCount = ' 1' + + for index, i in enumerate([output1, output2, output3]): + if not i: + break + + if 'http://w3id.org/rml/resources' in i: + output_html = f'**Output{outputCount}**\n [{i}]({i})\n\n' + else: + try: + with open(os.path.join(testcase, i)) as f: + output_html = f'**Output{outputCount}**\n```\n{f.read()}\n```\n\n' + except UnicodeDecodeError: + try: + with open(os.path.join(testcase, i), encoding='utf-16') as f: + output_html = f'**Output{outputCount}**\n```\n{f.read()}\n```\n\n' + except UnicodeDecodeError: + output_html = f'**Output{outputCount}**\n `{i}`\n\n' + + lines.append(output_html) + outputCount = f' {index + 2}' + + + with open(os.path.join(testcase, 'README.md'), 'w') as f: + f.writelines(lines) + +if __name__ == '__main__': + if len(sys.argv) != 2: + print('Usage: ./make-metadata.py ') + sys.exit(1) + main(sys.argv[1]) diff --git a/src/test/resources/rml-core/manifest.rml.ttl b/src/test/resources/rml-core/manifest.rml.ttl new file mode 100644 index 00000000..9f6175d1 --- /dev/null +++ b/src/test/resources/rml-core/manifest.rml.ttl @@ -0,0 +1,274 @@ +@prefix xsd: . +@prefix dcterms: . +@prefix rml: . +@prefix rmltest: . +@prefix test: . +@base . + +# java -jar .\burp.jar -m manifest.rml.ttl -o manifest.ttl -b http://w3id.org/rml/core/test/ + +_:source + rml:source [ + a rml:RelativePathSource ; + rml:path "metadata.csv" ; + rml:null ""; + ]; + rml:referenceFormulation rml:CSV; +. + +<#TriplesMapTestcase> + a rml:TriplesMap; + + rml:logicalSource _:source; + + rml:subjectMap [ + rml:reference "ID"; + rml:class test:TestCase; + ]; + + rml:predicateObjectMap [ + rml:predicate dcterms:identifier; + rml:objectMap [ + rml:reference "ID"; + ]; + ]; + + rml:predicateObjectMap [ + rml:predicate rmltest:hasError; + rml:objectMap [ + rml:reference "error"; + rml:datatype xsd:boolean; + ]; + ]; + + rml:predicateObjectMap [ + rml:predicate rmltest:mappingDocument; + rml:objectMap [ + rml:reference "mapping"; + ]; + ]; + + rml:predicateObjectMap [ + rml:predicate rmltest:defaultBaseIRI; + rml:objectMap [ + rml:constant ; + ]; + ]; + + rml:predicateObjectMap [ + rml:predicate rmltest:input; + rml:objectMap [ a rml:RefObjectMap; + rml:parentTriplesMap <#TriplesMapInput1>; + rml:joinCondition [ + rml:child "ID"; + rml:parent "ID"; + ]; + ]; + ]; + + rml:predicateObjectMap [ + rml:predicate rmltest:input; + rml:objectMap [ a rml:RefObjectMap; + rml:parentTriplesMap <#TriplesMapInput2>; + rml:joinCondition [ + rml:child "ID"; + rml:parent "ID"; + ]; + ]; + ]; + + rml:predicateObjectMap [ + rml:predicate rmltest:input; + rml:objectMap [ a rml:RefObjectMap; + rml:parentTriplesMap <#TriplesMapInput3>; + rml:joinCondition [ + rml:child "ID"; + rml:parent "ID"; + ]; + ]; + ]; + + rml:predicateObjectMap [ + rml:predicate rmltest:output; + rml:objectMap [ a rml:RefObjectMap; + rml:parentTriplesMap <#TriplesMapOutput1>; + rml:joinCondition [ + rml:child "ID"; + rml:parent "ID"; + ]; + ]; + ]; + + rml:predicateObjectMap [ + rml:predicate rmltest:output; + rml:objectMap [ a rml:RefObjectMap; + rml:parentTriplesMap <#TriplesMapOutput2>; + rml:joinCondition [ + rml:child "ID"; + rml:parent "ID"; + ]; + ]; + ]; + + rml:predicateObjectMap [ + rml:predicate rmltest:output; + rml:objectMap [ a rml:RefObjectMap; + rml:parentTriplesMap <#TriplesMapOutput3>; + rml:joinCondition [ + rml:child "ID"; + rml:parent "ID"; + ]; + ]; + ]; +. + +<#TriplesMapInput1> + a rml:TriplesMap; + + rml:logicalSource _:source ; + + rml:subjectMap [ + rml:template "{ID}/input/{input1}"; + rml:class rmltest:Input; + ]; + + rml:predicateObjectMap [ + rml:predicate rmltest:input; + rml:objectMap [ + rml:reference "input1"; + ]; + ]; + + rml:predicateObjectMap [ + rml:predicate rmltest:inputFormat; + rml:objectMap [ + rml:reference "input_format1"; + ]; + ]; +. + +<#TriplesMapInput2> + a rml:TriplesMap; + + rml:logicalSource _:source; + + rml:subjectMap [ + rml:template "{ID}/input/{input2}"; + rml:class rmltest:Input; + ]; + + rml:predicateObjectMap [ + rml:predicate rmltest:input; + rml:objectMap [ + rml:reference "input2"; + ]; + ]; + + rml:predicateObjectMap [ + rml:predicate rmltest:inputFormat; + rml:objectMap [ + rml:reference "input_format2"; + ]; + ]; +. + +<#TriplesMapInput3> + a rml:TriplesMap; + + rml:logicalSource _:source; + + rml:subjectMap [ + rml:template "{ID}/input/{input3}"; + rml:class rmltest:Input; + ]; + + rml:predicateObjectMap [ + rml:predicate rmltest:input; + rml:objectMap [ + rml:reference "input3"; + ]; + ]; + + rml:predicateObjectMap [ + rml:predicate rmltest:inputFormat; + rml:objectMap [ + rml:reference "input_format3"; + ]; + ]; +. + +<#TriplesMapOutput1> + a rml:TriplesMap; + + rml:logicalSource _:source; + + rml:subjectMap [ + rml:template "{ID}/output/{output1}"; + rml:class rmltest:Output; + ]; + + rml:predicateObjectMap [ + rml:predicate rmltest:output; + rml:objectMap [ + rml:reference "output1"; + ]; + ]; + + rml:predicateObjectMap [ + rml:predicate rmltest:outputFormat; + rml:objectMap [ + rml:reference "output_format1"; + ]; + ]; +. + +<#TriplesMapOutput2> + a rml:TriplesMap; + + rml:logicalSource _:source; + + rml:subjectMap [ + rml:template "{ID}/output/{output2}"; + rml:class rmltest:Output; + ]; + + rml:predicateObjectMap [ + rml:predicate rmltest:output; + rml:objectMap [ + rml:reference "output2"; + ]; + ]; + + rml:predicateObjectMap [ + rml:predicate rmltest:outputFormat; + rml:objectMap [ + rml:reference "output_format2"; + ]; + ]; +. + +<#TriplesMapOutput3> + a rml:TriplesMap; + + rml:logicalSource _:source; + + rml:subjectMap [ + rml:template "{ID}/output/{output3}"; + rml:class rmltest:Output; + ]; + + rml:predicateObjectMap [ + rml:predicate rmltest:output; + rml:objectMap [ + rml:reference "output3"; + ]; + ]; + + rml:predicateObjectMap [ + rml:predicate rmltest:outputFormat; + rml:objectMap [ + rml:reference "output_format3"; + ]; + ]; +. + diff --git a/src/test/resources/rml-core/manifest.ttl b/src/test/resources/rml-core/manifest.ttl index dbde3f27..a5ed034d 100644 --- a/src/test/resources/rml-core/manifest.ttl +++ b/src/test/resources/rml-core/manifest.ttl @@ -1,3371 +1,779 @@ -@base . -@prefix dcterms: . -@prefix rmltest: . -@prefix test: . - - a test:TestCase; - dcterms:identifier "RMLTC0000-CSV"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:inputFile "student.csv"; - rmltest:inputType "CSV" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0000-JSON"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:inputFile "student.json"; - rmltest:inputType "JSON" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0000-MySQL"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:database [ - rmltest:sqlScriptFile "resource.sql" - ]; - rmltest:inputType "MySQL" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0000-PostgreSQL"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:database [ - rmltest:sqlScriptFile "resource.sql" - ]; - rmltest:inputType "PostgreSQL" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0000-SPARQL"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:inputType "SPARQL"; - rmltest:tripleStore [ - rmltest:rdfFile "resource.ttl" - ] - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0000-SQLServer"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:inputType "SQLServer" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0000-XML"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:inputFile "student.xml"; - rmltest:inputType "XML" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0001a-CSV"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:inputFile "student.csv"; - rmltest:inputType "CSV" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0001a-JSON"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:inputFile "student.json"; - rmltest:inputType "JSON" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0001a-MySQL"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:database [ - rmltest:sqlScriptFile "resource.sql" - ]; - rmltest:inputType "MySQL" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0001a-PostgreSQL"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:database [ - rmltest:sqlScriptFile "resource.sql" - ]; - rmltest:inputType "PostgreSQL" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0001a-SPARQL"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:inputType "SPARQL"; - rmltest:tripleStore [ - rmltest:rdfFile "resource.ttl" - ] - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0001a-SQLServer"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:inputType "SQLServer" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0001a-XML"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:inputFile "student.xml"; - rmltest:inputType "XML" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0001b-CSV"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:inputFile "student.csv"; - rmltest:inputType "CSV" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0001b-JSON"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:inputFile "student.json"; - rmltest:inputType "JSON" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0001b-MySQL"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:database [ - rmltest:sqlScriptFile "resource.sql" - ]; - rmltest:inputType "MySQL" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0001b-PostgreSQL"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:database [ - rmltest:sqlScriptFile "resource.sql" - ]; - rmltest:inputType "PostgreSQL" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0001b-SPARQL"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:inputType "SPARQL"; - rmltest:tripleStore [ - rmltest:rdfFile "resource.ttl" - ] - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0001b-SQLServer"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:inputType "SQLServer" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0001b-XML"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:inputFile "student.xml"; - rmltest:inputType "XML" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0002a-CSV"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:inputFile "student.csv"; - rmltest:inputType "CSV" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0002a-JSON"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:inputFile "student.json"; - rmltest:inputType "JSON" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0002a-MySQL"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:database [ - rmltest:sqlScriptFile "resource.sql" - ]; - rmltest:inputType "MySQL" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0002a-PostgreSQL"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:database [ - rmltest:sqlScriptFile "resource.sql" - ]; - rmltest:inputType "PostgreSQL" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0002a-SPARQL"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:inputType "SPARQL"; - rmltest:tripleStore [ - rmltest:rdfFile "resource.ttl" - ] - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0002a-SQLServer"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:inputType "SQLServer" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0002a-XML"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:inputFile "student.xml"; - rmltest:inputType "XML" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0002b-CSV"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:inputFile "student.csv"; - rmltest:inputType "CSV" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0002b-JSON"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:inputFile "student.json"; - rmltest:inputType "JSON" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0002b-MySQL"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:database [ - rmltest:sqlScriptFile "resource.sql" - ]; - rmltest:inputType "MySQL" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0002b-PostgreSQL"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:database [ - rmltest:sqlScriptFile "resource.sql" - ]; - rmltest:inputType "PostgreSQL" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0002b-SPARQL"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:inputType "SPARQL"; - rmltest:tripleStore [ - rmltest:rdfFile "resource.ttl" - ] - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0002b-SQLServer"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:inputType "SQLServer" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0002b-XML"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:inputFile "student.xml"; - rmltest:inputType "XML" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0002c-CSV"; - rmltest:input [ - rmltest:inputFile "student.csv"; - rmltest:inputType "CSV" - ]; - rmltest:mappingDocument "mapping.ttl" . - - a test:TestCase; - dcterms:identifier "RMLTC0002c-MySQL"; - rmltest:input [ - rmltest:database [ - rmltest:sqlScriptFile "resource.sql" - ]; - rmltest:inputType "MySQL" - ]; - rmltest:mappingDocument "mapping.ttl" . - - a test:TestCase; - dcterms:identifier "RMLTC0002c-PostgreSQL"; - rmltest:input [ - rmltest:database [ - rmltest:sqlScriptFile "resource.sql" - ]; - rmltest:inputType "PostgreSQL" - ]; - rmltest:mappingDocument "mapping.ttl" . - - a test:TestCase; - dcterms:identifier "RMLTC0002c-SQLServer"; - rmltest:input [ - rmltest:inputType "SQLServer" - ]; - rmltest:mappingDocument "mapping.ttl" . - - a test:TestCase; - dcterms:identifier "RMLTC0002d-MySQL"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:database [ - rmltest:sqlScriptFile "resource.sql" - ]; - rmltest:inputType "MySQL" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0002d-PostgreSQL"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:database [ - rmltest:sqlScriptFile "resource.sql" - ]; - rmltest:inputType "PostgreSQL" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0002d-SQLServer"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:inputType "SQLServer" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0002e-CSV"; - rmltest:input [ - rmltest:inputFile "student.csv"; - rmltest:inputType "CSV" - ]; - rmltest:mappingDocument "mapping.ttl" . - - a test:TestCase; - dcterms:identifier "RMLTC0002e-JSON"; - rmltest:input [ - rmltest:inputFile "student.json"; - rmltest:inputType "JSON" - ]; - rmltest:mappingDocument "mapping.ttl" . - - a test:TestCase; - dcterms:identifier "RMLTC0002e-MySQL"; - rmltest:input [ - rmltest:database [ - rmltest:sqlScriptFile "resource.sql" - ]; - rmltest:inputType "MySQL" - ]; - rmltest:mappingDocument "mapping.ttl" . - - a test:TestCase; - dcterms:identifier "RMLTC0002e-PostgreSQL"; - rmltest:input [ - rmltest:database [ - rmltest:sqlScriptFile "resource.sql" - ]; - rmltest:inputType "PostgreSQL" - ]; - rmltest:mappingDocument "mapping.ttl" . - - a test:TestCase; - dcterms:identifier "RMLTC0002e-SQLServer"; - rmltest:input [ - rmltest:inputType "SQLServer" - ]; - rmltest:mappingDocument "mapping.ttl" . - - a test:TestCase; - dcterms:identifier "RMLTC0002e-XML"; - rmltest:input [ - rmltest:inputFile "student.xml"; - rmltest:inputType "XML" - ]; - rmltest:mappingDocument "mapping.ttl" . - - a test:TestCase; - dcterms:identifier "RMLTC0002f-MySQL"; - rmltest:input [ - rmltest:database [ - rmltest:sqlScriptFile "resource.sql" - ]; - rmltest:inputType "MySQL" - ]; - rmltest:mappingDocument "mapping.ttl" . - - a test:TestCase; - dcterms:identifier "RMLTC0002f-PostgreSQL"; - rmltest:input [ - rmltest:database [ - rmltest:sqlScriptFile "resource.sql" - ]; - rmltest:inputType "PostgreSQL" - ]; - rmltest:mappingDocument "mapping.ttl" . - - a test:TestCase; - dcterms:identifier "RMLTC0002f-SQLServer"; - rmltest:input [ - rmltest:inputType "SQLServer" - ]; - rmltest:mappingDocument "mapping.ttl" . - - a test:TestCase; - dcterms:identifier "RMLTC0002g-JSON"; - rmltest:input [ - rmltest:inputFile "student.json"; - rmltest:inputType "JSON" - ]; - rmltest:mappingDocument "mapping.ttl" . - - a test:TestCase; - dcterms:identifier "RMLTC0002g-MySQL"; - rmltest:input [ - rmltest:database [ - rmltest:sqlScriptFile "resource.sql" - ]; - rmltest:inputType "MySQL" - ]; - rmltest:mappingDocument "mapping.ttl" . - - a test:TestCase; - dcterms:identifier "RMLTC0002g-PostgreSQL"; - rmltest:input [ - rmltest:database [ - rmltest:sqlScriptFile "resource.sql" - ]; - rmltest:inputType "PostgreSQL" - ]; - rmltest:mappingDocument "mapping.ttl" . - - a test:TestCase; - dcterms:identifier "RMLTC0002g-SPARQL"; - rmltest:input [ - rmltest:inputType "SPARQL"; - rmltest:tripleStore [ - rmltest:rdfFile "resource.ttl" - ] - ]; - rmltest:mappingDocument "mapping.ttl" . - - a test:TestCase; - dcterms:identifier "RMLTC0002g-SQLServer"; - rmltest:input [ - rmltest:inputType "SQLServer" - ]; - rmltest:mappingDocument "mapping.ttl" . - - a test:TestCase; - dcterms:identifier "RMLTC0002h-MySQL"; - rmltest:input [ - rmltest:database [ - rmltest:sqlScriptFile "resource.sql" - ]; - rmltest:inputType "MySQL" - ]; - rmltest:mappingDocument "mapping.ttl" . - - a test:TestCase; - dcterms:identifier "RMLTC0002h-PostgreSQL"; - rmltest:input [ - rmltest:database [ - rmltest:sqlScriptFile "resource.sql" - ]; - rmltest:inputType "PostgreSQL" - ]; - rmltest:mappingDocument "mapping.ttl" . - - a test:TestCase; - dcterms:identifier "RMLTC0002h-SPARQL"; - rmltest:input [ - rmltest:inputType "SPARQL"; - rmltest:tripleStore [ - rmltest:rdfFile "resource.ttl" - ] - ]; - rmltest:mappingDocument "mapping.ttl" . - - a test:TestCase; - dcterms:identifier "RMLTC0002h-SQLServer"; - rmltest:input [ - rmltest:inputType "SQLServer" - ]; - rmltest:mappingDocument "mapping.ttl" . - - a test:TestCase; - dcterms:identifier "RMLTC0002i-MySQL"; - rmltest:input [ - rmltest:database [ - rmltest:sqlScriptFile "resource.sql" - ]; - rmltest:inputType "MySQL" - ]; - rmltest:mappingDocument "mapping.ttl" . - - a test:TestCase; - dcterms:identifier "RMLTC0002i-PostgreSQL"; - rmltest:input [ - rmltest:database [ - rmltest:sqlScriptFile "resource.sql" - ]; - rmltest:inputType "PostgreSQL" - ]; - rmltest:mappingDocument "mapping.ttl" . - - a test:TestCase; - dcterms:identifier "RMLTC0002i-SQLServer"; - rmltest:input [ - rmltest:inputType "SQLServer" - ]; - rmltest:mappingDocument "mapping.ttl" . - - a test:TestCase; - dcterms:identifier "RMLTC0002j-MySQL"; - rmltest:input [ - rmltest:database [ - rmltest:sqlScriptFile "resource.sql" - ]; - rmltest:inputType "MySQL" - ]; - rmltest:mappingDocument "mapping.ttl" . - - a test:TestCase; - dcterms:identifier "RMLTC0002j-PostgreSQL"; - rmltest:input [ - rmltest:database [ - rmltest:sqlScriptFile "resource.sql" - ]; - rmltest:inputType "PostgreSQL" - ]; - rmltest:mappingDocument "mapping.ttl" . - - a test:TestCase; - dcterms:identifier "RMLTC0002j-SQLServer"; - rmltest:input [ - rmltest:inputType "SQLServer" - ]; - rmltest:mappingDocument "mapping.ttl" . - - a test:TestCase; - dcterms:identifier "RMLTC0003a-MySQL"; - rmltest:input [ - rmltest:database [ - rmltest:sqlScriptFile "resource.sql" - ]; - rmltest:inputType "MySQL" - ]; - rmltest:mappingDocument "mapping.ttl" . - - a test:TestCase; - dcterms:identifier "RMLTC0003a-PostgreSQL"; - rmltest:input [ - rmltest:database [ - rmltest:sqlScriptFile "resource.sql" - ]; - rmltest:inputType "PostgreSQL" - ]; - rmltest:mappingDocument "mapping.ttl" . - - a test:TestCase; - dcterms:identifier "RMLTC0003a-SQLServer"; - rmltest:input [ - rmltest:inputType "SQLServer" - ]; - rmltest:mappingDocument "mapping.ttl" . - - a test:TestCase; - dcterms:identifier "RMLTC0003b-MySQL"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:database [ - rmltest:sqlScriptFile "resource.sql" - ]; - rmltest:inputType "MySQL" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0003b-PostgreSQL"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:database [ - rmltest:sqlScriptFile "resource.sql" - ]; - rmltest:inputType "PostgreSQL" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0003b-SQLServer"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:inputType "SQLServer" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0003c-CSV"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:inputFile "student.csv"; - rmltest:inputType "CSV" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0003c-JSON"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:inputFile "student.json"; - rmltest:inputType "JSON" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0003c-MySQL"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:database [ - rmltest:sqlScriptFile "resource.sql" - ]; - rmltest:inputType "MySQL" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0003c-PostgreSQL"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:database [ - rmltest:sqlScriptFile "resource.sql" - ]; - rmltest:inputType "PostgreSQL" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0003c-SPARQL"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:inputType "SPARQL"; - rmltest:tripleStore [ - rmltest:rdfFile "resource.ttl" - ] - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0003c-SQLServer"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:inputType "SQLServer" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0003c-XML"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:inputFile "student.xml"; - rmltest:inputType "XML" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0004a-CSV"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:inputFile "student_sport.csv"; - rmltest:inputType "CSV" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0004a-JSON"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:inputFile "student_sport.json"; - rmltest:inputType "JSON" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0004a-MySQL"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:database [ - rmltest:sqlScriptFile "resource.sql" - ]; - rmltest:inputType "MySQL" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0004a-PostgreSQL"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:database [ - rmltest:sqlScriptFile "resource.sql" - ]; - rmltest:inputType "PostgreSQL" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0004a-SPARQL"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:inputType "SPARQL"; - rmltest:tripleStore [ - rmltest:rdfFile "resource.ttl" - ] - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0004a-SQLServer"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:inputFile "student_sport.csv"; - rmltest:inputType "SQLServer" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0004a-XML"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:inputFile "student_sport.xml"; - rmltest:inputType "XML" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0004b-CSV"; - rmltest:input [ - rmltest:inputFile "student.csv"; - rmltest:inputType "CSV" - ]; - rmltest:mappingDocument "mapping.ttl" . - - a test:TestCase; - dcterms:identifier "RMLTC0004b-JSON"; - rmltest:input [ - rmltest:inputFile "student.json"; - rmltest:inputType "JSON" - ]; - rmltest:mappingDocument "mapping.ttl" . - - a test:TestCase; - dcterms:identifier "RMLTC0004b-MySQL"; - rmltest:input [ - rmltest:database [ - rmltest:sqlScriptFile "resource.sql" - ]; - rmltest:inputType "MySQL" - ]; - rmltest:mappingDocument "mapping.ttl" . - - a test:TestCase; - dcterms:identifier "RMLTC0004b-PostgreSQL"; - rmltest:input [ - rmltest:database [ - rmltest:sqlScriptFile "resource.sql" - ]; - rmltest:inputType "PostgreSQL" - ]; - rmltest:mappingDocument "mapping.ttl" . - - a test:TestCase; - dcterms:identifier "RMLTC0004b-SPARQL"; - rmltest:input [ - rmltest:inputType "SPARQL"; - rmltest:tripleStore [ - rmltest:rdfFile "resource.ttl" - ] - ]; - rmltest:mappingDocument "mapping.ttl" . - - a test:TestCase; - dcterms:identifier "RMLTC0004b-SQLServer"; - rmltest:input [ - rmltest:inputType "SQLServer" - ]; - rmltest:mappingDocument "mapping.ttl" . - - a test:TestCase; - dcterms:identifier "RMLTC0004b-XML"; - rmltest:input [ - rmltest:inputFile "student.xml"; - rmltest:inputType "XML" - ]; - rmltest:mappingDocument "mapping.ttl" . - - a test:TestCase; - dcterms:identifier "RMLTC0005a-CSV"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:inputFile "ious.csv"; - rmltest:inputType "CSV" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0005a-JSON"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:inputFile "ious.json"; - rmltest:inputType "JSON" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0005a-MySQL"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:database [ - rmltest:sqlScriptFile "resource.sql" - ]; - rmltest:inputType "MySQL" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0005a-PostgreSQL"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:database [ - rmltest:sqlScriptFile "resource.sql" - ]; - rmltest:inputType "PostgreSQL" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0005a-SQLServer"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:inputType "SQLServer" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0005a-XML"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:inputFile "ious.xml"; - rmltest:inputType "XML" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0005b-MySQL"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:database [ - rmltest:sqlScriptFile "resource.sql" - ]; - rmltest:inputType "MySQL" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0005b-PostgreSQL"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:database [ - rmltest:sqlScriptFile "resource.sql" - ]; - rmltest:inputType "PostgreSQL" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0005b-SQLServer"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:inputType "SQLServer" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0006a-CSV"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:inputFile "student.csv"; - rmltest:inputType "CSV" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0006a-JSON"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:inputFile "student.json"; - rmltest:inputType "JSON" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0006a-MySQL"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:database [ - rmltest:sqlScriptFile "resource.sql" - ]; - rmltest:inputType "MySQL" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0006a-PostgreSQL"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:database [ - rmltest:sqlScriptFile "resource.sql" - ]; - rmltest:inputType "PostgreSQL" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0006a-SPARQL"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:inputType "SPARQL"; - rmltest:tripleStore [ - rmltest:rdfFile "resource.ttl" - ] - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0006a-SQLServer"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:inputType "SQLServer" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0006a-XML"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:inputFile "student.xml"; - rmltest:inputType "XML" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0007a-CSV"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:inputFile "student.csv"; - rmltest:inputType "CSV" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0007a-JSON"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:inputFile "student.json"; - rmltest:inputType "JSON" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0007a-MySQL"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:database [ - rmltest:sqlScriptFile "resource.sql" - ]; - rmltest:inputType "MySQL" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0007a-PostgreSQL"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:database [ - rmltest:sqlScriptFile "resource.sql" - ]; - rmltest:inputType "PostgreSQL" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0007a-SPARQL"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:inputType "SPARQL"; - rmltest:tripleStore [ - rmltest:rdfFile "resource.ttl" - ] - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0007a-SQLServer"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:inputType "SQLServer" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0007a-XML"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:inputFile "student.xml"; - rmltest:inputType "XML" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0007b-CSV"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:inputFile "student.csv"; - rmltest:inputType "CSV" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0007b-JSON"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:inputFile "student.json"; - rmltest:inputType "JSON" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0007b-MySQL"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:database [ - rmltest:sqlScriptFile "resource.sql" - ]; - rmltest:inputType "MySQL" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0007b-PostgreSQL"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:database [ - rmltest:sqlScriptFile "resource.sql" - ]; - rmltest:inputType "PostgreSQL" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0007b-SPARQL"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:inputType "SPARQL"; - rmltest:tripleStore [ - rmltest:rdfFile "resource.ttl" - ] - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0007b-SQLServer"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:inputType "SQLServer" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0007b-XML"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:inputFile "student.xml"; - rmltest:inputType "XML" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0007c-CSV"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:inputFile "student.csv"; - rmltest:inputType "CSV" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0007c-JSON"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:inputFile "student.json"; - rmltest:inputType "JSON" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0007c-MySQL"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:database [ - rmltest:sqlScriptFile "resource.sql" - ]; - rmltest:inputType "MySQL" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0007c-PostgreSQL"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:database [ - rmltest:sqlScriptFile "resource.sql" - ]; - rmltest:inputType "PostgreSQL" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0007c-SPARQL"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:inputType "SPARQL"; - rmltest:tripleStore [ - rmltest:rdfFile "resource.ttl" - ] - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0007c-SQLServer"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:inputType "SQLServer" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0007c-XML"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:inputFile "student.xml"; - rmltest:inputType "XML" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0007d-CSV"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:inputFile "student.csv"; - rmltest:inputType "CSV" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0007d-JSON"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:inputFile "student.json"; - rmltest:inputType "JSON" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0007d-MySQL"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:database [ - rmltest:sqlScriptFile "resource.sql" - ]; - rmltest:inputType "MySQL" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0007d-PostgreSQL"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:database [ - rmltest:sqlScriptFile "resource.sql" - ]; - rmltest:inputType "PostgreSQL" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0007d-SPARQL"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:inputType "SPARQL"; - rmltest:tripleStore [ - rmltest:rdfFile "resource.ttl" - ] - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0007d-SQLServer"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:inputType "SQLServer" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0007d-XML"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:inputFile "student.xml"; - rmltest:inputType "XML" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0007e-CSV"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:inputFile "student.csv"; - rmltest:inputType "CSV" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0007e-JSON"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:inputFile "student.json"; - rmltest:inputType "JSON" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0007e-MySQL"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:database [ - rmltest:sqlScriptFile "resource.sql" - ]; - rmltest:inputType "MySQL" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0007e-PostgreSQL"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:database [ - rmltest:sqlScriptFile "resource.sql" - ]; - rmltest:inputType "PostgreSQL" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0007e-SPARQL"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:inputType "SPARQL"; - rmltest:tripleStore [ - rmltest:rdfFile "resource.ttl" - ] - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0007e-SQLServer"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:inputType "SQLServer" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0007e-XML"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:inputFile "student.xml"; - rmltest:inputType "XML" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0007f-CSV"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:inputFile "student.csv"; - rmltest:inputType "CSV" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0007f-JSON"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:inputFile "student.json"; - rmltest:inputType "JSON" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0007f-MySQL"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:database [ - rmltest:sqlScriptFile "resource.sql" - ]; - rmltest:inputType "MySQL" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0007f-PostgreSQL"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:database [ - rmltest:sqlScriptFile "resource.sql" - ]; - rmltest:inputType "PostgreSQL" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0007f-SPARQL"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:inputType "SPARQL"; - rmltest:tripleStore [ - rmltest:rdfFile "resource.ttl" - ] - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0007f-SQLServer"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:inputType "SQLServer" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0007f-XML"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:inputFile "student.xml"; - rmltest:inputType "XML" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0007g-CSV"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:inputFile "student.csv"; - rmltest:inputType "CSV" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0007g-JSON"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:inputFile "student.json"; - rmltest:inputType "JSON" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0007g-MySQL"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:database [ - rmltest:sqlScriptFile "resource.sql" - ]; - rmltest:inputType "MySQL" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0007g-PostgreSQL"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:database [ - rmltest:sqlScriptFile "resource.sql" - ]; - rmltest:inputType "PostgreSQL" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0007g-SPARQL"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:inputType "SPARQL"; - rmltest:tripleStore [ - rmltest:rdfFile "resource.ttl" - ] - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0007g-SQLServer"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:inputType "SQLServer" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0007g-XML"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:inputFile "student.xml"; - rmltest:inputType "XML" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0007h-CSV"; - rmltest:input [ - rmltest:inputFile "student.csv"; - rmltest:inputType "CSV" - ]; - rmltest:mappingDocument "mapping.ttl" . - - a test:TestCase; - dcterms:identifier "RMLTC0007h-JSON"; - rmltest:input [ - rmltest:inputFile "student.json"; - rmltest:inputType "JSON" - ]; - rmltest:mappingDocument "mapping.ttl" . - - a test:TestCase; - dcterms:identifier "RMLTC0007h-MySQL"; - rmltest:input [ - rmltest:database [ - rmltest:sqlScriptFile "resource.sql" - ]; - rmltest:inputType "MySQL" - ]; - rmltest:mappingDocument "mapping.ttl" . - - a test:TestCase; - dcterms:identifier "RMLTC0007h-PostgreSQL"; - rmltest:input [ - rmltest:database [ - rmltest:sqlScriptFile "resource.sql" - ]; - rmltest:inputType "PostgreSQL" - ]; - rmltest:mappingDocument "mapping.ttl" . - - a test:TestCase; - dcterms:identifier "RMLTC0007h-SPARQL"; - rmltest:input [ - rmltest:inputType "SPARQL"; - rmltest:tripleStore [ - rmltest:rdfFile "resource.ttl" - ] - ]; - rmltest:mappingDocument "mapping.ttl" . - - a test:TestCase; - dcterms:identifier "RMLTC0007h-SQLServer"; - rmltest:input [ - rmltest:inputType "SQLServer" - ]; - rmltest:mappingDocument "mapping.ttl" . - - a test:TestCase; - dcterms:identifier "RMLTC0007h-XML"; - rmltest:input [ - rmltest:inputFile "student.xml"; - rmltest:inputType "XML" - ]; - rmltest:mappingDocument "mapping.ttl" . - - a test:TestCase; - dcterms:identifier "RMLTC0008a-CSV"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:inputFile "student.csv"; - rmltest:inputType "CSV" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0008a-JSON"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:inputFile "student.json"; - rmltest:inputType "JSON" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0008a-MySQL"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:database [ - rmltest:sqlScriptFile "resource.sql" - ]; - rmltest:inputType "MySQL" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0008a-PostgreSQL"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:database [ - rmltest:sqlScriptFile "resource.sql" - ]; - rmltest:inputType "PostgreSQL" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0008a-SPARQL"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:inputType "SPARQL"; - rmltest:tripleStore [ - rmltest:rdfFile "resource.ttl" - ] - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0008a-SQLServer"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:inputType "SQLServer" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0008a-XML"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:inputFile "student.xml"; - rmltest:inputType "XML" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0008b-CSV"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:inputFile "student.csv"; - rmltest:inputType "CSV" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0008b-JSON"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:inputFile "student.json"; - rmltest:inputType "JSON" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0008b-MySQL"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:database [ - rmltest:sqlScriptFile "resource.sql" - ]; - rmltest:inputType "MySQL" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0008b-PostgreSQL"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:database [ - rmltest:sqlScriptFile "resource.sql" - ]; - rmltest:inputType "PostgreSQL" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0008b-SPARQL"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:inputType "SPARQL"; - rmltest:tripleStore [ - rmltest:rdfFile "resource.ttl" - ] - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0008b-SQLServer"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:inputType "SQLServer" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0008b-XML"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:inputFile "student.xml"; - rmltest:inputType "XML" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0008c-CSV"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:inputFile "student.csv"; - rmltest:inputType "CSV" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0008c-JSON"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:inputFile "student.json"; - rmltest:inputType "JSON" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0008c-MySQL"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:database [ - rmltest:sqlScriptFile "resource.sql" - ]; - rmltest:inputType "MySQL" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0008c-PostgreSQL"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:database [ - rmltest:sqlScriptFile "resource.sql" - ]; - rmltest:inputType "PostgreSQL" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0008c-SPARQL"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:inputType "SPARQL"; - rmltest:tripleStore [ - rmltest:rdfFile "resource.ttl" - ] - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0008c-SQLServer"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:inputType "SQLServer" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0008c-XML"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:inputFile "student.xml"; - rmltest:inputType "XML" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0009a-CSV"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:inputFile "sport.csv", "student.csv"; - rmltest:inputType "CSV" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0009a-JSON"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:inputFile "sport.json", "student.json"; - rmltest:inputType "JSON" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0009a-MySQL"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:database [ - rmltest:sqlScriptFile "resource.sql" - ]; - rmltest:inputType "MySQL" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0009a-PostgreSQL"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:database [ - rmltest:sqlScriptFile "resource.sql" - ]; - rmltest:inputType "PostgreSQL" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0009a-SPARQL"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:inputType "SPARQL"; - rmltest:tripleStore [ - rmltest:rdfFile "resource1.ttl", "resource2.ttl" - ] - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0009a-SQLServer"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:inputType "SQLServer" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0009a-XML"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:inputFile "sport.xml", "student.xml"; - rmltest:inputType "XML" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0009b-CSV"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:inputFile "sport.csv", "student.csv"; - rmltest:inputType "CSV" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0009b-JSON"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:inputFile "sport.json", "student.json"; - rmltest:inputType "JSON" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0009b-MySQL"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:database [ - rmltest:sqlScriptFile "resource.sql" - ]; - rmltest:inputType "MySQL" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0009b-PostgreSQL"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:database [ - rmltest:sqlScriptFile "resource.sql" - ]; - rmltest:inputType "PostgreSQL" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0009b-SPARQL"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:inputType "SPARQL"; - rmltest:tripleStore [ - rmltest:rdfFile "resource1.ttl", "resource2.ttl" - ] - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0009b-SQLServer"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:inputType "SQLServer" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0009b-XML"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:inputFile "sport.xml", "student.xml"; - rmltest:inputType "XML" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0009c-MySQL"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:database [ - rmltest:sqlScriptFile "resource.sql" - ]; - rmltest:inputType "MySQL" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0009c-PostgreSQL"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:database [ - rmltest:sqlScriptFile "resource.sql" - ]; - rmltest:inputType "PostgreSQL" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0009c-SQLServer"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:inputType "SQLServer" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0009d-MySQL"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:database [ - rmltest:sqlScriptFile "resource.sql" - ]; - rmltest:inputType "MySQL" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0009d-PostgreSQL"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:database [ - rmltest:sqlScriptFile "resource.sql" - ]; - rmltest:inputType "PostgreSQL" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0009d-SQLServer"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:inputType "SQLServer" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0010a-CSV"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:inputFile "country_info.csv"; - rmltest:inputType "CSV" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0010a-JSON"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:inputFile "country_info.json"; - rmltest:inputType "JSON" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0010a-MySQL"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:database [ - rmltest:sqlScriptFile "resource.sql" - ]; - rmltest:inputType "MySQL" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0010a-PostgreSQL"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:database [ - rmltest:sqlScriptFile "resource.sql" - ]; - rmltest:inputType "PostgreSQL" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0010a-SQLServer"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:inputType "SQLServer" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0010b-CSV"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:inputFile "country_info.csv"; - rmltest:inputType "CSV" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0010b-JSON"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:inputFile "country_info.json"; - rmltest:inputType "JSON" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0010b-MySQL"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:database [ - rmltest:sqlScriptFile "resource.sql" - ]; - rmltest:inputType "MySQL" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0010b-PostgreSQL"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:database [ - rmltest:sqlScriptFile "resource.sql" - ]; - rmltest:inputType "PostgreSQL" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0010b-SQLServer"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:inputType "SQLServer" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0010b-XML"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:inputFile "country_info.xml"; - rmltest:inputType "XML" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0010c-CSV"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:inputFile "country_info.csv"; - rmltest:inputType "CSV" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0010c-JSON"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:inputFile "country_info.json"; - rmltest:inputType "JSON" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0010c-MySQL"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:database [ - rmltest:sqlScriptFile "resource.sql" - ]; - rmltest:inputType "MySQL" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0010c-PostgreSQL"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:database [ - rmltest:sqlScriptFile "resource.sql" - ]; - rmltest:inputType "PostgreSQL" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0010c-SQLServer"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:inputType "SQLServer" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0010c-XML"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:inputFile "country_info.xml"; - rmltest:inputType "XML" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0011a-MySQL"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:database [ - rmltest:sqlScriptFile "resource.sql" - ]; - rmltest:inputType "MySQL" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0011a-PostgreSQL"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:database [ - rmltest:sqlScriptFile "resource.sql" - ]; - rmltest:inputType "PostgreSQL" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0011a-SQLServer"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:inputType "SQLServer" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0011b-CSV"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:inputFile "sport.csv", "student.csv", "student_sport.csv"; - rmltest:inputType "CSV" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0011b-JSON"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:inputFile "sport.json", "student.json", "student_sport.json"; - rmltest:inputType "JSON" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0011b-MySQL"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:database [ - rmltest:sqlScriptFile "resource.sql" - ]; - rmltest:inputType "MySQL" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0011b-PostgreSQL"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:database [ - rmltest:sqlScriptFile "resource.sql" - ]; - rmltest:inputType "PostgreSQL" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0011b-SQLServer"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:inputType "SQLServer" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0011b-XML"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:inputFile "sport.xml", "student.xml", "student_sport.xml"; - rmltest:inputType "XML" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0012a-CSV"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:inputFile "persons.csv"; - rmltest:inputType "CSV" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0012a-JSON"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:inputFile "persons.json"; - rmltest:inputType "JSON" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0012a-MySQL"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:database [ - rmltest:sqlScriptFile "resource.sql" - ]; - rmltest:inputType "MySQL" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0012a-PostgreSQL"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:database [ - rmltest:sqlScriptFile "resource.sql" - ]; - rmltest:inputType "PostgreSQL" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0012a-SPARQL"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:inputType "SPARQL"; - rmltest:tripleStore [ - rmltest:rdfFile "resource.ttl" - ] - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0012a-SQLServer"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:inputType "SQLServer" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0012a-XML"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:inputFile "persons.xml"; - rmltest:inputType "XML" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0012b-CSV"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:inputFile "lives.csv", "persons.csv"; - rmltest:inputType "CSV" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0012b-JSON"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:inputFile "lives.json", "persons.json"; - rmltest:inputType "JSON" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0012b-MySQL"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:database [ - rmltest:sqlScriptFile "resource.sql" - ]; - rmltest:inputType "MySQL" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0012b-PostgreSQL"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:database [ - rmltest:sqlScriptFile "resource.sql" - ]; - rmltest:inputType "PostgreSQL" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0012b-SPARQL"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:inputType "SPARQL"; - rmltest:tripleStore [ - rmltest:rdfFile "resource1.ttl", "resource2.ttl" - ] - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0012b-SQLServer"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:inputType "SQLServer" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0012b-XML"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:inputFile "lives.xml", "persons.xml"; - rmltest:inputType "XML" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0012c-CSV"; - rmltest:input [ - rmltest:inputFile "persons.csv"; - rmltest:inputType "CSV" - ]; - rmltest:mappingDocument "mapping.ttl" . - - a test:TestCase; - dcterms:identifier "RMLTC0012c-JSON"; - rmltest:input [ - rmltest:inputFile "persons.json"; - rmltest:inputType "JSON" - ]; - rmltest:mappingDocument "mapping.ttl" . - - a test:TestCase; - dcterms:identifier "RMLTC0012c-MySQL"; - rmltest:input [ - rmltest:database [ - rmltest:sqlScriptFile "resource.sql" - ]; - rmltest:inputType "MySQL" - ]; - rmltest:mappingDocument "mapping.ttl" . - - a test:TestCase; - dcterms:identifier "RMLTC0012c-PostgreSQL"; - rmltest:input [ - rmltest:database [ - rmltest:sqlScriptFile "resource.sql" - ]; - rmltest:inputType "PostgreSQL" - ]; - rmltest:mappingDocument "mapping.ttl" . - - a test:TestCase; - dcterms:identifier "RMLTC0012c-SQLServer"; - rmltest:input [ - rmltest:inputType "SQLServer" - ]; - rmltest:mappingDocument "mapping.ttl" . - - a test:TestCase; - dcterms:identifier "RMLTC0012c-XML"; - rmltest:input [ - rmltest:inputFile "persons.xml"; - rmltest:inputType "XML" - ]; - rmltest:mappingDocument "mapping.ttl" . - - a test:TestCase; - dcterms:identifier "RMLTC0012d-CSV"; - rmltest:input [ - rmltest:inputFile "persons.csv"; - rmltest:inputType "CSV" - ]; - rmltest:mappingDocument "mapping.ttl" . - - a test:TestCase; - dcterms:identifier "RMLTC0012d-JSON"; - rmltest:input [ - rmltest:inputFile "persons.json"; - rmltest:inputType "JSON" - ]; - rmltest:mappingDocument "mapping.ttl" . - - a test:TestCase; - dcterms:identifier "RMLTC0012d-MySQL"; - rmltest:input [ - rmltest:database [ - rmltest:sqlScriptFile "resource.sql" - ]; - rmltest:inputType "MySQL" - ]; - rmltest:mappingDocument "mapping.ttl" . - - a test:TestCase; - dcterms:identifier "RMLTC0012d-PostgreSQL"; - rmltest:input [ - rmltest:database [ - rmltest:sqlScriptFile "resource.sql" - ]; - rmltest:inputType "PostgreSQL" - ]; - rmltest:mappingDocument "mapping.ttl" . - - a test:TestCase; - dcterms:identifier "RMLTC0012d-SQLServer"; - rmltest:input [ - rmltest:inputType "SQLServer" - ]; - rmltest:mappingDocument "mapping.ttl" . - - a test:TestCase; - dcterms:identifier "RMLTC0012d-XML"; - rmltest:input [ - rmltest:inputFile "persons.xml"; - rmltest:inputType "XML" - ]; - rmltest:mappingDocument "mapping.ttl" . - - a test:TestCase; - dcterms:identifier "RMLTC0012e-MySQL"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:database [ - rmltest:sqlScriptFile "resource.sql" - ]; - rmltest:inputType "MySQL" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0012e-PostgreSQL"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:database [ - rmltest:sqlScriptFile "resource.sql" - ]; - rmltest:inputType "PostgreSQL" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0012e-SQLServer"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:inputType "SQLServer" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0013a-JSON"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:inputFile "persons.json"; - rmltest:inputType "JSON" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0013a-MySQL"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:database [ - rmltest:sqlScriptFile "resource.sql" - ]; - rmltest:inputType "MySQL" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0013a-PostgreSQL"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:database [ - rmltest:sqlScriptFile "resource.sql" - ]; - rmltest:inputType "PostgreSQL" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0013a-SQLServer"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:inputType "SQLServer" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0014d-MySQL"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:database [ - rmltest:sqlScriptFile "resource.sql" - ]; - rmltest:inputType "MySQL" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0014d-PostgreSQL"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:database [ - rmltest:sqlScriptFile "resource.sql" - ]; - rmltest:inputType "PostgreSQL" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0014d-SQLServer"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:inputType "SQLServer" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0015a-CSV"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:inputFile "country_en.csv", "country_es.csv"; - rmltest:inputType "CSV" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0015a-JSON"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:inputFile "country_en.json", "country_es.json"; - rmltest:inputType "JSON" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0015a-MySQL"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:database [ - rmltest:sqlScriptFile "resource.sql" - ]; - rmltest:inputType "MySQL" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0015a-PostgreSQL"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:database [ - rmltest:sqlScriptFile "resource.sql" - ]; - rmltest:inputType "PostgreSQL" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0015a-SQLServer"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:inputType "SQLServer" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0015a-XML"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:inputFile "country_en.xml", "country_es.xml"; - rmltest:inputType "XML" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0015b-CSV"; - rmltest:input [ - rmltest:inputFile "country_en.csv", "country_es.csv"; - rmltest:inputType "CSV" - ]; - rmltest:mappingDocument "mapping.ttl" . - - a test:TestCase; - dcterms:identifier "RMLTC0015b-JSON"; - rmltest:input [ - rmltest:inputFile "country_en.json", "country_es.json"; - rmltest:inputType "JSON" - ]; - rmltest:mappingDocument "mapping.ttl" . - - a test:TestCase; - dcterms:identifier "RMLTC0015b-MySQL"; - rmltest:input [ - rmltest:database [ - rmltest:sqlScriptFile "resource.sql" - ]; - rmltest:inputType "MySQL" - ]; - rmltest:mappingDocument "mapping.ttl" . - - a test:TestCase; - dcterms:identifier "RMLTC0015b-PostgreSQL"; - rmltest:input [ - rmltest:database [ - rmltest:sqlScriptFile "resource.sql" - ]; - rmltest:inputType "PostgreSQL" - ]; - rmltest:mappingDocument "mapping.ttl" . - - a test:TestCase; - dcterms:identifier "RMLTC0015b-SQLServer"; - rmltest:input [ - rmltest:inputType "SQLServer" - ]; - rmltest:mappingDocument "mapping.ttl" . - - a test:TestCase; - dcterms:identifier "RMLTC0015b-XML"; - rmltest:input [ - rmltest:inputFile "country_en.xml", "country_es.xml"; - rmltest:inputType "XML" - ]; - rmltest:mappingDocument "mapping.ttl" . - - a test:TestCase; - dcterms:identifier "RMLTC0016a-MySQL"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:database [ - rmltest:sqlScriptFile "resource.sql" - ]; - rmltest:inputType "MySQL" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0016a-PostgreSQL"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:database [ - rmltest:sqlScriptFile "resource.sql" - ]; - rmltest:inputType "PostgreSQL" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0016a-SQLServer"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:inputType "SQLServer" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0016b-MySQL"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:database [ - rmltest:sqlScriptFile "resource.sql" - ]; - rmltest:inputType "MySQL" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0016b-PostgreSQL"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:database [ - rmltest:sqlScriptFile "resource.sql" - ]; - rmltest:inputType "PostgreSQL" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0016b-SQLServer"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:inputType "SQLServer" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0016c-MySQL"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:database [ - rmltest:sqlScriptFile "resource.sql" - ]; - rmltest:inputType "MySQL" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0016c-PostgreSQL"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:database [ - rmltest:sqlScriptFile "resource.sql" - ]; - rmltest:inputType "PostgreSQL" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0016c-SQLServer"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:inputType "SQLServer" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0016d-MySQL"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:database [ - rmltest:sqlScriptFile "resource.sql" - ]; - rmltest:inputType "MySQL" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0016d-PostgreSQL"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:database [ - rmltest:sqlScriptFile "resource.sql" - ]; - rmltest:inputType "PostgreSQL" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0016d-SQLServer"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:inputType "SQLServer" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0016e-MySQL"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:database [ - rmltest:sqlScriptFile "resource.sql" - ]; - rmltest:inputType "MySQL" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0016e-PostgreSQL"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:database [ - rmltest:sqlScriptFile "resource.sql" - ]; - rmltest:inputType "PostgreSQL" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0016e-SQLServer"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:inputType "SQLServer" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0018a-MySQL"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:database [ - rmltest:sqlScriptFile "resource.sql" - ]; - rmltest:inputType "MySQL" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0018a-PostgreSQL"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:database [ - rmltest:sqlScriptFile "resource.sql" - ]; - rmltest:inputType "PostgreSQL" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0018a-SQLServer"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:inputType "SQLServer" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0019a-CSV"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:inputFile "persons.csv"; - rmltest:inputType "CSV" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0019a-JSON"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:inputFile "persons.json"; - rmltest:inputType "JSON" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0019a-MySQL"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:database [ - rmltest:sqlScriptFile "resource.sql" - ]; - rmltest:inputType "MySQL" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0019a-PostgreSQL"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:database [ - rmltest:sqlScriptFile "resource.sql" - ]; - rmltest:inputType "PostgreSQL" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0019a-SQLServer"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:inputType "SQLServer" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0019a-XML"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:inputFile "persons.xml"; - rmltest:inputType "XML" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0019b-CSV"; - rmltest:input [ - rmltest:inputFile "persons.csv"; - rmltest:inputType "CSV" - ]; - rmltest:mappingDocument "mapping.ttl" . - - a test:TestCase; - dcterms:identifier "RMLTC0019b-JSON"; - rmltest:input [ - rmltest:inputFile "persons.json"; - rmltest:inputType "JSON" - ]; - rmltest:mappingDocument "mapping.ttl" . - - a test:TestCase; - dcterms:identifier "RMLTC0019b-MySQL"; - rmltest:input [ - rmltest:database [ - rmltest:sqlScriptFile "resource.sql" - ]; - rmltest:inputType "MySQL" - ]; - rmltest:mappingDocument "mapping.ttl" . - - a test:TestCase; - dcterms:identifier "RMLTC0019b-PostgreSQL"; - rmltest:input [ - rmltest:database [ - rmltest:sqlScriptFile "resource.sql" - ]; - rmltest:inputType "PostgreSQL" - ]; - rmltest:mappingDocument "mapping.ttl" . - - a test:TestCase; - dcterms:identifier "RMLTC0019b-SQLServer"; - rmltest:input [ - rmltest:inputType "SQLServer" - ]; - rmltest:mappingDocument "mapping.ttl" . - - a test:TestCase; - dcterms:identifier "RMLTC0019b-XML"; - rmltest:input [ - rmltest:inputFile "persons.xml"; - rmltest:inputType "XML" - ]; - rmltest:mappingDocument "mapping.ttl" . - - a test:TestCase; - dcterms:identifier "RMLTC0020a-CSV"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:inputFile "student.csv"; - rmltest:inputType "CSV" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0020a-JSON"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:inputFile "student.json"; - rmltest:inputType "JSON" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0020a-MySQL"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:database [ - rmltest:sqlScriptFile "resource.sql" - ]; - rmltest:inputType "MySQL" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0020a-PostgreSQL"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:database [ - rmltest:sqlScriptFile "resource.sql" - ]; - rmltest:inputType "PostgreSQL" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0020a-SQLServer"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:inputType "SQLServer" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0020a-XML"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:inputFile "student.xml"; - rmltest:inputType "XML" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0021a-CSV"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:inputFile "student.csv"; - rmltest:inputType "CSV" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0021a-JSON"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:inputFile "student.json"; - rmltest:inputType "JSON" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0021a-MySQL"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:database [ - rmltest:sqlScriptFile "resource.sql" - ]; - rmltest:inputType "MySQL" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0021a-PostgreSQL"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:database [ - rmltest:sqlScriptFile "resource.sql" - ]; - rmltest:inputType "PostgreSQL" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0021a-SPARQL"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:inputType "SPARQL"; - rmltest:tripleStore [ - rmltest:rdfFile "resource.ttl" - ] - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0021a-SQLServer"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:inputType "SQLServer" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0021a-XML"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:inputFile "student.xml"; - rmltest:inputType "XML" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0022a-CSV"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:inputFile "student.csv"; - rmltest:inputType "CSV" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0022b-CSV"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:inputFile "data.csv"; - rmltest:inputType "CSV" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0022c-CSV"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:inputFile "data.csv"; - rmltest:inputType "CSV" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . - - a test:TestCase; - dcterms:identifier "RMLTC0023a-XML"; - rmltest:hasExpectedOutput true; - rmltest:input [ - rmltest:inputFile "ious.xml"; - rmltest:inputType "XML" - ]; - rmltest:mappingDocument "mapping.ttl"; - rmltest:output "output.nq" . + "country_info.json" . + "application/json" . + . + "student.json" . + "application/json" . + . + "output.nq" . + "application/n-quads" . + . + . + "RMLTC0008b-JSON" . + . + . + "mapping.ttl" . + "false"^^ . + . + "output.nq" . + "application/n-quads" . + . + . + "RMLTC0021a-JSON" . + . + . + "mapping.ttl" . + "false"^^ . + . + . + "RMLTC0023c-JSON" . + . + "mapping.ttl" . + "true"^^ . + . + . + "RMLTC0023f-JSON" . + . + . + "mapping.ttl" . + "false"^^ . + . + "persons.json" . + "application/json" . + . + "output.nq" . + "application/n-quads" . + . + "output.nq" . + "application/n-quads" . + . + "output.nq" . + "application/n-quads" . + . + . + "RMLTC0010c-JSON" . + . + . + "mapping.ttl" . + "false"^^ . + . + "output.nq" . + "application/n-quads" . + . + . + "RMLTC0023b-JSON" . + . + "mapping.ttl" . + "true"^^ . + . + . + "RMLTC0025a-JSON" . + . + . + "mapping.ttl" . + "false"^^ . + . + "output.nq" . + "application/n-quads" . + . + . + "RMLTC0012a-JSON" . + . + . + "mapping.ttl" . + "false"^^ . + . + "sport.json" . + "application/json" . + . + . + "RMLTC0012d-JSON" . + . + "mapping.ttl" . + "true"^^ . + . + "persons.json" . + "application/json" . + . + "persons.json" . + "application/json" . + . + . + "RMLTC0027b-JSON" . + . + . + "mapping.ttl" . + "false"^^ . + . + "student.json" . + "application/json" . + . + "output.nq" . + "application/n-quads" . + . + "output.nq" . + "application/n-quads" . + . + "output.nq" . + "application/n-quads" . + . + "data.json" . + "application/json" . + . + "student_sport.json" . + "application/json" . + . + . + "RMLTC0027a-JSON" . + . + . + "mapping.ttl" . + "false"^^ . + . + "output.nq" . + "application/n-quads" . + . + "country_es.json" . + "application/json" . + . + "output.nq" . + "application/n-quads" . + . + "persons.json" . + "application/json" . + . + "persons.json" . + "application/json" . + . + . + "RMLTC0007e-JSON" . + . + . + "mapping.ttl" . + "false"^^ . + . + . + "RMLTC0007h-JSON" . + . + "mapping.ttl" . + "true"^^ . + . + "data.json" . + "application/json" . + . + "output.nq" . + "application/n-quads" . + . + "output.nq" . + "application/n-quads" . + . + . + "RMLTC0007a-JSON" . + . + . + "mapping.ttl" . + "false"^^ . + . + . + "RMLTC0007d-JSON" . + . + . + "mapping.ttl" . + "false"^^ . + . + "country_info.json" . + "application/json" . + . + "persons.json" . + "application/json" . + . + . + "RMLTC0009b-JSON" . + . + . + . + "mapping.ttl" . + "false"^^ . + . + "student.json" . + "application/json" . + . + "student.json" . + "application/json" . + . + "output.nq" . + "application/n-quads" . + . + "ious.json" . + "application/json" . + . + . + "RMLTC0009a-JSON" . + . + . + . + "mapping.ttl" . + "false"^^ . + . + . + "RMLTC0022a-JSON" . + . + . + "mapping.ttl" . + "false"^^ . + . + "output.nq" . + "application/n-quads" . + . + "output.nq" . + "application/n-quads" . + . + "output.nq" . + "application/n-quads" . + . + "persons.json" . + "application/json" . + . + "student.json" . + "application/json" . + . + "output.nq" . + "application/n-quads" . + . + "persons.json" . + "application/json" . + . + "country_es.json" . + "application/json" . + . + "student.json" . + "application/json" . + . + . + "RMLTC0026d-JSON" . + . + . + "mapping.ttl" . + "false"^^ . + . + "student.json" . + "application/json" . + . + . + . + "RMLTC0011b-JSON" . + . + . + . + "mapping.ttl" . + "false"^^ . + . + "output.nq" . + "application/n-quads" . + . + "persons.json" . + "application/json" . + . + "output.nq" . + "application/n-quads" . + . + "output.nq" . + "application/n-quads" . + . + . + "RMLTC0002g-JSON" . + . + "mapping.ttl" . + "true"^^ . + . + . + "RMLTC0013a-JSON" . + . + . + "mapping.ttl" . + "false"^^ . + . + . + "RMLTC0026c-JSON" . + . + . + "mapping.ttl" . + "false"^^ . + . + "student.json" . + "application/json" . + . + "country_info.json" . + "application/json" . + . + . + "RMLTC0028b-JSON" . + . + . + "mapping.ttl" . + "false"^^ . + . + "student_sport.json" . + "application/json" . + . + "output.nq" . + "application/n-quads" . + . + "output.nq" . + "application/n-quads" . + . + "student.json" . + "application/json" . + . + "student.json" . + "application/json" . + . + . + "RMLTC0015b-JSON" . + . + "mapping.ttl" . + "true"^^ . + . + . + "RMLTC0028a-JSON" . + . + . + "mapping.ttl" . + "false"^^ . + . + . + "RMLTC0002b-JSON" . + . + . + "mapping.ttl" . + "false"^^ . + . + . + "RMLTC0004a-JSON" . + . + . + "mapping.ttl" . + "false"^^ . + . + "output.nq" . + "application/n-quads" . + . + "student.json" . + "application/json" . + . + . + "RMLTC0019b-JSON" . + . + "mapping.ttl" . + "true"^^ . + . + "lives.json" . + "application/json" . + . + "output.nq" . + "application/n-quads" . + . + "data.json" . + "application/json" . + . + "student.json" . + "application/json" . + . + . + "RMLTC0008a-JSON" . + . + . + "mapping.ttl" . + "false"^^ . + . + . + "RMLTC0019a-JSON" . + . + . + "mapping.ttl" . + "false"^^ . + . + "persons.json" . + "application/json" . + . + "student.json" . + "application/json" . + . + "student.json" . + "application/json" . + . + "output.nq" . + "application/n-quads" . + . + "output.nq" . + "application/n-quads" . + . + "output.nq" . + "application/n-quads" . + . + "student.json" . + "application/json" . + . + . + "RMLTC0023e-JSON" . + . + "mapping.ttl" . + "true"^^ . + . + "student.json" . + "application/json" . + . + "student.json" . + "application/json" . + . + "output.nq" . + "application/n-quads" . + . + "output.nq" . + "application/n-quads" . + . + . + "RMLTC0010b-JSON" . + . + . + "mapping.ttl" . + "false"^^ . + . + . + "RMLTC0023a-JSON" . + . + "mapping.ttl" . + "true"^^ . + . + . + "RMLTC0023d-JSON" . + . + "mapping.ttl" . + "true"^^ . + . + . + "RMLTC0025c-JSON" . + . + . + "mapping.ttl" . + "false"^^ . + . + . + "RMLTC0000-JSON" . + . + . + "mapping.ttl" . + "false"^^ . + . + . + "RMLTC0010a-JSON" . + . + . + "mapping.ttl" . + "false"^^ . + . + "student.json" . + "application/json" . + . + "student.json" . + "application/json" . + . + . + "RMLTC0012c-JSON" . + . + "mapping.ttl" . + "true"^^ . + . + "student.json" . + "application/json" . + . + . + "RMLTC0025b-JSON" . + . + "mapping.ttl" . + "true"^^ . + . + "student.json" . + "application/json" . + . + "student.json" . + "application/json" . + . + "persons.json" . + "application/json" . + . + . + "RMLTC0001b-JSON" . + . + . + "mapping.ttl" . + "false"^^ . + . + . + "RMLTC0012b-JSON" . + . + . + . + "mapping.ttl" . + "false"^^ . + . + . + "RMLTC0027c-JSON" . + . + . + "mapping.ttl" . + "false"^^ . + . + "student.json" . + "application/json" . + . + "student.json" . + "application/json" . + . + . + "RMLTC0001a-JSON" . + . + . + "mapping.ttl" . + "false"^^ . + . + "student.json" . + "application/json" . + . + . + "RMLTC0003c-JSON" . + . + . + "mapping.ttl" . + "false"^^ . + . + "student.json" . + "application/json" . + . + "output.nq" . + "application/n-quads" . + . + . + "RMLTC0007g-JSON" . + . + . + "mapping.ttl" . + "false"^^ . + . + "output.nq" . + "application/n-quads" . + . + "output.nq" . + "application/n-quads" . + . + "persons.json" . + "application/json" . + . + "persons.json" . + "application/json" . + . + "student.json" . + "application/json" . + . + "output.nq" . + "application/n-quads" . + . + . + "RMLTC0005a-JSON" . + . + . + "mapping.ttl" . + "false"^^ . + . + . + "RMLTC0007c-JSON" . + . + . + "mapping.ttl" . + "false"^^ . + . + . + "RMLTC0007f-JSON" . + . + . + "mapping.ttl" . + "false"^^ . + . + "student.json" . + "application/json" . + . + "sport.json" . + "application/json" . + . + . + "RMLTC0007b-JSON" . + . + . + "mapping.ttl" . + "false"^^ . + . + "output.nq" . + "application/n-quads" . + . + "persons.json" . + "application/json" . + . + "output.nq" . + "application/n-quads" . + . + "output.nq" . + "application/n-quads" . + . + "output.nq" . + "application/n-quads" . + . + "student.json" . + "application/json" . + . + . + "RMLTC0020a-JSON" . + . + . + "mapping.ttl" . + "false"^^ . + . + . + "RMLTC0022c-JSON" . + . + . + "mapping.ttl" . + "false"^^ . + . + "student.json" . + "application/json" . + . + "output.nq" . + "application/n-quads" . + . + "student.json" . + "application/json" . + . + "student.json" . + "application/json" . + . + "sport.json" . + "application/json" . + . + . + "RMLTC0022b-JSON" . + . + . + "mapping.ttl" . + "false"^^ . + . + . + "RMLTC0024a-JSON" . + . + "mapping.ttl" . + "true"^^ . + . + "output.nq" . + "application/n-quads" . + . + "student.json" . + "application/json" . + . + "student.json" . + "application/json" . + . + . + "RMLTC0026b-JSON" . + . + . + "mapping.ttl" . + "false"^^ . + . + "output.nq" . + "application/n-quads" . + . + "data.json" . + "application/json" . + . + . + "RMLTC0002e-JSON" . + . + "mapping.ttl" . + "true"^^ . + . + . + "RMLTC0015a-JSON" . + . + . + "mapping.ttl" . + "false"^^ . + . + . + "RMLTC0026a-JSON" . + . + . + "mapping.ttl" . + "false"^^ . + . + "output.nq" . + "application/n-quads" . + . + . + "RMLTC0028c-JSON" . + . + . + "mapping.ttl" . + "false"^^ . + . + "student.json" . + "application/json" . + . + "output.nq" . + "application/n-quads" . + . + "student.json" . + "application/json" . + . + . + "RMLTC0002a-JSON" . + . + . + "mapping.ttl" . + "false"^^ . + . + "output.nq" . + "application/n-quads" . + . + "student.json" . + "application/json" . + . + "output.nq" . + "application/n-quads" . + . + "output.nq" . + "application/n-quads" . + . + "output.nq" . + "application/n-quads" . + . + . + "RMLTC0004b-JSON" . + . + "mapping.ttl" . + "true"^^ . + . + . + "RMLTC0006a-JSON" . + . + . + "mapping.ttl" . + "false"^^ . + . + "data.json" . + "application/json" . + . + . + "RMLTC0008c-JSON" . + . + . + "mapping.ttl" . + "false"^^ . + . diff --git a/src/test/resources/rml-core/metadata.csv b/src/test/resources/rml-core/metadata.csv new file mode 100644 index 00000000..23b49974 --- /dev/null +++ b/src/test/resources/rml-core/metadata.csv @@ -0,0 +1,64 @@ +ID,title,description,specification,base_iri,mapping,input_format1,input_format2,input_format3,output_format1,output_format2,output_format3,input1,input2,input3,output1,output2,output3,error +RMLTC0000-JSON,"""one table, one column, zero rows""","""Tests if an empty table produces an empty RDF graph""",http://w3id.org/rml/core,http://example.org/,mapping.ttl,application/json,,,application/n-quads,,,student.json,,,output.nq,,,false +RMLTC0001a-JSON,"""One column mapping, subject URI generation by using rml:template""","""Tests: (1) one column mapping; (2) subject URI generation by using rml:template; (3) one column to one property""",http://w3id.org/rml/core,http://example.org/,mapping.ttl,application/json,,,application/n-quads,,,student.json,,,output.nq,,,false +RMLTC0001b-JSON,"""One column mapping, generation of a BlankNode subject by using rml:termType""","""Tests: (1) one column mapping; (2) generation of a BlankNode subject by using rml:termType; (3) one column to one property""",http://w3id.org/rml/core,http://example.org/,mapping.ttl,application/json,,,application/n-quads,,,student.json,,,output.nq,,,false +RMLTC0002a-JSON,"""Two columns mapping, generation of a subject URI by the concatenation of two column values""","""Tests: (1) two column mapping, no primary key; (2) subject URI generated by the concatenation of two column values; (3) one column to one property""",http://w3id.org/rml/core,http://example.org/,mapping.ttl,application/json,,,application/n-quads,,,student.json,,,output.nq,,,false +RMLTC0002b-JSON,"""Two columns mapping, generation of a BlankNode subject by using rml:template and rml:termType""","""Tests: (1) two column mapping, no primary key; (2) generation of a BlankNode subject by using rml:template; (3) one column to one property""",http://w3id.org/rml/core,http://example.org/,mapping.ttl,application/json,,,application/n-quads,,,student.json,,,output.nq,,,false +RMLTC0002e-JSON,"""Two columns mapping, an undefined rml:path""","""Tests the presence of an undefined rml:path""",http://w3id.org/rml/core,http://example.org/,mapping.ttl,application/json,,,,,,student.json,,,,,,true +RMLTC0002g-JSON,"""Two columns mapping, invalid JSONPath""","""Test the presence of an invalid JSONPath""",http://w3id.org/rml/core,http://example.org/,mapping.ttl,application/json,,,,,,student.json,,,,,,true +RMLTC0003c-JSON,"""Three columns mapping, by using a rml:template to produce literal""","""Tests: (1) three column mapping; and (2) the use of rml:template to produce literal""",http://w3id.org/rml/core,http://example.org/,mapping.ttl,application/json,,,application/n-quads,,,student.json,,,output.nq,,,false +RMLTC0004a-JSON,"""Two column mapping, from one row table to two different triples""","""Tests: (1) two column mapping, (2) subject URI generated by a column value; (3) from one row table to two different triples (4) typing by using rml:class""",http://w3id.org/rml/core,http://example.org/,mapping.ttl,application/json,,,application/n-quads,,,student_sport.json,,,output.nq,,,false +RMLTC0004b-JSON,"""One column mapping, presence of rml:termType rml:Literal on rml:subjectMap""","""Tests: (1) one column mapping (2) the presence of rml:termType rml:Literal on rml:subjectMap, which is invalid""",http://w3id.org/rml/core,http://example.org/,mapping.ttl,application/json,,,,,,student.json,,,,,,true +RMLTC0005a-JSON,"""Typing of resources""","""Tests the typing of resources""",http://w3id.org/rml/core,http://example.org/,mapping.ttl,application/json,,,application/n-quads,,,ious.json,,,output.nq,,,false +RMLTC0006a-JSON,"""Use of rml:constant in rml:subjectMap, rml:predicateMap, rml:objectMap and rml:graphMap""","""Tests the use of rml:constant in rml:subjectMap, rml:predicateMap, rml:objectMap and rml:graphMap""",http://w3id.org/rml/core,http://example.org/,mapping.ttl,application/json,,,application/n-quads,,,student.json,,,output.nq,,,false +RMLTC0007a-JSON,"""Typing resources by relying on rdf:type predicate""","""Tests the typing resources by relying on rdf:type predicate""",http://w3id.org/rml/core,http://example.org/,mapping.ttl,application/json,,,application/n-quads,,,student.json,,,output.nq,,,false +RMLTC0007b-JSON,"""Assigning triples to Named Graphs""","""Tests the generation of triples to a named graph""",http://w3id.org/rml/core,http://example.org/,mapping.ttl,application/json,,,application/n-quads,,,student.json,,,output.nq,,,false +RMLTC0007c-JSON,"""One row mapping, using rml:class""","""Tests subjectmap with more than one class IRIs, rml:class""",http://w3id.org/rml/core,http://example.org/,mapping.ttl,application/json,,,application/n-quads,,,student.json,,,output.nq,,,false +RMLTC0007d-JSON,"""One column mapping, specifying an rml:predicateObjectMap with rdf:type""","""Tests subjectmap with an alternative of having rml:class, i.e., by specifying an rml:predicateObjectMap with predicate rdf:type""",http://w3id.org/rml/core,http://example.org/,mapping.ttl,application/json,,,application/n-quads,,,student.json,,,output.nq,,,false +RMLTC0007e-JSON,"""One column mapping, using rml:graphMap and rml:class""","""Tests subjectmap with rml:graphMap and rml:class""",http://w3id.org/rml/core,http://example.org/,mapping.ttl,application/json,,,application/n-quads,,,student.json,,,output.nq,,,false +RMLTC0007f-JSON,"""One column mapping, using rml:graphMap and specifying an rml:predicateObjectMap with rdf:type""","""Tests subjectmap with rml:graphMap and specifying an rml:predicateObjectMap with predicate rdf:type""",http://w3id.org/rml/core,http://example.org/,mapping.ttl,application/json,,,application/n-quads,,,student.json,,,output.nq,,,false +RMLTC0007g-JSON,"""Assigning triples to the default graph""","""Tests the generation of triples to the default graph""",http://w3id.org/rml/core,http://example.org/,mapping.ttl,application/json,,,application/n-quads,,,student.json,,,output.nq,,,false +RMLTC0007h-JSON,"""Assigning triples to a non-IRI named graph""","""Tests the generation of triples to a non-IRI named graph, which is an error""",http://w3id.org/rml/core,http://example.org/,mapping.ttl,application/json,,,,,,student.json,,,,,,true +RMLTC0008a-JSON,"""Generation of triples to a target graph by using rml:graphMap and rml:template""","""Test that results of the mapping can be directed to a target graph by using rml:graphMap and rml:template""",http://w3id.org/rml/core,http://example.org/,mapping.ttl,application/json,,,application/n-quads,,,student.json,,,output.nq,,,false +RMLTC0008b-JSON,"""Generation of triples referencing object map""","""Tests the mapping specification referencing object map without join""",http://w3id.org/rml/core,http://example.org/,mapping.ttl,application/json,,,application/n-quads,,,student.json,,,output.nq,,,false +RMLTC0008c-JSON,"""Generation of triples by using multiple predicateMaps within a rml:predicateObjectMap""","""Tests the generation of triples by using multiple predicateMaps within a rml:predicateObjectMap""",http://w3id.org/rml/core,http://example.org/,mapping.ttl,application/json,,,application/n-quads,,,student.json,,,output.nq,,,false +RMLTC0009a-JSON,"""Generation of triples from foreign key relations""","""Test foreign key relationships among logical tables""",http://w3id.org/rml/core,http://example.org/,mapping.ttl,application/json,application/json,,application/n-quads,,,student.json,sport.json,,output.nq,,,false +RMLTC0009b-JSON,"""Generation of triples to multiple graphs""","""Test that results from distinct parts of the mapping can be directed to different target graphs.""",http://w3id.org/rml/core,http://example.org/,mapping.ttl,application/json,application/json,,application/n-quads,,,student.json,sport.json,,output.nq,,,false +RMLTC0010a-JSON,"""Template with table column with blank space""","""Tests a template with blank space in column value""",http://w3id.org/rml/core,http://example.org/,mapping.ttl,application/json,,,application/n-quads,,,country_info.json,,,output.nq,,,false +RMLTC0010b-JSON,"""Template with table columns with special chars""","""Tests a template with special chars in column value""",http://w3id.org/rml/core,http://example.org/,mapping.ttl,application/json,,,application/n-quads,,,country_info.json,,,output.nq,,,false +RMLTC0010c-JSON,"""Template with table columns with special chars and backslashes""","""Tests a template with special chars in reference value and backslash escapes in string templates""",http://w3id.org/rml/core,http://example.org/,mapping.ttl,application/json,,,application/n-quads,,,country_info.json,,,output.nq,,,false +RMLTC0011b-JSON,"""M to M relation, by using an additional Triples Map""","""Tests, M to M relations, by using an additional Triples Map""",http://w3id.org/rml/core,http://example.org/,mapping.ttl,application/json,application/json,application/json,application/n-quads,,,student.json,sport.json,student_sport.json,output.nq,,,false +RMLTC0012a-JSON,"""Blank node referencing multiple columns""","""Tests that blank nodes can be generated by referencing multiple columns""",http://w3id.org/rml/core,http://example.org/,mapping.ttl,application/json,,,application/n-quads,,,persons.json,,,output.nq,,,false +RMLTC0012b-JSON,"""Duplicate tuples generate same blank node""","""Tests that blank nodes with same identifier and in the same graph but generated by different logical rows are considered equivalent.""",http://w3id.org/rml/core,http://example.org/,mapping.ttl,application/json,application/json,,application/n-quads,,,lives.json,persons.json,,output.nq,,,false +RMLTC0012c-JSON,"""TriplesMap without subjectMap""","""Tests a RML with missing information, TriplesMap without subjectMap.""",http://w3id.org/rml/core,http://example.org/,mapping.ttl,application/json,,,,,,persons.json,,,,,,true +RMLTC0012d-JSON,"""TriplesMap with two subjectMap""","""Tests a RML with wrong information, TriplesMap with two subjectMap.""",http://w3id.org/rml/core,http://example.org/,mapping.ttl,application/json,,,,,,persons.json,,,,,,true +RMLTC0013a-JSON,"""Null value in JSON file""","""Tests if null values in JSON files are handled correctly.""",http://w3id.org/rml/core,http://example.org/,mapping.ttl,application/json,,,application/n-quads,,,persons.json,,,output.nq,,,false +RMLTC0015a-JSON,"""Generation of language tags from a table with language information""","""Generation of language tags from a table with language information""",http://w3id.org/rml/core,http://example.org/,mapping.ttl,application/json,,,application/n-quads,,,country_es.json,,,output.nq,,,false +RMLTC0015b-JSON,"""Generation of language tags from a table with language information, and a term map with invalid rml:language value""","""Tests a term map with an invalid rml:language value, which is an error""",http://w3id.org/rml/core,http://example.org/,mapping.ttl,application/json,,,,,,country_es.json,,,,,,true +RMLTC0019a-JSON,"""Generation of triples by using IRI value in columns""","""Test the generation of triples by using IRI value in attributes""",http://w3id.org/rml/core,http://example.org/,mapping.ttl,application/json,,,application/n-quads,,,persons.json,,,output.nq,,,false +RMLTC0019b-JSON,"""Generation of triples by using IRI value in columns, with data error""","""Test the generation of triples by using IRI value in attributes, conforming RML mapping with data error (and limited results)""",http://w3id.org/rml/core,http://example.org/,mapping.ttl,application/json,,,,,,persons.json,,,,,,true +RMLTC0020a-JSON,"""Generation of triples by using IRI value in columns""","""Test the generation of triples by using IRI value in attributes""",http://w3id.org/rml/core,http://example.org/,mapping.ttl,application/json,,,application/n-quads,,,student.json,,,output.nq,,,false +RMLTC0021a-JSON,"""Generation of triples referencing object map""","""Tests the mapping specification referencing object map with same logical source and join condition""",http://w3id.org/rml/core,http://example.org/,mapping.ttl,application/json,,,application/n-quads,,,student.json,,,output.nq,,,false +RMLTC0022a-JSON,"""Generating of triples with constant datatype""","""Test triples with a fixed constant datatype""",http://w3id.org/rml/core,http://example.org/,mapping.ttl,application/json,,,application/n-quads,,,student.json,,,output.nq,,,false +RMLTC0022b-JSON,"""Generating of triples with datatypeMap""","""Test triples with a XSD datatype generated from the data""",http://w3id.org/rml/core,http://example.org/,mapping.ttl,application/json,,,application/n-quads,,,data.json,,,output.nq,,,false +RMLTC0022c-JSON,"""Generating of triples with datatypeMap with custom datatype""","""Test triples with a custom datype from the data""",http://w3id.org/rml/core,http://example.org/,mapping.ttl,application/json,,,application/n-quads,,,data.json,,,output.nq,,,false +RMLTC0023a-JSON,"""Invalid IRI template 1""","""Test handling of invalid IRI template""",http://w3id.org/rml/core,http://example.org/,mapping.ttl,application/json,,,,,,student.json,,,,,,true +RMLTC0023b-JSON,"""Invalid IRI template 2""","""Test handling of invalid IRI template""",http://w3id.org/rml/core,http://example.org/,mapping.ttl,application/json,,,,,,student.json,,,,,,true +RMLTC0023c-JSON,"""Invalid IRI template 3""","""Test handling of invalid IRI template""",http://w3id.org/rml/core,http://example.org/,mapping.ttl,application/json,,,,,,student.json,,,,,,true +RMLTC0023d-JSON,"""Invalid IRI template 4""","""Test handling of invalid IRI template""",http://w3id.org/rml/core,http://example.org/,mapping.ttl,application/json,,,,,,student.json,,,,,,true +RMLTC0023e-JSON,"""Invalid IRI template 5""","""Test handling of invalid IRI template""",http://w3id.org/rml/core,http://example.org/,mapping.ttl,application/json,,,,,,student.json,,,,,,true +RMLTC0023f-JSON,"""Valid IRI template with backslash-escape""","""Test handling of a valid IRI template using backslash-escape""",http://w3id.org/rml/core,http://example.org/,mapping.ttl,application/json,,,application/n-quads,,,student.json,,,output.nq,,,false +RMLTC0024a-JSON,"""Usage of constant term maps in combination with explicitly defined term types""","""Tests the usage of constant term maps in combination with explicitly defined term types""",http://w3id.org/rml/core,http://example.org/,mapping.ttl,application/json,,,,,,student.json,,,,,,true +RMLTC0025a-JSON,"""Generation of triples from arrays""","""Tests the generation of triples from array input data structures""",http://w3id.org/rml/core,http://example.org/,mapping.ttl,application/json,,,application/n-quads,,,persons.json,,,output.nq,,,false +RMLTC0025b-JSON,"""Generation of triples from arrays with wrong reference""","""Tests the generation of triples from array input data structures. Test should fail as reference points to the array and not the values of the array""",http://w3id.org/rml/core,http://example.org/,mapping.ttl,application/json,,,,,,persons.json,,,,,,true +RMLTC0025c-JSON,"""Generation of triples from arrays in subject and object""","""Tests the generation of triples from array input data structures in subject and object""",http://w3id.org/rml/core,http://example.org/,mapping.ttl,application/json,,,application/n-quads,,,persons.json,,,output.nq,,,false +RMLTC0026a-JSON,"""Two triples maps, one with rml:baseIRI and one without and generating absolute IRIs""","""Tests the generation of triples from relative IRIs using base IRI""",http://w3id.org/rml/core,http://example.org/,mapping.ttl,application/json,,,application/n-quads,,,persons.json,,,output.nq,,,false +RMLTC0026b-JSON,"""Two triples maps, one with rml:baseIRI one one without and generating relative IRIs using baseIRI parameter""","""Tests the generation of triples from relative IRI using base IRI parameter""",http://w3id.org/rml/core,http://example.org/,mapping.ttl,application/json,,,application/n-quads,,,persons.json,,,output.nq,,,false +RMLTC0026c-JSON,"""Two triples maps, both with rml:baseIRI defined""","""Tests the generation of triples using relative IRIs with base IRIs defined only in triples maps, without base IRI parameter""",http://w3id.org/rml/core,http://example.org/,mapping.ttl,application/json,,,application/n-quads,,,persons.json,,,output.nq,,,false +RMLTC0026d-JSON,"""Two triples maps,both with rml:bseIRI defined and baseIRI parameter defined""","""Tests the generation of triples by with base IRIs different than the base IRI parameter""",http://w3id.org/rml/core,http://example.org/,mapping.ttl,application/json,,,application/n-quads,,,persons.json,,,output.nq,,,false +RMLTC0027a-JSON,"""Generation of triples using the URI term type""","""Tests the generation of triples with a URI term type in the subject or object""",http://w3id.org/rml/core,http://example.org/,mapping.ttl,application/json,,,application/n-quads,,,student.json,,,output.nq,,,false +RMLTC0027b-JSON,"""Generation of triples using the UnsafeURI term type""","""Tests the generation of triples with a UnsafeURI term type in the subject or object""",http://w3id.org/rml/core,http://example.org/,mapping.ttl,application/json,,,application/n-quads,,,student.json,,,output.nq,,,false +RMLTC0027c-JSON,"""Generation of triples using the UnsafeIRI term type""","""Tests the generation of triples with a UnsafeIRI term type in the subject or object""",http://w3id.org/rml/core,http://example.org/,mapping.ttl,application/json,,,application/n-quads,,,student.json,,,output.nq,,,false +RMLTC0028a-JSON,"""Generation of the right datatype for a constant in the mapping""","""Test the honoring of the datatype specified by the constant term in the mapping""",http://w3id.org/rml/core,http://example.org/,mapping.ttl,application/json,,,application/n-quads,,,data.json,,,output.nq,,,false +RMLTC0028b-JSON,"""Generation of all named graphs when rml:defaultGraph is involved""","""Test if the default graph is also generated correctly.""",http://w3id.org/rml/core,http://example.org/,mapping.ttl,application/json,,,application/n-quads,,,data.json,,,output.nq,,,false +RMLTC0028c-JSON,"""Generation of the right language tag for a constant in the mapping""","""Test the honoring of the language tag specified by the constant term in the mapping""",http://w3id.org/rml/core,http://example.org/,mapping.ttl,application/json,,,application/n-quads,,,data.json,,,output.nq,,,false diff --git a/src/test/resources/rml-core/section/abstract.md b/src/test/resources/rml-core/section/abstract.md new file mode 100644 index 00000000..e7298444 --- /dev/null +++ b/src/test/resources/rml-core/section/abstract.md @@ -0,0 +1 @@ +This document defines the RML-Core test cases to the determine the RML-Core specification conformance of tools. diff --git a/src/test/resources/rml-core/section/data-model.md b/src/test/resources/rml-core/section/data-model.md new file mode 100644 index 00000000..f4c3ad6a --- /dev/null +++ b/src/test/resources/rml-core/section/data-model.md @@ -0,0 +1,12 @@ +# Data model + +The test cases are semantically described for re-usability and shareability following the [W3C Test case description](https://www.w3.org/2006/03/test-description). +Each `test:Testcase` as the following properties: + +- `dcterms:identifier`: unique ID of the test case. +- `rmltest:hasError`: if an error of the RML Processor is expected or not. +- `rmltest:input`: One or more input data of the test case. +- `rmltest:output`: One or more output data of the test case. +- `rmltest:inputFormat`: the input data format. +- `rmltest:outputFormat`: the output data format. +- `rmltest:mappingDocument`: the RML mapping rules in Turtle. diff --git a/src/test/resources/rml-core/section/introduction.md b/src/test/resources/rml-core/section/introduction.md new file mode 100644 index 00000000..caad4497 --- /dev/null +++ b/src/test/resources/rml-core/section/introduction.md @@ -0,0 +1,4 @@ +# Introduction + +This document defines the RML-Core test cases, consisting of a collection of test case documents (input and expected output). +The purpose of the test cases is to determine the conformance of tools that execute RML rules to the RML-Core specification. diff --git a/src/test/resources/rml-core/section/test-cases.md b/src/test/resources/rml-core/section/test-cases.md new file mode 100644 index 00000000..63cd4274 --- /dev/null +++ b/src/test/resources/rml-core/section/test-cases.md @@ -0,0 +1,10 @@ +# Test cases + +This section describes the RML-Core test cases. These descriptions are also available as RDF. +The files are available on [GitHub](https://github.com/kg-construct/rml-core/tree/main/test-cases) in the folder `test-cases`. +Each test case is contained in a single folder, containing three types of files: + + - Zero or more files containing the data sources, in the case of JSON, XML, CSV, or containing the SQL statements to create the necessary tables, in the case of MySQL, PostgreSQL, and SQL Server. + - One file with the RML rules, called `mapping.ttl`, in the Turtle format. + - Zero or more files with the expected RDF. No file is provided if an error is expected that must halt the generation of the RDF because of an error. + diff --git a/src/test/resources/rml-fnml/README.md b/src/test/resources/rml-fnml/README.md new file mode 100644 index 00000000..1f7ff703 --- /dev/null +++ b/src/test/resources/rml-fnml/README.md @@ -0,0 +1,38 @@ +# FNML Test Cases + +Each test case is within a subfolder of this folder. + +If no output.nq file is present, an error is expected. + +All function descriptions are locally available under [functions.ttl](./functions.ttl). + +A nicely rendered HTML page of all test cases is available at https://w3id.org/rml/fnml/test-cases. + +## Functions that are used in these test cases + +`@prefix idlab-fn: .` +`@prefix grel: .` + +## Updating the metadata + +The test cases publication (html pages) can be generated as followed: + +1. Add the testcase description in `descriptions.csv` or fetch it from the [Google spreadsheet](https://docs.google.com/spreadsheets/d/1Ui216z2cF8bNAbdZvws-JoAhcjj4M2k_NlfzmCh1jh8/edit?gid=1793408313#gid=1793408313). +2. Execute the `make-metadata.py` script: `./make-metadata.py http://w3id.org/rml/fnml/` + (This is based on the content of the folders with the test cases, and on the file descriptions.csv for the descriptions of the cases) +3. Download burp: `curl -LO https://github.com/kg-construct/BURP/releases/download/v0.1.1/burp.jar` +4. Generate the manifest with [Burp](https://github.com/kg-construct/BURP): `java -jar burp.jar -m manifest.rml.ttl -o manifest.ttl -b http://w3id.org/rml/fnml/test/` +5. Run list.sh and insert output in dev.html +6. Set the `prevVersion` in config.js +7. To publish the new HTML verson of the test cases, export `dev.html` as `index.html` in ./docs and in a subfolder with the date of the publication (maybe adapt the publication date) + +## Open issues for which there are no test cases + +| title | purpose | +| - | - | +| Function on object, default termType | Tests if the default termType assigned to the output of the function in an object position to be correct | +| Function on subject, default termType | Tests if the default termType assigned to the output of the function in a subject position to be correct | +| Function using non-constant shortcut property function | Tests that a non-constant FNML Function map also works | +| Function using non-constant shortcut property return | Tests that a non-constant FNML Return map also works | +| Nested function - Test B | Tests if a composite function of form f(g(x1),h(x2)) works (i.e., two different inner functions are the arguments of the outer function) | +| Nested function - Test C | Tests if a composite function of form f(g(h(x1),x2),x3) works (i.e., the inner function is also a composite function) | diff --git a/src/test/resources/rml-fnml/RMLFNMLTC0001-CSV/README.md b/src/test/resources/rml-fnml/RMLFNMLTC0001-CSV/README.md new file mode 100644 index 00000000..625a34d4 --- /dev/null +++ b/src/test/resources/rml-fnml/RMLFNMLTC0001-CSV/README.md @@ -0,0 +1,59 @@ +## RMLFNMLTC0001-CSV + +**Title**: Function on object, 0 parameters + +**Description**: Tests +(1) if a function without parameters can be used (FnO) +(2) if a function on an object map can be used (Term) +(3) if the output of the function is assigned the correct termType by default + +**Error expected?** No + +**Input** +``` +Id,Name,Comment,Class +1,Venus,A&B,A + +``` + +**Mapping** +``` +@prefix foaf: . +@prefix ex: . +@prefix xsd: . +@prefix rml: . +@prefix fno: . +@prefix idlab-fn: . + +@base . + + + rml:logicalSource [ + rml:source [ a rml:RelativePathSource; + rml:root rml:MappingDirectory; + rml:path "student.csv" + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:template "http://example.com/{Name}" + ]; + rml:predicateObjectMap [ + rml:predicate foaf:name; + rml:objectMap [ + rml:functionExecution <#Execution> ; + rml:return idlab-fn:_stringOut + ] + ] . + +<#Execution> + rml:function idlab-fn:random . + +``` + +**Output** +``` + "e4dcc7ee-8e2a-4012-92cc-9a74dd545e89" . + +``` + diff --git a/src/test/resources/rml-fnml/RMLFNMLTC0001-CSV/mapping.ttl b/src/test/resources/rml-fnml/RMLFNMLTC0001-CSV/mapping.ttl new file mode 100644 index 00000000..ff9e9cc6 --- /dev/null +++ b/src/test/resources/rml-fnml/RMLFNMLTC0001-CSV/mapping.ttl @@ -0,0 +1,30 @@ +@prefix foaf: . +@prefix ex: . +@prefix xsd: . +@prefix rml: . +@prefix fno: . +@prefix idlab-fn: . + +@base . + + + rml:logicalSource [ + rml:source [ a rml:RelativePathSource; + rml:root rml:MappingDirectory; + rml:path "student.csv" + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:template "http://example.com/{Name}" + ]; + rml:predicateObjectMap [ + rml:predicate foaf:name; + rml:objectMap [ + rml:functionExecution <#Execution> ; + rml:return idlab-fn:_stringOut + ] + ] . + +<#Execution> + rml:function idlab-fn:random . diff --git a/src/test/resources/rml-fnml/RMLFNMLTC0001-CSV/output.nq b/src/test/resources/rml-fnml/RMLFNMLTC0001-CSV/output.nq new file mode 100644 index 00000000..a76f6853 --- /dev/null +++ b/src/test/resources/rml-fnml/RMLFNMLTC0001-CSV/output.nq @@ -0,0 +1 @@ + "e4dcc7ee-8e2a-4012-92cc-9a74dd545e89" . diff --git a/src/test/resources/rml-fnml/RMLFNMLTC0001-CSV/student.csv b/src/test/resources/rml-fnml/RMLFNMLTC0001-CSV/student.csv new file mode 100644 index 00000000..cb323e96 --- /dev/null +++ b/src/test/resources/rml-fnml/RMLFNMLTC0001-CSV/student.csv @@ -0,0 +1,2 @@ +Id,Name,Comment,Class +1,Venus,A&B,A diff --git a/src/test/resources/rml-fnml/RMLFNMLTC0002-CSV/README.md b/src/test/resources/rml-fnml/RMLFNMLTC0002-CSV/README.md new file mode 100644 index 00000000..6fee2cde --- /dev/null +++ b/src/test/resources/rml-fnml/RMLFNMLTC0002-CSV/README.md @@ -0,0 +1,65 @@ +## RMLFNMLTC0002-CSV + +**Title**: Function on object, 1 reference parameter + +**Description**: Tests: +(1) if a function with one parameter can be used, (FnO) +(2) a reference parameter can be used (Term) + +**Error expected?** No + +**Input** +``` +Id,Name,Comment,Class +1,Venus,A&B,A + +``` + +**Mapping** +``` +@prefix foaf: . +@prefix ex: . +@prefix xsd: . +@prefix rml: . +@prefix fno: . +@prefix grel: . + +@base . + + + rml:logicalSource [ + rml:source [ a rml:RelativePathSource; + rml:root rml:MappingDirectory; + rml:path "student.csv" + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:template "http://example.com/{Name}" + ]; + rml:predicateObjectMap [ + rml:predicate foaf:name; + rml:objectMap [ + rml:functionExecution <#Execution> ; + rml:return grel:stringOut + ] + ] . + +<#Execution> + rml:function grel:toUpperCase ; + rml:input + [ + rml:parameter grel:valueParam ; + rml:inputValueMap [ + rml:reference "Name" ; + ] + ] . + +``` + +**Output** +``` + "VENUS" . + +``` + diff --git a/src/test/resources/rml-fnml/RMLFNMLTC0002-CSV/mapping.ttl b/src/test/resources/rml-fnml/RMLFNMLTC0002-CSV/mapping.ttl new file mode 100644 index 00000000..381bac4d --- /dev/null +++ b/src/test/resources/rml-fnml/RMLFNMLTC0002-CSV/mapping.ttl @@ -0,0 +1,37 @@ +@prefix foaf: . +@prefix ex: . +@prefix xsd: . +@prefix rml: . +@prefix fno: . +@prefix grel: . + +@base . + + + rml:logicalSource [ + rml:source [ a rml:RelativePathSource; + rml:root rml:MappingDirectory; + rml:path "student.csv" + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:template "http://example.com/{Name}" + ]; + rml:predicateObjectMap [ + rml:predicate foaf:name; + rml:objectMap [ + rml:functionExecution <#Execution> ; + rml:return grel:stringOut + ] + ] . + +<#Execution> + rml:function grel:toUpperCase ; + rml:input + [ + rml:parameter grel:valueParam ; + rml:inputValueMap [ + rml:reference "Name" ; + ] + ] . diff --git a/src/test/resources/rml-fnml/RMLFNMLTC0002-CSV/output.nq b/src/test/resources/rml-fnml/RMLFNMLTC0002-CSV/output.nq new file mode 100644 index 00000000..d7e35a25 --- /dev/null +++ b/src/test/resources/rml-fnml/RMLFNMLTC0002-CSV/output.nq @@ -0,0 +1 @@ + "VENUS" . diff --git a/src/test/resources/rml-fnml/RMLFNMLTC0002-CSV/student.csv b/src/test/resources/rml-fnml/RMLFNMLTC0002-CSV/student.csv new file mode 100644 index 00000000..cb323e96 --- /dev/null +++ b/src/test/resources/rml-fnml/RMLFNMLTC0002-CSV/student.csv @@ -0,0 +1,2 @@ +Id,Name,Comment,Class +1,Venus,A&B,A diff --git a/src/test/resources/rml-fnml/RMLFNMLTC0003-CSV/README.md b/src/test/resources/rml-fnml/RMLFNMLTC0003-CSV/README.md new file mode 100644 index 00000000..14526730 --- /dev/null +++ b/src/test/resources/rml-fnml/RMLFNMLTC0003-CSV/README.md @@ -0,0 +1,65 @@ +## RMLFNMLTC0003-CSV + +**Title**: Function on object, 1 reference parameter, the output termType is IRI + +**Description**: Tests if the output of the function is assigned the correct termType + +**Error expected?** No + +**Input** +``` +Id,Name,Comment,Class,url +1,Venus,A&B,A,http://example.com/venus + +``` + +**Mapping** +``` +@prefix foaf: . +@prefix ex: . +@prefix xsd: . +@prefix rml: . +@prefix fno: . +@prefix grel: . +@prefix idlab-fn: . + +@base . + + + rml:logicalSource [ + rml:source [ a rml:RelativePathSource; + rml:root rml:MappingDirectory; + rml:path "student.csv" + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:template "http://example.com/{Name}" + ]; + rml:predicateObjectMap [ + rml:predicate foaf:name; + rml:objectMap [ + rml:functionExecution <#Execution> ; + rml:return idlab-fn:_stringOut ; + rml:termType rml:IRI + ]; + ] . + +<#Execution> + rml:function idlab-fn:toUpperCaseURL ; + rml:input + [ + rml:parameter idlab-fn:str ; + rml:inputValueMap [ + rml:reference "url" + ]; + ] . + +``` + +**Output** +``` + . + +``` + diff --git a/src/test/resources/rml-fnml/RMLFNMLTC0003-CSV/mapping.ttl b/src/test/resources/rml-fnml/RMLFNMLTC0003-CSV/mapping.ttl new file mode 100644 index 00000000..a5538774 --- /dev/null +++ b/src/test/resources/rml-fnml/RMLFNMLTC0003-CSV/mapping.ttl @@ -0,0 +1,39 @@ +@prefix foaf: . +@prefix ex: . +@prefix xsd: . +@prefix rml: . +@prefix fno: . +@prefix grel: . +@prefix idlab-fn: . + +@base . + + + rml:logicalSource [ + rml:source [ a rml:RelativePathSource; + rml:root rml:MappingDirectory; + rml:path "student.csv" + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:template "http://example.com/{Name}" + ]; + rml:predicateObjectMap [ + rml:predicate foaf:name; + rml:objectMap [ + rml:functionExecution <#Execution> ; + rml:return idlab-fn:_stringOut ; + rml:termType rml:IRI + ]; + ] . + +<#Execution> + rml:function idlab-fn:toUpperCaseURL ; + rml:input + [ + rml:parameter idlab-fn:str ; + rml:inputValueMap [ + rml:reference "url" + ]; + ] . diff --git a/src/test/resources/rml-fnml/RMLFNMLTC0003-CSV/output.nq b/src/test/resources/rml-fnml/RMLFNMLTC0003-CSV/output.nq new file mode 100644 index 00000000..617e154d --- /dev/null +++ b/src/test/resources/rml-fnml/RMLFNMLTC0003-CSV/output.nq @@ -0,0 +1 @@ + . diff --git a/src/test/resources/rml-fnml/RMLFNMLTC0003-CSV/student.csv b/src/test/resources/rml-fnml/RMLFNMLTC0003-CSV/student.csv new file mode 100644 index 00000000..97c6fdd2 --- /dev/null +++ b/src/test/resources/rml-fnml/RMLFNMLTC0003-CSV/student.csv @@ -0,0 +1,2 @@ +Id,Name,Comment,Class,url +1,Venus,A&B,A,http://example.com/venus diff --git a/src/test/resources/rml-fnml/RMLFNMLTC0004-CSV/README.md b/src/test/resources/rml-fnml/RMLFNMLTC0004-CSV/README.md new file mode 100644 index 00000000..8c70fae8 --- /dev/null +++ b/src/test/resources/rml-fnml/RMLFNMLTC0004-CSV/README.md @@ -0,0 +1,64 @@ +## RMLFNMLTC0004-CSV + +**Title**: Function on object, the output termType is Literal + +**Description**: Tests if the output of the function is assigned the correct termType + +**Error expected?** No + +**Input** +``` +Id,Name,Comment,Class,url +1,Venus,A&B,A,http://example.com/venus + +``` + +**Mapping** +``` +@prefix foaf: . +@prefix ex: . +@prefix xsd: . +@prefix rml: . +@prefix fno: . +@prefix grel: . +@prefix idlab-fn: . + +@base . + + + rml:logicalSource [ + rml:source [ a rml:RelativePathSource; + rml:root rml:MappingDirectory; + rml:path "student.csv" + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:template "http://example.com/{Name}" + ]; + rml:predicateObjectMap [ + rml:predicate foaf:name; + rml:objectMap [ + rml:functionExecution <#Execution> ; + rml:return grel:stringOut + ] + ] . + +<#Execution> + rml:function grel:length ; + rml:input + [ + rml:parameter grel:valueParam ; + rml:inputValueMap [ + rml:reference "Name" + ]; + ] . + +``` + +**Output** +``` + "5"^^ . + +``` + diff --git a/src/test/resources/rml-fnml/RMLFNMLTC0004-CSV/mapping.ttl b/src/test/resources/rml-fnml/RMLFNMLTC0004-CSV/mapping.ttl new file mode 100644 index 00000000..c17c9580 --- /dev/null +++ b/src/test/resources/rml-fnml/RMLFNMLTC0004-CSV/mapping.ttl @@ -0,0 +1,38 @@ +@prefix foaf: . +@prefix ex: . +@prefix xsd: . +@prefix rml: . +@prefix fno: . +@prefix grel: . +@prefix idlab-fn: . + +@base . + + + rml:logicalSource [ + rml:source [ a rml:RelativePathSource; + rml:root rml:MappingDirectory; + rml:path "student.csv" + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:template "http://example.com/{Name}" + ]; + rml:predicateObjectMap [ + rml:predicate foaf:name; + rml:objectMap [ + rml:functionExecution <#Execution> ; + rml:return grel:stringOut + ] + ] . + +<#Execution> + rml:function grel:length ; + rml:input + [ + rml:parameter grel:valueParam ; + rml:inputValueMap [ + rml:reference "Name" + ]; + ] . diff --git a/src/test/resources/rml-fnml/RMLFNMLTC0004-CSV/output.nq b/src/test/resources/rml-fnml/RMLFNMLTC0004-CSV/output.nq new file mode 100644 index 00000000..a0fb12b8 --- /dev/null +++ b/src/test/resources/rml-fnml/RMLFNMLTC0004-CSV/output.nq @@ -0,0 +1 @@ + "5"^^ . diff --git a/src/test/resources/rml-fnml/RMLFNMLTC0004-CSV/student.csv b/src/test/resources/rml-fnml/RMLFNMLTC0004-CSV/student.csv new file mode 100644 index 00000000..5c20b3cd --- /dev/null +++ b/src/test/resources/rml-fnml/RMLFNMLTC0004-CSV/student.csv @@ -0,0 +1,2 @@ +Id,Name,Comment,Class,url +1,Venus,A&B,A,http://example.com/venus diff --git a/src/test/resources/rml-fnml/RMLFNMLTC0005-CSV/README.md b/src/test/resources/rml-fnml/RMLFNMLTC0005-CSV/README.md new file mode 100644 index 00000000..e82355d0 --- /dev/null +++ b/src/test/resources/rml-fnml/RMLFNMLTC0005-CSV/README.md @@ -0,0 +1,63 @@ +## RMLFNMLTC0005-CSV + +**Title**: Function on object, 1 template parameter + +**Description**: Tests if a function with a template parameter can be used + +**Error expected?** No + +**Input** +``` +Id,Name,Comment,Class +1,Venus,A&B,A + +``` + +**Mapping** +``` +@prefix foaf: . +@prefix ex: . +@prefix xsd: . +@prefix rml: . +@prefix fno: . +@prefix grel: . + +@base . + + + rml:logicalSource [ + rml:source [ a rml:RelativePathSource; + rml:root rml:MappingDirectory; + rml:path "student.csv" + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:template "http://example.com/{Name}" + ]; + rml:predicateObjectMap [ + rml:predicate foaf:name; + rml:objectMap [ + rml:functionExecution <#Execution> ; + rml:return grel:stringOut + ] + ] . + +<#Execution> + rml:function grel:toUpperCase ; + rml:input + [ + rml:parameter grel:valueParam ; + rml:inputValueMap [ + rml:template "Name: {Name}" ; + ]; + ] . + +``` + +**Output** +``` + "NAME: VENUS" . + +``` + diff --git a/src/test/resources/rml-fnml/RMLFNMLTC0005-CSV/mapping.ttl b/src/test/resources/rml-fnml/RMLFNMLTC0005-CSV/mapping.ttl new file mode 100644 index 00000000..91cca314 --- /dev/null +++ b/src/test/resources/rml-fnml/RMLFNMLTC0005-CSV/mapping.ttl @@ -0,0 +1,37 @@ +@prefix foaf: . +@prefix ex: . +@prefix xsd: . +@prefix rml: . +@prefix fno: . +@prefix grel: . + +@base . + + + rml:logicalSource [ + rml:source [ a rml:RelativePathSource; + rml:root rml:MappingDirectory; + rml:path "student.csv" + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:template "http://example.com/{Name}" + ]; + rml:predicateObjectMap [ + rml:predicate foaf:name; + rml:objectMap [ + rml:functionExecution <#Execution> ; + rml:return grel:stringOut + ] + ] . + +<#Execution> + rml:function grel:toUpperCase ; + rml:input + [ + rml:parameter grel:valueParam ; + rml:inputValueMap [ + rml:template "Name: {Name}" ; + ]; + ] . diff --git a/src/test/resources/rml-fnml/RMLFNMLTC0005-CSV/output.nq b/src/test/resources/rml-fnml/RMLFNMLTC0005-CSV/output.nq new file mode 100644 index 00000000..dc75d983 --- /dev/null +++ b/src/test/resources/rml-fnml/RMLFNMLTC0005-CSV/output.nq @@ -0,0 +1 @@ + "NAME: VENUS" . diff --git a/src/test/resources/rml-fnml/RMLFNMLTC0005-CSV/student.csv b/src/test/resources/rml-fnml/RMLFNMLTC0005-CSV/student.csv new file mode 100644 index 00000000..cb323e96 --- /dev/null +++ b/src/test/resources/rml-fnml/RMLFNMLTC0005-CSV/student.csv @@ -0,0 +1,2 @@ +Id,Name,Comment,Class +1,Venus,A&B,A diff --git a/src/test/resources/rml-fnml/RMLFNMLTC0007-CSV/README.md b/src/test/resources/rml-fnml/RMLFNMLTC0007-CSV/README.md new file mode 100644 index 00000000..5a62c8c9 --- /dev/null +++ b/src/test/resources/rml-fnml/RMLFNMLTC0007-CSV/README.md @@ -0,0 +1,69 @@ +## RMLFNMLTC0007-CSV + +**Title**: Function on object returns empty string + +**Description**: Tests that a triple is generated when the results is an empty string. + +**Error expected?** No + +**Input** +``` +Id,Name,Comment,Class +1,Venus,A&B,A + +``` + +**Mapping** +``` +@prefix foaf: . +@prefix ex: . +@prefix xsd: . +@prefix rml: . +@prefix fno: . +@prefix grel: . +@prefix idlab-fn: . + +@base . + + + rml:logicalSource [ + rml:source [ a rml:RelativePathSource; + rml:root rml:MappingDirectory; + rml:path "student.csv" + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:template "http://example.com/{Name}" + ]; + rml:predicateObjectMap [ + rml:predicate foaf:name; + rml:objectMap [ + rml:functionExecution <#Execution> ; + rml:return grel:stringOut + ] + ] . + +<#Execution> + rml:function grel:string_substring ; + rml:input + [ + rml:parameter grel:valueParam ; + rml:inputValueMap [ + rml:reference "Name" + ]; + ] , + [ + a rml:Input ; + rml:parameter grel:p_int_i_from ; + rml:inputValue "5" + ] . + +``` + +**Output** +``` + "" . + +``` + diff --git a/src/test/resources/rml-fnml/RMLFNMLTC0007-CSV/mapping.ttl b/src/test/resources/rml-fnml/RMLFNMLTC0007-CSV/mapping.ttl new file mode 100644 index 00000000..bac6b3e3 --- /dev/null +++ b/src/test/resources/rml-fnml/RMLFNMLTC0007-CSV/mapping.ttl @@ -0,0 +1,43 @@ +@prefix foaf: . +@prefix ex: . +@prefix xsd: . +@prefix rml: . +@prefix fno: . +@prefix grel: . +@prefix idlab-fn: . + +@base . + + + rml:logicalSource [ + rml:source [ a rml:RelativePathSource; + rml:root rml:MappingDirectory; + rml:path "student.csv" + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:template "http://example.com/{Name}" + ]; + rml:predicateObjectMap [ + rml:predicate foaf:name; + rml:objectMap [ + rml:functionExecution <#Execution> ; + rml:return grel:stringOut + ] + ] . + +<#Execution> + rml:function grel:string_substring ; + rml:input + [ + rml:parameter grel:valueParam ; + rml:inputValueMap [ + rml:reference "Name" + ]; + ] , + [ + a rml:Input ; + rml:parameter grel:p_int_i_from ; + rml:inputValue "5" + ] . diff --git a/src/test/resources/rml-fnml/RMLFNMLTC0007-CSV/output.nq b/src/test/resources/rml-fnml/RMLFNMLTC0007-CSV/output.nq new file mode 100644 index 00000000..6629e021 --- /dev/null +++ b/src/test/resources/rml-fnml/RMLFNMLTC0007-CSV/output.nq @@ -0,0 +1 @@ + "" . diff --git a/src/test/resources/rml-fnml/RMLFNMLTC0007-CSV/student.csv b/src/test/resources/rml-fnml/RMLFNMLTC0007-CSV/student.csv new file mode 100644 index 00000000..052b9915 --- /dev/null +++ b/src/test/resources/rml-fnml/RMLFNMLTC0007-CSV/student.csv @@ -0,0 +1,2 @@ +Id,Name,Comment,Class +1,Venus,A&B,A diff --git a/src/test/resources/rml-fnml/RMLFNMLTC0008-CSV/README.md b/src/test/resources/rml-fnml/RMLFNMLTC0008-CSV/README.md new file mode 100644 index 00000000..28181b3e --- /dev/null +++ b/src/test/resources/rml-fnml/RMLFNMLTC0008-CSV/README.md @@ -0,0 +1,68 @@ +## RMLFNMLTC0008-CSV + +**Title**: Function on object returns null + +**Description**: Tests that no triple should be generated when the result is null. + +**Error expected?** No + +**Input** +``` +Id,Name,Comment,Class +1,Venus,A&B,A + +``` + +**Mapping** +``` +@prefix foaf: . +@prefix ex: . +@prefix xsd: . +@prefix rml: . +@prefix fno: . +@prefix grel: . +@prefix idlab-fn: . + +@base . + + + rml:logicalSource [ + rml:source [ a rml:RelativePathSource; + rml:root rml:MappingDirectory; + rml:path "student.csv" + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:template "http://example.com/{Name}" + ]; + rml:predicateObjectMap [ + rml:predicate foaf:name; + rml:objectMap [ + rml:functionExecution <#Execution> ; + rml:return grel:stringOut + ] + ] . + +<#Execution> + rml:function grel:string_substring ; + rml:input + [ + rml:parameter grel:valueParam ; + rml:inputValueMap [ + rml:reference "Name" + ]; + ] , + [ + a rml:Input ; + rml:parameter grel:p_int_i_from ; + rml:inputValue "1000" + ] . + +``` + +**Output** +``` + +``` + diff --git a/src/test/resources/rml-fnml/RMLFNMLTC0008-CSV/mapping.ttl b/src/test/resources/rml-fnml/RMLFNMLTC0008-CSV/mapping.ttl new file mode 100644 index 00000000..b21a92f7 --- /dev/null +++ b/src/test/resources/rml-fnml/RMLFNMLTC0008-CSV/mapping.ttl @@ -0,0 +1,43 @@ +@prefix foaf: . +@prefix ex: . +@prefix xsd: . +@prefix rml: . +@prefix fno: . +@prefix grel: . +@prefix idlab-fn: . + +@base . + + + rml:logicalSource [ + rml:source [ a rml:RelativePathSource; + rml:root rml:MappingDirectory; + rml:path "student.csv" + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:template "http://example.com/{Name}" + ]; + rml:predicateObjectMap [ + rml:predicate foaf:name; + rml:objectMap [ + rml:functionExecution <#Execution> ; + rml:return grel:stringOut + ] + ] . + +<#Execution> + rml:function grel:string_substring ; + rml:input + [ + rml:parameter grel:valueParam ; + rml:inputValueMap [ + rml:reference "Name" + ]; + ] , + [ + a rml:Input ; + rml:parameter grel:p_int_i_from ; + rml:inputValue "1000" + ] . diff --git a/src/test/resources/rml-core/RMLTC0000-SPARQL/output.nq b/src/test/resources/rml-fnml/RMLFNMLTC0008-CSV/output.nq similarity index 100% rename from src/test/resources/rml-core/RMLTC0000-SPARQL/output.nq rename to src/test/resources/rml-fnml/RMLFNMLTC0008-CSV/output.nq diff --git a/src/test/resources/rml-fnml/RMLFNMLTC0008-CSV/student.csv b/src/test/resources/rml-fnml/RMLFNMLTC0008-CSV/student.csv new file mode 100644 index 00000000..052b9915 --- /dev/null +++ b/src/test/resources/rml-fnml/RMLFNMLTC0008-CSV/student.csv @@ -0,0 +1,2 @@ +Id,Name,Comment,Class +1,Venus,A&B,A diff --git a/src/test/resources/rml-fnml/RMLFNMLTC0011-CSV/README.md b/src/test/resources/rml-fnml/RMLFNMLTC0011-CSV/README.md new file mode 100644 index 00000000..bd597668 --- /dev/null +++ b/src/test/resources/rml-fnml/RMLFNMLTC0011-CSV/README.md @@ -0,0 +1,64 @@ +## RMLFNMLTC0011-CSV + +**Title**: Function on predicate, 1 parameter + +**Description**: Tests if a function can be used on a predicate + +**Error expected?** No + +**Input** +``` +Id,Name,Comment,Class +1,Venus,A&B,A + +``` + +**Mapping** +``` +@prefix foaf: . +@prefix ex: . +@prefix xsd: . +@prefix rml: . +@prefix fno: . +@prefix grel: . +@prefix idlab-fn: . + +@base . + + + rml:logicalSource [ + rml:source [ a rml:RelativePathSource; + rml:root rml:MappingDirectory; + rml:path "student.csv" + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:template "http://example.com/{Name}" + ]; + rml:predicateObjectMap [ + rml:predicateMap [ + rml:functionExecution <#Execution> ; + rml:return idlab-fn:_stringOut + ]; + rml:object foaf:name; + ] . + +<#Execution> + rml:function idlab-fn:toUpperCaseURL ; + rml:input + [ + rml:parameter idlab-fn:str ; + rml:inputValueMap [ + rml:reference "Name" + ]; + ] . + +``` + +**Output** +``` + . + +``` + diff --git a/src/test/resources/rml-fnml/RMLFNMLTC0011-CSV/mapping.ttl b/src/test/resources/rml-fnml/RMLFNMLTC0011-CSV/mapping.ttl new file mode 100644 index 00000000..79e7738a --- /dev/null +++ b/src/test/resources/rml-fnml/RMLFNMLTC0011-CSV/mapping.ttl @@ -0,0 +1,38 @@ +@prefix foaf: . +@prefix ex: . +@prefix xsd: . +@prefix rml: . +@prefix fno: . +@prefix grel: . +@prefix idlab-fn: . + +@base . + + + rml:logicalSource [ + rml:source [ a rml:RelativePathSource; + rml:root rml:MappingDirectory; + rml:path "student.csv" + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:template "http://example.com/{Name}" + ]; + rml:predicateObjectMap [ + rml:predicateMap [ + rml:functionExecution <#Execution> ; + rml:return idlab-fn:_stringOut + ]; + rml:object foaf:name; + ] . + +<#Execution> + rml:function idlab-fn:toUpperCaseURL ; + rml:input + [ + rml:parameter idlab-fn:str ; + rml:inputValueMap [ + rml:reference "Name" + ]; + ] . diff --git a/src/test/resources/rml-fnml/RMLFNMLTC0011-CSV/output.nq b/src/test/resources/rml-fnml/RMLFNMLTC0011-CSV/output.nq new file mode 100644 index 00000000..42101211 --- /dev/null +++ b/src/test/resources/rml-fnml/RMLFNMLTC0011-CSV/output.nq @@ -0,0 +1 @@ + . diff --git a/src/test/resources/rml-fnml/RMLFNMLTC0011-CSV/student.csv b/src/test/resources/rml-fnml/RMLFNMLTC0011-CSV/student.csv new file mode 100644 index 00000000..cb323e96 --- /dev/null +++ b/src/test/resources/rml-fnml/RMLFNMLTC0011-CSV/student.csv @@ -0,0 +1,2 @@ +Id,Name,Comment,Class +1,Venus,A&B,A diff --git a/src/test/resources/rml-fnml/RMLFNMLTC0021-CSV/README.md b/src/test/resources/rml-fnml/RMLFNMLTC0021-CSV/README.md new file mode 100644 index 00000000..044f5c62 --- /dev/null +++ b/src/test/resources/rml-fnml/RMLFNMLTC0021-CSV/README.md @@ -0,0 +1,67 @@ +## RMLFNMLTC0021-CSV + +**Title**: Function on object, 1 reference parameter, 1 constant parameter + +**Description**: Tests if a function with multiple parameters can be used + +**Error expected?** No + +**Input** +``` +Id,Name,Comment,Class +1,Venus,A&B,A + +``` + +**Mapping** +``` +@prefix foaf: . +@prefix ex: . +@prefix xsd: . +@prefix rml: . +@prefix fno: . +@prefix grel: . + +@base . + + + rml:logicalSource [ + rml:source [ a rml:RelativePathSource; + rml:root rml:MappingDirectory; + rml:path "student.csv" + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:template "http://example.com/{Name}" + ]; + rml:predicateObjectMap [ + rml:predicate foaf:name; + rml:objectMap [ + rml:functionExecution <#Execution> ; + rml:return grel:stringOut + ] + ] . + +<#Execution> + rml:function grel:escape ; + rml:input + [ + rml:parameter grel:valueParam ; + rml:inputValueMap [ + rml:reference "Comment" + ] + ] , + [ + rml:parameter grel:modeParam ; + rml:inputValue "html" + ] . + +``` + +**Output** +``` + "A&B" . + +``` + diff --git a/src/test/resources/rml-fnml/RMLFNMLTC0021-CSV/mapping.ttl b/src/test/resources/rml-fnml/RMLFNMLTC0021-CSV/mapping.ttl new file mode 100644 index 00000000..63b9668c --- /dev/null +++ b/src/test/resources/rml-fnml/RMLFNMLTC0021-CSV/mapping.ttl @@ -0,0 +1,41 @@ +@prefix foaf: . +@prefix ex: . +@prefix xsd: . +@prefix rml: . +@prefix fno: . +@prefix grel: . + +@base . + + + rml:logicalSource [ + rml:source [ a rml:RelativePathSource; + rml:root rml:MappingDirectory; + rml:path "student.csv" + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:template "http://example.com/{Name}" + ]; + rml:predicateObjectMap [ + rml:predicate foaf:name; + rml:objectMap [ + rml:functionExecution <#Execution> ; + rml:return grel:stringOut + ] + ] . + +<#Execution> + rml:function grel:escape ; + rml:input + [ + rml:parameter grel:valueParam ; + rml:inputValueMap [ + rml:reference "Comment" + ] + ] , + [ + rml:parameter grel:modeParam ; + rml:inputValue "html" + ] . diff --git a/src/test/resources/rml-fnml/RMLFNMLTC0021-CSV/output.nq b/src/test/resources/rml-fnml/RMLFNMLTC0021-CSV/output.nq new file mode 100644 index 00000000..a51e1c4d --- /dev/null +++ b/src/test/resources/rml-fnml/RMLFNMLTC0021-CSV/output.nq @@ -0,0 +1 @@ + "A&B" . diff --git a/src/test/resources/rml-fnml/RMLFNMLTC0021-CSV/student.csv b/src/test/resources/rml-fnml/RMLFNMLTC0021-CSV/student.csv new file mode 100644 index 00000000..cb323e96 --- /dev/null +++ b/src/test/resources/rml-fnml/RMLFNMLTC0021-CSV/student.csv @@ -0,0 +1,2 @@ +Id,Name,Comment,Class +1,Venus,A&B,A diff --git a/src/test/resources/rml-fnml/RMLFNMLTC0031-CSV/README.md b/src/test/resources/rml-fnml/RMLFNMLTC0031-CSV/README.md new file mode 100644 index 00000000..a146e871 --- /dev/null +++ b/src/test/resources/rml-fnml/RMLFNMLTC0031-CSV/README.md @@ -0,0 +1,64 @@ +## RMLFNMLTC0031-CSV + +**Title**: Function on subject, 1 parameter + +**Description**: Tests if +(1) a function can be used on a subject +(2) Tests if the default termType assigned to the output of the function to be correct + +**Error expected?** No + +**Input** +``` +Id,Name,url +1,Venus,www.example.com + +``` + +**Mapping** +``` +@prefix foaf: . +@prefix ex: . +@prefix xsd: . +@prefix rml: . +@prefix fno: . +@prefix grel: . +@prefix idlab-fn: . + +@base . + + + rml:logicalSource [ + rml:source [ a rml:RelativePathSource; + rml:root rml:MappingDirectory; + rml:path "student.csv" + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:functionExecution <#Execution> ; + rml:return idlab-fn:_stringOut + ]; + rml:predicateObjectMap [ + rml:predicate foaf:name; + rml:objectMap [ rml:reference "Name"] + ] . + +<#Execution> + rml:function idlab-fn:toUpperCaseURL ; + rml:input + [ + rml:parameter idlab-fn:str ; + rml:inputValueMap [ + rml:reference "url" + ]; + ] . + +``` + +**Output** +``` + "Venus" . + +``` + diff --git a/src/test/resources/rml-fnml/RMLFNMLTC0031-CSV/mapping.ttl b/src/test/resources/rml-fnml/RMLFNMLTC0031-CSV/mapping.ttl new file mode 100644 index 00000000..20cedd9b --- /dev/null +++ b/src/test/resources/rml-fnml/RMLFNMLTC0031-CSV/mapping.ttl @@ -0,0 +1,36 @@ +@prefix foaf: . +@prefix ex: . +@prefix xsd: . +@prefix rml: . +@prefix fno: . +@prefix grel: . +@prefix idlab-fn: . + +@base . + + + rml:logicalSource [ + rml:source [ a rml:RelativePathSource; + rml:root rml:MappingDirectory; + rml:path "student.csv" + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:functionExecution <#Execution> ; + rml:return idlab-fn:_stringOut + ]; + rml:predicateObjectMap [ + rml:predicate foaf:name; + rml:objectMap [ rml:reference "Name"] + ] . + +<#Execution> + rml:function idlab-fn:toUpperCaseURL ; + rml:input + [ + rml:parameter idlab-fn:str ; + rml:inputValueMap [ + rml:reference "url" + ]; + ] . diff --git a/src/test/resources/rml-fnml/RMLFNMLTC0031-CSV/output.nq b/src/test/resources/rml-fnml/RMLFNMLTC0031-CSV/output.nq new file mode 100644 index 00000000..43ceda18 --- /dev/null +++ b/src/test/resources/rml-fnml/RMLFNMLTC0031-CSV/output.nq @@ -0,0 +1 @@ + "Venus" . diff --git a/src/test/resources/rml-fnml/RMLFNMLTC0031-CSV/student.csv b/src/test/resources/rml-fnml/RMLFNMLTC0031-CSV/student.csv new file mode 100644 index 00000000..ec727877 --- /dev/null +++ b/src/test/resources/rml-fnml/RMLFNMLTC0031-CSV/student.csv @@ -0,0 +1,2 @@ +Id,Name,url +1,Venus,www.example.com diff --git a/src/test/resources/rml-fnml/RMLFNMLTC0032-CSV/README.md b/src/test/resources/rml-fnml/RMLFNMLTC0032-CSV/README.md new file mode 100644 index 00000000..69a77e10 --- /dev/null +++ b/src/test/resources/rml-fnml/RMLFNMLTC0032-CSV/README.md @@ -0,0 +1,70 @@ +## RMLFNMLTC0032-CSV + +**Title**: Condition on subject + +**Description**: Tests that a condition shortcut works + +**Error expected?** No + +**Input** +``` +Id,Name,Class +1,Venus,A +1,Serena,B + +``` + +**Mapping** +``` +@prefix foaf: . +@prefix ex: . +@prefix xsd: . +@prefix rml: . +@prefix fno: . +@prefix grel: . +@prefix idlab-fn: . + +@base . + + + rml:logicalSource [ + rml:source [ a rml:RelativePathSource; + rml:root rml:MappingDirectory; + rml:path "student.csv" + ]; + rml:referenceFormulation rml:CSV + ] ; + rml:subjectMap [ + rml:condition [ + rml:functionExecution [ + rml:function idlab-fn:equal ; + rml:input [ + rml:parameter grel:valueParam ; + rml:inputValueMap [ + rml:reference "Class" + ] + ] , [ + rml:parameter grel:valueParam2 ; + rml:inputValue "A" ; + ] ; + ] ; + rml:return idlab-fn:_boolOut ; + ] ; + rml:template "http://example.com/{Name}" ; + ] ; + rml:predicateObjectMap [ + rml:predicate foaf:name ; + rml:objectMap [ + rml:reference "Name" ; + ] ; + ] ; +. + +``` + +**Output** +``` + "Venus" . + +``` + diff --git a/src/test/resources/rml-fnml/RMLFNMLTC0032-CSV/mapping.ttl b/src/test/resources/rml-fnml/RMLFNMLTC0032-CSV/mapping.ttl new file mode 100644 index 00000000..8c482d13 --- /dev/null +++ b/src/test/resources/rml-fnml/RMLFNMLTC0032-CSV/mapping.ttl @@ -0,0 +1,43 @@ +@prefix foaf: . +@prefix ex: . +@prefix xsd: . +@prefix rml: . +@prefix fno: . +@prefix grel: . +@prefix idlab-fn: . + +@base . + + + rml:logicalSource [ + rml:source [ a rml:RelativePathSource; + rml:root rml:MappingDirectory; + rml:path "student.csv" + ]; + rml:referenceFormulation rml:CSV + ] ; + rml:subjectMap [ + rml:condition [ + rml:functionExecution [ + rml:function idlab-fn:equal ; + rml:input [ + rml:parameter grel:valueParam ; + rml:inputValueMap [ + rml:reference "Class" + ] + ] , [ + rml:parameter grel:valueParam2 ; + rml:inputValue "A" ; + ] ; + ] ; + rml:return idlab-fn:_boolOut ; + ] ; + rml:template "http://example.com/{Name}" ; + ] ; + rml:predicateObjectMap [ + rml:predicate foaf:name ; + rml:objectMap [ + rml:reference "Name" ; + ] ; + ] ; +. diff --git a/src/test/resources/rml-core/RMLTC0001a-MySQL/output.nq b/src/test/resources/rml-fnml/RMLFNMLTC0032-CSV/output.nq similarity index 100% rename from src/test/resources/rml-core/RMLTC0001a-MySQL/output.nq rename to src/test/resources/rml-fnml/RMLFNMLTC0032-CSV/output.nq diff --git a/src/test/resources/rml-fnml/RMLFNMLTC0032-CSV/student.csv b/src/test/resources/rml-fnml/RMLFNMLTC0032-CSV/student.csv new file mode 100644 index 00000000..01546404 --- /dev/null +++ b/src/test/resources/rml-fnml/RMLFNMLTC0032-CSV/student.csv @@ -0,0 +1,3 @@ +Id,Name,Class +1,Venus,A +1,Serena,B diff --git a/src/test/resources/rml-fnml/RMLFNMLTC0041-CSV/README.md b/src/test/resources/rml-fnml/RMLFNMLTC0041-CSV/README.md new file mode 100644 index 00000000..0fd04319 --- /dev/null +++ b/src/test/resources/rml-fnml/RMLFNMLTC0041-CSV/README.md @@ -0,0 +1,65 @@ +## RMLFNMLTC0041-CSV + +**Title**: Function using non-constant shortcut property return + +**Description**: Tests that a non-constant FNML Return map also works + +**Error expected?** No + +**Input** +``` +Id,Name,Comment,Class,url +1,Venus,A&B,A,http://example.com/venus + +``` + +**Mapping** +``` +@prefix foaf: . +@prefix ex: . +@prefix xsd: . +@prefix rml: . +@prefix fno: . +@prefix grel: . + +@base . + + + rml:logicalSource [ + rml:source [ a rml:RelativePathSource; + rml:root rml:MappingDirectory; + rml:path "student.csv" + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:template "http://example.com/{Name}" + ]; + rml:predicateObjectMap [ + rml:predicate foaf:name; + rml:objectMap [ + rml:functionExecution <#Execution> ; + rml:returnMap [ + rml:constant grel:stringOut + ] + ] + ] . + +<#Execution> + rml:function grel:toUpperCase ; + rml:input + [ + rml:parameter grel:valueParam ; + rml:inputValueMap [ + rml:reference "Name" ; + ] + ] . + +``` + +**Output** +``` + "VENUS" . + +``` + diff --git a/src/test/resources/rml-fnml/RMLFNMLTC0041-CSV/mapping.ttl b/src/test/resources/rml-fnml/RMLFNMLTC0041-CSV/mapping.ttl new file mode 100644 index 00000000..3669cab8 --- /dev/null +++ b/src/test/resources/rml-fnml/RMLFNMLTC0041-CSV/mapping.ttl @@ -0,0 +1,39 @@ +@prefix foaf: . +@prefix ex: . +@prefix xsd: . +@prefix rml: . +@prefix fno: . +@prefix grel: . + +@base . + + + rml:logicalSource [ + rml:source [ a rml:RelativePathSource; + rml:root rml:MappingDirectory; + rml:path "student.csv" + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:template "http://example.com/{Name}" + ]; + rml:predicateObjectMap [ + rml:predicate foaf:name; + rml:objectMap [ + rml:functionExecution <#Execution> ; + rml:returnMap [ + rml:constant grel:stringOut + ] + ] + ] . + +<#Execution> + rml:function grel:toUpperCase ; + rml:input + [ + rml:parameter grel:valueParam ; + rml:inputValueMap [ + rml:reference "Name" ; + ] + ] . diff --git a/src/test/resources/rml-fnml/RMLFNMLTC0041-CSV/output.nq b/src/test/resources/rml-fnml/RMLFNMLTC0041-CSV/output.nq new file mode 100644 index 00000000..d7e35a25 --- /dev/null +++ b/src/test/resources/rml-fnml/RMLFNMLTC0041-CSV/output.nq @@ -0,0 +1 @@ + "VENUS" . diff --git a/src/test/resources/rml-fnml/RMLFNMLTC0041-CSV/student.csv b/src/test/resources/rml-fnml/RMLFNMLTC0041-CSV/student.csv new file mode 100644 index 00000000..97c6fdd2 --- /dev/null +++ b/src/test/resources/rml-fnml/RMLFNMLTC0041-CSV/student.csv @@ -0,0 +1,2 @@ +Id,Name,Comment,Class,url +1,Venus,A&B,A,http://example.com/venus diff --git a/src/test/resources/rml-fnml/RMLFNMLTC0051-CSV/README.md b/src/test/resources/rml-fnml/RMLFNMLTC0051-CSV/README.md new file mode 100644 index 00000000..510edf15 --- /dev/null +++ b/src/test/resources/rml-fnml/RMLFNMLTC0051-CSV/README.md @@ -0,0 +1,88 @@ +## RMLFNMLTC0051-CSV + +**Title**: Nested function - Test A + +**Description**: Tests if a composite function of form f(g(x1),x2) works (i.e., the inner function is only one argument of the outer function) + +**Error expected?** No + +**Input** +``` +Id,Name,Comment,Class +1,M Venus,A&B,A + +``` + +**Mapping** +``` +@prefix foaf: . +@prefix ex: . +@prefix xsd: . +@prefix rml: . +@prefix fno: . +@prefix grel: . +@prefix idlab-fn: . + +@base . + +<#Person_Mapping> + rml:logicalSource [ + rml:source [ a rml:RelativePathSource; + rml:root rml:MappingDirectory; + rml:path "student.csv" + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:template "http://example.com/{Name}" + ]; + rml:predicateObjectMap <#NameMapping> . + +<#NameMapping> + rml:predicate foaf:name ; + rml:objectMap [ + rml:functionExecution <#Execution> ; + rml:return grel:stringOut + ]; . + +<#Execution> a rml:FunctionExecution ; + rml:function grel:toUpperCase ; + rml:input + [ + a rml:Input ; + rml:parameter grel:valueParam ; + rml:inputValueMap [ + rml:functionExecution <#Execution2> ; + rml:return grel:stringOut + ] + ] . + +<#Execution2> a rml:Execution ; + rml:function grel:string_replace ; + rml:input + [ + a rml:Input ; + rml:parameter grel:valueParam ; + rml:inputValueMap [ + rml:reference "Name" + ] + ] , + [ + a rml:Input ; + rml:parameter grel:param_find ; + rml:inputValue " " + ] , + [ + a rml:Input ; + rml:parameter grel:param_replace ; + rml:inputValue "-" + ] . + +``` + +**Output** +``` + "M-VENUS" . + +``` + diff --git a/src/test/resources/rml-fnml/RMLFNMLTC0051-CSV/mapping.ttl b/src/test/resources/rml-fnml/RMLFNMLTC0051-CSV/mapping.ttl new file mode 100644 index 00000000..d23fd4d4 --- /dev/null +++ b/src/test/resources/rml-fnml/RMLFNMLTC0051-CSV/mapping.ttl @@ -0,0 +1,62 @@ +@prefix foaf: . +@prefix ex: . +@prefix xsd: . +@prefix rml: . +@prefix fno: . +@prefix grel: . +@prefix idlab-fn: . + +@base . + +<#Person_Mapping> + rml:logicalSource [ + rml:source [ a rml:RelativePathSource; + rml:root rml:MappingDirectory; + rml:path "student.csv" + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:template "http://example.com/{Name}" + ]; + rml:predicateObjectMap <#NameMapping> . + +<#NameMapping> + rml:predicate foaf:name ; + rml:objectMap [ + rml:functionExecution <#Execution> ; + rml:return grel:stringOut + ]; . + +<#Execution> a rml:FunctionExecution ; + rml:function grel:toUpperCase ; + rml:input + [ + a rml:Input ; + rml:parameter grel:valueParam ; + rml:inputValueMap [ + rml:functionExecution <#Execution2> ; + rml:return grel:stringOut + ] + ] . + +<#Execution2> a rml:Execution ; + rml:function grel:string_replace ; + rml:input + [ + a rml:Input ; + rml:parameter grel:valueParam ; + rml:inputValueMap [ + rml:reference "Name" + ] + ] , + [ + a rml:Input ; + rml:parameter grel:param_find ; + rml:inputValue " " + ] , + [ + a rml:Input ; + rml:parameter grel:param_replace ; + rml:inputValue "-" + ] . diff --git a/src/test/resources/rml-fnml/RMLFNMLTC0051-CSV/output.nq b/src/test/resources/rml-fnml/RMLFNMLTC0051-CSV/output.nq new file mode 100644 index 00000000..5e4ca542 --- /dev/null +++ b/src/test/resources/rml-fnml/RMLFNMLTC0051-CSV/output.nq @@ -0,0 +1 @@ + "M-VENUS" . diff --git a/src/test/resources/rml-fnml/RMLFNMLTC0051-CSV/student.csv b/src/test/resources/rml-fnml/RMLFNMLTC0051-CSV/student.csv new file mode 100644 index 00000000..adfc7a84 --- /dev/null +++ b/src/test/resources/rml-fnml/RMLFNMLTC0051-CSV/student.csv @@ -0,0 +1,2 @@ +Id,Name,Comment,Class +1,M Venus,A&B,A diff --git a/src/test/resources/rml-fnml/RMLFNMLTC0061-CSV/README.md b/src/test/resources/rml-fnml/RMLFNMLTC0061-CSV/README.md new file mode 100644 index 00000000..d1011901 --- /dev/null +++ b/src/test/resources/rml-fnml/RMLFNMLTC0061-CSV/README.md @@ -0,0 +1,69 @@ +## RMLFNMLTC0061-CSV + +**Title**: Function on graph, 1 parameter + +**Description**: Tests if a function can be used on a graph + +**Error expected?** No + +**Input** +``` +Id,Name,Comment,Class,url +1,Venus,A&B,A,http://example.com/venus + +``` + +**Mapping** +``` +@prefix foaf: . +@prefix ex: . +@prefix xsd: . +@prefix rml: . +@prefix fno: . +@prefix grel: . +@prefix idlab-fn: . + +@base . + + + rml:logicalSource [ + rml:source [ a rml:RelativePathSource; + rml:root rml:MappingDirectory; + rml:path "student.csv" + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:template "http://example.com/{Name}" ; + rml:graphMap [ + rml:functionExecution <#Execution> ; + rml:return idlab-fn:_stringOut + + ] + ]; + + rml:predicateObjectMap [ + rml:predicate foaf:name; + rml:objectMap [ + rml:reference "Name" + ] + ] . + +<#Execution> + rml:function idlab-fn:toUpperCaseURL ; + rml:input + [ + rml:parameter idlab-fn:str ; + rml:inputValueMap [ + rml:reference "url" ; + ] + ] . + +``` + +**Output** +``` + "Venus" . + +``` + diff --git a/src/test/resources/rml-fnml/RMLFNMLTC0061-CSV/mapping.ttl b/src/test/resources/rml-fnml/RMLFNMLTC0061-CSV/mapping.ttl new file mode 100644 index 00000000..7927ea4a --- /dev/null +++ b/src/test/resources/rml-fnml/RMLFNMLTC0061-CSV/mapping.ttl @@ -0,0 +1,43 @@ +@prefix foaf: . +@prefix ex: . +@prefix xsd: . +@prefix rml: . +@prefix fno: . +@prefix grel: . +@prefix idlab-fn: . + +@base . + + + rml:logicalSource [ + rml:source [ a rml:RelativePathSource; + rml:root rml:MappingDirectory; + rml:path "student.csv" + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:template "http://example.com/{Name}" ; + rml:graphMap [ + rml:functionExecution <#Execution> ; + rml:return idlab-fn:_stringOut + + ] + ]; + + rml:predicateObjectMap [ + rml:predicate foaf:name; + rml:objectMap [ + rml:reference "Name" + ] + ] . + +<#Execution> + rml:function idlab-fn:toUpperCaseURL ; + rml:input + [ + rml:parameter idlab-fn:str ; + rml:inputValueMap [ + rml:reference "url" ; + ] + ] . diff --git a/src/test/resources/rml-fnml/RMLFNMLTC0061-CSV/output.nq b/src/test/resources/rml-fnml/RMLFNMLTC0061-CSV/output.nq new file mode 100644 index 00000000..47140dcf --- /dev/null +++ b/src/test/resources/rml-fnml/RMLFNMLTC0061-CSV/output.nq @@ -0,0 +1 @@ + "Venus" . diff --git a/src/test/resources/rml-fnml/RMLFNMLTC0061-CSV/student.csv b/src/test/resources/rml-fnml/RMLFNMLTC0061-CSV/student.csv new file mode 100644 index 00000000..5c20b3cd --- /dev/null +++ b/src/test/resources/rml-fnml/RMLFNMLTC0061-CSV/student.csv @@ -0,0 +1,2 @@ +Id,Name,Comment,Class,url +1,Venus,A&B,A,http://example.com/venus diff --git a/src/test/resources/rml-fnml/RMLFNMLTC0071-CSV/README.md b/src/test/resources/rml-fnml/RMLFNMLTC0071-CSV/README.md new file mode 100644 index 00000000..3af5a785 --- /dev/null +++ b/src/test/resources/rml-fnml/RMLFNMLTC0071-CSV/README.md @@ -0,0 +1,72 @@ +## RMLFNMLTC0071-CSV + +**Title**: Function on datatypeMap, 1 parameter + +**Description**: Tests that function on DatatypeMap is handled + +**Error expected?** No + +**Input** +``` +Id,Name,Comment,Class,Type +1,Venus,A&B,A,http://www.w3.org/2001/XMLSchema#string + +``` + +**Mapping** +``` +@prefix foaf: . +@prefix ex: . +@prefix xsd: . +@prefix rml: . +@prefix fno: . +@prefix grel: . +@prefix idlab-fn: . + +@base . + + + rml:logicalSource [ + rml:source [ a rml:RelativePathSource; + rml:root rml:MappingDirectory; + rml:path "student.csv" + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:template "http://example.com/{Name}" + ]; + rml:predicateObjectMap [ + rml:predicate foaf:name; + rml:objectMap [ + rml:reference "Name" ; + rml:datatypeMap [ + rml:functionExecution <#Execution> ; + rml:return grel:stringOut + ] + ] + ] . + +<#Execution> + rml:function grel:string_substring ; + rml:input + [ + rml:parameter grel:valueParam ; + rml:inputValueMap [ + rml:reference "Type" + ]; + ] , + [ + a rml:Input ; + rml:parameter grel:p_int_i_from ; + rml:inputValue "0" + ] . + +``` + +**Output** +``` + "Venus"^^ . + +``` + diff --git a/src/test/resources/rml-fnml/RMLFNMLTC0071-CSV/mapping.ttl b/src/test/resources/rml-fnml/RMLFNMLTC0071-CSV/mapping.ttl new file mode 100644 index 00000000..a78dcba3 --- /dev/null +++ b/src/test/resources/rml-fnml/RMLFNMLTC0071-CSV/mapping.ttl @@ -0,0 +1,46 @@ +@prefix foaf: . +@prefix ex: . +@prefix xsd: . +@prefix rml: . +@prefix fno: . +@prefix grel: . +@prefix idlab-fn: . + +@base . + + + rml:logicalSource [ + rml:source [ a rml:RelativePathSource; + rml:root rml:MappingDirectory; + rml:path "student.csv" + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:template "http://example.com/{Name}" + ]; + rml:predicateObjectMap [ + rml:predicate foaf:name; + rml:objectMap [ + rml:reference "Name" ; + rml:datatypeMap [ + rml:functionExecution <#Execution> ; + rml:return grel:stringOut + ] + ] + ] . + +<#Execution> + rml:function grel:string_substring ; + rml:input + [ + rml:parameter grel:valueParam ; + rml:inputValueMap [ + rml:reference "Type" + ]; + ] , + [ + a rml:Input ; + rml:parameter grel:p_int_i_from ; + rml:inputValue "0" + ] . diff --git a/src/test/resources/rml-fnml/RMLFNMLTC0071-CSV/output.nq b/src/test/resources/rml-fnml/RMLFNMLTC0071-CSV/output.nq new file mode 100644 index 00000000..d0740b63 --- /dev/null +++ b/src/test/resources/rml-fnml/RMLFNMLTC0071-CSV/output.nq @@ -0,0 +1 @@ + "Venus"^^ . diff --git a/src/test/resources/rml-fnml/RMLFNMLTC0071-CSV/student.csv b/src/test/resources/rml-fnml/RMLFNMLTC0071-CSV/student.csv new file mode 100644 index 00000000..d4588918 --- /dev/null +++ b/src/test/resources/rml-fnml/RMLFNMLTC0071-CSV/student.csv @@ -0,0 +1,2 @@ +Id,Name,Comment,Class,Type +1,Venus,A&B,A,http://www.w3.org/2001/XMLSchema#string diff --git a/src/test/resources/rml-fnml/RMLFNMLTC0081-CSV/README.md b/src/test/resources/rml-fnml/RMLFNMLTC0081-CSV/README.md new file mode 100644 index 00000000..c96d4b23 --- /dev/null +++ b/src/test/resources/rml-fnml/RMLFNMLTC0081-CSV/README.md @@ -0,0 +1,72 @@ +## RMLFNMLTC0081-CSV + +**Title**: Function on languageMap, 1 parameter + +**Description**: Tests that function on LanguageMap is handled + +**Error expected?** No + +**Input** +``` +Id,Name,Comment,Class,Lang +1,Venus,A&B,A,en + +``` + +**Mapping** +``` +@prefix foaf: . +@prefix ex: . +@prefix xsd: . +@prefix rml: . +@prefix fno: . +@prefix grel: . +@prefix idlab-fn: . + +@base . + + + rml:logicalSource [ + rml:source [ a rml:RelativePathSource; + rml:root rml:MappingDirectory; + rml:path "student.csv" + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:template "http://example.com/{Name}" + ]; + rml:predicateObjectMap [ + rml:predicate foaf:name; + rml:objectMap [ + rml:reference "Name" ; + rml:languageMap [ + rml:functionExecution <#Execution> ; + rml:return grel:stringOut + ] ; + ] + ] . + +<#Execution> + rml:function grel:string_substring ; + rml:input + [ + rml:parameter grel:valueParam ; + rml:inputValueMap [ + rml:reference "Lang" + ]; + ] , + [ + a rml:Input ; + rml:parameter grel:p_int_i_from ; + rml:inputValue "0" + ] . + +``` + +**Output** +``` + "Venus"@en . + +``` + diff --git a/src/test/resources/rml-fnml/RMLFNMLTC0081-CSV/mapping.ttl b/src/test/resources/rml-fnml/RMLFNMLTC0081-CSV/mapping.ttl new file mode 100644 index 00000000..ef8573ad --- /dev/null +++ b/src/test/resources/rml-fnml/RMLFNMLTC0081-CSV/mapping.ttl @@ -0,0 +1,46 @@ +@prefix foaf: . +@prefix ex: . +@prefix xsd: . +@prefix rml: . +@prefix fno: . +@prefix grel: . +@prefix idlab-fn: . + +@base . + + + rml:logicalSource [ + rml:source [ a rml:RelativePathSource; + rml:root rml:MappingDirectory; + rml:path "student.csv" + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:template "http://example.com/{Name}" + ]; + rml:predicateObjectMap [ + rml:predicate foaf:name; + rml:objectMap [ + rml:reference "Name" ; + rml:languageMap [ + rml:functionExecution <#Execution> ; + rml:return grel:stringOut + ] ; + ] + ] . + +<#Execution> + rml:function grel:string_substring ; + rml:input + [ + rml:parameter grel:valueParam ; + rml:inputValueMap [ + rml:reference "Lang" + ]; + ] , + [ + a rml:Input ; + rml:parameter grel:p_int_i_from ; + rml:inputValue "0" + ] . diff --git a/src/test/resources/rml-fnml/RMLFNMLTC0081-CSV/output.nq b/src/test/resources/rml-fnml/RMLFNMLTC0081-CSV/output.nq new file mode 100644 index 00000000..ec2e5497 --- /dev/null +++ b/src/test/resources/rml-fnml/RMLFNMLTC0081-CSV/output.nq @@ -0,0 +1 @@ + "Venus"@en . diff --git a/src/test/resources/rml-fnml/RMLFNMLTC0081-CSV/student.csv b/src/test/resources/rml-fnml/RMLFNMLTC0081-CSV/student.csv new file mode 100644 index 00000000..56a4e2ad --- /dev/null +++ b/src/test/resources/rml-fnml/RMLFNMLTC0081-CSV/student.csv @@ -0,0 +1,2 @@ +Id,Name,Comment,Class,Lang +1,Venus,A&B,A,en diff --git a/src/test/resources/rml-fnml/RMLFNMLTC0101-CSV/README.md b/src/test/resources/rml-fnml/RMLFNMLTC0101-CSV/README.md new file mode 100644 index 00000000..1922b26f --- /dev/null +++ b/src/test/resources/rml-fnml/RMLFNMLTC0101-CSV/README.md @@ -0,0 +1,58 @@ +## RMLFNMLTC0101-CSV + +**Title**: Function on object, 1 false reference parameter + +**Description**: Tests if a false reference parameters is caught + +**Error expected?** Yes + +**Input** +``` +Id,Name,Comment,Class +1,Venus,A&B,A + +``` + +**Mapping** +``` +@prefix foaf: . +@prefix ex: . +@prefix xsd: . +@prefix rml: . +@prefix fno: . +@prefix grel: . +@prefix idlab-fn: . + +@base . + + + rml:logicalSource [ + rml:source [ a rml:RelativePathSource; + rml:root rml:MappingDirectory; + rml:path "student.csv" + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:template "http://example.com/{Name}" + ]; + rml:predicateObjectMap [ + rml:predicate foaf:name; + rml:objectMap [ + rml:functionExecution <#Execution> ; + rml:return grel:stringOut + ] + ] . + +<#Execution> + rml:function grel:toUpperCase ; + rml:input + [ + rml:parameter grel:valueParam ; + rml:inputValueMap [ + rml:reference "name" ; + ] + ] . + +``` + diff --git a/src/test/resources/rml-fnml/RMLFNMLTC0101-CSV/mapping.ttl b/src/test/resources/rml-fnml/RMLFNMLTC0101-CSV/mapping.ttl new file mode 100644 index 00000000..d7a024ea --- /dev/null +++ b/src/test/resources/rml-fnml/RMLFNMLTC0101-CSV/mapping.ttl @@ -0,0 +1,38 @@ +@prefix foaf: . +@prefix ex: . +@prefix xsd: . +@prefix rml: . +@prefix fno: . +@prefix grel: . +@prefix idlab-fn: . + +@base . + + + rml:logicalSource [ + rml:source [ a rml:RelativePathSource; + rml:root rml:MappingDirectory; + rml:path "student.csv" + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:template "http://example.com/{Name}" + ]; + rml:predicateObjectMap [ + rml:predicate foaf:name; + rml:objectMap [ + rml:functionExecution <#Execution> ; + rml:return grel:stringOut + ] + ] . + +<#Execution> + rml:function grel:toUpperCase ; + rml:input + [ + rml:parameter grel:valueParam ; + rml:inputValueMap [ + rml:reference "name" ; + ] + ] . diff --git a/src/test/resources/rml-fnml/RMLFNMLTC0101-CSV/student.csv b/src/test/resources/rml-fnml/RMLFNMLTC0101-CSV/student.csv new file mode 100644 index 00000000..cb323e96 --- /dev/null +++ b/src/test/resources/rml-fnml/RMLFNMLTC0101-CSV/student.csv @@ -0,0 +1,2 @@ +Id,Name,Comment,Class +1,Venus,A&B,A diff --git a/src/test/resources/rml-fnml/RMLFNMLTC0102-CSV/README.md b/src/test/resources/rml-fnml/RMLFNMLTC0102-CSV/README.md new file mode 100644 index 00000000..f9c01cc5 --- /dev/null +++ b/src/test/resources/rml-fnml/RMLFNMLTC0102-CSV/README.md @@ -0,0 +1,62 @@ +## RMLFNMLTC0102-CSV + +**Title**: Function on object, wrong function URI + +**Description**: Tests that nothing is generated if a function is used where no implementation is made available to the mapping engine + +**Error expected?** No + +**Input** +``` +Id,Name,Comment,Class +1,Venus,A&B,A + +``` + +**Mapping** +``` +@prefix foaf: . +@prefix ex: . +@prefix xsd: . +@prefix rml: . +@prefix fno: . +@prefix grel: . + +@base . + + + rml:logicalSource [ + rml:source [ a rml:RelativePathSource; + rml:root rml:MappingDirectory; + rml:path "student.csv" + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:template "http://example.com/{Name}" + ]; + rml:predicateObjectMap [ + rml:predicate foaf:name; + rml:objectMap [ + rml:functionExecution <#Execution> ; + rml:return grel:stringOut + ] + ] . + +<#Execution> + rml:function grel:unknown_func ; + rml:input + [ + rml:parameter grel:valueParam ; + rml:inputValueMap [ + rml:reference "Name" ; + ] + ] . + +``` + +**Output** +``` + +``` + diff --git a/src/test/resources/rml-fnml/RMLFNMLTC0102-CSV/mapping.ttl b/src/test/resources/rml-fnml/RMLFNMLTC0102-CSV/mapping.ttl new file mode 100644 index 00000000..a5978b6c --- /dev/null +++ b/src/test/resources/rml-fnml/RMLFNMLTC0102-CSV/mapping.ttl @@ -0,0 +1,37 @@ +@prefix foaf: . +@prefix ex: . +@prefix xsd: . +@prefix rml: . +@prefix fno: . +@prefix grel: . + +@base . + + + rml:logicalSource [ + rml:source [ a rml:RelativePathSource; + rml:root rml:MappingDirectory; + rml:path "student.csv" + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:template "http://example.com/{Name}" + ]; + rml:predicateObjectMap [ + rml:predicate foaf:name; + rml:objectMap [ + rml:functionExecution <#Execution> ; + rml:return grel:stringOut + ] + ] . + +<#Execution> + rml:function grel:unknown_func ; + rml:input + [ + rml:parameter grel:valueParam ; + rml:inputValueMap [ + rml:reference "Name" ; + ] + ] . diff --git a/src/test/resources/rml-io/RMLTTC0007b/default.nq b/src/test/resources/rml-fnml/RMLFNMLTC0102-CSV/output.nq similarity index 100% rename from src/test/resources/rml-io/RMLTTC0007b/default.nq rename to src/test/resources/rml-fnml/RMLFNMLTC0102-CSV/output.nq diff --git a/src/test/resources/rml-fnml/RMLFNMLTC0102-CSV/student.csv b/src/test/resources/rml-fnml/RMLFNMLTC0102-CSV/student.csv new file mode 100644 index 00000000..052b9915 --- /dev/null +++ b/src/test/resources/rml-fnml/RMLFNMLTC0102-CSV/student.csv @@ -0,0 +1,2 @@ +Id,Name,Comment,Class +1,Venus,A&B,A diff --git a/src/test/resources/rml-fnml/RMLFNMLTC0103-CSV/README.md b/src/test/resources/rml-fnml/RMLFNMLTC0103-CSV/README.md new file mode 100644 index 00000000..bfe7dd0b --- /dev/null +++ b/src/test/resources/rml-fnml/RMLFNMLTC0103-CSV/README.md @@ -0,0 +1,62 @@ +## RMLFNMLTC0103-CSV + +**Title**: Function on object, wrong parameter + +**Description**: Tests that nothing is generated if a function is defined using a parameter not defined in the FnO description + +**Error expected?** No + +**Input** +``` +Id,Name,Comment,Class,url +1,Venus,A&B,A,http://example.com/venus + +``` + +**Mapping** +``` +@prefix foaf: . +@prefix ex: . +@prefix xsd: . +@prefix rml: . +@prefix fno: . +@prefix grel: . + +@base . + + + rml:logicalSource [ + rml:source [ a rml:RelativePathSource; + rml:root rml:MappingDirectory; + rml:path "student.csv" + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:template "http://example.com/{Name}" + ]; + rml:predicateObjectMap [ + rml:predicate foaf:name; + rml:objectMap [ + rml:functionExecution <#Execution> ; + rml:return grel:stringOut + ] + ] . + +<#Execution> + rml:function grel:toUpperCase ; + rml:input + [ + rml:parameter grel:unknownParam ; + rml:inputValueMap [ + rml:reference "Name" ; + ] + ] . + +``` + +**Output** +``` + +``` + diff --git a/src/test/resources/rml-fnml/RMLFNMLTC0103-CSV/mapping.ttl b/src/test/resources/rml-fnml/RMLFNMLTC0103-CSV/mapping.ttl new file mode 100644 index 00000000..96cca0c4 --- /dev/null +++ b/src/test/resources/rml-fnml/RMLFNMLTC0103-CSV/mapping.ttl @@ -0,0 +1,37 @@ +@prefix foaf: . +@prefix ex: . +@prefix xsd: . +@prefix rml: . +@prefix fno: . +@prefix grel: . + +@base . + + + rml:logicalSource [ + rml:source [ a rml:RelativePathSource; + rml:root rml:MappingDirectory; + rml:path "student.csv" + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:template "http://example.com/{Name}" + ]; + rml:predicateObjectMap [ + rml:predicate foaf:name; + rml:objectMap [ + rml:functionExecution <#Execution> ; + rml:return grel:stringOut + ] + ] . + +<#Execution> + rml:function grel:toUpperCase ; + rml:input + [ + rml:parameter grel:unknownParam ; + rml:inputValueMap [ + rml:reference "Name" ; + ] + ] . diff --git a/src/test/resources/rml-io/RMLTTC0007c/default.nq b/src/test/resources/rml-fnml/RMLFNMLTC0103-CSV/output.nq similarity index 100% rename from src/test/resources/rml-io/RMLTTC0007c/default.nq rename to src/test/resources/rml-fnml/RMLFNMLTC0103-CSV/output.nq diff --git a/src/test/resources/rml-fnml/RMLFNMLTC0103-CSV/student.csv b/src/test/resources/rml-fnml/RMLFNMLTC0103-CSV/student.csv new file mode 100644 index 00000000..5c20b3cd --- /dev/null +++ b/src/test/resources/rml-fnml/RMLFNMLTC0103-CSV/student.csv @@ -0,0 +1,2 @@ +Id,Name,Comment,Class,url +1,Venus,A&B,A,http://example.com/venus diff --git a/src/test/resources/rml-fnml/RMLFNMLTC0104-CSV/README.md b/src/test/resources/rml-fnml/RMLFNMLTC0104-CSV/README.md new file mode 100644 index 00000000..8a02a345 --- /dev/null +++ b/src/test/resources/rml-fnml/RMLFNMLTC0104-CSV/README.md @@ -0,0 +1,62 @@ +## RMLFNMLTC0104-CSV + +**Title**: Function on object, wrong return parameter + +**Description**: Tests that nothing is generated if a function is defined using a return not defined in the FnO description + +**Error expected?** No + +**Input** +``` +Id,Name,Comment,Class,url +1,Venus,A&B,A,http://example.com/venus + +``` + +**Mapping** +``` +@prefix foaf: . +@prefix ex: . +@prefix xsd: . +@prefix rml: . +@prefix fno: . +@prefix grel: . + +@base . + + + rml:logicalSource [ + rml:source [ a rml:RelativePathSource; + rml:root rml:MappingDirectory; + rml:path "student.csv" + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:template "http://example.com/{Name}" + ]; + rml:predicateObjectMap [ + rml:predicate foaf:name; + rml:objectMap [ + rml:functionExecution <#Execution> ; + rml:return grel:unknownOut + ] + ] . + +<#Execution> + rml:function grel:toUpperCase ; + rml:input + [ + rml:parameter grel:valueParam ; + rml:inputValueMap [ + rml:reference "Name" ; + ] + ] . + +``` + +**Output** +``` + +``` + diff --git a/src/test/resources/rml-fnml/RMLFNMLTC0104-CSV/mapping.ttl b/src/test/resources/rml-fnml/RMLFNMLTC0104-CSV/mapping.ttl new file mode 100644 index 00000000..dd6c647f --- /dev/null +++ b/src/test/resources/rml-fnml/RMLFNMLTC0104-CSV/mapping.ttl @@ -0,0 +1,37 @@ +@prefix foaf: . +@prefix ex: . +@prefix xsd: . +@prefix rml: . +@prefix fno: . +@prefix grel: . + +@base . + + + rml:logicalSource [ + rml:source [ a rml:RelativePathSource; + rml:root rml:MappingDirectory; + rml:path "student.csv" + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:template "http://example.com/{Name}" + ]; + rml:predicateObjectMap [ + rml:predicate foaf:name; + rml:objectMap [ + rml:functionExecution <#Execution> ; + rml:return grel:unknownOut + ] + ] . + +<#Execution> + rml:function grel:toUpperCase ; + rml:input + [ + rml:parameter grel:valueParam ; + rml:inputValueMap [ + rml:reference "Name" ; + ] + ] . diff --git a/src/test/resources/rml-io/RMLTTC0007d/default.nq b/src/test/resources/rml-fnml/RMLFNMLTC0104-CSV/output.nq similarity index 100% rename from src/test/resources/rml-io/RMLTTC0007d/default.nq rename to src/test/resources/rml-fnml/RMLFNMLTC0104-CSV/output.nq diff --git a/src/test/resources/rml-fnml/RMLFNMLTC0104-CSV/student.csv b/src/test/resources/rml-fnml/RMLFNMLTC0104-CSV/student.csv new file mode 100644 index 00000000..5c20b3cd --- /dev/null +++ b/src/test/resources/rml-fnml/RMLFNMLTC0104-CSV/student.csv @@ -0,0 +1,2 @@ +Id,Name,Comment,Class,url +1,Venus,A&B,A,http://example.com/venus diff --git a/src/test/resources/rml-fnml/config.js b/src/test/resources/rml-fnml/config.js new file mode 100644 index 00000000..8427457d --- /dev/null +++ b/src/test/resources/rml-fnml/config.js @@ -0,0 +1,93 @@ +async function loadTurtle() { + //this is the function you call in 'preProcess', to load the highlighter + const worker = await new Promise(resolve => { + require(["core/worker"], ({ worker }) => resolve(worker)); + }); + const action = "highlight-load-lang"; + const langURL = + "https://cdn.jsdelivr.net/gh/redmer/highlightjs-turtle/src/languages/turtle.js"; + const propName = "hljsDefineTurtle"; // This funtion is defined in the highlighter being loaded + const lang = "turtle"; // this is the class you use to identify the language + worker.postMessage({ action, langURL, propName, lang }); + return new Promise(resolve => { + worker.addEventListener("message", function listener({ data }) { + const { action: responseAction, lang: responseLang } = data; + if (responseAction === action && responseLang === lang) { + worker.removeEventListener("message", listener); + resolve(); + } + }); + }); +} + +var respecConfig = { + // check https://respec.org/docs/ for the meaning of these keys + preProcess: [loadTurtle], + authors: [ + { + name: "Dylan Van Assche", + url: "https://dylanvanassche.be", + company: "IDLab – Ghent University – imec", + orcid: "0000-0002-7195-9935", + companyURL: "https://knows.idlab.ugent.be/" + }, { + name: "Ben De Meester", + company: "Ghent University – imec – IDLab", + url: "https://ben.de-meester.org/#me", + orcid: "0000-0003-0248-0987", + companyURL: "https://knows.idlab.ugent.be/" + }, { + name: "Tobias Schweizer" + }, { + name: "Els de Vleeschauwer", + company: "Ghent University – imec – IDLab", + orcid: "0000-0002-8630-3947", + companyURL: "https://knows.idlab.ugent.be/" + } + ], + edDraftURI: "https://w3id.org/rml/fnml/test-cases/", + editors: [ + { + name: "Dylan Van Assche", + url: "https://dylanvanassche.be", + company: "IDLab – Ghent University – imec", + orcid: "0000-0002-7195-9935", + companyURL: "https://knows.idlab.ugent.be/" + }, + { + name: "Ben De Meester", + company: "Ghent University – imec – IDLab", + url: "https://ben.de-meester.org/#me", + orcid: "0000-0003-0248-0987", + companyURL: "https://knows.idlab.ugent.be/" + } + ], + formerEditors: [ + ], + github: "https://github.com/kg-construct/rml-fnml", + license: "w3c-software-doc", + localBiblio: { + "RML-Core": { + title: "RML-Core", + href: "https://w3id.org/rml/core/spec", + status: "Draft Community Group Report", + publisher: "W3C", + date: "07 August 2024", + }, + "RML-IO": { + title: "RML-IO", + href: "https://w3id.org/rml/io/spec", + status: "Draft Community Group Report", + publisher: "W3C", + date: "12 March 2024", + }, + }, + otherLinks: [], + shortName: "RML-FNML-Testcases", + specStatus: "CG-DRAFT", + // W3C config + copyrightStart: "2024", + doJsonLd: true, + prevVersion: "https://kg-construct.github.io/rml-fnml/test-cases/docs/20250630/", + group: "kg-construct", +}; diff --git a/src/test/resources/rml-fnml/descriptions.csv b/src/test/resources/rml-fnml/descriptions.csv new file mode 100644 index 00000000..a1915826 --- /dev/null +++ b/src/test/resources/rml-fnml/descriptions.csv @@ -0,0 +1,28 @@ +ID,title,description,part of spec,data format,ref. formulation,error expected?,input file 1,input file 2,input file 3,comment +RMLFNMLTC0001-CSV,"Function on object, 0 parameters","Tests +(1) if a function without parameters can be used (FnO) +(2) if a function on an object map can be used (Term) +(3) if the output of the function is assigned the correct termType by default",,CSV,CSV,FALSE,student.csv,,, +RMLFNMLTC0002-CSV,"Function on object, 1 reference parameter","Tests: +(1) if a function with one parameter can be used, (FnO) +(2) a reference parameter can be used (Term)",,CSV,CSV,FALSE,student.csv,,, +RMLFNMLTC0003-CSV,"Function on object, 1 reference parameter, the output termType is IRI",Tests if the output of the function is assigned the correct termType,,CSV,CSV,FALSE,student.csv,,, +RMLFNMLTC0004-CSV,"Function on object, the output termType is Literal",Tests if the output of the function is assigned the correct termType,,CSV,CSV,FALSE,student.csv,,, +RMLFNMLTC0005-CSV,"Function on object, 1 template parameter",Tests if a function with a template parameter can be used,,CSV,CSV,FALSE,student.csv,,, +RMLFNMLTC0007-CSV,Function on object returns empty string,Tests that a triple is generated when the results is an empty string.,,CSV,CSV,FALSE,student.csv,,, +RMLFNMLTC0008-CSV,Function on object returns null,Tests that no triple should be generated when the result is null.,,CSV,CSV,FALSE,student.csv,,, +RMLFNMLTC0011-CSV,"Function on predicate, 1 parameter",Tests if a function can be used on a predicate,,CSV,CSV,FALSE,student.csv,,, +RMLFNMLTC0021-CSV,"Function on object, 1 reference parameter, 1 constant parameter",Tests if a function with multiple parameters can be used,,CSV,CSV,FALSE,student.csv,,, +RMLFNMLTC0031-CSV,"Function on subject, 1 parameter","Tests if +(1) a function can be used on a subject +(2) Tests if the default termType assigned to the output of the function to be correct",,CSV,CSV,FALSE,student.csv,,, +RMLFNMLTC0032-CSV,Condition on subject,Tests that a condition shortcut works,,,,,,,, +RMLFNMLTC0041-CSV,Function using non-constant shortcut property return,Tests that a non-constant FNML Return map also works,,CSV,CSV,FALSE,student.csv,,,"does this can be tested with SHACL? If yes, I think this wouldn't be a test-case" +RMLFNMLTC0051-CSV,Nested function - Test A,"Tests if a composite function of form f(g(x1),x2) works (i.e., the inner function is only one argument of the outer function)",,CSV,CSV,FALSE,student.csv,,, +RMLFNMLTC0061-CSV,"Function on graph, 1 parameter",Tests if a function can be used on a graph,,CSV,CSV,FALSE,student.csv,,,RML example: https://kg-construct.github.io/rml-core/spec/docs/#example-graph-map +RMLFNMLTC0071-CSV,"Function on datatypeMap, 1 parameter",Tests that function on DatatypeMap is handled,,CSV,CSV,FALSE,student.csv,,,RML example: https://kg-construct.github.io/rml-core/spec/docs/#example-datatype-map +RMLFNMLTC0081-CSV,"Function on languageMap, 1 parameter",Tests that function on LanguageMap is handled,,CSV,CSV,FALSE,student.csv,,,RML example: https://kg-construct.github.io/rml-core/spec/docs/#example-language-map +RMLFNMLTC0101-CSV,"Function on object, 1 false reference parameter",Tests if a false reference parameters is caught,,CSV,CSV,TRUE,student.csv,,, +RMLFNMLTC0102-CSV,"Function on object, wrong function URI",Tests that nothing is generated if a function is used where no implementation is made available to the mapping engine,,CSV,CSV,TRUE,student.csv,,, +RMLFNMLTC0103-CSV,"Function on object, wrong parameter",Tests that nothing is generated if a function is defined using a parameter not defined in the FnO description,,CSV,CSV,TRUE,student.csv,,, +RMLFNMLTC0104-CSV,"Function on object, wrong return parameter",Tests that nothing is generated if a function is defined using a return not defined in the FnO description,,CSV,CSV,TRUE,student.csv,,, \ No newline at end of file diff --git a/src/test/resources/rml-fnml/dev.html b/src/test/resources/rml-fnml/dev.html new file mode 100644 index 00000000..1b2422a4 --- /dev/null +++ b/src/test/resources/rml-fnml/dev.html @@ -0,0 +1,120 @@ + + + + + RML-FNML: Test Cases + + + + + + + + + + +
+ +
+ +
+ +
+ +
+ + +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ + + + diff --git a/src/test/resources/rml-fnml/docs/20250130/index.html b/src/test/resources/rml-fnml/docs/20250130/index.html new file mode 100644 index 00000000..f66c763f --- /dev/null +++ b/src/test/resources/rml-fnml/docs/20250130/index.html @@ -0,0 +1,1325 @@ + + + + + + +RML-FNML: Test Cases + + + + + + + + + + + + + + +
+ +

RML-FNML: Test Cases

+

+ Draft Community Group Report + +

+
+ +
Latest published version:
+ https://www.w3.org/RML-FNML-Testcases/ +
+
Latest editor's draft:
https://w3id.org/rml/fnml/test-cases/
+ + + + +
Editor:
+ Dylan Van Assche + + + + (IDLab – Ghent University – imec) +
+ +
Author:
+ Dylan Van Assche + + + + (IDLab – Ghent University – imec) +
+
Feedback:
+ GitHub kg-construct/rml-fnml + (pull requests, + new issue, + open issues) +
+ +
+ + +
+
+ + + +

Abstract

This document defines the RML-FNML test cases to the determine the RML-FNML specification conformance of tools.

+
+ +

Status of This Document

+ This specification was published by the + Knowledge Graph Construction Community Group. It is not a W3C Standard nor is it + on the W3C Standards Track. + + Please note that under the + W3C Community Contributor License Agreement (CLA) + there is a limited opt-out and other conditions apply. + + Learn more about + W3C Community and Business Groups. +

+ GitHub Issues are preferred for + discussion of this specification. + + +

+ +

1. Introduction

+

This document defines the RML-FNML test cases, consisting of a collection of test case documents (input and expected output). +The purpose of the test cases is to determine the conformance of tools that execute RML rules to the RML-FNML specification.

+
+ +

2. Data model

+

The test cases are semantically described for re-usability and shareability following the W3C Test case description. +Each test:Testcase as the following properties:

+
    +
  • dcterms:identifier: unique ID of the test case.
  • +
  • rmltest:hasError: if an error of the RML Processor is expected or not.
  • +
  • rmltest:input: One or more input data of the test case.
  • +
  • rmltest:output: One or more output data of the test case.
  • +
  • rmltest:inputFormat: the input data format.
  • +
  • rmltest:outputFormat: the output data format.
  • +
  • rmltest:mappingDocument: the RML mapping rules in Turtle.
  • +
+
+ +

3. Test cases

+

This section describes the RML-FNML test cases. These descriptions are also available as RDF. +The files are available on GitHub in the folder test-cases. +Each test case is contained in a single folder, containing three types of files:

+
    +
  • Zero or more files containing the data sources, in the case of JSON, XML, CSV, or containing the SQL statements to create the necessary tables, in the case of MySQL, PostgreSQL, and SQL Server.
  • +
  • One file with the RML rules, called mapping.ttl, in the Turtle format.
  • +
  • Zero or more files with the expected RDF. No file is provided if an error is expected that must halt the generation of the RDF because of an error.
  • +
+
+ + +

4. RMLFNOTC0000b-CSV

+

Title: Function on object, default termType

+

Description: Tests if the output of the function is assigned the correct termType by default

+

Error expected? No

+

Input

+
Id,Name,Comment,Class
+1,Venus,A&B,A
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix ex: <http://example.com/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix fno: <https://w3id.org/function/ontology#> .
+@prefix fns: <http://example.com/functions/> .
+@prefix grel: <http://users.ugent.be/~bjdmeest/function/grel.ttl#> .
+@prefix idlab-fn: <http://example.com/idlab/function/> .
+
+@base <http://example.com/base/> .
+
+<TriplesMap1>
+    rml:logicalSource [
+        rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.csv"
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example.com/{Name}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicate foaf:name;
+        rml:objectMap [
+            rml:functionExecution <#Execution> ;
+        ]
+    ] .
+
+<#Execution>
+    rml:function fns:helloworld .
+
+

Output

+
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "Hello World!" .
+
+
+

5. RMLFNOTC0000-CSV

+

Title: Function on object, 0 parameters

+

Description: Tests +(1) if a function without parameters can be used (FnO) +(2) if a function on an object map can be used (Term)

+

Error expected? No

+

Input

+
Id,Name,Comment,Class
+1,Venus,A&B,A
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix ex: <http://example.com/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix fno: <https://w3id.org/function/ontology#> .
+@prefix morph-kgc: <https://github.com/morph-kgc/morph-kgc/function/built-in.ttl#> .
+@prefix grel: <http://users.ugent.be/~bjdmeest/function/grel.ttl#> .
+@prefix idlab-fn: <http://example.com/idlab/function/> .
+
+@base <http://example.com/base/> .
+
+<TriplesMap1>
+    rml:logicalSource [
+        rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.csv"
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example.com/{Name}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicate foaf:name;
+        rml:objectMap [
+            rml:functionExecution <#Execution> ;
+        ]
+    ] .
+
+<#Execution>
+    rml:function morph-kgc:uuid .
+
+

Output

+
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "e4dcc7ee-8e2a-4012-92cc-9a74dd545e89" .
+
+
+

6. RMLFNOTC0001-CSV

+

Title: Function on object, 1 reference parameter

+

Description: Tests: +(1) if a function with one parameter can be used, (FnO) +(2) a reference parameter can be used (Term)

+

Error expected? No

+

Input

+
Id,Name,Comment,Class
+1,Venus,A&B,A
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix ex: <http://example.com/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix fno: <https://w3id.org/function/ontology#> .
+@prefix morph-kgc: <https://github.com/morph-kgc/morph-kgc/function/built-in.ttl#> .
+@prefix grel: <http://users.ugent.be/~bjdmeest/function/grel.ttl#> .
+@prefix idlab-fn: <http://example.com/idlab/function/> .
+
+@base <http://example.com/base/> .
+
+<TriplesMap1>
+    rml:logicalSource [
+        rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.csv"
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example.com/{Name}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicate foaf:name;
+        rml:objectMap [
+            rml:functionExecution <#Execution> ;
+        ]
+    ] .
+
+<#Execution>
+    rml:function grel:toUpperCase ;
+    rml:input
+        [
+            rml:parameter grel:valueParam ;
+            rml:inputValueMap [
+                rml:reference "Name" ;
+            ]
+        ] .
+
+

Output

+
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "VENUS" .
+
+
+

7. RMLFNOTC0002-CSV

+

Title: Function using non-constant shortcut property parameter

+

Description: Tests that a non-constant FNML Parameter map also works

+

Error expected? Yes

+

Input

+
Id,Name,Comment,Class
+1,Venus,A&B,A
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix ex: <http://example.com/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix fno: <https://w3id.org/function/ontology#> .
+@prefix morph-kgc: <https://github.com/morph-kgc/morph-kgc/function/built-in.ttl#> .
+@prefix grel: <http://users.ugent.be/~bjdmeest/function/grel.ttl#> .
+@prefix idlab-fn: <http://example.com/idlab/function/> .
+
+@base <http://example.com/base/> .
+
+<TriplesMap1>
+    rml:logicalSource [
+        rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.csv"
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example.com/{Name}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicate foaf:name;
+        rml:objectMap [
+            rml:functionExecution <#Execution> ;
+        ]
+    ] .
+
+<#Execution>
+    rml:function grel:toUpperCase ;
+    rml:input
+        [
+            rml:parameter grel:valueParam ;
+            rml:inputValueMap [
+                rml:reference "name" ;
+            ]
+        ] .
+
+
+

8. RMLFNOTC0003-CSV

+

Title: Function on object, 1 false reference parameter

+

Description: Tests if a false reference parameters is caught

+

Error expected? No

+

Input

+
Id,Name,Comment,Class
+1,Venus,A&B,A
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix ex: <http://example.com/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix fno: <https://w3id.org/function/ontology#> .
+@prefix morph-kgc: <https://github.com/morph-kgc/morph-kgc/function/built-in.ttl#> .
+@prefix grel: <http://users.ugent.be/~bjdmeest/function/grel.ttl#> .
+@prefix idlab-fn: <http://example.com/idlab/function/> .
+
+@base <http://example.com/base/> .
+
+<TriplesMap1>
+    rml:logicalSource [
+        rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.csv"
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example.com/{Name}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicate foaf:name;
+        rml:objectMap [
+            rml:functionExecution <#Execution> ;
+        ]
+    ] .
+
+<#Execution>
+    rml:function grel:escape ;
+    rml:input
+        [
+            rml:parameter grel:valueParam ;
+            rml:inputValueMap [
+                rml:reference "Comment"
+            ]
+        ] ,
+        [
+            rml:parameter grel:modeParam  ;
+            rml:inputValue "html"
+        ] .
+
+

Output

+
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "A&B" .
+
+
+

9. RMLFNOTC0004b-CSV

+

Title: Function on predicate, 1 parameter

+

Description: Tests if a function can be used on a predicate

+

Error expected? No

+

Input

+
Id,Name,Comment,Class
+1,Venus,A&B,A
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix ex: <http://example.com/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix fno: <https://w3id.org/function/ontology#> .
+@prefix fns: <http://example.com/functions/> .
+@prefix morph-kgc: <https://github.com/morph-kgc/morph-kgc/function/built-in.ttl#> .
+@prefix grel: <http://users.ugent.be/~bjdmeest/function/grel.ttl#> .
+@prefix idlab-fn: <http://example.com/idlab/function/> .
+
+@base <http://example.com/base/> .
+
+<TriplesMap1>
+    rml:logicalSource [
+        rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.csv"
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example.com/{Name}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicateMap [
+            rml:functionExecution <#Execution> ;
+        ];
+        rml:object foaf:name;
+    ] .
+
+<#Execution>
+    rml:function fns:schema ;
+    rml:input
+        [
+            rml:parameter fns:stringParameter ;
+            rml:inputValueMap [
+                rml:reference "Name"
+            ];
+        ] .
+
+

Output

+
<http://example.com/Venus> <https://schema.org/Venus> <http://xmlns.com/foaf/0.1/name> .
+
+
+

10. RMLFNOTC0004-CSV

+

Title: Function on object, 1 reference parameter, 1 constant parameter

+

Description: Tests if a function with multiple parameters can be used

+

Error expected? No

+

Input

+
Id,Name,Comment,Class
+1,Venus,A&B,A
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix ex: <http://example.com/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix fno: <https://w3id.org/function/ontology#> .
+@prefix morph-kgc: <https://github.com/morph-kgc/morph-kgc/function/built-in.ttl#> .
+@prefix grel: <http://users.ugent.be/~bjdmeest/function/grel.ttl#> .
+@prefix idlab-fn: <http://example.com/idlab/function/> .
+
+@base <http://example.com/base/> .
+
+<TriplesMap1>
+    rml:logicalSource [
+        rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.csv"
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example.com/{Name}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicateMap [
+            rml:functionExecution <#Execution> ;
+        ];
+        rml:object foaf:name;
+    ] .
+
+<#Execution>
+    rml:function idlab-fn:toUpperCaseURL ;
+    rml:input
+        [
+            rml:parameter idlab-fn:str ;
+            rml:inputValueMap [
+                rml:reference "Name"
+            ];
+        ] .
+
+

Output

+
<http://example.com/Venus> <http://VENUS> <http://xmlns.com/foaf/0.1/name> .
+
+
+

11. RMLFNOTC0005b-CSV

+

Title: Function on subject, default termType

+

Description: Tests if the default termType assigned to the output of the function to be correct

+

Error expected? No

+

Input

+
Id,Name,url
+1,Venus,www.example.com
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix ex: <http://example.com/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix fno: <https://w3id.org/function/ontology#> .
+@prefix fns: <http://example.com/functions/> .
+@prefix morph-kgc: <https://github.com/morph-kgc/morph-kgc/function/built-in.ttl#> .
+@prefix grel: <http://users.ugent.be/~bjdmeest/function/grel.ttl#> .
+@prefix idlab-fn: <http://example.com/idlab/function/> .
+
+@base <http://example.com/base/> .
+
+<TriplesMap1>
+    rml:logicalSource [
+        rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.csv"
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:functionExecution <#Execution> ;
+    ];
+    rml:predicateObjectMap [
+        rml:predicate foaf:name;
+        rml:objectMap [ rml:reference "Name"]
+    ] .
+
+<#Execution>
+    rml:function fns:schema ;
+    rml:input
+        [
+            rml:parameter fns:stringParameter ;
+            rml:inputValueMap [
+                rml:reference "Name"
+            ];
+        ] .
+
+

Output

+
<https://schema.org/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
+
+
+

12. RMLFNOTC0005-CSV

+

Title: Function on subject, 1 parameter

+

Description: Tests if a function can be used on a subject

+

Error expected? No

+

Input

+
Id,Name,url
+1,Venus,www.example.com
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix ex: <http://example.com/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix fno: <https://w3id.org/function/ontology#> .
+@prefix morph-kgc: <https://github.com/morph-kgc/morph-kgc/function/built-in.ttl#> .
+@prefix grel: <http://users.ugent.be/~bjdmeest/function/grel.ttl#> .
+@prefix idlab-fn: <http://example.com/idlab/function/> .
+
+@base <http://example.com/base/> .
+
+<TriplesMap1>
+    rml:logicalSource [
+        rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.csv"
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:functionExecution <#Execution> ;
+    ];
+    rml:predicateObjectMap [
+        rml:predicate foaf:name;
+        rml:objectMap [ rml:reference "Name"]
+    ] .
+
+<#Execution>
+    rml:function idlab-fn:toUpperCaseURL ;
+    rml:input
+        [
+            rml:parameter idlab-fn:str ;
+            rml:inputValueMap [
+                rml:reference "url"
+            ];
+        ] .
+
+

Output

+
<http://WWW.EXAMPLE.COM> <http://xmlns.com/foaf/0.1/name> "Venus" .
+
+
+

13. RMLFNOTC0006b-CSV

+

Title: Function on object, 1 template parameter

+

Description: Tests if a function with a template parameter can be used

+

Error expected? No

+

Input

+
Id,Name,Comment,Class,url
+1,Venus,A&B,A,http://example.com/venus
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix ex: <http://example.com/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix fno: <https://w3id.org/function/ontology#> .
+@prefix fns: <http://example.com/functions/> .
+@prefix morph-kgc: <https://github.com/morph-kgc/morph-kgc/function/built-in.ttl#> .
+@prefix grel: <http://users.ugent.be/~bjdmeest/function/grel.ttl#> .
+@prefix idlab-fn: <http://example.com/idlab/function/> .
+
+@base <http://example.com/base/> .
+
+<TriplesMap1>
+    rml:logicalSource [
+        rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.csv"
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example.com/{Name}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicate foaf:name;
+        rml:objectMap [
+            rml:functionExecution <#Execution> ;
+            rml:termType rml:IRI
+        ];
+    ] .
+
+<#Execution>
+    rml:function fns:schema ;
+    rml:input
+        [
+            rml:parameter fns:stringParameter ;
+            rml:inputValueMap [
+                rml:reference "Name"
+            ];
+        ] .
+
+

Output

+
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> <https://schema.org/Venus> .
+
+
+

14. RMLFNOTC0006-CSV

+

Title: Function on object, the output termType is IRI

+

Description: Tests if the output of the function is assigned the correct termType

+

Error expected? No

+

Input

+
Id,Name,Comment,Class,url
+1,Venus,A&B,A,http://example.com/venus
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix ex: <http://example.com/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix fno: <https://w3id.org/function/ontology#> .
+@prefix morph-kgc: <https://github.com/morph-kgc/morph-kgc/function/built-in.ttl#> .
+@prefix grel: <http://users.ugent.be/~bjdmeest/function/grel.ttl#> .
+@prefix idlab-fn: <http://example.com/idlab/function/> .
+
+@base <http://example.com/base/> .
+
+<TriplesMap1>
+    rml:logicalSource [
+        rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.csv"
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example.com/{Name}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicate foaf:name;
+        rml:objectMap [
+            rml:functionExecution <#Execution> ;
+            rml:termType rml:IRI
+        ];
+    ] .
+
+<#Execution>
+    rml:function idlab-fn:toUpperCaseURL ;
+    rml:input
+        [
+            rml:parameter idlab-fn:str ;
+            rml:inputValueMap [
+                rml:reference "url"
+            ];
+        ] .
+
+

Output

+
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> <HTTP://EXAMPLE.COM/VENUS> .
+
+
+

15. RMLFNOTC0008-CSV

+

Title: Nested function - Test A

+

Description: Tests if a composite function of form f(g(x1),x2) works (i.e., the inner function is only one argument of the outer function)

+

Error expected? No

+

Input

+
Id,Name,Comment,Class
+1,Venus,A&B,A
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix ex: <http://example.com/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix fno: <https://w3id.org/function/ontology#> .
+@prefix morph-kgc: <https://github.com/morph-kgc/morph-kgc/function/built-in.ttl#> .
+@prefix grel: <http://users.ugent.be/~bjdmeest/function/grel.ttl#> .
+@prefix idlab-fn: <http://example.com/idlab/function/> .
+
+@base <http://example.com/base/> .
+
+<TriplesMap1>
+    rml:logicalSource [
+        rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.csv"
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example.com/{Name}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicate foaf:name;
+        rml:objectMap [ rml:functionExecution <#Execution> ] ;
+    ] .
+
+<#Execution>
+    rml:function grel:toUpperCase ;
+    rml:input
+        [
+            rml:parameter grel:valueParam ;
+            rml:inputValueMap [
+                rml:template "Name: {Name}"
+            ];
+        ] .
+
+

Output

+
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "NAME: VENUS" .
+
+
+

16. RMLFNOTC0009-CSV

+

Title: Function on object, 1 constant parameter

+

Description: Tests if a constant parameter can be used

+

Error expected? No

+

Input

+
Id,Name,Comment,Class
+1,M Venus,A&B,A
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix ex: <http://example.com/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix fno: <https://w3id.org/function/ontology#> .
+@prefix morph-kgc: <https://github.com/morph-kgc/morph-kgc/function/built-in.ttl#> .
+@prefix grel: <http://users.ugent.be/~bjdmeest/function/grel.ttl#> .
+@prefix idlab-fn: <http://example.com/idlab/function/> .
+
+@base <http://example.com/base/> .
+
+<#Person_Mapping>
+    rml:logicalSource [
+        rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.csv"
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example.com/{Name}"
+    ];
+    rml:predicateObjectMap <#NameMapping> .
+
+<#NameMapping>
+    rml:predicate foaf:name ;
+    rml:objectMap [
+        rml:functionExecution <#Execution> ;
+    ]; .
+
+<#Execution> a rml:FunctionExecution ;
+    rml:function grel:toUpperCase ;
+    rml:input
+        [
+            a rml:Input ;
+            rml:parameter grel:valueParam ;
+            rml:inputValueMap [
+                rml:functionExecution <#Execution2> ;
+                rml:return grel:stringOut
+            ]
+        ] .
+
+<#Execution2> a rml:Execution ;
+    rml:function grel:string_replace ;
+    rml:input
+        [
+            a rml:Input ;
+            rml:parameter grel:valueParam ;
+            rml:inputValueMap [
+                rml:reference "Name"
+            ]
+        ] ,
+        [
+            a rml:Input ;
+            rml:parameter grel:param_find ;
+            rml:inputValue " "
+        ] ,
+        [
+            a rml:Input ;
+            rml:parameter grel:param_replace  ;
+            rml:inputValue "-"
+        ] .
+
+

Output

+
<http://example.com/M%20Venus> <http://xmlns.com/foaf/0.1/name> "M-VENUS" .
+
+
+

17. RMLFNOTC0010-CSV

+

Title: Function on object, wrong type parameter

+

Description: Tests a function with a wrong type parameter cannot be used

+

Error expected? No

+

Input

+
Id,Name,Comment,Class,url
+1,Venus,A&B,A,http://example.com/venus
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix ex: <http://example.com/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix fno: <https://w3id.org/function/ontology#> .
+@prefix fns: <http://example.com/functions/> .
+@prefix morph-kgc: <https://github.com/morph-kgc/morph-kgc/function/built-in.ttl#> .
+@prefix grel: <http://users.ugent.be/~bjdmeest/function/grel.ttl#> .
+@prefix idlab-fn: <http://example.com/idlab/function/> .
+
+@base <http://example.com/base/> .
+
+<TriplesMap1>
+    rml:logicalSource [
+        rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.csv"
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example.com/{Name}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicate foaf:name;
+        rml:objectMap [
+            rml:functionExecution <#Execution> ;
+            rml:returnMap [
+                rml:constant fns:domainOutput
+            ]
+        ]
+    ] .
+
+<#Execution>
+    rml:function fns:parseURL ;
+    rml:input
+        [
+            rml:parameter fns:stringParameter ;
+            rml:inputValueMap [
+                rml:reference "url" ;
+            ]
+        ] .
+
+

Output

+
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "example.com" .
+
+
+ + + + + diff --git a/src/test/resources/rml-fnml/docs/20250303/index.html b/src/test/resources/rml-fnml/docs/20250303/index.html new file mode 100644 index 00000000..c5504b93 --- /dev/null +++ b/src/test/resources/rml-fnml/docs/20250303/index.html @@ -0,0 +1,1496 @@ + + + + + + +RML-FNML: Test Cases + + + + + + + + + + + + + + +
+ +

RML-FNML: Test Cases

+

+ Draft Community Group Report + +

+
+ +
Latest published version:
+ https://www.w3.org/RML-FNML-Testcases/ +
+
Latest editor's draft:
https://w3id.org/rml/fnml/test-cases/
+ + + + +
Editor:
+ Dylan Van Assche + + + + (IDLab – Ghent University – imec) +
+ +
Author:
+ Dylan Van Assche + + + + (IDLab – Ghent University – imec) +
+
Feedback:
+ GitHub kg-construct/rml-fnml + (pull requests, + new issue, + open issues) +
+ +
+ + +
+
+ + + +

Abstract

This document defines the RML-FNML test cases to the determine the RML-FNML specification conformance of tools.

+
+ +

Status of This Document

+ This specification was published by the + Knowledge Graph Construction Community Group. It is not a W3C Standard nor is it + on the W3C Standards Track. + + Please note that under the + W3C Community Contributor License Agreement (CLA) + there is a limited opt-out and other conditions apply. + + Learn more about + W3C Community and Business Groups. +

+ GitHub Issues are preferred for + discussion of this specification. + + +

+ +

1. Introduction

+

This document defines the RML-FNML test cases, consisting of a collection of test case documents (input and expected output). +The purpose of the test cases is to determine the conformance of tools that execute RML rules to the RML-FNML specification.

+
+ +

2. Data model

+

The test cases are semantically described for re-usability and shareability following the W3C Test case description. +Each test:Testcase as the following properties:

+
    +
  • dcterms:identifier: unique ID of the test case.
  • +
  • rmltest:hasError: if an error of the RML Processor is expected or not.
  • +
  • rmltest:input: One or more input data of the test case.
  • +
  • rmltest:output: One or more output data of the test case.
  • +
  • rmltest:inputFormat: the input data format.
  • +
  • rmltest:outputFormat: the output data format.
  • +
  • rmltest:mappingDocument: the RML mapping rules in Turtle.
  • +
+
+ +

3. Test cases

+

This section describes the RML-FNML test cases. These descriptions are also available as RDF. +The files are available on GitHub in the folder test-cases. +Each test case is contained in a single folder, containing three types of files:

+
    +
  • Zero or more files containing the data sources, in the case of JSON, XML, CSV, or containing the SQL statements to create the necessary tables, in the case of MySQL, PostgreSQL, and SQL Server.
  • +
  • One file with the RML rules, called mapping.ttl, in the Turtle format.
  • +
  • Zero or more files with the expected RDF. No file is provided if an error is expected that must halt the generation of the RDF because of an error.
  • +
+
+ + +

4. RMLFNMLTC0001-CSV

+

Title: Function on object, 0 parameters

+

Description: Tests +(1) if a function without parameters can be used (FnO) +(2) if a function on an object map can be used (Term) +(3) if the output of the function is assigned the correct termType by default

+

Error expected? No

+

Input

+
Id,Name,Comment,Class
+1,Venus,A&B,A
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix ex: <http://example.com/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix fno: <https://w3id.org/function/ontology#> .
+@prefix idlab-fn: <https://w3id.org/imec/idlab/function#> .
+
+@base <http://example.com/base/> .
+
+<TriplesMap1>
+    rml:logicalSource [
+        rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.csv"
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example.com/{Name}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicate foaf:name;
+        rml:objectMap [
+            rml:functionExecution <#Execution> ;
+            rml:return idlab-fn:_stringOut
+        ]
+    ] .
+
+<#Execution>
+    rml:function idlab-fn:random .
+
+

Output

+
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "e4dcc7ee-8e2a-4012-92cc-9a74dd545e89" .
+
+
+

5. RMLFNMLTC0002-CSV

+

Title: Function on object, 1 reference parameter

+

Description: Tests: +(1) if a function with one parameter can be used, (FnO) +(2) a reference parameter can be used (Term)

+

Error expected? No

+

Input

+
Id,Name,Comment,Class
+1,Venus,A&B,A
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix ex: <http://example.com/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix fno: <https://w3id.org/function/ontology#> .
+@prefix grel: <http://users.ugent.be/~bjdmeest/function/grel.ttl#> .
+
+@base <http://example.com/base/> .
+
+<TriplesMap1>
+    rml:logicalSource [
+        rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.csv"
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example.com/{Name}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicate foaf:name;
+        rml:objectMap [
+            rml:functionExecution <#Execution> ;
+            rml:return grel:stringOut
+        ]
+    ] .
+
+<#Execution>
+    rml:function grel:toUpperCase ;
+    rml:input
+        [
+            rml:parameter grel:valueParam ;
+            rml:inputValueMap [
+                rml:reference "Name" ;
+            ]
+        ] .
+
+

Output

+
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "VENUS" .
+
+
+

6. RMLFNMLTC0003-CSV

+

Title: Function on object, 1 reference parameter, the output termType is IRI

+

Description: Tests if the output of the function is assigned the correct termType

+

Error expected? No

+

Input

+
Id,Name,Comment,Class,url
+1,Venus,A&B,A,http://example.com/venus
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix ex: <http://example.com/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix fno: <https://w3id.org/function/ontology#> .
+@prefix grel: <http://users.ugent.be/~bjdmeest/function/grel.ttl#> .
+@prefix idlab-fn: <https://w3id.org/imec/idlab/function#> .
+
+@base <http://example.com/base/> .
+
+<TriplesMap1>
+    rml:logicalSource [
+        rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.csv"
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example.com/{Name}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicate foaf:name;
+        rml:objectMap [
+            rml:functionExecution <#Execution> ;
+            rml:return idlab-fn:_stringOut ;
+            rml:termType rml:IRI
+        ];
+    ] .
+
+<#Execution>
+    rml:function idlab-fn:toUpperCaseURL ;
+    rml:input
+        [
+            rml:parameter idlab-fn:str ;
+            rml:inputValueMap [
+                rml:reference "url"
+            ];
+        ] .
+
+

Output

+
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> <HTTP://EXAMPLE.COM/VENUS> .
+
+
+

7. RMLFNMLTC0004-CSV

+

Title: Function on object, the output termType is Literal

+

Description: Tests if the output of the function is assigned the correct termType

+

Error expected? No

+

Input

+
Id,Name,Comment,Class,url
+1,Venus,A&B,A,http://example.com/venus
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix ex: <http://example.com/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix fno: <https://w3id.org/function/ontology#> .
+@prefix grel: <http://users.ugent.be/~bjdmeest/function/grel.ttl#> .
+@prefix idlab-fn: <https://w3id.org/imec/idlab/function#> .
+
+@base <http://example.com/base/> .
+
+<TriplesMap1>
+    rml:logicalSource [
+        rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.csv"
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example.com/{Name}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicate foaf:name;
+        rml:objectMap [
+            rml:functionExecution <#Execution> ;
+            rml:return grel:stringOut
+        ]
+    ] .
+
+<#Execution>
+    rml:function grel:length ;
+    rml:input
+        [
+            rml:parameter grel:valueParam ;
+            rml:inputValueMap [
+                rml:reference "Name"
+            ];
+        ]  .
+
+

Output

+
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "5"^^<http://www.w3.org/2001/XMLSchema#integer> .
+
+
+

8. RMLFNMLTC0005-CSV

+

Title: Function on object, 1 template parameter

+

Description: Tests if a function with a template parameter can be used

+

Error expected? No

+

Input

+
Id,Name,Comment,Class
+1,Venus,A&B,A
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix ex: <http://example.com/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix fno: <https://w3id.org/function/ontology#> .
+@prefix grel: <http://users.ugent.be/~bjdmeest/function/grel.ttl#> .
+
+@base <http://example.com/base/> .
+
+<TriplesMap1>
+    rml:logicalSource [
+        rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.csv"
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example.com/{Name}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicate foaf:name;
+        rml:objectMap [
+            rml:functionExecution <#Execution> ;
+            rml:return grel:stringOut
+        ]
+    ] .
+
+<#Execution>
+    rml:function grel:toUpperCase ;
+    rml:input
+        [
+            rml:parameter grel:valueParam ;
+            rml:inputValueMap [
+                rml:template "Name: {Name}" ;
+            ];
+        ] .
+
+

Output

+
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "NAME: VENUS" .
+
+
+

9. RMLFNMLTC0007-CSV

+

Title: Function on object returns empty string

+

Description: Tests that a triple is generated when the results is an empty string.

+

Error expected? No

+

Input

+
Id,Name,Comment,Class
+1,Venus,A&B,A
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix ex: <http://example.com/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix fno: <https://w3id.org/function/ontology#> .
+@prefix grel: <http://users.ugent.be/~bjdmeest/function/grel.ttl#> .
+@prefix idlab-fn: <https://w3id.org/imec/idlab/function#> .
+
+@base <http://example.com/base/> .
+
+<TriplesMap1>
+    rml:logicalSource [
+        rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.csv"
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example.com/{Name}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicate foaf:name;
+        rml:objectMap [
+            rml:functionExecution <#Execution> ;
+            rml:return grel:stringOut
+        ]
+    ] .
+
+<#Execution>
+    rml:function grel:string_substring ;
+    rml:input
+        [
+            rml:parameter grel:valueParam ;
+            rml:inputValueMap [
+                rml:reference "Name"
+            ];
+        ]  ,
+        [
+            a rml:Input ;
+            rml:parameter grel:p_int_i_from ;
+            rml:inputValue "5"
+        ]  .
+
+

Output

+
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "" .
+
+
+

10. RMLFNMLTC0008-CSV

+

Title: Function on object returns null

+

Description: Tests that no triple should be generated when the result is null.

+

Error expected? No

+

Input

+
Id,Name,Comment,Class
+1,Venus,A&B,A
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix ex: <http://example.com/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix fno: <https://w3id.org/function/ontology#> .
+@prefix grel: <http://users.ugent.be/~bjdmeest/function/grel.ttl#> .
+@prefix idlab-fn: <https://w3id.org/imec/idlab/function#> .
+
+@base <http://example.com/base/> .
+
+<TriplesMap1>
+    rml:logicalSource [
+        rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.csv"
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example.com/{Name}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicate foaf:name;
+        rml:objectMap [
+            rml:functionExecution <#Execution> ;
+            rml:return grel:stringOut
+        ]
+    ] .
+
+<#Execution>
+    rml:function grel:string_substring ;
+    rml:input
+        [
+            rml:parameter grel:valueParam ;
+            rml:inputValueMap [
+                rml:reference "Name"
+            ];
+        ]  ,
+        [
+            a rml:Input ;
+            rml:parameter grel:p_int_i_from ;
+            rml:inputValue "1000"
+        ]  .
+
+

Output

+

+
+
+

11. RMLFNMLTC0011-CSV

+

Title: Function on predicate, 1 parameter

+

Description: Tests if a function can be used on a predicate

+

Error expected? No

+

Input

+
Id,Name,Comment,Class
+1,Venus,A&B,A
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix ex: <http://example.com/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix fno: <https://w3id.org/function/ontology#> .
+@prefix grel: <http://users.ugent.be/~bjdmeest/function/grel.ttl#> .
+@prefix idlab-fn: <https://w3id.org/imec/idlab/function#> .
+
+@base <http://example.com/base/> .
+
+<TriplesMap1>
+    rml:logicalSource [
+        rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.csv"
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example.com/{Name}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicateMap [
+            rml:functionExecution <#Execution> ;
+            rml:return idlab-fn:_stringOut
+        ];
+        rml:object foaf:name;
+    ] .
+
+<#Execution>
+    rml:function idlab-fn:toUpperCaseURL ;
+    rml:input
+        [
+            rml:parameter idlab-fn:str ;
+            rml:inputValueMap [
+                rml:reference "Name"
+            ];
+        ] .
+
+

Output

+
<http://example.com/Venus> <http://VENUS> <http://xmlns.com/foaf/0.1/name> .
+
+
+

12. RMLFNMLTC0021-CSV

+

Title: Function on object, 1 reference parameter, 1 constant parameter

+

Description: Tests if a function with multiple parameters can be used

+

Error expected? No

+

Input

+
Id,Name,Comment,Class
+1,Venus,A&B,A
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix ex: <http://example.com/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix fno: <https://w3id.org/function/ontology#> .
+@prefix grel: <http://users.ugent.be/~bjdmeest/function/grel.ttl#> .
+
+@base <http://example.com/base/> .
+
+<TriplesMap1>
+    rml:logicalSource [
+        rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.csv"
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example.com/{Name}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicate foaf:name;
+        rml:objectMap [
+            rml:functionExecution <#Execution> ;
+            rml:return grel:stringOut
+        ]
+    ] .
+
+<#Execution>
+    rml:function grel:escape ;
+    rml:input
+        [
+            rml:parameter grel:valueParam ;
+            rml:inputValueMap [
+                rml:reference "Comment"
+            ]
+        ] ,
+        [
+            rml:parameter grel:modeParam  ;
+            rml:inputValue "html"
+        ] .
+
+

Output

+
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "A&B" .
+
+
+

13. RMLFNMLTC0031-CSV

+

Title: Function on subject, 1 parameter

+

Description: Tests if +(1) a function can be used on a subject +(2) Tests if the default termType assigned to the output of the function to be correct

+

Error expected? No

+

Input

+
Id,Name,url
+1,Venus,www.example.com
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix ex: <http://example.com/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix fno: <https://w3id.org/function/ontology#> .
+@prefix grel: <http://users.ugent.be/~bjdmeest/function/grel.ttl#> .
+@prefix idlab-fn: <https://w3id.org/imec/idlab/function#> .
+
+@base <http://example.com/base/> .
+
+<TriplesMap1>
+    rml:logicalSource [
+        rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.csv"
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:functionExecution <#Execution> ;
+        rml:return idlab-fn:_stringOut
+    ];
+    rml:predicateObjectMap [
+        rml:predicate foaf:name;
+        rml:objectMap [ rml:reference "Name"]
+    ] .
+
+<#Execution>
+    rml:function idlab-fn:toUpperCaseURL ;
+    rml:input
+        [
+            rml:parameter idlab-fn:str ;
+            rml:inputValueMap [
+                rml:reference "url"
+            ];
+        ] .
+
+

Output

+
<http://WWW.EXAMPLE.COM> <http://xmlns.com/foaf/0.1/name> "Venus" .
+
+
+

14. RMLFNMLTC0041-CSV

+

Title: Function using non-constant shortcut property return

+

Description: Tests that a non-constant FNML Return map also works

+

Error expected? No

+

Input

+
Id,Name,Comment,Class,url
+1,Venus,A&B,A,http://example.com/venus
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix ex: <http://example.com/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix fno: <https://w3id.org/function/ontology#> .
+@prefix grel: <http://users.ugent.be/~bjdmeest/function/grel.ttl#> .
+
+@base <http://example.com/base/> .
+
+<TriplesMap1>
+    rml:logicalSource [
+        rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.csv"
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example.com/{Name}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicate foaf:name;
+        rml:objectMap [
+            rml:functionExecution <#Execution> ;
+            rml:returnMap [
+                rml:constant grel:stringOut
+            ]
+        ]
+    ] .
+
+<#Execution>
+    rml:function grel:toUpperCase ;
+    rml:input
+        [
+            rml:parameter grel:valueParam ;
+            rml:inputValueMap [
+                rml:reference "Name" ;
+            ]
+        ] .
+
+

Output

+
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "example.com" .
+
+
+

15. RMLFNMLTC0051-CSV

+

Title: Nested function - Test A

+

Description: Tests if a composite function of form f(g(x1),x2) works (i.e., the inner function is only one argument of the outer function)

+

Error expected? No

+

Input

+
Id,Name,Comment,Class
+1,M Venus,A&B,A
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix ex: <http://example.com/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix fno: <https://w3id.org/function/ontology#> .
+@prefix grel: <http://users.ugent.be/~bjdmeest/function/grel.ttl#> .
+@prefix idlab-fn: <https://w3id.org/imec/idlab/function#> .
+
+@base <http://example.com/base/> .
+
+<#Person_Mapping>
+    rml:logicalSource [
+        rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.csv"
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example.com/{Name}"
+    ];
+    rml:predicateObjectMap <#NameMapping> .
+
+<#NameMapping>
+    rml:predicate foaf:name ;
+    rml:objectMap [
+        rml:functionExecution <#Execution> ;
+        rml:return grel:stringOut
+    ]; .
+
+<#Execution> a rml:FunctionExecution ;
+    rml:function grel:toUpperCase ;
+    rml:input
+        [
+            a rml:Input ;
+            rml:parameter grel:valueParam ;
+            rml:inputValueMap [
+                rml:functionExecution <#Execution2> ;
+                rml:return grel:stringOut
+            ]
+        ] .
+
+<#Execution2> a rml:Execution ;
+    rml:function grel:string_replace ;
+    rml:input
+        [
+            a rml:Input ;
+            rml:parameter grel:valueParam ;
+            rml:inputValueMap [
+                rml:reference "Name"
+            ]
+        ] ,
+        [
+            a rml:Input ;
+            rml:parameter grel:param_find ;
+            rml:inputValue " "
+        ] ,
+        [
+            a rml:Input ;
+            rml:parameter grel:param_replace  ;
+            rml:inputValue "-"
+        ] .
+
+

Output

+
<http://example.com/M%20Venus> <http://xmlns.com/foaf/0.1/name> "M-VENUS" .
+
+
+

16. RMLFNMLTC0061-CSV

+

Title: Function on graph, 1 parameter

+

Description: Tests if a function can be used on a graph

+

Error expected? No

+

Input

+
Id,Name,Comment,Class,url
+1,Venus,A&B,A,http://example.com/venus
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix ex: <http://example.com/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix fno: <https://w3id.org/function/ontology#> .
+@prefix grel: <http://users.ugent.be/~bjdmeest/function/grel.ttl#> .
+@prefix idlab-fn: <https://w3id.org/imec/idlab/function#> .
+
+@base <http://example.com/base/> .
+
+<TriplesMap1>
+    rml:logicalSource [
+        rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.csv"
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example.com/{Name}" ;
+        rml:graphMap [
+            rml:functionExecution <#Execution> ;
+            rml:return idlab-fn:_stringOut
+            
+        ]
+    ];
+
+    rml:predicateObjectMap [
+        rml:predicate foaf:name;
+        rml:objectMap [
+            rml:reference "Name"
+        ]
+    ] .
+
+<#Execution>
+    rml:function idlab-fn:toUpperCaseURL ;
+    rml:input
+        [
+            rml:parameter idlab-fn:str ;
+            rml:inputValueMap [
+                rml:reference "url" ;
+            ]
+        ] .
+
+

Output

+
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" <HTTP://EXAMPLE.COM/VENUS> .
+
+
+

17. RMLFNMLTC0101-CSV

+

Title: Function on object, 1 false reference parameter

+

Description: Tests if a false reference parameters is caught

+

Error expected? Yes

+

Input

+
Id,Name,Comment,Class
+1,Venus,A&B,A
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix ex: <http://example.com/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix fno: <https://w3id.org/function/ontology#> .
+@prefix grel: <http://users.ugent.be/~bjdmeest/function/grel.ttl#> .
+@prefix idlab-fn: <https://w3id.org/imec/idlab/function#> .
+
+@base <http://example.com/base/> .
+
+<TriplesMap1>
+    rml:logicalSource [
+        rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.csv"
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example.com/{Name}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicate foaf:name;
+        rml:objectMap [
+            rml:functionExecution <#Execution> ;
+            rml:return grel:stringOut
+        ]
+    ] .
+
+<#Execution>
+    rml:function grel:toUpperCase ;
+    rml:input
+        [
+            rml:parameter grel:valueParam ;
+            rml:inputValueMap [
+                rml:reference "name" ;
+            ]
+        ] .
+
+
+

18. RMLFNMLTC0102-CSV

+

Title: Function on object, wrong function URI

+

Description: Tests that nothing is generated if a function is used where no implementation is made available to the mapping engine

+

Error expected? No

+

Input

+
Id,Name,Comment,Class
+1,Venus,A&B,A
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix ex: <http://example.com/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix fno: <https://w3id.org/function/ontology#> .
+@prefix grel: <http://users.ugent.be/~bjdmeest/function/grel.ttl#> .
+
+@base <http://example.com/base/> .
+
+<TriplesMap1>
+    rml:logicalSource [
+        rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.csv"
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example.com/{Name}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicate foaf:name;
+        rml:objectMap [
+            rml:functionExecution <#Execution> ;
+            rml:return grel:stringOut
+        ]
+    ] .
+
+<#Execution>
+    rml:function grel:unknown_func ;
+    rml:input
+        [
+            rml:parameter grel:valueParam ;
+            rml:inputValueMap [
+                rml:reference "Name" ;
+            ]
+        ] .
+
+

Output

+

+
+
+

19. RMLFNMLTC0103-CSV

+

Title: Function on object, wrong parameter

+

Description: Tests that nothing is generated if a function is defined using a parameter not defined in the FnO description

+

Error expected? No

+

Input

+
Id,Name,Comment,Class,url
+1,Venus,A&B,A,http://example.com/venus
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix ex: <http://example.com/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix fno: <https://w3id.org/function/ontology#> .
+@prefix grel: <http://users.ugent.be/~bjdmeest/function/grel.ttl#> .
+
+@base <http://example.com/base/> .
+
+<TriplesMap1>
+    rml:logicalSource [
+        rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.csv"
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example.com/{Name}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicate foaf:name;
+        rml:objectMap [
+            rml:functionExecution <#Execution> ;
+            rml:return grel:stringOut
+        ]
+    ] .
+
+<#Execution>
+    rml:function grel:toUpperCase ;
+    rml:input
+        [
+            rml:parameter grel:unknownParam ;
+            rml:inputValueMap [
+                rml:reference "Name" ;
+            ]
+        ] .
+
+

Output

+

+
+
+

20. RMLFNMLTC0104-CSV

+

Title: Function on object, wrong return parameter

+

Description: Tests that nothing is generated if a function is defined using a return not defined in the FnO description

+

Error expected? No

+

Input

+
Id,Name,Comment,Class,url
+1,Venus,A&B,A,http://example.com/venus
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix ex: <http://example.com/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix fno: <https://w3id.org/function/ontology#> .
+@prefix grel: <http://users.ugent.be/~bjdmeest/function/grel.ttl#> .
+
+@base <http://example.com/base/> .
+
+<TriplesMap1>
+    rml:logicalSource [
+        rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.csv"
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example.com/{Name}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicate foaf:name;
+        rml:objectMap [
+            rml:functionExecution <#Execution> ;
+            rml:return grel:unknownOut
+        ]
+    ] .
+
+<#Execution>
+    rml:function grel:toUpperCase ;
+    rml:input
+        [
+            rml:parameter grel:valueParam ;
+            rml:inputValueMap [
+                rml:reference "Name" ;
+            ]
+        ] .
+
+

Output

+

+
+
+ + + + + \ No newline at end of file diff --git a/src/test/resources/rml-fnml/docs/20250630/index.html b/src/test/resources/rml-fnml/docs/20250630/index.html new file mode 100644 index 00000000..67b08896 --- /dev/null +++ b/src/test/resources/rml-fnml/docs/20250630/index.html @@ -0,0 +1,1768 @@ + + + + + + +RML-FNML: Test Cases + + + + + + + + + + + + + + + +
+ +

RML-FNML: Test Cases

+

+ Draft Community Group Report + +

+
+ +
Latest published version:
+ https://www.w3.org/RML-FNML-Testcases/ +
+
Latest editor's draft:
https://w3id.org/rml/fnml/test-cases/
+ + + + +
Editor:
+ Dylan Van Assche + + + + (IDLab – Ghent University – imec) +
+ +
Author:
+ Dylan Van Assche + + + + (IDLab – Ghent University – imec) +
+
Feedback:
+ GitHub kg-construct/rml-fnml + (pull requests, + new issue, + open issues) +
+ +
+ + +
+
+ + + +

Abstract

This document defines the RML-FNML test cases to the determine the RML-FNML specification conformance of tools.

+
+ +

Status of This Document

+ This specification was published by the + Knowledge Graph Construction Community Group. It is not a W3C Standard nor is it + on the W3C Standards Track. + + Please note that under the + W3C Community Contributor License Agreement (CLA) + there is a limited opt-out and other conditions apply. + + Learn more about + W3C Community and Business Groups. +

+ GitHub Issues are preferred for + discussion of this specification. + + +

+ +

1. Introduction

+

This document defines the RML-FNML test cases, consisting of a collection of test case documents (input and expected output). +The purpose of the test cases is to determine the conformance of tools that execute RML rules to the RML-FNML specification.

+
+ +

2. Data model

+

The test cases are semantically described for re-usability and shareability following the W3C Test case description. +Each test:Testcase as the following properties:

+
    +
  • dcterms:identifier: unique ID of the test case.
  • +
  • rmltest:hasError: if an error of the RML Processor is expected or not.
  • +
  • rmltest:input: One or more input data of the test case.
  • +
  • rmltest:output: One or more output data of the test case.
  • +
  • rmltest:inputFormat: the input data format.
  • +
  • rmltest:outputFormat: the output data format.
  • +
  • rmltest:mappingDocument: the RML mapping rules in Turtle.
  • +
+
+ +

3. Test cases

+

This section describes the RML-FNML test cases. These descriptions are also available as RDF. +The files are available on GitHub in the folder test-cases. +Each test case is contained in a single folder, containing three types of files:

+
    +
  • Zero or more files containing the data sources, in the case of JSON, XML, CSV, or containing the SQL statements to create the necessary tables, in the case of MySQL, PostgreSQL, and SQL Server.
  • +
  • One file with the RML rules, called mapping.ttl, in the Turtle format.
  • +
  • Zero or more files with the expected RDF. No file is provided if an error is expected that must halt the generation of the RDF because of an error.
  • +
+
+ + +

4. RMLFNMLTC0001-CSV

+

Title: Function on object, 0 parameters

+

Description: Tests +(1) if a function without parameters can be used (FnO) +(2) if a function on an object map can be used (Term) +(3) if the output of the function is assigned the correct termType by default

+

Error expected? No

+

Input

+
Id,Name,Comment,Class
+1,Venus,A&B,A
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix ex: <http://example.com/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix fno: <https://w3id.org/function/ontology#> .
+@prefix idlab-fn: <https://w3id.org/imec/idlab/function#> .
+
+@base <http://example.com/base/> .
+
+<TriplesMap1>
+    rml:logicalSource [
+        rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.csv"
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example.com/{Name}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicate foaf:name;
+        rml:objectMap [
+            rml:functionExecution <#Execution> ;
+            rml:return idlab-fn:_stringOut
+        ]
+    ] .
+
+<#Execution>
+    rml:function idlab-fn:random .
+
+

Output

+
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "e4dcc7ee-8e2a-4012-92cc-9a74dd545e89" .
+
+
+

5. RMLFNMLTC0002-CSV

+

Title: Function on object, 1 reference parameter

+

Description: Tests: +(1) if a function with one parameter can be used, (FnO) +(2) a reference parameter can be used (Term)

+

Error expected? No

+

Input

+
Id,Name,Comment,Class
+1,Venus,A&B,A
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix ex: <http://example.com/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix fno: <https://w3id.org/function/ontology#> .
+@prefix grel: <http://users.ugent.be/~bjdmeest/function/grel.ttl#> .
+
+@base <http://example.com/base/> .
+
+<TriplesMap1>
+    rml:logicalSource [
+        rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.csv"
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example.com/{Name}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicate foaf:name;
+        rml:objectMap [
+            rml:functionExecution <#Execution> ;
+            rml:return grel:stringOut
+        ]
+    ] .
+
+<#Execution>
+    rml:function grel:toUpperCase ;
+    rml:input
+        [
+            rml:parameter grel:valueParam ;
+            rml:inputValueMap [
+                rml:reference "Name" ;
+            ]
+        ] .
+
+

Output

+
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "VENUS" .
+
+
+

6. RMLFNMLTC0003-CSV

+

Title: Function on object, 1 reference parameter, the output termType is IRI

+

Description: Tests if the output of the function is assigned the correct termType

+

Error expected? No

+

Input

+
Id,Name,Comment,Class,url
+1,Venus,A&B,A,http://example.com/venus
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix ex: <http://example.com/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix fno: <https://w3id.org/function/ontology#> .
+@prefix grel: <http://users.ugent.be/~bjdmeest/function/grel.ttl#> .
+@prefix idlab-fn: <https://w3id.org/imec/idlab/function#> .
+
+@base <http://example.com/base/> .
+
+<TriplesMap1>
+    rml:logicalSource [
+        rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.csv"
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example.com/{Name}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicate foaf:name;
+        rml:objectMap [
+            rml:functionExecution <#Execution> ;
+            rml:return idlab-fn:_stringOut ;
+            rml:termType rml:IRI
+        ];
+    ] .
+
+<#Execution>
+    rml:function idlab-fn:toUpperCaseURL ;
+    rml:input
+        [
+            rml:parameter idlab-fn:str ;
+            rml:inputValueMap [
+                rml:reference "url"
+            ];
+        ] .
+
+

Output

+
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> <HTTP://EXAMPLE.COM/VENUS> .
+
+
+

7. RMLFNMLTC0004-CSV

+

Title: Function on object, the output termType is Literal

+

Description: Tests if the output of the function is assigned the correct termType

+

Error expected? No

+

Input

+
Id,Name,Comment,Class,url
+1,Venus,A&B,A,http://example.com/venus
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix ex: <http://example.com/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix fno: <https://w3id.org/function/ontology#> .
+@prefix grel: <http://users.ugent.be/~bjdmeest/function/grel.ttl#> .
+@prefix idlab-fn: <https://w3id.org/imec/idlab/function#> .
+
+@base <http://example.com/base/> .
+
+<TriplesMap1>
+    rml:logicalSource [
+        rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.csv"
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example.com/{Name}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicate foaf:name;
+        rml:objectMap [
+            rml:functionExecution <#Execution> ;
+            rml:return grel:stringOut
+        ]
+    ] .
+
+<#Execution>
+    rml:function grel:length ;
+    rml:input
+        [
+            rml:parameter grel:valueParam ;
+            rml:inputValueMap [
+                rml:reference "Name"
+            ];
+        ]  .
+
+

Output

+
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "5"^^<http://www.w3.org/2001/XMLSchema#integer> .
+
+
+

8. RMLFNMLTC0005-CSV

+

Title: Function on object, 1 template parameter

+

Description: Tests if a function with a template parameter can be used

+

Error expected? No

+

Input

+
Id,Name,Comment,Class
+1,Venus,A&B,A
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix ex: <http://example.com/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix fno: <https://w3id.org/function/ontology#> .
+@prefix grel: <http://users.ugent.be/~bjdmeest/function/grel.ttl#> .
+
+@base <http://example.com/base/> .
+
+<TriplesMap1>
+    rml:logicalSource [
+        rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.csv"
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example.com/{Name}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicate foaf:name;
+        rml:objectMap [
+            rml:functionExecution <#Execution> ;
+            rml:return grel:stringOut
+        ]
+    ] .
+
+<#Execution>
+    rml:function grel:toUpperCase ;
+    rml:input
+        [
+            rml:parameter grel:valueParam ;
+            rml:inputValueMap [
+                rml:template "Name: {Name}" ;
+            ];
+        ] .
+
+

Output

+
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "NAME: VENUS" .
+
+
+

9. RMLFNMLTC0007-CSV

+

Title: Function on object returns empty string

+

Description: Tests that a triple is generated when the results is an empty string.

+

Error expected? No

+

Input

+
Id,Name,Comment,Class
+1,Venus,A&B,A
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix ex: <http://example.com/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix fno: <https://w3id.org/function/ontology#> .
+@prefix grel: <http://users.ugent.be/~bjdmeest/function/grel.ttl#> .
+@prefix idlab-fn: <https://w3id.org/imec/idlab/function#> .
+
+@base <http://example.com/base/> .
+
+<TriplesMap1>
+    rml:logicalSource [
+        rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.csv"
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example.com/{Name}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicate foaf:name;
+        rml:objectMap [
+            rml:functionExecution <#Execution> ;
+            rml:return grel:stringOut
+        ]
+    ] .
+
+<#Execution>
+    rml:function grel:string_substring ;
+    rml:input
+        [
+            rml:parameter grel:valueParam ;
+            rml:inputValueMap [
+                rml:reference "Name"
+            ];
+        ]  ,
+        [
+            a rml:Input ;
+            rml:parameter grel:p_int_i_from ;
+            rml:inputValue "5"
+        ]  .
+
+

Output

+
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "" .
+
+
+

10. RMLFNMLTC0008-CSV

+

Title: Function on object returns null

+

Description: Tests that no triple should be generated when the result is null.

+

Error expected? No

+

Input

+
Id,Name,Comment,Class
+1,Venus,A&B,A
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix ex: <http://example.com/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix fno: <https://w3id.org/function/ontology#> .
+@prefix grel: <http://users.ugent.be/~bjdmeest/function/grel.ttl#> .
+@prefix idlab-fn: <https://w3id.org/imec/idlab/function#> .
+
+@base <http://example.com/base/> .
+
+<TriplesMap1>
+    rml:logicalSource [
+        rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.csv"
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example.com/{Name}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicate foaf:name;
+        rml:objectMap [
+            rml:functionExecution <#Execution> ;
+            rml:return grel:stringOut
+        ]
+    ] .
+
+<#Execution>
+    rml:function grel:string_substring ;
+    rml:input
+        [
+            rml:parameter grel:valueParam ;
+            rml:inputValueMap [
+                rml:reference "Name"
+            ];
+        ]  ,
+        [
+            a rml:Input ;
+            rml:parameter grel:p_int_i_from ;
+            rml:inputValue "1000"
+        ]  .
+
+

Output

+

+
+
+

11. RMLFNMLTC0011-CSV

+

Title: Function on predicate, 1 parameter

+

Description: Tests if a function can be used on a predicate

+

Error expected? No

+

Input

+
Id,Name,Comment,Class
+1,Venus,A&B,A
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix ex: <http://example.com/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix fno: <https://w3id.org/function/ontology#> .
+@prefix grel: <http://users.ugent.be/~bjdmeest/function/grel.ttl#> .
+@prefix idlab-fn: <https://w3id.org/imec/idlab/function#> .
+
+@base <http://example.com/base/> .
+
+<TriplesMap1>
+    rml:logicalSource [
+        rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.csv"
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example.com/{Name}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicateMap [
+            rml:functionExecution <#Execution> ;
+            rml:return idlab-fn:_stringOut
+        ];
+        rml:object foaf:name;
+    ] .
+
+<#Execution>
+    rml:function idlab-fn:toUpperCaseURL ;
+    rml:input
+        [
+            rml:parameter idlab-fn:str ;
+            rml:inputValueMap [
+                rml:reference "Name"
+            ];
+        ] .
+
+

Output

+
<http://example.com/Venus> <http://VENUS> <http://xmlns.com/foaf/0.1/name> .
+
+
+

12. RMLFNMLTC0021-CSV

+

Title: Function on object, 1 reference parameter, 1 constant parameter

+

Description: Tests if a function with multiple parameters can be used

+

Error expected? No

+

Input

+
Id,Name,Comment,Class
+1,Venus,A&B,A
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix ex: <http://example.com/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix fno: <https://w3id.org/function/ontology#> .
+@prefix grel: <http://users.ugent.be/~bjdmeest/function/grel.ttl#> .
+
+@base <http://example.com/base/> .
+
+<TriplesMap1>
+    rml:logicalSource [
+        rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.csv"
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example.com/{Name}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicate foaf:name;
+        rml:objectMap [
+            rml:functionExecution <#Execution> ;
+            rml:return grel:stringOut
+        ]
+    ] .
+
+<#Execution>
+    rml:function grel:escape ;
+    rml:input
+        [
+            rml:parameter grel:valueParam ;
+            rml:inputValueMap [
+                rml:reference "Comment"
+            ]
+        ] ,
+        [
+            rml:parameter grel:modeParam  ;
+            rml:inputValue "html"
+        ] .
+
+

Output

+
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "A&B" .
+
+
+

13. RMLFNMLTC0031-CSV

+

Title: Function on subject, 1 parameter

+

Description: Tests if +(1) a function can be used on a subject +(2) Tests if the default termType assigned to the output of the function to be correct

+

Error expected? No

+

Input

+
Id,Name,url
+1,Venus,www.example.com
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix ex: <http://example.com/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix fno: <https://w3id.org/function/ontology#> .
+@prefix grel: <http://users.ugent.be/~bjdmeest/function/grel.ttl#> .
+@prefix idlab-fn: <https://w3id.org/imec/idlab/function#> .
+
+@base <http://example.com/base/> .
+
+<TriplesMap1>
+    rml:logicalSource [
+        rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.csv"
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:functionExecution <#Execution> ;
+        rml:return idlab-fn:_stringOut
+    ];
+    rml:predicateObjectMap [
+        rml:predicate foaf:name;
+        rml:objectMap [ rml:reference "Name"]
+    ] .
+
+<#Execution>
+    rml:function idlab-fn:toUpperCaseURL ;
+    rml:input
+        [
+            rml:parameter idlab-fn:str ;
+            rml:inputValueMap [
+                rml:reference "url"
+            ];
+        ] .
+
+

Output

+
<http://WWW.EXAMPLE.COM> <http://xmlns.com/foaf/0.1/name> "Venus" .
+
+
+

14. RMLFNMLTC0041-CSV

+

Title: Function using non-constant shortcut property return

+

Description: Tests that a non-constant FNML Return map also works

+

Error expected? No

+

Input

+
Id,Name,Comment,Class,url
+1,Venus,A&B,A,http://example.com/venus
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix ex: <http://example.com/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix fno: <https://w3id.org/function/ontology#> .
+@prefix grel: <http://users.ugent.be/~bjdmeest/function/grel.ttl#> .
+
+@base <http://example.com/base/> .
+
+<TriplesMap1>
+    rml:logicalSource [
+        rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.csv"
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example.com/{Name}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicate foaf:name;
+        rml:objectMap [
+            rml:functionExecution <#Execution> ;
+            rml:returnMap [
+                rml:constant grel:stringOut
+            ]
+        ]
+    ] .
+
+<#Execution>
+    rml:function grel:toUpperCase ;
+    rml:input
+        [
+            rml:parameter grel:valueParam ;
+            rml:inputValueMap [
+                rml:reference "Name" ;
+            ]
+        ] .
+
+

Output

+
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "VENUS" .
+
+
+

15. RMLFNMLTC0051-CSV

+

Title: Nested function - Test A

+

Description: Tests if a composite function of form f(g(x1),x2) works (i.e., the inner function is only one argument of the outer function)

+

Error expected? No

+

Input

+
Id,Name,Comment,Class
+1,M Venus,A&B,A
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix ex: <http://example.com/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix fno: <https://w3id.org/function/ontology#> .
+@prefix grel: <http://users.ugent.be/~bjdmeest/function/grel.ttl#> .
+@prefix idlab-fn: <https://w3id.org/imec/idlab/function#> .
+
+@base <http://example.com/base/> .
+
+<#Person_Mapping>
+    rml:logicalSource [
+        rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.csv"
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example.com/{Name}"
+    ];
+    rml:predicateObjectMap <#NameMapping> .
+
+<#NameMapping>
+    rml:predicate foaf:name ;
+    rml:objectMap [
+        rml:functionExecution <#Execution> ;
+        rml:return grel:stringOut
+    ]; .
+
+<#Execution> a rml:FunctionExecution ;
+    rml:function grel:toUpperCase ;
+    rml:input
+        [
+            a rml:Input ;
+            rml:parameter grel:valueParam ;
+            rml:inputValueMap [
+                rml:functionExecution <#Execution2> ;
+                rml:return grel:stringOut
+            ]
+        ] .
+
+<#Execution2> a rml:Execution ;
+    rml:function grel:string_replace ;
+    rml:input
+        [
+            a rml:Input ;
+            rml:parameter grel:valueParam ;
+            rml:inputValueMap [
+                rml:reference "Name"
+            ]
+        ] ,
+        [
+            a rml:Input ;
+            rml:parameter grel:param_find ;
+            rml:inputValue " "
+        ] ,
+        [
+            a rml:Input ;
+            rml:parameter grel:param_replace  ;
+            rml:inputValue "-"
+        ] .
+
+

Output

+
<http://example.com/M%20Venus> <http://xmlns.com/foaf/0.1/name> "M-VENUS" .
+
+
+

16. RMLFNMLTC0061-CSV

+

Title: Function on graph, 1 parameter

+

Description: Tests if a function can be used on a graph

+

Error expected? No

+

Input

+
Id,Name,Comment,Class,url
+1,Venus,A&B,A,http://example.com/venus
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix ex: <http://example.com/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix fno: <https://w3id.org/function/ontology#> .
+@prefix grel: <http://users.ugent.be/~bjdmeest/function/grel.ttl#> .
+@prefix idlab-fn: <https://w3id.org/imec/idlab/function#> .
+
+@base <http://example.com/base/> .
+
+<TriplesMap1>
+    rml:logicalSource [
+        rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.csv"
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example.com/{Name}" ;
+        rml:graphMap [
+            rml:functionExecution <#Execution> ;
+            rml:return idlab-fn:_stringOut
+            
+        ]
+    ];
+
+    rml:predicateObjectMap [
+        rml:predicate foaf:name;
+        rml:objectMap [
+            rml:reference "Name"
+        ]
+    ] .
+
+<#Execution>
+    rml:function idlab-fn:toUpperCaseURL ;
+    rml:input
+        [
+            rml:parameter idlab-fn:str ;
+            rml:inputValueMap [
+                rml:reference "url" ;
+            ]
+        ] .
+
+

Output

+
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" <HTTP://EXAMPLE.COM/VENUS> .
+
+
+

17. RMLFNMLTC0071-CSV

+

Title: Function on datatypeMap, 1 parameter

+

Description: Tests that function on DatatypeMap is handled

+

Error expected? No

+

Input

+
Id,Name,Comment,Class,Type
+1,Venus,A&B,A,http://www.w3.org/2001/XMLSchema#string
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix ex: <http://example.com/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix fno: <https://w3id.org/function/ontology#> .
+@prefix grel: <http://users.ugent.be/~bjdmeest/function/grel.ttl#> .
+@prefix idlab-fn: <https://w3id.org/imec/idlab/function#> .
+
+@base <http://example.com/base/> .
+
+<TriplesMap1>
+    rml:logicalSource [
+        rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.csv"
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example.com/{Name}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicate foaf:name;
+        rml:objectMap [
+           rml:reference "Name" ;
+           rml:datatypeMap [
+             rml:functionExecution <#Execution> ;
+             rml:return grel:stringOut
+           ]
+        ]
+    ] .
+
+<#Execution>
+    rml:function grel:string_substring ;
+    rml:input
+        [
+            rml:parameter grel:valueParam ;
+            rml:inputValueMap [
+                rml:reference "Type"
+            ];
+        ]  ,
+        [
+            a rml:Input ;
+            rml:parameter grel:p_int_i_from ;
+            rml:inputValue "0"
+        ]  .
+
+

Output

+
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "Venus"^^<http://www.w3.org/2001/XMLSchema#string> .
+
+
+

18. RMLFNMLTC0081-CSV

+

Title: Function on languageMap, 1 parameter

+

Description: Tests that function on LanguageMap is handled

+

Error expected? No

+

Input

+
Id,Name,Comment,Class,Lang
+1,Venus,A&B,A,en
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix ex: <http://example.com/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix fno: <https://w3id.org/function/ontology#> .
+@prefix grel: <http://users.ugent.be/~bjdmeest/function/grel.ttl#> .
+@prefix idlab-fn: <https://w3id.org/imec/idlab/function#> .
+
+@base <http://example.com/base/> .
+
+<TriplesMap1>
+    rml:logicalSource [
+        rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.csv"
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example.com/{Name}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicate foaf:name;
+        rml:objectMap [
+           rml:reference "Name" ;
+           rml:languageMap [
+             rml:functionExecution <#Execution> ;
+             rml:return grel:stringOut
+           ] ;
+        ]
+    ] .
+
+<#Execution>
+    rml:function grel:string_substring ;
+    rml:input
+        [
+            rml:parameter grel:valueParam ;
+            rml:inputValueMap [
+                rml:reference "Lang"
+            ];
+        ]  ,
+        [
+            a rml:Input ;
+            rml:parameter grel:p_int_i_from ;
+            rml:inputValue "0"
+        ]  .
+
+

Output

+
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "Venus"@en .
+
+
+

19. RMLFNMLTC0101-CSV

+

Title: Function on object, 1 false reference parameter

+

Description: Tests if a false reference parameters is caught

+

Error expected? Yes

+

Input

+
Id,Name,Comment,Class
+1,Venus,A&B,A
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix ex: <http://example.com/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix fno: <https://w3id.org/function/ontology#> .
+@prefix grel: <http://users.ugent.be/~bjdmeest/function/grel.ttl#> .
+@prefix idlab-fn: <https://w3id.org/imec/idlab/function#> .
+
+@base <http://example.com/base/> .
+
+<TriplesMap1>
+    rml:logicalSource [
+        rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.csv"
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example.com/{Name}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicate foaf:name;
+        rml:objectMap [
+            rml:functionExecution <#Execution> ;
+            rml:return grel:stringOut
+        ]
+    ] .
+
+<#Execution>
+    rml:function grel:toUpperCase ;
+    rml:input
+        [
+            rml:parameter grel:valueParam ;
+            rml:inputValueMap [
+                rml:reference "name" ;
+            ]
+        ] .
+
+
+

20. RMLFNMLTC0102-CSV

+

Title: Function on object, wrong function URI

+

Description: Tests that nothing is generated if a function is used where no implementation is made available to the mapping engine

+

Error expected? No

+

Input

+
Id,Name,Comment,Class
+1,Venus,A&B,A
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix ex: <http://example.com/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix fno: <https://w3id.org/function/ontology#> .
+@prefix grel: <http://users.ugent.be/~bjdmeest/function/grel.ttl#> .
+
+@base <http://example.com/base/> .
+
+<TriplesMap1>
+    rml:logicalSource [
+        rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.csv"
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example.com/{Name}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicate foaf:name;
+        rml:objectMap [
+            rml:functionExecution <#Execution> ;
+            rml:return grel:stringOut
+        ]
+    ] .
+
+<#Execution>
+    rml:function grel:unknown_func ;
+    rml:input
+        [
+            rml:parameter grel:valueParam ;
+            rml:inputValueMap [
+                rml:reference "Name" ;
+            ]
+        ] .
+
+

Output

+

+
+
+

21. RMLFNMLTC0103-CSV

+

Title: Function on object, wrong parameter

+

Description: Tests that nothing is generated if a function is defined using a parameter not defined in the FnO description

+

Error expected? No

+

Input

+
Id,Name,Comment,Class,url
+1,Venus,A&B,A,http://example.com/venus
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix ex: <http://example.com/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix fno: <https://w3id.org/function/ontology#> .
+@prefix grel: <http://users.ugent.be/~bjdmeest/function/grel.ttl#> .
+
+@base <http://example.com/base/> .
+
+<TriplesMap1>
+    rml:logicalSource [
+        rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.csv"
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example.com/{Name}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicate foaf:name;
+        rml:objectMap [
+            rml:functionExecution <#Execution> ;
+            rml:return grel:stringOut
+        ]
+    ] .
+
+<#Execution>
+    rml:function grel:toUpperCase ;
+    rml:input
+        [
+            rml:parameter grel:unknownParam ;
+            rml:inputValueMap [
+                rml:reference "Name" ;
+            ]
+        ] .
+
+

Output

+

+
+
+

22. RMLFNMLTC0104-CSV

+

Title: Function on object, wrong return parameter

+

Description: Tests that nothing is generated if a function is defined using a return not defined in the FnO description

+

Error expected? No

+

Input

+
Id,Name,Comment,Class,url
+1,Venus,A&B,A,http://example.com/venus
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix ex: <http://example.com/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix fno: <https://w3id.org/function/ontology#> .
+@prefix grel: <http://users.ugent.be/~bjdmeest/function/grel.ttl#> .
+
+@base <http://example.com/base/> .
+
+<TriplesMap1>
+    rml:logicalSource [
+        rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.csv"
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example.com/{Name}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicate foaf:name;
+        rml:objectMap [
+            rml:functionExecution <#Execution> ;
+            rml:return grel:unknownOut
+        ]
+    ] .
+
+<#Execution>
+    rml:function grel:toUpperCase ;
+    rml:input
+        [
+            rml:parameter grel:valueParam ;
+            rml:inputValueMap [
+                rml:reference "Name" ;
+            ]
+        ] .
+
+

Output

+

+
+
+ + + + + \ No newline at end of file diff --git a/src/test/resources/rml-fnml/docs/20250806/index.html b/src/test/resources/rml-fnml/docs/20250806/index.html new file mode 100644 index 00000000..f939ec5c --- /dev/null +++ b/src/test/resources/rml-fnml/docs/20250806/index.html @@ -0,0 +1,1865 @@ + + + + + + +RML-FNML: Test Cases + + + + + + + + + + + + + + + + + + + +

Abstract

This document defines the RML-FNML test cases to the determine the RML-FNML specification conformance of tools.

+
+ +

Status of This Document

+ This specification was published by the + Knowledge Graph Construction Community Group. It is not a W3C Standard nor is it + on the W3C Standards Track. + + Please note that under the + W3C Community Contributor License Agreement (CLA) + there is a limited opt-out and other conditions apply. + + Learn more about + W3C Community and Business Groups. +

+ GitHub Issues are preferred for + discussion of this specification. + + +

+ +

1. Introduction

+

This document defines the RML-FNML test cases, consisting of a collection of test case documents (input and expected output). +The purpose of the test cases is to determine the conformance of tools that execute RML rules to the RML-FNML specification.

+
+ +

2. Data model

+

The test cases are semantically described for re-usability and shareability following the W3C Test case description. +Each test:Testcase as the following properties:

+
    +
  • dcterms:identifier: unique ID of the test case.
  • +
  • rmltest:hasError: if an error of the RML Processor is expected or not.
  • +
  • rmltest:input: One or more input data of the test case.
  • +
  • rmltest:output: One or more output data of the test case.
  • +
  • rmltest:inputFormat: the input data format.
  • +
  • rmltest:outputFormat: the output data format.
  • +
  • rmltest:mappingDocument: the RML mapping rules in Turtle.
  • +
+
+ +

3. Test cases

+

This section describes the RML-FNML test cases. These descriptions are also available as RDF. +The files are available on GitHub in the folder test-cases. +Each test case is contained in a single folder, containing three types of files:

+
    +
  • Zero or more files containing the data sources, in the case of JSON, XML, CSV, or containing the SQL statements to create the necessary tables, in the case of MySQL, PostgreSQL, and SQL Server.
  • +
  • One file with the RML rules, called mapping.ttl, in the Turtle format.
  • +
  • Zero or more files with the expected RDF. No file is provided if an error is expected that must halt the generation of the RDF because of an error.
  • +
+
+ + +

4. RMLFNMLTC0001-CSV

+

Title: Function on object, 0 parameters

+

Description: Tests +(1) if a function without parameters can be used (FnO) +(2) if a function on an object map can be used (Term) +(3) if the output of the function is assigned the correct termType by default

+

Error expected? No

+

Input

+
Id,Name,Comment,Class
+1,Venus,A&B,A
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix ex: <http://example.com/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix fno: <https://w3id.org/function/ontology#> .
+@prefix idlab-fn: <https://w3id.org/imec/idlab/function#> .
+
+@base <http://example.com/base/> .
+
+<TriplesMap1>
+    rml:logicalSource [
+        rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.csv"
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example.com/{Name}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicate foaf:name;
+        rml:objectMap [
+            rml:functionExecution <#Execution> ;
+            rml:return idlab-fn:_stringOut
+        ]
+    ] .
+
+<#Execution>
+    rml:function idlab-fn:random .
+
+

Output

+
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "e4dcc7ee-8e2a-4012-92cc-9a74dd545e89" .
+
+
+

5. RMLFNMLTC0002-CSV

+

Title: Function on object, 1 reference parameter

+

Description: Tests: +(1) if a function with one parameter can be used, (FnO) +(2) a reference parameter can be used (Term)

+

Error expected? No

+

Input

+
Id,Name,Comment,Class
+1,Venus,A&B,A
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix ex: <http://example.com/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix fno: <https://w3id.org/function/ontology#> .
+@prefix grel: <http://users.ugent.be/~bjdmeest/function/grel.ttl#> .
+
+@base <http://example.com/base/> .
+
+<TriplesMap1>
+    rml:logicalSource [
+        rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.csv"
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example.com/{Name}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicate foaf:name;
+        rml:objectMap [
+            rml:functionExecution <#Execution> ;
+            rml:return grel:stringOut
+        ]
+    ] .
+
+<#Execution>
+    rml:function grel:toUpperCase ;
+    rml:input
+        [
+            rml:parameter grel:valueParam ;
+            rml:inputValueMap [
+                rml:reference "Name" ;
+            ]
+        ] .
+
+

Output

+
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "VENUS" .
+
+
+

6. RMLFNMLTC0003-CSV

+

Title: Function on object, 1 reference parameter, the output termType is IRI

+

Description: Tests if the output of the function is assigned the correct termType

+

Error expected? No

+

Input

+
Id,Name,Comment,Class,url
+1,Venus,A&B,A,http://example.com/venus
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix ex: <http://example.com/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix fno: <https://w3id.org/function/ontology#> .
+@prefix grel: <http://users.ugent.be/~bjdmeest/function/grel.ttl#> .
+@prefix idlab-fn: <https://w3id.org/imec/idlab/function#> .
+
+@base <http://example.com/base/> .
+
+<TriplesMap1>
+    rml:logicalSource [
+        rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.csv"
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example.com/{Name}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicate foaf:name;
+        rml:objectMap [
+            rml:functionExecution <#Execution> ;
+            rml:return idlab-fn:_stringOut ;
+            rml:termType rml:IRI
+        ];
+    ] .
+
+<#Execution>
+    rml:function idlab-fn:toUpperCaseURL ;
+    rml:input
+        [
+            rml:parameter idlab-fn:str ;
+            rml:inputValueMap [
+                rml:reference "url"
+            ];
+        ] .
+
+

Output

+
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> <HTTP://EXAMPLE.COM/VENUS> .
+
+
+

7. RMLFNMLTC0004-CSV

+

Title: Function on object, the output termType is Literal

+

Description: Tests if the output of the function is assigned the correct termType

+

Error expected? No

+

Input

+
Id,Name,Comment,Class,url
+1,Venus,A&B,A,http://example.com/venus
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix ex: <http://example.com/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix fno: <https://w3id.org/function/ontology#> .
+@prefix grel: <http://users.ugent.be/~bjdmeest/function/grel.ttl#> .
+@prefix idlab-fn: <https://w3id.org/imec/idlab/function#> .
+
+@base <http://example.com/base/> .
+
+<TriplesMap1>
+    rml:logicalSource [
+        rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.csv"
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example.com/{Name}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicate foaf:name;
+        rml:objectMap [
+            rml:functionExecution <#Execution> ;
+            rml:return grel:stringOut
+        ]
+    ] .
+
+<#Execution>
+    rml:function grel:length ;
+    rml:input
+        [
+            rml:parameter grel:valueParam ;
+            rml:inputValueMap [
+                rml:reference "Name"
+            ];
+        ]  .
+
+

Output

+
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "5"^^<http://www.w3.org/2001/XMLSchema#integer> .
+
+
+

8. RMLFNMLTC0005-CSV

+

Title: Function on object, 1 template parameter

+

Description: Tests if a function with a template parameter can be used

+

Error expected? No

+

Input

+
Id,Name,Comment,Class
+1,Venus,A&B,A
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix ex: <http://example.com/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix fno: <https://w3id.org/function/ontology#> .
+@prefix grel: <http://users.ugent.be/~bjdmeest/function/grel.ttl#> .
+
+@base <http://example.com/base/> .
+
+<TriplesMap1>
+    rml:logicalSource [
+        rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.csv"
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example.com/{Name}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicate foaf:name;
+        rml:objectMap [
+            rml:functionExecution <#Execution> ;
+            rml:return grel:stringOut
+        ]
+    ] .
+
+<#Execution>
+    rml:function grel:toUpperCase ;
+    rml:input
+        [
+            rml:parameter grel:valueParam ;
+            rml:inputValueMap [
+                rml:template "Name: {Name}" ;
+            ];
+        ] .
+
+

Output

+
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "NAME: VENUS" .
+
+
+

9. RMLFNMLTC0007-CSV

+

Title: Function on object returns empty string

+

Description: Tests that a triple is generated when the results is an empty string.

+

Error expected? No

+

Input

+
Id,Name,Comment,Class
+1,Venus,A&B,A
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix ex: <http://example.com/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix fno: <https://w3id.org/function/ontology#> .
+@prefix grel: <http://users.ugent.be/~bjdmeest/function/grel.ttl#> .
+@prefix idlab-fn: <https://w3id.org/imec/idlab/function#> .
+
+@base <http://example.com/base/> .
+
+<TriplesMap1>
+    rml:logicalSource [
+        rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.csv"
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example.com/{Name}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicate foaf:name;
+        rml:objectMap [
+            rml:functionExecution <#Execution> ;
+            rml:return grel:stringOut
+        ]
+    ] .
+
+<#Execution>
+    rml:function grel:string_substring ;
+    rml:input
+        [
+            rml:parameter grel:valueParam ;
+            rml:inputValueMap [
+                rml:reference "Name"
+            ];
+        ]  ,
+        [
+            a rml:Input ;
+            rml:parameter grel:p_int_i_from ;
+            rml:inputValue "5"
+        ]  .
+
+

Output

+
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "" .
+
+
+

10. RMLFNMLTC0008-CSV

+

Title: Function on object returns null

+

Description: Tests that no triple should be generated when the result is null.

+

Error expected? No

+

Input

+
Id,Name,Comment,Class
+1,Venus,A&B,A
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix ex: <http://example.com/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix fno: <https://w3id.org/function/ontology#> .
+@prefix grel: <http://users.ugent.be/~bjdmeest/function/grel.ttl#> .
+@prefix idlab-fn: <https://w3id.org/imec/idlab/function#> .
+
+@base <http://example.com/base/> .
+
+<TriplesMap1>
+    rml:logicalSource [
+        rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.csv"
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example.com/{Name}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicate foaf:name;
+        rml:objectMap [
+            rml:functionExecution <#Execution> ;
+            rml:return grel:stringOut
+        ]
+    ] .
+
+<#Execution>
+    rml:function grel:string_substring ;
+    rml:input
+        [
+            rml:parameter grel:valueParam ;
+            rml:inputValueMap [
+                rml:reference "Name"
+            ];
+        ]  ,
+        [
+            a rml:Input ;
+            rml:parameter grel:p_int_i_from ;
+            rml:inputValue "1000"
+        ]  .
+
+

Output

+

+
+
+

11. RMLFNMLTC0011-CSV

+

Title: Function on predicate, 1 parameter

+

Description: Tests if a function can be used on a predicate

+

Error expected? No

+

Input

+
Id,Name,Comment,Class
+1,Venus,A&B,A
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix ex: <http://example.com/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix fno: <https://w3id.org/function/ontology#> .
+@prefix grel: <http://users.ugent.be/~bjdmeest/function/grel.ttl#> .
+@prefix idlab-fn: <https://w3id.org/imec/idlab/function#> .
+
+@base <http://example.com/base/> .
+
+<TriplesMap1>
+    rml:logicalSource [
+        rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.csv"
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example.com/{Name}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicateMap [
+            rml:functionExecution <#Execution> ;
+            rml:return idlab-fn:_stringOut
+        ];
+        rml:object foaf:name;
+    ] .
+
+<#Execution>
+    rml:function idlab-fn:toUpperCaseURL ;
+    rml:input
+        [
+            rml:parameter idlab-fn:str ;
+            rml:inputValueMap [
+                rml:reference "Name"
+            ];
+        ] .
+
+

Output

+
<http://example.com/Venus> <http://VENUS> <http://xmlns.com/foaf/0.1/name> .
+
+
+

12. RMLFNMLTC0021-CSV

+

Title: Function on object, 1 reference parameter, 1 constant parameter

+

Description: Tests if a function with multiple parameters can be used

+

Error expected? No

+

Input

+
Id,Name,Comment,Class
+1,Venus,A&B,A
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix ex: <http://example.com/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix fno: <https://w3id.org/function/ontology#> .
+@prefix grel: <http://users.ugent.be/~bjdmeest/function/grel.ttl#> .
+
+@base <http://example.com/base/> .
+
+<TriplesMap1>
+    rml:logicalSource [
+        rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.csv"
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example.com/{Name}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicate foaf:name;
+        rml:objectMap [
+            rml:functionExecution <#Execution> ;
+            rml:return grel:stringOut
+        ]
+    ] .
+
+<#Execution>
+    rml:function grel:escape ;
+    rml:input
+        [
+            rml:parameter grel:valueParam ;
+            rml:inputValueMap [
+                rml:reference "Comment"
+            ]
+        ] ,
+        [
+            rml:parameter grel:modeParam  ;
+            rml:inputValue "html"
+        ] .
+
+

Output

+
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "A&B" .
+
+
+

13. RMLFNMLTC0031-CSV

+

Title: Function on subject, 1 parameter

+

Description: Tests if +(1) a function can be used on a subject +(2) Tests if the default termType assigned to the output of the function to be correct

+

Error expected? No

+

Input

+
Id,Name,url
+1,Venus,www.example.com
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix ex: <http://example.com/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix fno: <https://w3id.org/function/ontology#> .
+@prefix grel: <http://users.ugent.be/~bjdmeest/function/grel.ttl#> .
+@prefix idlab-fn: <https://w3id.org/imec/idlab/function#> .
+
+@base <http://example.com/base/> .
+
+<TriplesMap1>
+    rml:logicalSource [
+        rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.csv"
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:functionExecution <#Execution> ;
+        rml:return idlab-fn:_stringOut
+    ];
+    rml:predicateObjectMap [
+        rml:predicate foaf:name;
+        rml:objectMap [ rml:reference "Name"]
+    ] .
+
+<#Execution>
+    rml:function idlab-fn:toUpperCaseURL ;
+    rml:input
+        [
+            rml:parameter idlab-fn:str ;
+            rml:inputValueMap [
+                rml:reference "url"
+            ];
+        ] .
+
+

Output

+
<http://WWW.EXAMPLE.COM> <http://xmlns.com/foaf/0.1/name> "Venus" .
+
+
+

14. RMLFNMLTC0032-CSV

+

Title: Condition on subject

+

Description: Tests that a condition shortcut works

+

Error expected? No

+

Input

+
Id,Name,Class
+1,Venus,A
+1,Serena,B
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix ex: <http://example.com/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix fno: <https://w3id.org/function/ontology#> .
+@prefix grel: <http://users.ugent.be/~bjdmeest/function/grel.ttl#> .
+@prefix idlab-fn: <https://w3id.org/imec/idlab/function#> .
+
+@base <http://example.com/base/> .
+
+<TriplesMap1>
+    rml:logicalSource [
+        rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.csv"
+        ];
+        rml:referenceFormulation rml:CSV
+    ] ;
+    rml:subjectMap [
+        rml:condition [
+            rml:functionExecution [
+                rml:function idlab-fn:equal ;
+                rml:input [
+                    rml:parameter grel:valueParam ;
+                    rml:inputValueMap [
+                        rml:reference "Class"
+                    ]
+                ] , [
+                    rml:parameter grel:valueParam2 ;
+                    rml:inputValue "A" ;
+                ] ;
+            ] ;
+            rml:return idlab-fn:_boolOut ;
+        ] ;
+        rml:template "http://example.com/{Name}" ;
+    ] ;
+    rml:predicateObjectMap [
+        rml:predicate foaf:name ;
+        rml:objectMap [
+            rml:reference "Name" ;
+        ] ;
+    ] ;
+.
+
+

Output

+
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
+
+
+

15. RMLFNMLTC0041-CSV

+

Title: Function using non-constant shortcut property return

+

Description: Tests that a non-constant FNML Return map also works

+

Error expected? No

+

Input

+
Id,Name,Comment,Class,url
+1,Venus,A&B,A,http://example.com/venus
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix ex: <http://example.com/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix fno: <https://w3id.org/function/ontology#> .
+@prefix grel: <http://users.ugent.be/~bjdmeest/function/grel.ttl#> .
+
+@base <http://example.com/base/> .
+
+<TriplesMap1>
+    rml:logicalSource [
+        rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.csv"
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example.com/{Name}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicate foaf:name;
+        rml:objectMap [
+            rml:functionExecution <#Execution> ;
+            rml:returnMap [
+                rml:constant grel:stringOut
+            ]
+        ]
+    ] .
+
+<#Execution>
+    rml:function grel:toUpperCase ;
+    rml:input
+        [
+            rml:parameter grel:valueParam ;
+            rml:inputValueMap [
+                rml:reference "Name" ;
+            ]
+        ] .
+
+

Output

+
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "VENUS" .
+
+
+

16. RMLFNMLTC0051-CSV

+

Title: Nested function - Test A

+

Description: Tests if a composite function of form f(g(x1),x2) works (i.e., the inner function is only one argument of the outer function)

+

Error expected? No

+

Input

+
Id,Name,Comment,Class
+1,M Venus,A&B,A
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix ex: <http://example.com/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix fno: <https://w3id.org/function/ontology#> .
+@prefix grel: <http://users.ugent.be/~bjdmeest/function/grel.ttl#> .
+@prefix idlab-fn: <https://w3id.org/imec/idlab/function#> .
+
+@base <http://example.com/base/> .
+
+<#Person_Mapping>
+    rml:logicalSource [
+        rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.csv"
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example.com/{Name}"
+    ];
+    rml:predicateObjectMap <#NameMapping> .
+
+<#NameMapping>
+    rml:predicate foaf:name ;
+    rml:objectMap [
+        rml:functionExecution <#Execution> ;
+        rml:return grel:stringOut
+    ]; .
+
+<#Execution> a rml:FunctionExecution ;
+    rml:function grel:toUpperCase ;
+    rml:input
+        [
+            a rml:Input ;
+            rml:parameter grel:valueParam ;
+            rml:inputValueMap [
+                rml:functionExecution <#Execution2> ;
+                rml:return grel:stringOut
+            ]
+        ] .
+
+<#Execution2> a rml:Execution ;
+    rml:function grel:string_replace ;
+    rml:input
+        [
+            a rml:Input ;
+            rml:parameter grel:valueParam ;
+            rml:inputValueMap [
+                rml:reference "Name"
+            ]
+        ] ,
+        [
+            a rml:Input ;
+            rml:parameter grel:param_find ;
+            rml:inputValue " "
+        ] ,
+        [
+            a rml:Input ;
+            rml:parameter grel:param_replace  ;
+            rml:inputValue "-"
+        ] .
+
+

Output

+
<http://example.com/M%20Venus> <http://xmlns.com/foaf/0.1/name> "M-VENUS" .
+
+
+

17. RMLFNMLTC0061-CSV

+

Title: Function on graph, 1 parameter

+

Description: Tests if a function can be used on a graph

+

Error expected? No

+

Input

+
Id,Name,Comment,Class,url
+1,Venus,A&B,A,http://example.com/venus
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix ex: <http://example.com/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix fno: <https://w3id.org/function/ontology#> .
+@prefix grel: <http://users.ugent.be/~bjdmeest/function/grel.ttl#> .
+@prefix idlab-fn: <https://w3id.org/imec/idlab/function#> .
+
+@base <http://example.com/base/> .
+
+<TriplesMap1>
+    rml:logicalSource [
+        rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.csv"
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example.com/{Name}" ;
+        rml:graphMap [
+            rml:functionExecution <#Execution> ;
+            rml:return idlab-fn:_stringOut
+            
+        ]
+    ];
+
+    rml:predicateObjectMap [
+        rml:predicate foaf:name;
+        rml:objectMap [
+            rml:reference "Name"
+        ]
+    ] .
+
+<#Execution>
+    rml:function idlab-fn:toUpperCaseURL ;
+    rml:input
+        [
+            rml:parameter idlab-fn:str ;
+            rml:inputValueMap [
+                rml:reference "url" ;
+            ]
+        ] .
+
+

Output

+
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" <HTTP://EXAMPLE.COM/VENUS> .
+
+
+

18. RMLFNMLTC0071-CSV

+

Title: Function on datatypeMap, 1 parameter

+

Description: Tests that function on DatatypeMap is handled

+

Error expected? No

+

Input

+
Id,Name,Comment,Class,Type
+1,Venus,A&B,A,http://www.w3.org/2001/XMLSchema#string
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix ex: <http://example.com/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix fno: <https://w3id.org/function/ontology#> .
+@prefix grel: <http://users.ugent.be/~bjdmeest/function/grel.ttl#> .
+@prefix idlab-fn: <https://w3id.org/imec/idlab/function#> .
+
+@base <http://example.com/base/> .
+
+<TriplesMap1>
+    rml:logicalSource [
+        rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.csv"
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example.com/{Name}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicate foaf:name;
+        rml:objectMap [
+           rml:reference "Name" ;
+           rml:datatypeMap [
+             rml:functionExecution <#Execution> ;
+             rml:return grel:stringOut
+           ]
+        ]
+    ] .
+
+<#Execution>
+    rml:function grel:string_substring ;
+    rml:input
+        [
+            rml:parameter grel:valueParam ;
+            rml:inputValueMap [
+                rml:reference "Type"
+            ];
+        ]  ,
+        [
+            a rml:Input ;
+            rml:parameter grel:p_int_i_from ;
+            rml:inputValue "0"
+        ]  .
+
+

Output

+
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "Venus"^^<http://www.w3.org/2001/XMLSchema#string> .
+
+
+

19. RMLFNMLTC0081-CSV

+

Title: Function on languageMap, 1 parameter

+

Description: Tests that function on LanguageMap is handled

+

Error expected? No

+

Input

+
Id,Name,Comment,Class,Lang
+1,Venus,A&B,A,en
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix ex: <http://example.com/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix fno: <https://w3id.org/function/ontology#> .
+@prefix grel: <http://users.ugent.be/~bjdmeest/function/grel.ttl#> .
+@prefix idlab-fn: <https://w3id.org/imec/idlab/function#> .
+
+@base <http://example.com/base/> .
+
+<TriplesMap1>
+    rml:logicalSource [
+        rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.csv"
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example.com/{Name}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicate foaf:name;
+        rml:objectMap [
+           rml:reference "Name" ;
+           rml:languageMap [
+             rml:functionExecution <#Execution> ;
+             rml:return grel:stringOut
+           ] ;
+        ]
+    ] .
+
+<#Execution>
+    rml:function grel:string_substring ;
+    rml:input
+        [
+            rml:parameter grel:valueParam ;
+            rml:inputValueMap [
+                rml:reference "Lang"
+            ];
+        ]  ,
+        [
+            a rml:Input ;
+            rml:parameter grel:p_int_i_from ;
+            rml:inputValue "0"
+        ]  .
+
+

Output

+
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "Venus"@en .
+
+
+

20. RMLFNMLTC0101-CSV

+

Title: Function on object, 1 false reference parameter

+

Description: Tests if a false reference parameters is caught

+

Error expected? Yes

+

Input

+
Id,Name,Comment,Class
+1,Venus,A&B,A
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix ex: <http://example.com/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix fno: <https://w3id.org/function/ontology#> .
+@prefix grel: <http://users.ugent.be/~bjdmeest/function/grel.ttl#> .
+@prefix idlab-fn: <https://w3id.org/imec/idlab/function#> .
+
+@base <http://example.com/base/> .
+
+<TriplesMap1>
+    rml:logicalSource [
+        rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.csv"
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example.com/{Name}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicate foaf:name;
+        rml:objectMap [
+            rml:functionExecution <#Execution> ;
+            rml:return grel:stringOut
+        ]
+    ] .
+
+<#Execution>
+    rml:function grel:toUpperCase ;
+    rml:input
+        [
+            rml:parameter grel:valueParam ;
+            rml:inputValueMap [
+                rml:reference "name" ;
+            ]
+        ] .
+
+
+

21. RMLFNMLTC0102-CSV

+

Title: Function on object, wrong function URI

+

Description: Tests that nothing is generated if a function is used where no implementation is made available to the mapping engine

+

Error expected? No

+

Input

+
Id,Name,Comment,Class
+1,Venus,A&B,A
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix ex: <http://example.com/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix fno: <https://w3id.org/function/ontology#> .
+@prefix grel: <http://users.ugent.be/~bjdmeest/function/grel.ttl#> .
+
+@base <http://example.com/base/> .
+
+<TriplesMap1>
+    rml:logicalSource [
+        rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.csv"
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example.com/{Name}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicate foaf:name;
+        rml:objectMap [
+            rml:functionExecution <#Execution> ;
+            rml:return grel:stringOut
+        ]
+    ] .
+
+<#Execution>
+    rml:function grel:unknown_func ;
+    rml:input
+        [
+            rml:parameter grel:valueParam ;
+            rml:inputValueMap [
+                rml:reference "Name" ;
+            ]
+        ] .
+
+

Output

+

+
+
+

22. RMLFNMLTC0103-CSV

+

Title: Function on object, wrong parameter

+

Description: Tests that nothing is generated if a function is defined using a parameter not defined in the FnO description

+

Error expected? No

+

Input

+
Id,Name,Comment,Class,url
+1,Venus,A&B,A,http://example.com/venus
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix ex: <http://example.com/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix fno: <https://w3id.org/function/ontology#> .
+@prefix grel: <http://users.ugent.be/~bjdmeest/function/grel.ttl#> .
+
+@base <http://example.com/base/> .
+
+<TriplesMap1>
+    rml:logicalSource [
+        rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.csv"
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example.com/{Name}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicate foaf:name;
+        rml:objectMap [
+            rml:functionExecution <#Execution> ;
+            rml:return grel:stringOut
+        ]
+    ] .
+
+<#Execution>
+    rml:function grel:toUpperCase ;
+    rml:input
+        [
+            rml:parameter grel:unknownParam ;
+            rml:inputValueMap [
+                rml:reference "Name" ;
+            ]
+        ] .
+
+

Output

+

+
+
+

23. RMLFNMLTC0104-CSV

+

Title: Function on object, wrong return parameter

+

Description: Tests that nothing is generated if a function is defined using a return not defined in the FnO description

+

Error expected? No

+

Input

+
Id,Name,Comment,Class,url
+1,Venus,A&B,A,http://example.com/venus
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix ex: <http://example.com/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix fno: <https://w3id.org/function/ontology#> .
+@prefix grel: <http://users.ugent.be/~bjdmeest/function/grel.ttl#> .
+
+@base <http://example.com/base/> .
+
+<TriplesMap1>
+    rml:logicalSource [
+        rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.csv"
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example.com/{Name}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicate foaf:name;
+        rml:objectMap [
+            rml:functionExecution <#Execution> ;
+            rml:return grel:unknownOut
+        ]
+    ] .
+
+<#Execution>
+    rml:function grel:toUpperCase ;
+    rml:input
+        [
+            rml:parameter grel:valueParam ;
+            rml:inputValueMap [
+                rml:reference "Name" ;
+            ]
+        ] .
+
+

Output

+

+
+
+ + + + + + + \ No newline at end of file diff --git a/src/test/resources/rml-fnml/docs/index.html b/src/test/resources/rml-fnml/docs/index.html new file mode 100644 index 00000000..f939ec5c --- /dev/null +++ b/src/test/resources/rml-fnml/docs/index.html @@ -0,0 +1,1865 @@ + + + + + + +RML-FNML: Test Cases + + + + + + + + + + + + + + + + + + + +

Abstract

This document defines the RML-FNML test cases to the determine the RML-FNML specification conformance of tools.

+
+ +

Status of This Document

+ This specification was published by the + Knowledge Graph Construction Community Group. It is not a W3C Standard nor is it + on the W3C Standards Track. + + Please note that under the + W3C Community Contributor License Agreement (CLA) + there is a limited opt-out and other conditions apply. + + Learn more about + W3C Community and Business Groups. +

+ GitHub Issues are preferred for + discussion of this specification. + + +

+ +

1. Introduction

+

This document defines the RML-FNML test cases, consisting of a collection of test case documents (input and expected output). +The purpose of the test cases is to determine the conformance of tools that execute RML rules to the RML-FNML specification.

+
+ +

2. Data model

+

The test cases are semantically described for re-usability and shareability following the W3C Test case description. +Each test:Testcase as the following properties:

+
    +
  • dcterms:identifier: unique ID of the test case.
  • +
  • rmltest:hasError: if an error of the RML Processor is expected or not.
  • +
  • rmltest:input: One or more input data of the test case.
  • +
  • rmltest:output: One or more output data of the test case.
  • +
  • rmltest:inputFormat: the input data format.
  • +
  • rmltest:outputFormat: the output data format.
  • +
  • rmltest:mappingDocument: the RML mapping rules in Turtle.
  • +
+
+ +

3. Test cases

+

This section describes the RML-FNML test cases. These descriptions are also available as RDF. +The files are available on GitHub in the folder test-cases. +Each test case is contained in a single folder, containing three types of files:

+
    +
  • Zero or more files containing the data sources, in the case of JSON, XML, CSV, or containing the SQL statements to create the necessary tables, in the case of MySQL, PostgreSQL, and SQL Server.
  • +
  • One file with the RML rules, called mapping.ttl, in the Turtle format.
  • +
  • Zero or more files with the expected RDF. No file is provided if an error is expected that must halt the generation of the RDF because of an error.
  • +
+
+ + +

4. RMLFNMLTC0001-CSV

+

Title: Function on object, 0 parameters

+

Description: Tests +(1) if a function without parameters can be used (FnO) +(2) if a function on an object map can be used (Term) +(3) if the output of the function is assigned the correct termType by default

+

Error expected? No

+

Input

+
Id,Name,Comment,Class
+1,Venus,A&B,A
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix ex: <http://example.com/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix fno: <https://w3id.org/function/ontology#> .
+@prefix idlab-fn: <https://w3id.org/imec/idlab/function#> .
+
+@base <http://example.com/base/> .
+
+<TriplesMap1>
+    rml:logicalSource [
+        rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.csv"
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example.com/{Name}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicate foaf:name;
+        rml:objectMap [
+            rml:functionExecution <#Execution> ;
+            rml:return idlab-fn:_stringOut
+        ]
+    ] .
+
+<#Execution>
+    rml:function idlab-fn:random .
+
+

Output

+
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "e4dcc7ee-8e2a-4012-92cc-9a74dd545e89" .
+
+
+

5. RMLFNMLTC0002-CSV

+

Title: Function on object, 1 reference parameter

+

Description: Tests: +(1) if a function with one parameter can be used, (FnO) +(2) a reference parameter can be used (Term)

+

Error expected? No

+

Input

+
Id,Name,Comment,Class
+1,Venus,A&B,A
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix ex: <http://example.com/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix fno: <https://w3id.org/function/ontology#> .
+@prefix grel: <http://users.ugent.be/~bjdmeest/function/grel.ttl#> .
+
+@base <http://example.com/base/> .
+
+<TriplesMap1>
+    rml:logicalSource [
+        rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.csv"
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example.com/{Name}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicate foaf:name;
+        rml:objectMap [
+            rml:functionExecution <#Execution> ;
+            rml:return grel:stringOut
+        ]
+    ] .
+
+<#Execution>
+    rml:function grel:toUpperCase ;
+    rml:input
+        [
+            rml:parameter grel:valueParam ;
+            rml:inputValueMap [
+                rml:reference "Name" ;
+            ]
+        ] .
+
+

Output

+
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "VENUS" .
+
+
+

6. RMLFNMLTC0003-CSV

+

Title: Function on object, 1 reference parameter, the output termType is IRI

+

Description: Tests if the output of the function is assigned the correct termType

+

Error expected? No

+

Input

+
Id,Name,Comment,Class,url
+1,Venus,A&B,A,http://example.com/venus
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix ex: <http://example.com/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix fno: <https://w3id.org/function/ontology#> .
+@prefix grel: <http://users.ugent.be/~bjdmeest/function/grel.ttl#> .
+@prefix idlab-fn: <https://w3id.org/imec/idlab/function#> .
+
+@base <http://example.com/base/> .
+
+<TriplesMap1>
+    rml:logicalSource [
+        rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.csv"
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example.com/{Name}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicate foaf:name;
+        rml:objectMap [
+            rml:functionExecution <#Execution> ;
+            rml:return idlab-fn:_stringOut ;
+            rml:termType rml:IRI
+        ];
+    ] .
+
+<#Execution>
+    rml:function idlab-fn:toUpperCaseURL ;
+    rml:input
+        [
+            rml:parameter idlab-fn:str ;
+            rml:inputValueMap [
+                rml:reference "url"
+            ];
+        ] .
+
+

Output

+
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> <HTTP://EXAMPLE.COM/VENUS> .
+
+
+

7. RMLFNMLTC0004-CSV

+

Title: Function on object, the output termType is Literal

+

Description: Tests if the output of the function is assigned the correct termType

+

Error expected? No

+

Input

+
Id,Name,Comment,Class,url
+1,Venus,A&B,A,http://example.com/venus
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix ex: <http://example.com/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix fno: <https://w3id.org/function/ontology#> .
+@prefix grel: <http://users.ugent.be/~bjdmeest/function/grel.ttl#> .
+@prefix idlab-fn: <https://w3id.org/imec/idlab/function#> .
+
+@base <http://example.com/base/> .
+
+<TriplesMap1>
+    rml:logicalSource [
+        rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.csv"
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example.com/{Name}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicate foaf:name;
+        rml:objectMap [
+            rml:functionExecution <#Execution> ;
+            rml:return grel:stringOut
+        ]
+    ] .
+
+<#Execution>
+    rml:function grel:length ;
+    rml:input
+        [
+            rml:parameter grel:valueParam ;
+            rml:inputValueMap [
+                rml:reference "Name"
+            ];
+        ]  .
+
+

Output

+
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "5"^^<http://www.w3.org/2001/XMLSchema#integer> .
+
+
+

8. RMLFNMLTC0005-CSV

+

Title: Function on object, 1 template parameter

+

Description: Tests if a function with a template parameter can be used

+

Error expected? No

+

Input

+
Id,Name,Comment,Class
+1,Venus,A&B,A
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix ex: <http://example.com/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix fno: <https://w3id.org/function/ontology#> .
+@prefix grel: <http://users.ugent.be/~bjdmeest/function/grel.ttl#> .
+
+@base <http://example.com/base/> .
+
+<TriplesMap1>
+    rml:logicalSource [
+        rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.csv"
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example.com/{Name}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicate foaf:name;
+        rml:objectMap [
+            rml:functionExecution <#Execution> ;
+            rml:return grel:stringOut
+        ]
+    ] .
+
+<#Execution>
+    rml:function grel:toUpperCase ;
+    rml:input
+        [
+            rml:parameter grel:valueParam ;
+            rml:inputValueMap [
+                rml:template "Name: {Name}" ;
+            ];
+        ] .
+
+

Output

+
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "NAME: VENUS" .
+
+
+

9. RMLFNMLTC0007-CSV

+

Title: Function on object returns empty string

+

Description: Tests that a triple is generated when the results is an empty string.

+

Error expected? No

+

Input

+
Id,Name,Comment,Class
+1,Venus,A&B,A
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix ex: <http://example.com/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix fno: <https://w3id.org/function/ontology#> .
+@prefix grel: <http://users.ugent.be/~bjdmeest/function/grel.ttl#> .
+@prefix idlab-fn: <https://w3id.org/imec/idlab/function#> .
+
+@base <http://example.com/base/> .
+
+<TriplesMap1>
+    rml:logicalSource [
+        rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.csv"
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example.com/{Name}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicate foaf:name;
+        rml:objectMap [
+            rml:functionExecution <#Execution> ;
+            rml:return grel:stringOut
+        ]
+    ] .
+
+<#Execution>
+    rml:function grel:string_substring ;
+    rml:input
+        [
+            rml:parameter grel:valueParam ;
+            rml:inputValueMap [
+                rml:reference "Name"
+            ];
+        ]  ,
+        [
+            a rml:Input ;
+            rml:parameter grel:p_int_i_from ;
+            rml:inputValue "5"
+        ]  .
+
+

Output

+
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "" .
+
+
+

10. RMLFNMLTC0008-CSV

+

Title: Function on object returns null

+

Description: Tests that no triple should be generated when the result is null.

+

Error expected? No

+

Input

+
Id,Name,Comment,Class
+1,Venus,A&B,A
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix ex: <http://example.com/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix fno: <https://w3id.org/function/ontology#> .
+@prefix grel: <http://users.ugent.be/~bjdmeest/function/grel.ttl#> .
+@prefix idlab-fn: <https://w3id.org/imec/idlab/function#> .
+
+@base <http://example.com/base/> .
+
+<TriplesMap1>
+    rml:logicalSource [
+        rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.csv"
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example.com/{Name}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicate foaf:name;
+        rml:objectMap [
+            rml:functionExecution <#Execution> ;
+            rml:return grel:stringOut
+        ]
+    ] .
+
+<#Execution>
+    rml:function grel:string_substring ;
+    rml:input
+        [
+            rml:parameter grel:valueParam ;
+            rml:inputValueMap [
+                rml:reference "Name"
+            ];
+        ]  ,
+        [
+            a rml:Input ;
+            rml:parameter grel:p_int_i_from ;
+            rml:inputValue "1000"
+        ]  .
+
+

Output

+

+
+
+

11. RMLFNMLTC0011-CSV

+

Title: Function on predicate, 1 parameter

+

Description: Tests if a function can be used on a predicate

+

Error expected? No

+

Input

+
Id,Name,Comment,Class
+1,Venus,A&B,A
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix ex: <http://example.com/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix fno: <https://w3id.org/function/ontology#> .
+@prefix grel: <http://users.ugent.be/~bjdmeest/function/grel.ttl#> .
+@prefix idlab-fn: <https://w3id.org/imec/idlab/function#> .
+
+@base <http://example.com/base/> .
+
+<TriplesMap1>
+    rml:logicalSource [
+        rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.csv"
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example.com/{Name}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicateMap [
+            rml:functionExecution <#Execution> ;
+            rml:return idlab-fn:_stringOut
+        ];
+        rml:object foaf:name;
+    ] .
+
+<#Execution>
+    rml:function idlab-fn:toUpperCaseURL ;
+    rml:input
+        [
+            rml:parameter idlab-fn:str ;
+            rml:inputValueMap [
+                rml:reference "Name"
+            ];
+        ] .
+
+

Output

+
<http://example.com/Venus> <http://VENUS> <http://xmlns.com/foaf/0.1/name> .
+
+
+

12. RMLFNMLTC0021-CSV

+

Title: Function on object, 1 reference parameter, 1 constant parameter

+

Description: Tests if a function with multiple parameters can be used

+

Error expected? No

+

Input

+
Id,Name,Comment,Class
+1,Venus,A&B,A
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix ex: <http://example.com/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix fno: <https://w3id.org/function/ontology#> .
+@prefix grel: <http://users.ugent.be/~bjdmeest/function/grel.ttl#> .
+
+@base <http://example.com/base/> .
+
+<TriplesMap1>
+    rml:logicalSource [
+        rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.csv"
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example.com/{Name}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicate foaf:name;
+        rml:objectMap [
+            rml:functionExecution <#Execution> ;
+            rml:return grel:stringOut
+        ]
+    ] .
+
+<#Execution>
+    rml:function grel:escape ;
+    rml:input
+        [
+            rml:parameter grel:valueParam ;
+            rml:inputValueMap [
+                rml:reference "Comment"
+            ]
+        ] ,
+        [
+            rml:parameter grel:modeParam  ;
+            rml:inputValue "html"
+        ] .
+
+

Output

+
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "A&B" .
+
+
+

13. RMLFNMLTC0031-CSV

+

Title: Function on subject, 1 parameter

+

Description: Tests if +(1) a function can be used on a subject +(2) Tests if the default termType assigned to the output of the function to be correct

+

Error expected? No

+

Input

+
Id,Name,url
+1,Venus,www.example.com
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix ex: <http://example.com/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix fno: <https://w3id.org/function/ontology#> .
+@prefix grel: <http://users.ugent.be/~bjdmeest/function/grel.ttl#> .
+@prefix idlab-fn: <https://w3id.org/imec/idlab/function#> .
+
+@base <http://example.com/base/> .
+
+<TriplesMap1>
+    rml:logicalSource [
+        rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.csv"
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:functionExecution <#Execution> ;
+        rml:return idlab-fn:_stringOut
+    ];
+    rml:predicateObjectMap [
+        rml:predicate foaf:name;
+        rml:objectMap [ rml:reference "Name"]
+    ] .
+
+<#Execution>
+    rml:function idlab-fn:toUpperCaseURL ;
+    rml:input
+        [
+            rml:parameter idlab-fn:str ;
+            rml:inputValueMap [
+                rml:reference "url"
+            ];
+        ] .
+
+

Output

+
<http://WWW.EXAMPLE.COM> <http://xmlns.com/foaf/0.1/name> "Venus" .
+
+
+

14. RMLFNMLTC0032-CSV

+

Title: Condition on subject

+

Description: Tests that a condition shortcut works

+

Error expected? No

+

Input

+
Id,Name,Class
+1,Venus,A
+1,Serena,B
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix ex: <http://example.com/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix fno: <https://w3id.org/function/ontology#> .
+@prefix grel: <http://users.ugent.be/~bjdmeest/function/grel.ttl#> .
+@prefix idlab-fn: <https://w3id.org/imec/idlab/function#> .
+
+@base <http://example.com/base/> .
+
+<TriplesMap1>
+    rml:logicalSource [
+        rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.csv"
+        ];
+        rml:referenceFormulation rml:CSV
+    ] ;
+    rml:subjectMap [
+        rml:condition [
+            rml:functionExecution [
+                rml:function idlab-fn:equal ;
+                rml:input [
+                    rml:parameter grel:valueParam ;
+                    rml:inputValueMap [
+                        rml:reference "Class"
+                    ]
+                ] , [
+                    rml:parameter grel:valueParam2 ;
+                    rml:inputValue "A" ;
+                ] ;
+            ] ;
+            rml:return idlab-fn:_boolOut ;
+        ] ;
+        rml:template "http://example.com/{Name}" ;
+    ] ;
+    rml:predicateObjectMap [
+        rml:predicate foaf:name ;
+        rml:objectMap [
+            rml:reference "Name" ;
+        ] ;
+    ] ;
+.
+
+

Output

+
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
+
+
+

15. RMLFNMLTC0041-CSV

+

Title: Function using non-constant shortcut property return

+

Description: Tests that a non-constant FNML Return map also works

+

Error expected? No

+

Input

+
Id,Name,Comment,Class,url
+1,Venus,A&B,A,http://example.com/venus
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix ex: <http://example.com/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix fno: <https://w3id.org/function/ontology#> .
+@prefix grel: <http://users.ugent.be/~bjdmeest/function/grel.ttl#> .
+
+@base <http://example.com/base/> .
+
+<TriplesMap1>
+    rml:logicalSource [
+        rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.csv"
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example.com/{Name}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicate foaf:name;
+        rml:objectMap [
+            rml:functionExecution <#Execution> ;
+            rml:returnMap [
+                rml:constant grel:stringOut
+            ]
+        ]
+    ] .
+
+<#Execution>
+    rml:function grel:toUpperCase ;
+    rml:input
+        [
+            rml:parameter grel:valueParam ;
+            rml:inputValueMap [
+                rml:reference "Name" ;
+            ]
+        ] .
+
+

Output

+
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "VENUS" .
+
+
+

16. RMLFNMLTC0051-CSV

+

Title: Nested function - Test A

+

Description: Tests if a composite function of form f(g(x1),x2) works (i.e., the inner function is only one argument of the outer function)

+

Error expected? No

+

Input

+
Id,Name,Comment,Class
+1,M Venus,A&B,A
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix ex: <http://example.com/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix fno: <https://w3id.org/function/ontology#> .
+@prefix grel: <http://users.ugent.be/~bjdmeest/function/grel.ttl#> .
+@prefix idlab-fn: <https://w3id.org/imec/idlab/function#> .
+
+@base <http://example.com/base/> .
+
+<#Person_Mapping>
+    rml:logicalSource [
+        rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.csv"
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example.com/{Name}"
+    ];
+    rml:predicateObjectMap <#NameMapping> .
+
+<#NameMapping>
+    rml:predicate foaf:name ;
+    rml:objectMap [
+        rml:functionExecution <#Execution> ;
+        rml:return grel:stringOut
+    ]; .
+
+<#Execution> a rml:FunctionExecution ;
+    rml:function grel:toUpperCase ;
+    rml:input
+        [
+            a rml:Input ;
+            rml:parameter grel:valueParam ;
+            rml:inputValueMap [
+                rml:functionExecution <#Execution2> ;
+                rml:return grel:stringOut
+            ]
+        ] .
+
+<#Execution2> a rml:Execution ;
+    rml:function grel:string_replace ;
+    rml:input
+        [
+            a rml:Input ;
+            rml:parameter grel:valueParam ;
+            rml:inputValueMap [
+                rml:reference "Name"
+            ]
+        ] ,
+        [
+            a rml:Input ;
+            rml:parameter grel:param_find ;
+            rml:inputValue " "
+        ] ,
+        [
+            a rml:Input ;
+            rml:parameter grel:param_replace  ;
+            rml:inputValue "-"
+        ] .
+
+

Output

+
<http://example.com/M%20Venus> <http://xmlns.com/foaf/0.1/name> "M-VENUS" .
+
+
+

17. RMLFNMLTC0061-CSV

+

Title: Function on graph, 1 parameter

+

Description: Tests if a function can be used on a graph

+

Error expected? No

+

Input

+
Id,Name,Comment,Class,url
+1,Venus,A&B,A,http://example.com/venus
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix ex: <http://example.com/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix fno: <https://w3id.org/function/ontology#> .
+@prefix grel: <http://users.ugent.be/~bjdmeest/function/grel.ttl#> .
+@prefix idlab-fn: <https://w3id.org/imec/idlab/function#> .
+
+@base <http://example.com/base/> .
+
+<TriplesMap1>
+    rml:logicalSource [
+        rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.csv"
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example.com/{Name}" ;
+        rml:graphMap [
+            rml:functionExecution <#Execution> ;
+            rml:return idlab-fn:_stringOut
+            
+        ]
+    ];
+
+    rml:predicateObjectMap [
+        rml:predicate foaf:name;
+        rml:objectMap [
+            rml:reference "Name"
+        ]
+    ] .
+
+<#Execution>
+    rml:function idlab-fn:toUpperCaseURL ;
+    rml:input
+        [
+            rml:parameter idlab-fn:str ;
+            rml:inputValueMap [
+                rml:reference "url" ;
+            ]
+        ] .
+
+

Output

+
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" <HTTP://EXAMPLE.COM/VENUS> .
+
+
+

18. RMLFNMLTC0071-CSV

+

Title: Function on datatypeMap, 1 parameter

+

Description: Tests that function on DatatypeMap is handled

+

Error expected? No

+

Input

+
Id,Name,Comment,Class,Type
+1,Venus,A&B,A,http://www.w3.org/2001/XMLSchema#string
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix ex: <http://example.com/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix fno: <https://w3id.org/function/ontology#> .
+@prefix grel: <http://users.ugent.be/~bjdmeest/function/grel.ttl#> .
+@prefix idlab-fn: <https://w3id.org/imec/idlab/function#> .
+
+@base <http://example.com/base/> .
+
+<TriplesMap1>
+    rml:logicalSource [
+        rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.csv"
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example.com/{Name}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicate foaf:name;
+        rml:objectMap [
+           rml:reference "Name" ;
+           rml:datatypeMap [
+             rml:functionExecution <#Execution> ;
+             rml:return grel:stringOut
+           ]
+        ]
+    ] .
+
+<#Execution>
+    rml:function grel:string_substring ;
+    rml:input
+        [
+            rml:parameter grel:valueParam ;
+            rml:inputValueMap [
+                rml:reference "Type"
+            ];
+        ]  ,
+        [
+            a rml:Input ;
+            rml:parameter grel:p_int_i_from ;
+            rml:inputValue "0"
+        ]  .
+
+

Output

+
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "Venus"^^<http://www.w3.org/2001/XMLSchema#string> .
+
+
+

19. RMLFNMLTC0081-CSV

+

Title: Function on languageMap, 1 parameter

+

Description: Tests that function on LanguageMap is handled

+

Error expected? No

+

Input

+
Id,Name,Comment,Class,Lang
+1,Venus,A&B,A,en
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix ex: <http://example.com/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix fno: <https://w3id.org/function/ontology#> .
+@prefix grel: <http://users.ugent.be/~bjdmeest/function/grel.ttl#> .
+@prefix idlab-fn: <https://w3id.org/imec/idlab/function#> .
+
+@base <http://example.com/base/> .
+
+<TriplesMap1>
+    rml:logicalSource [
+        rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.csv"
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example.com/{Name}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicate foaf:name;
+        rml:objectMap [
+           rml:reference "Name" ;
+           rml:languageMap [
+             rml:functionExecution <#Execution> ;
+             rml:return grel:stringOut
+           ] ;
+        ]
+    ] .
+
+<#Execution>
+    rml:function grel:string_substring ;
+    rml:input
+        [
+            rml:parameter grel:valueParam ;
+            rml:inputValueMap [
+                rml:reference "Lang"
+            ];
+        ]  ,
+        [
+            a rml:Input ;
+            rml:parameter grel:p_int_i_from ;
+            rml:inputValue "0"
+        ]  .
+
+

Output

+
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "Venus"@en .
+
+
+

20. RMLFNMLTC0101-CSV

+

Title: Function on object, 1 false reference parameter

+

Description: Tests if a false reference parameters is caught

+

Error expected? Yes

+

Input

+
Id,Name,Comment,Class
+1,Venus,A&B,A
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix ex: <http://example.com/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix fno: <https://w3id.org/function/ontology#> .
+@prefix grel: <http://users.ugent.be/~bjdmeest/function/grel.ttl#> .
+@prefix idlab-fn: <https://w3id.org/imec/idlab/function#> .
+
+@base <http://example.com/base/> .
+
+<TriplesMap1>
+    rml:logicalSource [
+        rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.csv"
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example.com/{Name}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicate foaf:name;
+        rml:objectMap [
+            rml:functionExecution <#Execution> ;
+            rml:return grel:stringOut
+        ]
+    ] .
+
+<#Execution>
+    rml:function grel:toUpperCase ;
+    rml:input
+        [
+            rml:parameter grel:valueParam ;
+            rml:inputValueMap [
+                rml:reference "name" ;
+            ]
+        ] .
+
+
+

21. RMLFNMLTC0102-CSV

+

Title: Function on object, wrong function URI

+

Description: Tests that nothing is generated if a function is used where no implementation is made available to the mapping engine

+

Error expected? No

+

Input

+
Id,Name,Comment,Class
+1,Venus,A&B,A
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix ex: <http://example.com/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix fno: <https://w3id.org/function/ontology#> .
+@prefix grel: <http://users.ugent.be/~bjdmeest/function/grel.ttl#> .
+
+@base <http://example.com/base/> .
+
+<TriplesMap1>
+    rml:logicalSource [
+        rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.csv"
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example.com/{Name}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicate foaf:name;
+        rml:objectMap [
+            rml:functionExecution <#Execution> ;
+            rml:return grel:stringOut
+        ]
+    ] .
+
+<#Execution>
+    rml:function grel:unknown_func ;
+    rml:input
+        [
+            rml:parameter grel:valueParam ;
+            rml:inputValueMap [
+                rml:reference "Name" ;
+            ]
+        ] .
+
+

Output

+

+
+
+

22. RMLFNMLTC0103-CSV

+

Title: Function on object, wrong parameter

+

Description: Tests that nothing is generated if a function is defined using a parameter not defined in the FnO description

+

Error expected? No

+

Input

+
Id,Name,Comment,Class,url
+1,Venus,A&B,A,http://example.com/venus
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix ex: <http://example.com/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix fno: <https://w3id.org/function/ontology#> .
+@prefix grel: <http://users.ugent.be/~bjdmeest/function/grel.ttl#> .
+
+@base <http://example.com/base/> .
+
+<TriplesMap1>
+    rml:logicalSource [
+        rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.csv"
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example.com/{Name}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicate foaf:name;
+        rml:objectMap [
+            rml:functionExecution <#Execution> ;
+            rml:return grel:stringOut
+        ]
+    ] .
+
+<#Execution>
+    rml:function grel:toUpperCase ;
+    rml:input
+        [
+            rml:parameter grel:unknownParam ;
+            rml:inputValueMap [
+                rml:reference "Name" ;
+            ]
+        ] .
+
+

Output

+

+
+
+

23. RMLFNMLTC0104-CSV

+

Title: Function on object, wrong return parameter

+

Description: Tests that nothing is generated if a function is defined using a return not defined in the FnO description

+

Error expected? No

+

Input

+
Id,Name,Comment,Class,url
+1,Venus,A&B,A,http://example.com/venus
+
+

Mapping

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix ex: <http://example.com/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix fno: <https://w3id.org/function/ontology#> .
+@prefix grel: <http://users.ugent.be/~bjdmeest/function/grel.ttl#> .
+
+@base <http://example.com/base/> .
+
+<TriplesMap1>
+    rml:logicalSource [
+        rml:source [ a rml:RelativePathSource;
+          rml:root rml:MappingDirectory;
+          rml:path "student.csv"
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example.com/{Name}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicate foaf:name;
+        rml:objectMap [
+            rml:functionExecution <#Execution> ;
+            rml:return grel:unknownOut
+        ]
+    ] .
+
+<#Execution>
+    rml:function grel:toUpperCase ;
+    rml:input
+        [
+            rml:parameter grel:valueParam ;
+            rml:inputValueMap [
+                rml:reference "Name" ;
+            ]
+        ] .
+
+

Output

+

+
+
+ + + + + + + \ No newline at end of file diff --git a/src/test/resources/rml-fnml/functions.ttl b/src/test/resources/rml-fnml/functions.ttl new file mode 100644 index 00000000..d3ddd8bb --- /dev/null +++ b/src/test/resources/rml-fnml/functions.ttl @@ -0,0 +1,102 @@ +@prefix dcterms: . +@prefix fno: . +@prefix fns: . +@prefix grel: . +@prefix rdf: . +@prefix rdfs: . +@prefix xsd: . + +grel:toUpperCase + a fno:Function ; + fno:name "to Uppercase" ; + rdfs:label "to Uppercase" ; + dcterms:description "Returns the input with all letters in upper case." ; + fno:expects ( grel:valueParam ) ; + fno:returns ( grel:stringOut ) . + +grel:valueParam + a fno:Parameter ; + fno:name "input value" ; + rdfs:label "input value" ; + fno:predicate grel:valueParameter ; + fno:type xsd:string ; + fno:required "true"^^xsd:boolean . + +grel:stringOut + a fno:Output ; + fno:name "output string" ; + rdfs:label "output string" ; + fno:predicate grel:stringOutput ; + fno:type xsd:string . + +grel:string_replace + a fno:Function ; + fno:name "replace" ; + dcterms:description "replace" ; + fno:expects ( grel:valueParam grel:param_find grel:param_replace ) ; + fno:returns ( grel:stringOut ) . + +grel:param_find + a fno:Parameter ; + fno:name "f" ; + rdfs:label "f" ; + fno:predicate grel:p_string_find ; + fno:type xsd:string ; + fno:required "true"^^xsd:boolean . + +grel:param_replace + a fno:Parameter ; + fno:name "r" ; + rdfs:label "r" ; + fno:predicate grel:p_string_replace ; + fno:type xsd:string ; + fno:required "true"^^xsd:boolean . + +fns:helloworld + a fno:Function ; + fno:name "hello world" ; + dcterms:description "The hello world function has no parameters and always returns the string 'Hello World!'" ; + fno:expects ( ) ; + fno:returns ( fns:stringOutput ) . + +fns:stringOutput + a fno:Output ; + fno:name "output string" ; + rdfs:label "output string" ; + fno:predicate fns:hasStringOutput ; + fno:type xsd:string . + +fns:schema + a fno:Function ; + fno:name "schema term generator" ; + dcterms:description "The schema term generator function returns a string of the form 'https://schema.org/{stringParameter}'" ; + fno:expects ( fns:stringParameter ) ; + fno:returns ( fns:stringOutput ) . + +fns:stringParameter + a fno:Parameter ; + fno:name "input string" ; + rdfs:label "input string" ; + fno:predicate fns:hasStringParameter ; + fno:type xsd:string . + +fns:parseURL + a fno:Function ; + fno:name "parse URL" ; + dcterms:description "The parse URL function returns the protocol, domain, and path as strings of a URL of the form '{protocolOutput}://{domainOutput}/{stringOutput}'" ; + fno:expects ( fns:stringParameter ) ; + fno:returns ( fns:protocolOutput fns:domainOutput fns:stringOutput ) . + +fns:protocolOutput + a fno:Output ; + fno:name "protocol output string" ; + rdfs:label "protocol output string" ; + fno:predicate fns:hasProtocolOutput ; + fno:type xsd:string . + +fns:domainOutput + a fno:Output ; + fno:name "domain output string" ; + rdfs:label "domain output string" ; + fno:predicate fns:hasDomainOutput ; + fno:type xsd:string . diff --git a/src/test/resources/rml-fnml/list.sh b/src/test/resources/rml-fnml/list.sh new file mode 100755 index 00000000..12c32031 --- /dev/null +++ b/src/test/resources/rml-fnml/list.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +for i in RML*; do + echo "
" +done diff --git a/src/test/resources/rml-fnml/make-metadata.py b/src/test/resources/rml-fnml/make-metadata.py new file mode 100755 index 00000000..4e42105d --- /dev/null +++ b/src/test/resources/rml-fnml/make-metadata.py @@ -0,0 +1,139 @@ +#!/usr/bin/env python3 + +import os +import sys +import glob +import csv + +def get_title_description(testcase: str): + with open ('descriptions.csv') as csvfile: + reader = csv.reader(csvfile) + for row in reader: + if row[0] == testcase: + return row[1], row[2] + +def main(spec: str): + with open ('metadata.csv', 'w', newline='') as csvfile: + writer = csv.writer(csvfile) + writer.writerow(['ID', 'title', 'description', 'specification', + 'mapping', 'input_format1', 'input_format2', + 'input_format3', 'output_format1', 'output_format2', + 'output_format3', 'input1', 'input2', 'input3', + 'output1', 'output2', 'output3', 'error']) + for testcase in glob.glob('RML*'): + print(testcase) + title, description = get_title_description(testcase) + error = 'false' + input1 = '' + input2 = '' + input3 = '' + input_format1 = '' + input_format2 = '' + input_format3 = '' + output1 = '' + output2 = '' + output3 = '' + output_format1 = '' + output_format2 = '' + output_format3 = '' + + # Input file + if os.path.exists(os.path.join(testcase, 'student.csv')): + input1 = 'student.csv' + input_format1 = 'text/csv' + + # Mapping file + if os.path.exists(os.path.join(testcase, 'mapping.ttl')): + mapping_file = 'mapping.ttl' + else: + raise ValueError('Mapping file missing!') + + # Output files + if os.path.exists(os.path.join(testcase, 'default.nq')): + output1 = 'default.nq' + output_format1 = 'application/n-quads' + elif os.path.exists(os.path.join(testcase, 'output.nq')): + output1 = 'output.nq' + output_format1 = 'application/n-quads' + else: + error = 'true' + + writer.writerow([testcase, title, description, spec, mapping_file, + input_format1, input_format2, input_format3, + output_format1, output_format2, output_format3, + input1, input2, input3, output1, output2, + output3, error]) + lines = [] + # Title and description + lines.append(f'## {testcase}\n\n') + lines.append(f'**Title**: {title}\n\n') + lines.append(f'**Description**: {description}\n\n') + if error == 'true': + error_html = 'Yes' + else: + error_html = 'No' + lines.append(f'**Error expected?** {error_html}\n\n') + + # Input + inputCount = '' + + for index, i in enumerate([input1, input2, input3]): + if not i: + break + + if 'http://w3id.org/rml/resources' in i: + input_html = f'**Input{inputCount}**\n [{i}]({i})\n\n' + else: + try: + with open(os.path.join(testcase, i)) as f: + input_html = f'**Input{inputCount}**\n```\n{f.read()}\n```\n\n' + except UnicodeDecodeError: + try: + with open(os.path.join(testcase, i), encoding='utf-16') as f: + input_html = f'**Input{inputCount}**\n```\n{f.read()}\n```\n\n' + except UnicodeDecodeError: + input_html = f'**Input{inputCount}**\n `{i}`\n\n' + + lines.append(input_html) + inputCount = f' {index + 1}' + + # Mapping + with open(os.path.join(testcase, mapping_file)) as f: + mapping_html = f'**Mapping**\n```\n{f.read()}\n```\n\n' + lines.append(mapping_html) + + # Output + outputCount = '' + if output2 or output3: + outputCount = ' 1' + + for index, i in enumerate([output1, output2, output3]): + if not i: + break + + if 'http://w3id.org/rml/resources' in i: + output_html = f'**Output{outputCount}**\n [{i}]({i})\n\n' + else: + try: + with open(os.path.join(testcase, i)) as f: + output_html = f'**Output{outputCount}**\n```\n{f.read()}\n```\n\n' + except UnicodeDecodeError: + try: + with open(os.path.join(testcase, i), encoding='utf-16') as f: + output_html = f'**Output{outputCount}**\n```\n{f.read()}\n```\n\n' + except UnicodeDecodeError: + output_html = f'**Output{outputCount}**\n `{i}`\n\n' + + lines.append(output_html) + outputCount = f' {index + 2}' + + + with open(os.path.join(testcase, 'README.md'), 'w') as f: + f.writelines(lines) + + +if __name__ == '__main__': + if len(sys.argv) != 2: + print('Usage: ./make-metadata.py ') + sys.exit(1) + main(sys.argv[1]) diff --git a/src/test/resources/rml-fnml/manifest.rml.ttl b/src/test/resources/rml-fnml/manifest.rml.ttl new file mode 100644 index 00000000..9d7b4281 --- /dev/null +++ b/src/test/resources/rml-fnml/manifest.rml.ttl @@ -0,0 +1,267 @@ +@prefix xsd: . +@prefix dcterms: . +@prefix rml: . +@prefix rmltest: . +@prefix test: . +@base . + +# java -jar .\burp.jar -m manifest.rml.ttl -o manifest.ttl -b http://w3id.org/rml/fnml/test/ + +_:source + rml:source [ + a rml:RelativePathSource ; + rml:path "metadata.csv" ; + rml:null ""; + ]; + rml:referenceFormulation rml:CSV; +. + +<#TriplesMapTestcase> + a rml:TriplesMap; + + rml:logicalSource _:source; + + rml:subjectMap [ + rml:reference "ID"; + rml:class test:TestCase; + ]; + + rml:predicateObjectMap [ + rml:predicate dcterms:identifier; + rml:objectMap [ + rml:reference "ID"; + ]; + ]; + + rml:predicateObjectMap [ + rml:predicate rmltest:hasError; + rml:objectMap [ + rml:reference "error"; + rml:datatype xsd:boolean; + ]; + ]; + + rml:predicateObjectMap [ + rml:predicate rmltest:mappingDocument; + rml:objectMap [ + rml:reference "mapping"; + ]; + ]; + + rml:predicateObjectMap [ + rml:predicate rmltest:input; + rml:objectMap [ a rml:RefObjectMap; + rml:parentTriplesMap <#TriplesMapInput1>; + rml:joinCondition [ + rml:child "ID"; + rml:parent "ID"; + ]; + ]; + ]; + + rml:predicateObjectMap [ + rml:predicate rmltest:input; + rml:objectMap [ a rml:RefObjectMap; + rml:parentTriplesMap <#TriplesMapInput2>; + rml:joinCondition [ + rml:child "ID"; + rml:parent "ID"; + ]; + ]; + ]; + + rml:predicateObjectMap [ + rml:predicate rmltest:input; + rml:objectMap [ a rml:RefObjectMap; + rml:parentTriplesMap <#TriplesMapInput3>; + rml:joinCondition [ + rml:child "ID"; + rml:parent "ID"; + ]; + ]; + ]; + + rml:predicateObjectMap [ + rml:predicate rmltest:output; + rml:objectMap [ a rml:RefObjectMap; + rml:parentTriplesMap <#TriplesMapOutput1>; + rml:joinCondition [ + rml:child "ID"; + rml:parent "ID"; + ]; + ]; + ]; + + rml:predicateObjectMap [ + rml:predicate rmltest:output; + rml:objectMap [ a rml:RefObjectMap; + rml:parentTriplesMap <#TriplesMapOutput2>; + rml:joinCondition [ + rml:child "ID"; + rml:parent "ID"; + ]; + ]; + ]; + + rml:predicateObjectMap [ + rml:predicate rmltest:output; + rml:objectMap [ a rml:RefObjectMap; + rml:parentTriplesMap <#TriplesMapOutput3>; + rml:joinCondition [ + rml:child "ID"; + rml:parent "ID"; + ]; + ]; + ]; +. + +<#TriplesMapInput1> + a rml:TriplesMap; + + rml:logicalSource _:source ; + + rml:subjectMap [ + rml:template "{ID}/input/{input1}"; + rml:class rmltest:Input; + ]; + + rml:predicateObjectMap [ + rml:predicate rmltest:input; + rml:objectMap [ + rml:reference "input1"; + ]; + ]; + + rml:predicateObjectMap [ + rml:predicate rmltest:inputFormat; + rml:objectMap [ + rml:reference "input_format1"; + ]; + ]; +. + +<#TriplesMapInput2> + a rml:TriplesMap; + + rml:logicalSource _:source; + + rml:subjectMap [ + rml:template "{ID}/input/{input2}"; + rml:class rmltest:Input; + ]; + + rml:predicateObjectMap [ + rml:predicate rmltest:input; + rml:objectMap [ + rml:reference "input2"; + ]; + ]; + + rml:predicateObjectMap [ + rml:predicate rmltest:inputFormat; + rml:objectMap [ + rml:reference "input_format2"; + ]; + ]; +. + +<#TriplesMapInput3> + a rml:TriplesMap; + + rml:logicalSource _:source; + + rml:subjectMap [ + rml:template "{ID}/input/{input3}"; + rml:class rmltest:Input; + ]; + + rml:predicateObjectMap [ + rml:predicate rmltest:input; + rml:objectMap [ + rml:reference "input3"; + ]; + ]; + + rml:predicateObjectMap [ + rml:predicate rmltest:inputFormat; + rml:objectMap [ + rml:reference "input_format3"; + ]; + ]; +. + +<#TriplesMapOutput1> + a rml:TriplesMap; + + rml:logicalSource _:source; + + rml:subjectMap [ + rml:template "{ID}/output/{output1}"; + rml:class rmltest:Output; + ]; + + rml:predicateObjectMap [ + rml:predicate rmltest:output; + rml:objectMap [ + rml:reference "output1"; + ]; + ]; + + rml:predicateObjectMap [ + rml:predicate rmltest:outputFormat; + rml:objectMap [ + rml:reference "output_format1"; + ]; + ]; +. + +<#TriplesMapOutput2> + a rml:TriplesMap; + + rml:logicalSource _:source; + + rml:subjectMap [ + rml:template "{ID}/output/{output2}"; + rml:class rmltest:Output; + ]; + + rml:predicateObjectMap [ + rml:predicate rmltest:output; + rml:objectMap [ + rml:reference "output2"; + ]; + ]; + + rml:predicateObjectMap [ + rml:predicate rmltest:outputFormat; + rml:objectMap [ + rml:reference "output_format2"; + ]; + ]; +. + +<#TriplesMapOutput3> + a rml:TriplesMap; + + rml:logicalSource _:source; + + rml:subjectMap [ + rml:template "{ID}/output/{output3}"; + rml:class rmltest:Output; + ]; + + rml:predicateObjectMap [ + rml:predicate rmltest:output; + rml:objectMap [ + rml:reference "output3"; + ]; + ]; + + rml:predicateObjectMap [ + rml:predicate rmltest:outputFormat; + rml:objectMap [ + rml:reference "output_format3"; + ]; + ]; +. + diff --git a/src/test/resources/rml-fnml/manifest.ttl b/src/test/resources/rml-fnml/manifest.ttl new file mode 100644 index 00000000..9110b4a1 --- /dev/null +++ b/src/test/resources/rml-fnml/manifest.ttl @@ -0,0 +1,236 @@ + "student.csv" . + "text/csv" . + . + "output.nq" . + "application/n-quads" . + . + "RMLFNMLTC0001-CSV" . + "false"^^ . + . + "mapping.ttl" . + . + . + "student.csv" . + "text/csv" . + . + "output.nq" . + "application/n-quads" . + . + "RMLFNMLTC0002-CSV" . + "false"^^ . + . + "mapping.ttl" . + . + . + "student.csv" . + "text/csv" . + . + "output.nq" . + "application/n-quads" . + . + "RMLFNMLTC0003-CSV" . + "false"^^ . + . + "mapping.ttl" . + . + . + "student.csv" . + "text/csv" . + . + "output.nq" . + "application/n-quads" . + . + "RMLFNMLTC0004-CSV" . + "false"^^ . + . + "mapping.ttl" . + . + . + "student.csv" . + "text/csv" . + . + "output.nq" . + "application/n-quads" . + . + "RMLFNMLTC0005-CSV" . + "false"^^ . + . + "mapping.ttl" . + . + . + "student.csv" . + "text/csv" . + . + "output.nq" . + "application/n-quads" . + . + "RMLFNMLTC0007-CSV" . + "false"^^ . + . + "mapping.ttl" . + . + . + "student.csv" . + "text/csv" . + . + "output.nq" . + "application/n-quads" . + . + "RMLFNMLTC0008-CSV" . + "false"^^ . + . + "mapping.ttl" . + . + . + "student.csv" . + "text/csv" . + . + "output.nq" . + "application/n-quads" . + . + "RMLFNMLTC0011-CSV" . + "false"^^ . + . + "mapping.ttl" . + . + . + "student.csv" . + "text/csv" . + . + "output.nq" . + "application/n-quads" . + . + "RMLFNMLTC0021-CSV" . + "false"^^ . + . + "mapping.ttl" . + . + . + "student.csv" . + "text/csv" . + . + "output.nq" . + "application/n-quads" . + . + "RMLFNMLTC0031-CSV" . + "false"^^ . + . + "mapping.ttl" . + . + . + "student.csv" . + "text/csv" . + . + "output.nq" . + "application/n-quads" . + . + "RMLFNMLTC0032-CSV" . + "false"^^ . + . + "mapping.ttl" . + . + . + "student.csv" . + "text/csv" . + . + "output.nq" . + "application/n-quads" . + . + "RMLFNMLTC0041-CSV" . + "false"^^ . + . + "mapping.ttl" . + . + . + "student.csv" . + "text/csv" . + . + "output.nq" . + "application/n-quads" . + . + "RMLFNMLTC0051-CSV" . + "false"^^ . + . + "mapping.ttl" . + . + . + "student.csv" . + "text/csv" . + . + "output.nq" . + "application/n-quads" . + . + "RMLFNMLTC0061-CSV" . + "false"^^ . + . + "mapping.ttl" . + . + . + "student.csv" . + "text/csv" . + . + "output.nq" . + "application/n-quads" . + . + "RMLFNMLTC0071-CSV" . + "false"^^ . + . + "mapping.ttl" . + . + . + "student.csv" . + "text/csv" . + . + "output.nq" . + "application/n-quads" . + . + "RMLFNMLTC0081-CSV" . + "false"^^ . + . + "mapping.ttl" . + . + . + "student.csv" . + "text/csv" . + . + "RMLFNMLTC0101-CSV" . + "true"^^ . + . + "mapping.ttl" . + . + "student.csv" . + "text/csv" . + . + "output.nq" . + "application/n-quads" . + . + "RMLFNMLTC0102-CSV" . + "false"^^ . + . + "mapping.ttl" . + . + . + "student.csv" . + "text/csv" . + . + "output.nq" . + "application/n-quads" . + . + "RMLFNMLTC0103-CSV" . + "false"^^ . + . + "mapping.ttl" . + . + . + "student.csv" . + "text/csv" . + . + "output.nq" . + "application/n-quads" . + . + "RMLFNMLTC0104-CSV" . + "false"^^ . + . + "mapping.ttl" . + . + . diff --git a/src/test/resources/rml-fnml/metadata.csv b/src/test/resources/rml-fnml/metadata.csv new file mode 100644 index 00000000..c26f1b85 --- /dev/null +++ b/src/test/resources/rml-fnml/metadata.csv @@ -0,0 +1,28 @@ +ID,title,description,specification,mapping,input_format1,input_format2,input_format3,output_format1,output_format2,output_format3,input1,input2,input3,output1,output2,output3,error +RMLFNMLTC0001-CSV,"Function on object, 0 parameters","Tests +(1) if a function without parameters can be used (FnO) +(2) if a function on an object map can be used (Term) +(3) if the output of the function is assigned the correct termType by default",http://w3id.org/rml/fnml/,mapping.ttl,text/csv,,,application/n-quads,,,student.csv,,,output.nq,,,false +RMLFNMLTC0002-CSV,"Function on object, 1 reference parameter","Tests: +(1) if a function with one parameter can be used, (FnO) +(2) a reference parameter can be used (Term)",http://w3id.org/rml/fnml/,mapping.ttl,text/csv,,,application/n-quads,,,student.csv,,,output.nq,,,false +RMLFNMLTC0003-CSV,"Function on object, 1 reference parameter, the output termType is IRI",Tests if the output of the function is assigned the correct termType,http://w3id.org/rml/fnml/,mapping.ttl,text/csv,,,application/n-quads,,,student.csv,,,output.nq,,,false +RMLFNMLTC0004-CSV,"Function on object, the output termType is Literal",Tests if the output of the function is assigned the correct termType,http://w3id.org/rml/fnml/,mapping.ttl,text/csv,,,application/n-quads,,,student.csv,,,output.nq,,,false +RMLFNMLTC0005-CSV,"Function on object, 1 template parameter",Tests if a function with a template parameter can be used,http://w3id.org/rml/fnml/,mapping.ttl,text/csv,,,application/n-quads,,,student.csv,,,output.nq,,,false +RMLFNMLTC0007-CSV,Function on object returns empty string,Tests that a triple is generated when the results is an empty string.,http://w3id.org/rml/fnml/,mapping.ttl,text/csv,,,application/n-quads,,,student.csv,,,output.nq,,,false +RMLFNMLTC0008-CSV,Function on object returns null,Tests that no triple should be generated when the result is null.,http://w3id.org/rml/fnml/,mapping.ttl,text/csv,,,application/n-quads,,,student.csv,,,output.nq,,,false +RMLFNMLTC0011-CSV,"Function on predicate, 1 parameter",Tests if a function can be used on a predicate,http://w3id.org/rml/fnml/,mapping.ttl,text/csv,,,application/n-quads,,,student.csv,,,output.nq,,,false +RMLFNMLTC0021-CSV,"Function on object, 1 reference parameter, 1 constant parameter",Tests if a function with multiple parameters can be used,http://w3id.org/rml/fnml/,mapping.ttl,text/csv,,,application/n-quads,,,student.csv,,,output.nq,,,false +RMLFNMLTC0031-CSV,"Function on subject, 1 parameter","Tests if +(1) a function can be used on a subject +(2) Tests if the default termType assigned to the output of the function to be correct",http://w3id.org/rml/fnml/,mapping.ttl,text/csv,,,application/n-quads,,,student.csv,,,output.nq,,,false +RMLFNMLTC0032-CSV,Condition on subject,Tests that a condition shortcut works,http://w3id.org/rml/fnml/,mapping.ttl,text/csv,,,application/n-quads,,,student.csv,,,output.nq,,,false +RMLFNMLTC0041-CSV,Function using non-constant shortcut property return,Tests that a non-constant FNML Return map also works,http://w3id.org/rml/fnml/,mapping.ttl,text/csv,,,application/n-quads,,,student.csv,,,output.nq,,,false +RMLFNMLTC0051-CSV,Nested function - Test A,"Tests if a composite function of form f(g(x1),x2) works (i.e., the inner function is only one argument of the outer function)",http://w3id.org/rml/fnml/,mapping.ttl,text/csv,,,application/n-quads,,,student.csv,,,output.nq,,,false +RMLFNMLTC0061-CSV,"Function on graph, 1 parameter",Tests if a function can be used on a graph,http://w3id.org/rml/fnml/,mapping.ttl,text/csv,,,application/n-quads,,,student.csv,,,output.nq,,,false +RMLFNMLTC0071-CSV,"Function on datatypeMap, 1 parameter",Tests that function on DatatypeMap is handled,http://w3id.org/rml/fnml/,mapping.ttl,text/csv,,,application/n-quads,,,student.csv,,,output.nq,,,false +RMLFNMLTC0081-CSV,"Function on languageMap, 1 parameter",Tests that function on LanguageMap is handled,http://w3id.org/rml/fnml/,mapping.ttl,text/csv,,,application/n-quads,,,student.csv,,,output.nq,,,false +RMLFNMLTC0101-CSV,"Function on object, 1 false reference parameter",Tests if a false reference parameters is caught,http://w3id.org/rml/fnml/,mapping.ttl,text/csv,,,,,,student.csv,,,,,,true +RMLFNMLTC0102-CSV,"Function on object, wrong function URI",Tests that nothing is generated if a function is used where no implementation is made available to the mapping engine,http://w3id.org/rml/fnml/,mapping.ttl,text/csv,,,application/n-quads,,,student.csv,,,output.nq,,,false +RMLFNMLTC0103-CSV,"Function on object, wrong parameter",Tests that nothing is generated if a function is defined using a parameter not defined in the FnO description,http://w3id.org/rml/fnml/,mapping.ttl,text/csv,,,application/n-quads,,,student.csv,,,output.nq,,,false +RMLFNMLTC0104-CSV,"Function on object, wrong return parameter",Tests that nothing is generated if a function is defined using a return not defined in the FnO description,http://w3id.org/rml/fnml/,mapping.ttl,text/csv,,,application/n-quads,,,student.csv,,,output.nq,,,false diff --git a/src/test/resources/rml-fnml/section/abstract.md b/src/test/resources/rml-fnml/section/abstract.md new file mode 100644 index 00000000..3ef03d68 --- /dev/null +++ b/src/test/resources/rml-fnml/section/abstract.md @@ -0,0 +1 @@ +This document defines the RML-FNML test cases to the determine the RML-FNML specification conformance of tools. diff --git a/src/test/resources/rml-fnml/section/data-model.md b/src/test/resources/rml-fnml/section/data-model.md new file mode 100644 index 00000000..f4c3ad6a --- /dev/null +++ b/src/test/resources/rml-fnml/section/data-model.md @@ -0,0 +1,12 @@ +# Data model + +The test cases are semantically described for re-usability and shareability following the [W3C Test case description](https://www.w3.org/2006/03/test-description). +Each `test:Testcase` as the following properties: + +- `dcterms:identifier`: unique ID of the test case. +- `rmltest:hasError`: if an error of the RML Processor is expected or not. +- `rmltest:input`: One or more input data of the test case. +- `rmltest:output`: One or more output data of the test case. +- `rmltest:inputFormat`: the input data format. +- `rmltest:outputFormat`: the output data format. +- `rmltest:mappingDocument`: the RML mapping rules in Turtle. diff --git a/src/test/resources/rml-fnml/section/introduction.md b/src/test/resources/rml-fnml/section/introduction.md new file mode 100644 index 00000000..e43b97ed --- /dev/null +++ b/src/test/resources/rml-fnml/section/introduction.md @@ -0,0 +1,4 @@ +# Introduction + +This document defines the RML-FNML test cases, consisting of a collection of test case documents (input and expected output). +The purpose of the test cases is to determine the conformance of tools that execute RML rules to the RML-FNML specification. diff --git a/src/test/resources/rml-fnml/section/test-cases.md b/src/test/resources/rml-fnml/section/test-cases.md new file mode 100644 index 00000000..5ba69b6d --- /dev/null +++ b/src/test/resources/rml-fnml/section/test-cases.md @@ -0,0 +1,10 @@ +# Test cases + +This section describes the RML-FNML test cases. These descriptions are also available as RDF. +The files are available on [GitHub](https://github.com/kg-construct/rml-fnml/tree/main/test-cases) in the folder `test-cases`. +Each test case is contained in a single folder, containing three types of files: + + - Zero or more files containing the data sources, in the case of JSON, XML, CSV, or containing the SQL statements to create the necessary tables, in the case of MySQL, PostgreSQL, and SQL Server. + - One file with the RML rules, called `mapping.ttl`, in the Turtle format. + - Zero or more files with the expected RDF. No file is provided if an error is expected that must halt the generation of the RDF because of an error. + diff --git a/src/test/resources/rml-io/NETCONF/README.md b/src/test/resources/rml-io/NETCONF/README.md deleted file mode 100644 index 13ebd128..00000000 --- a/src/test/resources/rml-io/NETCONF/README.md +++ /dev/null @@ -1,14 +0,0 @@ -# NETCONF Server Instructions - -First, deploy the NETCONF server using a containerized version of netooper2: - -```bash -docker run -it -d -p 830:830 --name netopeer2-server sysrepo/sysrepo-netopeer2:latest -``` - -The NETCONF server listens locally on port 830 and runs a default configuration with username `netconf` and password `netconf`. - -After this, the possible RML mappings to transform the YANG Library 1.0 into RDF can be tested against the server: - -- [Subtree filter query](./subtree/mapping.ttl) -- [XPath filter query](./xpath/mapping.ttl) diff --git a/src/test/resources/rml-io/NETCONF/subtree/default.nq b/src/test/resources/rml-io/NETCONF/subtree/default.nq deleted file mode 100644 index 443e4ea9..00000000 --- a/src/test/resources/rml-io/NETCONF/subtree/default.nq +++ /dev/null @@ -1,160 +0,0 @@ - "ietf-netconf-acm"^^ . - "2018-02-14"^^ . - "urn:ietf:params:xml:ns:yang:ietf-netconf-acm"^^ . - . - "ietf-subscribed-notifications"^^ . - "2019-09-09"^^ . - "urn:ietf:params:xml:ns:yang:ietf-subscribed-notifications"^^ . - . - "ietf-yang-types"^^ . - "2013-07-15"^^ . - "urn:ietf:params:xml:ns:yang:ietf-yang-types"^^ . - . - "ietf-tls-server"^^ . - "2019-07-02"^^ . - "urn:ietf:params:xml:ns:yang:ietf-tls-server"^^ . - . - "ietf-tls-common"^^ . - "2019-07-02"^^ . - "urn:ietf:params:xml:ns:yang:ietf-tls-common"^^ . - . - "ietf-tcp-client"^^ . - "2019-07-02"^^ . - "urn:ietf:params:xml:ns:yang:ietf-tcp-client"^^ . - . - "ietf-network-instance"^^ . - "2019-01-21"^^ . - "urn:ietf:params:xml:ns:yang:ietf-network-instance"^^ . - . - "ietf-netconf"^^ . - "2013-09-29"^^ . - "urn:ietf:params:xml:ns:netconf:base:1.0"^^ . - . - "ietf-netconf-monitoring"^^ . - "2010-10-04"^^ . - "urn:ietf:params:xml:ns:yang:ietf-netconf-monitoring"^^ . - . - "ietf-interfaces"^^ . - "2018-02-20"^^ . - "urn:ietf:params:xml:ns:yang:ietf-interfaces"^^ . - . - "ietf-yang-schema-mount"^^ . - "2019-01-14"^^ . - "urn:ietf:params:xml:ns:yang:ietf-yang-schema-mount"^^ . - . - "ietf-netconf-notifications"^^ . - "2012-02-06"^^ . - "urn:ietf:params:xml:ns:yang:ietf-netconf-notifications"^^ . - . - "ietf-datastores"^^ . - "2018-02-14"^^ . - "urn:ietf:params:xml:ns:yang:ietf-datastores"^^ . - . - "ietf-restconf"^^ . - "2017-01-26"^^ . - "urn:ietf:params:xml:ns:yang:ietf-restconf"^^ . - . - "sysrepo-monitoring"^^ . - "2022-08-19"^^ . - "http://www.sysrepo.org/yang/sysrepo-monitoring"^^ . - . - "ietf-yang-push"^^ . - "2019-09-09"^^ . - "urn:ietf:params:xml:ns:yang:ietf-yang-push"^^ . - . - "ietf-yang-structure-ext"^^ . - "2020-06-17"^^ . - "urn:ietf:params:xml:ns:yang:ietf-yang-structure-ext"^^ . - . - "notifications"^^ . - "2008-07-14"^^ . - "urn:ietf:params:xml:ns:netconf:notification:1.0"^^ . - . - "ietf-x509-cert-to-name"^^ . - "2014-12-10"^^ . - "urn:ietf:params:xml:ns:yang:ietf-x509-cert-to-name"^^ . - . - "ietf-truststore"^^ . - "2019-07-02"^^ . - "urn:ietf:params:xml:ns:yang:ietf-truststore"^^ . - . - "ietf-yang-library"^^ . - "2019-01-04"^^ . - "urn:ietf:params:xml:ns:yang:ietf-yang-library"^^ . - . - "ietf-tcp-server"^^ . - "2019-07-02"^^ . - "urn:ietf:params:xml:ns:yang:ietf-tcp-server"^^ . - . - "ietf-origin"^^ . - "2018-02-14"^^ . - "urn:ietf:params:xml:ns:yang:ietf-origin"^^ . - . - "ietf-netconf-nmda"^^ . - "2019-01-07"^^ . - "urn:ietf:params:xml:ns:yang:ietf-netconf-nmda"^^ . - . - "iana-crypt-hash"^^ . - "2014-08-06"^^ . - "urn:ietf:params:xml:ns:yang:iana-crypt-hash"^^ . - . - "ietf-tcp-common"^^ . - "2019-07-02"^^ . - "urn:ietf:params:xml:ns:yang:ietf-tcp-common"^^ . - . - "sysrepo-plugind"^^ . - "2022-08-26"^^ . - "urn:sysrepo:plugind"^^ . - . - "ietf-keystore"^^ . - "2019-07-02"^^ . - "urn:ietf:params:xml:ns:yang:ietf-keystore"^^ . - . - "sysrepo"^^ . - "2021-10-08"^^ . - "http://www.sysrepo.org/yang/sysrepo"^^ . - . - "ietf-crypto-types"^^ . - "2019-07-02"^^ . - "urn:ietf:params:xml:ns:yang:ietf-crypto-types"^^ . - . - "yang"^^ . - "2022-06-16"^^ . - "urn:ietf:params:xml:ns:yang:1"^^ . - . - "ietf-yang-metadata"^^ . - "2016-08-05"^^ . - "urn:ietf:params:xml:ns:yang:ietf-yang-metadata"^^ . - . - "nc-notifications"^^ . - "2008-07-14"^^ . - "urn:ietf:params:xml:ns:netmod:notification"^^ . - . - "ietf-netconf-with-defaults"^^ . - "2011-06-01"^^ . - "urn:ietf:params:xml:ns:yang:ietf-netconf-with-defaults"^^ . - . - "ietf-inet-types"^^ . - "2013-07-15"^^ . - "urn:ietf:params:xml:ns:yang:ietf-inet-types"^^ . - . - "ietf-ssh-server"^^ . - "2019-07-02"^^ . - "urn:ietf:params:xml:ns:yang:ietf-ssh-server"^^ . - . - "ietf-ssh-common"^^ . - "2019-07-02"^^ . - "urn:ietf:params:xml:ns:yang:ietf-ssh-common"^^ . - . - "ietf-ip"^^ . - "2018-02-22"^^ . - "urn:ietf:params:xml:ns:yang:ietf-ip"^^ . - . - "ietf-netconf-server"^^ . - "2019-07-02"^^ . - "urn:ietf:params:xml:ns:yang:ietf-netconf-server"^^ . - . - "ietf-yang-patch"^^ . - "2017-02-22"^^ . - "urn:ietf:params:xml:ns:yang:ietf-yang-patch"^^ . - . diff --git a/src/test/resources/rml-io/NETCONF/subtree/mapping.ttl b/src/test/resources/rml-io/NETCONF/subtree/mapping.ttl deleted file mode 100644 index acb8d270..00000000 --- a/src/test/resources/rml-io/NETCONF/subtree/mapping.ttl +++ /dev/null @@ -1,94 +0,0 @@ -@prefix yl: . -@prefix ys: . -@prefix rml: . -@prefix xsd: . -@prefix core: . -@prefix dcterms: . -@prefix observable: . -@base . - -# Connection details to NETCONF server - a ys:NetconfServer ; - ys:socketAddress ; - ys:serverAccount ; - ys:hostKeyVerification "false" -. - -# In this example the NETCONF server is non-NMDA compatible. -# Thus, only operational and running datastores are available. - a ys:OperationalDatastore ; - ys:server -. - a ys:RunningDatastore ; - ys:server -. - - a observable:SocketAddress ; - observable:addressValue "localhost:830" -. - - a ys:ServerAccount ; - ys:username "netconf" ; - core:hasFacet -. - - a observable:AccountAuthenticationFacet ; - observable:password "netconf" ; - observable:passwordType "plain-text" -. - - a ys:SubtreeFilter ; - ys:subtreeValue ''' - - - - - '''; -. - -<#TriplesMap> a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource ; - rml:source [ a ys:Query, rml:Source ; - ys:sourceDatastore ; - ys:filter - ]; - rml:referenceFormulation [ a ys:NetconfQuerySource ; - rml:namespace [ a rml:Namespace ; - rml:namespacePrefix "yanglib" ; - rml:namespaceURL "urn:ietf:params:xml:ns:yang:ietf-yang-library" ; - ]; - ]; - rml:iterator "/yanglib:modules-state/yanglib:module"; - ]; - rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/module/{yanglib:name/text()}:{yanglib:revision/text()}"; - rml:class yl:Module; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant yl:name; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "yanglib:name/text()"; - rml:datatype xsd:string; - ]; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant yl:revisionDate; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "yanglib:revision/text()"; - rml:datatype xsd:date; - ]; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant yl:namespace; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "yanglib:namespace/text()"; - rml:datatype xsd:anyURI; - ]; - ]; -. diff --git a/src/test/resources/rml-io/NETCONF/subtree/yanglibrary.xml b/src/test/resources/rml-io/NETCONF/subtree/yanglibrary.xml deleted file mode 100644 index a8ab1081..00000000 --- a/src/test/resources/rml-io/NETCONF/subtree/yanglibrary.xml +++ /dev/null @@ -1,301 +0,0 @@ - - 1 - - ietf-yang-metadata - 2016-08-05 - urn:ietf:params:xml:ns:yang:ietf-yang-metadata - import - - - yang - 2022-06-16 - urn:ietf:params:xml:ns:yang:1 - implement - - - ietf-inet-types - 2013-07-15 - urn:ietf:params:xml:ns:yang:ietf-inet-types - import - - - ietf-yang-types - 2013-07-15 - urn:ietf:params:xml:ns:yang:ietf-yang-types - import - - - ietf-yang-schema-mount - 2019-01-14 - urn:ietf:params:xml:ns:yang:ietf-yang-schema-mount - implement - - - ietf-yang-structure-ext - 2020-06-17 - urn:ietf:params:xml:ns:yang:ietf-yang-structure-ext - import - - - sysrepo - 2021-10-08 - http://www.sysrepo.org/yang/sysrepo - implement - - - ietf-datastores - 2018-02-14 - file:///etc/sysrepo/yang/ietf-datastores@2018-02-14.yang - urn:ietf:params:xml:ns:yang:ietf-datastores - implement - - - ietf-yang-library - 2019-01-04 - file:///etc/sysrepo/yang/ietf-yang-library@2019-01-04.yang - urn:ietf:params:xml:ns:yang:ietf-yang-library - implement - - - ietf-netconf-acm - 2018-02-14 - file:///etc/sysrepo/yang/ietf-netconf-acm@2018-02-14.yang - urn:ietf:params:xml:ns:yang:ietf-netconf-acm - implement - - - sysrepo-monitoring - 2022-08-19 - file:///etc/sysrepo/yang/sysrepo-monitoring@2022-08-19.yang - http://www.sysrepo.org/yang/sysrepo-monitoring - implement - - - sysrepo-plugind - 2022-08-26 - file:///etc/sysrepo/yang/sysrepo-plugind@2022-08-26.yang - urn:sysrepo:plugind - implement - - - ietf-netconf - 2013-09-29 - file:///etc/sysrepo/yang/ietf-netconf@2013-09-29.yang - urn:ietf:params:xml:ns:netconf:base:1.0 - writable-running - candidate - confirmed-commit - rollback-on-error - validate - startup - url - xpath - implement - - - ietf-netconf-with-defaults - 2011-06-01 - file:///etc/sysrepo/yang/ietf-netconf-with-defaults@2011-06-01.yang - urn:ietf:params:xml:ns:yang:ietf-netconf-with-defaults - implement - - - ietf-netconf-notifications - 2012-02-06 - file:///etc/sysrepo/yang/ietf-netconf-notifications@2012-02-06.yang - urn:ietf:params:xml:ns:yang:ietf-netconf-notifications - implement - - - ietf-origin - 2018-02-14 - file:///etc/sysrepo/yang/ietf-origin@2018-02-14.yang - urn:ietf:params:xml:ns:yang:ietf-origin - implement - - - ietf-netconf-monitoring - 2010-10-04 - file:///etc/sysrepo/yang/ietf-netconf-monitoring@2010-10-04.yang - urn:ietf:params:xml:ns:yang:ietf-netconf-monitoring - implement - - - ietf-netconf-nmda - 2019-01-07 - file:///etc/sysrepo/yang/ietf-netconf-nmda@2019-01-07.yang - urn:ietf:params:xml:ns:yang:ietf-netconf-nmda - origin - with-defaults - implement - - - nc-notifications - 2008-07-14 - file:///etc/sysrepo/yang/nc-notifications@2008-07-14.yang - urn:ietf:params:xml:ns:netmod:notification - implement - - - notifications - 2008-07-14 - file:///etc/sysrepo/yang/notifications@2008-07-14.yang - urn:ietf:params:xml:ns:netconf:notification:1.0 - implement - - - ietf-x509-cert-to-name - 2014-12-10 - file:///etc/sysrepo/yang/ietf-x509-cert-to-name@2014-12-10.yang - urn:ietf:params:xml:ns:yang:ietf-x509-cert-to-name - implement - - - ietf-keystore - 2019-07-02 - file:///etc/sysrepo/yang/ietf-keystore@2019-07-02.yang - urn:ietf:params:xml:ns:yang:ietf-keystore - keystore-supported - implement - - - ietf-crypto-types - 2019-07-02 - file:///etc/sysrepo/yang/ietf-crypto-types@2019-07-02.yang - urn:ietf:params:xml:ns:yang:ietf-crypto-types - import - - - ietf-truststore - 2019-07-02 - file:///etc/sysrepo/yang/ietf-truststore@2019-07-02.yang - urn:ietf:params:xml:ns:yang:ietf-truststore - truststore-supported - x509-certificates - implement - - - ietf-tcp-common - 2019-07-02 - file:///etc/sysrepo/yang/ietf-tcp-common@2019-07-02.yang - urn:ietf:params:xml:ns:yang:ietf-tcp-common - keepalives-supported - implement - - - ietf-ssh-server - 2019-07-02 - file:///etc/sysrepo/yang/ietf-ssh-server@2019-07-02.yang - urn:ietf:params:xml:ns:yang:ietf-ssh-server - local-client-auth-supported - implement - - - ietf-ssh-common - 2019-07-02 - file:///etc/sysrepo/yang/ietf-ssh-common@2019-07-02.yang - urn:ietf:params:xml:ns:yang:ietf-ssh-common - import - - - iana-crypt-hash - 2014-08-06 - file:///etc/sysrepo/yang/iana-crypt-hash@2014-08-06.yang - urn:ietf:params:xml:ns:yang:iana-crypt-hash - import - - - ietf-tls-server - 2019-07-02 - file:///etc/sysrepo/yang/ietf-tls-server@2019-07-02.yang - urn:ietf:params:xml:ns:yang:ietf-tls-server - local-client-auth-supported - implement - - - ietf-tls-common - 2019-07-02 - file:///etc/sysrepo/yang/ietf-tls-common@2019-07-02.yang - urn:ietf:params:xml:ns:yang:ietf-tls-common - import - - - ietf-netconf-server - 2019-07-02 - file:///etc/sysrepo/yang/ietf-netconf-server@2019-07-02.yang - urn:ietf:params:xml:ns:yang:ietf-netconf-server - ssh-listen - tls-listen - ssh-call-home - tls-call-home - implement - - - ietf-tcp-client - 2019-07-02 - file:///etc/sysrepo/yang/ietf-tcp-client@2019-07-02.yang - urn:ietf:params:xml:ns:yang:ietf-tcp-client - import - - - ietf-tcp-server - 2019-07-02 - file:///etc/sysrepo/yang/ietf-tcp-server@2019-07-02.yang - urn:ietf:params:xml:ns:yang:ietf-tcp-server - import - - - ietf-interfaces - 2018-02-20 - file:///etc/sysrepo/yang/ietf-interfaces@2018-02-20.yang - urn:ietf:params:xml:ns:yang:ietf-interfaces - implement - - - ietf-ip - 2018-02-22 - file:///etc/sysrepo/yang/ietf-ip@2018-02-22.yang - urn:ietf:params:xml:ns:yang:ietf-ip - implement - - - ietf-network-instance - 2019-01-21 - file:///etc/sysrepo/yang/ietf-network-instance@2019-01-21.yang - urn:ietf:params:xml:ns:yang:ietf-network-instance - implement - - - ietf-subscribed-notifications - 2019-09-09 - file:///etc/sysrepo/yang/ietf-subscribed-notifications@2019-09-09.yang - urn:ietf:params:xml:ns:yang:ietf-subscribed-notifications - encode-xml - replay - subtree - xpath - implement - - - ietf-restconf - 2017-01-26 - file:///etc/sysrepo/yang/ietf-restconf@2017-01-26.yang - urn:ietf:params:xml:ns:yang:ietf-restconf - import - - - ietf-yang-push - 2019-09-09 - file:///etc/sysrepo/yang/ietf-yang-push@2019-09-09.yang - urn:ietf:params:xml:ns:yang:ietf-yang-push - on-change - implement - - - ietf-yang-patch - 2017-02-22 - file:///etc/sysrepo/yang/ietf-yang-patch@2017-02-22.yang - urn:ietf:params:xml:ns:yang:ietf-yang-patch - import - - diff --git a/src/test/resources/rml-io/NETCONF/xpath/default.nq b/src/test/resources/rml-io/NETCONF/xpath/default.nq deleted file mode 100644 index 73b70967..00000000 --- a/src/test/resources/rml-io/NETCONF/xpath/default.nq +++ /dev/null @@ -1,160 +0,0 @@ - "ietf-netconf-acm"^^ . - "2018-02-14"^^ . - "urn:ietf:params:xml:ns:yang:ietf-netconf-acm"^^ . - . - "ietf-subscribed-notifications"^^ . - "2019-09-09"^^ . - "urn:ietf:params:xml:ns:yang:ietf-subscribed-notifications"^^ . - . - "ietf-yang-types"^^ . - "2013-07-15"^^ . - "urn:ietf:params:xml:ns:yang:ietf-yang-types"^^ . - . - "ietf-tls-server"^^ . - "2019-07-02"^^ . - "urn:ietf:params:xml:ns:yang:ietf-tls-server"^^ . - . - "ietf-tls-common"^^ . - "2019-07-02"^^ . - "urn:ietf:params:xml:ns:yang:ietf-tls-common"^^ . - . - "ietf-tcp-client"^^ . - "2019-07-02"^^ . - "urn:ietf:params:xml:ns:yang:ietf-tcp-client"^^ . - . - "ietf-network-instance"^^ . - "2019-01-21"^^ . - "urn:ietf:params:xml:ns:yang:ietf-network-instance"^^ . - . - "ietf-netconf"^^ . - "2013-09-29"^^ . - "urn:ietf:params:xml:ns:netconf:base:1.0"^^ . - . - "ietf-netconf-monitoring"^^ . - "2010-10-04"^^ . - "urn:ietf:params:xml:ns:yang:ietf-netconf-monitoring"^^ . - . - "ietf-interfaces"^^ . - "2018-02-20"^^ . - "urn:ietf:params:xml:ns:yang:ietf-interfaces"^^ . - . - "ietf-yang-schema-mount"^^ . - "2019-01-14"^^ . - "urn:ietf:params:xml:ns:yang:ietf-yang-schema-mount"^^ . - . - "ietf-netconf-notifications"^^ . - "2012-02-06"^^ . - "urn:ietf:params:xml:ns:yang:ietf-netconf-notifications"^^ . - . - "ietf-datastores"^^ . - "2018-02-14"^^ . - "urn:ietf:params:xml:ns:yang:ietf-datastores"^^ . - . - "ietf-restconf"^^ . - "2017-01-26"^^ . - "urn:ietf:params:xml:ns:yang:ietf-restconf"^^ . - . - "sysrepo-monitoring"^^ . - "2022-08-19"^^ . - "http://www.sysrepo.org/yang/sysrepo-monitoring"^^ . - . - "ietf-yang-push"^^ . - "2019-09-09"^^ . - "urn:ietf:params:xml:ns:yang:ietf-yang-push"^^ . - . - "ietf-yang-structure-ext"^^ . - "2020-06-17"^^ . - "urn:ietf:params:xml:ns:yang:ietf-yang-structure-ext"^^ . - . - "notifications"^^ . - "2008-07-14"^^ . - "urn:ietf:params:xml:ns:netconf:notification:1.0"^^ . - . - "ietf-x509-cert-to-name"^^ . - "2014-12-10"^^ . - "urn:ietf:params:xml:ns:yang:ietf-x509-cert-to-name"^^ . - . - "ietf-truststore"^^ . - "2019-07-02"^^ . - "urn:ietf:params:xml:ns:yang:ietf-truststore"^^ . - . - "ietf-yang-library"^^ . - "2019-01-04"^^ . - "urn:ietf:params:xml:ns:yang:ietf-yang-library"^^ . - . - "ietf-tcp-server"^^ . - "2019-07-02"^^ . - "urn:ietf:params:xml:ns:yang:ietf-tcp-server"^^ . - . - "ietf-origin"^^ . - "2018-02-14"^^ . - "urn:ietf:params:xml:ns:yang:ietf-origin"^^ . - . - "ietf-netconf-nmda"^^ . - "2019-01-07"^^ . - "urn:ietf:params:xml:ns:yang:ietf-netconf-nmda"^^ . - . - "iana-crypt-hash"^^ . - "2014-08-06"^^ . - "urn:ietf:params:xml:ns:yang:iana-crypt-hash"^^ . - . - "ietf-tcp-common"^^ . - "2019-07-02"^^ . - "urn:ietf:params:xml:ns:yang:ietf-tcp-common"^^ . - . - "sysrepo-plugind"^^ . - "2022-08-26"^^ . - "urn:sysrepo:plugind"^^ . - . - "ietf-keystore"^^ . - "2019-07-02"^^ . - "urn:ietf:params:xml:ns:yang:ietf-keystore"^^ . - . - "sysrepo"^^ . - "2021-10-08"^^ . - "http://www.sysrepo.org/yang/sysrepo"^^ . - . - "ietf-crypto-types"^^ . - "2019-07-02"^^ . - "urn:ietf:params:xml:ns:yang:ietf-crypto-types"^^ . - . - "yang"^^ . - "2022-06-16"^^ . - "urn:ietf:params:xml:ns:yang:1"^^ . - . - "ietf-yang-metadata"^^ . - "2016-08-05"^^ . - "urn:ietf:params:xml:ns:yang:ietf-yang-metadata"^^ . - . - "nc-notifications"^^ . - "2008-07-14"^^ . - "urn:ietf:params:xml:ns:netmod:notification"^^ . - . - "ietf-netconf-with-defaults"^^ . - "2011-06-01"^^ . - "urn:ietf:params:xml:ns:yang:ietf-netconf-with-defaults"^^ . - . - "ietf-inet-types"^^ . - "2013-07-15"^^ . - "urn:ietf:params:xml:ns:yang:ietf-inet-types"^^ . - . - "ietf-ssh-server"^^ . - "2019-07-02"^^ . - "urn:ietf:params:xml:ns:yang:ietf-ssh-server"^^ . - . - "ietf-ssh-common"^^ . - "2019-07-02"^^ . - "urn:ietf:params:xml:ns:yang:ietf-ssh-common"^^ . - . - "ietf-ip"^^ . - "2018-02-22"^^ . - "urn:ietf:params:xml:ns:yang:ietf-ip"^^ . - . - "ietf-netconf-server"^^ . - "2019-07-02"^^ . - "urn:ietf:params:xml:ns:yang:ietf-netconf-server"^^ . - . - "ietf-yang-patch"^^ . - "2017-02-22"^^ . - "urn:ietf:params:xml:ns:yang:ietf-yang-patch"^^ . - . diff --git a/src/test/resources/rml-io/NETCONF/xpath/mapping.ttl b/src/test/resources/rml-io/NETCONF/xpath/mapping.ttl deleted file mode 100644 index da0f86ea..00000000 --- a/src/test/resources/rml-io/NETCONF/xpath/mapping.ttl +++ /dev/null @@ -1,95 +0,0 @@ -@prefix yl: . -@prefix ys: . -@prefix rml: . -@prefix xsd: . -@prefix core: . -@prefix dcterms: . -@prefix observable: . -@base . - -# Connection details to NETCONF server - a ys:NetconfServer ; - ys:socketAddress ; - ys:serverAccount ; - ys:hostKeyVerification "false" ; - ys:capability ys:XpathCapability , - ys:YangLibrary1.0 -. - - a ys:OperationalDatastore ; - ys:server -. - a ys:RunningDatastore ; - ys:server -. - - a observable:SocketAddress ; - observable:addressValue "localhost:830" -. - - a ys:ServerAccount ; - ys:username "netconf" ; - core:hasFacet -. - - a observable:AccountAuthenticationFacet ; - observable:password "netconf" ; - observable:passwordType "plain-text" -. - - a ys:XPathFilter ; - ys:xpathValue "/yanglib:modules-state"; - ys:namespace [ a ys:Namespace ; - ys:namespacePrefix "yanglib" ; - ys:namespaceURL "urn:ietf:params:xml:ns:yang:ietf-yang-library" ; - ]; -. - -# Note that ys:Query is processed as part of the RML mapping -# rml:iterator replaces the ys:Filter in the YANG query -<#TriplesMap> a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:source [ a ys:Query, rml:Source ; - ys:sourceDatastore ; - ys:filter - ]; - rml:referenceFormulation [ a ys:NetconfQuerySource ; - rml:namespace [ a rml:Namespace ; - rml:namespacePrefix "yanglib" ; - rml:namespaceURL "urn:ietf:params:xml:ns:yang:ietf-yang-library" ; - ]; - ]; - rml:iterator "/yanglib:modules-state/yanglib:module"; - ]; - rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/module/{yanglib:name/text()}:{yanglib:revision/text()}"; - rml:class yl:Module; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant yl:moduleName; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "yanglib:name/text()"; - rml:datatype xsd:string; - ]; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant yl:revisionDate; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "yanglib:revision/text()"; - rml:datatype xsd:date; - ]; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant yl:namespace; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "yanglib:namespace/text()"; - rml:datatype xsd:anyURI; - ]; - ]; -. diff --git a/src/test/resources/rml-io/NETCONF/xpath/yanglibrary.xml b/src/test/resources/rml-io/NETCONF/xpath/yanglibrary.xml deleted file mode 100644 index a8ab1081..00000000 --- a/src/test/resources/rml-io/NETCONF/xpath/yanglibrary.xml +++ /dev/null @@ -1,301 +0,0 @@ - - 1 - - ietf-yang-metadata - 2016-08-05 - urn:ietf:params:xml:ns:yang:ietf-yang-metadata - import - - - yang - 2022-06-16 - urn:ietf:params:xml:ns:yang:1 - implement - - - ietf-inet-types - 2013-07-15 - urn:ietf:params:xml:ns:yang:ietf-inet-types - import - - - ietf-yang-types - 2013-07-15 - urn:ietf:params:xml:ns:yang:ietf-yang-types - import - - - ietf-yang-schema-mount - 2019-01-14 - urn:ietf:params:xml:ns:yang:ietf-yang-schema-mount - implement - - - ietf-yang-structure-ext - 2020-06-17 - urn:ietf:params:xml:ns:yang:ietf-yang-structure-ext - import - - - sysrepo - 2021-10-08 - http://www.sysrepo.org/yang/sysrepo - implement - - - ietf-datastores - 2018-02-14 - file:///etc/sysrepo/yang/ietf-datastores@2018-02-14.yang - urn:ietf:params:xml:ns:yang:ietf-datastores - implement - - - ietf-yang-library - 2019-01-04 - file:///etc/sysrepo/yang/ietf-yang-library@2019-01-04.yang - urn:ietf:params:xml:ns:yang:ietf-yang-library - implement - - - ietf-netconf-acm - 2018-02-14 - file:///etc/sysrepo/yang/ietf-netconf-acm@2018-02-14.yang - urn:ietf:params:xml:ns:yang:ietf-netconf-acm - implement - - - sysrepo-monitoring - 2022-08-19 - file:///etc/sysrepo/yang/sysrepo-monitoring@2022-08-19.yang - http://www.sysrepo.org/yang/sysrepo-monitoring - implement - - - sysrepo-plugind - 2022-08-26 - file:///etc/sysrepo/yang/sysrepo-plugind@2022-08-26.yang - urn:sysrepo:plugind - implement - - - ietf-netconf - 2013-09-29 - file:///etc/sysrepo/yang/ietf-netconf@2013-09-29.yang - urn:ietf:params:xml:ns:netconf:base:1.0 - writable-running - candidate - confirmed-commit - rollback-on-error - validate - startup - url - xpath - implement - - - ietf-netconf-with-defaults - 2011-06-01 - file:///etc/sysrepo/yang/ietf-netconf-with-defaults@2011-06-01.yang - urn:ietf:params:xml:ns:yang:ietf-netconf-with-defaults - implement - - - ietf-netconf-notifications - 2012-02-06 - file:///etc/sysrepo/yang/ietf-netconf-notifications@2012-02-06.yang - urn:ietf:params:xml:ns:yang:ietf-netconf-notifications - implement - - - ietf-origin - 2018-02-14 - file:///etc/sysrepo/yang/ietf-origin@2018-02-14.yang - urn:ietf:params:xml:ns:yang:ietf-origin - implement - - - ietf-netconf-monitoring - 2010-10-04 - file:///etc/sysrepo/yang/ietf-netconf-monitoring@2010-10-04.yang - urn:ietf:params:xml:ns:yang:ietf-netconf-monitoring - implement - - - ietf-netconf-nmda - 2019-01-07 - file:///etc/sysrepo/yang/ietf-netconf-nmda@2019-01-07.yang - urn:ietf:params:xml:ns:yang:ietf-netconf-nmda - origin - with-defaults - implement - - - nc-notifications - 2008-07-14 - file:///etc/sysrepo/yang/nc-notifications@2008-07-14.yang - urn:ietf:params:xml:ns:netmod:notification - implement - - - notifications - 2008-07-14 - file:///etc/sysrepo/yang/notifications@2008-07-14.yang - urn:ietf:params:xml:ns:netconf:notification:1.0 - implement - - - ietf-x509-cert-to-name - 2014-12-10 - file:///etc/sysrepo/yang/ietf-x509-cert-to-name@2014-12-10.yang - urn:ietf:params:xml:ns:yang:ietf-x509-cert-to-name - implement - - - ietf-keystore - 2019-07-02 - file:///etc/sysrepo/yang/ietf-keystore@2019-07-02.yang - urn:ietf:params:xml:ns:yang:ietf-keystore - keystore-supported - implement - - - ietf-crypto-types - 2019-07-02 - file:///etc/sysrepo/yang/ietf-crypto-types@2019-07-02.yang - urn:ietf:params:xml:ns:yang:ietf-crypto-types - import - - - ietf-truststore - 2019-07-02 - file:///etc/sysrepo/yang/ietf-truststore@2019-07-02.yang - urn:ietf:params:xml:ns:yang:ietf-truststore - truststore-supported - x509-certificates - implement - - - ietf-tcp-common - 2019-07-02 - file:///etc/sysrepo/yang/ietf-tcp-common@2019-07-02.yang - urn:ietf:params:xml:ns:yang:ietf-tcp-common - keepalives-supported - implement - - - ietf-ssh-server - 2019-07-02 - file:///etc/sysrepo/yang/ietf-ssh-server@2019-07-02.yang - urn:ietf:params:xml:ns:yang:ietf-ssh-server - local-client-auth-supported - implement - - - ietf-ssh-common - 2019-07-02 - file:///etc/sysrepo/yang/ietf-ssh-common@2019-07-02.yang - urn:ietf:params:xml:ns:yang:ietf-ssh-common - import - - - iana-crypt-hash - 2014-08-06 - file:///etc/sysrepo/yang/iana-crypt-hash@2014-08-06.yang - urn:ietf:params:xml:ns:yang:iana-crypt-hash - import - - - ietf-tls-server - 2019-07-02 - file:///etc/sysrepo/yang/ietf-tls-server@2019-07-02.yang - urn:ietf:params:xml:ns:yang:ietf-tls-server - local-client-auth-supported - implement - - - ietf-tls-common - 2019-07-02 - file:///etc/sysrepo/yang/ietf-tls-common@2019-07-02.yang - urn:ietf:params:xml:ns:yang:ietf-tls-common - import - - - ietf-netconf-server - 2019-07-02 - file:///etc/sysrepo/yang/ietf-netconf-server@2019-07-02.yang - urn:ietf:params:xml:ns:yang:ietf-netconf-server - ssh-listen - tls-listen - ssh-call-home - tls-call-home - implement - - - ietf-tcp-client - 2019-07-02 - file:///etc/sysrepo/yang/ietf-tcp-client@2019-07-02.yang - urn:ietf:params:xml:ns:yang:ietf-tcp-client - import - - - ietf-tcp-server - 2019-07-02 - file:///etc/sysrepo/yang/ietf-tcp-server@2019-07-02.yang - urn:ietf:params:xml:ns:yang:ietf-tcp-server - import - - - ietf-interfaces - 2018-02-20 - file:///etc/sysrepo/yang/ietf-interfaces@2018-02-20.yang - urn:ietf:params:xml:ns:yang:ietf-interfaces - implement - - - ietf-ip - 2018-02-22 - file:///etc/sysrepo/yang/ietf-ip@2018-02-22.yang - urn:ietf:params:xml:ns:yang:ietf-ip - implement - - - ietf-network-instance - 2019-01-21 - file:///etc/sysrepo/yang/ietf-network-instance@2019-01-21.yang - urn:ietf:params:xml:ns:yang:ietf-network-instance - implement - - - ietf-subscribed-notifications - 2019-09-09 - file:///etc/sysrepo/yang/ietf-subscribed-notifications@2019-09-09.yang - urn:ietf:params:xml:ns:yang:ietf-subscribed-notifications - encode-xml - replay - subtree - xpath - implement - - - ietf-restconf - 2017-01-26 - file:///etc/sysrepo/yang/ietf-restconf@2017-01-26.yang - urn:ietf:params:xml:ns:yang:ietf-restconf - import - - - ietf-yang-push - 2019-09-09 - file:///etc/sysrepo/yang/ietf-yang-push@2019-09-09.yang - urn:ietf:params:xml:ns:yang:ietf-yang-push - on-change - implement - - - ietf-yang-patch - 2017-02-22 - file:///etc/sysrepo/yang/ietf-yang-patch@2017-02-22.yang - urn:ietf:params:xml:ns:yang:ietf-yang-patch - import - - diff --git a/src/test/resources/rml-io/README.md b/src/test/resources/rml-io/README.md new file mode 100644 index 00000000..8dac5408 --- /dev/null +++ b/src/test/resources/rml-io/README.md @@ -0,0 +1,14 @@ +# IO Test Cases + +## Updating the metadata + +The test cases publication (html pages) can be generated as followed: + +1. Add the testcase description in `descriptions.csv` or fetch it from the [Google spreadsheet](https://docs.google.com/spreadsheets/d/1Ui216z2cF8bNAbdZvws-JoAhcjj4M2k_NlfzmCh1jh8/edit?gid=135246907#gid=135246907). +2. Execute the `make-metadata.py` script: `./make-metadata.py http://w3id.org/rml/io/` + (This is based on the content of the folders with the test cases, and on the file descriptions.csv for the descriptions of the cases) +3. Download burp: `curl -LO https://github.com/kg-construct/BURP/releases/download/v0.1.1/burp.jar` +4. Generate the manifest with [Burp](https://github.com/kg-construct/BURP): `java -jar burp.jar -m manifest.rml.ttl -o manifest.ttl -b http://w3id.org/rml/io/test/`. Optionally, sort the output: `sort -o manifest.ttl manifest.ttl` +5. Run list.sh and insert output in dev.html +6. Set the `prevVersion` in config.js +7. To publish the new HTML verson of the test cases, export `dev.html` as `index.html` in ./docs and in a subfolder with the date of the publication (maybe adapt the publication date) diff --git a/src/test/resources/rml-io/RMLSTC0001a/README.md b/src/test/resources/rml-io/RMLSTC0001a/README.md new file mode 100644 index 00000000..21e82669 --- /dev/null +++ b/src/test/resources/rml-io/RMLSTC0001a/README.md @@ -0,0 +1,94 @@ +## RMLSTC0001a + +**Title**: Source with UTF-8 encoding + +**Description**: Test source with UTF-8 encoding + +**Error expected?** No + +**Input** +``` +[ + { + "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 + } +] + +``` + +**Mapping** +``` +@prefix rml: . +@prefix foaf: . +@base . + + +<#TriplesMap> a rml:TriplesMap; + rml:logicalSource [ a rml:LogicalSource; + rml:source [ a rml:FilePath; + rml:root rml:MappingDirectory; + rml:path "Friends.json" + ]; + rml:referenceFormulation rml:JSONPath; + rml:iterator "$[*]"; + ]; + rml:subjectMap [ a rml:SubjectMap; + rml:template "http://example.org/{$.id}"; + ]; + rml:predicateObjectMap [ a rml:PredicateObjectMap; + rml:predicateMap [ a rml:PredicateMap; + rml:constant foaf:name; + ]; + rml:objectMap [ a rml:ObjectMap; + rml:reference "$.name"; + ]; + ]; + rml:predicateObjectMap [ a rml:PredicateObjectMap; + rml:predicateMap [ a rml:PredicateMap; + rml:constant foaf:age; + ]; + rml:objectMap [ a rml:ObjectMap; + rml:reference "$.age"; + ]; + ]; +. + +``` + +**Output** +``` + "33" . + "Monica Geller" . + "34" . + "Rachel Green" . + "35" . + "Joey Tribbiani" . + "36" . + "Chandler Bing" . + "37" . + "Ross Geller" . + +``` + diff --git a/src/test/resources/rml-io/RMLSTC0001a/default.nq b/src/test/resources/rml-io/RMLSTC0001a/default.nq index d9456768..63f28ff8 100644 --- a/src/test/resources/rml-io/RMLSTC0001a/default.nq +++ b/src/test/resources/rml-io/RMLSTC0001a/default.nq @@ -1,10 +1,10 @@ - "33" . + "33"^^ . "Monica Geller" . - "34" . + "34"^^ . "Rachel Green" . - "35" . + "35"^^ . "Joey Tribbiani" . - "36" . + "36"^^ . "Chandler Bing" . - "37" . + "37"^^ . "Ross Geller" . diff --git a/src/test/resources/rml-io/RMLSTC0001a/mapping.ttl b/src/test/resources/rml-io/RMLSTC0001a/mapping.ttl index a0e95acd..6ebc43f3 100644 --- a/src/test/resources/rml-io/RMLSTC0001a/mapping.ttl +++ b/src/test/resources/rml-io/RMLSTC0001a/mapping.ttl @@ -1,28 +1,26 @@ @prefix rml: . @prefix foaf: . -@prefix dcat: . @base . -<#DCATSourceAccess> a rml:Source, dcat:Distribution; - dcat:downloadURL ; - rml:encoding rml:UTF-8; -. <#TriplesMap> a rml:TriplesMap; rml:logicalSource [ a rml:LogicalSource; - rml:source <#DCATSourceAccess>; + rml:source [ a rml:FilePath; + rml:root rml:MappingDirectory; + rml:path "Friends.json" + ]; rml:referenceFormulation rml:JSONPath; - rml:iterator "$.[*]"; + rml:iterator "$[*]"; ]; rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{id}"; + rml:template "http://example.org/{$.id}"; ]; rml:predicateObjectMap [ a rml:PredicateObjectMap; rml:predicateMap [ a rml:PredicateMap; rml:constant foaf:name; ]; rml:objectMap [ a rml:ObjectMap; - rml:reference "name"; + rml:reference "$.name"; ]; ]; rml:predicateObjectMap [ a rml:PredicateObjectMap; @@ -30,7 +28,7 @@ rml:constant foaf:age; ]; rml:objectMap [ a rml:ObjectMap; - rml:reference "age"; + rml:reference "$.age"; ]; ]; . diff --git a/src/test/resources/rml-io/RMLSTC0001b/README.md b/src/test/resources/rml-io/RMLSTC0001b/README.md new file mode 100644 index 00000000..32997daa --- /dev/null +++ b/src/test/resources/rml-io/RMLSTC0001b/README.md @@ -0,0 +1,94 @@ +## RMLSTC0001b + +**Title**: Source with UTF-16 encoding + +**Description**: Test source with UTF-16 encoding + +**Error expected?** No + +**Input** +``` +[ + { + "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 + } +] + +``` + +**Mapping** +``` +@prefix rml: . +@prefix foaf: . +@base . + + +<#TriplesMap> a rml:TriplesMap; + rml:logicalSource [ a rml:LogicalSource; + rml:source [ a rml:FilePath; + rml:root rml:MappingDirectory; + rml:path "Friends-UTF16.json" + ]; + rml:referenceFormulation rml:JSONPath; + rml:iterator "$[*]"; + ]; + rml:subjectMap [ a rml:SubjectMap; + rml:template "http://example.org/{$.id}"; + ]; + rml:predicateObjectMap [ a rml:PredicateObjectMap; + rml:predicateMap [ a rml:PredicateMap; + rml:constant foaf:name; + ]; + rml:objectMap [ a rml:ObjectMap; + rml:reference "$.name"; + ]; + ]; + rml:predicateObjectMap [ a rml:PredicateObjectMap; + rml:predicateMap [ a rml:PredicateMap; + rml:constant foaf:age; + ]; + rml:objectMap [ a rml:ObjectMap; + rml:reference "$.age"; + ]; + ]; +. + +``` + +**Output** +``` + "33" . + "Monica Geller" . + "34" . + "Rachel Green" . + "35" . + "Joey Tribbiani" . + "36" . + "Chandler Bing" . + "37" . + "Ross Geller" . + +``` + diff --git a/src/test/resources/rml-io/RMLSTC0001b/default.nq b/src/test/resources/rml-io/RMLSTC0001b/default.nq index d9456768..63f28ff8 100644 --- a/src/test/resources/rml-io/RMLSTC0001b/default.nq +++ b/src/test/resources/rml-io/RMLSTC0001b/default.nq @@ -1,10 +1,10 @@ - "33" . + "33"^^ . "Monica Geller" . - "34" . + "34"^^ . "Rachel Green" . - "35" . + "35"^^ . "Joey Tribbiani" . - "36" . + "36"^^ . "Chandler Bing" . - "37" . + "37"^^ . "Ross Geller" . diff --git a/src/test/resources/rml-io/RMLSTC0001b/mapping.ttl b/src/test/resources/rml-io/RMLSTC0001b/mapping.ttl index 9564ad5d..f669f6b3 100644 --- a/src/test/resources/rml-io/RMLSTC0001b/mapping.ttl +++ b/src/test/resources/rml-io/RMLSTC0001b/mapping.ttl @@ -1,28 +1,26 @@ @prefix rml: . @prefix foaf: . -@prefix dcat: . @base . -<#DCATSourceAccess> a rml:Source, dcat:Distribution; - dcat:downloadURL ; - rml:encoding rml:UTF-16; -. <#TriplesMap> a rml:TriplesMap; rml:logicalSource [ a rml:LogicalSource; - rml:source <#DCATSourceAccess>; + rml:source [ a rml:FilePath; + rml:root rml:MappingDirectory; + rml:path "Friends-UTF16.json" + ]; rml:referenceFormulation rml:JSONPath; - rml:iterator "$.[*]"; + rml:iterator "$[*]"; ]; rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{id}"; + rml:template "http://example.org/{$.id}"; ]; rml:predicateObjectMap [ a rml:PredicateObjectMap; rml:predicateMap [ a rml:PredicateMap; rml:constant foaf:name; ]; rml:objectMap [ a rml:ObjectMap; - rml:reference "name"; + rml:reference "$.name"; ]; ]; rml:predicateObjectMap [ a rml:PredicateObjectMap; @@ -30,7 +28,7 @@ rml:constant foaf:age; ]; rml:objectMap [ a rml:ObjectMap; - rml:reference "age"; + rml:reference "$.age"; ]; ]; . diff --git a/src/test/resources/rml-io/RMLSTC0002a/README.md b/src/test/resources/rml-io/RMLSTC0002a/README.md new file mode 100644 index 00000000..d7f3ae9a --- /dev/null +++ b/src/test/resources/rml-io/RMLSTC0002a/README.md @@ -0,0 +1,94 @@ +## RMLSTC0002a + +**Title**: Source no compression + +**Description**: Test source without compression + +**Error expected?** No + +**Input** +``` +[ + { + "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 + } +] + +``` + +**Mapping** +``` +@prefix rml: . +@prefix foaf: . +@base . + + +<#TriplesMap> a rml:TriplesMap; + rml:logicalSource [ a rml:LogicalSource; + rml:source [ a rml:FilePath; + rml:root rml:MappingDirectory; + rml:path "Friends.json" + ]; + rml:referenceFormulation rml:JSONPath; + rml:iterator "$[*]"; + ]; + rml:subjectMap [ a rml:SubjectMap; + rml:template "http://example.org/{$.id}"; + ]; + rml:predicateObjectMap [ a rml:PredicateObjectMap; + rml:predicateMap [ a rml:PredicateMap; + rml:constant foaf:name; + ]; + rml:objectMap [ a rml:ObjectMap; + rml:reference "$.name"; + ]; + ]; + rml:predicateObjectMap [ a rml:PredicateObjectMap; + rml:predicateMap [ a rml:PredicateMap; + rml:constant foaf:age; + ]; + rml:objectMap [ a rml:ObjectMap; + rml:reference "$.age"; + ]; + ]; +. + +``` + +**Output** +``` + "33" . + "Monica Geller" . + "34" . + "Rachel Green" . + "35" . + "Joey Tribbiani" . + "36" . + "Chandler Bing" . + "37" . + "Ross Geller" . + +``` + diff --git a/src/test/resources/rml-io/RMLSTC0002a/default.nq b/src/test/resources/rml-io/RMLSTC0002a/default.nq index d9456768..63f28ff8 100644 --- a/src/test/resources/rml-io/RMLSTC0002a/default.nq +++ b/src/test/resources/rml-io/RMLSTC0002a/default.nq @@ -1,10 +1,10 @@ - "33" . + "33"^^ . "Monica Geller" . - "34" . + "34"^^ . "Rachel Green" . - "35" . + "35"^^ . "Joey Tribbiani" . - "36" . + "36"^^ . "Chandler Bing" . - "37" . + "37"^^ . "Ross Geller" . diff --git a/src/test/resources/rml-io/RMLSTC0002a/mapping.ttl b/src/test/resources/rml-io/RMLSTC0002a/mapping.ttl index 7f0030e7..6ebc43f3 100644 --- a/src/test/resources/rml-io/RMLSTC0002a/mapping.ttl +++ b/src/test/resources/rml-io/RMLSTC0002a/mapping.ttl @@ -1,27 +1,26 @@ @prefix rml: . @prefix foaf: . -@prefix dcat: . @base . -<#DCATSourceAccess> a rml:Source, dcat:Distribution; - dcat:downloadURL ; -. <#TriplesMap> a rml:TriplesMap; rml:logicalSource [ a rml:LogicalSource; - rml:source <#DCATSourceAccess>; + rml:source [ a rml:FilePath; + rml:root rml:MappingDirectory; + rml:path "Friends.json" + ]; rml:referenceFormulation rml:JSONPath; - rml:iterator "$.[*]"; + rml:iterator "$[*]"; ]; rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{id}"; + rml:template "http://example.org/{$.id}"; ]; rml:predicateObjectMap [ a rml:PredicateObjectMap; rml:predicateMap [ a rml:PredicateMap; rml:constant foaf:name; ]; rml:objectMap [ a rml:ObjectMap; - rml:reference "name"; + rml:reference "$.name"; ]; ]; rml:predicateObjectMap [ a rml:PredicateObjectMap; @@ -29,7 +28,7 @@ rml:constant foaf:age; ]; rml:objectMap [ a rml:ObjectMap; - rml:reference "age"; + rml:reference "$.age"; ]; ]; . diff --git a/src/test/resources/rml-io/RMLSTC0002b/README.md b/src/test/resources/rml-io/RMLSTC0002b/README.md new file mode 100644 index 00000000..2919e46e --- /dev/null +++ b/src/test/resources/rml-io/RMLSTC0002b/README.md @@ -0,0 +1,66 @@ +## RMLSTC0002b + +**Title**: Source GZip compression + +**Description**: Test source with GZip compression + +**Error expected?** No + +**Input** + `Friends.json.gz` + +**Mapping** +``` +@prefix rml: . +@prefix foaf: . +@base . + + +<#TriplesMap> a rml:TriplesMap; + rml:logicalSource [ a rml:LogicalSource; + rml:source [ a rml:FilePath; + rml:root rml:MappingDirectory; + rml:path "Friends.json.gz"; + rml:compression rml:gzip; + ]; + rml:referenceFormulation rml:JSONPath; + rml:iterator "$[*]"; + ]; + rml:subjectMap [ a rml:SubjectMap; + rml:template "http://example.org/{$.id}"; + ]; + rml:predicateObjectMap [ a rml:PredicateObjectMap; + rml:predicateMap [ a rml:PredicateMap; + rml:constant foaf:name; + ]; + rml:objectMap [ a rml:ObjectMap; + rml:reference "$.name"; + ]; + ]; + rml:predicateObjectMap [ a rml:PredicateObjectMap; + rml:predicateMap [ a rml:PredicateMap; + rml:constant foaf:age; + ]; + rml:objectMap [ a rml:ObjectMap; + rml:reference "$.age"; + ]; + ]; +. + +``` + +**Output** +``` + "33" . + "Monica Geller" . + "34" . + "Rachel Green" . + "35" . + "Joey Tribbiani" . + "36" . + "Chandler Bing" . + "37" . + "Ross Geller" . + +``` + diff --git a/src/test/resources/rml-io/RMLSTC0002b/default.nq b/src/test/resources/rml-io/RMLSTC0002b/default.nq index d9456768..63f28ff8 100644 --- a/src/test/resources/rml-io/RMLSTC0002b/default.nq +++ b/src/test/resources/rml-io/RMLSTC0002b/default.nq @@ -1,10 +1,10 @@ - "33" . + "33"^^ . "Monica Geller" . - "34" . + "34"^^ . "Rachel Green" . - "35" . + "35"^^ . "Joey Tribbiani" . - "36" . + "36"^^ . "Chandler Bing" . - "37" . + "37"^^ . "Ross Geller" . diff --git a/src/test/resources/rml-io/RMLSTC0002b/mapping.ttl b/src/test/resources/rml-io/RMLSTC0002b/mapping.ttl index e85be871..c76bb87d 100644 --- a/src/test/resources/rml-io/RMLSTC0002b/mapping.ttl +++ b/src/test/resources/rml-io/RMLSTC0002b/mapping.ttl @@ -1,28 +1,27 @@ @prefix rml: . @prefix foaf: . -@prefix dcat: . @base . -<#DCATSourceAccess> a rml:Source, dcat:Distribution; - dcat:downloadURL ; - rml:compression rml:gzip; -. <#TriplesMap> a rml:TriplesMap; rml:logicalSource [ a rml:LogicalSource; - rml:source <#DCATSourceAccess>; + rml:source [ a rml:FilePath; + rml:root rml:MappingDirectory; + rml:path "Friends.json.gz"; + rml:compression rml:gzip; + ]; rml:referenceFormulation rml:JSONPath; - rml:iterator "$.[*]"; + rml:iterator "$[*]"; ]; rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{id}"; + rml:template "http://example.org/{$.id}"; ]; rml:predicateObjectMap [ a rml:PredicateObjectMap; rml:predicateMap [ a rml:PredicateMap; rml:constant foaf:name; ]; rml:objectMap [ a rml:ObjectMap; - rml:reference "name"; + rml:reference "$.name"; ]; ]; rml:predicateObjectMap [ a rml:PredicateObjectMap; @@ -30,7 +29,7 @@ rml:constant foaf:age; ]; rml:objectMap [ a rml:ObjectMap; - rml:reference "age"; + rml:reference "$.age"; ]; ]; . diff --git a/src/test/resources/rml-io/RMLSTC0002c/README.md b/src/test/resources/rml-io/RMLSTC0002c/README.md new file mode 100644 index 00000000..13324fcc --- /dev/null +++ b/src/test/resources/rml-io/RMLSTC0002c/README.md @@ -0,0 +1,65 @@ +## RMLSTC0002c + +**Title**: Source Zip compression + +**Description**: Test source with ZIP compression + +**Error expected?** No + +**Input** + `Friends.json.zip` + +**Mapping** +``` +@prefix rml: . +@prefix foaf: . +@base . + +<#TriplesMap> a rml:TriplesMap; + rml:logicalSource [ a rml:LogicalSource; + rml:source [ a rml:FilePath; + rml:root rml:MappingDirectory; + rml:path "Friends.json.zip"; + rml:compression rml:zip; + ]; + rml:referenceFormulation rml:JSONPath; + rml:iterator "$[*]"; + ]; + rml:subjectMap [ a rml:SubjectMap; + rml:template "http://example.org/{$.id}"; + ]; + rml:predicateObjectMap [ a rml:PredicateObjectMap; + rml:predicateMap [ a rml:PredicateMap; + rml:constant foaf:name; + ]; + rml:objectMap [ a rml:ObjectMap; + rml:reference "$.name"; + ]; + ]; + rml:predicateObjectMap [ a rml:PredicateObjectMap; + rml:predicateMap [ a rml:PredicateMap; + rml:constant foaf:age; + ]; + rml:objectMap [ a rml:ObjectMap; + rml:reference "$.age"; + ]; + ]; +. + +``` + +**Output** +``` + "33" . + "Monica Geller" . + "34" . + "Rachel Green" . + "35" . + "Joey Tribbiani" . + "36" . + "Chandler Bing" . + "37" . + "Ross Geller" . + +``` + diff --git a/src/test/resources/rml-io/RMLSTC0002c/default.nq b/src/test/resources/rml-io/RMLSTC0002c/default.nq index d9456768..63f28ff8 100644 --- a/src/test/resources/rml-io/RMLSTC0002c/default.nq +++ b/src/test/resources/rml-io/RMLSTC0002c/default.nq @@ -1,10 +1,10 @@ - "33" . + "33"^^ . "Monica Geller" . - "34" . + "34"^^ . "Rachel Green" . - "35" . + "35"^^ . "Joey Tribbiani" . - "36" . + "36"^^ . "Chandler Bing" . - "37" . + "37"^^ . "Ross Geller" . diff --git a/src/test/resources/rml-io/RMLSTC0002c/mapping.ttl b/src/test/resources/rml-io/RMLSTC0002c/mapping.ttl index 2a1ba1b4..18a50cf2 100644 --- a/src/test/resources/rml-io/RMLSTC0002c/mapping.ttl +++ b/src/test/resources/rml-io/RMLSTC0002c/mapping.ttl @@ -1,28 +1,26 @@ @prefix rml: . @prefix foaf: . -@prefix dcat: . @base . -<#DCATSourceAccess> a rml:Source, dcat:Distribution; - dcat:downloadURL ; - rml:compression rml:zip; -. - <#TriplesMap> a rml:TriplesMap; rml:logicalSource [ a rml:LogicalSource; - rml:source <#DCATSourceAccess>; + rml:source [ a rml:FilePath; + rml:root rml:MappingDirectory; + rml:path "Friends.json.zip"; + rml:compression rml:zip; + ]; rml:referenceFormulation rml:JSONPath; - rml:iterator "$.[*]"; + rml:iterator "$[*]"; ]; rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{id}"; + rml:template "http://example.org/{$.id}"; ]; rml:predicateObjectMap [ a rml:PredicateObjectMap; rml:predicateMap [ a rml:PredicateMap; rml:constant foaf:name; ]; rml:objectMap [ a rml:ObjectMap; - rml:reference "name"; + rml:reference "$.name"; ]; ]; rml:predicateObjectMap [ a rml:PredicateObjectMap; @@ -30,7 +28,7 @@ rml:constant foaf:age; ]; rml:objectMap [ a rml:ObjectMap; - rml:reference "age"; + rml:reference "$.age"; ]; ]; . diff --git a/src/test/resources/rml-io/RMLSTC0002d/Friends.json.tar.xz b/src/test/resources/rml-io/RMLSTC0002d/Friends.json.tar.xz index c37fd5f8..9b19cb56 100644 Binary files a/src/test/resources/rml-io/RMLSTC0002d/Friends.json.tar.xz and b/src/test/resources/rml-io/RMLSTC0002d/Friends.json.tar.xz differ diff --git a/src/test/resources/rml-io/RMLSTC0002d/README.md b/src/test/resources/rml-io/RMLSTC0002d/README.md new file mode 100644 index 00000000..74d1a384 --- /dev/null +++ b/src/test/resources/rml-io/RMLSTC0002d/README.md @@ -0,0 +1,65 @@ +## RMLSTC0002d + +**Title**: Source TarXz compression + +**Description**: Test source with TarXZ compression + +**Error expected?** No + +**Input** + `Friends.json.tar.xz` + +**Mapping** +``` +@prefix rml: . +@prefix foaf: . +@base . + +<#TriplesMap> a rml:TriplesMap; + rml:logicalSource [ a rml:LogicalSource; + rml:source [ a rml:FilePath; + rml:root rml:MappingDirectory; + rml:path "Friends.json.tar.xz"; + rml:compression rml:tarxz; + ]; + rml:referenceFormulation rml:JSONPath; + rml:iterator "$[*]"; + ]; + rml:subjectMap [ a rml:SubjectMap; + rml:template "http://example.org/{$.id}"; + ]; + rml:predicateObjectMap [ a rml:PredicateObjectMap; + rml:predicateMap [ a rml:PredicateMap; + rml:constant foaf:name; + ]; + rml:objectMap [ a rml:ObjectMap; + rml:reference "$.name"; + ]; + ]; + rml:predicateObjectMap [ a rml:PredicateObjectMap; + rml:predicateMap [ a rml:PredicateMap; + rml:constant foaf:age; + ]; + rml:objectMap [ a rml:ObjectMap; + rml:reference "$.age"; + ]; + ]; +. + +``` + +**Output** +``` + "33" . + "Monica Geller" . + "34" . + "Rachel Green" . + "35" . + "Joey Tribbiani" . + "36" . + "Chandler Bing" . + "37" . + "Ross Geller" . + +``` + diff --git a/src/test/resources/rml-io/RMLSTC0002d/default.nq b/src/test/resources/rml-io/RMLSTC0002d/default.nq index d9456768..63f28ff8 100644 --- a/src/test/resources/rml-io/RMLSTC0002d/default.nq +++ b/src/test/resources/rml-io/RMLSTC0002d/default.nq @@ -1,10 +1,10 @@ - "33" . + "33"^^ . "Monica Geller" . - "34" . + "34"^^ . "Rachel Green" . - "35" . + "35"^^ . "Joey Tribbiani" . - "36" . + "36"^^ . "Chandler Bing" . - "37" . + "37"^^ . "Ross Geller" . diff --git a/src/test/resources/rml-io/RMLSTC0002d/mapping.ttl b/src/test/resources/rml-io/RMLSTC0002d/mapping.ttl index 2269a236..175631be 100644 --- a/src/test/resources/rml-io/RMLSTC0002d/mapping.ttl +++ b/src/test/resources/rml-io/RMLSTC0002d/mapping.ttl @@ -1,28 +1,26 @@ @prefix rml: . @prefix foaf: . -@prefix dcat: . @base . -<#DCATSourceAccess> a rml:Source, dcat:Distribution; - dcat:downloadURL ; - rml:compression rml:tarxz; -. - <#TriplesMap> a rml:TriplesMap; rml:logicalSource [ a rml:LogicalSource; - rml:source <#DCATSourceAccess>; + rml:source [ a rml:FilePath; + rml:root rml:MappingDirectory; + rml:path "Friends.json.tar.xz"; + rml:compression rml:tarxz; + ]; rml:referenceFormulation rml:JSONPath; - rml:iterator "$.[*]"; + rml:iterator "$[*]"; ]; rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{id}"; + rml:template "http://example.org/{$.id}"; ]; rml:predicateObjectMap [ a rml:PredicateObjectMap; rml:predicateMap [ a rml:PredicateMap; rml:constant foaf:name; ]; rml:objectMap [ a rml:ObjectMap; - rml:reference "name"; + rml:reference "$.name"; ]; ]; rml:predicateObjectMap [ a rml:PredicateObjectMap; @@ -30,7 +28,7 @@ rml:constant foaf:age; ]; rml:objectMap [ a rml:ObjectMap; - rml:reference "age"; + rml:reference "$.age"; ]; ]; . diff --git a/src/test/resources/rml-io/RMLSTC0002e/README.md b/src/test/resources/rml-io/RMLSTC0002e/README.md new file mode 100644 index 00000000..b7144ef3 --- /dev/null +++ b/src/test/resources/rml-io/RMLSTC0002e/README.md @@ -0,0 +1,65 @@ +## RMLSTC0002e + +**Title**: Source TarGzip compression + +**Description**: Test source with TarGZip compression + +**Error expected?** No + +**Input** + `Friends.json.tar.gz` + +**Mapping** +``` +@prefix rml: . +@prefix foaf: . +@base . + +<#TriplesMap> a rml:TriplesMap; + rml:logicalSource [ a rml:LogicalSource; + rml:source [ a rml:FilePath; + rml:root rml:MappingDirectory; + rml:path "Friends.json.tar.gz"; + rml:compression rml:targz; + ]; + rml:referenceFormulation rml:JSONPath; + rml:iterator "$[*]"; + ]; + rml:subjectMap [ a rml:SubjectMap; + rml:template "http://example.org/{$.id}"; + ]; + rml:predicateObjectMap [ a rml:PredicateObjectMap; + rml:predicateMap [ a rml:PredicateMap; + rml:constant foaf:name; + ]; + rml:objectMap [ a rml:ObjectMap; + rml:reference "$.name"; + ]; + ]; + rml:predicateObjectMap [ a rml:PredicateObjectMap; + rml:predicateMap [ a rml:PredicateMap; + rml:constant foaf:age; + ]; + rml:objectMap [ a rml:ObjectMap; + rml:reference "$.age"; + ]; + ]; +. + +``` + +**Output** +``` + "33" . + "Monica Geller" . + "34" . + "Rachel Green" . + "35" . + "Joey Tribbiani" . + "36" . + "Chandler Bing" . + "37" . + "Ross Geller" . + +``` + diff --git a/src/test/resources/rml-io/RMLSTC0002e/default.nq b/src/test/resources/rml-io/RMLSTC0002e/default.nq index d9456768..63f28ff8 100644 --- a/src/test/resources/rml-io/RMLSTC0002e/default.nq +++ b/src/test/resources/rml-io/RMLSTC0002e/default.nq @@ -1,10 +1,10 @@ - "33" . + "33"^^ . "Monica Geller" . - "34" . + "34"^^ . "Rachel Green" . - "35" . + "35"^^ . "Joey Tribbiani" . - "36" . + "36"^^ . "Chandler Bing" . - "37" . + "37"^^ . "Ross Geller" . diff --git a/src/test/resources/rml-io/RMLSTC0002e/mapping.ttl b/src/test/resources/rml-io/RMLSTC0002e/mapping.ttl index bc8868f8..d08b82bd 100644 --- a/src/test/resources/rml-io/RMLSTC0002e/mapping.ttl +++ b/src/test/resources/rml-io/RMLSTC0002e/mapping.ttl @@ -1,28 +1,26 @@ @prefix rml: . @prefix foaf: . -@prefix dcat: . @base . -<#DCATSourceAccess> a rml:Source, dcat:Distribution; - dcat:downloadURL ; - rml:compression rml:targz; -. - <#TriplesMap> a rml:TriplesMap; rml:logicalSource [ a rml:LogicalSource; - rml:source <#DCATSourceAccess>; + rml:source [ a rml:FilePath; + rml:root rml:MappingDirectory; + rml:path "Friends.json.tar.gz"; + rml:compression rml:targz; + ]; rml:referenceFormulation rml:JSONPath; - rml:iterator "$.[*]"; + rml:iterator "$[*]"; ]; rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{id}"; + rml:template "http://example.org/{$.id}"; ]; rml:predicateObjectMap [ a rml:PredicateObjectMap; rml:predicateMap [ a rml:PredicateMap; rml:constant foaf:name; ]; rml:objectMap [ a rml:ObjectMap; - rml:reference "name"; + rml:reference "$.name"; ]; ]; rml:predicateObjectMap [ a rml:PredicateObjectMap; @@ -30,7 +28,7 @@ rml:constant foaf:age; ]; rml:objectMap [ a rml:ObjectMap; - rml:reference "age"; + rml:reference "$.age"; ]; ]; . diff --git a/src/test/resources/rml-io/RMLSTC0003/README.md b/src/test/resources/rml-io/RMLSTC0003/README.md new file mode 100644 index 00000000..0376f5dd --- /dev/null +++ b/src/test/resources/rml-io/RMLSTC0003/README.md @@ -0,0 +1,83 @@ +## RMLSTC0003 + +**Title**: Source with query + +**Description**: Test source which requires a query + +**Error expected?** No + +**Input** +``` + "33" . + "Monica Geller" . + "34" . + "Rachel Green" . + "35" . + "Joey Tribbiani" . + "36" . + "Chandler Bing" . + "37" . + "Ross Geller" . + +``` + +**Mapping** +``` +@prefix rml: . +@prefix foaf: . +@prefix formats: . +@base . + +<#TriplesMap> a rml:TriplesMap; + rml:logicalSource [ a rml:LogicalSource; + rml:source [ a rml:FilePath; + rml:path "./Friends.nt"; + ]; + rml:iterator """ + PREFIX foaf: + + SELECT ?person ?name ?age WHERE { + ?person foaf:name ?name . + ?person foaf:age ?age . + } + """; + rml:referenceFormulation formats:SPARQL_Results_CSV; + ]; + rml:subjectMap [ a rml:SubjectMap; + rml:reference "person"; + ]; + rml:predicateObjectMap [ a rml:PredicateObjectMap; + rml:predicateMap [ a rml:PredicateMap; + rml:constant foaf:name; + ]; + rml:objectMap [ a rml:ObjectMap; + rml:reference "name"; + ]; + ]; + rml:predicateObjectMap [ a rml:PredicateObjectMap; + rml:predicateMap [ a rml:PredicateMap; + rml:constant foaf:age; + ]; + rml:objectMap [ a rml:ObjectMap; + rml:reference "age"; + ]; + ]; +. + +``` + +**Output** +``` + "33" . + "Monica Geller" . + "34" . + "Rachel Green" . + "35" . + "Joey Tribbiani" . + "36" . + "Chandler Bing" . + "37" . + "Ross Geller" . + +``` + diff --git a/src/test/resources/rml-io/RMLSTC0003/default.nq b/src/test/resources/rml-io/RMLSTC0003/default.nq index d9456768..63f28ff8 100644 --- a/src/test/resources/rml-io/RMLSTC0003/default.nq +++ b/src/test/resources/rml-io/RMLSTC0003/default.nq @@ -1,10 +1,10 @@ - "33" . + "33"^^ . "Monica Geller" . - "34" . + "34"^^ . "Rachel Green" . - "35" . + "35"^^ . "Joey Tribbiani" . - "36" . + "36"^^ . "Chandler Bing" . - "37" . + "37"^^ . "Ross Geller" . diff --git a/src/test/resources/rml-io/RMLSTC0003/mapping.ttl b/src/test/resources/rml-io/RMLSTC0003/mapping.ttl index f4a8bc06..78cbc569 100644 --- a/src/test/resources/rml-io/RMLSTC0003/mapping.ttl +++ b/src/test/resources/rml-io/RMLSTC0003/mapping.ttl @@ -1,12 +1,11 @@ @prefix rml: . @prefix foaf: . -@prefix void: . @prefix formats: . @base . <#TriplesMap> a rml:TriplesMap; rml:logicalSource [ a rml:LogicalSource; - rml:source [ a rml:RelativePathSource; + rml:source [ a rml:FilePath; rml:path "./Friends.nt"; ]; rml:iterator """ diff --git a/src/test/resources/rml-io/RMLSTC0004a/Friends-NULL.csv b/src/test/resources/rml-io/RMLSTC0004a/Friends-NULL.csv index ab5f1924..6a82739b 100644 --- a/src/test/resources/rml-io/RMLSTC0004a/Friends-NULL.csv +++ b/src/test/resources/rml-io/RMLSTC0004a/Friends-NULL.csv @@ -1,7 +1,7 @@ -id;name;age -0;Monica Geller;33 -1;Rachel Green;34 -2;Joey Tribbiani;35 -3;Chandler Bing;36 -4;Ross Geller;37 -5;; +id,name,age +0,Monica Geller,33 +1,Rachel Green,34 +2,Joey Tribbiani,35 +3,Chandler Bing,36 +4,Ross Geller,37 +5,, diff --git a/src/test/resources/rml-io/RMLSTC0004a/README.md b/src/test/resources/rml-io/RMLSTC0004a/README.md new file mode 100644 index 00000000..21f0a61b --- /dev/null +++ b/src/test/resources/rml-io/RMLSTC0004a/README.md @@ -0,0 +1,73 @@ +## RMLSTC0004a + +**Title**: Source with default NULL values + +**Description**: Test source with default NULL values + +**Error expected?** No + +**Input** +``` +id,name,age +0,Monica Geller,33 +1,Rachel Green,34 +2,Joey Tribbiani,35 +3,Chandler Bing,36 +4,Ross Geller,37 +5,, + +``` + +**Mapping** +``` +@prefix rml: . +@prefix foaf: . +@prefix xsd: . +@base . + +<#TriplesMap> a rml:TriplesMap; + rml:logicalSource [ a rml:LogicalSource; + rml:source [ a rml:FilePath; + rml:root rml:MappingDirectory; + rml:path "Friends-NULL.csv"; + ]; + rml:referenceFormulation rml:CSV; + ]; + rml:subjectMap [ a rml:SubjectMap; + rml:template "http://example.org/{id}"; + ]; + rml:predicateObjectMap [ a rml:PredicateObjectMap; + rml:predicateMap [ a rml:PredicateMap; + rml:constant foaf:name; + ]; + rml:objectMap [ a rml:ObjectMap; + rml:reference "name"; + ]; + ]; + rml:predicateObjectMap [ a rml:PredicateObjectMap; + rml:predicateMap [ a rml:PredicateMap; + rml:constant foaf:age; + ]; + rml:objectMap [ a rml:ObjectMap; + rml:reference "age"; + ]; + ]; +. + +``` + +**Output** +``` + "33" . + "Monica Geller" . + "34" . + "Rachel Green" . + "35" . + "Joey Tribbiani" . + "36" . + "Chandler Bing" . + "37" . + "Ross Geller" . + +``` + diff --git a/src/test/resources/rml-io/RMLSTC0004a/default.nq b/src/test/resources/rml-io/RMLSTC0004a/default.nq index 93cbe17d..63f28ff8 100644 --- a/src/test/resources/rml-io/RMLSTC0004a/default.nq +++ b/src/test/resources/rml-io/RMLSTC0004a/default.nq @@ -1,12 +1,10 @@ - "33" . + "33"^^ . "Monica Geller" . - "34" . + "34"^^ . "Rachel Green" . - "35" . + "35"^^ . "Joey Tribbiani" . - "36" . + "36"^^ . "Chandler Bing" . - "37" . + "37"^^ . "Ross Geller" . - "" . - "" . diff --git a/src/test/resources/rml-io/RMLSTC0004a/mapping.ttl b/src/test/resources/rml-io/RMLSTC0004a/mapping.ttl index 8cb88880..aa44cf16 100644 --- a/src/test/resources/rml-io/RMLSTC0004a/mapping.ttl +++ b/src/test/resources/rml-io/RMLSTC0004a/mapping.ttl @@ -1,21 +1,14 @@ @prefix rml: . @prefix foaf: . -@prefix csvw: . @prefix xsd: . @base . -<#CSVWSourceAccess> a rml:Source, csvw:Table; - csvw:url "http://w3id.org/rml/resources/rml-io/RMLSTC0004a/Friends-NULL.csv"^^xsd:anyURI ; - csvw:dialect [ a csvw:Dialect; - csvw:delimiter ";"; - csvw:encoding "UTF-8"; - csvw:header "1"^^xsd:boolean; - ]; -. - <#TriplesMap> a rml:TriplesMap; rml:logicalSource [ a rml:LogicalSource; - rml:source <#CSVWSourceAccess>; + rml:source [ a rml:FilePath; + rml:root rml:MappingDirectory; + rml:path "Friends-NULL.csv"; + ]; rml:referenceFormulation rml:CSV; ]; rml:subjectMap [ a rml:SubjectMap; diff --git a/src/test/resources/rml-io/RMLSTC0004b/Friends-NULL.csv b/src/test/resources/rml-io/RMLSTC0004b/Friends-NULL.csv index ab5f1924..6a82739b 100644 --- a/src/test/resources/rml-io/RMLSTC0004b/Friends-NULL.csv +++ b/src/test/resources/rml-io/RMLSTC0004b/Friends-NULL.csv @@ -1,7 +1,7 @@ -id;name;age -0;Monica Geller;33 -1;Rachel Green;34 -2;Joey Tribbiani;35 -3;Chandler Bing;36 -4;Ross Geller;37 -5;; +id,name,age +0,Monica Geller,33 +1,Rachel Green,34 +2,Joey Tribbiani,35 +3,Chandler Bing,36 +4,Ross Geller,37 +5,, diff --git a/src/test/resources/rml-io/RMLSTC0004b/README.md b/src/test/resources/rml-io/RMLSTC0004b/README.md new file mode 100644 index 00000000..52cbcb47 --- /dev/null +++ b/src/test/resources/rml-io/RMLSTC0004b/README.md @@ -0,0 +1,74 @@ +## RMLSTC0004b + +**Title**: Source with one NULL value + +**Description**: Test source with one NULL value defined + +**Error expected?** No + +**Input** +``` +id,name,age +0,Monica Geller,33 +1,Rachel Green,34 +2,Joey Tribbiani,35 +3,Chandler Bing,36 +4,Ross Geller,37 +5,, + +``` + +**Mapping** +``` +@prefix rml: . +@prefix foaf: . +@prefix xsd: . +@base . + +<#TriplesMap> a rml:TriplesMap; + rml:logicalSource [ a rml:LogicalSource; + rml:source [ a rml:FilePath; + rml:root rml:MappingDirectory; + rml:path "Friends-NULL.csv"; + rml:null ""; + ]; + rml:referenceFormulation rml:CSV; + ]; + rml:subjectMap [ a rml:SubjectMap; + rml:template "http://example.org/{id}"; + ]; + rml:predicateObjectMap [ a rml:PredicateObjectMap; + rml:predicateMap [ a rml:PredicateMap; + rml:constant foaf:name; + ]; + rml:objectMap [ a rml:ObjectMap; + rml:reference "name"; + ]; + ]; + rml:predicateObjectMap [ a rml:PredicateObjectMap; + rml:predicateMap [ a rml:PredicateMap; + rml:constant foaf:age; + ]; + rml:objectMap [ a rml:ObjectMap; + rml:reference "age"; + ]; + ]; +. + +``` + +**Output** +``` + "33" . + "Monica Geller" . + "34" . + "Rachel Green" . + "35" . + "Joey Tribbiani" . + "36" . + "Chandler Bing" . + "37" . + "Ross Geller" . + +``` + diff --git a/src/test/resources/rml-io/RMLSTC0004b/default.nq b/src/test/resources/rml-io/RMLSTC0004b/default.nq index d9456768..63f28ff8 100644 --- a/src/test/resources/rml-io/RMLSTC0004b/default.nq +++ b/src/test/resources/rml-io/RMLSTC0004b/default.nq @@ -1,10 +1,10 @@ - "33" . + "33"^^ . "Monica Geller" . - "34" . + "34"^^ . "Rachel Green" . - "35" . + "35"^^ . "Joey Tribbiani" . - "36" . + "36"^^ . "Chandler Bing" . - "37" . + "37"^^ . "Ross Geller" . diff --git a/src/test/resources/rml-io/RMLSTC0004b/mapping.ttl b/src/test/resources/rml-io/RMLSTC0004b/mapping.ttl index 4b656404..bb39b80c 100644 --- a/src/test/resources/rml-io/RMLSTC0004b/mapping.ttl +++ b/src/test/resources/rml-io/RMLSTC0004b/mapping.ttl @@ -1,23 +1,15 @@ @prefix rml: . @prefix foaf: . -@prefix csvw: . @prefix xsd: . @base . -<#CSVWSourceAccess> a rml:Source, csvw:Table; - csvw:url "http://w3id.org/rml/resources/rml-io/RMLSTC0004b/Friends-NULL.csv"^^xsd:anyURI ; - csvw:dialect [ a csvw:Dialect; - csvw:delimiter ";"; - csvw:encoding "UTF-8"; - csvw:header "1"^^xsd:boolean; - ]; - # Empty value is considered NULL - rml:null ""; -. - <#TriplesMap> a rml:TriplesMap; rml:logicalSource [ a rml:LogicalSource; - rml:source <#CSVWSourceAccess>; + rml:source [ a rml:FilePath; + rml:root rml:MappingDirectory; + rml:path "Friends-NULL.csv"; + rml:null ""; + ]; rml:referenceFormulation rml:CSV; ]; rml:subjectMap [ a rml:SubjectMap; diff --git a/src/test/resources/rml-io/RMLSTC0004c/Friends-NULL.csv b/src/test/resources/rml-io/RMLSTC0004c/Friends-NULL.csv new file mode 100644 index 00000000..9fe19573 --- /dev/null +++ b/src/test/resources/rml-io/RMLSTC0004c/Friends-NULL.csv @@ -0,0 +1,8 @@ +id,name,age +0,Monica Geller,33 +1,Rachel Green,34 +2,Joey Tribbiani,35 +3,Chandler Bing,36 +4,Ross Geller,37 +5,, +6,NULL,NULL diff --git a/src/test/resources/rml-io/RMLSTC0004c/Friends-NULL2.csv b/src/test/resources/rml-io/RMLSTC0004c/Friends-NULL2.csv deleted file mode 100644 index 2bbf9a5d..00000000 --- a/src/test/resources/rml-io/RMLSTC0004c/Friends-NULL2.csv +++ /dev/null @@ -1,8 +0,0 @@ -id;name;age -0;Monica Geller;33 -1;Rachel Green;34 -2;Joey Tribbiani;35 -3;Chandler Bing;36 -4;Ross Geller;37 -5;; -6;NULL;NULL diff --git a/src/test/resources/rml-io/RMLSTC0004c/README.md b/src/test/resources/rml-io/RMLSTC0004c/README.md new file mode 100644 index 00000000..936b9430 --- /dev/null +++ b/src/test/resources/rml-io/RMLSTC0004c/README.md @@ -0,0 +1,76 @@ +## RMLSTC0004c + +**Title**: Source with multiple NULL values + +**Description**: Test source with multiple NULL values defined + +**Error expected?** No + +**Input** +``` +id,name,age +0,Monica Geller,33 +1,Rachel Green,34 +2,Joey Tribbiani,35 +3,Chandler Bing,36 +4,Ross Geller,37 +5,, +6,NULL,NULL + +``` + +**Mapping** +``` +@prefix rml: . +@prefix foaf: . +@prefix xsd: . +@base . + +<#TriplesMap> a rml:TriplesMap; + rml:logicalSource [ a rml:LogicalSource; + rml:source [ a rml:FilePath; + rml:root rml:MappingDirectory; + rml:path "Friends-NULL.csv"; + rml:null ""; + rml:null "NULL"; + ]; + rml:referenceFormulation rml:CSV; + ]; + rml:subjectMap [ a rml:SubjectMap; + rml:template "http://example.org/{id}"; + ]; + rml:predicateObjectMap [ a rml:PredicateObjectMap; + rml:predicateMap [ a rml:PredicateMap; + rml:constant foaf:name; + ]; + rml:objectMap [ a rml:ObjectMap; + rml:reference "name"; + ]; + ]; + rml:predicateObjectMap [ a rml:PredicateObjectMap; + rml:predicateMap [ a rml:PredicateMap; + rml:constant foaf:age; + ]; + rml:objectMap [ a rml:ObjectMap; + rml:reference "age"; + ]; + ]; +. + +``` + +**Output** +``` + "33" . + "Monica Geller" . + "34" . + "Rachel Green" . + "35" . + "Joey Tribbiani" . + "36" . + "Chandler Bing" . + "37" . + "Ross Geller" . + +``` + diff --git a/src/test/resources/rml-io/RMLSTC0004c/default.nq b/src/test/resources/rml-io/RMLSTC0004c/default.nq index d9456768..63f28ff8 100644 --- a/src/test/resources/rml-io/RMLSTC0004c/default.nq +++ b/src/test/resources/rml-io/RMLSTC0004c/default.nq @@ -1,10 +1,10 @@ - "33" . + "33"^^ . "Monica Geller" . - "34" . + "34"^^ . "Rachel Green" . - "35" . + "35"^^ . "Joey Tribbiani" . - "36" . + "36"^^ . "Chandler Bing" . - "37" . + "37"^^ . "Ross Geller" . diff --git a/src/test/resources/rml-io/RMLSTC0004c/mapping.ttl b/src/test/resources/rml-io/RMLSTC0004c/mapping.ttl index 6c365ee9..e864a958 100644 --- a/src/test/resources/rml-io/RMLSTC0004c/mapping.ttl +++ b/src/test/resources/rml-io/RMLSTC0004c/mapping.ttl @@ -1,24 +1,16 @@ @prefix rml: . @prefix foaf: . -@prefix csvw: . @prefix xsd: . @base . -<#CSVWSourceAccess> a rml:Source, csvw:Table; - csvw:url "http://w3id.org/rml/resources/rml-io/RMLSTC0004c/Friends-NULL2.csv"^^xsd:anyURI ; - csvw:dialect [ a csvw:Dialect; - csvw:delimiter ";"; - csvw:encoding "UTF-8"; - csvw:header "1"^^xsd:boolean; - ]; - # Empty value and 'NULL' are both considered NULL - rml:null ""; - rml:null "NULL"; -. - <#TriplesMap> a rml:TriplesMap; rml:logicalSource [ a rml:LogicalSource; - rml:source <#CSVWSourceAccess>; + rml:source [ a rml:FilePath; + rml:root rml:MappingDirectory; + rml:path "Friends-NULL.csv"; + rml:null ""; + rml:null "NULL"; + ]; rml:referenceFormulation rml:CSV; ]; rml:subjectMap [ a rml:SubjectMap; diff --git a/src/test/resources/rml-io/RMLSTC0005a/Friends-NULL.csv b/src/test/resources/rml-io/RMLSTC0005a/Friends-NULL.csv deleted file mode 100644 index ab5f1924..00000000 --- a/src/test/resources/rml-io/RMLSTC0005a/Friends-NULL.csv +++ /dev/null @@ -1,7 +0,0 @@ -id;name;age -0;Monica Geller;33 -1;Rachel Green;34 -2;Joey Tribbiani;35 -3;Chandler Bing;36 -4;Ross Geller;37 -5;; diff --git a/src/test/resources/rml-io/RMLSTC0005a/mapping.ttl b/src/test/resources/rml-io/RMLSTC0005a/mapping.ttl deleted file mode 100644 index 383efa6b..00000000 --- a/src/test/resources/rml-io/RMLSTC0005a/mapping.ttl +++ /dev/null @@ -1,43 +0,0 @@ -@prefix rml: . -@prefix foaf: . -@prefix csvw: . -@prefix xsd: . -@base . - -<#CSVWSourceAccess> a rml:Source, csvw:Table; - csvw:url "http://w3id.org/rml/resources/rml-io/RMLSTC0005a/Friends-NULL.csv"^^xsd:anyURI ; - csvw:dialect [ a csvw:Dialect; - csvw:delimiter ";"; - csvw:encoding "UTF-8"; - csvw:header "1"^^xsd:boolean; - csvw:null "NULL"; - ]; - # Empty value is considered NULL and overrides CSVW - rml:null ""; -. - -<#TriplesMap> a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:source <#CSVWSourceAccess>; - rml:referenceFormulation rml:CSV; - ]; - rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{id}"; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:name; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "name"; - ]; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:age; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "age"; - ]; - ]; -. diff --git a/src/test/resources/rml-io/RMLSTC0005b/Friends.csv b/src/test/resources/rml-io/RMLSTC0005b/Friends.csv deleted file mode 100644 index 0d40425f..00000000 Binary files a/src/test/resources/rml-io/RMLSTC0005b/Friends.csv and /dev/null differ diff --git a/src/test/resources/rml-io/RMLSTC0005b/default.nq b/src/test/resources/rml-io/RMLSTC0005b/default.nq deleted file mode 100644 index d9456768..00000000 --- a/src/test/resources/rml-io/RMLSTC0005b/default.nq +++ /dev/null @@ -1,10 +0,0 @@ - "33" . - "Monica Geller" . - "34" . - "Rachel Green" . - "35" . - "Joey Tribbiani" . - "36" . - "Chandler Bing" . - "37" . - "Ross Geller" . diff --git a/src/test/resources/rml-io/RMLSTC0005b/mapping.ttl b/src/test/resources/rml-io/RMLSTC0005b/mapping.ttl deleted file mode 100644 index 9ac12738..00000000 --- a/src/test/resources/rml-io/RMLSTC0005b/mapping.ttl +++ /dev/null @@ -1,42 +0,0 @@ -@prefix rml: . -@prefix foaf: . -@prefix csvw: . -@prefix xsd: . -@base . - -<#CSVWSourceAccess> a rml:Source, csvw:Table; - csvw:url "http://w3id.org/rml/resources/rml-io/RMLSTC0005b/Friends.csv"^^xsd:anyURI ; - csvw:dialect [ a csvw:Dialect; - csvw:delimiter ";"; - csvw:encoding "UTF-8"; - csvw:header "1"^^xsd:boolean; - ]; - # Encoding is UTF-16 and overrides CSVW - rml:encoding rml:UTF-16; -. - -<#TriplesMap> a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:source <#CSVWSourceAccess>; - rml:referenceFormulation rml:CSV; - ]; - rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{id}"; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:name; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "name"; - ]; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:age; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "age"; - ]; - ]; -. diff --git a/src/test/resources/rml-io/RMLSTC0006a/Friends.csv b/src/test/resources/rml-io/RMLSTC0006a/Friends.csv new file mode 100644 index 00000000..752cdfe4 --- /dev/null +++ b/src/test/resources/rml-io/RMLSTC0006a/Friends.csv @@ -0,0 +1,6 @@ +id,name,age +0,Monica Geller,33 +1,Rachel Green,34 +2,Joey Tribbiani,35 +3,Chandler Bing,36 +4,Ross Geller,37 diff --git a/src/test/resources/rml-io/RMLSTC0006a/README.md b/src/test/resources/rml-io/RMLSTC0006a/README.md new file mode 100644 index 00000000..3e7b5c95 --- /dev/null +++ b/src/test/resources/rml-io/RMLSTC0006a/README.md @@ -0,0 +1,77 @@ +## RMLSTC0006a + +**Title**: Source with D2RQ access description + +**Description**: Test source with D2RQ access description for SQL databases + +**Error expected?** No + +**Input** +``` +id,name,age +0,Monica Geller,33 +1,Rachel Green,34 +2,Joey Tribbiani,35 +3,Chandler Bing,36 +4,Ross Geller,37 + +``` + +**Mapping** +``` +@prefix rml: . +@prefix foaf: . +@prefix d2rq: . +@prefix xsd: . +@base . + +<#D2RQSourceAccess> a rml:Source, d2rq:Database; + d2rq:jdbcDSN "$CONNECTIONDSN"; + d2rq:username "$USERNAME"; + d2rq:password "$PASSWORD" +. + +<#TriplesMap> a rml:TriplesMap; + rml:logicalSource [ a rml:LogicalSource; + rml:source <#D2RQSourceAccess>; + rml:referenceFormulation rml:SQL2008Table; + rml:iterator "Friends"; + ]; + rml:subjectMap [ a rml:SubjectMap; + rml:template "http://example.org/{id}"; + ]; + rml:predicateObjectMap [ a rml:PredicateObjectMap; + rml:predicateMap [ a rml:PredicateMap; + rml:constant foaf:name; + ]; + rml:objectMap [ a rml:ObjectMap; + rml:reference "name"; + ]; + ]; + rml:predicateObjectMap [ a rml:PredicateObjectMap; + rml:predicateMap [ a rml:PredicateMap; + rml:constant foaf:age; + ]; + rml:objectMap [ a rml:ObjectMap; + rml:reference "age"; + ]; + ]; +. + +``` + +**Output** +``` + "33" . + "Monica Geller" . + "34" . + "Rachel Green" . + "35" . + "Joey Tribbiani" . + "36" . + "Chandler Bing" . + "37" . + "Ross Geller" . + +``` + diff --git a/src/test/resources/rml-io/RMLSTC0006a/default.nq b/src/test/resources/rml-io/RMLSTC0006a/default.nq index d9456768..63f28ff8 100644 --- a/src/test/resources/rml-io/RMLSTC0006a/default.nq +++ b/src/test/resources/rml-io/RMLSTC0006a/default.nq @@ -1,10 +1,10 @@ - "33" . + "33"^^ . "Monica Geller" . - "34" . + "34"^^ . "Rachel Green" . - "35" . + "35"^^ . "Joey Tribbiani" . - "36" . + "36"^^ . "Chandler Bing" . - "37" . + "37"^^ . "Ross Geller" . diff --git a/src/test/resources/rml-io/RMLSTC0006a/mapping.ttl b/src/test/resources/rml-io/RMLSTC0006a/mapping.ttl index 32b9aa32..f8011e89 100644 --- a/src/test/resources/rml-io/RMLSTC0006a/mapping.ttl +++ b/src/test/resources/rml-io/RMLSTC0006a/mapping.ttl @@ -1,17 +1,20 @@ @prefix rml: . @prefix foaf: . -@prefix dcat: . +@prefix d2rq: . +@prefix xsd: . @base . -<#DCATSourceAccess> a rml:Source, dcat:Distribution; - dcat:downloadURL ; +<#D2RQSourceAccess> a rml:Source, d2rq:Database; + d2rq:jdbcDSN "$CONNECTIONDSN"; + d2rq:username "$USERNAME"; + d2rq:password "$PASSWORD" . <#TriplesMap> a rml:TriplesMap; rml:logicalSource [ a rml:LogicalSource; - rml:source <#DCATSourceAccess>; - rml:referenceFormulation rml:JSONPath; - rml:iterator "$.[*]"; + rml:source <#D2RQSourceAccess>; + rml:referenceFormulation rml:SQL2008Table; + rml:iterator "Friends"; ]; rml:subjectMap [ a rml:SubjectMap; rml:template "http://example.org/{id}"; diff --git a/src/test/resources/rml-io/RMLSTC0006b/Friends.csv b/src/test/resources/rml-io/RMLSTC0006b/Friends.csv new file mode 100644 index 00000000..752cdfe4 --- /dev/null +++ b/src/test/resources/rml-io/RMLSTC0006b/Friends.csv @@ -0,0 +1,6 @@ +id,name,age +0,Monica Geller,33 +1,Rachel Green,34 +2,Joey Tribbiani,35 +3,Chandler Bing,36 +4,Ross Geller,37 diff --git a/src/test/resources/rml-io/RMLSTC0006b/Friends.nt b/src/test/resources/rml-io/RMLSTC0006b/Friends.nt deleted file mode 100644 index d9456768..00000000 --- a/src/test/resources/rml-io/RMLSTC0006b/Friends.nt +++ /dev/null @@ -1,10 +0,0 @@ - "33" . - "Monica Geller" . - "34" . - "Rachel Green" . - "35" . - "Joey Tribbiani" . - "36" . - "Chandler Bing" . - "37" . - "Ross Geller" . diff --git a/src/test/resources/rml-io/RMLSTC0006b/README.md b/src/test/resources/rml-io/RMLSTC0006b/README.md new file mode 100644 index 00000000..73c9ad58 --- /dev/null +++ b/src/test/resources/rml-io/RMLSTC0006b/README.md @@ -0,0 +1,72 @@ +## RMLSTC0006b + +**Title**: Source with a Relative Path Source + +**Description**: Test access to a file + +**Error expected?** No + +**Input** +``` +id,name,age +0,Monica Geller,33 +1,Rachel Green,34 +2,Joey Tribbiani,35 +3,Chandler Bing,36 +4,Ross Geller,37 + +``` + +**Mapping** +``` +@prefix rml: . +@prefix foaf: . +@prefix xsd: . +@base . + +<#TriplesMap> a rml:TriplesMap; + rml:logicalSource [ a rml:LogicalSource; + rml:source [ a rml:FilePath, rml:Source; + rml:root rml:CurrentWorkingDirectory; + rml:path "./Friends.csv" + ]; + rml:referenceFormulation rml:CSV; + ]; + rml:subjectMap [ a rml:SubjectMap; + rml:template "http://example.org/{id}"; + ]; + rml:predicateObjectMap [ a rml:PredicateObjectMap; + rml:predicateMap [ a rml:PredicateMap; + rml:constant foaf:name; + ]; + rml:objectMap [ a rml:ObjectMap; + rml:reference "name"; + ]; + ]; + rml:predicateObjectMap [ a rml:PredicateObjectMap; + rml:predicateMap [ a rml:PredicateMap; + rml:constant foaf:age; + ]; + rml:objectMap [ a rml:ObjectMap; + rml:reference "age"; + ]; + ]; +. + +``` + +**Output** +``` + "33" . + "Monica Geller" . + "34" . + "Rachel Green" . + "35" . + "Joey Tribbiani" . + "36" . + "Chandler Bing" . + "37" . + "Ross Geller" . + +``` + diff --git a/src/test/resources/rml-io/RMLSTC0006b/default.nq b/src/test/resources/rml-io/RMLSTC0006b/default.nq index d9456768..63f28ff8 100644 --- a/src/test/resources/rml-io/RMLSTC0006b/default.nq +++ b/src/test/resources/rml-io/RMLSTC0006b/default.nq @@ -1,10 +1,10 @@ - "33" . + "33"^^ . "Monica Geller" . - "34" . + "34"^^ . "Rachel Green" . - "35" . + "35"^^ . "Joey Tribbiani" . - "36" . + "36"^^ . "Chandler Bing" . - "37" . + "37"^^ . "Ross Geller" . diff --git a/src/test/resources/rml-io/RMLSTC0006b/mapping.ttl b/src/test/resources/rml-io/RMLSTC0006b/mapping.ttl index 6436db1b..f0d0f98e 100644 --- a/src/test/resources/rml-io/RMLSTC0006b/mapping.ttl +++ b/src/test/resources/rml-io/RMLSTC0006b/mapping.ttl @@ -1,26 +1,15 @@ @prefix rml: . @prefix foaf: . -@prefix void: . -@prefix formats: . +@prefix xsd: . @base . -<#VoIDSourceAccess> a rml:Source, void:Dataset; - void:dataDump ; -. - <#TriplesMap> a rml:TriplesMap; rml:logicalSource [ a rml:LogicalSource; - rml:source <#VoIDSourceAccess>; - rml:iterator """ - PREFIX foaf: - - SELECT ?id ?name ?age WHERE { - ?person foaf:name ?name . - ?person foaf:age ?age . - BIND(REPLACE(STR(?person),"http://example.org/", "") AS ?id) . - } - """; - rml:referenceFormulation formats:SPARQL_Results_CSV; + rml:source [ a rml:FilePath, rml:Source; + rml:root rml:CurrentWorkingDirectory; + rml:path "./Friends.csv" + ]; + rml:referenceFormulation rml:CSV; ]; rml:subjectMap [ a rml:SubjectMap; rml:template "http://example.org/{id}"; diff --git a/src/test/resources/rml-io/RMLSTC0006c/Friends.nt b/src/test/resources/rml-io/RMLSTC0006c/Friends.nt deleted file mode 100644 index d9456768..00000000 --- a/src/test/resources/rml-io/RMLSTC0006c/Friends.nt +++ /dev/null @@ -1,10 +0,0 @@ - "33" . - "Monica Geller" . - "34" . - "Rachel Green" . - "35" . - "Joey Tribbiani" . - "36" . - "Chandler Bing" . - "37" . - "Ross Geller" . diff --git a/src/test/resources/rml-io/RMLSTC0006c/default.nq b/src/test/resources/rml-io/RMLSTC0006c/default.nq deleted file mode 100644 index d9456768..00000000 --- a/src/test/resources/rml-io/RMLSTC0006c/default.nq +++ /dev/null @@ -1,10 +0,0 @@ - "33" . - "Monica Geller" . - "34" . - "Rachel Green" . - "35" . - "Joey Tribbiani" . - "36" . - "Chandler Bing" . - "37" . - "Ross Geller" . diff --git a/src/test/resources/rml-io/RMLSTC0006c/mapping.ttl b/src/test/resources/rml-io/RMLSTC0006c/mapping.ttl deleted file mode 100644 index 30bbffa5..00000000 --- a/src/test/resources/rml-io/RMLSTC0006c/mapping.ttl +++ /dev/null @@ -1,45 +0,0 @@ -@prefix rml: . -@prefix foaf: . -@prefix sd: . -@prefix formats: . -@base . - -<#SDSourceAccess> a rml:Source, sd:Service; - sd:endpoint ; - sd:supportedLanguage sd:SPARQL11Query; -. - -<#TriplesMap> a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:source <#SDSourceAccess>; - rml:iterator """ - PREFIX foaf: - - SELECT ?id ?name ?age WHERE { - ?person foaf:name ?name . - ?person foaf:age ?age . - BIND(REPLACE(STR(?person),"http://example.org/", "") AS ?id) . - } - """; - rml:referenceFormulation formats:SPARQL_Results_CSV; - ]; - rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{id}"; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:name; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "name"; - ]; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:age; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "age"; - ]; - ]; -. diff --git a/src/test/resources/rml-io/RMLSTC0006d/Friends.csv b/src/test/resources/rml-io/RMLSTC0006d/Friends.csv deleted file mode 100644 index 04680d7c..00000000 --- a/src/test/resources/rml-io/RMLSTC0006d/Friends.csv +++ /dev/null @@ -1,6 +0,0 @@ -id;name;age -0;Monica Geller;33 -1;Rachel Green;34 -2;Joey Tribbiani;35 -3;Chandler Bing;36 -4;Ross Geller;37 diff --git a/src/test/resources/rml-io/RMLSTC0006d/default.nq b/src/test/resources/rml-io/RMLSTC0006d/default.nq deleted file mode 100644 index d9456768..00000000 --- a/src/test/resources/rml-io/RMLSTC0006d/default.nq +++ /dev/null @@ -1,10 +0,0 @@ - "33" . - "Monica Geller" . - "34" . - "Rachel Green" . - "35" . - "Joey Tribbiani" . - "36" . - "Chandler Bing" . - "37" . - "Ross Geller" . diff --git a/src/test/resources/rml-io/RMLSTC0006d/mapping.ttl b/src/test/resources/rml-io/RMLSTC0006d/mapping.ttl deleted file mode 100644 index 78387d20..00000000 --- a/src/test/resources/rml-io/RMLSTC0006d/mapping.ttl +++ /dev/null @@ -1,40 +0,0 @@ -@prefix rml: . -@prefix foaf: . -@prefix csvw: . -@prefix xsd: . -@base . - -<#CSVWSourceAccess> a rml:Source, csvw:Table; - csvw:url "http://w3id.org/rml/resources/rml-io/RMLSTC0006d/Friends.csv"^^xsd:anyURI ; - csvw:dialect [ a csvw:Dialect; - csvw:delimiter ";"; - csvw:encoding "UTF-8"; - csvw:header "1"^^xsd:boolean; - ]; -. - -<#TriplesMap> a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:source <#CSVWSourceAccess>; - rml:referenceFormulation rml:CSV; - ]; - rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{id}"; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:name; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "name"; - ]; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:age; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "age"; - ]; - ]; -. diff --git a/src/test/resources/rml-io/RMLSTC0006e/default.nq b/src/test/resources/rml-io/RMLSTC0006e/default.nq deleted file mode 100644 index d9456768..00000000 --- a/src/test/resources/rml-io/RMLSTC0006e/default.nq +++ /dev/null @@ -1,10 +0,0 @@ - "33" . - "Monica Geller" . - "34" . - "Rachel Green" . - "35" . - "Joey Tribbiani" . - "36" . - "Chandler Bing" . - "37" . - "Ross Geller" . diff --git a/src/test/resources/rml-io/RMLSTC0006e/mapping.ttl b/src/test/resources/rml-io/RMLSTC0006e/mapping.ttl deleted file mode 100644 index 634dd584..00000000 --- a/src/test/resources/rml-io/RMLSTC0006e/mapping.ttl +++ /dev/null @@ -1,43 +0,0 @@ -@prefix rml: . -@prefix foaf: . -@prefix td: . -@prefix htv: . -@prefix hctl: . -@base . - -<#WoTSourceAccess> a rml:Source, td:Thing; - td:hasPropertyAffordance [ - td:hasForm [ - # URL and content type - hctl:hasTarget "http://w3id.org/rml/resources/rml-io/RMLSTC0006e/Friends.json"; - hctl:forContentType "application/json"; - ]; - ]; -. - -<#TriplesMap> a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:source <#WoTSourceAccess>; - rml:referenceFormulation rml:JSONPath; - rml:iterator "$.[*]"; - ]; - rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{id}"; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:name; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "name"; - ]; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:age; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "age"; - ]; - ]; -. diff --git a/src/test/resources/rml-io/RMLSTC0006f/Friends.csv b/src/test/resources/rml-io/RMLSTC0006f/Friends.csv deleted file mode 100644 index 928f08c1..00000000 --- a/src/test/resources/rml-io/RMLSTC0006f/Friends.csv +++ /dev/null @@ -1,6 +0,0 @@ -id, name, age -0, Monica Geller, 33 -1, Rachel Green, 34 -2, Joey Tribbiani, 35 -3, Chandler Bing, 36 -4, Ross Geller, 37 diff --git a/src/test/resources/rml-io/RMLSTC0006f/default.nq b/src/test/resources/rml-io/RMLSTC0006f/default.nq deleted file mode 100644 index d9456768..00000000 --- a/src/test/resources/rml-io/RMLSTC0006f/default.nq +++ /dev/null @@ -1,10 +0,0 @@ - "33" . - "Monica Geller" . - "34" . - "Rachel Green" . - "35" . - "Joey Tribbiani" . - "36" . - "Chandler Bing" . - "37" . - "Ross Geller" . diff --git a/src/test/resources/rml-io/RMLSTC0006f/mapping.ttl b/src/test/resources/rml-io/RMLSTC0006f/mapping.ttl deleted file mode 100644 index d06c50b4..00000000 --- a/src/test/resources/rml-io/RMLSTC0006f/mapping.ttl +++ /dev/null @@ -1,38 +0,0 @@ -@prefix rml: . -@prefix foaf: . -@prefix d2rq: . -@prefix xsd: . -@base . - -<#D2RQSourceAccess> a rml:Source, d2rq:Database; - d2rq:jdbcDSN "jdbc://host:port/database"; - d2rq:username "username"; - d2rq:password "password" -. - -<#TriplesMap> a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:source <#D2RQSourceAccess>; - rml:referenceFormulation rml:SQL2008Table; - rml:iterator "Friends"; - ]; - rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{id}"; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:name; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "name"; - ]; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:age; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "age"; - ]; - ]; -. diff --git a/src/test/resources/rml-io/RMLSTC0007a/README.md b/src/test/resources/rml-io/RMLSTC0007a/README.md new file mode 100644 index 00000000..94abd46c --- /dev/null +++ b/src/test/resources/rml-io/RMLSTC0007a/README.md @@ -0,0 +1,94 @@ +## RMLSTC0007a + +**Title**: Source with JSONPath reference formulation + +**Description**: Test source with JSONPath reference formulation + +**Error expected?** No + +**Input** +``` +[ + { + "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 + } +] + +``` + +**Mapping** +``` +@prefix rml: . +@prefix foaf: . +@base . + +<#TriplesMap> a rml:TriplesMap; + rml:logicalSource [ a rml:LogicalSource; + rml:source [ a rml:FilePath; + rml:root rml:MappingDirectory; + rml:path "Friends.json"; + rml:encoding rml:UTF-8 + ]; + rml:referenceFormulation rml:JSONPath; + rml:iterator "$[*]"; + ]; + rml:subjectMap [ a rml:SubjectMap; + rml:template "http://example.org/{$.id}"; + ]; + rml:predicateObjectMap [ a rml:PredicateObjectMap; + rml:predicateMap [ a rml:PredicateMap; + rml:constant foaf:name; + ]; + rml:objectMap [ a rml:ObjectMap; + rml:reference "$.name"; + ]; + ]; + rml:predicateObjectMap [ a rml:PredicateObjectMap; + rml:predicateMap [ a rml:PredicateMap; + rml:constant foaf:age; + ]; + rml:objectMap [ a rml:ObjectMap; + rml:reference "$.age"; + ]; + ]; +. + +``` + +**Output** +``` + "33" . + "Monica Geller" . + "34" . + "Rachel Green" . + "35" . + "Joey Tribbiani" . + "36" . + "Chandler Bing" . + "37" . + "Ross Geller" . + +``` + diff --git a/src/test/resources/rml-io/RMLSTC0007a/default.nq b/src/test/resources/rml-io/RMLSTC0007a/default.nq index d9456768..63f28ff8 100644 --- a/src/test/resources/rml-io/RMLSTC0007a/default.nq +++ b/src/test/resources/rml-io/RMLSTC0007a/default.nq @@ -1,10 +1,10 @@ - "33" . + "33"^^ . "Monica Geller" . - "34" . + "34"^^ . "Rachel Green" . - "35" . + "35"^^ . "Joey Tribbiani" . - "36" . + "36"^^ . "Chandler Bing" . - "37" . + "37"^^ . "Ross Geller" . diff --git a/src/test/resources/rml-io/RMLSTC0007a/mapping.ttl b/src/test/resources/rml-io/RMLSTC0007a/mapping.ttl index 496ca6fc..00a2f99e 100644 --- a/src/test/resources/rml-io/RMLSTC0007a/mapping.ttl +++ b/src/test/resources/rml-io/RMLSTC0007a/mapping.ttl @@ -1,28 +1,26 @@ @prefix rml: . @prefix foaf: . -@prefix dcat: . @base . -<#DCATSourceAccess> a rml:Source, dcat:Distribution; - dcat:downloadURL ; - rml:encoding rml:UTF-8; -. - <#TriplesMap> a rml:TriplesMap; rml:logicalSource [ a rml:LogicalSource; - rml:source <#DCATSourceAccess>; + rml:source [ a rml:FilePath; + rml:root rml:MappingDirectory; + rml:path "Friends.json"; + rml:encoding rml:UTF-8 + ]; rml:referenceFormulation rml:JSONPath; - rml:iterator "$.[*]"; + rml:iterator "$[*]"; ]; rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{id}"; + rml:template "http://example.org/{$.id}"; ]; rml:predicateObjectMap [ a rml:PredicateObjectMap; rml:predicateMap [ a rml:PredicateMap; rml:constant foaf:name; ]; rml:objectMap [ a rml:ObjectMap; - rml:reference "name"; + rml:reference "$.name"; ]; ]; rml:predicateObjectMap [ a rml:PredicateObjectMap; @@ -30,7 +28,7 @@ rml:constant foaf:age; ]; rml:objectMap [ a rml:ObjectMap; - rml:reference "age"; + rml:reference "$.age"; ]; ]; . diff --git a/src/test/resources/rml-io/RMLSTC0007b/Friends.csv b/src/test/resources/rml-io/RMLSTC0007b/Friends.csv index 928f08c1..752cdfe4 100644 --- a/src/test/resources/rml-io/RMLSTC0007b/Friends.csv +++ b/src/test/resources/rml-io/RMLSTC0007b/Friends.csv @@ -1,6 +1,6 @@ -id, name, age -0, Monica Geller, 33 -1, Rachel Green, 34 -2, Joey Tribbiani, 35 -3, Chandler Bing, 36 -4, Ross Geller, 37 +id,name,age +0,Monica Geller,33 +1,Rachel Green,34 +2,Joey Tribbiani,35 +3,Chandler Bing,36 +4,Ross Geller,37 diff --git a/src/test/resources/rml-io/RMLSTC0007b/README.md b/src/test/resources/rml-io/RMLSTC0007b/README.md new file mode 100644 index 00000000..90d9e4b9 --- /dev/null +++ b/src/test/resources/rml-io/RMLSTC0007b/README.md @@ -0,0 +1,72 @@ +## RMLSTC0007b + +**Title**: Source with CSV reference formulation + +**Description**: Test source with Tabular reference formulation + +**Error expected?** No + +**Input** +``` +id,name,age +0,Monica Geller,33 +1,Rachel Green,34 +2,Joey Tribbiani,35 +3,Chandler Bing,36 +4,Ross Geller,37 + +``` + +**Mapping** +``` +@prefix rml: . +@prefix foaf: . +@prefix xsd: . +@base . + +<#TriplesMap> a rml:TriplesMap; + rml:logicalSource [ a rml:LogicalSource; + rml:source [ a rml:FilePath; + rml:root rml:MappingDirectory; + rml:path "Friends.csv"; + ]; + rml:referenceFormulation rml:CSV; + ]; + rml:subjectMap [ a rml:SubjectMap; + rml:template "http://example.org/{id}"; + ]; + rml:predicateObjectMap [ a rml:PredicateObjectMap; + rml:predicateMap [ a rml:PredicateMap; + rml:constant foaf:name; + ]; + rml:objectMap [ a rml:ObjectMap; + rml:reference "name"; + ]; + ]; + rml:predicateObjectMap [ a rml:PredicateObjectMap; + rml:predicateMap [ a rml:PredicateMap; + rml:constant foaf:age; + ]; + rml:objectMap [ a rml:ObjectMap; + rml:reference "age"; + ]; + ]; +. + +``` + +**Output** +``` + "33" . + "Monica Geller" . + "34" . + "Rachel Green" . + "35" . + "Joey Tribbiani" . + "36" . + "Chandler Bing" . + "37" . + "Ross Geller" . + +``` + diff --git a/src/test/resources/rml-io/RMLSTC0007b/default.nq b/src/test/resources/rml-io/RMLSTC0007b/default.nq index d9456768..63f28ff8 100644 --- a/src/test/resources/rml-io/RMLSTC0007b/default.nq +++ b/src/test/resources/rml-io/RMLSTC0007b/default.nq @@ -1,10 +1,10 @@ - "33" . + "33"^^ . "Monica Geller" . - "34" . + "34"^^ . "Rachel Green" . - "35" . + "35"^^ . "Joey Tribbiani" . - "36" . + "36"^^ . "Chandler Bing" . - "37" . + "37"^^ . "Ross Geller" . diff --git a/src/test/resources/rml-io/RMLSTC0007b/mapping.ttl b/src/test/resources/rml-io/RMLSTC0007b/mapping.ttl index 1fe26eb4..a1771888 100644 --- a/src/test/resources/rml-io/RMLSTC0007b/mapping.ttl +++ b/src/test/resources/rml-io/RMLSTC0007b/mapping.ttl @@ -1,21 +1,15 @@ @prefix rml: . @prefix foaf: . -@prefix csvw: . @prefix xsd: . @base . -<#CSVWSourceAccess> a rml:Source, csvw:Table; - csvw:url "http://w3id.org/rml/resources/rml-io/RMLSTC0007b/Friends.csv"^^xsd:anyURI ; - csvw:dialect [ a csvw:Dialect; - csvw:delimiter ";"; - csvw:encoding "UTF-8"; - csvw:header "1"^^xsd:boolean; - ]; -. - <#TriplesMap> a rml:TriplesMap; rml:logicalSource [ a rml:LogicalSource; - rml:source <#CSVWSourceAccess>; + rml:source [ a rml:FilePath; + rml:root rml:MappingDirectory; + rml:path "Friends.csv"; + ]; + rml:referenceFormulation rml:CSV; ]; rml:subjectMap [ a rml:SubjectMap; rml:template "http://example.org/{id}"; diff --git a/src/test/resources/rml-io/RMLSTC0007c/README.md b/src/test/resources/rml-io/RMLSTC0007c/README.md new file mode 100644 index 00000000..234696f6 --- /dev/null +++ b/src/test/resources/rml-io/RMLSTC0007c/README.md @@ -0,0 +1,88 @@ +## RMLSTC0007c + +**Title**: Source with XPath reference formulation + +**Description**: Test source with XPath reference formulation + +**Error expected?** No + +**Input** +``` + + + Monica Geller + 33 + + + Rachel Green + 34 + + + Joey Tribbiani + 35 + + + Chandler Bing + 36 + + + Ross Geller + 37 + + + +``` + +**Mapping** +``` +@prefix rml: . +@prefix foaf: . +@base . + +<#TriplesMap> a rml:TriplesMap; + rml:logicalSource [ a rml:LogicalSource; + rml:source [ a rml:FilePath; + rml:root rml:MappingDirectory; + rml:path "Friends.xml" + ]; + rml:referenceFormulation rml:XPath; + rml:iterator "//Friends/Character"; + ]; + rml:subjectMap [ a rml:SubjectMap; + rml:template "http://example.org/{@id}"; + ]; + rml:predicateObjectMap [ a rml:PredicateObjectMap; + rml:predicateMap [ a rml:PredicateMap; + rml:constant foaf:name; + ]; + rml:objectMap [ a rml:ObjectMap; + rml:reference "name/text()"; + ]; + ]; + rml:predicateObjectMap [ a rml:PredicateObjectMap; + rml:predicateMap [ a rml:PredicateMap; + rml:constant foaf:age; + ]; + rml:objectMap [ a rml:ObjectMap; + rml:reference "age/text()"; + ]; + ]; +. + +``` + +**Output** +``` + "33" . + "Monica Geller" . + "34" . + "Rachel Green" . + "35" . + "Joey Tribbiani" . + "36" . + "Chandler Bing" . + "37" . + "Ross Geller" . + +``` + diff --git a/src/test/resources/rml-io/RMLSTC0007c/default.nq b/src/test/resources/rml-io/RMLSTC0007c/default.nq index d9456768..63f28ff8 100644 --- a/src/test/resources/rml-io/RMLSTC0007c/default.nq +++ b/src/test/resources/rml-io/RMLSTC0007c/default.nq @@ -1,10 +1,10 @@ - "33" . + "33"^^ . "Monica Geller" . - "34" . + "34"^^ . "Rachel Green" . - "35" . + "35"^^ . "Joey Tribbiani" . - "36" . + "36"^^ . "Chandler Bing" . - "37" . + "37"^^ . "Ross Geller" . diff --git a/src/test/resources/rml-io/RMLSTC0007c/mapping.ttl b/src/test/resources/rml-io/RMLSTC0007c/mapping.ttl index 96be1a3f..a4373532 100644 --- a/src/test/resources/rml-io/RMLSTC0007c/mapping.ttl +++ b/src/test/resources/rml-io/RMLSTC0007c/mapping.ttl @@ -1,15 +1,13 @@ @prefix rml: . @prefix foaf: . -@prefix dcat: . @base . -<#DCATSourceAccess> a rml:Source, dcat:Distribution; - dcat:downloadURL ; -. - <#TriplesMap> a rml:TriplesMap; rml:logicalSource [ a rml:LogicalSource; - rml:source <#DCATSourceAccess>; + rml:source [ a rml:FilePath; + rml:root rml:MappingDirectory; + rml:path "Friends.xml" + ]; rml:referenceFormulation rml:XPath; rml:iterator "//Friends/Character"; ]; diff --git a/src/test/resources/rml-io/RMLSTC0007d/README.md b/src/test/resources/rml-io/RMLSTC0007d/README.md new file mode 100644 index 00000000..ce969228 --- /dev/null +++ b/src/test/resources/rml-io/RMLSTC0007d/README.md @@ -0,0 +1,93 @@ +## RMLSTC0007d + +**Title**: Source with XPath reference formulation with namespaces + +**Description**: Test source with XPath reference formulation with namespaces + +**Error expected?** No + +**Input** +``` + + + Monica Geller + 33 + + + Rachel Green + 34 + + + Joey Tribbiani + 35 + + + Chandler Bing + 36 + + + Ross Geller + 37 + + + +``` + +**Mapping** +``` +@prefix rml: . +@prefix foaf: . +@base . + +<#TriplesMap> a rml:TriplesMap; + rml:logicalSource [ a rml:LogicalSource; + rml:source [ a rml:FilePath; + rml:root rml:MappingDirectory; + rml:path "Friends.xml" + ]; + rml:referenceFormulation [ a rml:XPathReferenceFormulation; + rml:namespace [ a rml:Namespace; + rml:namespacePrefix "ex"; + rml:namespaceURL "http://example.org"; + ]; + ]; + rml:iterator "//Friends/ex:Character"; + ]; + rml:subjectMap [ a rml:SubjectMap; + rml:template "http://example.org/{@id}"; + ]; + rml:predicateObjectMap [ a rml:PredicateObjectMap; + rml:predicateMap [ a rml:PredicateMap; + rml:constant foaf:name; + ]; + rml:objectMap [ a rml:ObjectMap; + rml:reference "ex:name/text()"; + ]; + ]; + rml:predicateObjectMap [ a rml:PredicateObjectMap; + rml:predicateMap [ a rml:PredicateMap; + rml:constant foaf:age; + ]; + rml:objectMap [ a rml:ObjectMap; + rml:reference "ex:age/text()"; + ]; + ]; +. + +``` + +**Output** +``` + "33" . + "Monica Geller" . + "34" . + "Rachel Green" . + "35" . + "Joey Tribbiani" . + "36" . + "Chandler Bing" . + "37" . + "Ross Geller" . + +``` + diff --git a/src/test/resources/rml-io/RMLSTC0007d/default.nq b/src/test/resources/rml-io/RMLSTC0007d/default.nq index d9456768..63f28ff8 100644 --- a/src/test/resources/rml-io/RMLSTC0007d/default.nq +++ b/src/test/resources/rml-io/RMLSTC0007d/default.nq @@ -1,10 +1,10 @@ - "33" . + "33"^^ . "Monica Geller" . - "34" . + "34"^^ . "Rachel Green" . - "35" . + "35"^^ . "Joey Tribbiani" . - "36" . + "36"^^ . "Chandler Bing" . - "37" . + "37"^^ . "Ross Geller" . diff --git a/src/test/resources/rml-io/RMLSTC0007d/mapping.ttl b/src/test/resources/rml-io/RMLSTC0007d/mapping.ttl index 3fd52498..14f45ed2 100644 --- a/src/test/resources/rml-io/RMLSTC0007d/mapping.ttl +++ b/src/test/resources/rml-io/RMLSTC0007d/mapping.ttl @@ -1,15 +1,13 @@ @prefix rml: . @prefix foaf: . -@prefix dcat: . @base . -<#DCATSourceAccess> a rml:Source, dcat:Distribution; - dcat:downloadURL ; -. - <#TriplesMap> a rml:TriplesMap; rml:logicalSource [ a rml:LogicalSource; - rml:source <#DCATSourceAccess>; + rml:source [ a rml:FilePath; + rml:root rml:MappingDirectory; + rml:path "Friends.xml" + ]; rml:referenceFormulation [ a rml:XPathReferenceFormulation; rml:namespace [ a rml:Namespace; rml:namespacePrefix "ex"; diff --git a/src/test/resources/rml-io/RMLSTC0006a/Friends.json b/src/test/resources/rml-io/RMLSTC0008a/Friends.json similarity index 100% rename from src/test/resources/rml-io/RMLSTC0006a/Friends.json rename to src/test/resources/rml-io/RMLSTC0008a/Friends.json diff --git a/src/test/resources/rml-io/RMLSTC0008a/Friends2.json b/src/test/resources/rml-io/RMLSTC0008a/Friends2.json new file mode 100644 index 00000000..415235fa --- /dev/null +++ b/src/test/resources/rml-io/RMLSTC0008a/Friends2.json @@ -0,0 +1,7 @@ +[ + { + "id": 6, + "name": "Phoebe Buffay", + "age": 37 + } +] diff --git a/src/test/resources/rml-io/RMLSTC0008a/README.md b/src/test/resources/rml-io/RMLSTC0008a/README.md new file mode 100644 index 00000000..20e36b20 --- /dev/null +++ b/src/test/resources/rml-io/RMLSTC0008a/README.md @@ -0,0 +1,127 @@ +## RMLSTC0008a + +**Title**: Multiple sources of same type + +**Description**: Tests the generation of all triples from multiple homogeneous sources + +**Error expected?** No + +**Input** +``` +[ + { + "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 + } +] + +``` + +**Mapping** +``` +@prefix rml: . +@prefix foaf: . +@base . + +<#TriplesMap> a rml:TriplesMap; + rml:logicalSource [ a rml:LogicalSource; + rml:source [ a rml:FilePath; + rml:root rml:MappingDirectory; + rml:path "Friends.json"; + rml:encoding rml:UTF-8 + ]; + rml:referenceFormulation rml:JSONPath; + rml:iterator "$[*]"; + ]; + rml:subjectMap [ a rml:SubjectMap; + rml:template "http://example.org/{$.id}"; + ]; + rml:predicateObjectMap [ a rml:PredicateObjectMap; + rml:predicateMap [ a rml:PredicateMap; + rml:constant foaf:name; + ]; + rml:objectMap [ a rml:ObjectMap; + rml:reference "$.name"; + ]; + ]; + rml:predicateObjectMap [ a rml:PredicateObjectMap; + rml:predicateMap [ a rml:PredicateMap; + rml:constant foaf:age; + ]; + rml:objectMap [ a rml:ObjectMap; + rml:reference "$.age"; + ]; + ]; +. + +<#TriplesMap2> a rml:TriplesMap; + rml:logicalSource [ a rml:LogicalSource; + rml:source [ a rml:RelativePathSource; + rml:root rml:MappingDirectory; + rml:path "Friends2.json"; + rml:encoding rml:UTF-8 + ]; + rml:referenceFormulation rml:JSONPath; + rml:iterator "$[*]"; + ]; + rml:subjectMap [ a rml:SubjectMap; + rml:template "http://example.org/{$.id}"; + ]; + rml:predicateObjectMap [ a rml:PredicateObjectMap; + rml:predicateMap [ a rml:PredicateMap; + rml:constant foaf:name; + ]; + rml:objectMap [ a rml:ObjectMap; + rml:reference "$.name"; + ]; + ]; + rml:predicateObjectMap [ a rml:PredicateObjectMap; + rml:predicateMap [ a rml:PredicateMap; + rml:constant foaf:age; + ]; + rml:objectMap [ a rml:ObjectMap; + rml:reference "$.age"; + ]; + ]; +. + +``` + +**Output** +``` + "33" . + "Monica Geller" . + "34" . + "Rachel Green" . + "35" . + "Joey Tribbiani" . + "36" . + "Chandler Bing" . + "37" . + "Ross Geller" . + "37" . + "Phoebe Buffay" . + +``` + diff --git a/src/test/resources/rml-io/RMLSTC0008a/default.nq b/src/test/resources/rml-io/RMLSTC0008a/default.nq new file mode 100644 index 00000000..8751f412 --- /dev/null +++ b/src/test/resources/rml-io/RMLSTC0008a/default.nq @@ -0,0 +1,12 @@ + "33"^^ . + "Monica Geller" . + "34"^^ . + "Rachel Green" . + "35"^^ . + "Joey Tribbiani" . + "36"^^ . + "Chandler Bing" . + "37"^^ . + "Ross Geller" . + "37"^^ . + "Phoebe Buffay" . diff --git a/src/test/resources/rml-io/RMLSTC0008a/mapping.ttl b/src/test/resources/rml-io/RMLSTC0008a/mapping.ttl new file mode 100644 index 00000000..1b53bd1d --- /dev/null +++ b/src/test/resources/rml-io/RMLSTC0008a/mapping.ttl @@ -0,0 +1,65 @@ +@prefix rml: . +@prefix foaf: . +@base . + +<#TriplesMap> a rml:TriplesMap; + rml:logicalSource [ a rml:LogicalSource; + rml:source [ a rml:FilePath; + rml:root rml:MappingDirectory; + rml:path "Friends.json"; + rml:encoding rml:UTF-8 + ]; + rml:referenceFormulation rml:JSONPath; + rml:iterator "$[*]"; + ]; + rml:subjectMap [ a rml:SubjectMap; + rml:template "http://example.org/{$.id}"; + ]; + rml:predicateObjectMap [ a rml:PredicateObjectMap; + rml:predicateMap [ a rml:PredicateMap; + rml:constant foaf:name; + ]; + rml:objectMap [ a rml:ObjectMap; + rml:reference "$.name"; + ]; + ]; + rml:predicateObjectMap [ a rml:PredicateObjectMap; + rml:predicateMap [ a rml:PredicateMap; + rml:constant foaf:age; + ]; + rml:objectMap [ a rml:ObjectMap; + rml:reference "$.age"; + ]; + ]; +. + +<#TriplesMap2> a rml:TriplesMap; + rml:logicalSource [ a rml:LogicalSource; + rml:source [ a rml:RelativePathSource; + rml:root rml:MappingDirectory; + rml:path "Friends2.json"; + rml:encoding rml:UTF-8 + ]; + rml:referenceFormulation rml:JSONPath; + rml:iterator "$[*]"; + ]; + rml:subjectMap [ a rml:SubjectMap; + rml:template "http://example.org/{$.id}"; + ]; + rml:predicateObjectMap [ a rml:PredicateObjectMap; + rml:predicateMap [ a rml:PredicateMap; + rml:constant foaf:name; + ]; + rml:objectMap [ a rml:ObjectMap; + rml:reference "$.name"; + ]; + ]; + rml:predicateObjectMap [ a rml:PredicateObjectMap; + rml:predicateMap [ a rml:PredicateMap; + rml:constant foaf:age; + ]; + rml:objectMap [ a rml:ObjectMap; + rml:reference "$.age"; + ]; + ]; +. diff --git a/src/test/resources/rml-io/RMLSTC0008b/Friends.csv b/src/test/resources/rml-io/RMLSTC0008b/Friends.csv new file mode 100644 index 00000000..69665237 --- /dev/null +++ b/src/test/resources/rml-io/RMLSTC0008b/Friends.csv @@ -0,0 +1,2 @@ +id,name,age +6,Phoebe Buffay,37 \ No newline at end of file diff --git a/src/test/resources/rml-io/RMLSTC0006e/Friends.json b/src/test/resources/rml-io/RMLSTC0008b/Friends.json similarity index 100% rename from src/test/resources/rml-io/RMLSTC0006e/Friends.json rename to src/test/resources/rml-io/RMLSTC0008b/Friends.json diff --git a/src/test/resources/rml-io/RMLSTC0008b/README.md b/src/test/resources/rml-io/RMLSTC0008b/README.md new file mode 100644 index 00000000..18fea470 --- /dev/null +++ b/src/test/resources/rml-io/RMLSTC0008b/README.md @@ -0,0 +1,126 @@ +## RMLSTC0008b + +**Title**: Multiple sources of different type + +**Description**: Tests the generation of all triples from multiple heterogeneous sources + +**Error expected?** No + +**Input** +``` +[ + { + "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 + } +] + +``` + +**Mapping** +``` +@prefix rml: . +@prefix foaf: . +@base . + +<#TriplesMap> a rml:TriplesMap; + rml:logicalSource [ a rml:LogicalSource; + rml:source [ a rml:FilePath; + rml:root rml:MappingDirectory; + rml:path "Friends.json"; + rml:encoding rml:UTF-8 + ]; + rml:referenceFormulation rml:JSONPath; + rml:iterator "$[*]"; + ]; + rml:subjectMap [ a rml:SubjectMap; + rml:template "http://example.org/{$.id}"; + ]; + rml:predicateObjectMap [ a rml:PredicateObjectMap; + rml:predicateMap [ a rml:PredicateMap; + rml:constant foaf:name; + ]; + rml:objectMap [ a rml:ObjectMap; + rml:reference "$.name"; + ]; + ]; + rml:predicateObjectMap [ a rml:PredicateObjectMap; + rml:predicateMap [ a rml:PredicateMap; + rml:constant foaf:age; + ]; + rml:objectMap [ a rml:ObjectMap; + rml:reference "$.age"; + ]; + ]; +. + +<#TriplesMap2> a rml:TriplesMap; + rml:logicalSource [ a rml:LogicalSource; + rml:source [ a rml:RelativePathSource; + rml:root rml:MappingDirectory; + rml:path "Friends.csv"; + rml:encoding rml:UTF-8 + ]; + rml:referenceFormulation rml:CSV; + ]; + rml:subjectMap [ a rml:SubjectMap; + rml:template "http://example.org/{id}"; + ]; + rml:predicateObjectMap [ a rml:PredicateObjectMap; + rml:predicateMap [ a rml:PredicateMap; + rml:constant foaf:name; + ]; + rml:objectMap [ a rml:ObjectMap; + rml:reference "name"; + ]; + ]; + rml:predicateObjectMap [ a rml:PredicateObjectMap; + rml:predicateMap [ a rml:PredicateMap; + rml:constant foaf:age; + ]; + rml:objectMap [ a rml:ObjectMap; + rml:reference "age"; + ]; + ]; +. + +``` + +**Output** +``` + "33" . + "Monica Geller" . + "34" . + "Rachel Green" . + "35" . + "Joey Tribbiani" . + "36" . + "Chandler Bing" . + "37" . + "Ross Geller" . + "37" . + "Phoebe Buffay" . + +``` + diff --git a/src/test/resources/rml-io/RMLSTC0008b/default.nq b/src/test/resources/rml-io/RMLSTC0008b/default.nq new file mode 100644 index 00000000..8751f412 --- /dev/null +++ b/src/test/resources/rml-io/RMLSTC0008b/default.nq @@ -0,0 +1,12 @@ + "33"^^ . + "Monica Geller" . + "34"^^ . + "Rachel Green" . + "35"^^ . + "Joey Tribbiani" . + "36"^^ . + "Chandler Bing" . + "37"^^ . + "Ross Geller" . + "37"^^ . + "Phoebe Buffay" . diff --git a/src/test/resources/rml-io/RMLSTC0008b/mapping.ttl b/src/test/resources/rml-io/RMLSTC0008b/mapping.ttl new file mode 100644 index 00000000..8fd68c4d --- /dev/null +++ b/src/test/resources/rml-io/RMLSTC0008b/mapping.ttl @@ -0,0 +1,64 @@ +@prefix rml: . +@prefix foaf: . +@base . + +<#TriplesMap> a rml:TriplesMap; + rml:logicalSource [ a rml:LogicalSource; + rml:source [ a rml:FilePath; + rml:root rml:MappingDirectory; + rml:path "Friends.json"; + rml:encoding rml:UTF-8 + ]; + rml:referenceFormulation rml:JSONPath; + rml:iterator "$[*]"; + ]; + rml:subjectMap [ a rml:SubjectMap; + rml:template "http://example.org/{$.id}"; + ]; + rml:predicateObjectMap [ a rml:PredicateObjectMap; + rml:predicateMap [ a rml:PredicateMap; + rml:constant foaf:name; + ]; + rml:objectMap [ a rml:ObjectMap; + rml:reference "$.name"; + ]; + ]; + rml:predicateObjectMap [ a rml:PredicateObjectMap; + rml:predicateMap [ a rml:PredicateMap; + rml:constant foaf:age; + ]; + rml:objectMap [ a rml:ObjectMap; + rml:reference "$.age"; + ]; + ]; +. + +<#TriplesMap2> a rml:TriplesMap; + rml:logicalSource [ a rml:LogicalSource; + rml:source [ a rml:RelativePathSource; + rml:root rml:MappingDirectory; + rml:path "Friends.csv"; + rml:encoding rml:UTF-8 + ]; + rml:referenceFormulation rml:CSV; + ]; + rml:subjectMap [ a rml:SubjectMap; + rml:template "http://example.org/{id}"; + ]; + rml:predicateObjectMap [ a rml:PredicateObjectMap; + rml:predicateMap [ a rml:PredicateMap; + rml:constant foaf:name; + ]; + rml:objectMap [ a rml:ObjectMap; + rml:reference "name"; + ]; + ]; + rml:predicateObjectMap [ a rml:PredicateObjectMap; + rml:predicateMap [ a rml:PredicateMap; + rml:constant foaf:age; + ]; + rml:objectMap [ a rml:ObjectMap; + rml:reference "age"; + ]; + ]; +. diff --git a/src/test/resources/rml-io/RMLSTC0009a/Friends.csv b/src/test/resources/rml-io/RMLSTC0009a/Friends.csv new file mode 100644 index 00000000..66cc9dcc --- /dev/null +++ b/src/test/resources/rml-io/RMLSTC0009a/Friends.csv @@ -0,0 +1,6 @@ +"id","name","age" +0,Monica Geller,33 +1,Rachel Green,34 +2,Joey Tribbiani,35 +3,Chandler Bing,36 +4,Ross Geller,37 diff --git a/src/test/resources/rml-io/RMLSTC0009a/README.md b/src/test/resources/rml-io/RMLSTC0009a/README.md new file mode 100644 index 00000000..e8d8a64e --- /dev/null +++ b/src/test/resources/rml-io/RMLSTC0009a/README.md @@ -0,0 +1,57 @@ +## RMLSTC0009a + +**Title**: Source with quoted columns + +**Description**: Tests the generation of triples where columns are quoted + +**Error expected?** Yes + +**Input** +``` +"id","name","age" +0,Monica Geller,33 +1,Rachel Green,34 +2,Joey Tribbiani,35 +3,Chandler Bing,36 +4,Ross Geller,37 + +``` + +**Mapping** +``` +@prefix rml: . +@prefix foaf: . +@prefix xsd: . +@base . + +<#TriplesMap> a rml:TriplesMap; + rml:logicalSource [ a rml:LogicalSource; + rml:source [ a rml:FilePath; + rml:root rml:MappingDirectory; + rml:path "Friends.csv"; + ]; + rml:referenceFormulation rml:CSV; + ]; + rml:subjectMap [ a rml:SubjectMap; + rml:template "http://example.org/{id}"; + ]; + rml:predicateObjectMap [ a rml:PredicateObjectMap; + rml:predicateMap [ a rml:PredicateMap; + rml:constant foaf:name; + ]; + rml:objectMap [ a rml:ObjectMap; + rml:reference "name"; + ]; + ]; + rml:predicateObjectMap [ a rml:PredicateObjectMap; + rml:predicateMap [ a rml:PredicateMap; + rml:constant foaf:age; + ]; + rml:objectMap [ a rml:ObjectMap; + rml:reference "age"; + ]; + ]; +. + +``` + diff --git a/src/test/resources/rml-io/RMLSTC0009a/mapping.ttl b/src/test/resources/rml-io/RMLSTC0009a/mapping.ttl new file mode 100644 index 00000000..a1771888 --- /dev/null +++ b/src/test/resources/rml-io/RMLSTC0009a/mapping.ttl @@ -0,0 +1,33 @@ +@prefix rml: . +@prefix foaf: . +@prefix xsd: . +@base . + +<#TriplesMap> a rml:TriplesMap; + rml:logicalSource [ a rml:LogicalSource; + rml:source [ a rml:FilePath; + rml:root rml:MappingDirectory; + rml:path "Friends.csv"; + ]; + rml:referenceFormulation rml:CSV; + ]; + rml:subjectMap [ a rml:SubjectMap; + rml:template "http://example.org/{id}"; + ]; + rml:predicateObjectMap [ a rml:PredicateObjectMap; + rml:predicateMap [ a rml:PredicateMap; + rml:constant foaf:name; + ]; + rml:objectMap [ a rml:ObjectMap; + rml:reference "name"; + ]; + ]; + rml:predicateObjectMap [ a rml:PredicateObjectMap; + rml:predicateMap [ a rml:PredicateMap; + rml:constant foaf:age; + ]; + rml:objectMap [ a rml:ObjectMap; + rml:reference "age"; + ]; + ]; +. diff --git a/src/test/resources/rml-io/RMLSTC0005a/default.nq b/src/test/resources/rml-io/RMLSTC0009a/output.nq similarity index 100% rename from src/test/resources/rml-io/RMLSTC0005a/default.nq rename to src/test/resources/rml-io/RMLSTC0009a/output.nq diff --git a/src/test/resources/rml-io/RMLSTC0010a/Friends.csv b/src/test/resources/rml-io/RMLSTC0010a/Friends.csv new file mode 100644 index 00000000..1b386cf0 --- /dev/null +++ b/src/test/resources/rml-io/RMLSTC0010a/Friends.csv @@ -0,0 +1,2 @@ +id,name,age +6,Phoebe Buffay 37 diff --git a/src/test/resources/rml-io/RMLSTC0010a/README.md b/src/test/resources/rml-io/RMLSTC0010a/README.md new file mode 100644 index 00000000..d960a59b --- /dev/null +++ b/src/test/resources/rml-io/RMLSTC0010a/README.md @@ -0,0 +1,52 @@ +## RMLSTC0010a + +**Title**: Invalid CSV source, reference to invalid column + +**Description**: Tests the identification of invalid CSV sources + +**Error expected?** Yes + +**Input** +``` +id,name,age +6,Phoebe Buffay 37 + +``` + +**Mapping** +``` +@prefix rml: . +@prefix foaf: . +@prefix xsd: . +@base . + +<#TriplesMap2> a rml:TriplesMap; + rml:logicalSource [ a rml:LogicalSource; + rml:source [ a rml:FilePath; + rml:root rml:MappingDirectory; + rml:path "Friends.csv"; + ]; + rml:referenceFormulation rml:CSV; + ]; + rml:subjectMap [ a rml:SubjectMap; + rml:template "http://example.org/{id}"; + ]; + rml:predicateObjectMap [ a rml:PredicateObjectMap; + rml:predicateMap [ a rml:PredicateMap; + rml:constant foaf:name; + ]; + rml:objectMap [ a rml:ObjectMap; + rml:reference "name"; + ]; + ]; + rml:predicateObjectMap [ a rml:PredicateObjectMap; + rml:predicateMap [ a rml:PredicateMap; + rml:constant foaf:age; + ]; + rml:objectMap [ a rml:ObjectMap; + rml:reference "age"; + ]; + ]. + +``` + diff --git a/src/test/resources/rml-io/RMLSTC0010a/mapping.ttl b/src/test/resources/rml-io/RMLSTC0010a/mapping.ttl new file mode 100644 index 00000000..84392963 --- /dev/null +++ b/src/test/resources/rml-io/RMLSTC0010a/mapping.ttl @@ -0,0 +1,32 @@ +@prefix rml: . +@prefix foaf: . +@prefix xsd: . +@base . + +<#TriplesMap2> a rml:TriplesMap; + rml:logicalSource [ a rml:LogicalSource; + rml:source [ a rml:FilePath; + rml:root rml:MappingDirectory; + rml:path "Friends.csv"; + ]; + rml:referenceFormulation rml:CSV; + ]; + rml:subjectMap [ a rml:SubjectMap; + rml:template "http://example.org/{id}"; + ]; + rml:predicateObjectMap [ a rml:PredicateObjectMap; + rml:predicateMap [ a rml:PredicateMap; + rml:constant foaf:name; + ]; + rml:objectMap [ a rml:ObjectMap; + rml:reference "name"; + ]; + ]; + rml:predicateObjectMap [ a rml:PredicateObjectMap; + rml:predicateMap [ a rml:PredicateMap; + rml:constant foaf:age; + ]; + rml:objectMap [ a rml:ObjectMap; + rml:reference "age"; + ]; + ]. diff --git a/src/test/resources/rml-io/RMLSTC0010b/Friends.csv b/src/test/resources/rml-io/RMLSTC0010b/Friends.csv new file mode 100644 index 00000000..1b386cf0 --- /dev/null +++ b/src/test/resources/rml-io/RMLSTC0010b/Friends.csv @@ -0,0 +1,2 @@ +id,name,age +6,Phoebe Buffay 37 diff --git a/src/test/resources/rml-io/RMLSTC0010b/README.md b/src/test/resources/rml-io/RMLSTC0010b/README.md new file mode 100644 index 00000000..83bee15a --- /dev/null +++ b/src/test/resources/rml-io/RMLSTC0010b/README.md @@ -0,0 +1,44 @@ +## RMLSTC0010b + +**Title**: Invalid CSV source, no reference to invalid column + +**Description**: Tests the identification of invalid CSV sources, even when all columns referenced are valid + +**Error expected?** Yes + +**Input** +``` +id,name,age +6,Phoebe Buffay 37 + +``` + +**Mapping** +``` +@prefix rml: . +@prefix foaf: . +@prefix xsd: . +@base . + +<#TriplesMap2> a rml:TriplesMap; + rml:logicalSource [ a rml:LogicalSource; + rml:source [ a rml:FilePath; + rml:root rml:MappingDirectory; + rml:path "Friends.csv"; + ]; + rml:referenceFormulation rml:CSV; + ]; + rml:subjectMap [ a rml:SubjectMap; + rml:template "http://example.org/{id}"; + ]; + rml:predicateObjectMap [ a rml:PredicateObjectMap; + rml:predicateMap [ a rml:PredicateMap; + rml:constant foaf:name; + ]; + rml:objectMap [ a rml:ObjectMap; + rml:reference "name"; + ]; + ]. + +``` + diff --git a/src/test/resources/rml-io/RMLSTC0010b/mapping.ttl b/src/test/resources/rml-io/RMLSTC0010b/mapping.ttl new file mode 100644 index 00000000..d4e5fe58 --- /dev/null +++ b/src/test/resources/rml-io/RMLSTC0010b/mapping.ttl @@ -0,0 +1,24 @@ +@prefix rml: . +@prefix foaf: . +@prefix xsd: . +@base . + +<#TriplesMap2> a rml:TriplesMap; + rml:logicalSource [ a rml:LogicalSource; + rml:source [ a rml:FilePath; + rml:root rml:MappingDirectory; + rml:path "Friends.csv"; + ]; + rml:referenceFormulation rml:CSV; + ]; + rml:subjectMap [ a rml:SubjectMap; + rml:template "http://example.org/{id}"; + ]; + rml:predicateObjectMap [ a rml:PredicateObjectMap; + rml:predicateMap [ a rml:PredicateMap; + rml:constant foaf:name; + ]; + rml:objectMap [ a rml:ObjectMap; + rml:reference "name"; + ]; + ]. diff --git a/src/test/resources/rml-io/RMLSTC0011a/README.md b/src/test/resources/rml-io/RMLSTC0011a/README.md new file mode 100644 index 00000000..bf4cdbed --- /dev/null +++ b/src/test/resources/rml-io/RMLSTC0011a/README.md @@ -0,0 +1,48 @@ +## RMLSTC0011a + +**Title**: Complex JSON source + +**Description**: Tests the generation of triples from complex JSON sources + +**Error expected?** No + +**Input** + [http://w3id.org/rml/resources/rml-io/RMLSTC0011a/Friends.json](http://w3id.org/rml/resources/rml-io/RMLSTC0011a/Friends.json) + +**Mapping** +``` +@prefix rml: . +@prefix foaf: . +@prefix xsd: . +@base . + +<#TriplesMap2> a rml:TriplesMap; + rml:logicalSource [ a rml:LogicalSource; + rml:source [ a rml:FilePath; + rml:root rml:MappingDirectory; + rml:path "companies.json"; + ]; + rml:referenceFormulation rml:JSONPath; + rml:iterator "$.companies[*]"; + ]; + rml:subjectMap [ a rml:SubjectMap; + rml:template "http://example.org/{name}"; + ]; + rml:predicateObjectMap [ a rml:PredicateObjectMap; + rml:predicateMap [ a rml:PredicateMap; + rml:constant foaf:name; + ]; + rml:objectMap [ a rml:ObjectMap; + rml:reference "$.name"; + ]; + ]. + +``` + +**Output** +``` + "InnovateX" . + "TechCorp" . + +``` + diff --git a/src/test/resources/rml-io/RMLSTC0011a/companies.json b/src/test/resources/rml-io/RMLSTC0011a/companies.json new file mode 100644 index 00000000..28355038 --- /dev/null +++ b/src/test/resources/rml-io/RMLSTC0011a/companies.json @@ -0,0 +1,91 @@ +{ + "companies": [ + { + "name": "TechCorp", + "location": { + "country": "USA", + "state": "California", + "city": "San Francisco" + }, + "departments": [ + { + "name": "Engineering", + "manager": { + "name": "Alice Johnson", + "age": 42 + }, + "employees": [ + { + "name": "Bob Smith", + "role": "Software Engineer", + "skills": ["Python", "JavaScript", "AWS"] + }, + { + "name": "Eve Davis", + "role": "DevOps Engineer", + "skills": ["Docker", "Kubernetes", "Terraform"] + } + ] + }, + { + "name": "Marketing", + "manager": { + "name": "John Doe", + "age": 39 + }, + "employees": [ + { + "name": "Sarah Lee", + "role": "Marketing Specialist", + "skills": ["SEO", "Google Ads", "Copywriting"] + } + ] + } + ] + }, + { + "name": "InnovateX", + "location": { + "country": "Canada", + "state": "Ontario", + "city": "Toronto" + }, + "departments": [ + { + "name": "Research & Development", + "manager": { + "name": "Emma Wilson", + "age": 45 + }, + "employees": [ + { + "name": "Liam Brown", + "role": "AI Researcher", + "skills": ["Machine Learning", "Deep Learning", "Python"] + }, + { + "name": "Sophia White", + "role": "Data Scientist", + "skills": ["Data Analysis", "R", "SQL"] + } + ] + }, + { + "name": "Sales", + "manager": { + "name": "Michael Green", + "age": 38 + }, + "employees": [ + { + "name": "Olivia Martinez", + "role": "Sales Executive", + "skills": ["Negotiation", "CRM", "Lead Generation"] + } + ] + } + ] + } + ] + } + \ No newline at end of file diff --git a/src/test/resources/rml-io/RMLSTC0011a/default.nq b/src/test/resources/rml-io/RMLSTC0011a/default.nq new file mode 100644 index 00000000..77a21531 --- /dev/null +++ b/src/test/resources/rml-io/RMLSTC0011a/default.nq @@ -0,0 +1,2 @@ + "InnovateX" . + "TechCorp" . diff --git a/src/test/resources/rml-io/RMLSTC0011a/mapping.ttl b/src/test/resources/rml-io/RMLSTC0011a/mapping.ttl new file mode 100644 index 00000000..ac102a3b --- /dev/null +++ b/src/test/resources/rml-io/RMLSTC0011a/mapping.ttl @@ -0,0 +1,25 @@ +@prefix rml: . +@prefix foaf: . +@prefix xsd: . +@base . + +<#TriplesMap2> a rml:TriplesMap; + rml:logicalSource [ a rml:LogicalSource; + rml:source [ a rml:FilePath; + rml:root rml:MappingDirectory; + rml:path "companies.json"; + ]; + rml:referenceFormulation rml:JSONPath; + rml:iterator "$.companies[*]"; + ]; + rml:subjectMap [ a rml:SubjectMap; + rml:template "http://example.org/{name}"; + ]; + rml:predicateObjectMap [ a rml:PredicateObjectMap; + rml:predicateMap [ a rml:PredicateMap; + rml:constant foaf:name; + ]; + rml:objectMap [ a rml:ObjectMap; + rml:reference "$.name"; + ]; + ]. diff --git a/src/test/resources/rml-io/RMLSTC0011b/README.md b/src/test/resources/rml-io/RMLSTC0011b/README.md new file mode 100644 index 00000000..6a0f0bfc --- /dev/null +++ b/src/test/resources/rml-io/RMLSTC0011b/README.md @@ -0,0 +1,51 @@ +## RMLSTC0011b + +**Title**: Complex JSON source + +**Description**: Tests the generation of triples from complex JSON sources + +**Error expected?** No + +**Input** + [http://w3id.org/rml/resources/rml-io/RMLSTC0011b/Friends.json](http://w3id.org/rml/resources/rml-io/RMLSTC0011b/Friends.json) + +**Mapping** +``` +@prefix rml: . +@prefix foaf: . +@prefix xsd: . +@prefix ex: . +@base . + +<#TriplesMap2> a rml:TriplesMap; + rml:logicalSource [ a rml:LogicalSource; + rml:source [ a rml:FilePath; + rml:root rml:MappingDirectory; + rml:path "companies.json"; + ]; + rml:referenceFormulation rml:JSONPath; + rml:iterator "$.companies[*]"; + ]; + rml:subjectMap [ a rml:SubjectMap; + rml:template "http://example.org/{name}"; + ]; + rml:predicateObjectMap [ a rml:PredicateObjectMap; + rml:predicateMap [ a rml:PredicateMap; + rml:constant ex:department; + ]; + rml:objectMap [ a rml:ObjectMap; + rml:reference "$.departments[*].name"; + ]; + ]. + +``` + +**Output** +``` + "Research & Development" . + "Sales" . + "Engineering" . + "Marketing" . + +``` + diff --git a/src/test/resources/rml-io/RMLSTC0011b/companies.json b/src/test/resources/rml-io/RMLSTC0011b/companies.json new file mode 100644 index 00000000..28355038 --- /dev/null +++ b/src/test/resources/rml-io/RMLSTC0011b/companies.json @@ -0,0 +1,91 @@ +{ + "companies": [ + { + "name": "TechCorp", + "location": { + "country": "USA", + "state": "California", + "city": "San Francisco" + }, + "departments": [ + { + "name": "Engineering", + "manager": { + "name": "Alice Johnson", + "age": 42 + }, + "employees": [ + { + "name": "Bob Smith", + "role": "Software Engineer", + "skills": ["Python", "JavaScript", "AWS"] + }, + { + "name": "Eve Davis", + "role": "DevOps Engineer", + "skills": ["Docker", "Kubernetes", "Terraform"] + } + ] + }, + { + "name": "Marketing", + "manager": { + "name": "John Doe", + "age": 39 + }, + "employees": [ + { + "name": "Sarah Lee", + "role": "Marketing Specialist", + "skills": ["SEO", "Google Ads", "Copywriting"] + } + ] + } + ] + }, + { + "name": "InnovateX", + "location": { + "country": "Canada", + "state": "Ontario", + "city": "Toronto" + }, + "departments": [ + { + "name": "Research & Development", + "manager": { + "name": "Emma Wilson", + "age": 45 + }, + "employees": [ + { + "name": "Liam Brown", + "role": "AI Researcher", + "skills": ["Machine Learning", "Deep Learning", "Python"] + }, + { + "name": "Sophia White", + "role": "Data Scientist", + "skills": ["Data Analysis", "R", "SQL"] + } + ] + }, + { + "name": "Sales", + "manager": { + "name": "Michael Green", + "age": 38 + }, + "employees": [ + { + "name": "Olivia Martinez", + "role": "Sales Executive", + "skills": ["Negotiation", "CRM", "Lead Generation"] + } + ] + } + ] + } + ] + } + \ No newline at end of file diff --git a/src/test/resources/rml-io/RMLSTC0011b/default.nq b/src/test/resources/rml-io/RMLSTC0011b/default.nq new file mode 100644 index 00000000..600758be --- /dev/null +++ b/src/test/resources/rml-io/RMLSTC0011b/default.nq @@ -0,0 +1,4 @@ + "Research & Development" . + "Sales" . + "Engineering" . + "Marketing" . diff --git a/src/test/resources/rml-io/RMLSTC0011b/mapping.ttl b/src/test/resources/rml-io/RMLSTC0011b/mapping.ttl new file mode 100644 index 00000000..91a597ea --- /dev/null +++ b/src/test/resources/rml-io/RMLSTC0011b/mapping.ttl @@ -0,0 +1,26 @@ +@prefix rml: . +@prefix foaf: . +@prefix xsd: . +@prefix ex: . +@base . + +<#TriplesMap2> a rml:TriplesMap; + rml:logicalSource [ a rml:LogicalSource; + rml:source [ a rml:FilePath; + rml:root rml:MappingDirectory; + rml:path "companies.json"; + ]; + rml:referenceFormulation rml:JSONPath; + rml:iterator "$.companies[*]"; + ]; + rml:subjectMap [ a rml:SubjectMap; + rml:template "http://example.org/{name}"; + ]; + rml:predicateObjectMap [ a rml:PredicateObjectMap; + rml:predicateMap [ a rml:PredicateMap; + rml:constant ex:department; + ]; + rml:objectMap [ a rml:ObjectMap; + rml:reference "$.departments[*].name"; + ]; + ]. diff --git a/src/test/resources/rml-io/RMLSTC0011c/README.md b/src/test/resources/rml-io/RMLSTC0011c/README.md new file mode 100644 index 00000000..aed00dd3 --- /dev/null +++ b/src/test/resources/rml-io/RMLSTC0011c/README.md @@ -0,0 +1,53 @@ +## RMLSTC0011c + +**Title**: Complex JSON source + +**Description**: Tests the generation of triples from complex JSON sources + +**Error expected?** No + +**Input** + [http://w3id.org/rml/resources/rml-io/RMLSTC0011c/Friends.json](http://w3id.org/rml/resources/rml-io/RMLSTC0011c/Friends.json) + +**Mapping** +``` +@prefix rml: . +@prefix foaf: . +@prefix xsd: . +@prefix ex: . +@base . + +<#TriplesMap2> a rml:TriplesMap; + rml:logicalSource [ a rml:LogicalSource; + rml:source [ a rml:FilePath; + rml:root rml:MappingDirectory; + rml:path "companies.json"; + ]; + rml:referenceFormulation rml:JSONPath; + rml:iterator "$.companies[*]"; + ]; + rml:subjectMap [ a rml:SubjectMap; + rml:template "http://example.org/{name}"; + ]; + rml:predicateObjectMap [ a rml:PredicateObjectMap; + rml:predicateMap [ a rml:PredicateMap; + rml:constant ex:employee; + ]; + rml:objectMap [ a rml:ObjectMap; + rml:reference "$.departments[*].employees[*].name"; + ]; + ]. + +``` + +**Output** +``` + "Liam Brown" . + "Olivia Martinez" . + "Sophia White" . + "Bob Smith" . + "Eve Davis" . + "Sarah Lee" . + +``` + diff --git a/src/test/resources/rml-io/RMLSTC0011c/companies.json b/src/test/resources/rml-io/RMLSTC0011c/companies.json new file mode 100644 index 00000000..28355038 --- /dev/null +++ b/src/test/resources/rml-io/RMLSTC0011c/companies.json @@ -0,0 +1,91 @@ +{ + "companies": [ + { + "name": "TechCorp", + "location": { + "country": "USA", + "state": "California", + "city": "San Francisco" + }, + "departments": [ + { + "name": "Engineering", + "manager": { + "name": "Alice Johnson", + "age": 42 + }, + "employees": [ + { + "name": "Bob Smith", + "role": "Software Engineer", + "skills": ["Python", "JavaScript", "AWS"] + }, + { + "name": "Eve Davis", + "role": "DevOps Engineer", + "skills": ["Docker", "Kubernetes", "Terraform"] + } + ] + }, + { + "name": "Marketing", + "manager": { + "name": "John Doe", + "age": 39 + }, + "employees": [ + { + "name": "Sarah Lee", + "role": "Marketing Specialist", + "skills": ["SEO", "Google Ads", "Copywriting"] + } + ] + } + ] + }, + { + "name": "InnovateX", + "location": { + "country": "Canada", + "state": "Ontario", + "city": "Toronto" + }, + "departments": [ + { + "name": "Research & Development", + "manager": { + "name": "Emma Wilson", + "age": 45 + }, + "employees": [ + { + "name": "Liam Brown", + "role": "AI Researcher", + "skills": ["Machine Learning", "Deep Learning", "Python"] + }, + { + "name": "Sophia White", + "role": "Data Scientist", + "skills": ["Data Analysis", "R", "SQL"] + } + ] + }, + { + "name": "Sales", + "manager": { + "name": "Michael Green", + "age": 38 + }, + "employees": [ + { + "name": "Olivia Martinez", + "role": "Sales Executive", + "skills": ["Negotiation", "CRM", "Lead Generation"] + } + ] + } + ] + } + ] + } + \ No newline at end of file diff --git a/src/test/resources/rml-io/RMLSTC0011c/default.nq b/src/test/resources/rml-io/RMLSTC0011c/default.nq new file mode 100644 index 00000000..c83222b8 --- /dev/null +++ b/src/test/resources/rml-io/RMLSTC0011c/default.nq @@ -0,0 +1,6 @@ + "Liam Brown" . + "Olivia Martinez" . + "Sophia White" . + "Bob Smith" . + "Eve Davis" . + "Sarah Lee" . diff --git a/src/test/resources/rml-io/RMLSTC0011c/mapping.ttl b/src/test/resources/rml-io/RMLSTC0011c/mapping.ttl new file mode 100644 index 00000000..8c92295f --- /dev/null +++ b/src/test/resources/rml-io/RMLSTC0011c/mapping.ttl @@ -0,0 +1,26 @@ +@prefix rml: . +@prefix foaf: . +@prefix xsd: . +@prefix ex: . +@base . + +<#TriplesMap2> a rml:TriplesMap; + rml:logicalSource [ a rml:LogicalSource; + rml:source [ a rml:FilePath; + rml:root rml:MappingDirectory; + rml:path "companies.json"; + ]; + rml:referenceFormulation rml:JSONPath; + rml:iterator "$.companies[*]"; + ]; + rml:subjectMap [ a rml:SubjectMap; + rml:template "http://example.org/{name}"; + ]; + rml:predicateObjectMap [ a rml:PredicateObjectMap; + rml:predicateMap [ a rml:PredicateMap; + rml:constant ex:employee; + ]; + rml:objectMap [ a rml:ObjectMap; + rml:reference "$.departments[*].employees[*].name"; + ]; + ]. diff --git a/src/test/resources/rml-io/RMLSTC0011d/README.md b/src/test/resources/rml-io/RMLSTC0011d/README.md new file mode 100644 index 00000000..cb2caaf1 --- /dev/null +++ b/src/test/resources/rml-io/RMLSTC0011d/README.md @@ -0,0 +1,51 @@ +## RMLSTC0011d + +**Title**: Complex JSON source + +**Description**: Tests the generation of triples from complex JSON sources + +**Error expected?** No + +**Input** + [http://w3id.org/rml/resources/rml-io/RMLSTC0011d/Friends.json](http://w3id.org/rml/resources/rml-io/RMLSTC0011d/Friends.json) + +**Mapping** +``` +@prefix rml: . +@prefix foaf: . +@prefix xsd: . +@prefix ex: . +@base . + +<#TriplesMap2> a rml:TriplesMap; + rml:logicalSource [ a rml:LogicalSource; + rml:source [ a rml:FilePath; + rml:root rml:MappingDirectory; + rml:path "companies.json"; + ]; + rml:referenceFormulation rml:JSONPath; + rml:iterator "$.companies[*].departments[*]"; + ]; + rml:subjectMap [ a rml:SubjectMap; + rml:template "http://example.org/{name}"; + ]; + rml:predicateObjectMap [ a rml:PredicateObjectMap; + rml:predicateMap [ a rml:PredicateMap; + rml:constant foaf:name; + ]; + rml:objectMap [ a rml:ObjectMap; + rml:reference "$.manager.name"; + ]; + ]. + +``` + +**Output** +``` + "Alice Johnson" . + "John Doe" . + "Emma Wilson" . + "Michael Green" . + +``` + diff --git a/src/test/resources/rml-io/RMLSTC0011d/companies.json b/src/test/resources/rml-io/RMLSTC0011d/companies.json new file mode 100644 index 00000000..28355038 --- /dev/null +++ b/src/test/resources/rml-io/RMLSTC0011d/companies.json @@ -0,0 +1,91 @@ +{ + "companies": [ + { + "name": "TechCorp", + "location": { + "country": "USA", + "state": "California", + "city": "San Francisco" + }, + "departments": [ + { + "name": "Engineering", + "manager": { + "name": "Alice Johnson", + "age": 42 + }, + "employees": [ + { + "name": "Bob Smith", + "role": "Software Engineer", + "skills": ["Python", "JavaScript", "AWS"] + }, + { + "name": "Eve Davis", + "role": "DevOps Engineer", + "skills": ["Docker", "Kubernetes", "Terraform"] + } + ] + }, + { + "name": "Marketing", + "manager": { + "name": "John Doe", + "age": 39 + }, + "employees": [ + { + "name": "Sarah Lee", + "role": "Marketing Specialist", + "skills": ["SEO", "Google Ads", "Copywriting"] + } + ] + } + ] + }, + { + "name": "InnovateX", + "location": { + "country": "Canada", + "state": "Ontario", + "city": "Toronto" + }, + "departments": [ + { + "name": "Research & Development", + "manager": { + "name": "Emma Wilson", + "age": 45 + }, + "employees": [ + { + "name": "Liam Brown", + "role": "AI Researcher", + "skills": ["Machine Learning", "Deep Learning", "Python"] + }, + { + "name": "Sophia White", + "role": "Data Scientist", + "skills": ["Data Analysis", "R", "SQL"] + } + ] + }, + { + "name": "Sales", + "manager": { + "name": "Michael Green", + "age": 38 + }, + "employees": [ + { + "name": "Olivia Martinez", + "role": "Sales Executive", + "skills": ["Negotiation", "CRM", "Lead Generation"] + } + ] + } + ] + } + ] + } + \ No newline at end of file diff --git a/src/test/resources/rml-io/RMLSTC0011d/default.nq b/src/test/resources/rml-io/RMLSTC0011d/default.nq new file mode 100644 index 00000000..bf945c75 --- /dev/null +++ b/src/test/resources/rml-io/RMLSTC0011d/default.nq @@ -0,0 +1,4 @@ + "Alice Johnson" . + "John Doe" . + "Emma Wilson" . + "Michael Green" . diff --git a/src/test/resources/rml-io/RMLSTC0011d/mapping.ttl b/src/test/resources/rml-io/RMLSTC0011d/mapping.ttl new file mode 100644 index 00000000..84360e1d --- /dev/null +++ b/src/test/resources/rml-io/RMLSTC0011d/mapping.ttl @@ -0,0 +1,26 @@ +@prefix rml: . +@prefix foaf: . +@prefix xsd: . +@prefix ex: . +@base . + +<#TriplesMap2> a rml:TriplesMap; + rml:logicalSource [ a rml:LogicalSource; + rml:source [ a rml:FilePath; + rml:root rml:MappingDirectory; + rml:path "companies.json"; + ]; + rml:referenceFormulation rml:JSONPath; + rml:iterator "$.companies[*].departments[*]"; + ]; + rml:subjectMap [ a rml:SubjectMap; + rml:template "http://example.org/{name}"; + ]; + rml:predicateObjectMap [ a rml:PredicateObjectMap; + rml:predicateMap [ a rml:PredicateMap; + rml:constant foaf:name; + ]; + rml:objectMap [ a rml:ObjectMap; + rml:reference "$.manager.name"; + ]; + ]. diff --git a/src/test/resources/rml-io/RMLSTC0011e/README.md b/src/test/resources/rml-io/RMLSTC0011e/README.md new file mode 100644 index 00000000..1685d967 --- /dev/null +++ b/src/test/resources/rml-io/RMLSTC0011e/README.md @@ -0,0 +1,65 @@ +## RMLSTC0011e + +**Title**: Complex JSON source + +**Description**: Tests the generation of triples from complex JSON sources + +**Error expected?** No + +**Input** + [http://w3id.org/rml/resources/rml-io/RMLSTC0011e/Friends.json](http://w3id.org/rml/resources/rml-io/RMLSTC0011e/Friends.json) + +**Mapping** +``` +@prefix rml: . +@prefix foaf: . +@prefix xsd: . +@prefix ex: . +@base . + +<#TriplesMap2> a rml:TriplesMap; + rml:logicalSource [ a rml:LogicalSource; + rml:source [ a rml:FilePath; + rml:root rml:MappingDirectory; + rml:path "companies.json"; + ]; + rml:referenceFormulation rml:JSONPath; + rml:iterator "$.companies[*].departments[*].employees[*]"; + ]; + rml:subjectMap [ a rml:SubjectMap; + rml:template "http://example.org/{name}"; + ]; + rml:predicateObjectMap [ a rml:PredicateObjectMap; + rml:predicateMap [ a rml:PredicateMap; + rml:constant ex:skill; + ]; + rml:objectMap [ a rml:ObjectMap; + rml:reference "$.skills[*]"; + ]; + ]. + +``` + +**Output** +``` + "AWS" . + "JavaScript" . + "Python" . + "Docker" . + "Kubernetes" . + "Terraform" . + "Deep Learning" . + "Machine Learning" . + "Python" . + "CRM" . + "Lead Generation" . + "Negotiation" . + "Copywriting" . + "Google Ads" . + "SEO" . + "Data Analysis" . + "R" . + "SQL" . + +``` + diff --git a/src/test/resources/rml-io/RMLSTC0011e/companies.json b/src/test/resources/rml-io/RMLSTC0011e/companies.json new file mode 100644 index 00000000..28355038 --- /dev/null +++ b/src/test/resources/rml-io/RMLSTC0011e/companies.json @@ -0,0 +1,91 @@ +{ + "companies": [ + { + "name": "TechCorp", + "location": { + "country": "USA", + "state": "California", + "city": "San Francisco" + }, + "departments": [ + { + "name": "Engineering", + "manager": { + "name": "Alice Johnson", + "age": 42 + }, + "employees": [ + { + "name": "Bob Smith", + "role": "Software Engineer", + "skills": ["Python", "JavaScript", "AWS"] + }, + { + "name": "Eve Davis", + "role": "DevOps Engineer", + "skills": ["Docker", "Kubernetes", "Terraform"] + } + ] + }, + { + "name": "Marketing", + "manager": { + "name": "John Doe", + "age": 39 + }, + "employees": [ + { + "name": "Sarah Lee", + "role": "Marketing Specialist", + "skills": ["SEO", "Google Ads", "Copywriting"] + } + ] + } + ] + }, + { + "name": "InnovateX", + "location": { + "country": "Canada", + "state": "Ontario", + "city": "Toronto" + }, + "departments": [ + { + "name": "Research & Development", + "manager": { + "name": "Emma Wilson", + "age": 45 + }, + "employees": [ + { + "name": "Liam Brown", + "role": "AI Researcher", + "skills": ["Machine Learning", "Deep Learning", "Python"] + }, + { + "name": "Sophia White", + "role": "Data Scientist", + "skills": ["Data Analysis", "R", "SQL"] + } + ] + }, + { + "name": "Sales", + "manager": { + "name": "Michael Green", + "age": 38 + }, + "employees": [ + { + "name": "Olivia Martinez", + "role": "Sales Executive", + "skills": ["Negotiation", "CRM", "Lead Generation"] + } + ] + } + ] + } + ] + } + \ No newline at end of file diff --git a/src/test/resources/rml-io/RMLSTC0011e/default.nq b/src/test/resources/rml-io/RMLSTC0011e/default.nq new file mode 100644 index 00000000..9403b1fb --- /dev/null +++ b/src/test/resources/rml-io/RMLSTC0011e/default.nq @@ -0,0 +1,18 @@ + "AWS" . + "JavaScript" . + "Python" . + "Docker" . + "Kubernetes" . + "Terraform" . + "Deep Learning" . + "Machine Learning" . + "Python" . + "CRM" . + "Lead Generation" . + "Negotiation" . + "Copywriting" . + "Google Ads" . + "SEO" . + "Data Analysis" . + "R" . + "SQL" . diff --git a/src/test/resources/rml-io/RMLSTC0011e/mapping.ttl b/src/test/resources/rml-io/RMLSTC0011e/mapping.ttl new file mode 100644 index 00000000..871a4e81 --- /dev/null +++ b/src/test/resources/rml-io/RMLSTC0011e/mapping.ttl @@ -0,0 +1,26 @@ +@prefix rml: . +@prefix foaf: . +@prefix xsd: . +@prefix ex: . +@base . + +<#TriplesMap2> a rml:TriplesMap; + rml:logicalSource [ a rml:LogicalSource; + rml:source [ a rml:FilePath; + rml:root rml:MappingDirectory; + rml:path "companies.json"; + ]; + rml:referenceFormulation rml:JSONPath; + rml:iterator "$.companies[*].departments[*].employees[*]"; + ]; + rml:subjectMap [ a rml:SubjectMap; + rml:template "http://example.org/{name}"; + ]; + rml:predicateObjectMap [ a rml:PredicateObjectMap; + rml:predicateMap [ a rml:PredicateMap; + rml:constant ex:skill; + ]; + rml:objectMap [ a rml:ObjectMap; + rml:reference "$.skills[*]"; + ]; + ]. diff --git a/src/test/resources/rml-io/RMLSTC0012a/README.md b/src/test/resources/rml-io/RMLSTC0012a/README.md new file mode 100644 index 00000000..35634247 --- /dev/null +++ b/src/test/resources/rml-io/RMLSTC0012a/README.md @@ -0,0 +1,49 @@ +## RMLSTC0012a + +**Title**: Complex XML source + +**Description**: Tests the generation of triples from complex XML sources + +**Error expected?** No + +**Input** + [http://w3id.org/rml/resources/rml-io/RMLSTC0012a/Friends.json](http://w3id.org/rml/resources/rml-io/RMLSTC0012a/Friends.json) + +**Mapping** +``` +@prefix rml: . +@prefix foaf: . +@prefix xsd: . +@prefix ex: . +@base . + +<#TriplesMap2> a rml:TriplesMap; + rml:logicalSource [ a rml:LogicalSource; + rml:source [ a rml:FilePath; + rml:root rml:MappingDirectory; + rml:path "companies.xml"; + ]; + rml:referenceFormulation rml:XPath; + rml:iterator "/companies/company"; + ]; + rml:subjectMap [ a rml:SubjectMap; + rml:template "http://example.org/{@id}"; + ]; + rml:predicateObjectMap [ a rml:PredicateObjectMap; + rml:predicateMap [ a rml:PredicateMap; + rml:constant foaf:name; + ]; + rml:objectMap [ a rml:ObjectMap; + rml:reference "name"; + ]; + ]. + +``` + +**Output** +``` + "TechCorp" . + "InnovateX" . + +``` + diff --git a/src/test/resources/rml-io/RMLSTC0012a/companies.xml b/src/test/resources/rml-io/RMLSTC0012a/companies.xml new file mode 100644 index 00000000..6cf391ea --- /dev/null +++ b/src/test/resources/rml-io/RMLSTC0012a/companies.xml @@ -0,0 +1,112 @@ + + + TechCorp + + USA + California + San Francisco + + + + Engineering + + Alice Johnson + 42 + + + + Bob Smith + Software Engineer + + Python + JavaScript + AWS + + + + Eve Davis + DevOps Engineer + + Docker + Kubernetes + Terraform + + + + + + Marketing + + John Doe + 39 + + + + Sarah Lee + Marketing Specialist + + SEO + Google Ads + Copywriting + + + + + + + + InnovateX + + Canada + Ontario + Toronto + + + + Research & Development + + Emma Wilson + 45 + + + + Liam Brown + AI Researcher + + Machine Learning + Deep Learning + Python + + + + Sophia White + Data Scientist + + Data Analysis + R + SQL + + + + + + Sales + + Michael Green + 38 + + + + Olivia Martinez + Sales Executive + + Negotiation + CRM + Lead Generation + + + + + + + \ No newline at end of file diff --git a/src/test/resources/rml-io/RMLSTC0012a/default.nq b/src/test/resources/rml-io/RMLSTC0012a/default.nq new file mode 100644 index 00000000..2d195a8a --- /dev/null +++ b/src/test/resources/rml-io/RMLSTC0012a/default.nq @@ -0,0 +1,2 @@ + "TechCorp" . + "InnovateX" . diff --git a/src/test/resources/rml-io/RMLSTC0012a/mapping.ttl b/src/test/resources/rml-io/RMLSTC0012a/mapping.ttl new file mode 100644 index 00000000..e506815c --- /dev/null +++ b/src/test/resources/rml-io/RMLSTC0012a/mapping.ttl @@ -0,0 +1,26 @@ +@prefix rml: . +@prefix foaf: . +@prefix xsd: . +@prefix ex: . +@base . + +<#TriplesMap2> a rml:TriplesMap; + rml:logicalSource [ a rml:LogicalSource; + rml:source [ a rml:FilePath; + rml:root rml:MappingDirectory; + rml:path "companies.xml"; + ]; + rml:referenceFormulation rml:XPath; + rml:iterator "/companies/company"; + ]; + rml:subjectMap [ a rml:SubjectMap; + rml:template "http://example.org/{@id}"; + ]; + rml:predicateObjectMap [ a rml:PredicateObjectMap; + rml:predicateMap [ a rml:PredicateMap; + rml:constant foaf:name; + ]; + rml:objectMap [ a rml:ObjectMap; + rml:reference "name"; + ]; + ]. diff --git a/src/test/resources/rml-io/RMLSTC0012b/README.md b/src/test/resources/rml-io/RMLSTC0012b/README.md new file mode 100644 index 00000000..33121fd8 --- /dev/null +++ b/src/test/resources/rml-io/RMLSTC0012b/README.md @@ -0,0 +1,51 @@ +## RMLSTC0012b + +**Title**: Complex XML source + +**Description**: Tests the generation of triples from complex XML sources + +**Error expected?** No + +**Input** + [http://w3id.org/rml/resources/rml-io/RMLSTC0012b/Friends.json](http://w3id.org/rml/resources/rml-io/RMLSTC0012b/Friends.json) + +**Mapping** +``` +@prefix rml: . +@prefix foaf: . +@prefix xsd: . +@prefix ex: . +@base . + +<#TriplesMap2> a rml:TriplesMap; + rml:logicalSource [ a rml:LogicalSource; + rml:source [ a rml:FilePath; + rml:root rml:MappingDirectory; + rml:path "companies.xml"; + ]; + rml:referenceFormulation rml:XPath; + rml:iterator "/companies/company/departments"; + ]; + rml:subjectMap [ a rml:SubjectMap; + rml:template "http://example.org/{../@id}"; + ]; + rml:predicateObjectMap [ a rml:PredicateObjectMap; + rml:predicateMap [ a rml:PredicateMap; + rml:constant ex:department; + ]; + rml:objectMap [ a rml:ObjectMap; + rml:reference "department/name"; + ]; + ]. + +``` + +**Output** +``` + "Engineering" . + "Marketing" . + "Research & Development" . + "Sales" . + +``` + diff --git a/src/test/resources/rml-io/RMLSTC0012b/companies.xml b/src/test/resources/rml-io/RMLSTC0012b/companies.xml new file mode 100644 index 00000000..6cf391ea --- /dev/null +++ b/src/test/resources/rml-io/RMLSTC0012b/companies.xml @@ -0,0 +1,112 @@ + + + TechCorp + + USA + California + San Francisco + + + + Engineering + + Alice Johnson + 42 + + + + Bob Smith + Software Engineer + + Python + JavaScript + AWS + + + + Eve Davis + DevOps Engineer + + Docker + Kubernetes + Terraform + + + + + + Marketing + + John Doe + 39 + + + + Sarah Lee + Marketing Specialist + + SEO + Google Ads + Copywriting + + + + + + + + InnovateX + + Canada + Ontario + Toronto + + + + Research & Development + + Emma Wilson + 45 + + + + Liam Brown + AI Researcher + + Machine Learning + Deep Learning + Python + + + + Sophia White + Data Scientist + + Data Analysis + R + SQL + + + + + + Sales + + Michael Green + 38 + + + + Olivia Martinez + Sales Executive + + Negotiation + CRM + Lead Generation + + + + + + + \ No newline at end of file diff --git a/src/test/resources/rml-io/RMLSTC0012b/default.nq b/src/test/resources/rml-io/RMLSTC0012b/default.nq new file mode 100644 index 00000000..a6ddb028 --- /dev/null +++ b/src/test/resources/rml-io/RMLSTC0012b/default.nq @@ -0,0 +1,4 @@ + "Engineering" . + "Marketing" . + "Research & Development" . + "Sales" . diff --git a/src/test/resources/rml-io/RMLSTC0012b/mapping.ttl b/src/test/resources/rml-io/RMLSTC0012b/mapping.ttl new file mode 100644 index 00000000..bc6e289a --- /dev/null +++ b/src/test/resources/rml-io/RMLSTC0012b/mapping.ttl @@ -0,0 +1,26 @@ +@prefix rml: . +@prefix foaf: . +@prefix xsd: . +@prefix ex: . +@base . + +<#TriplesMap2> a rml:TriplesMap; + rml:logicalSource [ a rml:LogicalSource; + rml:source [ a rml:FilePath; + rml:root rml:MappingDirectory; + rml:path "companies.xml"; + ]; + rml:referenceFormulation rml:XPath; + rml:iterator "/companies/company/departments"; + ]; + rml:subjectMap [ a rml:SubjectMap; + rml:template "http://example.org/{../@id}"; + ]; + rml:predicateObjectMap [ a rml:PredicateObjectMap; + rml:predicateMap [ a rml:PredicateMap; + rml:constant ex:department; + ]; + rml:objectMap [ a rml:ObjectMap; + rml:reference "department/name"; + ]; + ]. diff --git a/src/test/resources/rml-io/RMLSTC0012c/README.md b/src/test/resources/rml-io/RMLSTC0012c/README.md new file mode 100644 index 00000000..b89b6478 --- /dev/null +++ b/src/test/resources/rml-io/RMLSTC0012c/README.md @@ -0,0 +1,53 @@ +## RMLSTC0012c + +**Title**: Complex XML source + +**Description**: Tests the generation of triples from complex XML sources + +**Error expected?** No + +**Input** + [http://w3id.org/rml/resources/rml-io/RMLSTC0012c/Friends.json](http://w3id.org/rml/resources/rml-io/RMLSTC0012c/Friends.json) + +**Mapping** +``` +@prefix rml: . +@prefix foaf: . +@prefix xsd: . +@prefix ex: . +@base . + +<#TriplesMap2> a rml:TriplesMap; + rml:logicalSource [ a rml:LogicalSource; + rml:source [ a rml:FilePath; + rml:root rml:MappingDirectory; + rml:path "companies.xml"; + ]; + rml:referenceFormulation rml:XPath; + rml:iterator "/companies/company/departments/department/employees"; + ]; + rml:subjectMap [ a rml:SubjectMap; + rml:template "http://example.org/{../../../@id}"; + ]; + rml:predicateObjectMap [ a rml:PredicateObjectMap; + rml:predicateMap [ a rml:PredicateMap; + rml:constant ex:employee; + ]; + rml:objectMap [ a rml:ObjectMap; + rml:reference "employee/name"; + ]; + ]. + +``` + +**Output** +``` + "Bob Smith" . + "Eve Davis" . + "Sarah Lee" . + "Liam Brown" . + "Olivia Martinez" . + "Sophia White" . + +``` + diff --git a/src/test/resources/rml-io/RMLSTC0012c/companies.xml b/src/test/resources/rml-io/RMLSTC0012c/companies.xml new file mode 100644 index 00000000..6cf391ea --- /dev/null +++ b/src/test/resources/rml-io/RMLSTC0012c/companies.xml @@ -0,0 +1,112 @@ + + + TechCorp + + USA + California + San Francisco + + + + Engineering + + Alice Johnson + 42 + + + + Bob Smith + Software Engineer + + Python + JavaScript + AWS + + + + Eve Davis + DevOps Engineer + + Docker + Kubernetes + Terraform + + + + + + Marketing + + John Doe + 39 + + + + Sarah Lee + Marketing Specialist + + SEO + Google Ads + Copywriting + + + + + + + + InnovateX + + Canada + Ontario + Toronto + + + + Research & Development + + Emma Wilson + 45 + + + + Liam Brown + AI Researcher + + Machine Learning + Deep Learning + Python + + + + Sophia White + Data Scientist + + Data Analysis + R + SQL + + + + + + Sales + + Michael Green + 38 + + + + Olivia Martinez + Sales Executive + + Negotiation + CRM + Lead Generation + + + + + + + \ No newline at end of file diff --git a/src/test/resources/rml-io/RMLSTC0012c/default.nq b/src/test/resources/rml-io/RMLSTC0012c/default.nq new file mode 100644 index 00000000..e7dab8b6 --- /dev/null +++ b/src/test/resources/rml-io/RMLSTC0012c/default.nq @@ -0,0 +1,6 @@ + "Bob Smith" . + "Eve Davis" . + "Sarah Lee" . + "Liam Brown" . + "Olivia Martinez" . + "Sophia White" . diff --git a/src/test/resources/rml-io/RMLSTC0012c/mapping.ttl b/src/test/resources/rml-io/RMLSTC0012c/mapping.ttl new file mode 100644 index 00000000..5388d754 --- /dev/null +++ b/src/test/resources/rml-io/RMLSTC0012c/mapping.ttl @@ -0,0 +1,26 @@ +@prefix rml: . +@prefix foaf: . +@prefix xsd: . +@prefix ex: . +@base . + +<#TriplesMap2> a rml:TriplesMap; + rml:logicalSource [ a rml:LogicalSource; + rml:source [ a rml:FilePath; + rml:root rml:MappingDirectory; + rml:path "companies.xml"; + ]; + rml:referenceFormulation rml:XPath; + rml:iterator "/companies/company/departments/department/employees"; + ]; + rml:subjectMap [ a rml:SubjectMap; + rml:template "http://example.org/{../../../@id}"; + ]; + rml:predicateObjectMap [ a rml:PredicateObjectMap; + rml:predicateMap [ a rml:PredicateMap; + rml:constant ex:employee; + ]; + rml:objectMap [ a rml:ObjectMap; + rml:reference "employee/name"; + ]; + ]. diff --git a/src/test/resources/rml-io/RMLSTC0012d/README.md b/src/test/resources/rml-io/RMLSTC0012d/README.md new file mode 100644 index 00000000..a322b1af --- /dev/null +++ b/src/test/resources/rml-io/RMLSTC0012d/README.md @@ -0,0 +1,51 @@ +## RMLSTC0012d + +**Title**: Complex XML source + +**Description**: Tests the generation of triples from complex XML sources + +**Error expected?** No + +**Input** + [http://w3id.org/rml/resources/rml-io/RMLSTC0012d/Friends.json](http://w3id.org/rml/resources/rml-io/RMLSTC0012d/Friends.json) + +**Mapping** +``` +@prefix rml: . +@prefix foaf: . +@prefix xsd: . +@prefix ex: . +@base . + +<#TriplesMap2> a rml:TriplesMap; + rml:logicalSource [ a rml:LogicalSource; + rml:source [ a rml:FilePath; + rml:root rml:MappingDirectory; + rml:path "companies.xml"; + ]; + rml:referenceFormulation rml:XPath; + rml:iterator "/companies/company/departments/department"; + ]; + rml:subjectMap [ a rml:SubjectMap; + rml:template "http://example.org/{../../@id}"; + ]; + rml:predicateObjectMap [ a rml:PredicateObjectMap; + rml:predicateMap [ a rml:PredicateMap; + rml:constant ex:manager; + ]; + rml:objectMap [ a rml:ObjectMap; + rml:reference "manager/name"; + ]; + ]. + +``` + +**Output** +``` + "Alice Johnson" . + "John Doe" . + "Emma Wilson" . + "Michael Green" . + +``` + diff --git a/src/test/resources/rml-io/RMLSTC0012d/companies.xml b/src/test/resources/rml-io/RMLSTC0012d/companies.xml new file mode 100644 index 00000000..6cf391ea --- /dev/null +++ b/src/test/resources/rml-io/RMLSTC0012d/companies.xml @@ -0,0 +1,112 @@ + + + TechCorp + + USA + California + San Francisco + + + + Engineering + + Alice Johnson + 42 + + + + Bob Smith + Software Engineer + + Python + JavaScript + AWS + + + + Eve Davis + DevOps Engineer + + Docker + Kubernetes + Terraform + + + + + + Marketing + + John Doe + 39 + + + + Sarah Lee + Marketing Specialist + + SEO + Google Ads + Copywriting + + + + + + + + InnovateX + + Canada + Ontario + Toronto + + + + Research & Development + + Emma Wilson + 45 + + + + Liam Brown + AI Researcher + + Machine Learning + Deep Learning + Python + + + + Sophia White + Data Scientist + + Data Analysis + R + SQL + + + + + + Sales + + Michael Green + 38 + + + + Olivia Martinez + Sales Executive + + Negotiation + CRM + Lead Generation + + + + + + + \ No newline at end of file diff --git a/src/test/resources/rml-io/RMLSTC0012d/default.nq b/src/test/resources/rml-io/RMLSTC0012d/default.nq new file mode 100644 index 00000000..13a0c585 --- /dev/null +++ b/src/test/resources/rml-io/RMLSTC0012d/default.nq @@ -0,0 +1,4 @@ + "Alice Johnson" . + "John Doe" . + "Emma Wilson" . + "Michael Green" . diff --git a/src/test/resources/rml-io/RMLSTC0012d/mapping.ttl b/src/test/resources/rml-io/RMLSTC0012d/mapping.ttl new file mode 100644 index 00000000..a97be77d --- /dev/null +++ b/src/test/resources/rml-io/RMLSTC0012d/mapping.ttl @@ -0,0 +1,26 @@ +@prefix rml: . +@prefix foaf: . +@prefix xsd: . +@prefix ex: . +@base . + +<#TriplesMap2> a rml:TriplesMap; + rml:logicalSource [ a rml:LogicalSource; + rml:source [ a rml:FilePath; + rml:root rml:MappingDirectory; + rml:path "companies.xml"; + ]; + rml:referenceFormulation rml:XPath; + rml:iterator "/companies/company/departments/department"; + ]; + rml:subjectMap [ a rml:SubjectMap; + rml:template "http://example.org/{../../@id}"; + ]; + rml:predicateObjectMap [ a rml:PredicateObjectMap; + rml:predicateMap [ a rml:PredicateMap; + rml:constant ex:manager; + ]; + rml:objectMap [ a rml:ObjectMap; + rml:reference "manager/name"; + ]; + ]. diff --git a/src/test/resources/rml-io/RMLSTC0012e/README.md b/src/test/resources/rml-io/RMLSTC0012e/README.md new file mode 100644 index 00000000..436b7cc1 --- /dev/null +++ b/src/test/resources/rml-io/RMLSTC0012e/README.md @@ -0,0 +1,65 @@ +## RMLSTC0012e + +**Title**: Complex XML source + +**Description**: Tests the generation of triples from complex XML sources + +**Error expected?** No + +**Input** + [http://w3id.org/rml/resources/rml-io/RMLSTC0012e/Friends.json](http://w3id.org/rml/resources/rml-io/RMLSTC0012e/Friends.json) + +**Mapping** +``` +@prefix rml: . +@prefix foaf: . +@prefix xsd: . +@prefix ex: . +@base . + +<#TriplesMap2> a rml:TriplesMap; + rml:logicalSource [ a rml:LogicalSource; + rml:source [ a rml:FilePath; + rml:root rml:MappingDirectory; + rml:path "companies.xml"; + ]; + rml:referenceFormulation rml:XPath; + rml:iterator "/companies/company/departments/department/employees/employee"; + ]; + rml:subjectMap [ a rml:SubjectMap; + rml:template "http://example.org/{name}"; + ]; + rml:predicateObjectMap [ a rml:PredicateObjectMap; + rml:predicateMap [ a rml:PredicateMap; + rml:constant ex:skill; + ]; + rml:objectMap [ a rml:ObjectMap; + rml:reference "skills/skill"; + ]; + ]. + +``` + +**Output** +``` + "AWS" . + "JavaScript" . + "Python" . + "Docker" . + "Kubernetes" . + "Terraform" . + "Deep Learning" . + "Machine Learning" . + "Python" . + "CRM" . + "Lead Generation" . + "Negotiation" . + "Copywriting" . + "Google Ads" . + "SEO" . + "Data Analysis" . + "R" . + "SQL" . + +``` + diff --git a/src/test/resources/rml-io/RMLSTC0012e/companies.xml b/src/test/resources/rml-io/RMLSTC0012e/companies.xml new file mode 100644 index 00000000..6cf391ea --- /dev/null +++ b/src/test/resources/rml-io/RMLSTC0012e/companies.xml @@ -0,0 +1,112 @@ + + + TechCorp + + USA + California + San Francisco + + + + Engineering + + Alice Johnson + 42 + + + + Bob Smith + Software Engineer + + Python + JavaScript + AWS + + + + Eve Davis + DevOps Engineer + + Docker + Kubernetes + Terraform + + + + + + Marketing + + John Doe + 39 + + + + Sarah Lee + Marketing Specialist + + SEO + Google Ads + Copywriting + + + + + + + + InnovateX + + Canada + Ontario + Toronto + + + + Research & Development + + Emma Wilson + 45 + + + + Liam Brown + AI Researcher + + Machine Learning + Deep Learning + Python + + + + Sophia White + Data Scientist + + Data Analysis + R + SQL + + + + + + Sales + + Michael Green + 38 + + + + Olivia Martinez + Sales Executive + + Negotiation + CRM + Lead Generation + + + + + + + \ No newline at end of file diff --git a/src/test/resources/rml-io/RMLSTC0012e/default.nq b/src/test/resources/rml-io/RMLSTC0012e/default.nq new file mode 100644 index 00000000..9403b1fb --- /dev/null +++ b/src/test/resources/rml-io/RMLSTC0012e/default.nq @@ -0,0 +1,18 @@ + "AWS" . + "JavaScript" . + "Python" . + "Docker" . + "Kubernetes" . + "Terraform" . + "Deep Learning" . + "Machine Learning" . + "Python" . + "CRM" . + "Lead Generation" . + "Negotiation" . + "Copywriting" . + "Google Ads" . + "SEO" . + "Data Analysis" . + "R" . + "SQL" . diff --git a/src/test/resources/rml-io/RMLSTC0012e/mapping.ttl b/src/test/resources/rml-io/RMLSTC0012e/mapping.ttl new file mode 100644 index 00000000..91af0f2b --- /dev/null +++ b/src/test/resources/rml-io/RMLSTC0012e/mapping.ttl @@ -0,0 +1,26 @@ +@prefix rml: . +@prefix foaf: . +@prefix xsd: . +@prefix ex: . +@base . + +<#TriplesMap2> a rml:TriplesMap; + rml:logicalSource [ a rml:LogicalSource; + rml:source [ a rml:FilePath; + rml:root rml:MappingDirectory; + rml:path "companies.xml"; + ]; + rml:referenceFormulation rml:XPath; + rml:iterator "/companies/company/departments/department/employees/employee"; + ]; + rml:subjectMap [ a rml:SubjectMap; + rml:template "http://example.org/{name}"; + ]; + rml:predicateObjectMap [ a rml:PredicateObjectMap; + rml:predicateMap [ a rml:PredicateMap; + rml:constant ex:skill; + ]; + rml:objectMap [ a rml:ObjectMap; + rml:reference "skills/skill"; + ]; + ]. diff --git a/src/test/resources/rml-io/RMLTTC0000/Friends.json b/src/test/resources/rml-io/RMLTTC0000/Friends.json new file mode 100644 index 00000000..8e554498 --- /dev/null +++ b/src/test/resources/rml-io/RMLTTC0000/Friends.json @@ -0,0 +1,27 @@ +[ + { + "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 + } +] diff --git a/src/test/resources/rml-io/RMLTTC0000/README.md b/src/test/resources/rml-io/RMLTTC0000/README.md new file mode 100644 index 00000000..f7669dbb --- /dev/null +++ b/src/test/resources/rml-io/RMLTTC0000/README.md @@ -0,0 +1,94 @@ +## RMLTTC0000 + +**Title**: Default target + +**Description**: Test exporting all triples to the default Target when not Targets are specified. + +**Error expected?** No + +**Input** +``` +[ + { + "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 + } +] + +``` + +**Mapping** +``` +@prefix rml: . +@prefix foaf: . +@base . + +<#TriplesMap> a rml:TriplesMap; + rml:logicalSource [ a rml:LogicalSource; + rml:source [ a rml:FilePath; + rml:root rml:MappingDirectory; + rml:path "Friends.json"; + rml:encoding rml:UTF-8 + ]; + rml:referenceFormulation rml:JSONPath; + rml:iterator "$[*]"; + ]; + rml:subjectMap [ a rml:SubjectMap; + rml:template "http://example.org/{$.id}"; + ]; + rml:predicateObjectMap [ a rml:PredicateObjectMap; + rml:predicateMap [ a rml:PredicateMap; + rml:constant foaf:name; + ]; + rml:objectMap [ a rml:ObjectMap; + rml:reference "$.name"; + ]; + ]; + rml:predicateObjectMap [ a rml:PredicateObjectMap; + rml:predicateMap [ a rml:PredicateMap; + rml:constant foaf:age; + ]; + rml:objectMap [ a rml:ObjectMap; + rml:reference "$.age"; + ]; + ]; +. + +``` + +**Output** +``` + "33" . + "Monica Geller" . + "34" . + "Rachel Green" . + "35" . + "Joey Tribbiani" . + "36" . + "Chandler Bing" . + "37" . + "Ross Geller" . + +``` + diff --git a/src/test/resources/rml-io/RMLTTC0000/default.nq b/src/test/resources/rml-io/RMLTTC0000/default.nq index d9456768..63f28ff8 100644 --- a/src/test/resources/rml-io/RMLTTC0000/default.nq +++ b/src/test/resources/rml-io/RMLTTC0000/default.nq @@ -1,10 +1,10 @@ - "33" . + "33"^^ . "Monica Geller" . - "34" . + "34"^^ . "Rachel Green" . - "35" . + "35"^^ . "Joey Tribbiani" . - "36" . + "36"^^ . "Chandler Bing" . - "37" . + "37"^^ . "Ross Geller" . diff --git a/src/test/resources/rml-io/RMLTTC0000/mapping.ttl b/src/test/resources/rml-io/RMLTTC0000/mapping.ttl index 1e7179c0..00a2f99e 100644 --- a/src/test/resources/rml-io/RMLTTC0000/mapping.ttl +++ b/src/test/resources/rml-io/RMLTTC0000/mapping.ttl @@ -1,27 +1,26 @@ @prefix rml: . @prefix foaf: . -@prefix dcat: . @base . -<#DCATSourceAccess> a rml:Source, dcat:Distribution; - dcat:downloadURL ; -. - <#TriplesMap> a rml:TriplesMap; rml:logicalSource [ a rml:LogicalSource; - rml:source <#DCATSourceAccess>; + rml:source [ a rml:FilePath; + rml:root rml:MappingDirectory; + rml:path "Friends.json"; + rml:encoding rml:UTF-8 + ]; rml:referenceFormulation rml:JSONPath; - rml:iterator "$.[*]"; + rml:iterator "$[*]"; ]; rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{id}"; + rml:template "http://example.org/{$.id}"; ]; rml:predicateObjectMap [ a rml:PredicateObjectMap; rml:predicateMap [ a rml:PredicateMap; rml:constant foaf:name; ]; rml:objectMap [ a rml:ObjectMap; - rml:reference "name"; + rml:reference "$.name"; ]; ]; rml:predicateObjectMap [ a rml:PredicateObjectMap; @@ -29,7 +28,7 @@ rml:constant foaf:age; ]; rml:objectMap [ a rml:ObjectMap; - rml:reference "age"; + rml:reference "$.age"; ]; ]; . diff --git a/src/test/resources/rml-io/RMLTTC0001a/Friends.json b/src/test/resources/rml-io/RMLTTC0001a/Friends.json new file mode 100644 index 00000000..8e554498 --- /dev/null +++ b/src/test/resources/rml-io/RMLTTC0001a/Friends.json @@ -0,0 +1,27 @@ +[ + { + "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 + } +] diff --git a/src/test/resources/rml-io/RMLTTC0001a/README.md b/src/test/resources/rml-io/RMLTTC0001a/README.md new file mode 100644 index 00000000..34fa66db --- /dev/null +++ b/src/test/resources/rml-io/RMLTTC0001a/README.md @@ -0,0 +1,108 @@ +## RMLTTC0001a + +**Title**: Single Target: Subject Map + +**Description**: Test exporting all triples to a single Target with a given subject. + +**Error expected?** No + +**Input** +``` +[ + { + "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 + } +] + +``` + +**Mapping** +``` +@prefix rml: . +@prefix foaf: . +@prefix formats: . +@base . + +<#TriplesMap> a rml:TriplesMap; + rml:logicalSource [ a rml:LogicalSource; + rml:source [ a rml:FilePath; + rml:root rml:MappingDirectory; + rml:path "Friends.json"; + ]; + rml:referenceFormulation rml:JSONPath; + rml:iterator "$[*]"; + ]; + rml:subjectMap [ a rml:SubjectMap; + rml:template "http://example.org/{$.id}"; + rml:logicalTarget <#TargetDump1>; + ]; + rml:predicateObjectMap [ a rml:PredicateObjectMap; + rml:predicateMap [ a rml:PredicateMap; + rml:constant foaf:name; + ]; + rml:objectMap [ a rml:ObjectMap; + rml:reference "$.name"; + ]; + ]; + rml:predicateObjectMap [ a rml:PredicateObjectMap; + rml:predicateMap [ a rml:PredicateMap; + rml:constant foaf:age; + ]; + rml:objectMap [ a rml:ObjectMap; + rml:reference "$.age"; + ]; + ]; +. + +<#TargetDump1> a rml:LogicalTarget; + rml:target [ a rml:FilePath; + rml:root rml:CurrentWorkingDirectory; + rml:path "./dump1.nq"; + ]; + rml:serialization formats:N-Quads; +. + +``` + +**Output 1** +``` + +``` + +**Output 2** +``` + "33" . + "Monica Geller" . + "34" . + "Rachel Green" . + "35" . + "Joey Tribbiani" . + "36" . + "Chandler Bing" . + "37" . + "Ross Geller" . + +``` + diff --git a/src/test/resources/rml-io/RMLTTC0001a/mapping.ttl b/src/test/resources/rml-io/RMLTTC0001a/mapping.ttl index 9d005bd1..a6215d4c 100644 --- a/src/test/resources/rml-io/RMLTTC0001a/mapping.ttl +++ b/src/test/resources/rml-io/RMLTTC0001a/mapping.ttl @@ -1,22 +1,19 @@ @prefix rml: . @prefix foaf: . -@prefix dcat: . -@prefix void: . @prefix formats: . @base . -<#DCATSourceAccess> a rml:Source, dcat:Distribution; - dcat:downloadURL ; -. - <#TriplesMap> a rml:TriplesMap; rml:logicalSource [ a rml:LogicalSource; - rml:source <#DCATSourceAccess>; + rml:source [ a rml:FilePath; + rml:root rml:MappingDirectory; + rml:path "Friends.json"; + ]; rml:referenceFormulation rml:JSONPath; - rml:iterator "$.[*]"; + rml:iterator "$[*]"; ]; rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{id}"; + rml:template "http://example.org/{$.id}"; rml:logicalTarget <#TargetDump1>; ]; rml:predicateObjectMap [ a rml:PredicateObjectMap; @@ -24,7 +21,7 @@ rml:constant foaf:name; ]; rml:objectMap [ a rml:ObjectMap; - rml:reference "name"; + rml:reference "$.name"; ]; ]; rml:predicateObjectMap [ a rml:PredicateObjectMap; @@ -32,14 +29,15 @@ rml:constant foaf:age; ]; rml:objectMap [ a rml:ObjectMap; - rml:reference "age"; + rml:reference "$.age"; ]; ]; . <#TargetDump1> a rml:LogicalTarget; - rml:target [ a rml:Target, void:Dataset; - void:dataDump ; + rml:target [ a rml:FilePath; + rml:root rml:CurrentWorkingDirectory; + rml:path "./dump1.nq"; ]; rml:serialization formats:N-Quads; . diff --git a/src/test/resources/rml-io/RMLTTC0001b/Friends.json b/src/test/resources/rml-io/RMLTTC0001b/Friends.json new file mode 100644 index 00000000..8e554498 --- /dev/null +++ b/src/test/resources/rml-io/RMLTTC0001b/Friends.json @@ -0,0 +1,27 @@ +[ + { + "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 + } +] diff --git a/src/test/resources/rml-io/RMLTTC0001b/README.md b/src/test/resources/rml-io/RMLTTC0001b/README.md new file mode 100644 index 00000000..009ff1dd --- /dev/null +++ b/src/test/resources/rml-io/RMLTTC0001b/README.md @@ -0,0 +1,108 @@ +## RMLTTC0001b + +**Title**: Single Target: Predicate Map + +**Description**: Test exporting all triples to a single Target with a given predicate. + +**Error expected?** No + +**Input** +``` +[ + { + "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 + } +] + +``` + +**Mapping** +``` +@prefix rml: . +@prefix foaf: . +@prefix formats: . +@base . + +<#TriplesMap> a rml:TriplesMap; + rml:logicalSource [ a rml:LogicalSource; + rml:source [ a rml:FilePath; + rml:root rml:MappingDirectory; + rml:path "Friends.json"; + ]; + rml:referenceFormulation rml:JSONPath; + rml:iterator "$[*]"; + ]; + rml:subjectMap [ a rml:SubjectMap; + rml:template "http://example.org/{$.id}"; + ]; + rml:predicateObjectMap [ a rml:PredicateObjectMap; + rml:predicateMap [ a rml:PredicateMap; + rml:constant foaf:name; + rml:logicalTarget <#TargetDump1>; + ]; + rml:objectMap [ a rml:ObjectMap; + rml:reference "$.name"; + ]; + ]; + rml:predicateObjectMap [ a rml:PredicateObjectMap; + rml:predicateMap [ a rml:PredicateMap; + rml:constant foaf:age; + ]; + rml:objectMap [ a rml:ObjectMap; + rml:reference "$.age"; + ]; + ]; +. + +<#TargetDump1> a rml:LogicalTarget; + rml:target [ a rml:FilePath; + rml:root rml:CurrentWorkingDirectory; + rml:path "./dump1.nq"; + ]; + rml:serialization formats:N-Quads; +. + +``` + +**Output 1** +``` + "33". + "34". + "35". + "36". + "37". + +``` + +**Output 2** +``` + "Monica Geller" . + "Rachel Green" . + "Joey Tribbiani" . + "Chandler Bing" . + "Ross Geller" . + +``` + diff --git a/src/test/resources/rml-io/RMLTTC0001b/default.nq b/src/test/resources/rml-io/RMLTTC0001b/default.nq index ad87bcca..f2e60c86 100644 --- a/src/test/resources/rml-io/RMLTTC0001b/default.nq +++ b/src/test/resources/rml-io/RMLTTC0001b/default.nq @@ -1,5 +1,5 @@ - "33". - "34". - "35". - "36". - "37". + "33"^^. + "34"^^. + "35"^^. + "36"^^. + "37"^^. diff --git a/src/test/resources/rml-io/RMLTTC0001b/mapping.ttl b/src/test/resources/rml-io/RMLTTC0001b/mapping.ttl index ceb6ecbb..ac7eea7c 100644 --- a/src/test/resources/rml-io/RMLTTC0001b/mapping.ttl +++ b/src/test/resources/rml-io/RMLTTC0001b/mapping.ttl @@ -1,22 +1,19 @@ @prefix rml: . @prefix foaf: . -@prefix dcat: . -@prefix void: . @prefix formats: . @base . -<#DCATSourceAccess> a rml:Source, dcat:Distribution; - dcat:downloadURL ; -. - <#TriplesMap> a rml:TriplesMap; rml:logicalSource [ a rml:LogicalSource; - rml:source <#DCATSourceAccess>; + rml:source [ a rml:FilePath; + rml:root rml:MappingDirectory; + rml:path "Friends.json"; + ]; rml:referenceFormulation rml:JSONPath; - rml:iterator "$.[*]"; + rml:iterator "$[*]"; ]; rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{id}"; + rml:template "http://example.org/{$.id}"; ]; rml:predicateObjectMap [ a rml:PredicateObjectMap; rml:predicateMap [ a rml:PredicateMap; @@ -24,7 +21,7 @@ rml:logicalTarget <#TargetDump1>; ]; rml:objectMap [ a rml:ObjectMap; - rml:reference "name"; + rml:reference "$.name"; ]; ]; rml:predicateObjectMap [ a rml:PredicateObjectMap; @@ -32,14 +29,15 @@ rml:constant foaf:age; ]; rml:objectMap [ a rml:ObjectMap; - rml:reference "age"; + rml:reference "$.age"; ]; ]; . <#TargetDump1> a rml:LogicalTarget; - rml:target [ a rml:Target, void:Dataset; - void:dataDump ; + rml:target [ a rml:FilePath; + rml:root rml:CurrentWorkingDirectory; + rml:path "./dump1.nq"; ]; rml:serialization formats:N-Quads; . diff --git a/src/test/resources/rml-io/RMLTTC0001c/Friends.json b/src/test/resources/rml-io/RMLTTC0001c/Friends.json new file mode 100644 index 00000000..8e554498 --- /dev/null +++ b/src/test/resources/rml-io/RMLTTC0001c/Friends.json @@ -0,0 +1,27 @@ +[ + { + "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 + } +] diff --git a/src/test/resources/rml-io/RMLTTC0001c/README.md b/src/test/resources/rml-io/RMLTTC0001c/README.md new file mode 100644 index 00000000..eb3ac753 --- /dev/null +++ b/src/test/resources/rml-io/RMLTTC0001c/README.md @@ -0,0 +1,108 @@ +## RMLTTC0001c + +**Title**: Single Target: Object Map + +**Description**: Test exporting all triples to a single Target with a given object reference. + +**Error expected?** No + +**Input** +``` +[ + { + "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 + } +] + +``` + +**Mapping** +``` +@prefix rml: . +@prefix foaf: . +@prefix formats: . +@base . + +<#TriplesMap> a rml:TriplesMap; + rml:logicalSource [ a rml:LogicalSource; + rml:source [ a rml:FilePath; + rml:root rml:MappingDirectory; + rml:path "Friends.json"; + ]; + rml:referenceFormulation rml:JSONPath; + rml:iterator "$[*]"; + ]; + rml:subjectMap [ a rml:SubjectMap; + rml:template "http://example.org/{$.id}"; + ]; + rml:predicateObjectMap [ a rml:PredicateObjectMap; + rml:predicateMap [ a rml:PredicateMap; + rml:constant foaf:name; + ]; + rml:objectMap [ a rml:ObjectMap; + rml:reference "$.name"; + rml:logicalTarget <#TargetDump1>; + ]; + ]; + rml:predicateObjectMap [ a rml:PredicateObjectMap; + rml:predicateMap [ a rml:PredicateMap; + rml:constant foaf:age; + ]; + rml:objectMap [ a rml:ObjectMap; + rml:reference "$.age"; + ]; + ]; +. + +<#TargetDump1> a rml:LogicalTarget; + rml:target [ a rml:FilePath; + rml:root rml:CurrentWorkingDirectory; + rml:path "./dump1.nq"; + ]; + rml:serialization formats:N-Quads; +. + +``` + +**Output 1** +``` + "33". + "34". + "35". + "36". + "37". + +``` + +**Output 2** +``` + "Monica Geller" . + "Rachel Green" . + "Joey Tribbiani" . + "Chandler Bing" . + "Ross Geller" . + +``` + diff --git a/src/test/resources/rml-io/RMLTTC0001c/default.nq b/src/test/resources/rml-io/RMLTTC0001c/default.nq index ad87bcca..f2e60c86 100644 --- a/src/test/resources/rml-io/RMLTTC0001c/default.nq +++ b/src/test/resources/rml-io/RMLTTC0001c/default.nq @@ -1,5 +1,5 @@ - "33". - "34". - "35". - "36". - "37". + "33"^^. + "34"^^. + "35"^^. + "36"^^. + "37"^^. diff --git a/src/test/resources/rml-io/RMLTTC0001c/mapping.ttl b/src/test/resources/rml-io/RMLTTC0001c/mapping.ttl index a3561b4e..3b58386e 100644 --- a/src/test/resources/rml-io/RMLTTC0001c/mapping.ttl +++ b/src/test/resources/rml-io/RMLTTC0001c/mapping.ttl @@ -1,29 +1,26 @@ @prefix rml: . @prefix foaf: . -@prefix dcat: . -@prefix void: . @prefix formats: . @base . -<#DCATSourceAccess> a rml:Source, dcat:Distribution; - dcat:downloadURL ; -. - <#TriplesMap> a rml:TriplesMap; rml:logicalSource [ a rml:LogicalSource; - rml:source <#DCATSourceAccess>; + rml:source [ a rml:FilePath; + rml:root rml:MappingDirectory; + rml:path "Friends.json"; + ]; rml:referenceFormulation rml:JSONPath; - rml:iterator "$.[*]"; + rml:iterator "$[*]"; ]; rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{id}"; + rml:template "http://example.org/{$.id}"; ]; rml:predicateObjectMap [ a rml:PredicateObjectMap; rml:predicateMap [ a rml:PredicateMap; rml:constant foaf:name; ]; rml:objectMap [ a rml:ObjectMap; - rml:reference "name"; + rml:reference "$.name"; rml:logicalTarget <#TargetDump1>; ]; ]; @@ -32,14 +29,15 @@ rml:constant foaf:age; ]; rml:objectMap [ a rml:ObjectMap; - rml:reference "age"; + rml:reference "$.age"; ]; ]; . <#TargetDump1> a rml:LogicalTarget; - rml:target [ a rml:Target, void:Dataset; - void:dataDump ; + rml:target [ a rml:FilePath; + rml:root rml:CurrentWorkingDirectory; + rml:path "./dump1.nq"; ]; rml:serialization formats:N-Quads; . diff --git a/src/test/resources/rml-io/RMLTTC0001d/Friends.json b/src/test/resources/rml-io/RMLTTC0001d/Friends.json new file mode 100644 index 00000000..8e554498 --- /dev/null +++ b/src/test/resources/rml-io/RMLTTC0001d/Friends.json @@ -0,0 +1,27 @@ +[ + { + "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 + } +] diff --git a/src/test/resources/rml-io/RMLTTC0001d/README.md b/src/test/resources/rml-io/RMLTTC0001d/README.md new file mode 100644 index 00000000..86577052 --- /dev/null +++ b/src/test/resources/rml-io/RMLTTC0001d/README.md @@ -0,0 +1,113 @@ +## RMLTTC0001d + +**Title**: Single Target: Graph Map + +**Description**: Test exporting all triples within a named graph to a single Target. + +**Error expected?** No + +**Input** +``` +[ + { + "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 + } +] + +``` + +**Mapping** +``` +@prefix rml: . +@prefix foaf: . +@prefix dcat: . +@prefix formats: . +@prefix ex: . +@base . + +<#TriplesMap> a rml:TriplesMap; + rml:logicalSource [ a rml:LogicalSource; + rml:source [ a rml:FilePath; + rml:root rml:MappingDirectory; + rml:path "Friends.json"; + ]; + rml:referenceFormulation rml:JSONPath; + rml:iterator "$[*]"; + ]; + rml:subjectMap [ a rml:SubjectMap; + rml:template "http://example.org/{$.id}"; + rml:graphMap [ a rml:GraphMap; + rml:constant ex:PeopleGraph; + rml:logicalTarget <#TargetDump1>; + ]; + ]; + rml:predicateObjectMap [ a rml:PredicateObjectMap; + rml:predicateMap [ a rml:PredicateMap; + rml:constant foaf:name; + ]; + rml:objectMap [ a rml:ObjectMap; + rml:reference "$.name"; + ]; + ]; + rml:predicateObjectMap [ a rml:PredicateObjectMap; + rml:predicateMap [ a rml:PredicateMap; + rml:constant foaf:age; + ]; + rml:objectMap [ a rml:ObjectMap; + rml:reference "$.age"; + ]; + ]; +. + +<#TargetDump1> a rml:LogicalTarget; + rml:target [ a rml:FilePath; + rml:root rml:CurrentWorkingDirectory; + rml:path "./dump1.nq"; + ]; + rml:serialization formats:N-Quads; +. + +``` + +**Output 1** +``` + +``` + +**Output 2** +``` + "33" . + "Monica Geller" . + "34" . + "Rachel Green" . + "35" . + "Joey Tribbiani" . + "36" . + "Chandler Bing" . + "37" . + "Ross Geller" . + +``` + diff --git a/src/test/resources/rml-io/RMLTTC0001d/mapping.ttl b/src/test/resources/rml-io/RMLTTC0001d/mapping.ttl index 90069a89..40b34da4 100644 --- a/src/test/resources/rml-io/RMLTTC0001d/mapping.ttl +++ b/src/test/resources/rml-io/RMLTTC0001d/mapping.ttl @@ -1,23 +1,21 @@ @prefix rml: . @prefix foaf: . @prefix dcat: . -@prefix void: . @prefix formats: . @prefix ex: . @base . -<#DCATSourceAccess> a rml:Source, dcat:Distribution; - dcat:downloadURL ; -. - <#TriplesMap> a rml:TriplesMap; rml:logicalSource [ a rml:LogicalSource; - rml:source <#DCATSourceAccess>; + rml:source [ a rml:FilePath; + rml:root rml:MappingDirectory; + rml:path "Friends.json"; + ]; rml:referenceFormulation rml:JSONPath; - rml:iterator "$.[*]"; + rml:iterator "$[*]"; ]; rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{id}"; + rml:template "http://example.org/{$.id}"; rml:graphMap [ a rml:GraphMap; rml:constant ex:PeopleGraph; rml:logicalTarget <#TargetDump1>; @@ -28,7 +26,7 @@ rml:constant foaf:name; ]; rml:objectMap [ a rml:ObjectMap; - rml:reference "name"; + rml:reference "$.name"; ]; ]; rml:predicateObjectMap [ a rml:PredicateObjectMap; @@ -36,14 +34,15 @@ rml:constant foaf:age; ]; rml:objectMap [ a rml:ObjectMap; - rml:reference "age"; + rml:reference "$.age"; ]; ]; . <#TargetDump1> a rml:LogicalTarget; - rml:target [ a rml:Target, void:Dataset; - void:dataDump ; + rml:target [ a rml:FilePath; + rml:root rml:CurrentWorkingDirectory; + rml:path "./dump1.nq"; ]; rml:serialization formats:N-Quads; . diff --git a/src/test/resources/rml-io/RMLTTC0001e/Friends.json b/src/test/resources/rml-io/RMLTTC0001e/Friends.json new file mode 100644 index 00000000..8e554498 --- /dev/null +++ b/src/test/resources/rml-io/RMLTTC0001e/Friends.json @@ -0,0 +1,27 @@ +[ + { + "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 + } +] diff --git a/src/test/resources/rml-io/RMLTTC0001e/README.md b/src/test/resources/rml-io/RMLTTC0001e/README.md new file mode 100644 index 00000000..ae87dfe1 --- /dev/null +++ b/src/test/resources/rml-io/RMLTTC0001e/README.md @@ -0,0 +1,111 @@ +## RMLTTC0001e + +**Title**: Single Target: Language Map + +**Description**: Test exporting all triples with a given language tag to a single Target. + +**Error expected?** No + +**Input** +``` +[ + { + "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 + } +] + +``` + +**Mapping** +``` +@prefix rml: . +@prefix foaf: . +@prefix formats: . +@base . + +<#TriplesMap> a rml:TriplesMap; + rml:logicalSource [ a rml:LogicalSource; + rml:source [ a rml:FilePath; + rml:root rml:MappingDirectory; + rml:path "Friends.json"; + ]; + rml:referenceFormulation rml:JSONPath; + rml:iterator "$[*]"; + ]; + rml:subjectMap [ a rml:SubjectMap; + rml:template "http://example.org/{$.id}"; + ]; + rml:predicateObjectMap [ a rml:PredicateObjectMap; + rml:predicateMap [ a rml:PredicateMap; + rml:constant foaf:name; + ]; + rml:objectMap [ a rml:ObjectMap; + rml:reference "$.name"; + rml:languageMap [ a rml:LanguageMap; + rml:constant "en"; + rml:logicalTarget <#TargetDump1>; + ]; + ]; + ]; + rml:predicateObjectMap [ a rml:PredicateObjectMap; + rml:predicateMap [ a rml:PredicateMap; + rml:constant foaf:age; + ]; + rml:objectMap [ a rml:ObjectMap; + rml:reference "$.age"; + ]; + ]; +. + +<#TargetDump1> a rml:LogicalTarget; + rml:target [ a rml:FilePath; + rml:root rml:CurrentWorkingDirectory; + rml:path "./dump1.nq"; + ]; + rml:serialization formats:N-Quads; +. + +``` + +**Output 1** +``` + "33". + "34". + "35". + "36". + "37". + +``` + +**Output 2** +``` + "Monica Geller"@en . + "Rachel Green"@en . + "Joey Tribbiani"@en . + "Chandler Bing"@en . + "Ross Geller"@en . + +``` + diff --git a/src/test/resources/rml-io/RMLTTC0001e/default.nq b/src/test/resources/rml-io/RMLTTC0001e/default.nq index ad87bcca..f2e60c86 100644 --- a/src/test/resources/rml-io/RMLTTC0001e/default.nq +++ b/src/test/resources/rml-io/RMLTTC0001e/default.nq @@ -1,5 +1,5 @@ - "33". - "34". - "35". - "36". - "37". + "33"^^. + "34"^^. + "35"^^. + "36"^^. + "37"^^. diff --git a/src/test/resources/rml-io/RMLTTC0001e/mapping.ttl b/src/test/resources/rml-io/RMLTTC0001e/mapping.ttl index b9b0e008..51a5bbf2 100644 --- a/src/test/resources/rml-io/RMLTTC0001e/mapping.ttl +++ b/src/test/resources/rml-io/RMLTTC0001e/mapping.ttl @@ -1,29 +1,26 @@ @prefix rml: . @prefix foaf: . -@prefix dcat: . -@prefix void: . @prefix formats: . @base . -<#DCATSourceAccess> a rml:Source, dcat:Distribution; - dcat:downloadURL ; -. - <#TriplesMap> a rml:TriplesMap; rml:logicalSource [ a rml:LogicalSource; - rml:source <#DCATSourceAccess>; + rml:source [ a rml:FilePath; + rml:root rml:MappingDirectory; + rml:path "Friends.json"; + ]; rml:referenceFormulation rml:JSONPath; - rml:iterator "$.[*]"; + rml:iterator "$[*]"; ]; rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{id}"; + rml:template "http://example.org/{$.id}"; ]; rml:predicateObjectMap [ a rml:PredicateObjectMap; rml:predicateMap [ a rml:PredicateMap; rml:constant foaf:name; ]; rml:objectMap [ a rml:ObjectMap; - rml:reference "name"; + rml:reference "$.name"; rml:languageMap [ a rml:LanguageMap; rml:constant "en"; rml:logicalTarget <#TargetDump1>; @@ -35,14 +32,15 @@ rml:constant foaf:age; ]; rml:objectMap [ a rml:ObjectMap; - rml:reference "age"; + rml:reference "$.age"; ]; ]; . <#TargetDump1> a rml:LogicalTarget; - rml:target [ a rml:Target, void:Dataset; - void:dataDump ; + rml:target [ a rml:FilePath; + rml:root rml:CurrentWorkingDirectory; + rml:path "./dump1.nq"; ]; rml:serialization formats:N-Quads; . diff --git a/src/test/resources/rml-io/RMLTTC0001f/Friends.json b/src/test/resources/rml-io/RMLTTC0001f/Friends.json new file mode 100644 index 00000000..8e554498 --- /dev/null +++ b/src/test/resources/rml-io/RMLTTC0001f/Friends.json @@ -0,0 +1,27 @@ +[ + { + "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 + } +] diff --git a/src/test/resources/rml-io/RMLTTC0001f/README.md b/src/test/resources/rml-io/RMLTTC0001f/README.md new file mode 100644 index 00000000..1fb6a2b5 --- /dev/null +++ b/src/test/resources/rml-io/RMLTTC0001f/README.md @@ -0,0 +1,112 @@ +## RMLTTC0001f + +**Title**: Single Target: Datatype Map + +**Description**: Test exporting all triples with a given datatype to a single Target. + +**Error expected?** No + +**Input** +``` +[ + { + "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 + } +] + +``` + +**Mapping** +``` +@prefix rml: . +@prefix foaf: . +@prefix xsd: . +@prefix formats: . +@base . + +<#TriplesMap> a rml:TriplesMap; + rml:logicalSource [ a rml:LogicalSource; + rml:source [ a rml:FilePath; + rml:root rml:MappingDirectory; + rml:path "Friends.json"; + ]; + rml:referenceFormulation rml:JSONPath; + rml:iterator "$[*]"; + ]; + rml:subjectMap [ a rml:SubjectMap; + rml:template "http://example.org/{$.id}"; + ]; + rml:predicateObjectMap [ a rml:PredicateObjectMap; + rml:predicateMap [ a rml:PredicateMap; + rml:constant foaf:name; + ]; + rml:objectMap [ a rml:ObjectMap; + rml:reference "$.name"; + ]; + ]; + rml:predicateObjectMap [ a rml:PredicateObjectMap; + rml:predicateMap [ a rml:PredicateMap; + rml:constant foaf:age; + ]; + rml:objectMap [ a rml:ObjectMap; + rml:reference "$.age"; + rml:datatypeMap [ a rml:DatatypeMap; + rml:constant xsd:integer; + rml:logicalTarget <#TargetDump1>; + ]; + ]; + ]; +. + +<#TargetDump1> a rml:LogicalTarget; + rml:target [ a rml:FilePath; + rml:root rml:CurrentWorkingDirectory; + rml:path "./dump1.nq"; + ]; + rml:serialization formats:N-Quads; +. + +``` + +**Output 1** +``` + "Monica Geller" . + "Rachel Green" . + "Joey Tribbiani" . + "Chandler Bing" . + "Ross Geller" . + +``` + +**Output 2** +``` + "33"^^. + "34"^^. + "35"^^. + "36"^^. + "37"^^. + +``` + diff --git a/src/test/resources/rml-io/RMLTTC0001f/mapping.ttl b/src/test/resources/rml-io/RMLTTC0001f/mapping.ttl index aaa44ddf..e8f8fac1 100644 --- a/src/test/resources/rml-io/RMLTTC0001f/mapping.ttl +++ b/src/test/resources/rml-io/RMLTTC0001f/mapping.ttl @@ -1,30 +1,27 @@ @prefix rml: . @prefix foaf: . -@prefix dcat: . -@prefix void: . @prefix xsd: . @prefix formats: . @base . -<#DCATSourceAccess> a rml:Source, dcat:Distribution; - dcat:downloadURL ; -. - <#TriplesMap> a rml:TriplesMap; rml:logicalSource [ a rml:LogicalSource; - rml:source <#DCATSourceAccess>; + rml:source [ a rml:FilePath; + rml:root rml:MappingDirectory; + rml:path "Friends.json"; + ]; rml:referenceFormulation rml:JSONPath; - rml:iterator "$.[*]"; + rml:iterator "$[*]"; ]; rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{id}"; + rml:template "http://example.org/{$.id}"; ]; rml:predicateObjectMap [ a rml:PredicateObjectMap; rml:predicateMap [ a rml:PredicateMap; rml:constant foaf:name; ]; rml:objectMap [ a rml:ObjectMap; - rml:reference "name"; + rml:reference "$.name"; ]; ]; rml:predicateObjectMap [ a rml:PredicateObjectMap; @@ -32,7 +29,7 @@ rml:constant foaf:age; ]; rml:objectMap [ a rml:ObjectMap; - rml:reference "age"; + rml:reference "$.age"; rml:datatypeMap [ a rml:DatatypeMap; rml:constant xsd:integer; rml:logicalTarget <#TargetDump1>; @@ -42,8 +39,9 @@ . <#TargetDump1> a rml:LogicalTarget; - rml:target [ a rml:Target, void:Dataset; - void:dataDump ; + rml:target [ a rml:FilePath; + rml:root rml:CurrentWorkingDirectory; + rml:path "./dump1.nq"; ]; rml:serialization formats:N-Quads; . diff --git a/src/test/resources/rml-io/RMLTTC0002a/Friends.json b/src/test/resources/rml-io/RMLTTC0002a/Friends.json new file mode 100644 index 00000000..8e554498 --- /dev/null +++ b/src/test/resources/rml-io/RMLTTC0002a/Friends.json @@ -0,0 +1,27 @@ +[ + { + "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 + } +] diff --git a/src/test/resources/rml-io/RMLTTC0002a/README.md b/src/test/resources/rml-io/RMLTTC0002a/README.md new file mode 100644 index 00000000..299577a2 --- /dev/null +++ b/src/test/resources/rml-io/RMLTTC0002a/README.md @@ -0,0 +1,132 @@ +## RMLTTC0002a + +**Title**: Multiple Targets: Same Term Map + +**Description**: Test exporting all triples to multiple Targets in the same Term Map. + +**Error expected?** No + +**Input** +``` +[ + { + "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 + } +] + +``` + +**Mapping** +``` +@prefix rml: . +@prefix foaf: . +@prefix formats: . +@base . + +<#TriplesMap> a rml:TriplesMap; + rml:logicalSource [ a rml:LogicalSource; + rml:source [ a rml:FilePath; + rml:root rml:MappingDirectory; + rml:path "Friends.json"; + ]; + rml:referenceFormulation rml:JSONPath; + rml:iterator "$[*]"; + ]; + rml:subjectMap [ a rml:SubjectMap; + rml:template "http://example.org/{$.id}"; + rml:logicalTarget <#TargetDump1>; + rml:logicalTarget <#TargetDump2>; + ]; + rml:predicateObjectMap [ a rml:PredicateObjectMap; + rml:predicateMap [ a rml:PredicateMap; + rml:constant foaf:name; + ]; + rml:objectMap [ a rml:ObjectMap; + rml:reference "$.name"; + ]; + ]; + rml:predicateObjectMap [ a rml:PredicateObjectMap; + rml:predicateMap [ a rml:PredicateMap; + rml:constant foaf:age; + ]; + rml:objectMap [ a rml:ObjectMap; + rml:reference "$.age"; + ]; + ]; +. + +<#TargetDump1> a rml:LogicalTarget; + rml:target [ a rml:FilePath; + rml:root rml:CurrentWorkingDirectory; + rml:path "./dump1.nq"; + ]; + rml:serialization formats:N-Quads; +. + +<#TargetDump2> a rml:LogicalTarget; + rml:target [ a rml:FilePath; + rml:root rml:CurrentWorkingDirectory; + rml:path "./dump2.nq"; + ]; + rml:serialization formats:N-Quads; +. + +``` + +**Output 1** +``` + +``` + +**Output 2** +``` + "33" . + "Monica Geller" . + "34" . + "Rachel Green" . + "35" . + "Joey Tribbiani" . + "36" . + "Chandler Bing" . + "37" . + "Ross Geller" . + +``` + +**Output 3** +``` + "33" . + "Monica Geller" . + "34" . + "Rachel Green" . + "35" . + "Joey Tribbiani" . + "36" . + "Chandler Bing" . + "37" . + "Ross Geller" . + +``` + diff --git a/src/test/resources/rml-io/RMLTTC0002a/mapping.ttl b/src/test/resources/rml-io/RMLTTC0002a/mapping.ttl index 5c499926..a6647f3c 100644 --- a/src/test/resources/rml-io/RMLTTC0002a/mapping.ttl +++ b/src/test/resources/rml-io/RMLTTC0002a/mapping.ttl @@ -1,22 +1,19 @@ @prefix rml: . @prefix foaf: . -@prefix dcat: . -@prefix void: . @prefix formats: . @base . -<#DCATSourceAccess> a rml:Source, dcat:Distribution; - dcat:downloadURL ; -. - <#TriplesMap> a rml:TriplesMap; rml:logicalSource [ a rml:LogicalSource; - rml:source <#DCATSourceAccess>; + rml:source [ a rml:FilePath; + rml:root rml:MappingDirectory; + rml:path "Friends.json"; + ]; rml:referenceFormulation rml:JSONPath; - rml:iterator "$.[*]"; + rml:iterator "$[*]"; ]; rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{id}"; + rml:template "http://example.org/{$.id}"; rml:logicalTarget <#TargetDump1>; rml:logicalTarget <#TargetDump2>; ]; @@ -25,7 +22,7 @@ rml:constant foaf:name; ]; rml:objectMap [ a rml:ObjectMap; - rml:reference "name"; + rml:reference "$.name"; ]; ]; rml:predicateObjectMap [ a rml:PredicateObjectMap; @@ -33,21 +30,23 @@ rml:constant foaf:age; ]; rml:objectMap [ a rml:ObjectMap; - rml:reference "age"; + rml:reference "$.age"; ]; ]; . <#TargetDump1> a rml:LogicalTarget; - rml:target [ a rml:Target, void:Dataset; - void:dataDump ; + rml:target [ a rml:FilePath; + rml:root rml:CurrentWorkingDirectory; + rml:path "./dump1.nq"; ]; rml:serialization formats:N-Quads; . <#TargetDump2> a rml:LogicalTarget; - rml:target [ a rml:Target, void:Dataset; - void:dataDump ; + rml:target [ a rml:FilePath; + rml:root rml:CurrentWorkingDirectory; + rml:path "./dump2.nq"; ]; rml:serialization formats:N-Quads; . diff --git a/src/test/resources/rml-io/RMLTTC0002b/Friends.json b/src/test/resources/rml-io/RMLTTC0002b/Friends.json new file mode 100644 index 00000000..8e554498 --- /dev/null +++ b/src/test/resources/rml-io/RMLTTC0002b/Friends.json @@ -0,0 +1,27 @@ +[ + { + "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 + } +] diff --git a/src/test/resources/rml-io/RMLTTC0002b/README.md b/src/test/resources/rml-io/RMLTTC0002b/README.md new file mode 100644 index 00000000..f24589b1 --- /dev/null +++ b/src/test/resources/rml-io/RMLTTC0002b/README.md @@ -0,0 +1,127 @@ +## RMLTTC0002b + +**Title**: Multiple Targets: Subject Map and Predicate Map + +**Description**: Test exporting all triples to a Target in a Subject Map and a Target in a Predicate Map. + +**Error expected?** No + +**Input** +``` +[ + { + "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 + } +] + +``` + +**Mapping** +``` +@prefix rml: . +@prefix foaf: . +@prefix formats: . +@base . + +<#TriplesMap> a rml:TriplesMap; + rml:logicalSource [ a rml:LogicalSource; + rml:source [ a rml:FilePath; + rml:root rml:MappingDirectory; + rml:path "Friends.json"; + ]; + rml:referenceFormulation rml:JSONPath; + rml:iterator "$[*]"; + ]; + rml:subjectMap [ a rml:SubjectMap; + rml:template "http://example.org/{$.id}"; + rml:logicalTarget <#TargetDump1>; + ]; + rml:predicateObjectMap [ a rml:PredicateObjectMap; + rml:predicateMap [ a rml:PredicateMap; + rml:constant foaf:name; + ]; + rml:objectMap [ a rml:ObjectMap; + rml:reference "$.name"; + ]; + ]; + rml:predicateObjectMap [ a rml:PredicateObjectMap; + rml:predicateMap [ a rml:PredicateMap; + rml:constant foaf:age; + rml:logicalTarget <#TargetDump2>; + ]; + rml:objectMap [ a rml:ObjectMap; + rml:reference "$.age"; + ]; + ]; +. + +<#TargetDump1> a rml:LogicalTarget; + rml:target [ a rml:FilePath; + rml:root rml:CurrentWorkingDirectory; + rml:path "./dump1.nq"; + ]; + rml:serialization formats:N-Quads; +. + +<#TargetDump2> a rml:LogicalTarget; + rml:target [ a rml:FilePath; + rml:root rml:CurrentWorkingDirectory; + rml:path "./dump2.nq"; + ]; + rml:serialization formats:N-Quads; +. + +``` + +**Output 1** +``` + +``` + +**Output 2** +``` + "33" . + "Monica Geller" . + "34" . + "Rachel Green" . + "35" . + "Joey Tribbiani" . + "36" . + "Chandler Bing" . + "37" . + "Ross Geller" . + +``` + +**Output 3** +``` + "33" . + "34" . + "35" . + "36" . + "37" . + +``` + diff --git a/src/test/resources/rml-io/RMLTTC0002b/mapping.ttl b/src/test/resources/rml-io/RMLTTC0002b/mapping.ttl index 468b3f07..d218116d 100644 --- a/src/test/resources/rml-io/RMLTTC0002b/mapping.ttl +++ b/src/test/resources/rml-io/RMLTTC0002b/mapping.ttl @@ -1,22 +1,19 @@ @prefix rml: . @prefix foaf: . -@prefix dcat: . -@prefix void: . @prefix formats: . @base . -<#DCATSourceAccess> a rml:Source, dcat:Distribution; - dcat:downloadURL ; -. - <#TriplesMap> a rml:TriplesMap; rml:logicalSource [ a rml:LogicalSource; - rml:source <#DCATSourceAccess>; + rml:source [ a rml:FilePath; + rml:root rml:MappingDirectory; + rml:path "Friends.json"; + ]; rml:referenceFormulation rml:JSONPath; - rml:iterator "$.[*]"; + rml:iterator "$[*]"; ]; rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{id}"; + rml:template "http://example.org/{$.id}"; rml:logicalTarget <#TargetDump1>; ]; rml:predicateObjectMap [ a rml:PredicateObjectMap; @@ -24,7 +21,7 @@ rml:constant foaf:name; ]; rml:objectMap [ a rml:ObjectMap; - rml:reference "name"; + rml:reference "$.name"; ]; ]; rml:predicateObjectMap [ a rml:PredicateObjectMap; @@ -33,21 +30,23 @@ rml:logicalTarget <#TargetDump2>; ]; rml:objectMap [ a rml:ObjectMap; - rml:reference "age"; + rml:reference "$.age"; ]; ]; . <#TargetDump1> a rml:LogicalTarget; - rml:target [ a rml:Target, void:Dataset; - void:dataDump ; + rml:target [ a rml:FilePath; + rml:root rml:CurrentWorkingDirectory; + rml:path "./dump1.nq"; ]; rml:serialization formats:N-Quads; . <#TargetDump2> a rml:LogicalTarget; - rml:target [ a rml:Target, void:Dataset; - void:dataDump ; + rml:target [ a rml:FilePath; + rml:root rml:CurrentWorkingDirectory; + rml:path "./dump2.nq"; ]; rml:serialization formats:N-Quads; . diff --git a/src/test/resources/rml-io/RMLTTC0002c/Friends.json b/src/test/resources/rml-io/RMLTTC0002c/Friends.json new file mode 100644 index 00000000..8e554498 --- /dev/null +++ b/src/test/resources/rml-io/RMLTTC0002c/Friends.json @@ -0,0 +1,27 @@ +[ + { + "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 + } +] diff --git a/src/test/resources/rml-io/RMLTTC0002c/README.md b/src/test/resources/rml-io/RMLTTC0002c/README.md new file mode 100644 index 00000000..e1c45b0d --- /dev/null +++ b/src/test/resources/rml-io/RMLTTC0002c/README.md @@ -0,0 +1,127 @@ +## RMLTTC0002c + +**Title**: Multiple Targets: Subject Map and Object Map + +**Description**: Test exporting all triples to a Target in a Subject Map and a Target in a Object Map. + +**Error expected?** No + +**Input** +``` +[ + { + "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 + } +] + +``` + +**Mapping** +``` +@prefix rml: . +@prefix foaf: . +@prefix formats: . +@base . + +<#TriplesMap> a rml:TriplesMap; + rml:logicalSource [ a rml:LogicalSource; + rml:source [ a rml:FilePath; + rml:root rml:MappingDirectory; + rml:path "Friends.json"; + ]; + rml:referenceFormulation rml:JSONPath; + rml:iterator "$[*]"; + ]; + rml:subjectMap [ a rml:SubjectMap; + rml:template "http://example.org/{$.id}"; + rml:logicalTarget <#TargetDump1>; + ]; + rml:predicateObjectMap [ a rml:PredicateObjectMap; + rml:predicateMap [ a rml:PredicateMap; + rml:constant foaf:name; + ]; + rml:objectMap [ a rml:ObjectMap; + rml:reference "$.name"; + ]; + ]; + rml:predicateObjectMap [ a rml:PredicateObjectMap; + rml:predicateMap [ a rml:PredicateMap; + rml:constant foaf:age; + ]; + rml:objectMap [ a rml:ObjectMap; + rml:reference "$.age"; + rml:logicalTarget <#TargetDump2>; + ]; + ]; +. + +<#TargetDump1> a rml:LogicalTarget; + rml:target [ a rml:FilePath; + rml:root rml:CurrentWorkingDirectory; + rml:path "./dump1.nq"; + ]; + rml:serialization formats:N-Quads; +. + +<#TargetDump2> a rml:LogicalTarget; + rml:target [ a rml:FilePath; + rml:root rml:CurrentWorkingDirectory; + rml:path "./dump2.nq"; + ]; + rml:serialization formats:N-Quads; +. + +``` + +**Output 1** +``` + +``` + +**Output 2** +``` + "33" . + "Monica Geller" . + "34" . + "Rachel Green" . + "35" . + "Joey Tribbiani" . + "36" . + "Chandler Bing" . + "37" . + "Ross Geller" . + +``` + +**Output 3** +``` + "33" . + "34" . + "35" . + "36" . + "37" . + +``` + diff --git a/src/test/resources/rml-io/RMLTTC0002c/mapping.ttl b/src/test/resources/rml-io/RMLTTC0002c/mapping.ttl index 814dcdb9..d5466bdc 100644 --- a/src/test/resources/rml-io/RMLTTC0002c/mapping.ttl +++ b/src/test/resources/rml-io/RMLTTC0002c/mapping.ttl @@ -1,22 +1,19 @@ @prefix rml: . @prefix foaf: . -@prefix dcat: . -@prefix void: . @prefix formats: . @base . -<#DCATSourceAccess> a rml:Source, dcat:Distribution; - dcat:downloadURL ; -. - <#TriplesMap> a rml:TriplesMap; rml:logicalSource [ a rml:LogicalSource; - rml:source <#DCATSourceAccess>; + rml:source [ a rml:FilePath; + rml:root rml:MappingDirectory; + rml:path "Friends.json"; + ]; rml:referenceFormulation rml:JSONPath; - rml:iterator "$.[*]"; + rml:iterator "$[*]"; ]; rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{id}"; + rml:template "http://example.org/{$.id}"; rml:logicalTarget <#TargetDump1>; ]; rml:predicateObjectMap [ a rml:PredicateObjectMap; @@ -24,7 +21,7 @@ rml:constant foaf:name; ]; rml:objectMap [ a rml:ObjectMap; - rml:reference "name"; + rml:reference "$.name"; ]; ]; rml:predicateObjectMap [ a rml:PredicateObjectMap; @@ -32,22 +29,24 @@ rml:constant foaf:age; ]; rml:objectMap [ a rml:ObjectMap; - rml:reference "age"; + rml:reference "$.age"; rml:logicalTarget <#TargetDump2>; ]; ]; . <#TargetDump1> a rml:LogicalTarget; - rml:target [ a rml:Target, void:Dataset; - void:dataDump ; + rml:target [ a rml:FilePath; + rml:root rml:CurrentWorkingDirectory; + rml:path "./dump1.nq"; ]; rml:serialization formats:N-Quads; . <#TargetDump2> a rml:LogicalTarget; - rml:target [ a rml:Target, void:Dataset; - void:dataDump ; + rml:target [ a rml:FilePath; + rml:root rml:CurrentWorkingDirectory; + rml:path "./dump2.nq"; ]; rml:serialization formats:N-Quads; . diff --git a/src/test/resources/rml-io/RMLTTC0002d/Friends.json b/src/test/resources/rml-io/RMLTTC0002d/Friends.json new file mode 100644 index 00000000..8e554498 --- /dev/null +++ b/src/test/resources/rml-io/RMLTTC0002d/Friends.json @@ -0,0 +1,27 @@ +[ + { + "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 + } +] diff --git a/src/test/resources/rml-io/RMLTTC0002d/README.md b/src/test/resources/rml-io/RMLTTC0002d/README.md new file mode 100644 index 00000000..76f1adfc --- /dev/null +++ b/src/test/resources/rml-io/RMLTTC0002d/README.md @@ -0,0 +1,122 @@ +## RMLTTC0002d + +**Title**: Multiple Targets: Predicate Map and Object Map + +**Description**: Test exporting all triples to a Target in a Predicate Map and a Target in a Object Map. + +**Error expected?** No + +**Input** +``` +[ + { + "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 + } +] + +``` + +**Mapping** +``` +@prefix rml: . +@prefix foaf: . +@prefix formats: . +@base . + +<#TriplesMap> a rml:TriplesMap; + rml:logicalSource [ a rml:LogicalSource; + rml:source [ a rml:FilePath; + rml:root rml:MappingDirectory; + rml:path "Friends.json"; + ]; + rml:referenceFormulation rml:JSONPath; + rml:iterator "$[*]"; + ]; + rml:subjectMap [ a rml:SubjectMap; + rml:template "http://example.org/{$.id}"; + ]; + rml:predicateObjectMap [ a rml:PredicateObjectMap; + rml:predicateMap [ a rml:PredicateMap; + rml:constant foaf:name; + rml:logicalTarget <#TargetDump1>; + ]; + rml:objectMap [ a rml:ObjectMap; + rml:reference "$.name"; + ]; + ]; + rml:predicateObjectMap [ a rml:PredicateObjectMap; + rml:predicateMap [ a rml:PredicateMap; + rml:constant foaf:age; + ]; + rml:objectMap [ a rml:ObjectMap; + rml:reference "$.age"; + rml:logicalTarget <#TargetDump2>; + ]; + ]; +. + +<#TargetDump1> a rml:LogicalTarget; + rml:target [ a rml:FilePath; + rml:root rml:CurrentWorkingDirectory; + rml:path "./dump1.nq"; + ]; + rml:serialization formats:N-Quads; +. + +<#TargetDump2> a rml:LogicalTarget; + rml:target [ a rml:FilePath; + rml:root rml:CurrentWorkingDirectory; + rml:path "./dump2.nq"; + ]; + rml:serialization formats:N-Quads; +. + +``` + +**Output 1** +``` + +``` + +**Output 2** +``` + "Monica Geller" . + "Rachel Green" . + "Joey Tribbiani" . + "Chandler Bing" . + "Ross Geller" . + +``` + +**Output 3** +``` + "33" . + "34" . + "35" . + "36" . + "37" . + +``` + diff --git a/src/test/resources/rml-io/RMLTTC0002d/mapping.ttl b/src/test/resources/rml-io/RMLTTC0002d/mapping.ttl index ff734be5..c3833569 100644 --- a/src/test/resources/rml-io/RMLTTC0002d/mapping.ttl +++ b/src/test/resources/rml-io/RMLTTC0002d/mapping.ttl @@ -1,22 +1,19 @@ @prefix rml: . @prefix foaf: . -@prefix dcat: . -@prefix void: . @prefix formats: . @base . -<#DCATSourceAccess> a rml:Source, dcat:Distribution; - dcat:downloadURL ; -. - <#TriplesMap> a rml:TriplesMap; rml:logicalSource [ a rml:LogicalSource; - rml:source <#DCATSourceAccess>; + rml:source [ a rml:FilePath; + rml:root rml:MappingDirectory; + rml:path "Friends.json"; + ]; rml:referenceFormulation rml:JSONPath; - rml:iterator "$.[*]"; + rml:iterator "$[*]"; ]; rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{id}"; + rml:template "http://example.org/{$.id}"; ]; rml:predicateObjectMap [ a rml:PredicateObjectMap; rml:predicateMap [ a rml:PredicateMap; @@ -24,7 +21,7 @@ rml:logicalTarget <#TargetDump1>; ]; rml:objectMap [ a rml:ObjectMap; - rml:reference "name"; + rml:reference "$.name"; ]; ]; rml:predicateObjectMap [ a rml:PredicateObjectMap; @@ -32,22 +29,24 @@ rml:constant foaf:age; ]; rml:objectMap [ a rml:ObjectMap; - rml:reference "age"; + rml:reference "$.age"; rml:logicalTarget <#TargetDump2>; ]; ]; . <#TargetDump1> a rml:LogicalTarget; - rml:target [ a rml:Target, void:Dataset; - void:dataDump ; + rml:target [ a rml:FilePath; + rml:root rml:CurrentWorkingDirectory; + rml:path "./dump1.nq"; ]; rml:serialization formats:N-Quads; . <#TargetDump2> a rml:LogicalTarget; - rml:target [ a rml:Target, void:Dataset; - void:dataDump ; + rml:target [ a rml:FilePath; + rml:root rml:CurrentWorkingDirectory; + rml:path "./dump2.nq"; ]; rml:serialization formats:N-Quads; . diff --git a/src/test/resources/rml-io/RMLTTC0002e/Friends.json b/src/test/resources/rml-io/RMLTTC0002e/Friends.json new file mode 100644 index 00000000..8e554498 --- /dev/null +++ b/src/test/resources/rml-io/RMLTTC0002e/Friends.json @@ -0,0 +1,27 @@ +[ + { + "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 + } +] diff --git a/src/test/resources/rml-io/RMLTTC0002e/README.md b/src/test/resources/rml-io/RMLTTC0002e/README.md new file mode 100644 index 00000000..73346493 --- /dev/null +++ b/src/test/resources/rml-io/RMLTTC0002e/README.md @@ -0,0 +1,131 @@ +## RMLTTC0002e + +**Title**: Multiple Targets: Subject Map, Predicate Map, and Object Map + +**Description**: Test exporting all triples to a Target in a Subject Map, a Target in a Predicate Map, and a Target in a Object Map. + +**Error expected?** No + +**Input** +``` +[ + { + "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 + } +] + +``` + +**Mapping** +``` +@prefix rml: . +@prefix foaf: . +@prefix formats: . +@base . + +<#TriplesMap> a rml:TriplesMap; + rml:logicalSource [ a rml:LogicalSource; + rml:source [ a rml:FilePath; + rml:root rml:MappingDirectory; + rml:path "Friends.json"; + ]; + rml:referenceFormulation rml:JSONPath; + rml:iterator "$[*]"; + ]; + rml:subjectMap [ a rml:SubjectMap; + rml:template "http://example.org/{$.id}"; + rml:logicalTarget <#TargetDump3>; + ]; + rml:predicateObjectMap [ a rml:PredicateObjectMap; + rml:predicateMap [ a rml:PredicateMap; + rml:constant foaf:name; + rml:logicalTarget <#TargetDump1>; + ]; + rml:objectMap [ a rml:ObjectMap; + rml:reference "$.name"; + ]; + ]; + rml:predicateObjectMap [ a rml:PredicateObjectMap; + rml:predicateMap [ a rml:PredicateMap; + rml:constant foaf:age; + ]; + rml:objectMap [ a rml:ObjectMap; + rml:reference "$.age"; + rml:logicalTarget <#TargetDump2>; + ]; + ]; +. + +<#TargetDump1> a rml:LogicalTarget; + rml:target [ a rml:FilePath; + rml:root rml:CurrentWorkingDirectory; + rml:path "./dump1.nq"; + ]; + rml:serialization formats:N-Quads; +. + +<#TargetDump2> a rml:LogicalTarget; + rml:target [ a rml:FilePath; + rml:root rml:CurrentWorkingDirectory; + rml:path "./dump2.nq"; + ]; + rml:serialization formats:N-Quads; +. + +<#TargetDump3> a rml:LogicalTarget; + rml:target [ a rml:FilePath; + rml:root rml:CurrentWorkingDirectory; + rml:path "./dump3.nq"; + ]; + rml:serialization formats:N-Quads; +. + +``` + +**Output 1** +``` + +``` + +**Output 2** +``` + "Monica Geller" . + "Rachel Green" . + "Joey Tribbiani" . + "Chandler Bing" . + "Ross Geller" . + +``` + +**Output 3** +``` + "33" . + "34" . + "35" . + "36" . + "37" . + +``` + diff --git a/src/test/resources/rml-io/RMLTTC0002e/mapping.ttl b/src/test/resources/rml-io/RMLTTC0002e/mapping.ttl index 5ce65631..9b7a9672 100644 --- a/src/test/resources/rml-io/RMLTTC0002e/mapping.ttl +++ b/src/test/resources/rml-io/RMLTTC0002e/mapping.ttl @@ -1,22 +1,19 @@ @prefix rml: . @prefix foaf: . -@prefix dcat: . -@prefix void: . @prefix formats: . @base . -<#DCATSourceAccess> a rml:Source, dcat:Distribution; - dcat:downloadURL ; -. - <#TriplesMap> a rml:TriplesMap; rml:logicalSource [ a rml:LogicalSource; - rml:source <#DCATSourceAccess>; + rml:source [ a rml:FilePath; + rml:root rml:MappingDirectory; + rml:path "Friends.json"; + ]; rml:referenceFormulation rml:JSONPath; - rml:iterator "$.[*]"; + rml:iterator "$[*]"; ]; rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{id}"; + rml:template "http://example.org/{$.id}"; rml:logicalTarget <#TargetDump3>; ]; rml:predicateObjectMap [ a rml:PredicateObjectMap; @@ -25,7 +22,7 @@ rml:logicalTarget <#TargetDump1>; ]; rml:objectMap [ a rml:ObjectMap; - rml:reference "name"; + rml:reference "$.name"; ]; ]; rml:predicateObjectMap [ a rml:PredicateObjectMap; @@ -33,29 +30,32 @@ rml:constant foaf:age; ]; rml:objectMap [ a rml:ObjectMap; - rml:reference "age"; + rml:reference "$.age"; rml:logicalTarget <#TargetDump2>; ]; ]; . <#TargetDump1> a rml:LogicalTarget; - rml:target [ a rml:Target, void:Dataset; - void:dataDump ; + rml:target [ a rml:FilePath; + rml:root rml:CurrentWorkingDirectory; + rml:path "./dump1.nq"; ]; rml:serialization formats:N-Quads; . <#TargetDump2> a rml:LogicalTarget; - rml:target [ a rml:Target, void:Dataset; - void:dataDump ; + rml:target [ a rml:FilePath; + rml:root rml:CurrentWorkingDirectory; + rml:path "./dump2.nq"; ]; rml:serialization formats:N-Quads; . <#TargetDump3> a rml:LogicalTarget; - rml:target [ a rml:Target, void:Dataset; - void:dataDump ; + rml:target [ a rml:FilePath; + rml:root rml:CurrentWorkingDirectory; + rml:path "./dump3.nq"; ]; rml:serialization formats:N-Quads; . diff --git a/src/test/resources/rml-io/RMLTTC0002f/Friends.json b/src/test/resources/rml-io/RMLTTC0002f/Friends.json new file mode 100644 index 00000000..8e554498 --- /dev/null +++ b/src/test/resources/rml-io/RMLTTC0002f/Friends.json @@ -0,0 +1,27 @@ +[ + { + "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 + } +] diff --git a/src/test/resources/rml-io/RMLTTC0002f/README.md b/src/test/resources/rml-io/RMLTTC0002f/README.md new file mode 100644 index 00000000..3e480183 --- /dev/null +++ b/src/test/resources/rml-io/RMLTTC0002f/README.md @@ -0,0 +1,131 @@ +## RMLTTC0002f + +**Title**: Multiple Targets: Subject Map and Graph Map + +**Description**: Test exporting all triples to a Target in a Subject Map and a Target in a Graph Map. + +**Error expected?** No + +**Input** +``` +[ + { + "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 + } +] + +``` + +**Mapping** +``` +@prefix rml: . +@prefix foaf: . +@prefix formats: . +@prefix ex: . +@base . + +<#TriplesMap> a rml:TriplesMap; + rml:logicalSource [ a rml:LogicalSource; + rml:source [ a rml:FilePath; + rml:root rml:MappingDirectory; + rml:path "Friends.json"; + ]; + rml:referenceFormulation rml:JSONPath; + rml:iterator "$[*]"; + ]; + rml:subjectMap [ a rml:SubjectMap; + rml:template "http://example.org/{$.id}"; + rml:logicalTarget <#TargetDump1>; + ]; + rml:predicateObjectMap [ a rml:PredicateObjectMap; + rml:graphMap [ a rml:GraphMap; + rml:constant ex:PeopleGraph; + rml:logicalTarget <#TargetDump2>; + ]; + rml:predicateMap [ a rml:PredicateMap; + rml:constant foaf:name; + ]; + rml:objectMap [ a rml:ObjectMap; + rml:reference "$.name"; + ]; + ]; + rml:predicateObjectMap [ a rml:PredicateObjectMap; + rml:predicateMap [ a rml:PredicateMap; + rml:constant foaf:age; + ]; + rml:objectMap [ a rml:ObjectMap; + rml:reference "$.age"; + ]; + ]; +. + +<#TargetDump1> a rml:LogicalTarget; + rml:target [ a rml:FilePath; + rml:root rml:CurrentWorkingDirectory; + rml:path "./dump1.nq"; + ]; + rml:serialization formats:N-Quads; +. + +<#TargetDump2> a rml:LogicalTarget; + rml:target [ a rml:FilePath; + rml:root rml:CurrentWorkingDirectory; + rml:path "./dump2.nq"; + ]; + rml:serialization formats:N-Quads; +. + +``` + +**Output 1** +``` + +``` + +**Output 2** +``` + "33" . + "Monica Geller" . + "34" . + "Rachel Green" . + "35" . + "Joey Tribbiani" . + "36" . + "Chandler Bing" . + "37" . + "Ross Geller" . + +``` + +**Output 3** +``` + "Monica Geller" . + "Rachel Green" . + "Joey Tribbiani" . + "Chandler Bing" . + "Ross Geller" . + +``` + diff --git a/src/test/resources/rml-io/RMLTTC0002f/dump1.nq b/src/test/resources/rml-io/RMLTTC0002f/dump1.nq index adcefd04..0cbc7f5b 100644 --- a/src/test/resources/rml-io/RMLTTC0002f/dump1.nq +++ b/src/test/resources/rml-io/RMLTTC0002f/dump1.nq @@ -1,10 +1,10 @@ - "33" . - "Monica Geller" . - "34" . - "Rachel Green" . - "35" . - "Joey Tribbiani" . - "36" . - "Chandler Bing" . - "37" . - "Ross Geller" . + "33" . + "Monica Geller" . + "34" . + "Rachel Green" . + "35" . + "Joey Tribbiani" . + "36" . + "Chandler Bing" . + "37" . + "Ross Geller" . diff --git a/src/test/resources/rml-io/RMLTTC0002f/mapping.ttl b/src/test/resources/rml-io/RMLTTC0002f/mapping.ttl index 8d715f42..1e4138bb 100644 --- a/src/test/resources/rml-io/RMLTTC0002f/mapping.ttl +++ b/src/test/resources/rml-io/RMLTTC0002f/mapping.ttl @@ -1,57 +1,56 @@ -@prefix rml: . -@prefix foaf: . -@prefix dcat: . -@prefix void: . -@prefix formats: . -@prefix ex: . -@base . - -<#DCATSourceAccess> a rml:Source, dcat:Distribution; - dcat:downloadURL ; -. - -<#TriplesMap> a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:source <#DCATSourceAccess>; - rml:referenceFormulation rml:JSONPath; - rml:iterator "$.[*]"; - ]; - rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{id}"; - rml:logicalTarget <#TargetDump1>; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:graphMap [ a rml:GraphMap; - rml:constant ex:PeopleGraph; - rml:logicalTarget <#TargetDump2>; - ]; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:name; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "name"; - ]; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:age; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "age"; - ]; - ]; -. - -<#TargetDump1> a rml:LogicalTarget; - rml:target [ a rml:Target, void:Dataset; - void:dataDump ; - ]; - rml:serialization formats:N-Quads; -. - -<#TargetDump2> a rml:LogicalTarget; - rml:target [ a rml:Target, void:Dataset; - void:dataDump ; - ]; - rml:serialization formats:N-Quads; -. +@prefix rml: . +@prefix foaf: . +@prefix formats: . +@prefix ex: . +@base . + +<#TriplesMap> a rml:TriplesMap; + rml:logicalSource [ a rml:LogicalSource; + rml:source [ a rml:FilePath; + rml:root rml:MappingDirectory; + rml:path "Friends.json"; + ]; + rml:referenceFormulation rml:JSONPath; + rml:iterator "$[*]"; + ]; + rml:subjectMap [ a rml:SubjectMap; + rml:template "http://example.org/{$.id}"; + rml:logicalTarget <#TargetDump1>; + ]; + rml:predicateObjectMap [ a rml:PredicateObjectMap; + rml:graphMap [ a rml:GraphMap; + rml:constant ex:PeopleGraph; + rml:logicalTarget <#TargetDump2>; + ]; + rml:predicateMap [ a rml:PredicateMap; + rml:constant foaf:name; + ]; + rml:objectMap [ a rml:ObjectMap; + rml:reference "$.name"; + ]; + ]; + rml:predicateObjectMap [ a rml:PredicateObjectMap; + rml:predicateMap [ a rml:PredicateMap; + rml:constant foaf:age; + ]; + rml:objectMap [ a rml:ObjectMap; + rml:reference "$.age"; + ]; + ]; +. + +<#TargetDump1> a rml:LogicalTarget; + rml:target [ a rml:FilePath; + rml:root rml:CurrentWorkingDirectory; + rml:path "./dump1.nq"; + ]; + rml:serialization formats:N-Quads; +. + +<#TargetDump2> a rml:LogicalTarget; + rml:target [ a rml:FilePath; + rml:root rml:CurrentWorkingDirectory; + rml:path "./dump2.nq"; + ]; + rml:serialization formats:N-Quads; +. diff --git a/src/test/resources/rml-io/RMLTTC0002g/Friends.json b/src/test/resources/rml-io/RMLTTC0002g/Friends.json new file mode 100644 index 00000000..8e554498 --- /dev/null +++ b/src/test/resources/rml-io/RMLTTC0002g/Friends.json @@ -0,0 +1,27 @@ +[ + { + "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 + } +] diff --git a/src/test/resources/rml-io/RMLTTC0002g/README.md b/src/test/resources/rml-io/RMLTTC0002g/README.md new file mode 100644 index 00000000..957cf963 --- /dev/null +++ b/src/test/resources/rml-io/RMLTTC0002g/README.md @@ -0,0 +1,126 @@ +## RMLTTC0002g + +**Title**: Multiple Targets: Predicate Map and Graph Map + +**Description**: Test exporting all triples to a Target in a Predicate Map and a Target in a Graph Map. + +**Error expected?** No + +**Input** +``` +[ + { + "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 + } +] + +``` + +**Mapping** +``` +@prefix rml: . +@prefix foaf: . +@prefix formats: . +@prefix ex: . +@base . + +<#TriplesMap> a rml:TriplesMap; + rml:logicalSource [ a rml:LogicalSource; + rml:source [ a rml:FilePath; + rml:root rml:MappingDirectory; + rml:path "Friends.json"; + ]; + rml:referenceFormulation rml:JSONPath; + rml:iterator "$[*]"; + ]; + rml:subjectMap [ a rml:SubjectMap; + rml:template "http://example.org/{$.id}"; + ]; + rml:predicateObjectMap [ a rml:PredicateObjectMap; + rml:graphMap [ a rml:GraphMap; + rml:constant ex:PeopleGraph; + rml:logicalTarget <#TargetDump2>; + ]; + rml:predicateMap [ a rml:PredicateMap; + rml:constant foaf:name; + ]; + rml:objectMap [ a rml:ObjectMap; + rml:reference "$.name"; + ]; + ]; + rml:predicateObjectMap [ a rml:PredicateObjectMap; + rml:predicateMap [ a rml:PredicateMap; + rml:constant foaf:age; + rml:logicalTarget <#TargetDump1>; + ]; + rml:objectMap [ a rml:ObjectMap; + rml:reference "$.age"; + ]; + ]; +. + +<#TargetDump1> a rml:LogicalTarget; + rml:target [ a rml:FilePath; + rml:root rml:CurrentWorkingDirectory; + rml:path "./dump1.nq"; + ]; + rml:serialization formats:N-Quads; +. + +<#TargetDump2> a rml:LogicalTarget; + rml:target [ a rml:FilePath; + rml:root rml:CurrentWorkingDirectory; + rml:path "./dump2.nq"; + ]; + rml:serialization formats:N-Quads; +. + +``` + +**Output 1** +``` + +``` + +**Output 2** +``` + "33" . + "34" . + "35" . + "36" . + "37" . + +``` + +**Output 3** +``` + "Monica Geller" . + "Rachel Green" . + "Joey Tribbiani" . + "Chandler Bing" . + "Ross Geller" . + +``` + diff --git a/src/test/resources/rml-io/RMLTTC0002g/dump1.nq b/src/test/resources/rml-io/RMLTTC0002g/dump1.nq index 95ee6e21..42e9dfe2 100644 --- a/src/test/resources/rml-io/RMLTTC0002g/dump1.nq +++ b/src/test/resources/rml-io/RMLTTC0002g/dump1.nq @@ -1,5 +1,5 @@ - "33" . - "34" . - "35" . - "36" . - "37" . + "33" . + "34" . + "35" . + "36" . + "37" . diff --git a/src/test/resources/rml-io/RMLTTC0002g/mapping.ttl b/src/test/resources/rml-io/RMLTTC0002g/mapping.ttl index 5d428b09..a6b87c58 100644 --- a/src/test/resources/rml-io/RMLTTC0002g/mapping.ttl +++ b/src/test/resources/rml-io/RMLTTC0002g/mapping.ttl @@ -1,57 +1,56 @@ -@prefix rml: . -@prefix foaf: . -@prefix dcat: . -@prefix void: . -@prefix formats: . -@prefix ex: . -@base . - -<#DCATSourceAccess> a rml:Source, dcat:Distribution; - dcat:downloadURL ; -. - -<#TriplesMap> a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:source <#DCATSourceAccess>; - rml:referenceFormulation rml:JSONPath; - rml:iterator "$.[*]"; - ]; - rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{id}"; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:graphMap [ a rml:GraphMap; - rml:constant ex:PeopleGraph; - rml:logicalTarget <#TargetDump2>; - ]; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:name; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "name"; - ]; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:age; - rml:logicalTarget <#TargetDump1>; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "age"; - ]; - ]; -. - -<#TargetDump1> a rml:LogicalTarget; - rml:target [ a rml:Target, void:Dataset; - void:dataDump ; - ]; - rml:serialization formats:N-Quads; -. - -<#TargetDump2> a rml:LogicalTarget; - rml:target [ a rml:Target, void:Dataset; - void:dataDump ; - ]; - rml:serialization formats:N-Quads; -. +@prefix rml: . +@prefix foaf: . +@prefix formats: . +@prefix ex: . +@base . + +<#TriplesMap> a rml:TriplesMap; + rml:logicalSource [ a rml:LogicalSource; + rml:source [ a rml:FilePath; + rml:root rml:MappingDirectory; + rml:path "Friends.json"; + ]; + rml:referenceFormulation rml:JSONPath; + rml:iterator "$[*]"; + ]; + rml:subjectMap [ a rml:SubjectMap; + rml:template "http://example.org/{$.id}"; + ]; + rml:predicateObjectMap [ a rml:PredicateObjectMap; + rml:graphMap [ a rml:GraphMap; + rml:constant ex:PeopleGraph; + rml:logicalTarget <#TargetDump2>; + ]; + rml:predicateMap [ a rml:PredicateMap; + rml:constant foaf:name; + ]; + rml:objectMap [ a rml:ObjectMap; + rml:reference "$.name"; + ]; + ]; + rml:predicateObjectMap [ a rml:PredicateObjectMap; + rml:predicateMap [ a rml:PredicateMap; + rml:constant foaf:age; + rml:logicalTarget <#TargetDump1>; + ]; + rml:objectMap [ a rml:ObjectMap; + rml:reference "$.age"; + ]; + ]; +. + +<#TargetDump1> a rml:LogicalTarget; + rml:target [ a rml:FilePath; + rml:root rml:CurrentWorkingDirectory; + rml:path "./dump1.nq"; + ]; + rml:serialization formats:N-Quads; +. + +<#TargetDump2> a rml:LogicalTarget; + rml:target [ a rml:FilePath; + rml:root rml:CurrentWorkingDirectory; + rml:path "./dump2.nq"; + ]; + rml:serialization formats:N-Quads; +. diff --git a/src/test/resources/rml-io/RMLTTC0002h/Friends.json b/src/test/resources/rml-io/RMLTTC0002h/Friends.json new file mode 100644 index 00000000..8e554498 --- /dev/null +++ b/src/test/resources/rml-io/RMLTTC0002h/Friends.json @@ -0,0 +1,27 @@ +[ + { + "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 + } +] diff --git a/src/test/resources/rml-io/RMLTTC0002h/README.md b/src/test/resources/rml-io/RMLTTC0002h/README.md new file mode 100644 index 00000000..878af28c --- /dev/null +++ b/src/test/resources/rml-io/RMLTTC0002h/README.md @@ -0,0 +1,126 @@ +## RMLTTC0002h + +**Title**: Multiple Targets: Object Map and Graph Map + +**Description**: Test exporting all triples to a Target in a Object Map and a Target in a Graph Map. + +**Error expected?** No + +**Input** +``` +[ + { + "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 + } +] + +``` + +**Mapping** +``` +@prefix rml: . +@prefix foaf: . +@prefix formats: . +@prefix ex: . +@base . + +<#TriplesMap> a rml:TriplesMap; + rml:logicalSource [ a rml:LogicalSource; + rml:source [ a rml:FilePath; + rml:root rml:MappingDirectory; + rml:path "Friends.json"; + ]; + rml:referenceFormulation rml:JSONPath; + rml:iterator "$[*]"; + ]; + rml:subjectMap [ a rml:SubjectMap; + rml:template "http://example.org/{$.id}"; + ]; + rml:predicateObjectMap [ a rml:PredicateObjectMap; + rml:graphMap [ a rml:GraphMap; + rml:constant ex:PeopleGraph; + rml:logicalTarget <#TargetDump2>; + ]; + rml:predicateMap [ a rml:PredicateMap; + rml:constant foaf:name; + ]; + rml:objectMap [ a rml:ObjectMap; + rml:reference "$.name"; + ]; + ]; + rml:predicateObjectMap [ a rml:PredicateObjectMap; + rml:predicateMap [ a rml:PredicateMap; + rml:constant foaf:age; + ]; + rml:objectMap [ a rml:ObjectMap; + rml:reference "$.age"; + rml:logicalTarget <#TargetDump1>; + ]; + ]; +. + +<#TargetDump1> a rml:LogicalTarget; + rml:target [ a rml:FilePath; + rml:root rml:CurrentWorkingDirectory; + rml:path "./dump1.nq"; + ]; + rml:serialization formats:N-Quads; +. + +<#TargetDump2> a rml:LogicalTarget; + rml:target [ a rml:FilePath; + rml:root rml:CurrentWorkingDirectory; + rml:path "./dump2.nq"; + ]; + rml:serialization formats:N-Quads; +. + +``` + +**Output 1** +``` + +``` + +**Output 2** +``` + "33" . + "34" . + "35" . + "36" . + "37" . + +``` + +**Output 3** +``` + "Monica Geller" . + "Rachel Green" . + "Joey Tribbiani" . + "Chandler Bing" . + "Ross Geller" . + +``` + diff --git a/src/test/resources/rml-io/RMLTTC0002h/dump1.nq b/src/test/resources/rml-io/RMLTTC0002h/dump1.nq index 95ee6e21..42e9dfe2 100644 --- a/src/test/resources/rml-io/RMLTTC0002h/dump1.nq +++ b/src/test/resources/rml-io/RMLTTC0002h/dump1.nq @@ -1,5 +1,5 @@ - "33" . - "34" . - "35" . - "36" . - "37" . + "33" . + "34" . + "35" . + "36" . + "37" . diff --git a/src/test/resources/rml-io/RMLTTC0002h/mapping.ttl b/src/test/resources/rml-io/RMLTTC0002h/mapping.ttl index 55b9294f..ced88d89 100644 --- a/src/test/resources/rml-io/RMLTTC0002h/mapping.ttl +++ b/src/test/resources/rml-io/RMLTTC0002h/mapping.ttl @@ -1,57 +1,56 @@ -@prefix rml: . -@prefix foaf: . -@prefix dcat: . -@prefix void: . -@prefix formats: . -@prefix ex: . -@base . - -<#DCATSourceAccess> a rml:Source, dcat:Distribution; - dcat:downloadURL ; -. - -<#TriplesMap> a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:source <#DCATSourceAccess>; - rml:referenceFormulation rml:JSONPath; - rml:iterator "$.[*]"; - ]; - rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{id}"; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:graphMap [ a rml:GraphMap; - rml:constant ex:PeopleGraph; - rml:logicalTarget <#TargetDump2>; - ]; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:name; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "name"; - ]; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:age; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "age"; - rml:logicalTarget <#TargetDump1>; - ]; - ]; -. - -<#TargetDump1> a rml:LogicalTarget; - rml:target [ a rml:Target, void:Dataset; - void:dataDump ; - ]; - rml:serialization formats:N-Quads; -. - -<#TargetDump2> a rml:LogicalTarget; - rml:target [ a rml:Target, void:Dataset; - void:dataDump ; - ]; - rml:serialization formats:N-Quads; -. +@prefix rml: . +@prefix foaf: . +@prefix formats: . +@prefix ex: . +@base . + +<#TriplesMap> a rml:TriplesMap; + rml:logicalSource [ a rml:LogicalSource; + rml:source [ a rml:FilePath; + rml:root rml:MappingDirectory; + rml:path "Friends.json"; + ]; + rml:referenceFormulation rml:JSONPath; + rml:iterator "$[*]"; + ]; + rml:subjectMap [ a rml:SubjectMap; + rml:template "http://example.org/{$.id}"; + ]; + rml:predicateObjectMap [ a rml:PredicateObjectMap; + rml:graphMap [ a rml:GraphMap; + rml:constant ex:PeopleGraph; + rml:logicalTarget <#TargetDump2>; + ]; + rml:predicateMap [ a rml:PredicateMap; + rml:constant foaf:name; + ]; + rml:objectMap [ a rml:ObjectMap; + rml:reference "$.name"; + ]; + ]; + rml:predicateObjectMap [ a rml:PredicateObjectMap; + rml:predicateMap [ a rml:PredicateMap; + rml:constant foaf:age; + ]; + rml:objectMap [ a rml:ObjectMap; + rml:reference "$.age"; + rml:logicalTarget <#TargetDump1>; + ]; + ]; +. + +<#TargetDump1> a rml:LogicalTarget; + rml:target [ a rml:FilePath; + rml:root rml:CurrentWorkingDirectory; + rml:path "./dump1.nq"; + ]; + rml:serialization formats:N-Quads; +. + +<#TargetDump2> a rml:LogicalTarget; + rml:target [ a rml:FilePath; + rml:root rml:CurrentWorkingDirectory; + rml:path "./dump2.nq"; + ]; + rml:serialization formats:N-Quads; +. diff --git a/src/test/resources/rml-io/RMLTTC0002i/Friends.json b/src/test/resources/rml-io/RMLTTC0002i/Friends.json new file mode 100644 index 00000000..8e554498 --- /dev/null +++ b/src/test/resources/rml-io/RMLTTC0002i/Friends.json @@ -0,0 +1,27 @@ +[ + { + "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 + } +] diff --git a/src/test/resources/rml-io/RMLTTC0002i/README.md b/src/test/resources/rml-io/RMLTTC0002i/README.md new file mode 100644 index 00000000..371a4cc3 --- /dev/null +++ b/src/test/resources/rml-io/RMLTTC0002i/README.md @@ -0,0 +1,129 @@ +## RMLTTC0002i + +**Title**: Multiple Targets: Language Map and Graph Map + +**Description**: Test exporting all triples to a Target in a Language Map and a Target in a Graph Map. + +**Error expected?** No + +**Input** +``` +[ + { + "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 + } +] + +``` + +**Mapping** +``` +@prefix rml: . +@prefix foaf: . +@prefix formats: . +@prefix ex: . +@base . + +<#TriplesMap> a rml:TriplesMap; + rml:logicalSource [ a rml:LogicalSource; + rml:source [ a rml:FilePath; + rml:root rml:MappingDirectory; + rml:path "Friends.json"; + ]; + rml:referenceFormulation rml:JSONPath; + rml:iterator "$[*]"; + ]; + rml:subjectMap [ a rml:SubjectMap; + rml:template "http://example.org/{$.id}"; + ]; + rml:predicateObjectMap [ a rml:PredicateObjectMap; + rml:predicateMap [ a rml:PredicateMap; + rml:constant foaf:name; + ]; + rml:objectMap [ a rml:ObjectMap; + rml:reference "$.name"; + rml:languageMap [ a rml:LanguageMap; + rml:constant "en"; + rml:logicalTarget <#TargetDump2>; + ]; + ]; + ]; + rml:predicateObjectMap [ a rml:PredicateObjectMap; + rml:graphMap [ a rml:GraphMap; + rml:constant ex:PeopleGraph; + rml:logicalTarget <#TargetDump1>; + ]; + rml:predicateMap [ a rml:PredicateMap; + rml:constant foaf:age; + ]; + rml:objectMap [ a rml:ObjectMap; + rml:reference "$.age"; + ]; + ]; +. + +<#TargetDump1> a rml:LogicalTarget; + rml:target [ a rml:FilePath; + rml:root rml:CurrentWorkingDirectory; + rml:path "./dump1.nq"; + ]; + rml:serialization formats:N-Quads; +. + +<#TargetDump2> a rml:LogicalTarget; + rml:target [ a rml:FilePath; + rml:root rml:CurrentWorkingDirectory; + rml:path "./dump2.nq"; + ]; + rml:serialization formats:N-Quads; +. + +``` + +**Output 1** +``` + +``` + +**Output 2** +``` + "33" . + "34" . + "35" . + "36" . + "37" . + +``` + +**Output 3** +``` + "Monica Geller"@en . + "Rachel Green"@en . + "Joey Tribbiani"@en . + "Chandler Bing"@en . + "Ross Geller"@en . + +``` + diff --git a/src/test/resources/rml-io/RMLTTC0002i/mapping.ttl b/src/test/resources/rml-io/RMLTTC0002i/mapping.ttl index 38690c18..a5af0ef6 100644 --- a/src/test/resources/rml-io/RMLTTC0002i/mapping.ttl +++ b/src/test/resources/rml-io/RMLTTC0002i/mapping.ttl @@ -1,60 +1,59 @@ -@prefix rml: . -@prefix foaf: . -@prefix dcat: . -@prefix void: . -@prefix formats: . -@prefix ex: . -@base . - -<#DCATSourceAccess> a rml:Source, dcat:Distribution; - dcat:downloadURL ; -. - -<#TriplesMap> a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:source <#DCATSourceAccess>; - rml:referenceFormulation rml:JSONPath; - rml:iterator "$.[*]"; - ]; - rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{id}"; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:name; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "name"; - rml:languageMap [ a rml:LanguageMap; - rml:constant "en"; - rml:logicalTarget <#TargetDump2>; - ]; - ]; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:graphMap [ a rml:GraphMap; - rml:constant ex:PeopleGraph; - rml:logicalTarget <#TargetDump1>; - ]; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:age; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "age"; - ]; - ]; -. - -<#TargetDump1> a rml:LogicalTarget; - rml:target [ a rml:Target, void:Dataset; - void:dataDump ; - ]; - rml:serialization formats:N-Quads; -. - -<#TargetDump2> a rml:LogicalTarget; - rml:target [ a rml:Target, void:Dataset; - void:dataDump ; - ]; - rml:serialization formats:N-Quads; -. +@prefix rml: . +@prefix foaf: . +@prefix formats: . +@prefix ex: . +@base . + +<#TriplesMap> a rml:TriplesMap; + rml:logicalSource [ a rml:LogicalSource; + rml:source [ a rml:FilePath; + rml:root rml:MappingDirectory; + rml:path "Friends.json"; + ]; + rml:referenceFormulation rml:JSONPath; + rml:iterator "$[*]"; + ]; + rml:subjectMap [ a rml:SubjectMap; + rml:template "http://example.org/{$.id}"; + ]; + rml:predicateObjectMap [ a rml:PredicateObjectMap; + rml:predicateMap [ a rml:PredicateMap; + rml:constant foaf:name; + ]; + rml:objectMap [ a rml:ObjectMap; + rml:reference "$.name"; + rml:languageMap [ a rml:LanguageMap; + rml:constant "en"; + rml:logicalTarget <#TargetDump2>; + ]; + ]; + ]; + rml:predicateObjectMap [ a rml:PredicateObjectMap; + rml:graphMap [ a rml:GraphMap; + rml:constant ex:PeopleGraph; + rml:logicalTarget <#TargetDump1>; + ]; + rml:predicateMap [ a rml:PredicateMap; + rml:constant foaf:age; + ]; + rml:objectMap [ a rml:ObjectMap; + rml:reference "$.age"; + ]; + ]; +. + +<#TargetDump1> a rml:LogicalTarget; + rml:target [ a rml:FilePath; + rml:root rml:CurrentWorkingDirectory; + rml:path "./dump1.nq"; + ]; + rml:serialization formats:N-Quads; +. + +<#TargetDump2> a rml:LogicalTarget; + rml:target [ a rml:FilePath; + rml:root rml:CurrentWorkingDirectory; + rml:path "./dump2.nq"; + ]; + rml:serialization formats:N-Quads; +. diff --git a/src/test/resources/rml-io/RMLTTC0002j/Friends.json b/src/test/resources/rml-io/RMLTTC0002j/Friends.json new file mode 100644 index 00000000..8e554498 --- /dev/null +++ b/src/test/resources/rml-io/RMLTTC0002j/Friends.json @@ -0,0 +1,27 @@ +[ + { + "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 + } +] diff --git a/src/test/resources/rml-io/RMLTTC0002j/README.md b/src/test/resources/rml-io/RMLTTC0002j/README.md new file mode 100644 index 00000000..0838260f --- /dev/null +++ b/src/test/resources/rml-io/RMLTTC0002j/README.md @@ -0,0 +1,126 @@ +## RMLTTC0002j + +**Title**: Multiple Targets: Language Map and Object Map + +**Description**: Test exporting all triples to a Target in a Language Map and a Target in a Object Map. + +**Error expected?** No + +**Input** +``` +[ + { + "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 + } +] + +``` + +**Mapping** +``` +@prefix rml: . +@prefix foaf: . +@prefix formats: . +@prefix ex: . +@base . + +<#TriplesMap> a rml:TriplesMap; + rml:logicalSource [ a rml:LogicalSource; + rml:source [ a rml:FilePath; + rml:root rml:MappingDirectory; + rml:path "Friends.json"; + ]; + rml:referenceFormulation rml:JSONPath; + rml:iterator "$[*]"; + ]; + rml:subjectMap [ a rml:SubjectMap; + rml:template "http://example.org/{$.id}"; + ]; + rml:predicateObjectMap [ a rml:PredicateObjectMap; + rml:predicateMap [ a rml:PredicateMap; + rml:constant foaf:name; + ]; + rml:objectMap [ a rml:ObjectMap; + rml:reference "$.name"; + rml:languageMap [ a rml:LanguageMap; + rml:constant "en"; + rml:logicalTarget <#TargetDump2>; + ]; + ]; + ]; + rml:predicateObjectMap [ a rml:PredicateObjectMap; + rml:predicateMap [ a rml:PredicateMap; + rml:constant foaf:age; + ]; + rml:objectMap [ a rml:ObjectMap; + rml:reference "$.age"; + rml:logicalTarget <#TargetDump1>; + ]; + ]; +. + +<#TargetDump1> a rml:LogicalTarget; + rml:target [ a rml:Target, rml:FilePath; + rml:root rml:CurrentWorkingDirectory; + rml:path "./dump1.nq"; + ]; + rml:serialization formats:N-Quads; +. + +<#TargetDump2> a rml:LogicalTarget; + rml:target [ a rml:Target, rml:FilePath; + rml:root rml:CurrentWorkingDirectory; + rml:path "./dump2.nq"; + ]; + rml:serialization formats:N-Quads; +. + +``` + +**Output 1** +``` + +``` + +**Output 2** +``` + "33" . + "34" . + "35" . + "36" . + "37" . + +``` + +**Output 3** +``` + "Monica Geller"@en . + "Rachel Green"@en . + "Joey Tribbiani"@en . + "Chandler Bing"@en . + "Ross Geller"@en . + +``` + diff --git a/src/test/resources/rml-io/RMLTTC0002j/mapping.ttl b/src/test/resources/rml-io/RMLTTC0002j/mapping.ttl index 30d03b5c..fd7f1424 100644 --- a/src/test/resources/rml-io/RMLTTC0002j/mapping.ttl +++ b/src/test/resources/rml-io/RMLTTC0002j/mapping.ttl @@ -1,30 +1,27 @@ @prefix rml: . @prefix foaf: . -@prefix dcat: . -@prefix void: . @prefix formats: . @prefix ex: . @base . -<#DCATSourceAccess> a rml:Source, dcat:Distribution; - dcat:downloadURL ; -. - <#TriplesMap> a rml:TriplesMap; rml:logicalSource [ a rml:LogicalSource; - rml:source <#DCATSourceAccess>; + rml:source [ a rml:FilePath; + rml:root rml:MappingDirectory; + rml:path "Friends.json"; + ]; rml:referenceFormulation rml:JSONPath; - rml:iterator "$.[*]"; + rml:iterator "$[*]"; ]; rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{id}"; + rml:template "http://example.org/{$.id}"; ]; rml:predicateObjectMap [ a rml:PredicateObjectMap; rml:predicateMap [ a rml:PredicateMap; rml:constant foaf:name; ]; rml:objectMap [ a rml:ObjectMap; - rml:reference "name"; + rml:reference "$.name"; rml:languageMap [ a rml:LanguageMap; rml:constant "en"; rml:logicalTarget <#TargetDump2>; @@ -36,22 +33,24 @@ rml:constant foaf:age; ]; rml:objectMap [ a rml:ObjectMap; - rml:reference "age"; + rml:reference "$.age"; rml:logicalTarget <#TargetDump1>; ]; ]; . <#TargetDump1> a rml:LogicalTarget; - rml:target [ a rml:Target, void:Dataset; - void:dataDump ; + rml:target [ a rml:Target, rml:FilePath; + rml:root rml:CurrentWorkingDirectory; + rml:path "./dump1.nq"; ]; rml:serialization formats:N-Quads; . <#TargetDump2> a rml:LogicalTarget; - rml:target [ a rml:Target, void:Dataset; - void:dataDump ; + rml:target [ a rml:Target, rml:FilePath; + rml:root rml:CurrentWorkingDirectory; + rml:path "./dump2.nq"; ]; rml:serialization formats:N-Quads; . diff --git a/src/test/resources/rml-io/RMLTTC0002k/Friends.json b/src/test/resources/rml-io/RMLTTC0002k/Friends.json new file mode 100644 index 00000000..8e554498 --- /dev/null +++ b/src/test/resources/rml-io/RMLTTC0002k/Friends.json @@ -0,0 +1,27 @@ +[ + { + "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 + } +] diff --git a/src/test/resources/rml-io/RMLTTC0002k/README.md b/src/test/resources/rml-io/RMLTTC0002k/README.md new file mode 100644 index 00000000..656b5cbb --- /dev/null +++ b/src/test/resources/rml-io/RMLTTC0002k/README.md @@ -0,0 +1,135 @@ +## RMLTTC0002k + +**Title**: Multiple Targets: Datatype Map and Graph Map + +**Description**: Test exporting all triples to a Target in a Datatype Map and a Target in a Graph Map. + +**Error expected?** No + +**Input** +``` +[ + { + "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 + } +] + +``` + +**Mapping** +``` +@prefix rml: . +@prefix foaf: . +@prefix formats: . +@prefix xsd: . +@prefix ex: . +@base . + +<#TriplesMap> a rml:TriplesMap; + rml:logicalSource [ a rml:LogicalSource; + rml:source [ a rml:FilePath; + rml:root rml:MappingDirectory; + rml:path "Friends.json"; + ]; + rml:referenceFormulation rml:JSONPath; + rml:iterator "$[*]"; + ]; + rml:subjectMap [ a rml:SubjectMap; + rml:template "http://example.org/{$.id}"; + ]; + rml:predicateObjectMap [ a rml:PredicateObjectMap; + rml:predicateMap [ a rml:PredicateMap; + rml:constant foaf:name; + ]; + rml:objectMap [ a rml:ObjectMap; + rml:reference "$.name"; + ]; + ]; + rml:predicateObjectMap [ a rml:PredicateObjectMap; + rml:graphMap [ a rml:GraphMap; + rml:constant ex:PeopleGraph; + rml:logicalTarget <#TargetDump1>; + ]; + rml:predicateMap [ a rml:PredicateMap; + rml:constant foaf:age; + ]; + rml:objectMap [ a rml:ObjectMap; + rml:reference "$.age"; + rml:datatypeMap [ a rml:DatatypeMap; + rml:constant xsd:integer; + rml:logicalTarget <#TargetDump2>; + ]; + ]; + ]; +. + +<#TargetDump1> a rml:LogicalTarget; + rml:target [ a rml:Target, rml:FilePath; + rml:root rml:CurrentWorkingDirectory; + rml:path "./dump1.nq"; + ]; + rml:serialization formats:N-Quads; +. + +<#TargetDump2> a rml:LogicalTarget; + rml:target [ a rml:Target, rml:FilePath; + rml:root rml:CurrentWorkingDirectory; + rml:path "./dump2.nq"; + ]; + rml:serialization formats:N-Quads; +. + +``` + +**Output 1** +``` + "Monica Geller"@en . + "Rachel Green"@en . + "Joey Tribbiani"@en . + "Chandler Bing"@en . + "Ross Geller"@en . + +``` + +**Output 2** +``` + "33"^^ . + "34"^^ . + "35"^^ . + "36"^^ . + "37"^^ . + +``` + +**Output 3** +``` + "33"^^ . + "34"^^ . + "35"^^ . + "36"^^ . + "37"^^ . + +``` + diff --git a/src/test/resources/rml-io/RMLTTC0002k/default.nq b/src/test/resources/rml-io/RMLTTC0002k/default.nq index e69de29b..250e23c4 100644 --- a/src/test/resources/rml-io/RMLTTC0002k/default.nq +++ b/src/test/resources/rml-io/RMLTTC0002k/default.nq @@ -0,0 +1,5 @@ + "Monica Geller"@en . + "Rachel Green"@en . + "Joey Tribbiani"@en . + "Chandler Bing"@en . + "Ross Geller"@en . diff --git a/src/test/resources/rml-io/RMLTTC0002k/mapping.ttl b/src/test/resources/rml-io/RMLTTC0002k/mapping.ttl index e2ef9c2a..17dcb839 100644 --- a/src/test/resources/rml-io/RMLTTC0002k/mapping.ttl +++ b/src/test/resources/rml-io/RMLTTC0002k/mapping.ttl @@ -1,61 +1,60 @@ -@prefix rml: . -@prefix foaf: . -@prefix dcat: . -@prefix void: . -@prefix formats: . -@prefix xsd: . -@prefix ex: . -@base . - -<#DCATSourceAccess> a rml:Source, dcat:Distribution; - dcat:downloadURL ; -. - -<#TriplesMap> a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:source <#DCATSourceAccess>; - rml:referenceFormulation rml:JSONPath; - rml:iterator "$.[*]"; - ]; - rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{id}"; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:name; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "name"; - ]; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:graphMap [ a rml:GraphMap; - rml:constant ex:PeopleGraph; - rml:logicalTarget <#TargetDump1>; - ]; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:age; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "age"; - rml:languageMap [ a rml:DatatypeMap; - rml:constant xsd:integer; - rml:logicalTarget <#TargetDump2>; - ]; - ]; - ]; -. - -<#TargetDump1> a rml:LogicalTarget; - rml:target [ a rml:Target, void:Dataset; - void:dataDump ; - ]; - rml:serialization formats:N-Quads; -. - -<#TargetDump2> a rml:LogicalTarget; - rml:target [ a rml:Target, void:Dataset; - void:dataDump ; - ]; - rml:serialization formats:N-Quads; -. +@prefix rml: . +@prefix foaf: . +@prefix formats: . +@prefix xsd: . +@prefix ex: . +@base . + +<#TriplesMap> a rml:TriplesMap; + rml:logicalSource [ a rml:LogicalSource; + rml:source [ a rml:FilePath; + rml:root rml:MappingDirectory; + rml:path "Friends.json"; + ]; + rml:referenceFormulation rml:JSONPath; + rml:iterator "$[*]"; + ]; + rml:subjectMap [ a rml:SubjectMap; + rml:template "http://example.org/{$.id}"; + ]; + rml:predicateObjectMap [ a rml:PredicateObjectMap; + rml:predicateMap [ a rml:PredicateMap; + rml:constant foaf:name; + ]; + rml:objectMap [ a rml:ObjectMap; + rml:reference "$.name"; + ]; + ]; + rml:predicateObjectMap [ a rml:PredicateObjectMap; + rml:graphMap [ a rml:GraphMap; + rml:constant ex:PeopleGraph; + rml:logicalTarget <#TargetDump1>; + ]; + rml:predicateMap [ a rml:PredicateMap; + rml:constant foaf:age; + ]; + rml:objectMap [ a rml:ObjectMap; + rml:reference "$.age"; + rml:datatypeMap [ a rml:DatatypeMap; + rml:constant xsd:integer; + rml:logicalTarget <#TargetDump2>; + ]; + ]; + ]; +. + +<#TargetDump1> a rml:LogicalTarget; + rml:target [ a rml:Target, rml:FilePath; + rml:root rml:CurrentWorkingDirectory; + rml:path "./dump1.nq"; + ]; + rml:serialization formats:N-Quads; +. + +<#TargetDump2> a rml:LogicalTarget; + rml:target [ a rml:Target, rml:FilePath; + rml:root rml:CurrentWorkingDirectory; + rml:path "./dump2.nq"; + ]; + rml:serialization formats:N-Quads; +. diff --git a/src/test/resources/rml-io/RMLTTC0002l/Friends.json b/src/test/resources/rml-io/RMLTTC0002l/Friends.json new file mode 100644 index 00000000..8e554498 --- /dev/null +++ b/src/test/resources/rml-io/RMLTTC0002l/Friends.json @@ -0,0 +1,27 @@ +[ + { + "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 + } +] diff --git a/src/test/resources/rml-io/RMLTTC0002l/README.md b/src/test/resources/rml-io/RMLTTC0002l/README.md new file mode 100644 index 00000000..c688f6dd --- /dev/null +++ b/src/test/resources/rml-io/RMLTTC0002l/README.md @@ -0,0 +1,127 @@ +## RMLTTC0002l + +**Title**: Multiple Targets: Datatype Map and Object Map + +**Description**: Test exporting all triples to a Target in a Datatype Map and a Target in a Object Map. + +**Error expected?** No + +**Input** +``` +[ + { + "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 + } +] + +``` + +**Mapping** +``` +@prefix rml: . +@prefix foaf: . +@prefix formats: . +@prefix xsd: . +@prefix ex: . +@base . + +<#TriplesMap> a rml:TriplesMap; + rml:logicalSource [ a rml:LogicalSource; + rml:source [ a rml:FilePath; + rml:root rml:MappingDirectory; + rml:path "Friends.json"; + ]; + rml:referenceFormulation rml:JSONPath; + rml:iterator "$[*]"; + ]; + rml:subjectMap [ a rml:SubjectMap; + rml:template "http://example.org/{$.id}"; + ]; + rml:predicateObjectMap [ a rml:PredicateObjectMap; + rml:predicateMap [ a rml:PredicateMap; + rml:constant foaf:name; + ]; + rml:objectMap [ a rml:ObjectMap; + rml:reference "$.name"; + rml:logicalTarget <#TargetDump1>; + ]; + ]; + rml:predicateObjectMap [ a rml:PredicateObjectMap; + rml:predicateMap [ a rml:PredicateMap; + rml:constant foaf:age; + ]; + rml:objectMap [ a rml:ObjectMap; + rml:reference "$.age"; + rml:datatypeMap [ a rml:DatatypeMap; + rml:constant xsd:integer; + rml:logicalTarget <#TargetDump2>; + ]; + ]; + ]; +. + +<#TargetDump1> a rml:LogicalTarget; + rml:target [ a rml:Target, rml:FilePath; + rml:root rml:CurrentWorkingDirectory; + rml:path "./dump1.nq"; + ]; + rml:serialization formats:N-Quads; +. + +<#TargetDump2> a rml:LogicalTarget; + rml:target [ a rml:Target, rml:FilePath; + rml:root rml:CurrentWorkingDirectory; + rml:path "./dump2.nq"; + ]; + rml:serialization formats:N-Quads; +. + +``` + +**Output 1** +``` + +``` + +**Output 2** +``` + "Monica Geller" . + "Rachel Green" . + "Joey Tribbiani" . + "Chandler Bing" . + "Ross Geller" . + +``` + +**Output 3** +``` + "33"^^ . + "34"^^ . + "35"^^ . + "36"^^ . + "37"^^ . + +``` + diff --git a/src/test/resources/rml-io/RMLTTC0002l/dump2.nq b/src/test/resources/rml-io/RMLTTC0002l/dump2.nq index b92731fc..c3eeab33 100644 --- a/src/test/resources/rml-io/RMLTTC0002l/dump2.nq +++ b/src/test/resources/rml-io/RMLTTC0002l/dump2.nq @@ -1,5 +1,5 @@ - "33"^^ . - "34"^^ . - "35"^^ . - "36"^^ . - "37"^^ . + "33"^^ . + "34"^^ . + "35"^^ . + "36"^^ . + "37"^^ . diff --git a/src/test/resources/rml-io/RMLTTC0002l/mapping.ttl b/src/test/resources/rml-io/RMLTTC0002l/mapping.ttl index 014d1242..9fae6b4c 100644 --- a/src/test/resources/rml-io/RMLTTC0002l/mapping.ttl +++ b/src/test/resources/rml-io/RMLTTC0002l/mapping.ttl @@ -1,58 +1,57 @@ -@prefix rml: . -@prefix foaf: . -@prefix dcat: . -@prefix void: . -@prefix formats: . -@prefix xsd: . -@prefix ex: . -@base . - -<#DCATSourceAccess> a rml:Source, dcat:Distribution; - dcat:downloadURL ; -. - -<#TriplesMap> a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:source <#DCATSourceAccess>; - rml:referenceFormulation rml:JSONPath; - rml:iterator "$.[*]"; - ]; - rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{id}"; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:name; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "name"; - rml:logicalTarget <#TargetDump1>; - ]; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:age; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "age"; - rml:languageMap [ a rml:DatatypeMap; - rml:constant xsd:integer; - rml:logicalTarget <#TargetDump2>; - ]; - ]; - ]; -. - -<#TargetDump1> a rml:LogicalTarget; - rml:target [ a rml:Target, void:Dataset; - void:dataDump ; - ]; - rml:serialization formats:N-Quads; -. - -<#TargetDump2> a rml:LogicalTarget; - rml:target [ a rml:Target, void:Dataset; - void:dataDump ; - ]; - rml:serialization formats:N-Quads; -. +@prefix rml: . +@prefix foaf: . +@prefix formats: . +@prefix xsd: . +@prefix ex: . +@base . + +<#TriplesMap> a rml:TriplesMap; + rml:logicalSource [ a rml:LogicalSource; + rml:source [ a rml:FilePath; + rml:root rml:MappingDirectory; + rml:path "Friends.json"; + ]; + rml:referenceFormulation rml:JSONPath; + rml:iterator "$[*]"; + ]; + rml:subjectMap [ a rml:SubjectMap; + rml:template "http://example.org/{$.id}"; + ]; + rml:predicateObjectMap [ a rml:PredicateObjectMap; + rml:predicateMap [ a rml:PredicateMap; + rml:constant foaf:name; + ]; + rml:objectMap [ a rml:ObjectMap; + rml:reference "$.name"; + rml:logicalTarget <#TargetDump1>; + ]; + ]; + rml:predicateObjectMap [ a rml:PredicateObjectMap; + rml:predicateMap [ a rml:PredicateMap; + rml:constant foaf:age; + ]; + rml:objectMap [ a rml:ObjectMap; + rml:reference "$.age"; + rml:datatypeMap [ a rml:DatatypeMap; + rml:constant xsd:integer; + rml:logicalTarget <#TargetDump2>; + ]; + ]; + ]; +. + +<#TargetDump1> a rml:LogicalTarget; + rml:target [ a rml:Target, rml:FilePath; + rml:root rml:CurrentWorkingDirectory; + rml:path "./dump1.nq"; + ]; + rml:serialization formats:N-Quads; +. + +<#TargetDump2> a rml:LogicalTarget; + rml:target [ a rml:Target, rml:FilePath; + rml:root rml:CurrentWorkingDirectory; + rml:path "./dump2.nq"; + ]; + rml:serialization formats:N-Quads; +. diff --git a/src/test/resources/rml-io/RMLTTC0002m/Friends.json b/src/test/resources/rml-io/RMLTTC0002m/Friends.json new file mode 100644 index 00000000..8e554498 --- /dev/null +++ b/src/test/resources/rml-io/RMLTTC0002m/Friends.json @@ -0,0 +1,27 @@ +[ + { + "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 + } +] diff --git a/src/test/resources/rml-io/RMLTTC0002m/README.md b/src/test/resources/rml-io/RMLTTC0002m/README.md new file mode 100644 index 00000000..6727d987 --- /dev/null +++ b/src/test/resources/rml-io/RMLTTC0002m/README.md @@ -0,0 +1,122 @@ +## RMLTTC0002m + +**Title**: Multiple Targets: Multiple Predicate Maps + +**Description**: Test exporting all triples to Targets in multiple Predicate Maps. + +**Error expected?** No + +**Input** +``` +[ + { + "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 + } +] + +``` + +**Mapping** +``` +@prefix rml: . +@prefix foaf: . +@prefix formats: . +@base . + +<#TriplesMap> a rml:TriplesMap; + rml:logicalSource [ a rml:LogicalSource; + rml:source [ a rml:FilePath; + rml:root rml:MappingDirectory; + rml:path "Friends.json"; + ]; + rml:referenceFormulation rml:JSONPath; + rml:iterator "$[*]"; + ]; + rml:subjectMap [ a rml:SubjectMap; + rml:template "http://example.org/{$.id}"; + ]; + rml:predicateObjectMap [ a rml:PredicateObjectMap; + rml:predicateMap [ a rml:PredicateMap; + rml:constant foaf:name; + rml:logicalTarget <#TargetDump1>; + ]; + rml:objectMap [ a rml:ObjectMap; + rml:reference "$.name"; + ]; + ]; + rml:predicateObjectMap [ a rml:PredicateObjectMap; + rml:predicateMap [ a rml:PredicateMap; + rml:constant foaf:age; + rml:logicalTarget <#TargetDump2>; + ]; + rml:objectMap [ a rml:ObjectMap; + rml:reference "$.age"; + ]; + ]; +. + +<#TargetDump1> a rml:LogicalTarget; + rml:target [ a rml:Target, rml:FilePath; + rml:root rml:CurrentWorkingDirectory; + rml:path "./dump1.nq"; + ]; + rml:serialization formats:N-Quads; +. + +<#TargetDump2> a rml:LogicalTarget; + rml:target [ a rml:Target, rml:FilePath; + rml:root rml:CurrentWorkingDirectory; + rml:path "./dump2.nq"; + ]; + rml:serialization formats:N-Quads; +. + +``` + +**Output 1** +``` + +``` + +**Output 2** +``` + "Monica Geller" . + "Rachel Green" . + "Joey Tribbiani" . + "Chandler Bing" . + "Ross Geller" . + +``` + +**Output 3** +``` + "33" . + "34" . + "35" . + "36" . + "37" . + +``` + diff --git a/src/test/resources/rml-io/RMLTTC0002m/default.nq b/src/test/resources/rml-io/RMLTTC0002m/default.nq index ad87bcca..e69de29b 100644 --- a/src/test/resources/rml-io/RMLTTC0002m/default.nq +++ b/src/test/resources/rml-io/RMLTTC0002m/default.nq @@ -1,5 +0,0 @@ - "33". - "34". - "35". - "36". - "37". diff --git a/src/test/resources/rml-io/RMLTTC0002m/mapping.ttl b/src/test/resources/rml-io/RMLTTC0002m/mapping.ttl index 1a5589e1..d3fd84f1 100644 --- a/src/test/resources/rml-io/RMLTTC0002m/mapping.ttl +++ b/src/test/resources/rml-io/RMLTTC0002m/mapping.ttl @@ -1,22 +1,19 @@ @prefix rml: . @prefix foaf: . -@prefix dcat: . -@prefix void: . @prefix formats: . @base . -<#DCATSourceAccess> a rml:Source, dcat:Distribution; - dcat:downloadURL ; -. - <#TriplesMap> a rml:TriplesMap; rml:logicalSource [ a rml:LogicalSource; - rml:source <#DCATSourceAccess>; + rml:source [ a rml:FilePath; + rml:root rml:MappingDirectory; + rml:path "Friends.json"; + ]; rml:referenceFormulation rml:JSONPath; - rml:iterator "$.[*]"; + rml:iterator "$[*]"; ]; rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{id}"; + rml:template "http://example.org/{$.id}"; ]; rml:predicateObjectMap [ a rml:PredicateObjectMap; rml:predicateMap [ a rml:PredicateMap; @@ -24,7 +21,7 @@ rml:logicalTarget <#TargetDump1>; ]; rml:objectMap [ a rml:ObjectMap; - rml:reference "name"; + rml:reference "$.name"; ]; ]; rml:predicateObjectMap [ a rml:PredicateObjectMap; @@ -33,21 +30,23 @@ rml:logicalTarget <#TargetDump2>; ]; rml:objectMap [ a rml:ObjectMap; - rml:reference "age"; + rml:reference "$.age"; ]; ]; . <#TargetDump1> a rml:LogicalTarget; - rml:target [ a rml:Target, void:Dataset; - void:dataDump ; + rml:target [ a rml:Target, rml:FilePath; + rml:root rml:CurrentWorkingDirectory; + rml:path "./dump1.nq"; ]; rml:serialization formats:N-Quads; . <#TargetDump2> a rml:LogicalTarget; - rml:target [ a rml:Target, void:Dataset; - void:dataDump ; + rml:target [ a rml:Target, rml:FilePath; + rml:root rml:CurrentWorkingDirectory; + rml:path "./dump2.nq"; ]; rml:serialization formats:N-Quads; . diff --git a/src/test/resources/rml-io/RMLTTC0002n/Friends.json b/src/test/resources/rml-io/RMLTTC0002n/Friends.json new file mode 100644 index 00000000..8e554498 --- /dev/null +++ b/src/test/resources/rml-io/RMLTTC0002n/Friends.json @@ -0,0 +1,27 @@ +[ + { + "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 + } +] diff --git a/src/test/resources/rml-io/RMLTTC0002n/README.md b/src/test/resources/rml-io/RMLTTC0002n/README.md new file mode 100644 index 00000000..e0a1076f --- /dev/null +++ b/src/test/resources/rml-io/RMLTTC0002n/README.md @@ -0,0 +1,122 @@ +## RMLTTC0002n + +**Title**: Multiple Targets: Multiple Object Maps + +**Description**: Test exporting all triples to Targets in multiple Object Maps. + +**Error expected?** No + +**Input** +``` +[ + { + "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 + } +] + +``` + +**Mapping** +``` +@prefix rml: . +@prefix foaf: . +@prefix formats: . +@base . + +<#TriplesMap> a rml:TriplesMap; + rml:logicalSource [ a rml:LogicalSource; + rml:source [ a rml:FilePath; + rml:root rml:MappingDirectory; + rml:path "Friends.json"; + ]; + rml:referenceFormulation rml:JSONPath; + rml:iterator "$[*]"; + ]; + rml:subjectMap [ a rml:SubjectMap; + rml:template "http://example.org/{$.id}"; + ]; + rml:predicateObjectMap [ a rml:PredicateObjectMap; + rml:predicateMap [ a rml:PredicateMap; + rml:constant foaf:name; + ]; + rml:objectMap [ a rml:ObjectMap; + rml:reference "$.name"; + rml:logicalTarget <#TargetDump1>; + ]; + ]; + rml:predicateObjectMap [ a rml:PredicateObjectMap; + rml:predicateMap [ a rml:PredicateMap; + rml:constant foaf:age; + ]; + rml:objectMap [ a rml:ObjectMap; + rml:reference "$.age"; + rml:logicalTarget <#TargetDump2>; + ]; + ]; +. + +<#TargetDump1> a rml:LogicalTarget; + rml:target [ a rml:Target, rml:FilePath; + rml:root rml:CurrentWorkingDirectory; + rml:path "./dump1.nq"; + ]; + rml:serialization formats:N-Quads; +. + +<#TargetDump2> a rml:LogicalTarget; + rml:target [ a rml:Target, rml:FilePath; + rml:root rml:CurrentWorkingDirectory; + rml:path "./dump2.nq"; + ]; + rml:serialization formats:N-Quads; +. + +``` + +**Output 1** +``` + +``` + +**Output 2** +``` + "Monica Geller" . + "Rachel Green" . + "Joey Tribbiani" . + "Chandler Bing" . + "Ross Geller" . + +``` + +**Output 3** +``` + "33" . + "34" . + "35" . + "36" . + "37" . + +``` + diff --git a/src/test/resources/rml-io/RMLTTC0002n/default.nq b/src/test/resources/rml-io/RMLTTC0002n/default.nq index ad87bcca..e69de29b 100644 --- a/src/test/resources/rml-io/RMLTTC0002n/default.nq +++ b/src/test/resources/rml-io/RMLTTC0002n/default.nq @@ -1,5 +0,0 @@ - "33". - "34". - "35". - "36". - "37". diff --git a/src/test/resources/rml-io/RMLTTC0002n/mapping.ttl b/src/test/resources/rml-io/RMLTTC0002n/mapping.ttl index 589ca736..6371637d 100644 --- a/src/test/resources/rml-io/RMLTTC0002n/mapping.ttl +++ b/src/test/resources/rml-io/RMLTTC0002n/mapping.ttl @@ -1,29 +1,26 @@ @prefix rml: . @prefix foaf: . -@prefix dcat: . -@prefix void: . @prefix formats: . @base . -<#DCATSourceAccess> a rml:Source, dcat:Distribution; - dcat:downloadURL ; -. - <#TriplesMap> a rml:TriplesMap; rml:logicalSource [ a rml:LogicalSource; - rml:source <#DCATSourceAccess>; + rml:source [ a rml:FilePath; + rml:root rml:MappingDirectory; + rml:path "Friends.json"; + ]; rml:referenceFormulation rml:JSONPath; - rml:iterator "$.[*]"; + rml:iterator "$[*]"; ]; rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{id}"; + rml:template "http://example.org/{$.id}"; ]; rml:predicateObjectMap [ a rml:PredicateObjectMap; rml:predicateMap [ a rml:PredicateMap; rml:constant foaf:name; ]; rml:objectMap [ a rml:ObjectMap; - rml:reference "name"; + rml:reference "$.name"; rml:logicalTarget <#TargetDump1>; ]; ]; @@ -32,22 +29,24 @@ rml:constant foaf:age; ]; rml:objectMap [ a rml:ObjectMap; - rml:reference "age"; + rml:reference "$.age"; rml:logicalTarget <#TargetDump2>; ]; ]; . <#TargetDump1> a rml:LogicalTarget; - rml:target [ a rml:Target, void:Dataset; - void:dataDump ; + rml:target [ a rml:Target, rml:FilePath; + rml:root rml:CurrentWorkingDirectory; + rml:path "./dump1.nq"; ]; rml:serialization formats:N-Quads; . <#TargetDump2> a rml:LogicalTarget; - rml:target [ a rml:Target, void:Dataset; - void:dataDump ; + rml:target [ a rml:Target, rml:FilePath; + rml:root rml:CurrentWorkingDirectory; + rml:path "./dump2.nq"; ]; rml:serialization formats:N-Quads; . diff --git a/src/test/resources/rml-io/RMLTTC0002o/Friends.json b/src/test/resources/rml-io/RMLTTC0002o/Friends.json new file mode 100644 index 00000000..8e554498 --- /dev/null +++ b/src/test/resources/rml-io/RMLTTC0002o/Friends.json @@ -0,0 +1,27 @@ +[ + { + "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 + } +] diff --git a/src/test/resources/rml-io/RMLTTC0002o/README.md b/src/test/resources/rml-io/RMLTTC0002o/README.md new file mode 100644 index 00000000..67d69c41 --- /dev/null +++ b/src/test/resources/rml-io/RMLTTC0002o/README.md @@ -0,0 +1,134 @@ +## RMLTTC0002o + +**Title**: Multiple Targets: Multiple Graph Maps + +**Description**: Test exporting all triples to Targets in multiple Graph Maps. + +**Error expected?** No + +**Input** +``` +[ + { + "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 + } +] + +``` + +**Mapping** +``` +@prefix rml: . +@prefix foaf: . +@prefix dcat: . +@prefix formats: . +@prefix ex: . +@base . + +<#TriplesMap> a rml:TriplesMap; + rml:logicalSource [ a rml:LogicalSource; + rml:source [ a rml:FilePath; + rml:root rml:MappingDirectory; + rml:path "Friends.json"; + ]; + rml:referenceFormulation rml:JSONPath; + rml:iterator "$[*]"; + ]; + rml:subjectMap [ a rml:SubjectMap; + rml:template "http://example.org/{$.id}"; + rml:graphMap [ a rml:GraphMap; + rml:constant ex:PeopleGraph1; + rml:logicalTarget <#TargetDump1>; + ]; + ]; + rml:predicateObjectMap [ a rml:PredicateObjectMap; + rml:predicateMap [ a rml:PredicateMap; + rml:constant foaf:name; + ]; + rml:objectMap [ a rml:ObjectMap; + rml:reference "$.name"; + ]; + rml:graphMap [ a rml:GraphMap; + rml:constant ex:PeopleGraph2; + rml:logicalTarget <#TargetDump2>; + ]; + ]; + rml:predicateObjectMap [ a rml:PredicateObjectMap; + rml:predicateMap [ a rml:PredicateMap; + rml:constant foaf:age; + ]; + rml:objectMap [ a rml:ObjectMap; + rml:reference "$.age"; + ]; + ]; +. + +<#TargetDump1> a rml:LogicalTarget; + rml:target [ a rml:Target, rml:FilePath; + rml:root rml:CurrentWorkingDirectory; + rml:path "./dump1.nq"; + ]; + rml:serialization formats:N-Quads; +. + +<#TargetDump2> a rml:LogicalTarget; + rml:target [ a rml:Target, rml:FilePath; + rml:root rml:CurrentWorkingDirectory; + rml:path "./dump2.nq"; + ]; + rml:serialization formats:N-Quads; +. +``` + +**Output 1** +``` + +``` + +**Output 2** +``` + "33" . + "Monica Geller" . + "34" . + "Rachel Green" . + "35" . + "Joey Tribbiani" . + "36" . + "Chandler Bing" . + "37" . + "Ross Geller" . + +``` + +**Output 3** +``` + "Monica Geller" . + "Rachel Green" . + "Joey Tribbiani" . + "Chandler Bing" . + "Ross Geller" . + +``` + diff --git a/src/test/resources/rml-io/RMLTTC0002o/mapping.ttl b/src/test/resources/rml-io/RMLTTC0002o/mapping.ttl index a5abf1bd..7ffad944 100644 --- a/src/test/resources/rml-io/RMLTTC0002o/mapping.ttl +++ b/src/test/resources/rml-io/RMLTTC0002o/mapping.ttl @@ -1,23 +1,21 @@ @prefix rml: . @prefix foaf: . @prefix dcat: . -@prefix void: . @prefix formats: . @prefix ex: . @base . -<#DCATSourceAccess> a rml:Source, dcat:Distribution; - dcat:downloadURL ; -. - <#TriplesMap> a rml:TriplesMap; rml:logicalSource [ a rml:LogicalSource; - rml:source <#DCATSourceAccess>; + rml:source [ a rml:FilePath; + rml:root rml:MappingDirectory; + rml:path "Friends.json"; + ]; rml:referenceFormulation rml:JSONPath; - rml:iterator "$.[*]"; + rml:iterator "$[*]"; ]; rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{id}"; + rml:template "http://example.org/{$.id}"; rml:graphMap [ a rml:GraphMap; rml:constant ex:PeopleGraph1; rml:logicalTarget <#TargetDump1>; @@ -28,11 +26,11 @@ rml:constant foaf:name; ]; rml:objectMap [ a rml:ObjectMap; - rml:reference "name"; + rml:reference "$.name"; ]; rml:graphMap [ a rml:GraphMap; - rml:constant ex:PeopleGraph1; - rml:logicalTarget <#TargetDump1>; + rml:constant ex:PeopleGraph2; + rml:logicalTarget <#TargetDump2>; ]; ]; rml:predicateObjectMap [ a rml:PredicateObjectMap; @@ -40,14 +38,23 @@ rml:constant foaf:age; ]; rml:objectMap [ a rml:ObjectMap; - rml:reference "age"; + rml:reference "$.age"; ]; ]; . <#TargetDump1> a rml:LogicalTarget; - rml:target [ a rml:Target, void:Dataset; - void:dataDump ; + rml:target [ a rml:Target, rml:FilePath; + rml:root rml:CurrentWorkingDirectory; + rml:path "./dump1.nq"; ]; rml:serialization formats:N-Quads; . + +<#TargetDump2> a rml:LogicalTarget; + rml:target [ a rml:Target, rml:FilePath; + rml:root rml:CurrentWorkingDirectory; + rml:path "./dump2.nq"; + ]; + rml:serialization formats:N-Quads; +. \ No newline at end of file diff --git a/src/test/resources/rml-io/RMLTTC0002p/Friends.json b/src/test/resources/rml-io/RMLTTC0002p/Friends.json new file mode 100644 index 00000000..8e554498 --- /dev/null +++ b/src/test/resources/rml-io/RMLTTC0002p/Friends.json @@ -0,0 +1,27 @@ +[ + { + "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 + } +] diff --git a/src/test/resources/rml-io/RMLTTC0002p/README.md b/src/test/resources/rml-io/RMLTTC0002p/README.md new file mode 100644 index 00000000..8975f25b --- /dev/null +++ b/src/test/resources/rml-io/RMLTTC0002p/README.md @@ -0,0 +1,141 @@ +## RMLTTC0002p + +**Title**: Multiple Targets: Multiple Language Maps + +**Description**: Test exporting all triples to Targets in multiple Language Maps. + +**Error expected?** No + +**Input** +``` +[ + { + "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 + } +] + +``` + +**Mapping** +``` +@prefix rml: . +@prefix foaf: . +@prefix formats: . +@base . + +<#TriplesMap> a rml:TriplesMap; + rml:logicalSource [ a rml:LogicalSource; + rml:source [ a rml:FilePath; + rml:root rml:MappingDirectory; + rml:path "Friends.json"; + ]; + rml:referenceFormulation rml:JSONPath; + rml:iterator "$[*]"; + ]; + rml:subjectMap [ a rml:SubjectMap; + rml:template "http://example.org/{$.id}"; + ]; + rml:predicateObjectMap [ a rml:PredicateObjectMap; + rml:predicateMap [ a rml:PredicateMap; + rml:constant foaf:name; + ]; + rml:objectMap [ a rml:ObjectMap; + rml:reference "$.name"; + rml:languageMap [ a rml:LanguageMap; + rml:constant "en"; + rml:logicalTarget <#TargetDump1>; + ]; + ]; + ]; + rml:predicateObjectMap [ a rml:PredicateObjectMap; + rml:predicateMap [ a rml:PredicateMap; + rml:constant foaf:name; + ]; + rml:objectMap [ a rml:ObjectMap; + rml:reference "$.name"; + rml:languageMap [ a rml:LanguageMap; + rml:constant "nl"; + rml:logicalTarget <#TargetDump2>; + ]; + ]; + ]; + rml:predicateObjectMap [ a rml:PredicateObjectMap; + rml:predicateMap [ a rml:PredicateMap; + rml:constant foaf:age; + ]; + rml:objectMap [ a rml:ObjectMap; + rml:reference "$.age"; + ]; + ]; +. + +<#TargetDump1> a rml:LogicalTarget; + rml:target [ a rml:Target, rml:FilePath; + rml:root rml:CurrentWorkingDirectory; + rml:path "./dump1.nq"; + ]; + rml:serialization formats:N-Quads; +. + +<#TargetDump2> a rml:LogicalTarget; + rml:target [ a rml:Target, rml:FilePath; + rml:root rml:CurrentWorkingDirectory; + rml:path "./dump2.nq"; + ]; + rml:serialization formats:N-Quads; +. + +``` + +**Output 1** +``` + "33". + "34". + "35". + "36". + "37". + +``` + +**Output 2** +``` + "Monica Geller"@en . + "Rachel Green"@en . + "Joey Tribbiani"@en . + "Chandler Bing"@en . + "Ross Geller"@en . + +``` + +**Output 3** +``` + "Monica Geller"@nl . + "Rachel Green"@nl . + "Joey Tribbiani"@nl . + "Chandler Bing"@nl . + "Ross Geller"@nl . + +``` + diff --git a/src/test/resources/rml-io/RMLTTC0002p/default.nq b/src/test/resources/rml-io/RMLTTC0002p/default.nq index ad87bcca..f2e60c86 100644 --- a/src/test/resources/rml-io/RMLTTC0002p/default.nq +++ b/src/test/resources/rml-io/RMLTTC0002p/default.nq @@ -1,5 +1,5 @@ - "33". - "34". - "35". - "36". - "37". + "33"^^. + "34"^^. + "35"^^. + "36"^^. + "37"^^. diff --git a/src/test/resources/rml-io/RMLTTC0002p/mapping.ttl b/src/test/resources/rml-io/RMLTTC0002p/mapping.ttl index 243777ba..b7d772ea 100644 --- a/src/test/resources/rml-io/RMLTTC0002p/mapping.ttl +++ b/src/test/resources/rml-io/RMLTTC0002p/mapping.ttl @@ -1,29 +1,26 @@ @prefix rml: . @prefix foaf: . -@prefix dcat: . -@prefix void: . @prefix formats: . @base . -<#DCATSourceAccess> a rml:Source, dcat:Distribution; - dcat:downloadURL ; -. - <#TriplesMap> a rml:TriplesMap; rml:logicalSource [ a rml:LogicalSource; - rml:source <#DCATSourceAccess>; + rml:source [ a rml:FilePath; + rml:root rml:MappingDirectory; + rml:path "Friends.json"; + ]; rml:referenceFormulation rml:JSONPath; - rml:iterator "$.[*]"; + rml:iterator "$[*]"; ]; rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{id}"; + rml:template "http://example.org/{$.id}"; ]; rml:predicateObjectMap [ a rml:PredicateObjectMap; rml:predicateMap [ a rml:PredicateMap; rml:constant foaf:name; ]; rml:objectMap [ a rml:ObjectMap; - rml:reference "name"; + rml:reference "$.name"; rml:languageMap [ a rml:LanguageMap; rml:constant "en"; rml:logicalTarget <#TargetDump1>; @@ -35,7 +32,7 @@ rml:constant foaf:name; ]; rml:objectMap [ a rml:ObjectMap; - rml:reference "name"; + rml:reference "$.name"; rml:languageMap [ a rml:LanguageMap; rml:constant "nl"; rml:logicalTarget <#TargetDump2>; @@ -47,21 +44,23 @@ rml:constant foaf:age; ]; rml:objectMap [ a rml:ObjectMap; - rml:reference "age"; + rml:reference "$.age"; ]; ]; . <#TargetDump1> a rml:LogicalTarget; - rml:target [ a rml:Target, void:Dataset; - void:dataDump ; + rml:target [ a rml:Target, rml:FilePath; + rml:root rml:CurrentWorkingDirectory; + rml:path "./dump1.nq"; ]; rml:serialization formats:N-Quads; . <#TargetDump2> a rml:LogicalTarget; - rml:target [ a rml:Target, void:Dataset; - void:dataDump ; + rml:target [ a rml:Target, rml:FilePath; + rml:root rml:CurrentWorkingDirectory; + rml:path "./dump2.nq"; ]; rml:serialization formats:N-Quads; . diff --git a/src/test/resources/rml-io/RMLTTC0002q/Friends.json b/src/test/resources/rml-io/RMLTTC0002q/Friends.json new file mode 100644 index 00000000..8e554498 --- /dev/null +++ b/src/test/resources/rml-io/RMLTTC0002q/Friends.json @@ -0,0 +1,27 @@ +[ + { + "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 + } +] diff --git a/src/test/resources/rml-io/RMLTTC0002q/README.md b/src/test/resources/rml-io/RMLTTC0002q/README.md new file mode 100644 index 00000000..e173efb3 --- /dev/null +++ b/src/test/resources/rml-io/RMLTTC0002q/README.md @@ -0,0 +1,142 @@ +## RMLTTC0002q + +**Title**: Multiple Targets: Multiple Datatype Maps + +**Description**: Test exporting all triples to Targets in multiple Datatype Maps. + +**Error expected?** No + +**Input** +``` +[ + { + "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 + } +] + +``` + +**Mapping** +``` +@prefix rml: . +@prefix foaf: . +@prefix xsd: . +@prefix formats: . +@base . + +<#TriplesMap> a rml:TriplesMap; + rml:logicalSource [ a rml:LogicalSource; + rml:source [ a rml:FilePath; + rml:root rml:MappingDirectory; + rml:path "Friends.json"; + ]; + rml:referenceFormulation rml:JSONPath; + rml:iterator "$[*]"; + ]; + rml:subjectMap [ a rml:SubjectMap; + rml:template "http://example.org/{$.id}"; + ]; + rml:predicateObjectMap [ a rml:PredicateObjectMap; + rml:predicateMap [ a rml:PredicateMap; + rml:constant foaf:name; + ]; + rml:objectMap [ a rml:ObjectMap; + rml:reference "$.name"; + ]; + ]; + rml:predicateObjectMap [ a rml:PredicateObjectMap; + rml:predicateMap [ a rml:PredicateMap; + rml:constant foaf:age; + ]; + rml:objectMap [ a rml:ObjectMap; + rml:reference "$.age"; + rml:datatypeMap [ a rml:DatatypeMap; + rml:constant xsd:integer; + rml:logicalTarget <#TargetDump1>; + ]; + ]; + ]; + rml:predicateObjectMap [ a rml:PredicateObjectMap; + rml:predicateMap [ a rml:PredicateMap; + rml:constant foaf:age; + ]; + rml:objectMap [ a rml:ObjectMap; + rml:reference "$.age"; + rml:datatypeMap [ a rml:DatatypeMap; + rml:constant xsd:double; + rml:logicalTarget <#TargetDump2>; + ]; + ]; + ]; +. + +<#TargetDump1> a rml:LogicalTarget; + rml:target [ a rml:Target, rml:FilePath; + rml:root rml:CurrentWorkingDirectory; + rml:path "./dump1.nq"; + ]; + rml:serialization formats:N-Quads; +. + +<#TargetDump2> a rml:LogicalTarget; + rml:target [ a rml:Target, rml:FilePath; + rml:root rml:CurrentWorkingDirectory; + rml:path "./dump2.nq"; + ]; + rml:serialization formats:N-Quads; +. + +``` + +**Output 1** +``` + "Monica Geller" . + "Rachel Green" . + "Joey Tribbiani" . + "Chandler Bing" . + "Ross Geller" . + +``` + +**Output 2** +``` + "33"^^. + "34"^^. + "35"^^. + "36"^^. + "37"^^. + +``` + +**Output 3** +``` + "33"^^. + "34"^^. + "35"^^. + "36"^^. + "37"^^. + +``` + diff --git a/src/test/resources/rml-io/RMLTTC0002q/mapping.ttl b/src/test/resources/rml-io/RMLTTC0002q/mapping.ttl index 6ab75cda..a049f6db 100644 --- a/src/test/resources/rml-io/RMLTTC0002q/mapping.ttl +++ b/src/test/resources/rml-io/RMLTTC0002q/mapping.ttl @@ -1,30 +1,27 @@ @prefix rml: . @prefix foaf: . -@prefix dcat: . -@prefix void: . @prefix xsd: . @prefix formats: . @base . -<#DCATSourceAccess> a rml:Source, dcat:Distribution; - dcat:downloadURL ; -. - <#TriplesMap> a rml:TriplesMap; rml:logicalSource [ a rml:LogicalSource; - rml:source <#DCATSourceAccess>; + rml:source [ a rml:FilePath; + rml:root rml:MappingDirectory; + rml:path "Friends.json"; + ]; rml:referenceFormulation rml:JSONPath; - rml:iterator "$.[*]"; + rml:iterator "$[*]"; ]; rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{id}"; + rml:template "http://example.org/{$.id}"; ]; rml:predicateObjectMap [ a rml:PredicateObjectMap; rml:predicateMap [ a rml:PredicateMap; rml:constant foaf:name; ]; rml:objectMap [ a rml:ObjectMap; - rml:reference "name"; + rml:reference "$.name"; ]; ]; rml:predicateObjectMap [ a rml:PredicateObjectMap; @@ -32,7 +29,7 @@ rml:constant foaf:age; ]; rml:objectMap [ a rml:ObjectMap; - rml:reference "age"; + rml:reference "$.age"; rml:datatypeMap [ a rml:DatatypeMap; rml:constant xsd:integer; rml:logicalTarget <#TargetDump1>; @@ -44,7 +41,7 @@ rml:constant foaf:age; ]; rml:objectMap [ a rml:ObjectMap; - rml:reference "age"; + rml:reference "$.age"; rml:datatypeMap [ a rml:DatatypeMap; rml:constant xsd:double; rml:logicalTarget <#TargetDump2>; @@ -54,15 +51,17 @@ . <#TargetDump1> a rml:LogicalTarget; - rml:target [ a rml:Target, void:Dataset; - void:dataDump ; + rml:target [ a rml:Target, rml:FilePath; + rml:root rml:CurrentWorkingDirectory; + rml:path "./dump1.nq"; ]; rml:serialization formats:N-Quads; . <#TargetDump2> a rml:LogicalTarget; - rml:target [ a rml:Target, void:Dataset; - void:dataDump ; + rml:target [ a rml:Target, rml:FilePath; + rml:root rml:CurrentWorkingDirectory; + rml:path "./dump2.nq"; ]; rml:serialization formats:N-Quads; . diff --git a/src/test/resources/rml-io/RMLTTC0002r/Friends.json b/src/test/resources/rml-io/RMLTTC0002r/Friends.json new file mode 100644 index 00000000..8e554498 --- /dev/null +++ b/src/test/resources/rml-io/RMLTTC0002r/Friends.json @@ -0,0 +1,27 @@ +[ + { + "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 + } +] diff --git a/src/test/resources/rml-io/RMLTTC0002r/README.md b/src/test/resources/rml-io/RMLTTC0002r/README.md new file mode 100644 index 00000000..06d17ffa --- /dev/null +++ b/src/test/resources/rml-io/RMLTTC0002r/README.md @@ -0,0 +1,109 @@ +## RMLTTC0002r + +**Title**: Multiple Targets: Multiple Term Maps with same Target + +**Description**: Test exporting all triples to same Target in multiple Term Maps. + +**Error expected?** No + +**Input** +``` +[ + { + "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 + } +] + +``` + +**Mapping** +``` +@prefix rml: . +@prefix foaf: . +@prefix formats: . +@base . + +<#TriplesMap> a rml:TriplesMap; + rml:logicalSource [ a rml:LogicalSource; + rml:source [ a rml:FilePath; + rml:root rml:MappingDirectory; + rml:path "Friends.json"; + ]; + rml:referenceFormulation rml:JSONPath; + rml:iterator "$[*]"; + ]; + rml:subjectMap [ a rml:SubjectMap; + rml:template "http://example.org/{$.id}"; + ]; + rml:predicateObjectMap [ a rml:PredicateObjectMap; + rml:predicateMap [ a rml:PredicateMap; + rml:constant foaf:name; + rml:logicalTarget <#TargetDump1>; + ]; + rml:objectMap [ a rml:ObjectMap; + rml:reference "$.name"; + ]; + ]; + rml:predicateObjectMap [ a rml:PredicateObjectMap; + rml:predicateMap [ a rml:PredicateMap; + rml:constant foaf:age; + rml:logicalTarget <#TargetDump1>; + ]; + rml:objectMap [ a rml:ObjectMap; + rml:reference "$.age"; + ]; + ]; +. + +<#TargetDump1> a rml:LogicalTarget; + rml:target [ a rml:Target, rml:FilePath; + rml:root rml:CurrentWorkingDirectory; + rml:path "./dump1.nq"; + ]; + rml:serialization formats:N-Quads; +. + +``` + +**Output 1** +``` + +``` + +**Output 2** +``` + "Monica Geller" . + "Rachel Green" . + "Joey Tribbiani" . + "Chandler Bing" . + "Ross Geller" . + "33" . + "34" . + "35" . + "36" . + "37" . + +``` + diff --git a/src/test/resources/rml-io/RMLTTC0002r/default.nq b/src/test/resources/rml-io/RMLTTC0002r/default.nq index ad87bcca..e69de29b 100644 --- a/src/test/resources/rml-io/RMLTTC0002r/default.nq +++ b/src/test/resources/rml-io/RMLTTC0002r/default.nq @@ -1,5 +0,0 @@ - "33". - "34". - "35". - "36". - "37". diff --git a/src/test/resources/rml-io/RMLTTC0002r/mapping.ttl b/src/test/resources/rml-io/RMLTTC0002r/mapping.ttl index 43abc170..97dfc619 100644 --- a/src/test/resources/rml-io/RMLTTC0002r/mapping.ttl +++ b/src/test/resources/rml-io/RMLTTC0002r/mapping.ttl @@ -1,22 +1,19 @@ @prefix rml: . @prefix foaf: . -@prefix dcat: . -@prefix void: . @prefix formats: . @base . -<#DCATSourceAccess> a rml:Source, dcat:Distribution; - dcat:downloadURL ; -. - <#TriplesMap> a rml:TriplesMap; rml:logicalSource [ a rml:LogicalSource; - rml:source <#DCATSourceAccess>; + rml:source [ a rml:FilePath; + rml:root rml:MappingDirectory; + rml:path "Friends.json"; + ]; rml:referenceFormulation rml:JSONPath; - rml:iterator "$.[*]"; + rml:iterator "$[*]"; ]; rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{id}"; + rml:template "http://example.org/{$.id}"; ]; rml:predicateObjectMap [ a rml:PredicateObjectMap; rml:predicateMap [ a rml:PredicateMap; @@ -24,7 +21,7 @@ rml:logicalTarget <#TargetDump1>; ]; rml:objectMap [ a rml:ObjectMap; - rml:reference "name"; + rml:reference "$.name"; ]; ]; rml:predicateObjectMap [ a rml:PredicateObjectMap; @@ -33,14 +30,15 @@ rml:logicalTarget <#TargetDump1>; ]; rml:objectMap [ a rml:ObjectMap; - rml:reference "age"; + rml:reference "$.age"; ]; ]; . <#TargetDump1> a rml:LogicalTarget; - rml:target [ a rml:Target, void:Dataset; - void:dataDump ; + rml:target [ a rml:Target, rml:FilePath; + rml:root rml:CurrentWorkingDirectory; + rml:path "./dump1.nq"; ]; rml:serialization formats:N-Quads; . diff --git a/src/test/resources/rml-io/RMLTTC0003a/Friends.json b/src/test/resources/rml-io/RMLTTC0003a/Friends.json new file mode 100644 index 00000000..8e554498 --- /dev/null +++ b/src/test/resources/rml-io/RMLTTC0003a/Friends.json @@ -0,0 +1,27 @@ +[ + { + "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 + } +] diff --git a/src/test/resources/rml-io/RMLTTC0003a/README.md b/src/test/resources/rml-io/RMLTTC0003a/README.md new file mode 100644 index 00000000..61447677 --- /dev/null +++ b/src/test/resources/rml-io/RMLTTC0003a/README.md @@ -0,0 +1,136 @@ +## RMLTTC0003a + +**Title**: Overriding Targets: Seperate Triples Map + +**Description**: Test exporting some triples to a different Target with a separate Triples Map. + +**Error expected?** No + +**Input** +``` +[ + { + "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 + } +] + +``` + +**Mapping** +``` +@prefix rml: . +@prefix foaf: . +@prefix formats: . +@base . + +<#TriplesMap> a rml:TriplesMap; + rml:logicalSource [ a rml:LogicalSource; + rml:source [ a rml:FilePath; + rml:root rml:MappingDirectory; + rml:path "Friends.json"; + ]; + rml:referenceFormulation rml:JSONPath; + rml:iterator "$[*]"; + ]; + rml:subjectMap [ a rml:SubjectMap; + rml:template "http://example.org/{$.id}"; + rml:logicalTarget <#TargetDump2>; + ]; + rml:predicateObjectMap [ a rml:PredicateObjectMap; + rml:predicateMap [ a rml:PredicateMap; + rml:constant foaf:age; + ]; + rml:objectMap [ a rml:ObjectMap; + rml:reference "$.age"; + ]; + ]; +. + +<#TriplesMap2> a rml:TriplesMap; + rml:logicalSource [ a rml:LogicalSource; + rml:source [ a rml:FilePath; + rml:root rml:MappingDirectory; + rml:path "Friends.json"; + ]; + rml:referenceFormulation rml:JSONPath; + rml:iterator "$[*]"; + ]; + rml:subjectMap [ a rml:SubjectMap; + rml:template "http://example.org/{$.id}"; + rml:logicalTarget <#TargetDump1>; + ]; + rml:predicateObjectMap [ a rml:PredicateObjectMap; + rml:predicateMap [ a rml:PredicateMap; + rml:constant foaf:name; + ]; + rml:objectMap [ a rml:ObjectMap; + rml:reference "$.name"; + ]; + ]; +. + +<#TargetDump1> a rml:LogicalTarget; + rml:target [ a rml:Target, rml:FilePath; + rml:root rml:CurrentWorkingDirectory; + rml:path "./dump1.nq"; + ]; + rml:serialization formats:N-Quads; +. + +<#TargetDump2> a rml:LogicalTarget; + rml:target [ a rml:Target, rml:FilePath; + rml:root rml:CurrentWorkingDirectory; + rml:path "./dump2.nq"; + ]; + rml:serialization formats:N-Quads; +. + +``` + +**Output 1** +``` + +``` + +**Output 2** +``` + "Monica Geller" . + "Rachel Green" . + "Joey Tribbiani" . + "Chandler Bing" . + "Ross Geller" . + +``` + +**Output 3** +``` + "33" . + "34" . + "35" . + "36" . + "37" . + +``` + diff --git a/src/test/resources/rml-io/RMLTTC0003a/mapping.ttl b/src/test/resources/rml-io/RMLTTC0003a/mapping.ttl index 416901d8..615f15e6 100644 --- a/src/test/resources/rml-io/RMLTTC0003a/mapping.ttl +++ b/src/test/resources/rml-io/RMLTTC0003a/mapping.ttl @@ -1,42 +1,42 @@ @prefix rml: . @prefix foaf: . -@prefix dcat: . -@prefix void: . @prefix formats: . @base . -<#DCATSourceAccess> a rml:Source, dcat:Distribution; - dcat:downloadURL ; -. - <#TriplesMap> a rml:TriplesMap; rml:logicalSource [ a rml:LogicalSource; - rml:source <#DCATSourceAccess>; + rml:source [ a rml:FilePath; + rml:root rml:MappingDirectory; + rml:path "Friends.json"; + ]; rml:referenceFormulation rml:JSONPath; - rml:iterator "$.[*]"; + rml:iterator "$[*]"; ]; rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{id}"; - rml:logicalTarget <#TargetDump1>; + rml:template "http://example.org/{$.id}"; + rml:logicalTarget <#TargetDump2>; ]; rml:predicateObjectMap [ a rml:PredicateObjectMap; rml:predicateMap [ a rml:PredicateMap; rml:constant foaf:age; ]; rml:objectMap [ a rml:ObjectMap; - rml:reference "age"; + rml:reference "$.age"; ]; ]; . -<#TriplesMap> a rml:TriplesMap; +<#TriplesMap2> a rml:TriplesMap; rml:logicalSource [ a rml:LogicalSource; - rml:source <#DCATSourceAccess>; + rml:source [ a rml:FilePath; + rml:root rml:MappingDirectory; + rml:path "Friends.json"; + ]; rml:referenceFormulation rml:JSONPath; - rml:iterator "$.[*]"; + rml:iterator "$[*]"; ]; rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{id}"; + rml:template "http://example.org/{$.id}"; rml:logicalTarget <#TargetDump1>; ]; rml:predicateObjectMap [ a rml:PredicateObjectMap; @@ -44,21 +44,23 @@ rml:constant foaf:name; ]; rml:objectMap [ a rml:ObjectMap; - rml:reference "name"; + rml:reference "$.name"; ]; ]; . <#TargetDump1> a rml:LogicalTarget; - rml:target [ a rml:Target, void:Dataset; - void:dataDump ; + rml:target [ a rml:Target, rml:FilePath; + rml:root rml:CurrentWorkingDirectory; + rml:path "./dump1.nq"; ]; rml:serialization formats:N-Quads; . <#TargetDump2> a rml:LogicalTarget; - rml:target [ a rml:Target, void:Dataset; - void:dataDump ; + rml:target [ a rml:Target, rml:FilePath; + rml:root rml:CurrentWorkingDirectory; + rml:path "./dump2.nq"; ]; rml:serialization formats:N-Quads; . diff --git a/src/test/resources/rml-io/RMLTTC0004a/Friends.json b/src/test/resources/rml-io/RMLTTC0004a/Friends.json new file mode 100644 index 00000000..8e554498 --- /dev/null +++ b/src/test/resources/rml-io/RMLTTC0004a/Friends.json @@ -0,0 +1,27 @@ +[ + { + "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 + } +] diff --git a/src/test/resources/rml-io/RMLTTC0004a/README.md b/src/test/resources/rml-io/RMLTTC0004a/README.md new file mode 100644 index 00000000..1233d592 --- /dev/null +++ b/src/test/resources/rml-io/RMLTTC0004a/README.md @@ -0,0 +1,131 @@ +## RMLTTC0004a + +**Title**: Target JSON-LD + +**Description**: Test export all triples as JSON-LD + +**Error expected?** No + +**Input** +``` +[ + { + "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 + } +] + +``` + +**Mapping** +``` +@prefix rml: . +@prefix foaf: . +@prefix formats: . +@base . + +<#TriplesMap> a rml:TriplesMap; + rml:logicalSource [ a rml:LogicalSource; + rml:source [ a rml:FilePath; + rml:root rml:MappingDirectory; + rml:path "Friends.json"; + ]; + rml:referenceFormulation rml:JSONPath; + rml:iterator "$[*]"; + ]; + rml:subjectMap [ a rml:SubjectMap; + rml:template "http://example.org/{$.id}"; + rml:logicalTarget <#TargetDump1>; + ]; + rml:predicateObjectMap [ a rml:PredicateObjectMap; + rml:predicateMap [ a rml:PredicateMap; + rml:constant foaf:name; + ]; + rml:objectMap [ a rml:ObjectMap; + rml:reference "$.name"; + ]; + ]; + rml:predicateObjectMap [ a rml:PredicateObjectMap; + rml:predicateMap [ a rml:PredicateMap; + rml:constant foaf:age; + ]; + rml:objectMap [ a rml:ObjectMap; + rml:reference "$.age"; + ]; + ]; +. + +<#TargetDump1> a rml:LogicalTarget; + rml:target [ a rml:Target, rml:FilePath; + rml:root rml:CurrentWorkingDirectory; + rml:path "./dump1.jsonld"; + ]; + rml:serialization formats:JSON-LD; +. + +``` + +**Output 1** +``` + +``` + +**Output 2** +``` +{ + "@context": { + "foaf": "http://xmlns.com/foaf/0.1/" + }, + "@graph": [ + { + + "@id": "http://example.org/0", + "foaf:name": "Monica Geller", + "foaf:age": "33" + }, + { + "@id": "http://example.org/1", + "foaf:name": "Rachel Green", + "foaf:age": "34" + }, + { + "@id": "http://example.org/2", + "foaf:name": "Joey Tribbiani", + "foaf:age": "35" + }, + { + "@id": "http://example.org/3", + "foaf:name": "Chandler Bing", + "foaf:age": "36" + }, + { + "@id": "http://example.org/4", + "foaf:name": "Ross Geller", + "foaf:age": "37" + } + ] +} + +``` + diff --git a/src/test/resources/rml-io/RMLTTC0004a/mapping.ttl b/src/test/resources/rml-io/RMLTTC0004a/mapping.ttl index ad851088..7ed7673a 100644 --- a/src/test/resources/rml-io/RMLTTC0004a/mapping.ttl +++ b/src/test/resources/rml-io/RMLTTC0004a/mapping.ttl @@ -1,22 +1,19 @@ @prefix rml: . @prefix foaf: . -@prefix dcat: . -@prefix void: . @prefix formats: . @base . -<#DCATSourceAccess> a rml:Source, dcat:Distribution; - dcat:downloadURL ; -. - <#TriplesMap> a rml:TriplesMap; rml:logicalSource [ a rml:LogicalSource; - rml:source <#DCATSourceAccess>; + rml:source [ a rml:FilePath; + rml:root rml:MappingDirectory; + rml:path "Friends.json"; + ]; rml:referenceFormulation rml:JSONPath; - rml:iterator "$.[*]"; + rml:iterator "$[*]"; ]; rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{id}"; + rml:template "http://example.org/{$.id}"; rml:logicalTarget <#TargetDump1>; ]; rml:predicateObjectMap [ a rml:PredicateObjectMap; @@ -24,7 +21,7 @@ rml:constant foaf:name; ]; rml:objectMap [ a rml:ObjectMap; - rml:reference "name"; + rml:reference "$.name"; ]; ]; rml:predicateObjectMap [ a rml:PredicateObjectMap; @@ -32,14 +29,15 @@ rml:constant foaf:age; ]; rml:objectMap [ a rml:ObjectMap; - rml:reference "age"; + rml:reference "$.age"; ]; ]; . <#TargetDump1> a rml:LogicalTarget; - rml:target [ a rml:Target, void:Dataset; - void:dataDump ; + rml:target [ a rml:Target, rml:FilePath; + rml:root rml:CurrentWorkingDirectory; + rml:path "./dump1.jsonld"; ]; rml:serialization formats:JSON-LD; . diff --git a/src/test/resources/rml-io/RMLTTC0004b/Friends.json b/src/test/resources/rml-io/RMLTTC0004b/Friends.json new file mode 100644 index 00000000..8e554498 --- /dev/null +++ b/src/test/resources/rml-io/RMLTTC0004b/Friends.json @@ -0,0 +1,27 @@ +[ + { + "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 + } +] diff --git a/src/test/resources/rml-io/RMLTTC0004b/README.md b/src/test/resources/rml-io/RMLTTC0004b/README.md new file mode 100644 index 00000000..86e5e6d2 --- /dev/null +++ b/src/test/resources/rml-io/RMLTTC0004b/README.md @@ -0,0 +1,110 @@ +## RMLTTC0004b + +**Title**: Target N3 + +**Description**: Test export all triples as N3 + +**Error expected?** No + +**Input** +``` +[ + { + "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 + } +] + +``` + +**Mapping** +``` +@prefix rml: . +@prefix foaf: . +@prefix formats: . +@base . + +<#TriplesMap> a rml:TriplesMap; + rml:logicalSource [ a rml:LogicalSource; + rml:source [ a rml:FilePath; + rml:root rml:MappingDirectory; + rml:path "Friends.json"; + ]; + rml:referenceFormulation rml:JSONPath; + rml:iterator "$[*]"; + ]; + rml:subjectMap [ a rml:SubjectMap; + rml:template "http://example.org/{$.id}"; + rml:logicalTarget <#TargetDump1>; + ]; + rml:predicateObjectMap [ a rml:PredicateObjectMap; + rml:predicateMap [ a rml:PredicateMap; + rml:constant foaf:name; + ]; + rml:objectMap [ a rml:ObjectMap; + rml:reference "$.name"; + ]; + ]; + rml:predicateObjectMap [ a rml:PredicateObjectMap; + rml:predicateMap [ a rml:PredicateMap; + rml:constant foaf:age; + ]; + rml:objectMap [ a rml:ObjectMap; + rml:reference "$.age"; + ]; + ]; +. + +<#TargetDump1> a rml:LogicalTarget; + rml:target [ a rml:Target, rml:FilePath; + rml:root rml:CurrentWorkingDirectory; + rml:path "./dump1.n3"; + ]; + rml:serialization formats:N3; +. + +``` + +**Output 1** +``` + +``` + +**Output 2** +``` +@prefix foaf: . +@prefix ex: . +ex:0 "33" ; + "Monica Geller" . +ex:1 "34" ; + "Rachel Green" . +ex:2 "35" ; + "Joey Tribbiani" . +ex:3 "36" ; + "Chandler Bing" . +ex:4 "37" ; + "Ross Geller" . + +``` + diff --git a/src/test/resources/rml-io/RMLTTC0004b/mapping.ttl b/src/test/resources/rml-io/RMLTTC0004b/mapping.ttl index 1f1266cf..255349f2 100644 --- a/src/test/resources/rml-io/RMLTTC0004b/mapping.ttl +++ b/src/test/resources/rml-io/RMLTTC0004b/mapping.ttl @@ -1,22 +1,19 @@ @prefix rml: . @prefix foaf: . -@prefix dcat: . -@prefix void: . @prefix formats: . @base . -<#DCATSourceAccess> a rml:Source, dcat:Distribution; - dcat:downloadURL ; -. - <#TriplesMap> a rml:TriplesMap; rml:logicalSource [ a rml:LogicalSource; - rml:source <#DCATSourceAccess>; + rml:source [ a rml:FilePath; + rml:root rml:MappingDirectory; + rml:path "Friends.json"; + ]; rml:referenceFormulation rml:JSONPath; - rml:iterator "$.[*]"; + rml:iterator "$[*]"; ]; rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{id}"; + rml:template "http://example.org/{$.id}"; rml:logicalTarget <#TargetDump1>; ]; rml:predicateObjectMap [ a rml:PredicateObjectMap; @@ -24,7 +21,7 @@ rml:constant foaf:name; ]; rml:objectMap [ a rml:ObjectMap; - rml:reference "name"; + rml:reference "$.name"; ]; ]; rml:predicateObjectMap [ a rml:PredicateObjectMap; @@ -32,14 +29,15 @@ rml:constant foaf:age; ]; rml:objectMap [ a rml:ObjectMap; - rml:reference "age"; + rml:reference "$.age"; ]; ]; . <#TargetDump1> a rml:LogicalTarget; - rml:target [ a rml:Target, void:Dataset; - void:dataDump ; + rml:target [ a rml:Target, rml:FilePath; + rml:root rml:CurrentWorkingDirectory; + rml:path "./dump1.n3"; ]; rml:serialization formats:N3; . diff --git a/src/test/resources/rml-io/RMLTTC0004c/Friends.json b/src/test/resources/rml-io/RMLTTC0004c/Friends.json new file mode 100644 index 00000000..8e554498 --- /dev/null +++ b/src/test/resources/rml-io/RMLTTC0004c/Friends.json @@ -0,0 +1,27 @@ +[ + { + "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 + } +] diff --git a/src/test/resources/rml-io/RMLTTC0004c/README.md b/src/test/resources/rml-io/RMLTTC0004c/README.md new file mode 100644 index 00000000..72e1b327 --- /dev/null +++ b/src/test/resources/rml-io/RMLTTC0004c/README.md @@ -0,0 +1,108 @@ +## RMLTTC0004c + +**Title**: Target N-Triples + +**Description**: Test export all triples as N-Triples + +**Error expected?** No + +**Input** +``` +[ + { + "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 + } +] + +``` + +**Mapping** +``` +@prefix rml: . +@prefix foaf: . +@prefix formats: . +@base . + +<#TriplesMap> a rml:TriplesMap; + rml:logicalSource [ a rml:LogicalSource; + rml:source [ a rml:FilePath; + rml:root rml:MappingDirectory; + rml:path "Friends.json"; + ]; + rml:referenceFormulation rml:JSONPath; + rml:iterator "$[*]"; + ]; + rml:subjectMap [ a rml:SubjectMap; + rml:template "http://example.org/{$.id}"; + rml:logicalTarget <#TargetDump1>; + ]; + rml:predicateObjectMap [ a rml:PredicateObjectMap; + rml:predicateMap [ a rml:PredicateMap; + rml:constant foaf:name; + ]; + rml:objectMap [ a rml:ObjectMap; + rml:reference "$.name"; + ]; + ]; + rml:predicateObjectMap [ a rml:PredicateObjectMap; + rml:predicateMap [ a rml:PredicateMap; + rml:constant foaf:age; + ]; + rml:objectMap [ a rml:ObjectMap; + rml:reference "$.age"; + ]; + ]; +. + +<#TargetDump1> a rml:LogicalTarget; + rml:target [ a rml:Target, rml:FilePath; + rml:root rml:CurrentWorkingDirectory; + rml:path "./dump1.nt"; + ]; + rml:serialization formats:N-Triples; +. + +``` + +**Output 1** +``` + +``` + +**Output 2** +``` + "33" . + "Monica Geller" . + "34" . + "Rachel Green" . + "35" . + "Joey Tribbiani" . + "36" . + "Chandler Bing" . + "37" . + "Ross Geller" . + +``` + diff --git a/src/test/resources/rml-io/RMLTTC0004c/mapping.ttl b/src/test/resources/rml-io/RMLTTC0004c/mapping.ttl index 51707db0..30977d24 100644 --- a/src/test/resources/rml-io/RMLTTC0004c/mapping.ttl +++ b/src/test/resources/rml-io/RMLTTC0004c/mapping.ttl @@ -1,22 +1,19 @@ @prefix rml: . @prefix foaf: . -@prefix dcat: . -@prefix void: . @prefix formats: . @base . -<#DCATSourceAccess> a rml:Source, dcat:Distribution; - dcat:downloadURL ; -. - <#TriplesMap> a rml:TriplesMap; rml:logicalSource [ a rml:LogicalSource; - rml:source <#DCATSourceAccess>; + rml:source [ a rml:FilePath; + rml:root rml:MappingDirectory; + rml:path "Friends.json"; + ]; rml:referenceFormulation rml:JSONPath; - rml:iterator "$.[*]"; + rml:iterator "$[*]"; ]; rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{id}"; + rml:template "http://example.org/{$.id}"; rml:logicalTarget <#TargetDump1>; ]; rml:predicateObjectMap [ a rml:PredicateObjectMap; @@ -24,7 +21,7 @@ rml:constant foaf:name; ]; rml:objectMap [ a rml:ObjectMap; - rml:reference "name"; + rml:reference "$.name"; ]; ]; rml:predicateObjectMap [ a rml:PredicateObjectMap; @@ -32,14 +29,15 @@ rml:constant foaf:age; ]; rml:objectMap [ a rml:ObjectMap; - rml:reference "age"; + rml:reference "$.age"; ]; ]; . <#TargetDump1> a rml:LogicalTarget; - rml:target [ a rml:Target, void:Dataset; - void:dataDump ; + rml:target [ a rml:Target, rml:FilePath; + rml:root rml:CurrentWorkingDirectory; + rml:path "./dump1.nt"; ]; rml:serialization formats:N-Triples; . diff --git a/src/test/resources/rml-io/RMLTTC0004d/Friends.json b/src/test/resources/rml-io/RMLTTC0004d/Friends.json new file mode 100644 index 00000000..8e554498 --- /dev/null +++ b/src/test/resources/rml-io/RMLTTC0004d/Friends.json @@ -0,0 +1,27 @@ +[ + { + "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 + } +] diff --git a/src/test/resources/rml-io/RMLTTC0004d/README.md b/src/test/resources/rml-io/RMLTTC0004d/README.md new file mode 100644 index 00000000..68b41dbc --- /dev/null +++ b/src/test/resources/rml-io/RMLTTC0004d/README.md @@ -0,0 +1,108 @@ +## RMLTTC0004d + +**Title**: Target N-Quads + +**Description**: Test export all triples as N-Quads + +**Error expected?** No + +**Input** +``` +[ + { + "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 + } +] + +``` + +**Mapping** +``` +@prefix rml: . +@prefix foaf: . +@prefix formats: . +@base . + +<#TriplesMap> a rml:TriplesMap; + rml:logicalSource [ a rml:LogicalSource; + rml:source [ a rml:FilePath; + rml:root rml:MappingDirectory; + rml:path "Friends.json"; + ]; + rml:referenceFormulation rml:JSONPath; + rml:iterator "$[*]"; + ]; + rml:subjectMap [ a rml:SubjectMap; + rml:template "http://example.org/{$.id}"; + rml:logicalTarget <#TargetDump1>; + ]; + rml:predicateObjectMap [ a rml:PredicateObjectMap; + rml:predicateMap [ a rml:PredicateMap; + rml:constant foaf:name; + ]; + rml:objectMap [ a rml:ObjectMap; + rml:reference "$.name"; + ]; + ]; + rml:predicateObjectMap [ a rml:PredicateObjectMap; + rml:predicateMap [ a rml:PredicateMap; + rml:constant foaf:age; + ]; + rml:objectMap [ a rml:ObjectMap; + rml:reference "$.age"; + ]; + ]; +. + +<#TargetDump1> a rml:LogicalTarget; + rml:target [ a rml:Target, rml:FilePath; + rml:root rml:CurrentWorkingDirectory; + rml:path "./dump1.nq"; + ]; + rml:serialization formats:N-Quads; +. + +``` + +**Output 1** +``` + +``` + +**Output 2** +``` + "33" . + "Monica Geller" . + "34" . + "Rachel Green" . + "35" . + "Joey Tribbiani" . + "36" . + "Chandler Bing" . + "37" . + "Ross Geller" . + +``` + diff --git a/src/test/resources/rml-io/RMLTTC0004d/mapping.ttl b/src/test/resources/rml-io/RMLTTC0004d/mapping.ttl index 9d005bd1..e2b46141 100644 --- a/src/test/resources/rml-io/RMLTTC0004d/mapping.ttl +++ b/src/test/resources/rml-io/RMLTTC0004d/mapping.ttl @@ -1,22 +1,19 @@ @prefix rml: . @prefix foaf: . -@prefix dcat: . -@prefix void: . @prefix formats: . @base . -<#DCATSourceAccess> a rml:Source, dcat:Distribution; - dcat:downloadURL ; -. - <#TriplesMap> a rml:TriplesMap; rml:logicalSource [ a rml:LogicalSource; - rml:source <#DCATSourceAccess>; + rml:source [ a rml:FilePath; + rml:root rml:MappingDirectory; + rml:path "Friends.json"; + ]; rml:referenceFormulation rml:JSONPath; - rml:iterator "$.[*]"; + rml:iterator "$[*]"; ]; rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{id}"; + rml:template "http://example.org/{$.id}"; rml:logicalTarget <#TargetDump1>; ]; rml:predicateObjectMap [ a rml:PredicateObjectMap; @@ -24,7 +21,7 @@ rml:constant foaf:name; ]; rml:objectMap [ a rml:ObjectMap; - rml:reference "name"; + rml:reference "$.name"; ]; ]; rml:predicateObjectMap [ a rml:PredicateObjectMap; @@ -32,14 +29,15 @@ rml:constant foaf:age; ]; rml:objectMap [ a rml:ObjectMap; - rml:reference "age"; + rml:reference "$.age"; ]; ]; . <#TargetDump1> a rml:LogicalTarget; - rml:target [ a rml:Target, void:Dataset; - void:dataDump ; + rml:target [ a rml:Target, rml:FilePath; + rml:root rml:CurrentWorkingDirectory; + rml:path "./dump1.nq"; ]; rml:serialization formats:N-Quads; . diff --git a/src/test/resources/rml-io/RMLTTC0004e/Friends.json b/src/test/resources/rml-io/RMLTTC0004e/Friends.json new file mode 100644 index 00000000..8e554498 --- /dev/null +++ b/src/test/resources/rml-io/RMLTTC0004e/Friends.json @@ -0,0 +1,27 @@ +[ + { + "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 + } +] diff --git a/src/test/resources/rml-io/RMLTTC0004e/README.md b/src/test/resources/rml-io/RMLTTC0004e/README.md new file mode 100644 index 00000000..84c3c4c1 --- /dev/null +++ b/src/test/resources/rml-io/RMLTTC0004e/README.md @@ -0,0 +1,120 @@ +## RMLTTC0004e + +**Title**: Target RDF/JSON + +**Description**: Test export all triples as RDF/JSON + +**Error expected?** No + +**Input** +``` +[ + { + "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 + } +] + +``` + +**Mapping** +``` +@prefix rml: . +@prefix foaf: . +@prefix formats: . +@base . + +<#TriplesMap> a rml:TriplesMap; + rml:logicalSource [ a rml:LogicalSource; + rml:source [ a rml:FilePath; + rml:root rml:MappingDirectory; + rml:path "Friends.json"; + ]; + rml:referenceFormulation rml:JSONPath; + rml:iterator "$[*]"; + ]; + rml:subjectMap [ a rml:SubjectMap; + rml:template "http://example.org/{$.id}"; + rml:logicalTarget <#TargetDump1>; + ]; + rml:predicateObjectMap [ a rml:PredicateObjectMap; + rml:predicateMap [ a rml:PredicateMap; + rml:constant foaf:name; + ]; + rml:objectMap [ a rml:ObjectMap; + rml:reference "$.name"; + ]; + ]; + rml:predicateObjectMap [ a rml:PredicateObjectMap; + rml:predicateMap [ a rml:PredicateMap; + rml:constant foaf:age; + ]; + rml:objectMap [ a rml:ObjectMap; + rml:reference "$.age"; + ]; + ]; +. + +<#TargetDump1> a rml:LogicalTarget; + rml:target [ a rml:Target, rml:FilePath; + rml:root rml:CurrentWorkingDirectory; + rml:path "./dump1.rdfjson"; + ]; + rml:serialization formats:RDF_JSON; +. + +``` + +**Output 1** +``` + +``` + +**Output 2** +``` +{ + "http://example.org/0" : { + "http://xmlns.com/foaf/0.1/age" : [ { "value" : "33" } ], + "http://xmlns.com/foaf/0.1/name" : [ { "value" : "Monica Geller" } ] + }, + "http://example.org/1" : { + "http://xmlns.com/foaf/0.1/age" : [ { "value" : "34" } ], + "http://xmlns.com/foaf/0.1/name" : [ { "value" : "Rachel Green" } ] + }, + "http://example.org/2" : { + "http://xmlns.com/foaf/0.1/age" : [ { "value" : "35" } ], + "http://xmlns.com/foaf/0.1/name" : [ { "value" : "Joey Tribbiani" } ] + }, + "http://example.org/3" : { + "http://xmlns.com/foaf/0.1/age" : [ { "value" : "36" } ], + "http://xmlns.com/foaf/0.1/name" : [ { "value" : "Chandler Bing" } ] + }, + "http://example.org/4" : { + "http://xmlns.com/foaf/0.1/age" : [ { "value" : "37" } ], + "http://xmlns.com/foaf/0.1/name" : [ { "value" : "Ross Geller" } ] + } +} + +``` + diff --git a/src/test/resources/rml-io/RMLTTC0004e/mapping.ttl b/src/test/resources/rml-io/RMLTTC0004e/mapping.ttl index 9ff050a3..c27fded8 100644 --- a/src/test/resources/rml-io/RMLTTC0004e/mapping.ttl +++ b/src/test/resources/rml-io/RMLTTC0004e/mapping.ttl @@ -1,22 +1,19 @@ @prefix rml: . @prefix foaf: . -@prefix dcat: . -@prefix void: . @prefix formats: . @base . -<#DCATSourceAccess> a rml:Source, dcat:Distribution; - dcat:downloadURL ; -. - <#TriplesMap> a rml:TriplesMap; rml:logicalSource [ a rml:LogicalSource; - rml:source <#DCATSourceAccess>; + rml:source [ a rml:FilePath; + rml:root rml:MappingDirectory; + rml:path "Friends.json"; + ]; rml:referenceFormulation rml:JSONPath; - rml:iterator "$.[*]"; + rml:iterator "$[*]"; ]; rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{id}"; + rml:template "http://example.org/{$.id}"; rml:logicalTarget <#TargetDump1>; ]; rml:predicateObjectMap [ a rml:PredicateObjectMap; @@ -24,7 +21,7 @@ rml:constant foaf:name; ]; rml:objectMap [ a rml:ObjectMap; - rml:reference "name"; + rml:reference "$.name"; ]; ]; rml:predicateObjectMap [ a rml:PredicateObjectMap; @@ -32,14 +29,15 @@ rml:constant foaf:age; ]; rml:objectMap [ a rml:ObjectMap; - rml:reference "age"; + rml:reference "$.age"; ]; ]; . <#TargetDump1> a rml:LogicalTarget; - rml:target [ a rml:Target, void:Dataset; - void:dataDump ; + rml:target [ a rml:Target, rml:FilePath; + rml:root rml:CurrentWorkingDirectory; + rml:path "./dump1.rdfjson"; ]; rml:serialization formats:RDF_JSON; . diff --git a/src/test/resources/rml-io/RMLTTC0004f/Friends.json b/src/test/resources/rml-io/RMLTTC0004f/Friends.json new file mode 100644 index 00000000..8e554498 --- /dev/null +++ b/src/test/resources/rml-io/RMLTTC0004f/Friends.json @@ -0,0 +1,27 @@ +[ + { + "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 + } +] diff --git a/src/test/resources/rml-io/RMLTTC0004f/README.md b/src/test/resources/rml-io/RMLTTC0004f/README.md new file mode 100644 index 00000000..83c12590 --- /dev/null +++ b/src/test/resources/rml-io/RMLTTC0004f/README.md @@ -0,0 +1,121 @@ +## RMLTTC0004f + +**Title**: Target RDF/XML + +**Description**: Test export all triples as RDF/XML + +**Error expected?** No + +**Input** +``` +[ + { + "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 + } +] + +``` + +**Mapping** +``` +@prefix rml: . +@prefix foaf: . +@prefix formats: . +@base . + +<#TriplesMap> a rml:TriplesMap; + rml:logicalSource [ a rml:LogicalSource; + rml:source [ a rml:FilePath; + rml:root rml:MappingDirectory; + rml:path "Friends.json"; + ]; + rml:referenceFormulation rml:JSONPath; + rml:iterator "$[*]"; + ]; + rml:subjectMap [ a rml:SubjectMap; + rml:template "http://example.org/{$.id}"; + rml:logicalTarget <#TargetDump1>; + ]; + rml:predicateObjectMap [ a rml:PredicateObjectMap; + rml:predicateMap [ a rml:PredicateMap; + rml:constant foaf:name; + ]; + rml:objectMap [ a rml:ObjectMap; + rml:reference "$.name"; + ]; + ]; + rml:predicateObjectMap [ a rml:PredicateObjectMap; + rml:predicateMap [ a rml:PredicateMap; + rml:constant foaf:age; + ]; + rml:objectMap [ a rml:ObjectMap; + rml:reference "$.age"; + ]; + ]; +. + +<#TargetDump1> a rml:LogicalTarget; + rml:target [ a rml:Target, rml:FilePath; + rml:root rml:CurrentWorkingDirectory; + rml:path "./dump1.rdfxml"; + ]; + rml:serialization formats:RDF_XML; +. + +``` + +**Output 1** +``` + +``` + +**Output 2** +``` + + + 33 + Monica Geller + + + 34 + Rachel Green + + + 35 + Joey Tribbiani + + + 36 + Chandler Bing + + + 37 + Ross Geller + + + +``` + diff --git a/src/test/resources/rml-io/RMLTTC0004f/mapping.ttl b/src/test/resources/rml-io/RMLTTC0004f/mapping.ttl index db59ec0e..4a100eb8 100644 --- a/src/test/resources/rml-io/RMLTTC0004f/mapping.ttl +++ b/src/test/resources/rml-io/RMLTTC0004f/mapping.ttl @@ -1,22 +1,19 @@ @prefix rml: . @prefix foaf: . -@prefix dcat: . -@prefix void: . @prefix formats: . @base . -<#DCATSourceAccess> a rml:Source, dcat:Distribution; - dcat:downloadURL ; -. - <#TriplesMap> a rml:TriplesMap; rml:logicalSource [ a rml:LogicalSource; - rml:source <#DCATSourceAccess>; + rml:source [ a rml:FilePath; + rml:root rml:MappingDirectory; + rml:path "Friends.json"; + ]; rml:referenceFormulation rml:JSONPath; - rml:iterator "$.[*]"; + rml:iterator "$[*]"; ]; rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{id}"; + rml:template "http://example.org/{$.id}"; rml:logicalTarget <#TargetDump1>; ]; rml:predicateObjectMap [ a rml:PredicateObjectMap; @@ -24,7 +21,7 @@ rml:constant foaf:name; ]; rml:objectMap [ a rml:ObjectMap; - rml:reference "name"; + rml:reference "$.name"; ]; ]; rml:predicateObjectMap [ a rml:PredicateObjectMap; @@ -32,14 +29,15 @@ rml:constant foaf:age; ]; rml:objectMap [ a rml:ObjectMap; - rml:reference "age"; + rml:reference "$.age"; ]; ]; . <#TargetDump1> a rml:LogicalTarget; - rml:target [ a rml:Target, void:Dataset; - void:dataDump ; + rml:target [ a rml:Target, rml:FilePath; + rml:root rml:CurrentWorkingDirectory; + rml:path "./dump1.rdfxml"; ]; rml:serialization formats:RDF_XML; . diff --git a/src/test/resources/rml-io/RMLTTC0004g/Friends.json b/src/test/resources/rml-io/RMLTTC0004g/Friends.json new file mode 100644 index 00000000..8e554498 --- /dev/null +++ b/src/test/resources/rml-io/RMLTTC0004g/Friends.json @@ -0,0 +1,27 @@ +[ + { + "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 + } +] diff --git a/src/test/resources/rml-io/RMLTTC0004g/README.md b/src/test/resources/rml-io/RMLTTC0004g/README.md new file mode 100644 index 00000000..f44425ce --- /dev/null +++ b/src/test/resources/rml-io/RMLTTC0004g/README.md @@ -0,0 +1,108 @@ +## RMLTTC0004g + +**Title**: Target Turtle + +**Description**: Test export all triples as Turtle + +**Error expected?** No + +**Input** +``` +[ + { + "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 + } +] + +``` + +**Mapping** +``` +@prefix rml: . +@prefix foaf: . +@prefix formats: . +@base . + +<#TriplesMap> a rml:TriplesMap; + rml:logicalSource [ a rml:LogicalSource; + rml:source [ a rml:FilePath; + rml:root rml:MappingDirectory; + rml:path "Friends.json"; + ]; + rml:referenceFormulation rml:JSONPath; + rml:iterator "$[*]"; + ]; + rml:subjectMap [ a rml:SubjectMap; + rml:template "http://example.org/{$.id}"; + rml:logicalTarget <#TargetDump1>; + ]; + rml:predicateObjectMap [ a rml:PredicateObjectMap; + rml:predicateMap [ a rml:PredicateMap; + rml:constant foaf:name; + ]; + rml:objectMap [ a rml:ObjectMap; + rml:reference "$.name"; + ]; + ]; + rml:predicateObjectMap [ a rml:PredicateObjectMap; + rml:predicateMap [ a rml:PredicateMap; + rml:constant foaf:age; + ]; + rml:objectMap [ a rml:ObjectMap; + rml:reference "$.age"; + ]; + ]; +. + +<#TargetDump1> a rml:LogicalTarget; + rml:target [ a rml:Target, rml:FilePath; + rml:root rml:CurrentWorkingDirectory; + rml:path "./dump1.ttl"; + ]; + rml:serialization formats:Turtle; +. + +``` + +**Output 1** +``` + +``` + +**Output 2** +``` + "Monica Geller" . + "Rachel Green" . + "Joey Tribbiani" . + "Chandler Bing" . + "Ross Geller" . + "33" . + "34" . + "35" . + "36" . + "37" . + +``` + diff --git a/src/test/resources/rml-io/RMLTTC0004g/dump1.ttl b/src/test/resources/rml-io/RMLTTC0004g/dump1.ttl index 5f442e88..2032b0fe 100644 --- a/src/test/resources/rml-io/RMLTTC0004g/dump1.ttl +++ b/src/test/resources/rml-io/RMLTTC0004g/dump1.ttl @@ -1,13 +1,10 @@ -@prefix foaf: . -@prefix ex: . - - "33" . - "Monica Geller" . - "34" . - "Rachel Green" . - "35" . - "Joey Tribbiani" . - "36" . - "Chandler Bing" . - "37" . - "Ross Geller" . + "Monica Geller" . + "Rachel Green" . + "Joey Tribbiani" . + "Chandler Bing" . + "Ross Geller" . + "33" . + "34" . + "35" . + "36" . + "37" . diff --git a/src/test/resources/rml-io/RMLTTC0004g/mapping.ttl b/src/test/resources/rml-io/RMLTTC0004g/mapping.ttl index 2be79fe7..7ebf1021 100644 --- a/src/test/resources/rml-io/RMLTTC0004g/mapping.ttl +++ b/src/test/resources/rml-io/RMLTTC0004g/mapping.ttl @@ -1,22 +1,19 @@ @prefix rml: . @prefix foaf: . -@prefix dcat: . -@prefix void: . @prefix formats: . @base . -<#DCATSourceAccess> a rml:Source, dcat:Distribution; - dcat:downloadURL ; -. - <#TriplesMap> a rml:TriplesMap; rml:logicalSource [ a rml:LogicalSource; - rml:source <#DCATSourceAccess>; + rml:source [ a rml:FilePath; + rml:root rml:MappingDirectory; + rml:path "Friends.json"; + ]; rml:referenceFormulation rml:JSONPath; - rml:iterator "$.[*]"; + rml:iterator "$[*]"; ]; rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{id}"; + rml:template "http://example.org/{$.id}"; rml:logicalTarget <#TargetDump1>; ]; rml:predicateObjectMap [ a rml:PredicateObjectMap; @@ -24,7 +21,7 @@ rml:constant foaf:name; ]; rml:objectMap [ a rml:ObjectMap; - rml:reference "name"; + rml:reference "$.name"; ]; ]; rml:predicateObjectMap [ a rml:PredicateObjectMap; @@ -32,14 +29,15 @@ rml:constant foaf:age; ]; rml:objectMap [ a rml:ObjectMap; - rml:reference "age"; + rml:reference "$.age"; ]; ]; . <#TargetDump1> a rml:LogicalTarget; - rml:target [ a rml:Target, void:Dataset; - void:dataDump ; + rml:target [ a rml:Target, rml:FilePath; + rml:root rml:CurrentWorkingDirectory; + rml:path "./dump1.ttl"; ]; rml:serialization formats:Turtle; . diff --git a/src/test/resources/rml-io/RMLTTC0005a/Friends.json b/src/test/resources/rml-io/RMLTTC0005a/Friends.json new file mode 100644 index 00000000..8e554498 --- /dev/null +++ b/src/test/resources/rml-io/RMLTTC0005a/Friends.json @@ -0,0 +1,27 @@ +[ + { + "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 + } +] diff --git a/src/test/resources/rml-io/RMLTTC0005a/README.md b/src/test/resources/rml-io/RMLTTC0005a/README.md new file mode 100644 index 00000000..3e87f9b3 --- /dev/null +++ b/src/test/resources/rml-io/RMLTTC0005a/README.md @@ -0,0 +1,109 @@ +## RMLTTC0005a + +**Title**: Target UTF-8 + +**Description**: Test export all triples with UTF-8 encoding + +**Error expected?** No + +**Input** +``` +[ + { + "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 + } +] + +``` + +**Mapping** +``` +@prefix rml: . +@prefix foaf: . +@prefix formats: . +@base . + +<#TriplesMap> a rml:TriplesMap; + rml:logicalSource [ a rml:LogicalSource; + rml:source [ a rml:FilePath; + rml:root rml:MappingDirectory; + rml:path "Friends.json"; + ]; + rml:referenceFormulation rml:JSONPath; + rml:iterator "$[*]"; + ]; + rml:subjectMap [ a rml:SubjectMap; + rml:template "http://example.org/{$.id}"; + rml:logicalTarget <#TargetDump1>; + ]; + rml:predicateObjectMap [ a rml:PredicateObjectMap; + rml:predicateMap [ a rml:PredicateMap; + rml:constant foaf:name; + ]; + rml:objectMap [ a rml:ObjectMap; + rml:reference "$.name"; + ]; + ]; + rml:predicateObjectMap [ a rml:PredicateObjectMap; + rml:predicateMap [ a rml:PredicateMap; + rml:constant foaf:age; + ]; + rml:objectMap [ a rml:ObjectMap; + rml:reference "$.age"; + ]; + ]; +. + +<#TargetDump1> a rml:LogicalTarget; + rml:target [ a rml:Target, rml:FilePath; + rml:root rml:CurrentWorkingDirectory; + rml:path "./dump1.nq"; + ]; + rml:serialization formats:N-Quads; + rml:encoding rml:UTF-8; +. + +``` + +**Output 1** +``` + +``` + +**Output 2** +``` + "33" . + "Monica Geller" . + "34" . + "Rachel Green" . + "35" . + "Joey Tribbiani" . + "36" . + "Chandler Bing" . + "37" . + "Ross Geller" . + +``` + diff --git a/src/test/resources/rml-io/RMLTTC0005a/mapping.ttl b/src/test/resources/rml-io/RMLTTC0005a/mapping.ttl index 59d4453c..8ec724a5 100644 --- a/src/test/resources/rml-io/RMLTTC0005a/mapping.ttl +++ b/src/test/resources/rml-io/RMLTTC0005a/mapping.ttl @@ -1,22 +1,19 @@ @prefix rml: . @prefix foaf: . -@prefix dcat: . -@prefix void: . @prefix formats: . @base . -<#DCATSourceAccess> a rml:Source, dcat:Distribution; - dcat:downloadURL ; -. - <#TriplesMap> a rml:TriplesMap; rml:logicalSource [ a rml:LogicalSource; - rml:source <#DCATSourceAccess>; + rml:source [ a rml:FilePath; + rml:root rml:MappingDirectory; + rml:path "Friends.json"; + ]; rml:referenceFormulation rml:JSONPath; - rml:iterator "$.[*]"; + rml:iterator "$[*]"; ]; rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{id}"; + rml:template "http://example.org/{$.id}"; rml:logicalTarget <#TargetDump1>; ]; rml:predicateObjectMap [ a rml:PredicateObjectMap; @@ -24,7 +21,7 @@ rml:constant foaf:name; ]; rml:objectMap [ a rml:ObjectMap; - rml:reference "name"; + rml:reference "$.name"; ]; ]; rml:predicateObjectMap [ a rml:PredicateObjectMap; @@ -32,14 +29,15 @@ rml:constant foaf:age; ]; rml:objectMap [ a rml:ObjectMap; - rml:reference "age"; + rml:reference "$.age"; ]; ]; . <#TargetDump1> a rml:LogicalTarget; - rml:target [ a rml:Target, void:Dataset; - void:dataDump ; + rml:target [ a rml:Target, rml:FilePath; + rml:root rml:CurrentWorkingDirectory; + rml:path "./dump1.nq"; ]; rml:serialization formats:N-Quads; rml:encoding rml:UTF-8; diff --git a/src/test/resources/rml-io/RMLTTC0005b/Friends.json b/src/test/resources/rml-io/RMLTTC0005b/Friends.json new file mode 100644 index 00000000..8e554498 --- /dev/null +++ b/src/test/resources/rml-io/RMLTTC0005b/Friends.json @@ -0,0 +1,27 @@ +[ + { + "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 + } +] diff --git a/src/test/resources/rml-io/RMLTTC0005b/README.md b/src/test/resources/rml-io/RMLTTC0005b/README.md new file mode 100644 index 00000000..6f8b8933 --- /dev/null +++ b/src/test/resources/rml-io/RMLTTC0005b/README.md @@ -0,0 +1,109 @@ +## RMLTTC0005b + +**Title**: Target UTF-16 + +**Description**: Test export all triples with UTF-16 encoding + +**Error expected?** No + +**Input** +``` +[ + { + "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 + } +] + +``` + +**Mapping** +``` +@prefix rml: . +@prefix foaf: . +@prefix formats: . +@base . + +<#TriplesMap> a rml:TriplesMap; + rml:logicalSource [ a rml:LogicalSource; + rml:source [ a rml:FilePath; + rml:root rml:MappingDirectory; + rml:path "Friends.json"; + ]; + rml:referenceFormulation rml:JSONPath; + rml:iterator "$[*]"; + ]; + rml:subjectMap [ a rml:SubjectMap; + rml:template "http://example.org/{$.id}"; + rml:logicalTarget <#TargetDump1>; + ]; + rml:predicateObjectMap [ a rml:PredicateObjectMap; + rml:predicateMap [ a rml:PredicateMap; + rml:constant foaf:name; + ]; + rml:objectMap [ a rml:ObjectMap; + rml:reference "$.name"; + ]; + ]; + rml:predicateObjectMap [ a rml:PredicateObjectMap; + rml:predicateMap [ a rml:PredicateMap; + rml:constant foaf:age; + ]; + rml:objectMap [ a rml:ObjectMap; + rml:reference "$.age"; + ]; + ]; +. + +<#TargetDump1> a rml:LogicalTarget; + rml:target [ a rml:Target, rml:FilePath; + rml:root rml:CurrentWorkingDirectory; + rml:path "./dump1.nq"; + ]; + rml:serialization formats:N-Quads; + rml:encoding rml:UTF-16; +. + +``` + +**Output 1** +``` + +``` + +**Output 2** +``` + "33" . + "Monica Geller" . + "34" . + "Rachel Green" . + "35" . + "Joey Tribbiani" . + "36" . + "Chandler Bing" . + "37" . + "Ross Geller" . + +``` + diff --git a/src/test/resources/rml-io/RMLTTC0005b/mapping.ttl b/src/test/resources/rml-io/RMLTTC0005b/mapping.ttl index 6c45d82b..69dc45bc 100644 --- a/src/test/resources/rml-io/RMLTTC0005b/mapping.ttl +++ b/src/test/resources/rml-io/RMLTTC0005b/mapping.ttl @@ -1,22 +1,19 @@ @prefix rml: . @prefix foaf: . -@prefix dcat: . -@prefix void: . @prefix formats: . @base . -<#DCATSourceAccess> a rml:Source, dcat:Distribution; - dcat:downloadURL ; -. - <#TriplesMap> a rml:TriplesMap; rml:logicalSource [ a rml:LogicalSource; - rml:source <#DCATSourceAccess>; + rml:source [ a rml:FilePath; + rml:root rml:MappingDirectory; + rml:path "Friends.json"; + ]; rml:referenceFormulation rml:JSONPath; - rml:iterator "$.[*]"; + rml:iterator "$[*]"; ]; rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{id}"; + rml:template "http://example.org/{$.id}"; rml:logicalTarget <#TargetDump1>; ]; rml:predicateObjectMap [ a rml:PredicateObjectMap; @@ -24,7 +21,7 @@ rml:constant foaf:name; ]; rml:objectMap [ a rml:ObjectMap; - rml:reference "name"; + rml:reference "$.name"; ]; ]; rml:predicateObjectMap [ a rml:PredicateObjectMap; @@ -32,14 +29,15 @@ rml:constant foaf:age; ]; rml:objectMap [ a rml:ObjectMap; - rml:reference "age"; + rml:reference "$.age"; ]; ]; . <#TargetDump1> a rml:LogicalTarget; - rml:target [ a rml:Target, void:Dataset; - void:dataDump ; + rml:target [ a rml:Target, rml:FilePath; + rml:root rml:CurrentWorkingDirectory; + rml:path "./dump1.nq"; ]; rml:serialization formats:N-Quads; rml:encoding rml:UTF-16; diff --git a/src/test/resources/rml-io/RMLTTC0006a/Friends.json b/src/test/resources/rml-io/RMLTTC0006a/Friends.json new file mode 100644 index 00000000..8e554498 --- /dev/null +++ b/src/test/resources/rml-io/RMLTTC0006a/Friends.json @@ -0,0 +1,27 @@ +[ + { + "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 + } +] diff --git a/src/test/resources/rml-io/RMLTTC0006a/README.md b/src/test/resources/rml-io/RMLTTC0006a/README.md new file mode 100644 index 00000000..96554c9e --- /dev/null +++ b/src/test/resources/rml-io/RMLTTC0006a/README.md @@ -0,0 +1,108 @@ +## RMLTTC0006a + +**Title**: Target no compression + +**Description**: Test export all triples with no compression + +**Error expected?** No + +**Input** +``` +[ + { + "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 + } +] + +``` + +**Mapping** +``` +@prefix rml: . +@prefix foaf: . +@prefix formats: . +@base . + +<#TriplesMap> a rml:TriplesMap; + rml:logicalSource [ a rml:LogicalSource; + rml:source [ a rml:FilePath; + rml:root rml:MappingDirectory; + rml:path "Friends.json"; + ]; + rml:referenceFormulation rml:JSONPath; + rml:iterator "$[*]"; + ]; + rml:subjectMap [ a rml:SubjectMap; + rml:template "http://example.org/{$.id}"; + rml:logicalTarget <#TargetDump1>; + ]; + rml:predicateObjectMap [ a rml:PredicateObjectMap; + rml:predicateMap [ a rml:PredicateMap; + rml:constant foaf:name; + ]; + rml:objectMap [ a rml:ObjectMap; + rml:reference "$.name"; + ]; + ]; + rml:predicateObjectMap [ a rml:PredicateObjectMap; + rml:predicateMap [ a rml:PredicateMap; + rml:constant foaf:age; + ]; + rml:objectMap [ a rml:ObjectMap; + rml:reference "$.age"; + ]; + ]; +. + +<#TargetDump1> a rml:LogicalTarget; + rml:target [ a rml:Target, rml:FilePath; + rml:root rml:CurrentWorkingDirectory; + rml:path "./dump1.nq"; + ]; + rml:serialization formats:N-Quads; +. + +``` + +**Output 1** +``` + +``` + +**Output 2** +``` + "33" . + "Monica Geller" . + "34" . + "Rachel Green" . + "35" . + "Joey Tribbiani" . + "36" . + "Chandler Bing" . + "37" . + "Ross Geller" . + +``` + diff --git a/src/test/resources/rml-io/RMLTTC0006a/mapping.ttl b/src/test/resources/rml-io/RMLTTC0006a/mapping.ttl index 9d005bd1..e2b46141 100644 --- a/src/test/resources/rml-io/RMLTTC0006a/mapping.ttl +++ b/src/test/resources/rml-io/RMLTTC0006a/mapping.ttl @@ -1,22 +1,19 @@ @prefix rml: . @prefix foaf: . -@prefix dcat: . -@prefix void: . @prefix formats: . @base . -<#DCATSourceAccess> a rml:Source, dcat:Distribution; - dcat:downloadURL ; -. - <#TriplesMap> a rml:TriplesMap; rml:logicalSource [ a rml:LogicalSource; - rml:source <#DCATSourceAccess>; + rml:source [ a rml:FilePath; + rml:root rml:MappingDirectory; + rml:path "Friends.json"; + ]; rml:referenceFormulation rml:JSONPath; - rml:iterator "$.[*]"; + rml:iterator "$[*]"; ]; rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{id}"; + rml:template "http://example.org/{$.id}"; rml:logicalTarget <#TargetDump1>; ]; rml:predicateObjectMap [ a rml:PredicateObjectMap; @@ -24,7 +21,7 @@ rml:constant foaf:name; ]; rml:objectMap [ a rml:ObjectMap; - rml:reference "name"; + rml:reference "$.name"; ]; ]; rml:predicateObjectMap [ a rml:PredicateObjectMap; @@ -32,14 +29,15 @@ rml:constant foaf:age; ]; rml:objectMap [ a rml:ObjectMap; - rml:reference "age"; + rml:reference "$.age"; ]; ]; . <#TargetDump1> a rml:LogicalTarget; - rml:target [ a rml:Target, void:Dataset; - void:dataDump ; + rml:target [ a rml:Target, rml:FilePath; + rml:root rml:CurrentWorkingDirectory; + rml:path "./dump1.nq"; ]; rml:serialization formats:N-Quads; . diff --git a/src/test/resources/rml-io/RMLTTC0006b/Friends.json b/src/test/resources/rml-io/RMLTTC0006b/Friends.json new file mode 100644 index 00000000..8e554498 --- /dev/null +++ b/src/test/resources/rml-io/RMLTTC0006b/Friends.json @@ -0,0 +1,27 @@ +[ + { + "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 + } +] diff --git a/src/test/resources/rml-io/RMLTTC0006b/README.md b/src/test/resources/rml-io/RMLTTC0006b/README.md new file mode 100644 index 00000000..52bb0398 --- /dev/null +++ b/src/test/resources/rml-io/RMLTTC0006b/README.md @@ -0,0 +1,97 @@ +## RMLTTC0006b + +**Title**: Target GZip compression + +**Description**: Test export all triples with GZip compression + +**Error expected?** No + +**Input** +``` +[ + { + "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 + } +] + +``` + +**Mapping** +``` +@prefix rml: . +@prefix foaf: . +@prefix formats: . +@base . + +<#TriplesMap> a rml:TriplesMap; + rml:logicalSource [ a rml:LogicalSource; + rml:source [ a rml:FilePath; + rml:root rml:MappingDirectory; + rml:path "Friends.json"; + ]; + rml:referenceFormulation rml:JSONPath; + rml:iterator "$[*]"; + ]; + rml:subjectMap [ a rml:SubjectMap; + rml:template "http://example.org/{$.id}"; + rml:logicalTarget <#TargetDump1>; + ]; + rml:predicateObjectMap [ a rml:PredicateObjectMap; + rml:predicateMap [ a rml:PredicateMap; + rml:constant foaf:name; + ]; + rml:objectMap [ a rml:ObjectMap; + rml:reference "$.name"; + ]; + ]; + rml:predicateObjectMap [ a rml:PredicateObjectMap; + rml:predicateMap [ a rml:PredicateMap; + rml:constant foaf:age; + ]; + rml:objectMap [ a rml:ObjectMap; + rml:reference "$.age"; + ]; + ]; +. + +<#TargetDump1> a rml:LogicalTarget; + rml:target [ a rml:Target, rml:FilePath; + rml:root rml:CurrentWorkingDirectory; + rml:path "./dump1.nq.gz"; + ]; + rml:serialization formats:N-Quads; + rml:compression rml:gzip; +. + +``` + +**Output 1** +``` + +``` + +**Output 2** + `dump1.nq.gz` + diff --git a/src/test/resources/rml-io/RMLTTC0006b/mapping.ttl b/src/test/resources/rml-io/RMLTTC0006b/mapping.ttl index ee5fceef..ad46411f 100644 --- a/src/test/resources/rml-io/RMLTTC0006b/mapping.ttl +++ b/src/test/resources/rml-io/RMLTTC0006b/mapping.ttl @@ -1,22 +1,19 @@ @prefix rml: . @prefix foaf: . -@prefix dcat: . -@prefix void: . @prefix formats: . @base . -<#DCATSourceAccess> a rml:Source, dcat:Distribution; - dcat:downloadURL ; -. - <#TriplesMap> a rml:TriplesMap; rml:logicalSource [ a rml:LogicalSource; - rml:source <#DCATSourceAccess>; + rml:source [ a rml:FilePath; + rml:root rml:MappingDirectory; + rml:path "Friends.json"; + ]; rml:referenceFormulation rml:JSONPath; - rml:iterator "$.[*]"; + rml:iterator "$[*]"; ]; rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{id}"; + rml:template "http://example.org/{$.id}"; rml:logicalTarget <#TargetDump1>; ]; rml:predicateObjectMap [ a rml:PredicateObjectMap; @@ -24,7 +21,7 @@ rml:constant foaf:name; ]; rml:objectMap [ a rml:ObjectMap; - rml:reference "name"; + rml:reference "$.name"; ]; ]; rml:predicateObjectMap [ a rml:PredicateObjectMap; @@ -32,14 +29,15 @@ rml:constant foaf:age; ]; rml:objectMap [ a rml:ObjectMap; - rml:reference "age"; + rml:reference "$.age"; ]; ]; . <#TargetDump1> a rml:LogicalTarget; - rml:target [ a rml:Target, void:Dataset; - void:dataDump ; + rml:target [ a rml:Target, rml:FilePath; + rml:root rml:CurrentWorkingDirectory; + rml:path "./dump1.nq.gz"; ]; rml:serialization formats:N-Quads; rml:compression rml:gzip; diff --git a/src/test/resources/rml-io/RMLTTC0006c/Friends.json b/src/test/resources/rml-io/RMLTTC0006c/Friends.json new file mode 100644 index 00000000..8e554498 --- /dev/null +++ b/src/test/resources/rml-io/RMLTTC0006c/Friends.json @@ -0,0 +1,27 @@ +[ + { + "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 + } +] diff --git a/src/test/resources/rml-io/RMLTTC0006c/README.md b/src/test/resources/rml-io/RMLTTC0006c/README.md new file mode 100644 index 00000000..15435e90 --- /dev/null +++ b/src/test/resources/rml-io/RMLTTC0006c/README.md @@ -0,0 +1,97 @@ +## RMLTTC0006c + +**Title**: Target Zip compression + +**Description**: Test export all triples with ZIP compression + +**Error expected?** No + +**Input** +``` +[ + { + "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 + } +] + +``` + +**Mapping** +``` +@prefix rml: . +@prefix foaf: . +@prefix formats: . +@base . + +<#TriplesMap> a rml:TriplesMap; + rml:logicalSource [ a rml:LogicalSource; + rml:source [ a rml:FilePath; + rml:root rml:MappingDirectory; + rml:path "Friends.json"; + ]; + rml:referenceFormulation rml:JSONPath; + rml:iterator "$[*]"; + ]; + rml:subjectMap [ a rml:SubjectMap; + rml:template "http://example.org/{$.id}"; + rml:logicalTarget <#TargetDump1>; + ]; + rml:predicateObjectMap [ a rml:PredicateObjectMap; + rml:predicateMap [ a rml:PredicateMap; + rml:constant foaf:name; + ]; + rml:objectMap [ a rml:ObjectMap; + rml:reference "$.name"; + ]; + ]; + rml:predicateObjectMap [ a rml:PredicateObjectMap; + rml:predicateMap [ a rml:PredicateMap; + rml:constant foaf:age; + ]; + rml:objectMap [ a rml:ObjectMap; + rml:reference "$.age"; + ]; + ]; +. + +<#TargetDump1> a rml:LogicalTarget; + rml:target [ a rml:Target, rml:FilePath; + rml:root rml:CurrentWorkingDirectory; + rml:path "./dump1.nq.zip"; + ]; + rml:serialization formats:N-Quads; + rml:compression rml:zip; +. + +``` + +**Output 1** +``` + +``` + +**Output 2** + `dump1.nq.zip` + diff --git a/src/test/resources/rml-io/RMLTTC0006c/mapping.ttl b/src/test/resources/rml-io/RMLTTC0006c/mapping.ttl index 01763ba1..e4395a84 100644 --- a/src/test/resources/rml-io/RMLTTC0006c/mapping.ttl +++ b/src/test/resources/rml-io/RMLTTC0006c/mapping.ttl @@ -1,22 +1,19 @@ @prefix rml: . @prefix foaf: . -@prefix dcat: . -@prefix void: . @prefix formats: . @base . -<#DCATSourceAccess> a rml:Source, dcat:Distribution; - dcat:downloadURL ; -. - <#TriplesMap> a rml:TriplesMap; rml:logicalSource [ a rml:LogicalSource; - rml:source <#DCATSourceAccess>; + rml:source [ a rml:FilePath; + rml:root rml:MappingDirectory; + rml:path "Friends.json"; + ]; rml:referenceFormulation rml:JSONPath; - rml:iterator "$.[*]"; + rml:iterator "$[*]"; ]; rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{id}"; + rml:template "http://example.org/{$.id}"; rml:logicalTarget <#TargetDump1>; ]; rml:predicateObjectMap [ a rml:PredicateObjectMap; @@ -24,7 +21,7 @@ rml:constant foaf:name; ]; rml:objectMap [ a rml:ObjectMap; - rml:reference "name"; + rml:reference "$.name"; ]; ]; rml:predicateObjectMap [ a rml:PredicateObjectMap; @@ -32,14 +29,15 @@ rml:constant foaf:age; ]; rml:objectMap [ a rml:ObjectMap; - rml:reference "age"; + rml:reference "$.age"; ]; ]; . <#TargetDump1> a rml:LogicalTarget; - rml:target [ a rml:Target, void:Dataset; - void:dataDump ; + rml:target [ a rml:Target, rml:FilePath; + rml:root rml:CurrentWorkingDirectory; + rml:path "./dump1.nq.zip"; ]; rml:serialization formats:N-Quads; rml:compression rml:zip; diff --git a/src/test/resources/rml-io/RMLTTC0006d/Friends.json b/src/test/resources/rml-io/RMLTTC0006d/Friends.json new file mode 100644 index 00000000..8e554498 --- /dev/null +++ b/src/test/resources/rml-io/RMLTTC0006d/Friends.json @@ -0,0 +1,27 @@ +[ + { + "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 + } +] diff --git a/src/test/resources/rml-io/RMLTTC0006d/README.md b/src/test/resources/rml-io/RMLTTC0006d/README.md new file mode 100644 index 00000000..d60b367d --- /dev/null +++ b/src/test/resources/rml-io/RMLTTC0006d/README.md @@ -0,0 +1,98 @@ +## RMLTTC0006d + +**Title**: Target TarXz compression + +**Description**: Test export all triples with TarXZ compression + +**Error expected?** No + +**Input** +``` +[ + { + "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 + } +] + +``` + +**Mapping** +``` +@prefix rml: . +@prefix foaf: . +@prefix formats: . +@prefix ex: . +@base . + +<#TriplesMap> a rml:TriplesMap; + rml:logicalSource [ a rml:LogicalSource; + rml:source [ a rml:FilePath; + rml:root rml:MappingDirectory; + rml:path "Friends.json"; + ]; + rml:referenceFormulation rml:JSONPath; + rml:iterator "$[*]"; + ]; + rml:subjectMap [ a rml:SubjectMap; + rml:template "http://example.org/{$.id}"; + rml:logicalTarget <#TargetDump1>; + ]; + rml:predicateObjectMap [ a rml:PredicateObjectMap; + rml:predicateMap [ a rml:PredicateMap; + rml:constant foaf:name; + ]; + rml:objectMap [ a rml:ObjectMap; + rml:reference "$.name"; + ]; + ]; + rml:predicateObjectMap [ a rml:PredicateObjectMap; + rml:predicateMap [ a rml:PredicateMap; + rml:constant foaf:age; + ]; + rml:objectMap [ a rml:ObjectMap; + rml:reference "$.age"; + ]; + ]; +. + +<#TargetDump1> a rml:LogicalTarget; + rml:target [ a rml:Target, rml:FilePath; + rml:root rml:CurrentWorkingDirectory; + rml:path "./dump1.nq.tar.xz"; + ]; + rml:serialization formats:N-Quads; + rml:compression rml:tarxz; +. + +``` + +**Output 1** +``` + +``` + +**Output 2** + `dump1.nq.tar.xz` + diff --git a/src/test/resources/rml-io/RMLTTC0006d/mapping.ttl b/src/test/resources/rml-io/RMLTTC0006d/mapping.ttl index 3113053d..6c914e77 100644 --- a/src/test/resources/rml-io/RMLTTC0006d/mapping.ttl +++ b/src/test/resources/rml-io/RMLTTC0006d/mapping.ttl @@ -1,23 +1,20 @@ @prefix rml: . @prefix foaf: . -@prefix dcat: . -@prefix void: . @prefix formats: . @prefix ex: . @base . -<#DCATSourceAccess> a rml:Source, dcat:Distribution; - dcat:downloadURL ; -. - <#TriplesMap> a rml:TriplesMap; rml:logicalSource [ a rml:LogicalSource; - rml:source <#DCATSourceAccess>; + rml:source [ a rml:FilePath; + rml:root rml:MappingDirectory; + rml:path "Friends.json"; + ]; rml:referenceFormulation rml:JSONPath; - rml:iterator "$.[*]"; + rml:iterator "$[*]"; ]; rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{id}"; + rml:template "http://example.org/{$.id}"; rml:logicalTarget <#TargetDump1>; ]; rml:predicateObjectMap [ a rml:PredicateObjectMap; @@ -25,7 +22,7 @@ rml:constant foaf:name; ]; rml:objectMap [ a rml:ObjectMap; - rml:reference "name"; + rml:reference "$.name"; ]; ]; rml:predicateObjectMap [ a rml:PredicateObjectMap; @@ -33,14 +30,15 @@ rml:constant foaf:age; ]; rml:objectMap [ a rml:ObjectMap; - rml:reference "age"; + rml:reference "$.age"; ]; ]; . <#TargetDump1> a rml:LogicalTarget; - rml:target [ a rml:Target, void:Dataset; - void:dataDump ; + rml:target [ a rml:Target, rml:FilePath; + rml:root rml:CurrentWorkingDirectory; + rml:path "./dump1.nq.tar.xz"; ]; rml:serialization formats:N-Quads; rml:compression rml:tarxz; diff --git a/src/test/resources/rml-io/RMLTTC0006e/Friends.json b/src/test/resources/rml-io/RMLTTC0006e/Friends.json new file mode 100644 index 00000000..8e554498 --- /dev/null +++ b/src/test/resources/rml-io/RMLTTC0006e/Friends.json @@ -0,0 +1,27 @@ +[ + { + "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 + } +] diff --git a/src/test/resources/rml-io/RMLTTC0006e/README.md b/src/test/resources/rml-io/RMLTTC0006e/README.md new file mode 100644 index 00000000..42e7ca17 --- /dev/null +++ b/src/test/resources/rml-io/RMLTTC0006e/README.md @@ -0,0 +1,97 @@ +## RMLTTC0006e + +**Title**: Target TarGzip compression + +**Description**: Test export all triples with TarGZip compression + +**Error expected?** No + +**Input** +``` +[ + { + "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 + } +] + +``` + +**Mapping** +``` +@prefix rml: . +@prefix foaf: . +@prefix formats: . +@base . + +<#TriplesMap> a rml:TriplesMap; + rml:logicalSource [ a rml:LogicalSource; + rml:source [ a rml:FilePath; + rml:root rml:MappingDirectory; + rml:path "Friends.json"; + ]; + rml:referenceFormulation rml:JSONPath; + rml:iterator "$[*]"; + ]; + rml:subjectMap [ a rml:SubjectMap; + rml:template "http://example.org/{$.id}"; + rml:logicalTarget <#TargetDump1>; + ]; + rml:predicateObjectMap [ a rml:PredicateObjectMap; + rml:predicateMap [ a rml:PredicateMap; + rml:constant foaf:name; + ]; + rml:objectMap [ a rml:ObjectMap; + rml:reference "$.name"; + ]; + ]; + rml:predicateObjectMap [ a rml:PredicateObjectMap; + rml:predicateMap [ a rml:PredicateMap; + rml:constant foaf:age; + ]; + rml:objectMap [ a rml:ObjectMap; + rml:reference "$.age"; + ]; + ]; +. + +<#TargetDump1> a rml:LogicalTarget; + rml:target [ a rml:Target, rml:FilePath; + rml:root rml:CurrentWorkingDirectory; + rml:path "./dump1.nq.tar.gz"; + ]; + rml:serialization formats:N-Quads; + rml:compression rml:targz; +. + +``` + +**Output 1** +``` + +``` + +**Output 2** + `dump1.nq.tar.gz` + diff --git a/src/test/resources/rml-io/RMLTTC0006e/mapping.ttl b/src/test/resources/rml-io/RMLTTC0006e/mapping.ttl index 7de99a66..c71d369d 100644 --- a/src/test/resources/rml-io/RMLTTC0006e/mapping.ttl +++ b/src/test/resources/rml-io/RMLTTC0006e/mapping.ttl @@ -1,22 +1,19 @@ @prefix rml: . @prefix foaf: . -@prefix dcat: . -@prefix void: . @prefix formats: . @base . -<#DCATSourceAccess> a rml:Source, dcat:Distribution; - dcat:downloadURL ; -. - <#TriplesMap> a rml:TriplesMap; rml:logicalSource [ a rml:LogicalSource; - rml:source <#DCATSourceAccess>; + rml:source [ a rml:FilePath; + rml:root rml:MappingDirectory; + rml:path "Friends.json"; + ]; rml:referenceFormulation rml:JSONPath; - rml:iterator "$.[*]"; + rml:iterator "$[*]"; ]; rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{id}"; + rml:template "http://example.org/{$.id}"; rml:logicalTarget <#TargetDump1>; ]; rml:predicateObjectMap [ a rml:PredicateObjectMap; @@ -24,7 +21,7 @@ rml:constant foaf:name; ]; rml:objectMap [ a rml:ObjectMap; - rml:reference "name"; + rml:reference "$.name"; ]; ]; rml:predicateObjectMap [ a rml:PredicateObjectMap; @@ -32,14 +29,15 @@ rml:constant foaf:age; ]; rml:objectMap [ a rml:ObjectMap; - rml:reference "age"; + rml:reference "$.age"; ]; ]; . <#TargetDump1> a rml:LogicalTarget; - rml:target [ a rml:Target, void:Dataset; - void:dataDump ; + rml:target [ a rml:Target, rml:FilePath; + rml:root rml:CurrentWorkingDirectory; + rml:path "./dump1.nq.tar.gz"; ]; rml:serialization formats:N-Quads; rml:compression rml:targz; diff --git a/src/test/resources/rml-io/RMLTTC0007a/Friends.json b/src/test/resources/rml-io/RMLTTC0007a/Friends.json new file mode 100644 index 00000000..8e554498 --- /dev/null +++ b/src/test/resources/rml-io/RMLTTC0007a/Friends.json @@ -0,0 +1,27 @@ +[ + { + "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 + } +] diff --git a/src/test/resources/rml-io/RMLTTC0007a/README.md b/src/test/resources/rml-io/RMLTTC0007a/README.md new file mode 100644 index 00000000..4e2f4339 --- /dev/null +++ b/src/test/resources/rml-io/RMLTTC0007a/README.md @@ -0,0 +1,108 @@ +## RMLTTC0007a + +**Title**: Target with FilePath description + +**Description**: Test export all triples to a target with File path access description + +**Error expected?** No + +**Input** +``` +[ + { + "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 + } +] + +``` + +**Mapping** +``` +@prefix rml: . +@prefix foaf: . +@prefix formats: . +@base . + +<#TriplesMap> a rml:TriplesMap; + rml:logicalSource [ a rml:LogicalSource; + rml:source [ a rml:FilePath; + rml:root rml:MappingDirectory; + rml:path "Friends.json"; + ]; + rml:referenceFormulation rml:JSONPath; + rml:iterator "$[*]"; + ]; + rml:subjectMap [ a rml:SubjectMap; + rml:template "http://example.org/{$.id}"; + rml:logicalTarget <#TargetDump1>; + ]; + rml:predicateObjectMap [ a rml:PredicateObjectMap; + rml:predicateMap [ a rml:PredicateMap; + rml:constant foaf:name; + ]; + rml:objectMap [ a rml:ObjectMap; + rml:reference "$.name"; + ]; + ]; + rml:predicateObjectMap [ a rml:PredicateObjectMap; + rml:predicateMap [ a rml:PredicateMap; + rml:constant foaf:age; + ]; + rml:objectMap [ a rml:ObjectMap; + rml:reference "$.age"; + ]; + ]; +. + +<#TargetDump1> a rml:LogicalTarget; + rml:target [ a rml:Target, rml:FilePath; + rml:root rml:CurrentWorkingDirectory; + rml:path "./dump1.nq"; + ]; + rml:serialization formats:N-Quads; +. + +``` + +**Output 1** +``` + +``` + +**Output 2** +``` + "33" . + "Monica Geller" . + "34" . + "Rachel Green" . + "35" . + "Joey Tribbiani" . + "36" . + "Chandler Bing" . + "37" . + "Ross Geller" . + +``` + diff --git a/src/test/resources/rml-io/RMLTTC0007a/mapping.ttl b/src/test/resources/rml-io/RMLTTC0007a/mapping.ttl index e986d7d0..e2b46141 100644 --- a/src/test/resources/rml-io/RMLTTC0007a/mapping.ttl +++ b/src/test/resources/rml-io/RMLTTC0007a/mapping.ttl @@ -1,22 +1,19 @@ @prefix rml: . @prefix foaf: . -@prefix dcat: . -@prefix void: . @prefix formats: . @base . -<#DCATSourceAccess> a rml:Source, dcat:Distribution; - dcat:downloadURL ; -. - <#TriplesMap> a rml:TriplesMap; rml:logicalSource [ a rml:LogicalSource; - rml:source <#DCATSourceAccess>; + rml:source [ a rml:FilePath; + rml:root rml:MappingDirectory; + rml:path "Friends.json"; + ]; rml:referenceFormulation rml:JSONPath; - rml:iterator "$.[*]"; + rml:iterator "$[*]"; ]; rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{id}"; + rml:template "http://example.org/{$.id}"; rml:logicalTarget <#TargetDump1>; ]; rml:predicateObjectMap [ a rml:PredicateObjectMap; @@ -24,7 +21,7 @@ rml:constant foaf:name; ]; rml:objectMap [ a rml:ObjectMap; - rml:reference "name"; + rml:reference "$.name"; ]; ]; rml:predicateObjectMap [ a rml:PredicateObjectMap; @@ -32,14 +29,15 @@ rml:constant foaf:age; ]; rml:objectMap [ a rml:ObjectMap; - rml:reference "age"; + rml:reference "$.age"; ]; ]; . <#TargetDump1> a rml:LogicalTarget; - rml:target [ a rml:Target, dcat:Distribution; - dcat:accessUrl ; + rml:target [ a rml:Target, rml:FilePath; + rml:root rml:CurrentWorkingDirectory; + rml:path "./dump1.nq"; ]; rml:serialization formats:N-Quads; . diff --git a/src/test/resources/rml-io/RMLTTC0007b/dump1.nq b/src/test/resources/rml-io/RMLTTC0007b/dump1.nq deleted file mode 100644 index d9456768..00000000 --- a/src/test/resources/rml-io/RMLTTC0007b/dump1.nq +++ /dev/null @@ -1,10 +0,0 @@ - "33" . - "Monica Geller" . - "34" . - "Rachel Green" . - "35" . - "Joey Tribbiani" . - "36" . - "Chandler Bing" . - "37" . - "Ross Geller" . diff --git a/src/test/resources/rml-io/RMLTTC0007b/mapping.ttl b/src/test/resources/rml-io/RMLTTC0007b/mapping.ttl deleted file mode 100644 index 9d005bd1..00000000 --- a/src/test/resources/rml-io/RMLTTC0007b/mapping.ttl +++ /dev/null @@ -1,45 +0,0 @@ -@prefix rml: . -@prefix foaf: . -@prefix dcat: . -@prefix void: . -@prefix formats: . -@base . - -<#DCATSourceAccess> a rml:Source, dcat:Distribution; - dcat:downloadURL ; -. - -<#TriplesMap> a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:source <#DCATSourceAccess>; - rml:referenceFormulation rml:JSONPath; - rml:iterator "$.[*]"; - ]; - rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{id}"; - rml:logicalTarget <#TargetDump1>; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:name; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "name"; - ]; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:age; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "age"; - ]; - ]; -. - -<#TargetDump1> a rml:LogicalTarget; - rml:target [ a rml:Target, void:Dataset; - void:dataDump ; - ]; - rml:serialization formats:N-Quads; -. diff --git a/src/test/resources/rml-io/RMLTTC0007c/dump1.nq b/src/test/resources/rml-io/RMLTTC0007c/dump1.nq deleted file mode 100644 index d9456768..00000000 --- a/src/test/resources/rml-io/RMLTTC0007c/dump1.nq +++ /dev/null @@ -1,10 +0,0 @@ - "33" . - "Monica Geller" . - "34" . - "Rachel Green" . - "35" . - "Joey Tribbiani" . - "36" . - "Chandler Bing" . - "37" . - "Ross Geller" . diff --git a/src/test/resources/rml-io/RMLTTC0007c/mapping.ttl b/src/test/resources/rml-io/RMLTTC0007c/mapping.ttl deleted file mode 100644 index a507dc1e..00000000 --- a/src/test/resources/rml-io/RMLTTC0007c/mapping.ttl +++ /dev/null @@ -1,46 +0,0 @@ -@prefix rml: . -@prefix foaf: . -@prefix dcat: . -@prefix sd: . -@prefix formats: . -@base . - -<#DCATSourceAccess> a rml:Source, dcat:Distribution; - dcat:downloadURL ; -. - -<#TriplesMap> a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:source <#DCATSourceAccess>; - rml:referenceFormulation rml:JSONPath; - rml:iterator "$.[*]"; - ]; - rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{id}"; - rml:logicalTarget <#TargetDump1>; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:name; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "name"; - ]; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:age; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "age"; - ]; - ]; -. - -<#TargetDump1> a rml:LogicalTarget; - rml:target [ a rml:Target, sd:Service; - sd:endpoint ; - sd:supportedLanguage sd:SPARQL11Update; - ]; - rml:serialization formats:N-Quads; -. diff --git a/src/test/resources/rml-io/RMLTTC0007d/dump1.nq b/src/test/resources/rml-io/RMLTTC0007d/dump1.nq deleted file mode 100644 index d9456768..00000000 --- a/src/test/resources/rml-io/RMLTTC0007d/dump1.nq +++ /dev/null @@ -1,10 +0,0 @@ - "33" . - "Monica Geller" . - "34" . - "Rachel Green" . - "35" . - "Joey Tribbiani" . - "36" . - "Chandler Bing" . - "37" . - "Ross Geller" . diff --git a/src/test/resources/rml-io/RMLTTC0007d/mapping.ttl b/src/test/resources/rml-io/RMLTTC0007d/mapping.ttl deleted file mode 100644 index 8059aec6..00000000 --- a/src/test/resources/rml-io/RMLTTC0007d/mapping.ttl +++ /dev/null @@ -1,52 +0,0 @@ -@prefix rml: . -@prefix foaf: . -@prefix dcat: . -@prefix td: . -@prefix htv: . -@prefix hctl: . -@prefix formats: . -@base . - -<#DCATSourceAccess> a rml:Source, dcat:Distribution; - dcat:downloadURL ; -. - -<#TriplesMap> a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:source <#DCATSourceAccess>; - rml:referenceFormulation rml:JSONPath; - rml:iterator "$.[*]"; - ]; - rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{id}"; - rml:logicalTarget <#TargetDump1>; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:name; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "name"; - ]; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:age; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "age"; - ]; - ]; -. - -<#TargetDump1> a rml:LogicalTarget; - rml:target [ a rml:Target, td:Thing; - td:hasPropertyAffordance [ - td:hasForm [ - hctl:hasTarget "http://localhost/data"; - hctl:forContentType "application/n-quads"; - ]; - ]; - ]; - rml:serialization formats:N-Quads; -. diff --git a/src/test/resources/rml-io/config.js b/src/test/resources/rml-io/config.js new file mode 100644 index 00000000..ded0cc29 --- /dev/null +++ b/src/test/resources/rml-io/config.js @@ -0,0 +1,73 @@ +async function loadTurtle() { + //this is the function you call in 'preProcess', to load the highlighter + const worker = await new Promise(resolve => { + require(["core/worker"], ({ worker }) => resolve(worker)); + }); + const action = "highlight-load-lang"; + const langURL = + "https://cdn.jsdelivr.net/gh/redmer/highlightjs-turtle/src/languages/turtle.js"; + const propName = "hljsDefineTurtle"; // This funtion is defined in the highlighter being loaded + const lang = "turtle"; // this is the class you use to identify the language + worker.postMessage({ action, langURL, propName, lang }); + return new Promise(resolve => { + worker.addEventListener("message", function listener({ data }) { + const { action: responseAction, lang: responseLang } = data; + if (responseAction === action && responseLang === lang) { + worker.removeEventListener("message", listener); + resolve(); + } + }); + }); +} + +var respecConfig = { + // check https://respec.org/docs/ for the meaning of these keys + preProcess: [loadTurtle], + authors: [ + { + name: "Dylan Van Assche", + url: "https://dylanvanassche.be", + company: "IDLab – Ghent University – imec", + orcid: "0000-0002-7195-9935", + companyURL: "https://knows.idlab.ugent.be/" + } + ], + edDraftURI: "https://w3id.org/rml/io/test-cases/", + editors: [ + { + name: "Dylan Van Assche", + url: "https://dylanvanassche.be", + company: "IDLab – Ghent University – imec", + orcid: "0000-0002-7195-9935", + companyURL: "https://knows.idlab.ugent.be/" + } + ], + formerEditors: [ + ], + github: "https://github.com/kg-construct/rml-io", + license: "w3c-software-doc", + localBiblio: { + "RML-Core": { + title: "RML-Core", + href: "https://w3id.org/rml/core/spec", + status: "Draft Community Group Report", + publisher: "W3C", + date: "07 August 2024", + }, + "RML-IO": { + title: "RML-IO", + href: "https://w3id.org/rml/io/spec", + status: "Draft Community Group Report", + publisher: "W3C", + date: "12 March 2024", + }, + }, + otherLinks: [], + shortName: "RML-IO-Testcases", + specStatus: "CG-DRAFT", + // W3C config + copyrightStart: "2024", + doJsonLd: true, + group: "kg-construct", + prevVersion: "https://kg-construct.github.io/rml-io/test-cases/docs/20250630/", +}; diff --git a/src/test/resources/rml-io/descriptions.csv b/src/test/resources/rml-io/descriptions.csv new file mode 100644 index 00000000..6dc4cf95 --- /dev/null +++ b/src/test/resources/rml-io/descriptions.csv @@ -0,0 +1,85 @@ +ID,Title,Purpose,"Error +expected?",Input ,"Output +default","Output +1","Output +2","Output +3",Comment +TARGET,,,,,,,,, +RMLTTC0000,Default target,Test exporting all triples to the default Target when not Targets are specified.,no,Friends.json,default.nq,,,, +RMLTTC0001a,Single Target: Subject Map,Test exporting all triples to a single Target with a given subject.,no,Friends.json,default.nq,dump1.nq,,, +RMLTTC0001b,Single Target: Predicate Map,Test exporting all triples to a single Target with a given predicate.,no,Friends.json,default.nq,dump1.nq,,, +RMLTTC0001c,Single Target: Object Map,Test exporting all triples to a single Target with a given object reference.,no,Friends.json,default.nq,dump1.nq,,, +RMLTTC0001d,Single Target: Graph Map,Test exporting all triples within a named graph to a single Target.,no,Friends.json,default.nq,dump1.nq,,, +RMLTTC0001e,Single Target: Language Map,Test exporting all triples with a given language tag to a single Target.,no,Friends.json,default.nq,dump1.nq,,, +RMLTTC0001f,Single Target: Datatype Map,Test exporting all triples with a given datatype to a single Target.,no,Friends.json,default.nq,dump1.nq,,, +RMLTTC0002a,Multiple Targets: Same Term Map,Test exporting all triples to multiple Targets in the same Term Map.,no,Friends.json,default.nq,dump1.nq,dump2.nq,, +RMLTTC0002b,Multiple Targets: Subject Map and Predicate Map,Test exporting all triples to a Target in a Subject Map and a Target in a Predicate Map.,no,Friends.json,default.nq,dump1.nq,dump2.nq,, +RMLTTC0002c,Multiple Targets: Subject Map and Object Map,Test exporting all triples to a Target in a Subject Map and a Target in a Object Map.,no,Friends.json,default.nq,dump1.nq,dump2.nq,, +RMLTTC0002d,Multiple Targets: Predicate Map and Object Map,Test exporting all triples to a Target in a Predicate Map and a Target in a Object Map.,no,Friends.json,default.nq,dump1.nq,dump2.nq,, +RMLTTC0002e,"Multiple Targets: Subject Map, Predicate Map, and Object Map","Test exporting all triples to a Target in a Subject Map, a Target in a Predicate Map, and a Target in a Object Map.",no,Friends.json,default.nq,dump1.nq,dump2.nq,dump3.nq, +RMLTTC0002f,Multiple Targets: Subject Map and Graph Map,Test exporting all triples to a Target in a Subject Map and a Target in a Graph Map.,no,Friends.json,default.nq,dump1.nq,dump2.nq,, +RMLTTC0002g,Multiple Targets: Predicate Map and Graph Map,Test exporting all triples to a Target in a Predicate Map and a Target in a Graph Map.,no,Friends.json,default.nq,dump1.nq,dump2.nq,, +RMLTTC0002h,Multiple Targets: Object Map and Graph Map,Test exporting all triples to a Target in a Object Map and a Target in a Graph Map.,no,Friends.json,default.nq,dump1.nq,dump2.nq,, +RMLTTC0002i,Multiple Targets: Language Map and Graph Map,Test exporting all triples to a Target in a Language Map and a Target in a Graph Map.,no,Friends.json,default.nq,dump1.nq,dump2.nq,, +RMLTTC0002j,Multiple Targets: Language Map and Object Map,Test exporting all triples to a Target in a Language Map and a Target in a Object Map.,no,Friends.json,default.nq,dump1.nq,dump2.nq,, +RMLTTC0002k,Multiple Targets: Datatype Map and Graph Map,Test exporting all triples to a Target in a Datatype Map and a Target in a Graph Map.,no,Friends.json,default.nq,dump1.nq,dump2.nq,, +RMLTTC0002l,Multiple Targets: Datatype Map and Object Map,Test exporting all triples to a Target in a Datatype Map and a Target in a Object Map.,no,Friends.json,default.nq,dump1.nq,dump2.nq,, +RMLTTC0002m,Multiple Targets: Multiple Predicate Maps,Test exporting all triples to Targets in multiple Predicate Maps.,no,Friends.json,default.nq,dump1.nq,dump2.nq,, +RMLTTC0002n,Multiple Targets: Multiple Object Maps,Test exporting all triples to Targets in multiple Object Maps.,no,Friends.json,default.nq,dump1.nq,dump2.nq,, +RMLTTC0002o,Multiple Targets: Multiple Graph Maps,Test exporting all triples to Targets in multiple Graph Maps.,no,Friends.json,default.nq,dump1.nq,dump2.nq,, +RMLTTC0002p,Multiple Targets: Multiple Language Maps,Test exporting all triples to Targets in multiple Language Maps.,no,Friends.json,default.nq,dump1.nq,dump2.nq,, +RMLTTC0002q,Multiple Targets: Multiple Datatype Maps,Test exporting all triples to Targets in multiple Datatype Maps.,no,Friends.json,default.nq,dump1.nq,dump2.nq,, +RMLTTC0002r,Multiple Targets: Multiple Term Maps with same Target,Test exporting all triples to same Target in multiple Term Maps.,no,Friends.json,default.nq,dump1.nq,,, +RMLTTC0003a,Overriding Targets: Seperate Triples Map,Test exporting some triples to a different Target with a separate Triples Map.,no,Friends.json,default.nq,dump1.nq,dump2.nq,, +RMLTTC0004a,Target JSON-LD,Test export all triples as JSON-LD,no,Friends.json,default.nq,dump1.jsonld,,,"Uncommon RDF formats: LD Patch, Microdata, RDFa, TriG, etc. are skipped in test cases." +RMLTTC0004b,Target N3,Test export all triples as N3,no,Friends.json,default.nq,dump1.n3,,, +RMLTTC0004c,Target N-Triples,Test export all triples as N-Triples,no,Friends.json,default.nq,dump1.nt,,, +RMLTTC0004d,Target N-Quads,Test export all triples as N-Quads,no,Friends.json,default.nq,dump1.nq,,, +RMLTTC0004e,Target RDF/JSON,Test export all triples as RDF/JSON,no,Friends.json,default.nq,dump1.rdfjson,,, +RMLTTC0004f,Target RDF/XML,Test export all triples as RDF/XML,no,Friends.json,default.nq,dump1.rdfxml,,, +RMLTTC0004g,Target Turtle,Test export all triples as Turtle,no,Friends.json,default.nq,dump1.ttl,,, +RMLTTC0005a,Target UTF-8,Test export all triples with UTF-8 encoding,no,Friends.json,default.nq,dump1.nq,,, +RMLTTC0005b,Target UTF-16,Test export all triples with UTF-16 encoding,no,Friends.json,default.nq,dump1-utf16.nq,,, +RMLTTC0006a,Target no compression,Test export all triples with no compression,no,Friends.json,default.nq,dump1.nq,,, +RMLTTC0006b,Target GZip compression,Test export all triples with GZip compression,no,Friends.json,default.nq,dump1.nq.gz,,, +RMLTTC0006c,Target Zip compression,Test export all triples with ZIP compression,no,Friends.json,default.nq,dump1.nq.zip,,, +RMLTTC0006d,Target TarXz compression,Test export all triples with TarXZ compression,no,Friends.json,default.nq,dump1.nq.tar.xz,,, +RMLTTC0006e,Target TarGzip compression,Test export all triples with TarGZip compression,no,Friends.json,default.nq,dump1.nq.tar.gz,,, +RMLTTC0007a,Target with FilePath description,Test export all triples to a target with File path access description,no,Friends.json,default.nq,dump1.nq,,, +,,,,,,,,, +,,,,,,,,, +,,,,,,,,, +,,,,,,,,, +SOURCE,,,,,,,,, +RMLSTC0001a,Source with UTF-8 encoding,Test source with UTF-8 encoding,no,Friends.json,default.nq,,,, +RMLSTC0001b,Source with UTF-16 encoding,Test source with UTF-16 encoding,no,Friends-UTF16.json,default.nq,,,, +RMLSTC0002a,Source no compression,Test source without compression,no,Friends.json,default.nq,,,, +RMLSTC0002b,Source GZip compression,Test source with GZip compression,no,Friends.json.gz,default.nq,,,, +RMLSTC0002c,Source Zip compression,Test source with ZIP compression,no,Friends.json.zip,default.nq,,,, +RMLSTC0002d,Source TarXz compression,Test source with TarXZ compression,no,Friends.json.tar.xz,default.nq,,,, +RMLSTC0002e,Source TarGzip compression,Test source with TarGZip compression,no,Friends.json.tar.gz,default.nq,,,, +RMLSTC0003,Source with query,Test source which requires a query,no,Friends.nt,default.nq,,,, +RMLSTC0004a,Source with default NULL values,Test source with default NULL values,no,Friends-NULL.csv,default.nq,,,, +RMLSTC0004b,Source with one NULL value,Test source with one NULL value defined,no,Friends-NULL.csv,default.nq,,,, +RMLSTC0004c,Source with multiple NULL values,Test source with multiple NULL values defined,no,Friends-NULL2.csv,default.nq,,,, +RMLSTC0006a,Source with D2RQ access description,Test source with D2RQ access description for SQL databases,no,Friends.csv,default.nq,,,, +RMLSTC0006b,Source with a Relative Path Source,Test access to a file,no,Friends.csv,default.nq,,,, +RMLSTC0007a,Source with JSONPath reference formulation,Test source with JSONPath reference formulation,no,Friends.json,default.nq,,,, +RMLSTC0007b,Source with CSV reference formulation,Test source with Tabular reference formulation,no,Friends.csv,default.nq,,,, +RMLSTC0007c,Source with XPath reference formulation,Test source with XPath reference formulation,no,Friends.xml,default.nq,,,, +RMLSTC0007d,Source with XPath reference formulation with namespaces,Test source with XPath reference formulation with namespaces,no,Friends.xml,default.nq,,,, +RMLSTC0008a,Multiple sources of same type,Tests the generation of all triples from multiple homogeneous sources ,no,"Friends.json, Friends2.json",default.nq,,,, +RMLSTC0008b,Multiple sources of different type,Tests the generation of all triples from multiple heterogeneous sources ,no,"Friends.json, Friends.csv",default.nq,,,, +RMLSTC0009a,Source with quoted columns,Tests the generation of triples where columns are quoted,no,Friends.csv,default.nq,,,, +RMLSTC0010a,"Invalid CSV source, reference to invalid column",Tests the identification of invalid CSV sources,yes,Friends.csv,,,,, +RMLSTC0010b,"Invalid CSV source, no reference to invalid column","Tests the identification of invalid CSV sources, even when all columns referenced are valid",yes,Friends.csv,,,,, +RMLSTC0011a,Complex JSON source,Tests the generation of triples from complex JSON sources,no,companies.json,default.nq,,,, +RMLSTC0011b,Complex JSON source,Tests the generation of triples from complex JSON sources,no,companies.json,default.nq,,,, +RMLSTC0011c,Complex JSON source,Tests the generation of triples from complex JSON sources,no,companies.json,default.nq,,,, +RMLSTC0011d,Complex JSON source,Tests the generation of triples from complex JSON sources,no,companies.json,default.nq,,,, +RMLSTC0011e,Complex JSON source,Tests the generation of triples from complex JSON sources,no,companies.json,default.nq,,,, +RMLSTC0012a,Complex XML source,Tests the generation of triples from complex XML sources,no,companies.xml,default.nq,,,, +RMLSTC0012b,Complex XML source,Tests the generation of triples from complex XML sources,no,companies.xml,default.nq,,,, +RMLSTC0012c,Complex XML source,Tests the generation of triples from complex XML sources,no,companies.xml,default.nq,,,, +RMLSTC0012d,Complex XML source,Tests the generation of triples from complex XML sources,no,companies.xml,default.nq,,,, +RMLSTC0012e,Complex XML source,Tests the generation of triples from complex XML sources,no,companies.xml,default.nq,,,, \ No newline at end of file diff --git a/src/test/resources/rml-io/dev.html b/src/test/resources/rml-io/dev.html new file mode 100644 index 00000000..dca42297 --- /dev/null +++ b/src/test/resources/rml-io/dev.html @@ -0,0 +1,173 @@ + + + + + RML-IO: Test Cases + + + + + + + + + + +
+ +
+ +
+ +
+ +
+ + +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ + + + diff --git a/src/test/resources/rml-io/docs/20250130/index.html b/src/test/resources/rml-io/docs/20250130/index.html new file mode 100644 index 00000000..0a514b5a --- /dev/null +++ b/src/test/resources/rml-io/docs/20250130/index.html @@ -0,0 +1,5687 @@ + + + + + + +RML-IO: Test Cases + + + + + + + + + + + + + + +
+ +

RML-IO: Test Cases

+

+ Draft Community Group Report + +

+
+ +
Latest published version:
+ https://www.w3.org/RML-IO-Testcases/ +
+
Latest editor's draft:
https://w3id.org/rml/io/test-cases/
+ + + + +
Editor:
+ Dylan Van Assche + + + + (IDLab – Ghent University – imec) +
+ +
Author:
+ Dylan Van Assche + + + + (IDLab – Ghent University – imec) +
+
Feedback:
+ GitHub kg-construct/rml-io + (pull requests, + new issue, + open issues) +
+ +
+ + +
+
+ + + +

Abstract

This document defines the RML-IO test cases to the determine the RML-IO specification conformance of tools.

+
+ +

Status of This Document

+ This specification was published by the + Knowledge Graph Construction Community Group. It is not a W3C Standard nor is it + on the W3C Standards Track. + + Please note that under the + W3C Community Contributor License Agreement (CLA) + there is a limited opt-out and other conditions apply. + + Learn more about + W3C Community and Business Groups. +

+ GitHub Issues are preferred for + discussion of this specification. + + +

+ +

1. Introduction

+

This document defines the RML-IO test cases, consisting of a collection of test case documents (input and expected output). +The purpose of the test cases is to determine the conformance of tools that execute RML rules to the RML-IO specification.

+
+ +

2. Data model

+

The test cases are semantically described for re-usability and shareability following the W3C Test case description. +Each test:Testcase as the following properties:

+
    +
  • dcterms:identifier: unique ID of the test case.
  • +
  • rmltest:hasError: if an error of the RML Processor is expected or not.
  • +
  • rmltest:input: One or more input data of the test case.
  • +
  • rmltest:output: One or more output data of the test case.
  • +
  • rmltest:inputFormat: the input data format.
  • +
  • rmltest:outputFormat: the output data format.
  • +
  • rmltest:mappingDocument: the RML mapping rules in Turtle.
  • +
+
+ +

3. Test cases

+

This section describes the RML-IO test cases. These descriptions are also available as RDF. +The files are available on GitHub in the folder test-cases. +Each test case is contained in a single folder, containing three types of files:

+
    +
  • Zero or more files containing the data sources, in the case of JSON, XML, CSV, or containing the SQL statements to create the necessary tables, in the case of MySQL, PostgreSQL, and SQL Server.
  • +
  • One file with the RML rules, called mapping.ttl, in the Turtle format.
  • +
  • Zero or more files with the expected RDF. No file is provided if an error is expected that must halt the generation of the RDF because of an error.
  • +
+
+ + +

4. RMLSTC0001a

+

Title: Source with UTF-8 encoding

+

Description: Test source with UTF-8 encoding

+

Error expected? Yes

+

Input

+
[
+  { 
+    "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
+  }
+]
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix dcat: <http://www.w3.org/ns/dcat#> .
+@base <http://example.com/rules/> .
+
+<#DCATSourceAccess> a rml:Source, dcat:Distribution;
+  dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLSTC0001a/Friends.json>;
+  rml:encoding rml:UTF-8;
+.
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source <#DCATSourceAccess>;
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+

Output

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
+<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
+
+
+

5. RMLSTC0001b

+

Title: Source with UTF-16 encoding

+

Description: Test source with UTF-16 encoding

+

Error expected? Yes

+

Input

+
[
+  { 
+    "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
+  }
+]
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix dcat: <http://www.w3.org/ns/dcat#> .
+@base <http://example.com/rules/> .
+
+<#DCATSourceAccess> a rml:Source, dcat:Distribution;
+  dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLSTC0001b/Friends-UTF16.json>;
+  rml:encoding rml:UTF-16;
+.
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source <#DCATSourceAccess>;
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+

Output

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
+<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
+
+
+

6. RMLSTC0002a

+

Title: Source no compression

+

Description: Test source without compression

+

Error expected? Yes

+

Input

+
[
+  { 
+    "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
+  }
+]
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix dcat: <http://www.w3.org/ns/dcat#> .
+@base <http://example.com/rules/> .
+
+<#DCATSourceAccess> a rml:Source, dcat:Distribution;
+  dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLSTC0002a/Friends.json>;
+.
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source <#DCATSourceAccess>;
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+

Output

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
+<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
+
+
+

7. RMLSTC0002b

+

Title: Source GZip compression

+

Description: Test source with GZip compression

+

Error expected? Yes

+

Input + Friends.json.gz

+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix dcat: <http://www.w3.org/ns/dcat#> .
+@base <http://example.com/rules/> .
+
+<#DCATSourceAccess> a rml:Source, dcat:Distribution;
+  dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLSTC0002b/Friends.json.gz>;
+  rml:compression rml:gzip;
+.
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source <#DCATSourceAccess>;
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+

Output

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
+<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
+
+
+

8. RMLSTC0002c

+

Title: Source Zip compression

+

Description: Test source with ZIP compression

+

Error expected? Yes

+

Input + Friends.json.zip

+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix dcat: <http://www.w3.org/ns/dcat#> .
+@base <http://example.com/rules/> .
+
+<#DCATSourceAccess> a rml:Source, dcat:Distribution;
+  dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLSTC0002c/Friends.json.zip>;
+  rml:compression rml:zip;
+.
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source <#DCATSourceAccess>;
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+

Output

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
+<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
+
+
+

9. RMLSTC0002d

+

Title: Source TarXz compression

+

Description: Test source with TarXZ compression

+

Error expected? Yes

+

Input + Friends.json.tar.xz

+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix dcat: <http://www.w3.org/ns/dcat#> .
+@base <http://example.com/rules/> .
+
+<#DCATSourceAccess> a rml:Source, dcat:Distribution;
+  dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLSTC0002d/Friends.json.tar.xz>;
+  rml:compression rml:tarxz;
+.
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source <#DCATSourceAccess>;
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+

Output

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
+<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
+
+
+

10. RMLSTC0002e

+

Title: Source TarGzip compression

+

Description: Test source with TarGZip compression

+

Error expected? Yes

+

Input + Friends.json.tar.gz

+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix dcat: <http://www.w3.org/ns/dcat#> .
+@base <http://example.com/rules/> .
+
+<#DCATSourceAccess> a rml:Source, dcat:Distribution;
+  dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLSTC0002e/Friends.json.tar.gz>;
+  rml:compression rml:targz;
+.
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source <#DCATSourceAccess>;
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+

Output

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
+<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
+
+
+

11. RMLSTC0003

+

Title: Source with query

+

Description: Test source which requires a query

+

Error expected? Yes

+

Input

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
+<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix dcat: <http://www.w3.org/ns/dcat#> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@base <http://example.com/rules/> .
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:RelativePathSource;
+        rml:path "./Friends.nt";
+    ];
+    rml:iterator """
+    PREFIX foaf: <http://xmlns.com/foaf/0.1/>
+
+    SELECT ?person ?name ?age WHERE {
+        ?person foaf:name ?name .
+        ?person foaf:age ?age .
+    }
+    """;
+    rml:referenceFormulation formats:SPARQL_Results_CSV;
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:reference "person";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "age";
+    ];
+  ];
+.
+
+

Output

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
+<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
+
+
+

12. RMLSTC0004a

+

Title: Source with default NULL values

+

Description: Test source with default NULL values

+

Error expected? Yes

+

Input

+
id;name;age
+0;Monica Geller;33
+1;Rachel Green;34
+2;Joey Tribbiani;35
+3;Chandler Bing;36
+4;Ross Geller;37
+5;;
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix csvw: <http://www.w3.org/ns/csvw#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@base <http://example.com/rules/> .
+
+<#CSVWSourceAccess> a rml:Source, csvw:Table;
+  csvw:url "http://w3id.org/rml/resources/rml-io/RMLSTC0004a/Friends-NULL.csv"^^xsd:anyURI ;
+  csvw:dialect [ a csvw:Dialect;
+    csvw:delimiter ";";
+    csvw:encoding "UTF-8";
+    csvw:header "1"^^xsd:boolean;
+  ];
+.
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source <#CSVWSourceAccess>;
+    rml:referenceFormulation rml:CSV;
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "age";
+    ];
+  ];
+.
+
+

Output

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
+<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
+<http://example.org/5> <http://xmlns.com/foaf/0.1/age> "" .
+<http://example.org/5> <http://xmlns.com/foaf/0.1/name> "" .
+
+
+

13. RMLSTC0004b

+

Title: Source with one NULL value

+

Description: Test source with one NULL value defined

+

Error expected? Yes

+

Input

+
id;name;age
+0;Monica Geller;33
+1;Rachel Green;34
+2;Joey Tribbiani;35
+3;Chandler Bing;36
+4;Ross Geller;37
+5;;
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix csvw: <http://www.w3.org/ns/csvw#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@base <http://example.com/rules/> .
+
+<#CSVWSourceAccess> a rml:Source, csvw:Table;
+  csvw:url "http://w3id.org/rml/resources/rml-io/RMLSTC0004b/Friends-NULL.csv"^^xsd:anyURI ;
+  csvw:dialect [ a csvw:Dialect;
+    csvw:delimiter ";";
+    csvw:encoding "UTF-8";
+    csvw:header "1"^^xsd:boolean;
+  ];
+  # Empty value is considered NULL
+  rml:null "";
+.
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source <#CSVWSourceAccess>;
+    rml:referenceFormulation rml:CSV;
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "age";
+    ];
+  ];
+.
+
+

Output

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
+<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
+
+
+

14. RMLSTC0004c

+

Title: Source with multiple NULL values

+

Description: Test source with multiple NULL values defined

+

Error expected? Yes

+

Input

+
id;name;age
+0;Monica Geller;33
+1;Rachel Green;34
+2;Joey Tribbiani;35
+3;Chandler Bing;36
+4;Ross Geller;37
+5;;
+6;NULL;NULL
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix csvw: <http://www.w3.org/ns/csvw#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@base <http://example.com/rules/> .
+
+<#CSVWSourceAccess> a rml:Source, csvw:Table;
+  csvw:url "http://w3id.org/rml/resources/rml-io/RMLSTC0004c/Friends-NULL2.csv"^^xsd:anyURI ;
+  csvw:dialect [ a csvw:Dialect;
+    csvw:delimiter ";";
+    csvw:encoding "UTF-8";
+    csvw:header "1"^^xsd:boolean;
+  ];
+  # Empty value and 'NULL' are both considered NULL
+  rml:null "";
+  rml:null "NULL";
+.
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source <#CSVWSourceAccess>;
+    rml:referenceFormulation rml:CSV;
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "age";
+    ];
+  ];
+.
+
+

Output

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
+<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
+
+
+

15. RMLSTC0005a

+

Title: Source overrride access: NULL values

+

Description: Test source with data access description providing NULL values which we override.

+

Error expected? Yes

+

Input

+
id;name;age
+0;Monica Geller;33
+1;Rachel Green;34
+2;Joey Tribbiani;35
+3;Chandler Bing;36
+4;Ross Geller;37
+5;;
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix csvw: <http://www.w3.org/ns/csvw#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@base <http://example.com/rules/> .
+
+<#CSVWSourceAccess> a rml:Source, csvw:Table;
+  csvw:url "http://w3id.org/rml/resources/rml-io/RMLSTC0005a/Friends-NULL.csv"^^xsd:anyURI ;
+  csvw:dialect [ a csvw:Dialect;
+    csvw:delimiter ";";
+    csvw:encoding "UTF-8";
+    csvw:header "1"^^xsd:boolean;
+    csvw:null "NULL";
+  ];
+  # Empty value is considered NULL and overrides CSVW
+  rml:null "";
+.
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source <#CSVWSourceAccess>;
+    rml:referenceFormulation rml:CSV;
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "age";
+    ];
+  ];
+.
+
+

Output

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
+<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
+
+
+

16. RMLSTC0005b

+

Title: Source overrride access: Encoding

+

Description: Test source with data access description providing encoding which we override.

+

Error expected? Yes

+

Input

+
id;name;age
+0;Monica Geller;33
+1;Rachel Green;34
+2;Joey Tribbiani;35
+3;Chandler Bing;36
+4;Ross Geller;37
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix csvw: <http://www.w3.org/ns/csvw#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@base <http://example.com/rules/> .
+
+<#CSVWSourceAccess> a rml:Source, csvw:Table;
+  csvw:url "http://w3id.org/rml/resources/rml-io/RMLSTC0005b/Friends.csv"^^xsd:anyURI ;
+  csvw:dialect [ a csvw:Dialect;
+    csvw:delimiter ";";
+    csvw:encoding "UTF-8";
+    csvw:header "1"^^xsd:boolean;
+  ];
+  # Encoding is UTF-16 and overrides CSVW
+  rml:encoding rml:UTF-16;
+.
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source <#CSVWSourceAccess>;
+    rml:referenceFormulation rml:CSV;
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "age";
+    ];
+  ];
+.
+
+

Output

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
+<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
+
+
+

17. RMLSTC0006a

+

Title: Source with DCAT access description

+

Description: Test source with DCAT data access description

+

Error expected? Yes

+

Input

+
[
+  { 
+    "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
+  }
+]
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix dcat: <http://www.w3.org/ns/dcat#> .
+@base <http://example.com/rules/> .
+
+<#DCATSourceAccess> a rml:Source, dcat:Distribution;
+    dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLSTC0006a/Friends.json>;
+.
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source <#DCATSourceAccess>;
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+

Output

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
+<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
+
+
+

18. RMLSTC0006b

+

Title: Source with VoID access description

+

Description: Test source with VoID data access description

+

Error expected? Yes

+

Input

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
+<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix dcat: <http://www.w3.org/ns/dcat#> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@base <http://example.com/rules/> .
+
+<#VoIDSourceAccess> a rml:Source, dcat:Distribution;
+  dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLSTC0006b/Friends.nt>;
+.
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source <#VoIDSourceAccess>;
+    rml:iterator """
+    PREFIX foaf: <http://xmlns.com/foaf/0.1/>
+
+    SELECT ?id ?name ?age WHERE {
+        ?person foaf:name ?name .
+        ?person foaf:age ?age .
+        BIND(REPLACE(STR(?person),"http://example.org/", "") AS ?id) .
+    }
+    """;
+    rml:referenceFormulation formats:SPARQL_Results_CSV;
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "age";
+    ];
+  ];
+.
+
+

Output

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
+<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
+
+
+

19. RMLSTC0006c

+

Title: Source with SD access description

+

Description: Test source with SD data access description

+

Error expected? Yes

+

Input

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
+<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix sd: <http://www.w3.org/ns/sparql-service-description#> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@base <http://example.com/rules/> .
+
+<#SDSourceAccess> a rml:Source, sd:Service;
+  sd:endpoint <http://example.com/sparql/>;
+  sd:supportedLanguage sd:SPARQL11Query;
+.
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source <#SDSourceAccess>;
+    rml:iterator """
+    PREFIX foaf: <http://xmlns.com/foaf/0.1/>
+
+    SELECT ?id ?name ?age WHERE {
+        ?person foaf:name ?name .
+        ?person foaf:age ?age .
+        BIND(REPLACE(STR(?person),"http://example.org/", "") AS ?id) .
+    }
+    """;
+    rml:referenceFormulation formats:SPARQL_Results_CSV;
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "age";
+    ];
+  ];
+.
+
+

Output

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
+<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
+
+
+

20. RMLSTC0006d

+

Title: Source with CSVW access description

+

Description: Test source with CSVW data access description

+

Error expected? Yes

+

Input

+
id;name;age
+0;Monica Geller;33
+1;Rachel Green;34
+2;Joey Tribbiani;35
+3;Chandler Bing;36
+4;Ross Geller;37
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix csvw: <http://www.w3.org/ns/csvw#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@base <http://example.com/rules/> .
+
+<#CSVWSourceAccess> a rml:Source, csvw:Table;
+  csvw:url "http://w3id.org/rml/resources/rml-io/RMLSTC0006d/Friends.csv"^^xsd:anyURI ;
+  csvw:dialect [ a csvw:Dialect;
+    csvw:delimiter ";";
+    csvw:encoding "UTF-8";
+    csvw:header "1"^^xsd:boolean;
+  ];
+.
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source <#CSVWSourceAccess>;
+    rml:referenceFormulation rml:CSV;
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "age";
+    ];
+  ];
+.
+
+

Output

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
+<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
+
+
+

21. RMLSTC0006e

+

Title: Source with Web of Things access description

+

Description: Test source with Web of Things data access description

+

Error expected? Yes

+

Input

+
[
+  { 
+    "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
+  }
+]
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix td: <https://www.w3.org/2019/wot/td#> .
+@prefix htv: <http://www.w3.org/2011/http#> .
+@prefix hctl: <https://www.w3.org/2019/wot/hypermedia#> .
+@base <http://example.com/rules/> .
+
+<#WoTSourceAccess> a rml:Source, td:Thing;
+  td:hasPropertyAffordance [
+    td:hasForm [
+      # URL and content type
+      hctl:hasTarget "http://w3id.org/rml/resources/rml-io/RMLSTC0006e/Friends.json";
+      hctl:forContentType "application/json";
+    ];
+  ];
+.
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source <#WoTSourceAccess>;
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+

Output

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
+<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
+
+
+

22. RMLSTC0006f

+

Title: Source with D2RQ access description

+

Description: Test source with D2RQ access description for SQL databases

+

Error expected? Yes

+

Input

+
id, name, age
+0, Monica Geller, 33
+1, Rachel Green, 34
+2, Joey Tribbiani, 35
+3, Chandler Bing, 36
+4, Ross Geller, 37
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@base <http://example.com/rules/> .
+
+<#D2RQSourceAccess> a rml:Source, d2rq:Database;
+  d2rq:jdbcDSN "$CONNECTIONDSN";
+  d2rq:username "$USERNAME";
+  d2rq:password "$PASSWORD"
+.
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source <#D2RQSourceAccess>;
+    rml:referenceFormulation rml:SQL2008Table;
+    rml:iterator "Friends";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "age";
+    ];
+  ];
+.
+
+

Output

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
+<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
+
+
+

23. RMLSTC0007a

+

Title: Source with JSONPath reference formulation

+

Description: Test source with JSONPath reference formulation

+

Error expected? Yes

+

Input

+
[
+  { 
+    "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
+  }
+]
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix dcat: <http://www.w3.org/ns/dcat#> .
+@base <http://example.com/rules/> .
+
+<#DCATSourceAccess> a rml:Source, dcat:Distribution;
+  dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLSTC0007a/Friends.json>;
+  rml:encoding rml:UTF-8;
+.
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source <#DCATSourceAccess>;
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+

Output

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
+<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
+
+
+

24. RMLSTC0007b

+

Title: Source with CSV reference formulation

+

Description: Test source with Tabular reference formulation

+

Error expected? Yes

+

Input

+
id; name; age
+0; Monica Geller; 33
+1; Rachel Green; 34
+2; Joey Tribbiani; 35
+3; Chandler Bing; 36
+4; Ross Geller; 37
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix csvw: <http://www.w3.org/ns/csvw#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@base <http://example.com/rules/> .
+
+<#CSVWSourceAccess> a rml:Source, csvw:Table;
+  csvw:url "http://w3id.org/rml/resources/rml-io/RMLSTC0007b/Friends.csv"^^xsd:anyURI ;
+  csvw:dialect [ a csvw:Dialect;
+    csvw:delimiter ";";
+    csvw:encoding "UTF-8";
+    csvw:header "1"^^xsd:boolean;
+  ];
+.
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source <#CSVWSourceAccess>;
+    rml:referenceFormulation rml:CSV;
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "age";
+    ];
+  ];
+.
+
+

Output

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
+<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
+
+
+

25. RMLSTC0007c

+

Title: Source with XPath reference formulation

+

Description: Test source with XPath reference formulation

+

Error expected? Yes

+

Input

+
<Friends>
+  <Character id="0">
+    <name>Monica Geller</name>
+    <age>33</age>
+  </Character>
+  <Character id="1">
+    <name>Rachel Green</name>
+    <age>34</age>
+  </Character>
+  <Character id="2">
+    <name>Joey Tribbiani</name>
+    <age>35</age>
+  </Character>
+  <Character id="3">
+    <name>Chandler Bing</name>
+    <age>36</age>
+  </Character>
+  <Character id="4">
+    <name>Ross Geller</name>
+    <age>37</age>
+  </Character>
+</Friends>
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix dcat: <http://www.w3.org/ns/dcat#> .
+@base <http://example.com/rules/> .
+
+<#DCATSourceAccess> a rml:Source, dcat:Distribution;
+  dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLSTC0007c/Friends.xml>;
+.
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source <#DCATSourceAccess>;
+    rml:referenceFormulation rml:XPath;
+    rml:iterator "//Friends/Character";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{@id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "name/text()";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "age/text()";
+    ];
+  ];
+.
+
+

Output

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
+<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
+
+
+

26. RMLSTC0007d

+

Title: Source with XPath reference formulation with namespaces

+

Description: Test source with XPath reference formulation with namespaces

+

Error expected? Yes

+

Input

+
<Friends xmlns:ex="http://example.org">
+  <ex:Character id="0">
+    <ex:name>Monica Geller</ex:name>
+    <ex:age>33</ex:age>
+  </ex:Character>
+  <ex:Character id="1">
+    <ex:name>Rachel Green</ex:name>
+    <ex:age>34</ex:age>
+  </ex:Character>
+  <ex:Character id="2">
+    <ex:name>Joey Tribbiani</ex:name>
+    <ex:age>35</ex:age>
+  </ex:Character>
+  <ex:Character id="3">
+    <ex:name>Chandler Bing</ex:name>
+    <ex:age>36</ex:age>
+  </ex:Character>
+  <ex:Character id="4">
+    <ex:name>Ross Geller</ex:name>
+    <ex:age>37</ex:age>
+  </ex:Character>
+</Friends>
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix dcat: <http://www.w3.org/ns/dcat#> .
+@base <http://example.com/rules/> .
+
+<#DCATSourceAccess> a rml:Source, dcat:Distribution;
+  dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLSTC0007d/Friends.xml>;
+.
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source <#DCATSourceAccess>;
+    rml:referenceFormulation [ a rml:XPathReferenceFormulation;
+      rml:namespace [ a rml:Namespace;
+        rml:namespacePrefix "ex";
+        rml:namespaceURL "http://example.org";
+      ];
+    ];
+    rml:iterator "//Friends/ex:Character";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{@id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "ex:name/text()";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "ex:age/text()";
+    ];
+  ];
+.
+
+

Output

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
+<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
+
+
+

27. RMLTTC0000

+

Title: Default target

+

Description: Test exporting all triples to the default Target when not Targets are specified.

+

Error expected? Yes

+

Input

+
[
+  { 
+    "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
+  }
+]
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix dcat: <http://www.w3.org/ns/dcat#> .
+@base <http://example.com/rules/> .
+
+<#DCATSourceAccess> a rml:Source, dcat:Distribution;
+    dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLTTC0000/Friends.json>;
+.
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source <#DCATSourceAccess>;
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+

Output

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
+<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
+
+
+

28. RMLTTC0001a

+

Title: Single Target: Subject Map

+

Description: Test exporting all triples to a single Target with a given subject.

+

Error expected? Yes

+

Input + http://w3id.org/rml/resources/rml-io/RMLTTC0001a/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix dcat: <http://www.w3.org/ns/dcat#> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@base <http://example.com/rules/> .
+
+<#DCATSourceAccess> a rml:Source, dcat:Distribution;
+    dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLTTC0001a/Friends.json>;
+.
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source <#DCATSourceAccess>;
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+    rml:logicalTarget <#TargetDump1>;
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:Target, dcat:Distribution;
+    dcat:downloadURL <file://./dump1.nq>;
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+

Output 1

+

+
+

Output 2

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
+<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
+
+
+

29. RMLTTC0001b

+

Title: Single Target: Predicate Map

+

Description: Test exporting all triples to a single Target with a given predicate.

+

Error expected? Yes

+

Input + http://w3id.org/rml/resources/rml-io/RMLTTC0001b/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix dcat: <http://www.w3.org/ns/dcat#> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@base <http://example.com/rules/> .
+
+<#DCATSourceAccess> a rml:Source, dcat:Distribution;
+    dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLTTC0001b/Friends.json>;
+.
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source <#DCATSourceAccess>;
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+      rml:logicalTarget <#TargetDump1>;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:Target, dcat:Distribution;
+    dcat:downloadURL <file://./dump1.nq>;
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+

Output 1

+
<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".
+
+

Output 2

+
<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" .
+
+
+

30. RMLTTC0001c

+

Title: Single Target: Object Map

+

Description: Test exporting all triples to a single Target with a given object reference.

+

Error expected? Yes

+

Input + http://w3id.org/rml/resources/rml-io/RMLTTC0001c/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix dcat: <http://www.w3.org/ns/dcat#> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@base <http://example.com/rules/> .
+
+<#DCATSourceAccess> a rml:Source, dcat:Distribution;
+    dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLTTC0001c/Friends.json>;
+.
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source <#DCATSourceAccess>;
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+      rml:logicalTarget <#TargetDump1>;
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:Target, dcat:Distribution;
+    dcat:downloadURL <file://./dump1.nq>;
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+

Output 1

+
<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".
+
+

Output 2

+
<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" .
+
+
+

31. RMLTTC0001d

+

Title: Single Target: Graph Map

+

Description: Test exporting all triples within a named graph to a single Target.

+

Error expected? Yes

+

Input + http://w3id.org/rml/resources/rml-io/RMLTTC0001d/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix dcat: <http://www.w3.org/ns/dcat#> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@prefix ex: <http://example.org/> .
+@base <http://example.com/rules/> .
+
+<#DCATSourceAccess> a rml:Source, dcat:Distribution;
+    dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLTTC0001d/Friends.json>;
+.
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source <#DCATSourceAccess>;
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+    rml:graphMap [ a rml:GraphMap;
+      rml:constant ex:PeopleGraph;
+      rml:logicalTarget <#TargetDump1>;
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:Target, dcat:Distribution;
+    dcat:downloadURL <file://./dump1.nq>;
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+

Output 1

+

+
+

Output 2

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" <http://example.org/PeopleGraph>.
+<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" <http://example.org/PeopleGraph> .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" <http://example.org/PeopleGraph> .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" <http://example.org/PeopleGraph> .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" <http://example.org/PeopleGraph> .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" <http://example.org/PeopleGraph> .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" <http://example.org/PeopleGraph> .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" <http://example.org/PeopleGraph> .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" <http://example.org/PeopleGraph> .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" <http://example.org/PeopleGraph> .
+
+
+

32. RMLTTC0001e

+

Title: Single Target: Language Map

+

Description: Test exporting all triples with a given language tag to a single Target.

+

Error expected? Yes

+

Input + http://w3id.org/rml/resources/rml-io/RMLTTC0001e/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix dcat: <http://www.w3.org/ns/dcat#> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@base <http://example.com/rules/> .
+
+<#DCATSourceAccess> a rml:Source, dcat:Distribution;
+    dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLTTC0001e/Friends.json>;
+.
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source <#DCATSourceAccess>;
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+      rml:languageMap [ a rml:LanguageMap;
+        rml:constant "en";
+        rml:logicalTarget <#TargetDump1>;
+      ];
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:Target, dcat:Distribution;
+    dcat:downloadURL <file://./dump1.nq>;
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+

Output 1

+
<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".
+
+

Output 2

+
<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 .
+
+
+

33. RMLTTC0001f

+

Title: Single Target: Datatype Map

+

Description: Test exporting all triples with a given datatype to a single Target.

+

Error expected? Yes

+

Input + http://w3id.org/rml/resources/rml-io/RMLTTC0001f/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix dcat: <http://www.w3.org/ns/dcat#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@base <http://example.com/rules/> .
+
+<#DCATSourceAccess> a rml:Source, dcat:Distribution;
+    dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLTTC0001f/Friends.json>;
+.
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source <#DCATSourceAccess>;
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+      rml:datatypeMap [ a rml:DatatypeMap;
+        rml:constant xsd:integer;
+        rml:logicalTarget <#TargetDump1>;
+      ];
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:Target, dcat:Distribution;
+    dcat:downloadURL <file://./dump1.nq>;
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+

Output 1

+
<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" .
+
+

Output 2

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33"^^<http://www.w3.org/2001/XMLSchema#integer>.
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34"^^<http://www.w3.org/2001/XMLSchema#integer>.
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35"^^<http://www.w3.org/2001/XMLSchema#integer>.
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36"^^<http://www.w3.org/2001/XMLSchema#integer>.
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37"^^<http://www.w3.org/2001/XMLSchema#integer>.
+
+
+

34. RMLTTC0002a

+

Title: Multiple Targets: Same Term Map

+

Description: Test exporting all triples to multiple Targets in the same Term Map.

+

Error expected? Yes

+

Input + http://w3id.org/rml/resources/rml-io/RMLTTC0002a/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix dcat: <http://www.w3.org/ns/dcat#> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@base <http://example.com/rules/> .
+
+<#DCATSourceAccess> a rml:Source, dcat:Distribution;
+    dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLTTC0002a/Friends.json>;
+.
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source <#DCATSourceAccess>;
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+    rml:logicalTarget <#TargetDump1>;
+    rml:logicalTarget <#TargetDump2>;
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:Target, dcat:Distribution;
+    dcat:downloadURL <file://./dump1.nq>;
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+<#TargetDump2> a rml:LogicalTarget;
+  rml:target [ a rml:Target, dcat:Distribution;
+    dcat:downloadURL <file://./dump2.nq>;
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+

Output 1

+

+
+

Output 2

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
+<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
+
+

Output 3

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
+<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
+
+
+

35. RMLTTC0002b

+

Title: Multiple Targets: Subject Map and Predicate Map

+

Description: Test exporting all triples to a Target in a Subject Map and a Target in a Predicate Map.

+

Error expected? Yes

+

Input + http://w3id.org/rml/resources/rml-io/RMLTTC0002b/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix dcat: <http://www.w3.org/ns/dcat#> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@base <http://example.com/rules/> .
+
+<#DCATSourceAccess> a rml:Source, dcat:Distribution;
+    dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLTTC0002b/Friends.json>;
+.
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source <#DCATSourceAccess>;
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+    rml:logicalTarget <#TargetDump1>;
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+      rml:logicalTarget <#TargetDump2>;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:Target, dcat:Distribution;
+    dcat:downloadURL <file://./dump1.nq>;
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+<#TargetDump2> a rml:LogicalTarget;
+  rml:target [ a rml:Target, dcat:Distribution;
+    dcat:downloadURL <file://./dump2.nq>;
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+

Output 1

+

+
+

Output 2

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
+<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
+
+

Output 3

+
<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" .
+
+
+

36. RMLTTC0002c

+

Title: Multiple Targets: Subject Map and Object Map

+

Description: Test exporting all triples to a Target in a Subject Map and a Target in a Object Map.

+

Error expected? Yes

+

Input + http://w3id.org/rml/resources/rml-io/RMLTTC0002c/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix dcat: <http://www.w3.org/ns/dcat#> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@base <http://example.com/rules/> .
+
+<#DCATSourceAccess> a rml:Source, dcat:Distribution;
+    dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLTTC0002c/Friends.json>;
+.
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source <#DCATSourceAccess>;
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+    rml:logicalTarget <#TargetDump1>;
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+      rml:logicalTarget <#TargetDump2>;
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:Target, dcat:Distribution;
+    dcat:downloadURL <file://./dump1.nq>;
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+<#TargetDump2> a rml:LogicalTarget;
+  rml:target [ a rml:Target, dcat:Distribution;
+    dcat:downloadURL <file://./dump2.nq>;
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+

Output 1

+

+
+

Output 2

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
+<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
+
+

Output 3

+
<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" .
+
+
+

37. RMLTTC0002d

+

Title: Multiple Targets: Predicate Map and Object Map

+

Description: Test exporting all triples to a Target in a Predicate Map and a Target in a Object Map.

+

Error expected? Yes

+

Input + http://w3id.org/rml/resources/rml-io/RMLTTC0002d/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix dcat: <http://www.w3.org/ns/dcat#> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@base <http://example.com/rules/> .
+
+<#DCATSourceAccess> a rml:Source, dcat:Distribution;
+    dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLTTC0002d/Friends.json>;
+.
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source <#DCATSourceAccess>;
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+      rml:logicalTarget <#TargetDump1>;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+      rml:logicalTarget <#TargetDump2>;
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:Target, dcat:Distribution;
+    dcat:downloadURL <file://./dump1.nq>;
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+<#TargetDump2> a rml:LogicalTarget;
+  rml:target [ a rml:Target, dcat:Distribution;
+    dcat:downloadURL <file://./dump2.nq>;
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+

Output 1

+

+
+

Output 2

+
<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" .
+
+

Output 3

+
<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" .
+
+
+

38. RMLTTC0002e

+

Title: Multiple Targets: Subject Map, Predicate Map, and Object Map

+

Description: Test exporting all triples to a Target in a Subject Map, a Target in a Predicate Map, and a Target in a Object Map.

+

Error expected? Yes

+

Input + http://w3id.org/rml/resources/rml-io/RMLTTC0002e/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix dcat: <http://www.w3.org/ns/dcat#> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@base <http://example.com/rules/> .
+
+<#DCATSourceAccess> a rml:Source, dcat:Distribution;
+    dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLTTC0002e/Friends.json>;
+.
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source <#DCATSourceAccess>;
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+    rml:logicalTarget <#TargetDump3>;
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+      rml:logicalTarget <#TargetDump1>;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+      rml:logicalTarget <#TargetDump2>;
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:Target, dcat:Distribution;
+    dcat:downloadURL <file://./dump1.nq>;
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+<#TargetDump2> a rml:LogicalTarget;
+  rml:target [ a rml:Target, dcat:Distribution;
+    dcat:downloadURL <file://./dump2.nq>;
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+<#TargetDump3> a rml:LogicalTarget;
+  rml:target [ a rml:Target, dcat:Distribution;
+    dcat:downloadURL <file://./dump3.nq>;
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+

Output 1

+

+
+

Output 2

+
<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" .
+
+

Output 3

+
<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" .
+
+
+

39. RMLTTC0002f

+

Title: Multiple Targets: Subject Map and Graph Map

+

Description: Test exporting all triples to a Target in a Subject Map and a Target in a Graph Map.

+

Error expected? Yes

+

Input + http://w3id.org/rml/resources/rml-io/RMLTTC0002f/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix dcat: <http://www.w3.org/ns/dcat#> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@prefix ex: <http://example.org> .
+@base <http://example.com/rules/> .
+
+<#DCATSourceAccess> a rml:Source, dcat:Distribution;
+    dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLTTC0002f/Friends.json>;
+.
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source <#DCATSourceAccess>;
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+    rml:logicalTarget <#TargetDump1>;
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:graphMap [ a rml:GraphMap;
+      rml:constant ex:PeopleGraph;
+      rml:logicalTarget <#TargetDump2>;
+    ];
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:Target, dcat:Distribution;
+    dcat:downloadURL <file://./dump1.nq>;
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+<#TargetDump2> a rml:LogicalTarget;
+  rml:target [ a rml:Target, dcat:Distribution;
+    dcat:downloadURL <file://./dump2.nq>;
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+

Output 1

+

+
+

Output 2

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" <http://example.org/PeopleGraph>.
+<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" <http://example.org/PeopleGraph> .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" <http://example.org/PeopleGraph> .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" <http://example.org/PeopleGraph> .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" <http://example.org/PeopleGraph> .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" <http://example.org/PeopleGraph> .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" <http://example.org/PeopleGraph> .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" <http://example.org/PeopleGraph> .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" <http://example.org/PeopleGraph> .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" <http://example.org/PeopleGraph> .
+
+

Output 3

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

40. RMLTTC0002g

+

Title: Multiple Targets: Predicate Map and Graph Map

+

Description: Test exporting all triples to a Target in a Predicate Map and a Target in a Graph Map.

+

Error expected? Yes

+

Input + http://w3id.org/rml/resources/rml-io/RMLTTC0002g/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix dcat: <http://www.w3.org/ns/dcat#> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@prefix ex: <http://example.org> .
+@base <http://example.com/rules/> .
+
+<#DCATSourceAccess> a rml:Source, dcat:Distribution;
+    dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLTTC0002g/Friends.json>;
+.
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source <#DCATSourceAccess>;
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:graphMap [ a rml:GraphMap;
+      rml:constant ex:PeopleGraph;
+      rml:logicalTarget <#TargetDump2>;
+    ];
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+      rml:logicalTarget <#TargetDump1>;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:Target, dcat:Distribution;
+    dcat:downloadURL <file://./dump1.nq>;
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+<#TargetDump2> a rml:LogicalTarget;
+  rml:target [ a rml:Target, dcat:Distribution;
+    dcat:downloadURL <file://./dump2.nq>;
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+

Output 1

+

+
+

Output 2

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" <http://example.org/PeopleGraph>.
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" <http://example.org/PeopleGraph> .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" <http://example.org/PeopleGraph> .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" <http://example.org/PeopleGraph> .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" <http://example.org/PeopleGraph> .
+
+

Output 3

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

41. RMLTTC0002h

+

Title: Multiple Targets: Object Map and Graph Map

+

Description: Test exporting all triples to a Target in a Object Map and a Target in a Graph Map.

+

Error expected? Yes

+

Input + http://w3id.org/rml/resources/rml-io/RMLTTC0002h/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix dcat: <http://www.w3.org/ns/dcat#> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@prefix ex: <http://example.org> .
+@base <http://example.com/rules/> .
+
+<#DCATSourceAccess> a rml:Source, dcat:Distribution;
+    dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLTTC0002h/Friends.json>;
+.
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source <#DCATSourceAccess>;
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:graphMap [ a rml:GraphMap;
+      rml:constant ex:PeopleGraph;
+      rml:logicalTarget <#TargetDump2>;
+    ];
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+      rml:logicalTarget <#TargetDump1>;
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:Target, dcat:Distribution;
+    dcat:downloadURL <file://./dump1.nq>;
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+<#TargetDump2> a rml:LogicalTarget;
+  rml:target [ a rml:Target, dcat:Distribution;
+    dcat:downloadURL <file://./dump2.nq>;
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+

Output 1

+

+
+

Output 2

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" <http://example.org/PeopleGraph>.
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" <http://example.org/PeopleGraph> .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" <http://example.org/PeopleGraph> .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" <http://example.org/PeopleGraph> .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" <http://example.org/PeopleGraph> .
+
+

Output 3

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

42. RMLTTC0002i

+

Title: Multiple Targets: Language Map and Graph Map

+

Description: Test exporting all triples to a Target in a Language Map and a Target in a Graph Map.

+

Error expected? Yes

+

Input + http://w3id.org/rml/resources/rml-io/RMLTTC0002i/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix dcat: <http://www.w3.org/ns/dcat#> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@prefix ex: <http://example.org> .
+@base <http://example.com/rules/> .
+
+<#DCATSourceAccess> a rml:Source, dcat:Distribution;
+    dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLTTC0002i/Friends.json>;
+.
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source <#DCATSourceAccess>;
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+      rml:languageMap [ a rml:LanguageMap;
+        rml:constant "en";
+        rml:logicalTarget <#TargetDump2>;
+      ];
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:graphMap [ a rml:GraphMap;
+      rml:constant ex:PeopleGraph; 
+      rml:logicalTarget <#TargetDump1>;
+    ];
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:Target, dcat:Distribution;
+    dcat:downloadURL <file://./dump1.nq>;
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+<#TargetDump2> a rml:LogicalTarget;
+  rml:target [ a rml:Target, dcat:Distribution;
+    dcat:downloadURL <file://./dump2.nq>;
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+

Output 1

+

+
+

Output 2

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" <http://example.org/PeopleGraph> .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" <http://example.org/PeopleGraph> .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" <http://example.org/PeopleGraph> .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" <http://example.org/PeopleGraph> .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" <http://example.org/PeopleGraph> .
+
+

Output 3

+
<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 .
+
+
+

43. RMLTTC0002j

+

Title: Multiple Targets: Language Map and Object Map

+

Description: Test exporting all triples to a Target in a Language Map and a Target in a Object Map.

+

Error expected? Yes

+

Input + http://w3id.org/rml/resources/rml-io/RMLTTC0002j/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix dcat: <http://www.w3.org/ns/dcat#> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@prefix ex: <http://example.org> .
+@base <http://example.com/rules/> .
+
+<#DCATSourceAccess> a rml:Source, dcat:Distribution;
+    dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLTTC0002j/Friends.json>;
+.
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source <#DCATSourceAccess>;
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+      rml:languageMap [ a rml:LanguageMap;
+        rml:constant "en";
+        rml:logicalTarget <#TargetDump2>;
+      ];
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+      rml:logicalTarget <#TargetDump1>;
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:Target, dcat:Distribution;
+    dcat:downloadURL <file://./dump1.nq>;
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+<#TargetDump2> a rml:LogicalTarget;
+  rml:target [ a rml:Target, dcat:Distribution;
+    dcat:downloadURL <file://./dump2.nq>;
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+

Output 1

+

+
+

Output 2

+
<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" .
+
+

Output 3

+
<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 .
+
+
+

44. RMLTTC0002k

+

Title: Multiple Targets: Datatype Map and Graph Map

+

Description: Test exporting all triples to a Target in a Datatype Map and a Target in a Graph Map.

+

Error expected? Yes

+

Input + http://w3id.org/rml/resources/rml-io/RMLTTC0002k/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix dcat: <http://www.w3.org/ns/dcat#> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix ex: <http://example.org> .
+@base <http://example.com/rules/> .
+
+<#DCATSourceAccess> a rml:Source, dcat:Distribution;
+    dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLTTC0002k/Friends.json>;
+.
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source <#DCATSourceAccess>;
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:graphMap [ a rml:GraphMap;
+      rml:constant ex:PeopleGraph; 
+      rml:logicalTarget <#TargetDump1>;
+    ];
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+      rml:datatypeMap [ a rml:DatatypeMap;
+        rml:constant xsd:integer;
+        rml:logicalTarget <#TargetDump2>;
+      ];
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:Target, dcat:Distribution;
+    dcat:downloadURL <file://./dump1.nq>;
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+<#TargetDump2> a rml:LogicalTarget;
+  rml:target [ a rml:Target, dcat:Distribution;
+    dcat:downloadURL <file://./dump2.nq>;
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+

Output 1

+

+
+

Output 2

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33"^^<http://www.w3.org/2001/XMLSchema#integer> <http://example.org/PeopleGraph> .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34"^^<http://www.w3.org/2001/XMLSchema#integer> <http://example.org/PeopleGraph> .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35"^^<http://www.w3.org/2001/XMLSchema#integer> <http://example.org/PeopleGraph> .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36"^^<http://www.w3.org/2001/XMLSchema#integer> <http://example.org/PeopleGraph> .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37"^^<http://www.w3.org/2001/XMLSchema#integer> <http://example.org/PeopleGraph> .
+
+

Output 3

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33"^^<http://www.w3.org/2001/XMLSchema#integer> <http://example.org/PeopleGraph> .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34"^^<http://www.w3.org/2001/XMLSchema#integer> <http://example.org/PeopleGraph> .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35"^^<http://www.w3.org/2001/XMLSchema#integer> <http://example.org/PeopleGraph> .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36"^^<http://www.w3.org/2001/XMLSchema#integer> <http://example.org/PeopleGraph> .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37"^^<http://www.w3.org/2001/XMLSchema#integer> <http://example.org/PeopleGraph> .
+
+
+

45. RMLTTC0002l

+

Title: Multiple Targets: Datatype Map and Object Map

+

Description: Test exporting all triples to a Target in a Datatype Map and a Target in a Object Map.

+

Error expected? Yes

+

Input + http://w3id.org/rml/resources/rml-io/RMLTTC0002l/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix dcat: <http://www.w3.org/ns/dcat#> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix ex: <http://example.org> .
+@base <http://example.com/rules/> .
+
+<#DCATSourceAccess> a rml:Source, dcat:Distribution;
+    dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLTTC0002l/Friends.json>;
+.
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source <#DCATSourceAccess>;
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+      rml:logicalTarget <#TargetDump1>;
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+      rml:datatypeMap [ a rml:DatatypeMap;
+        rml:constant xsd:integer;
+        rml:logicalTarget <#TargetDump2>;
+      ];
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:Target, dcat:Distribution;
+    dcat:downloadURL <file://./dump1.nq>;
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+<#TargetDump2> a rml:LogicalTarget;
+  rml:target [ a rml:Target, dcat:Distribution;
+    dcat:downloadURL <file://./dump2.nq>;
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+

Output 1

+

+
+

Output 2

+
<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" .
+
+

Output 3

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33"^^<http://www.w3.org/2001/XMLSchema#integer> <http://example.org/PeopleGraph> .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34"^^<http://www.w3.org/2001/XMLSchema#integer> <http://example.org/PeopleGraph> .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35"^^<http://www.w3.org/2001/XMLSchema#integer> <http://example.org/PeopleGraph> .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36"^^<http://www.w3.org/2001/XMLSchema#integer> <http://example.org/PeopleGraph> .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37"^^<http://www.w3.org/2001/XMLSchema#integer> <http://example.org/PeopleGraph> .
+
+
+

46. RMLTTC0002m

+

Title: Multiple Targets: Multiple Predicate Maps

+

Description: Test exporting all triples to Targets in multiple Predicate Maps.

+

Error expected? Yes

+

Input + http://w3id.org/rml/resources/rml-io/RMLTTC0002m/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix dcat: <http://www.w3.org/ns/dcat#> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@base <http://example.com/rules/> .
+
+<#DCATSourceAccess> a rml:Source, dcat:Distribution;
+    dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLTTC0002m/Friends.json>;
+.
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source <#DCATSourceAccess>;
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+      rml:logicalTarget <#TargetDump1>;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+      rml:logicalTarget <#TargetDump2>;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:Target, dcat:Distribution;
+    dcat:downloadURL <file://./dump1.nq>;
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+<#TargetDump2> a rml:LogicalTarget;
+  rml:target [ a rml:Target, dcat:Distribution;
+    dcat:downloadURL <file://./dump2.nq>;
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+

Output 1

+
<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".
+
+

Output 2

+
<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" .
+
+

Output 3

+
<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" .
+
+
+

47. RMLTTC0002n

+

Title: Multiple Targets: Multiple Object Maps

+

Description: Test exporting all triples to Targets in multiple Object Maps.

+

Error expected? Yes

+

Input + http://w3id.org/rml/resources/rml-io/RMLTTC0002n/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix dcat: <http://www.w3.org/ns/dcat#> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@base <http://example.com/rules/> .
+
+<#DCATSourceAccess> a rml:Source, dcat:Distribution;
+    dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLTTC0002n/Friends.json>;
+.
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source <#DCATSourceAccess>;
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+      rml:logicalTarget <#TargetDump1>;
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+      rml:logicalTarget <#TargetDump2>;
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:Target, dcat:Distribution;
+    dcat:downloadURL <file://./dump1.nq>;
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+<#TargetDump2> a rml:LogicalTarget;
+  rml:target [ a rml:Target, dcat:Distribution;
+    dcat:downloadURL <file://./dump2.nq>;
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+

Output 1

+
<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".
+
+

Output 2

+
<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" .
+
+

Output 3

+
<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" .
+
+
+

48. RMLTTC0002o

+

Title: Multiple Targets: Multiple Graph Maps

+

Description: Test exporting all triples to Targets in multiple Graph Maps.

+

Error expected? Yes

+

Input + http://w3id.org/rml/resources/rml-io/RMLTTC0002o/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix dcat: <http://www.w3.org/ns/dcat#> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@prefix ex: <http://example.org/> .
+@base <http://example.com/rules/> .
+
+<#DCATSourceAccess> a rml:Source, dcat:Distribution;
+    dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLTTC0002o/Friends.json>;
+.
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source <#DCATSourceAccess>;
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+    rml:graphMap [ a rml:GraphMap;
+      rml:constant ex:PeopleGraph1;
+      rml:logicalTarget <#TargetDump1>;
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+    rml:graphMap [ a rml:GraphMap;
+      rml:constant ex:PeopleGraph1;
+      rml:logicalTarget <#TargetDump1>;
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:Target, dcat:Distribution;
+    dcat:downloadURL <file://./dump1.nq>;
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+

Output 1

+

+
+

Output 2

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" <http://example.org/PeopleGraph1>.
+<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" <http://example.org/PeopleGraph1> .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" <http://example.org/PeopleGraph1> .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" <http://example.org/PeopleGraph1> .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" <http://example.org/PeopleGraph1> .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" <http://example.org/PeopleGraph1> .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" <http://example.org/PeopleGraph1> .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" <http://example.org/PeopleGraph1> .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" <http://example.org/PeopleGraph1> .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" <http://example.org/PeopleGraph1> .
+
+

Output 3

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

49. RMLTTC0002p

+

Title: Multiple Targets: Multiple Language Maps

+

Description: Test exporting all triples to Targets in multiple Language Maps.

+

Error expected? Yes

+

Input + http://w3id.org/rml/resources/rml-io/RMLTTC0002p/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix dcat: <http://www.w3.org/ns/dcat#> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@base <http://example.com/rules/> .
+
+<#DCATSourceAccess> a rml:Source, dcat:Distribution;
+    dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLTTC0002p/Friends.json>;
+.
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source <#DCATSourceAccess>;
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+      rml:languageMap [ a rml:LanguageMap;
+        rml:constant "en";
+        rml:logicalTarget <#TargetDump1>;
+      ];
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+      rml:languageMap [ a rml:LanguageMap;
+        rml:constant "nl";
+        rml:logicalTarget <#TargetDump2>;
+      ];
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:Target, dcat:Distribution;
+    dcat:downloadURL <file://./dump1.nq>;
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+<#TargetDump2> a rml:LogicalTarget;
+  rml:target [ a rml:Target, dcat:Distribution;
+    dcat:downloadURL <file://./dump2.nq>;
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+

Output 1

+
<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".
+
+

Output 2

+
<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 .
+
+

Output 3

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller"@nl .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green"@nl .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani"@nl .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing"@nl .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller"@nl .
+
+
+

50. RMLTTC0002q

+

Title: Multiple Targets: Multiple Datatype Maps

+

Description: Test exporting all triples to Targets in multiple Datatype Maps.

+

Error expected? Yes

+

Input + http://w3id.org/rml/resources/rml-io/RMLTTC0002q/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix dcat: <http://www.w3.org/ns/dcat#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@base <http://example.com/rules/> .
+
+<#DCATSourceAccess> a rml:Source, dcat:Distribution;
+    dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLTTC0002q/Friends.json>;
+.
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source <#DCATSourceAccess>;
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+      rml:datatypeMap [ a rml:DatatypeMap;
+        rml:constant xsd:integer;
+        rml:logicalTarget <#TargetDump1>;
+      ];
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+      rml:datatypeMap [ a rml:DatatypeMap;
+        rml:constant xsd:double;
+        rml:logicalTarget <#TargetDump2>;
+      ];
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:Target, dcat:Distribution;
+    dcat:downloadURL <file://./dump1.nq>;
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+<#TargetDump2> a rml:LogicalTarget;
+  rml:target [ a rml:Target, dcat:Distribution;
+    dcat:downloadURL <file://./dump2.nq>;
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+

Output 1

+
<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" .
+
+

Output 2

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33"^^<http://www.w3.org/2001/XMLSchema#integer>.
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34"^^<http://www.w3.org/2001/XMLSchema#integer>.
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35"^^<http://www.w3.org/2001/XMLSchema#integer>.
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36"^^<http://www.w3.org/2001/XMLSchema#integer>.
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37"^^<http://www.w3.org/2001/XMLSchema#integer>.
+
+

Output 3

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33"^^<http://www.w3.org/2001/XMLSchema#double>.
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34"^^<http://www.w3.org/2001/XMLSchema#double>.
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35"^^<http://www.w3.org/2001/XMLSchema#double>.
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36"^^<http://www.w3.org/2001/XMLSchema#double>.
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37"^^<http://www.w3.org/2001/XMLSchema#double>.
+
+
+

51. RMLTTC0002r

+

Title: Multiple Targets: Multiple Term Maps with same Target

+

Description: Test exporting all triples to same Target in multiple Term Maps.

+

Error expected? Yes

+

Input + http://w3id.org/rml/resources/rml-io/RMLTTC0002r/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix dcat: <http://www.w3.org/ns/dcat#> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@base <http://example.com/rules/> .
+
+<#DCATSourceAccess> a rml:Source, dcat:Distribution;
+    dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLTTC0002r/Friends.json>;
+.
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source <#DCATSourceAccess>;
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+      rml:logicalTarget <#TargetDump1>;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+      rml:logicalTarget <#TargetDump1>;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:Target, dcat:Distribution;
+    dcat:downloadURL <file://./dump1.nq>;
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+

Output 1

+
<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".
+
+

Output 2

+
<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" .
+<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" .
+
+
+

52. RMLTTC0003a

+

Title: Overriding Targets: Seperate Triples Map

+

Description: Test exporting some triples to a different Target with a separate Triples Map.

+

Error expected? Yes

+

Input + http://w3id.org/rml/resources/rml-io/RMLTTC0003a/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix dcat: <http://www.w3.org/ns/dcat#> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@base <http://example.com/rules/> .
+
+<#DCATSourceAccess> a rml:Source, dcat:Distribution;
+    dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLTTC0003a/Friends.json>;
+.
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source <#DCATSourceAccess>;
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+    rml:logicalTarget <#TargetDump1>;
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+<#TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source <#DCATSourceAccess>;
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+    rml:logicalTarget <#TargetDump1>;
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:Target, dcat:Distribution;
+    dcat:downloadURL <file://./dump1.nq>;
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+<#TargetDump2> a rml:LogicalTarget;
+  rml:target [ a rml:Target, dcat:Distribution;
+    dcat:downloadURL <file://./dump2.nq>;
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+

Output 1

+

+
+

Output 2

+
<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" .
+
+

Output 3

+
<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" .
+
+
+

53. RMLTTC0004a

+

Title: Target JSON-LD

+

Description: Test export all triples as JSON-LD

+

Error expected? Yes

+

Input + http://w3id.org/rml/resources/rml-io/RMLTTC0004a/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix dcat: <http://www.w3.org/ns/dcat#> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@base <http://example.com/rules/> .
+
+<#DCATSourceAccess> a rml:Source, dcat:Distribution;
+    dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLTTC0004a/Friends.json>;
+.
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source <#DCATSourceAccess>;
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+    rml:logicalTarget <#TargetDump1>;
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:Target, dcat:Distribution;
+    dcat:downloadURL <file://./dump1.jsonld>;
+  ];
+  rml:serialization formats:JSON-LD;
+.
+
+

Output 1

+

+
+

Output 2

+
{
+  "@context": { 
+    "foaf": "http://xmlns.com/foaf/0.1/"
+  },
+  "@graph": [
+    {                                                                                
+
+      "@id": "http://example.org/0",
+      "foaf:name": "Monica Geller",
+      "foaf:age": "33"
+    },
+    {                                                                                
+      "@id": "http://example.org/1",
+      "foaf:name": "Rachel Green",
+      "foaf:age": "34"
+    },
+    {                                                                                
+      "@id": "http://example.org/2",
+      "foaf:name": "Joey Tribbiani",
+      "foaf:age": "35"
+    },
+    {                                                                                
+      "@id": "http://example.org/3",
+      "foaf:name": "Chandler Bing",
+      "foaf:age": "36"
+    },
+      {                                                                                
+      "@id": "http://example.org/4",
+      "foaf:name": "Ross Geller",
+      "foaf:age": "37"
+    }
+  ]
+}
+
+
+

54. RMLTTC0004b

+

Title: Target N3

+

Description: Test export all triples as N3

+

Error expected? Yes

+

Input + http://w3id.org/rml/resources/rml-io/RMLTTC0004b/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix dcat: <http://www.w3.org/ns/dcat#> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@base <http://example.com/rules/> .
+
+<#DCATSourceAccess> a rml:Source, dcat:Distribution;
+    dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLTTC0004b/Friends.json>;
+.
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source <#DCATSourceAccess>;
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+    rml:logicalTarget <#TargetDump1>;
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:Target, dcat:Distribution;
+    dcat:downloadURL <file://./dump1.n3>;
+  ];
+  rml:serialization formats:N3;
+.
+
+

Output 1

+

+
+

Output 2

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix ex: <http://example.org/> .
+ex:0 <foaf:age> "33" ;
+     <foaf:name> "Monica Geller" .
+ex:1 <foaf:age> "34" ;
+     <foaf:name> "Rachel Green" .
+ex:2 <foaf:age> "35" ;
+     <foaf:name> "Joey Tribbiani" .
+ex:3 <foaf:age> "36" ;
+     <foaf:name> "Chandler Bing" .
+ex:4 <foaf:age> "37" ;
+     <foaf:name> "Ross Geller" .
+
+
+

55. RMLTTC0004c

+

Title: Target N-Triples

+

Description: Test export all triples as N-Triples

+

Error expected? Yes

+

Input + http://w3id.org/rml/resources/rml-io/RMLTTC0004c/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix dcat: <http://www.w3.org/ns/dcat#> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@base <http://example.com/rules/> .
+
+<#DCATSourceAccess> a rml:Source, dcat:Distribution;
+    dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLTTC0004c/Friends.json>;
+.
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source <#DCATSourceAccess>;
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+    rml:logicalTarget <#TargetDump1>;
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:Target, dcat:Distribution;
+    dcat:downloadURL <file://./dump1.nt>;
+  ];
+  rml:serialization formats:N-Triples;
+.
+
+

Output 1

+

+
+

Output 2

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
+<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
+
+
+

56. RMLTTC0004d

+

Title: Target N-Quads

+

Description: Test export all triples as N-Quads

+

Error expected? Yes

+

Input + http://w3id.org/rml/resources/rml-io/RMLTTC0004d/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix dcat: <http://www.w3.org/ns/dcat#> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@base <http://example.com/rules/> .
+
+<#DCATSourceAccess> a rml:Source, dcat:Distribution;
+    dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLTTC0004d/Friends.json>;
+.
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source <#DCATSourceAccess>;
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+    rml:logicalTarget <#TargetDump1>;
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:Target, dcat:Distribution;
+    dcat:downloadURL <file://./dump1.nq>;
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+

Output 1

+

+
+

Output 2

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
+<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
+
+
+

57. RMLTTC0004e

+

Title: Target RDF/JSON

+

Description: Test export all triples as RDF/JSON

+

Error expected? Yes

+

Input + http://w3id.org/rml/resources/rml-io/RMLTTC0004e/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix dcat: <http://www.w3.org/ns/dcat#> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@base <http://example.com/rules/> .
+
+<#DCATSourceAccess> a rml:Source, dcat:Distribution;
+    dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLTTC0004e/Friends.json>;
+.
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source <#DCATSourceAccess>;
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+    rml:logicalTarget <#TargetDump1>;
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:Target, dcat:Distribution;
+    dcat:downloadURL <file://./dump1.rdfjson>;
+  ];
+  rml:serialization formats:RDF_JSON;
+.
+
+

Output 1

+

+
+

Output 2

+
{
+    "http://example.org/0" : {
+        "http://xmlns.com/foaf/0.1/age" : [ { "value" : "33" } ],
+        "http://xmlns.com/foaf/0.1/name" : [ { "value" : "Monica Geller" } ]
+    },
+    "http://example.org/1" : {
+        "http://xmlns.com/foaf/0.1/age" : [ { "value" : "34" } ],
+        "http://xmlns.com/foaf/0.1/name" : [ { "value" : "Rachel Green" } ]
+    },
+    "http://example.org/2" : {
+        "http://xmlns.com/foaf/0.1/age" : [ { "value" : "35" } ],
+        "http://xmlns.com/foaf/0.1/name" : [ { "value" : "Joey Tribbiani" } ]
+    },
+    "http://example.org/3" : {
+        "http://xmlns.com/foaf/0.1/age" : [ { "value" : "36" } ],
+        "http://xmlns.com/foaf/0.1/name" : [ { "value" : "Chandler Bing" } ]
+    },
+    "http://example.org/4" : {
+        "http://xmlns.com/foaf/0.1/age" : [ { "value" : "37" } ],
+        "http://xmlns.com/foaf/0.1/name" : [ { "value" : "Ross Geller" } ]
+    }
+}
+
+
+

58. RMLTTC0004f

+

Title: Target RDF/XML

+

Description: Test export all triples as RDF/XML

+

Error expected? Yes

+

Input + http://w3id.org/rml/resources/rml-io/RMLTTC0004f/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix dcat: <http://www.w3.org/ns/dcat#> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@base <http://example.com/rules/> .
+
+<#DCATSourceAccess> a rml:Source, dcat:Distribution;
+    dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLTTC0004f/Friends.json>;
+.
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source <#DCATSourceAccess>;
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+    rml:logicalTarget <#TargetDump1>;
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:Target, dcat:Distribution;
+    dcat:downloadURL <file://./dump1.rdfxml>;
+  ];
+  rml:serialization formats:RDF_XML;
+.
+
+

Output 1

+

+
+

Output 2

+
<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:age>33</foaf:age>
+    <foaf:name>Monica Geller</foaf:name>
+  </rdf:Description>
+  <rdf:Description rdf:about="http://example.org/1">
+    <foaf:age>34</foaf:age>
+    <foaf:name>Rachel Green</foaf:name>
+  </rdf:Description>
+  <rdf:Description rdf:about="http://example.org/2">
+    <foaf:age>35</foaf:age>
+    <foaf:name>Joey Tribbiani</foaf:name>
+  </rdf:Description>
+  <rdf:Description rdf:about="http://example.org/3">
+    <foaf:age>36</foaf:age>
+    <foaf:name>Chandler Bing</foaf:name>
+  </rdf:Description>
+  <rdf:Description rdf:about="http://example.org/4">
+    <foaf:age>37</foaf:age>
+    <foaf:name>Ross Geller</foaf:name>
+  </rdf:Description>
+</rdf:RDF>
+
+
+

59. RMLTTC0004g

+

Title: Target Turtle

+

Description: Test export all triples as Turtle

+

Error expected? Yes

+

Input + http://w3id.org/rml/resources/rml-io/RMLTTC0004g/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix dcat: <http://www.w3.org/ns/dcat#> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@base <http://example.com/rules/> .
+
+<#DCATSourceAccess> a rml:Source, dcat:Distribution;
+    dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLTTC0004g/Friends.json>;
+.
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source <#DCATSourceAccess>;
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+    rml:logicalTarget <#TargetDump1>;
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:Target, dcat:Distribution;
+    dcat:downloadURL <file://./dump1.ttl>;
+  ];
+  rml:serialization formats:Turtle;
+.
+
+

Output 1

+

+
+

Output 2

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix ex: <http://example.org/> .
+
+<ex:0> <foaf:age> "33" .
+<ex:0> <foaf:name> "Monica Geller" .
+<ex:1> <foaf:age> "34" .
+<ex:1> <foaf:name> "Rachel Green" .
+<ex:2> <foaf:age> "35" .
+<ex:2> <foaf:name> "Joey Tribbiani" .
+<ex:3> <foaf:age> "36" .
+<ex:3> <foaf:name> "Chandler Bing" .
+<ex:4> <foaf:age> "37" .
+<ex:4> <foaf:name> "Ross Geller" .
+
+
+

60. RMLTTC0005a

+

Title: Target UTF-8

+

Description: Test export all triples with UTF-8 encoding

+

Error expected? Yes

+

Input + http://w3id.org/rml/resources/rml-io/RMLTTC0005a/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix dcat: <http://www.w3.org/ns/dcat#> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@base <http://example.com/rules/> .
+
+<#DCATSourceAccess> a rml:Source, dcat:Distribution;
+    dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLTTC0005a/Friends.json>;
+.
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source <#DCATSourceAccess>;
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+    rml:logicalTarget <#TargetDump1>;
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:Target, dcat:Distribution;
+    dcat:downloadURL <file://./dump1.nq>;
+  ];
+  rml:serialization formats:N-Quads;
+  rml:encoding rml:UTF-8;
+.
+
+

Output 1

+

+
+

Output 2

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
+<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
+
+
+

61. RMLTTC0005b

+

Title: Target UTF-16

+

Description: Test export all triples with UTF-16 encoding

+

Error expected? Yes

+

Input + http://w3id.org/rml/resources/rml-io/RMLTTC0005b/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix dcat: <http://www.w3.org/ns/dcat#> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@base <http://example.com/rules/> .
+
+<#DCATSourceAccess> a rml:Source, dcat:Distribution;
+    dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLTTC0005b/Friends.json>;
+.
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source <#DCATSourceAccess>;
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+    rml:logicalTarget <#TargetDump1>;
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:Target, dcat:Distribution;
+    dcat:downloadURL <file://./dump1.nq>;
+  ];
+  rml:serialization formats:N-Quads;
+  rml:encoding rml:UTF-16;
+.
+
+

Output 1

+

+
+

Output 2

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
+<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
+
+
+

62. RMLTTC0006a

+

Title: Target no compression

+

Description: Test export all triples with no compression

+

Error expected? Yes

+

Input + http://w3id.org/rml/resources/rml-io/RMLTTC0006a/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix dcat: <http://www.w3.org/ns/dcat#> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@base <http://example.com/rules/> .
+
+<#DCATSourceAccess> a rml:Source, dcat:Distribution;
+    dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLTTC0006a/Friends.json>;
+.
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source <#DCATSourceAccess>;
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+    rml:logicalTarget <#TargetDump1>;
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:Target, dcat:Distribution;
+    dcat:downloadURL <file://./dump1.nq>;
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+

Output 1

+

+
+

Output 2

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
+<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
+
+
+

63. RMLTTC0006b

+

Title: Target GZip compression

+

Description: Test export all triples with GZip compression

+

Error expected? Yes

+

Input + http://w3id.org/rml/resources/rml-io/RMLTTC0006b/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix dcat: <http://www.w3.org/ns/dcat#> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@base <http://example.com/rules/> .
+
+<#DCATSourceAccess> a rml:Source, dcat:Distribution;
+    dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLTTC0006b/Friends.json>;
+.
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source <#DCATSourceAccess>;
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+    rml:logicalTarget <#TargetDump1>;
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:Target, dcat:Distribution;
+    dcat:downloadURL <file://./dump1.nq.gz>;
+  ];
+  rml:serialization formats:N-Quads;
+  rml:compression rml:gzip;
+.
+
+

Output 1

+

+
+

Output 2 + dump1.nq.gz

+
+

64. RMLTTC0006c

+

Title: Target Zip compression

+

Description: Test export all triples with ZIP compression

+

Error expected? Yes

+

Input + http://w3id.org/rml/resources/rml-io/RMLTTC0006c/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix dcat: <http://www.w3.org/ns/dcat#> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@base <http://example.com/rules/> .
+
+<#DCATSourceAccess> a rml:Source, dcat:Distribution;
+    dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLTTC0006c/Friends.json>;
+.
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source <#DCATSourceAccess>;
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+    rml:logicalTarget <#TargetDump1>;
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:Target, dcat:Distribution;
+    dcat:downloadURL <file://./dump1.nq.zip>;
+  ];
+  rml:serialization formats:N-Quads;
+  rml:compression rml:zip;
+.
+
+

Output 1

+

+
+

Output 2 + dump1.nq.zip

+
+

65. RMLTTC0006d

+

Title: Target TarXz compression

+

Description: Test export all triples with TarXZ compression

+

Error expected? Yes

+

Input + http://w3id.org/rml/resources/rml-io/RMLTTC0006d/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix dcat: <http://www.w3.org/ns/dcat#> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@prefix ex: <http://example.org/> .
+@base <http://example.com/rules/> .
+
+<#DCATSourceAccess> a rml:Source, dcat:Distribution;
+    dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLTTC0006d/Friends.json>;
+.
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source <#DCATSourceAccess>;
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+    rml:logicalTarget <#TargetDump1>;
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:Target, dcat:Distribution;
+    dcat:downloadURL <file://./dump1.nq.tar.xz>;
+  ];
+  rml:serialization formats:N-Quads;
+  rml:compression rml:tarxz;
+.
+
+

Output 1

+

+
+

Output 2 + dump1.nq.tar.xz

+
+

66. RMLTTC0006e

+

Title: Target TarGzip compression

+

Description: Test export all triples with TarGZip compression

+

Error expected? Yes

+

Input + http://w3id.org/rml/resources/rml-io/RMLTTC0006e/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix dcat: <http://www.w3.org/ns/dcat#> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@base <http://example.com/rules/> .
+
+<#DCATSourceAccess> a rml:Source, dcat:Distribution;
+    dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLTTC0006e/Friends.json>;
+.
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source <#DCATSourceAccess>;
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+    rml:logicalTarget <#TargetDump1>;
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:Target, dcat:Distribution;
+    dcat:downloadURL <file://./dump1.nq.tar.gz>;
+  ];
+  rml:serialization formats:N-Quads;
+  rml:compression rml:targz;
+.
+
+

Output 1

+

+
+

Output 2 + dump1.nq.tar.gz

+
+

67. RMLTTC0007a

+

Title: Target with DCAT access description

+

Description: Test export all triples to a target with DCAT access description

+

Error expected? Yes

+

Input + http://w3id.org/rml/resources/rml-io/RMLTTC0007a/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix dcat: <http://www.w3.org/ns/dcat#> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@base <http://example.com/rules/> .
+
+<#DCATSourceAccess> a rml:Source, dcat:Distribution;
+    dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLTTC0007a/Friends.json>;
+.
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source <#DCATSourceAccess>;
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+    rml:logicalTarget <#TargetDump1>;
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:Target, dcat:Distribution;
+    dcat:accessUrl <file://./dump1.nq>;
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+

Output 1

+

+
+

Output 2

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
+<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
+
+
+

68. RMLTTC0007b

+

Title: Target with VoID access description

+

Description: Test export all triples to a target with VoID access description

+

Error expected? Yes

+

Input + http://w3id.org/rml/resources/rml-io/RMLTTC0007b/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix dcat: <http://www.w3.org/ns/dcat#> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@base <http://example.com/rules/> .
+
+<#DCATSourceAccess> a rml:Source, dcat:Distribution;
+    dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLTTC0007b/Friends.json>;
+.
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source <#DCATSourceAccess>;
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+    rml:logicalTarget <#TargetDump1>;
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:Target, dcat:Distribution;
+    dcat:downloadURL <file://./dump1.nq>;
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+

Output 1

+

+
+

Output 2

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
+<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
+
+
+

69. RMLTTC0007c

+

Title: Target with SD access description

+

Description: Test export all triples to a target with SD access description

+

Error expected? Yes

+

Input + http://w3id.org/rml/resources/rml-io/RMLTTC0007c/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix dcat: <http://www.w3.org/ns/dcat#> .
+@prefix sd: <http://www.w3.org/ns/sparql-service-description#> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@base <http://example.com/rules/> .
+
+<#DCATSourceAccess> a rml:Source, dcat:Distribution;
+    dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLTTC0007c/Friends.json>;
+.
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source <#DCATSourceAccess>;
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+    rml:logicalTarget <#TargetDump1>;
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:Target, sd:Service;
+    sd:endpoint  <http://example.com/sparql-update>;
+    sd:supportedLanguage sd:SPARQL11Update;
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+

Output 1

+

+
+

Output 2

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
+<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
+
+
+

70. RMLTTC0007d

+

Title: Target with Web of Things access description

+

Description: Test export all triples to a target with Web of Things access description

+

Error expected? Yes

+

Input + http://w3id.org/rml/resources/rml-io/RMLTTC0007d/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix dcat: <http://www.w3.org/ns/dcat#> .
+@prefix td: <https://www.w3.org/2019/wot/td#> .
+@prefix htv: <http://www.w3.org/2011/http#> .
+@prefix hctl: <https://www.w3.org/2019/wot/hypermedia#> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@base <http://example.com/rules/> .
+
+<#DCATSourceAccess> a rml:Source, dcat:Distribution;
+    dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLTTC0007d/Friends.json>;
+.
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source <#DCATSourceAccess>;
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+    rml:logicalTarget <#TargetDump1>;
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:Target, td:Thing;
+      td:hasPropertyAffordance [
+        td:hasForm [
+          hctl:hasTarget "http://localhost/data";
+          hctl:forContentType "application/n-quads";
+      ];
+    ];
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+

Output 1

+

+
+

Output 2

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
+<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
+
+
+

71. RMLTTC0007e

+

Title: Target with dcat:format

+

Description: Test dcat:format in a Target

+

Error expected? Yes

+

Input + http://w3id.org/rml/resources/rml-io/RMLTTC0007e/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix dcat: <http://www.w3.org/ns/dcat#> .
+@prefix td: <https://www.w3.org/2019/wot/td#> .
+@prefix htv: <http://www.w3.org/2011/http#> .
+@prefix hctl: <https://www.w3.org/2019/wot/hypermedia#> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@base <http://example.com/rules/> .
+
+<#DCATSourceAccess> a rml:Source, dcat:Distribution;
+    dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLTTC0007d/Friends.json>;
+    dcat:format <http://www.iana.org/assignments/media-types/application/json> ;
+.
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source <#DCATSourceAccess>;
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+    rml:logicalTarget <#TargetDump1>;
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:Target, td:Thing;
+      td:hasPropertyAffordance [
+        td:hasForm [
+          hctl:hasTarget "http://localhost/data";
+          hctl:forContentType "application/n-quads";
+      ];
+    ];
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+

Output 1

+

+
+

Output 2

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
+<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
+
+
+ + + + + \ No newline at end of file diff --git a/src/test/resources/rml-io/docs/20250217/index.html b/src/test/resources/rml-io/docs/20250217/index.html new file mode 100644 index 00000000..5707a03d --- /dev/null +++ b/src/test/resources/rml-io/docs/20250217/index.html @@ -0,0 +1,5298 @@ + + + + + + +RML-IO: Test Cases + + + + + + + + + + + + + + +
+ +

RML-IO: Test Cases

+

+ Draft Community Group Report + +

+
+ +
Latest published version:
+ https://www.w3.org/RML-IO-Testcases/ +
+
Latest editor's draft:
https://w3id.org/rml/io/test-cases/
+ + + + +
Editor:
+ Dylan Van Assche + + + + (IDLab – Ghent University – imec) +
+ +
Author:
+ Dylan Van Assche + + + + (IDLab – Ghent University – imec) +
+
Feedback:
+ GitHub kg-construct/rml-io + (pull requests, + new issue, + open issues) +
+ +
+ + +
+
+ + + +

Abstract

This document defines the RML-IO test cases to the determine the RML-IO specification conformance of tools.

+
+ +

Status of This Document

+ This specification was published by the + Knowledge Graph Construction Community Group. It is not a W3C Standard nor is it + on the W3C Standards Track. + + Please note that under the + W3C Community Contributor License Agreement (CLA) + there is a limited opt-out and other conditions apply. + + Learn more about + W3C Community and Business Groups. +

+ GitHub Issues are preferred for + discussion of this specification. + + +

+ +

1. Introduction

+

This document defines the RML-IO test cases, consisting of a collection of test case documents (input and expected output). +The purpose of the test cases is to determine the conformance of tools that execute RML rules to the RML-IO specification.

+
+ +

2. Data model

+

The test cases are semantically described for re-usability and shareability following the W3C Test case description. +Each test:Testcase as the following properties:

+
    +
  • dcterms:identifier: unique ID of the test case.
  • +
  • rmltest:hasError: if an error of the RML Processor is expected or not.
  • +
  • rmltest:input: One or more input data of the test case.
  • +
  • rmltest:output: One or more output data of the test case.
  • +
  • rmltest:inputFormat: the input data format.
  • +
  • rmltest:outputFormat: the output data format.
  • +
  • rmltest:mappingDocument: the RML mapping rules in Turtle.
  • +
+
+ +

3. Test cases

+

This section describes the RML-IO test cases. These descriptions are also available as RDF. +The files are available on GitHub in the folder test-cases. +Each test case is contained in a single folder, containing three types of files:

+
    +
  • Zero or more files containing the data sources, in the case of JSON, XML, CSV, or containing the SQL statements to create the necessary tables, in the case of MySQL, PostgreSQL, and SQL Server.
  • +
  • One file with the RML rules, called mapping.ttl, in the Turtle format.
  • +
  • Zero or more files with the expected RDF. No file is provided if an error is expected that must halt the generation of the RDF because of an error.
  • +
+
+ + +

4. RMLSTC0001a

+

Title: Source with UTF-8 encoding

+

Description: Test source with UTF-8 encoding

+

Error expected? No

+

Input

+
[
+  { 
+    "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
+  }
+]
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix dcat: <http://www.w3.org/ns/dcat#> .
+@base <http://example.com/rules/> .
+
+<#DCATSourceAccess> a rml:Source, dcat:Distribution;
+  dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLSTC0001a/Friends.json>;
+  rml:encoding rml:UTF-8;
+.
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source <#DCATSourceAccess>;
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+

Output

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
+<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
+
+
+

5. RMLSTC0001b

+

Title: Source with UTF-16 encoding

+

Description: Test source with UTF-16 encoding

+

Error expected? No

+

Input

+
[
+  { 
+    "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
+  }
+]
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix dcat: <http://www.w3.org/ns/dcat#> .
+@base <http://example.com/rules/> .
+
+<#DCATSourceAccess> a rml:Source, dcat:Distribution;
+  dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLSTC0001b/Friends-UTF16.json>;
+  rml:encoding rml:UTF-16;
+.
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source <#DCATSourceAccess>;
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+

Output

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
+<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
+
+
+

6. RMLSTC0002a

+

Title: Source no compression

+

Description: Test source without compression

+

Error expected? No

+

Input

+
[
+  { 
+    "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
+  }
+]
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix dcat: <http://www.w3.org/ns/dcat#> .
+@base <http://example.com/rules/> .
+
+<#DCATSourceAccess> a rml:Source, dcat:Distribution;
+  dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLSTC0002a/Friends.json>;
+.
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source <#DCATSourceAccess>;
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+

Output

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
+<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
+
+
+

7. RMLSTC0002b

+

Title: Source GZip compression

+

Description: Test source with GZip compression

+

Error expected? No

+

Input + Friends.json.gz

+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix dcat: <http://www.w3.org/ns/dcat#> .
+@base <http://example.com/rules/> .
+
+<#DCATSourceAccess> a rml:Source, dcat:Distribution;
+  dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLSTC0002b/Friends.json.gz>;
+  rml:compression rml:gzip;
+.
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source <#DCATSourceAccess>;
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+

Output

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
+<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
+
+
+

8. RMLSTC0002c

+

Title: Source Zip compression

+

Description: Test source with ZIP compression

+

Error expected? No

+

Input + Friends.json.zip

+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix dcat: <http://www.w3.org/ns/dcat#> .
+@base <http://example.com/rules/> .
+
+<#DCATSourceAccess> a rml:Source, dcat:Distribution;
+  dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLSTC0002c/Friends.json.zip>;
+  rml:compression rml:zip;
+.
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source <#DCATSourceAccess>;
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+

Output

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
+<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
+
+
+

9. RMLSTC0002d

+

Title: Source TarXz compression

+

Description: Test source with TarXZ compression

+

Error expected? No

+

Input + Friends.json.tar.xz

+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix dcat: <http://www.w3.org/ns/dcat#> .
+@base <http://example.com/rules/> .
+
+<#DCATSourceAccess> a rml:Source, dcat:Distribution;
+  dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLSTC0002d/Friends.json.tar.xz>;
+  rml:compression rml:tarxz;
+.
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source <#DCATSourceAccess>;
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+

Output

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
+<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
+
+
+

10. RMLSTC0002e

+

Title: Source TarGzip compression

+

Description: Test source with TarGZip compression

+

Error expected? No

+

Input + Friends.json.tar.gz

+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix dcat: <http://www.w3.org/ns/dcat#> .
+@base <http://example.com/rules/> .
+
+<#DCATSourceAccess> a rml:Source, dcat:Distribution;
+  dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLSTC0002e/Friends.json.tar.gz>;
+  rml:compression rml:targz;
+.
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source <#DCATSourceAccess>;
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+

Output

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
+<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
+
+
+

11. RMLSTC0003

+

Title: Source with query

+

Description: Test source which requires a query

+

Error expected? No

+

Input

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
+<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix dcat: <http://www.w3.org/ns/dcat#> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@base <http://example.com/rules/> .
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:RelativePathSource;
+        rml:path "./Friends.nt";
+    ];
+    rml:iterator """
+    PREFIX foaf: <http://xmlns.com/foaf/0.1/>
+
+    SELECT ?person ?name ?age WHERE {
+        ?person foaf:name ?name .
+        ?person foaf:age ?age .
+    }
+    """;
+    rml:referenceFormulation formats:SPARQL_Results_CSV;
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:reference "person";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "age";
+    ];
+  ];
+.
+
+

Output

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
+<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
+
+
+

12. RMLSTC0004a

+

Title: Source with default NULL values

+

Description: Test source with default NULL values

+

Error expected? No

+

Input

+
id;name;age
+0;Monica Geller;33
+1;Rachel Green;34
+2;Joey Tribbiani;35
+3;Chandler Bing;36
+4;Ross Geller;37
+5;;
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix csvw: <http://www.w3.org/ns/csvw#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@base <http://example.com/rules/> .
+
+<#CSVWSourceAccess> a rml:Source, csvw:Table;
+  csvw:url "http://w3id.org/rml/resources/rml-io/RMLSTC0004a/Friends-NULL.csv"^^xsd:anyURI ;
+  csvw:dialect [ a csvw:Dialect;
+    csvw:delimiter ";";
+    csvw:encoding "UTF-8";
+    csvw:header "1"^^xsd:boolean;
+  ];
+.
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source <#CSVWSourceAccess>;
+    rml:referenceFormulation rml:CSV;
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "age";
+    ];
+  ];
+.
+
+

Output

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
+<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
+<http://example.org/5> <http://xmlns.com/foaf/0.1/age> "" .
+<http://example.org/5> <http://xmlns.com/foaf/0.1/name> "" .
+
+
+

13. RMLSTC0004b

+

Title: Source with one NULL value

+

Description: Test source with one NULL value defined

+

Error expected? No

+

Input

+
id;name;age
+0;Monica Geller;33
+1;Rachel Green;34
+2;Joey Tribbiani;35
+3;Chandler Bing;36
+4;Ross Geller;37
+5;;
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix csvw: <http://www.w3.org/ns/csvw#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@base <http://example.com/rules/> .
+
+<#CSVWSourceAccess> a rml:Source, csvw:Table;
+  csvw:url "http://w3id.org/rml/resources/rml-io/RMLSTC0004b/Friends-NULL.csv"^^xsd:anyURI ;
+  csvw:dialect [ a csvw:Dialect;
+    csvw:delimiter ";";
+    csvw:encoding "UTF-8";
+    csvw:header "1"^^xsd:boolean;
+  ];
+  # Empty value is considered NULL
+  rml:null "";
+.
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source <#CSVWSourceAccess>;
+    rml:referenceFormulation rml:CSV;
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "age";
+    ];
+  ];
+.
+
+

Output

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
+<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
+
+
+

14. RMLSTC0004c

+

Title: Source with multiple NULL values

+

Description: Test source with multiple NULL values defined

+

Error expected? No

+

Input

+
id;name;age
+0;Monica Geller;33
+1;Rachel Green;34
+2;Joey Tribbiani;35
+3;Chandler Bing;36
+4;Ross Geller;37
+5;;
+6;NULL;NULL
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix csvw: <http://www.w3.org/ns/csvw#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@base <http://example.com/rules/> .
+
+<#CSVWSourceAccess> a rml:Source, csvw:Table;
+  csvw:url "http://w3id.org/rml/resources/rml-io/RMLSTC0004c/Friends-NULL2.csv"^^xsd:anyURI ;
+  csvw:dialect [ a csvw:Dialect;
+    csvw:delimiter ";";
+    csvw:encoding "UTF-8";
+    csvw:header "1"^^xsd:boolean;
+  ];
+  # Empty value and 'NULL' are both considered NULL
+  rml:null "";
+  rml:null "NULL";
+.
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source <#CSVWSourceAccess>;
+    rml:referenceFormulation rml:CSV;
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "age";
+    ];
+  ];
+.
+
+

Output

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
+<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
+
+
+

15. RMLSTC0005a

+

Title: Source overrride access: NULL values

+

Description: Test source with data access description providing NULL values which we override.

+

Error expected? No

+

Input

+
id;name;age
+0;Monica Geller;33
+1;Rachel Green;34
+2;Joey Tribbiani;35
+3;Chandler Bing;36
+4;Ross Geller;37
+5;;
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix csvw: <http://www.w3.org/ns/csvw#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@base <http://example.com/rules/> .
+
+<#CSVWSourceAccess> a rml:Source, csvw:Table;
+  csvw:url "http://w3id.org/rml/resources/rml-io/RMLSTC0005a/Friends-NULL.csv"^^xsd:anyURI ;
+  csvw:dialect [ a csvw:Dialect;
+    csvw:delimiter ";";
+    csvw:encoding "UTF-8";
+    csvw:header "1"^^xsd:boolean;
+    csvw:null "NULL";
+  ];
+  # Empty value is considered NULL and overrides CSVW
+  rml:null "";
+.
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source <#CSVWSourceAccess>;
+    rml:referenceFormulation rml:CSV;
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "age";
+    ];
+  ];
+.
+
+

Output

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
+<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
+
+
+

16. RMLSTC0005b

+

Title: Source overrride access: Encoding

+

Description: Test source with data access description providing encoding which we override.

+

Error expected? No

+

Input

+
id;name;age
+0;Monica Geller;33
+1;Rachel Green;34
+2;Joey Tribbiani;35
+3;Chandler Bing;36
+4;Ross Geller;37
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix csvw: <http://www.w3.org/ns/csvw#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@base <http://example.com/rules/> .
+
+<#CSVWSourceAccess> a rml:Source, csvw:Table;
+  csvw:url "http://w3id.org/rml/resources/rml-io/RMLSTC0005b/Friends.csv"^^xsd:anyURI ;
+  csvw:dialect [ a csvw:Dialect;
+    csvw:delimiter ";";
+    csvw:encoding "UTF-8";
+    csvw:header "1"^^xsd:boolean;
+  ];
+  # Encoding is UTF-16 and overrides CSVW
+  rml:encoding rml:UTF-16;
+.
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source <#CSVWSourceAccess>;
+    rml:referenceFormulation rml:CSV;
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "age";
+    ];
+  ];
+.
+
+

Output

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
+<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
+
+
+

17. RMLSTC0006a

+

Title: Source with D2RQ access description

+

Description: Test source with D2RQ access description for SQL databases

+

Error expected? No

+

Input

+
id, name, age
+0, Monica Geller, 33
+1, Rachel Green, 34
+2, Joey Tribbiani, 35
+3, Chandler Bing, 36
+4, Ross Geller, 37
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@base <http://example.com/rules/> .
+
+<#D2RQSourceAccess> a rml:Source, d2rq:Database;
+  d2rq:jdbcDSN "$CONNECTIONDSN";
+  d2rq:username "$USERNAME";
+  d2rq:password "$PASSWORD"
+.
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source <#D2RQSourceAccess>;
+    rml:referenceFormulation rml:SQL2008Table;
+    rml:iterator "Friends";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "age";
+    ];
+  ];
+.
+
+

Output

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
+<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
+
+
+

18. RMLSTC0006b

+

Title: Source with a Relative Path Source

+

Description: Test access to a file

+

Error expected? No

+

Input

+
id, name, age
+0, Monica Geller, 33
+1, Rachel Green, 34
+2, Joey Tribbiani, 35
+3, Chandler Bing, 36
+4, Ross Geller, 37
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@base <http://example.com/rules/> .
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath, rml:Source;
+      rml:root rml:CurrentWorkingDirectory;
+      rml:path "./Friends.csv"
+    ];
+    rml:referenceFormulation rml:CSV;
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "age";
+    ];
+  ];
+.
+
+

Output

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
+<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
+
+
+

19. RMLSTC0007a

+

Title: Source with JSONPath reference formulation

+

Description: Test source with JSONPath reference formulation

+

Error expected? No

+

Input

+
[
+  { 
+    "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
+  }
+]
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix dcat: <http://www.w3.org/ns/dcat#> .
+@base <http://example.com/rules/> .
+
+<#DCATSourceAccess> a rml:Source, dcat:Distribution;
+  dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLSTC0007a/Friends.json>;
+  rml:encoding rml:UTF-8;
+.
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source <#DCATSourceAccess>;
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+

Output

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
+<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
+
+
+

20. RMLSTC0007b

+

Title: Source with CSV reference formulation

+

Description: Test source with Tabular reference formulation

+

Error expected? No

+

Input

+
id; name; age
+0; Monica Geller; 33
+1; Rachel Green; 34
+2; Joey Tribbiani; 35
+3; Chandler Bing; 36
+4; Ross Geller; 37
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix csvw: <http://www.w3.org/ns/csvw#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@base <http://example.com/rules/> .
+
+<#CSVWSourceAccess> a rml:Source, csvw:Table;
+  csvw:url "http://w3id.org/rml/resources/rml-io/RMLSTC0007b/Friends.csv"^^xsd:anyURI ;
+  csvw:dialect [ a csvw:Dialect;
+    csvw:delimiter ";";
+    csvw:encoding "UTF-8";
+    csvw:header "1"^^xsd:boolean;
+  ];
+.
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source <#CSVWSourceAccess>;
+    rml:referenceFormulation rml:CSV;
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "age";
+    ];
+  ];
+.
+
+

Output

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
+<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
+
+
+

21. RMLSTC0007c

+

Title: Source with XPath reference formulation

+

Description: Test source with XPath reference formulation

+

Error expected? No

+

Input

+
<Friends>
+  <Character id="0">
+    <name>Monica Geller</name>
+    <age>33</age>
+  </Character>
+  <Character id="1">
+    <name>Rachel Green</name>
+    <age>34</age>
+  </Character>
+  <Character id="2">
+    <name>Joey Tribbiani</name>
+    <age>35</age>
+  </Character>
+  <Character id="3">
+    <name>Chandler Bing</name>
+    <age>36</age>
+  </Character>
+  <Character id="4">
+    <name>Ross Geller</name>
+    <age>37</age>
+  </Character>
+</Friends>
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix dcat: <http://www.w3.org/ns/dcat#> .
+@base <http://example.com/rules/> .
+
+<#DCATSourceAccess> a rml:Source, dcat:Distribution;
+  dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLSTC0007c/Friends.xml>;
+.
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source <#DCATSourceAccess>;
+    rml:referenceFormulation rml:XPath;
+    rml:iterator "//Friends/Character";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{@id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "name/text()";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "age/text()";
+    ];
+  ];
+.
+
+

Output

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
+<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
+
+
+

22. RMLSTC0007d

+

Title: Source with XPath reference formulation with namespaces

+

Description: Test source with XPath reference formulation with namespaces

+

Error expected? No

+

Input

+
<Friends xmlns:ex="http://example.org">
+  <ex:Character id="0">
+    <ex:name>Monica Geller</ex:name>
+    <ex:age>33</ex:age>
+  </ex:Character>
+  <ex:Character id="1">
+    <ex:name>Rachel Green</ex:name>
+    <ex:age>34</ex:age>
+  </ex:Character>
+  <ex:Character id="2">
+    <ex:name>Joey Tribbiani</ex:name>
+    <ex:age>35</ex:age>
+  </ex:Character>
+  <ex:Character id="3">
+    <ex:name>Chandler Bing</ex:name>
+    <ex:age>36</ex:age>
+  </ex:Character>
+  <ex:Character id="4">
+    <ex:name>Ross Geller</ex:name>
+    <ex:age>37</ex:age>
+  </ex:Character>
+</Friends>
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix dcat: <http://www.w3.org/ns/dcat#> .
+@base <http://example.com/rules/> .
+
+<#DCATSourceAccess> a rml:Source, dcat:Distribution;
+  dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLSTC0007d/Friends.xml>;
+.
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source <#DCATSourceAccess>;
+    rml:referenceFormulation [ a rml:XPathReferenceFormulation;
+      rml:namespace [ a rml:Namespace;
+        rml:namespacePrefix "ex";
+        rml:namespaceURL "http://example.org";
+      ];
+    ];
+    rml:iterator "//Friends/ex:Character";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{@id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "ex:name/text()";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "ex:age/text()";
+    ];
+  ];
+.
+
+

Output

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
+<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
+
+
+

23. RMLSTC0008a

+

Title: Multiple sources of same type

+

Description: Tests the generation of all triples from multiple homogeneous sources

+

Error expected? No

+

Input

+
[
+  { 
+    "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
+  }
+]
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix dcat: <http://www.w3.org/ns/dcat#> .
+@base <http://example.com/rules/> .
+
+<#DCATSourceAccess> a rml:Source, dcat:Distribution;
+  dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLSTC0008a/Friends.json>;
+  rml:encoding rml:UTF-8;
+.
+
+<#DCATSourceAccess2> a rml:Source, dcat:Distribution;
+  dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLSTC0008a/Friends2.json>;
+  rml:encoding rml:UTF-8;
+.
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source <#DCATSourceAccess>;
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+<#TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source <#DCATSourceAccess2>;
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+

Output

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
+<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
+<http://example.org/6> <http://xmlns.com/foaf/0.1/age> "37" .
+<http://example.org/6> <http://xmlns.com/foaf/0.1/name> "Phoebe Buffay" .
+
+
+

24. RMLSTC0008b

+

Title: Multiple sources of different type

+

Description: Tests the generation of all triples from multiple heterogeneous sources

+

Error expected? No

+

Input

+
[
+  { 
+    "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
+  }
+]
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix dcat: <http://www.w3.org/ns/dcat#> .
+@base <http://example.com/rules/> .
+
+<#DCATSourceAccessJSON> a rml:Source, dcat:Distribution;
+  dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLSTC0008b/Friends.json>;
+  rml:encoding rml:UTF-8;
+.
+
+<#DCATSourceAccessCSV> a rml:Source, dcat:Distribution;
+  dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLSTC0008b/Friends.csv>;
+  rml:encoding rml:UTF-8;
+.
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source <#DCATSourceAccessJSON>;
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+<#TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source <#DCATSourceAccessCSV>;
+    rml:referenceFormulation rml:CSV;
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "age";
+    ];
+  ];
+.
+
+

Output

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
+<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
+<http://example.org/6> <http://xmlns.com/foaf/0.1/age> "37" .
+<http://example.org/6> <http://xmlns.com/foaf/0.1/name> "Phoebe Buffay" .
+
+
+

25. RMLTTC0000

+

Title: Default target

+

Description: Test exporting all triples to the default Target when not Targets are specified.

+

Error expected? No

+

Input

+
[
+  { 
+    "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
+  }
+]
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix dcat: <http://www.w3.org/ns/dcat#> .
+@base <http://example.com/rules/> .
+
+<#DCATSourceAccess> a rml:Source, dcat:Distribution;
+    dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLTTC0000/Friends.json>;
+.
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source <#DCATSourceAccess>;
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+

Output

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
+<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
+
+
+

26. RMLTTC0001a

+

Title: Single Target: Subject Map

+

Description: Test exporting all triples to a single Target with a given subject.

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTTC0001a/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix dcat: <http://www.w3.org/ns/dcat#> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@base <http://example.com/rules/> .
+
+<#DCATSourceAccess> a rml:Source, dcat:Distribution;
+    dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLTTC0001a/Friends.json>;
+.
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source <#DCATSourceAccess>;
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+    rml:logicalTarget <#TargetDump1>;
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:Target, dcat:Distribution;
+    dcat:downloadURL <file://./dump1.nq>;
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+

Output 1

+

+
+

Output 2

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
+<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
+
+
+

27. RMLTTC0001b

+

Title: Single Target: Predicate Map

+

Description: Test exporting all triples to a single Target with a given predicate.

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTTC0001b/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix dcat: <http://www.w3.org/ns/dcat#> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@base <http://example.com/rules/> .
+
+<#DCATSourceAccess> a rml:Source, dcat:Distribution;
+    dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLTTC0001b/Friends.json>;
+.
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source <#DCATSourceAccess>;
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+      rml:logicalTarget <#TargetDump1>;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:Target, dcat:Distribution;
+    dcat:downloadURL <file://./dump1.nq>;
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+

Output 1

+
<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".
+
+

Output 2

+
<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" .
+
+
+

28. RMLTTC0001c

+

Title: Single Target: Object Map

+

Description: Test exporting all triples to a single Target with a given object reference.

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTTC0001c/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix dcat: <http://www.w3.org/ns/dcat#> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@base <http://example.com/rules/> .
+
+<#DCATSourceAccess> a rml:Source, dcat:Distribution;
+    dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLTTC0001c/Friends.json>;
+.
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source <#DCATSourceAccess>;
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+      rml:logicalTarget <#TargetDump1>;
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:Target, dcat:Distribution;
+    dcat:downloadURL <file://./dump1.nq>;
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+

Output 1

+
<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".
+
+

Output 2

+
<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" .
+
+
+

29. RMLTTC0001d

+

Title: Single Target: Graph Map

+

Description: Test exporting all triples within a named graph to a single Target.

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTTC0001d/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix dcat: <http://www.w3.org/ns/dcat#> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@prefix ex: <http://example.org/> .
+@base <http://example.com/rules/> .
+
+<#DCATSourceAccess> a rml:Source, dcat:Distribution;
+    dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLTTC0001d/Friends.json>;
+.
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source <#DCATSourceAccess>;
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+    rml:graphMap [ a rml:GraphMap;
+      rml:constant ex:PeopleGraph;
+      rml:logicalTarget <#TargetDump1>;
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:Target, dcat:Distribution;
+    dcat:downloadURL <file://./dump1.nq>;
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+

Output 1

+

+
+

Output 2

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" <http://example.org/PeopleGraph>.
+<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" <http://example.org/PeopleGraph> .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" <http://example.org/PeopleGraph> .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" <http://example.org/PeopleGraph> .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" <http://example.org/PeopleGraph> .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" <http://example.org/PeopleGraph> .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" <http://example.org/PeopleGraph> .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" <http://example.org/PeopleGraph> .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" <http://example.org/PeopleGraph> .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" <http://example.org/PeopleGraph> .
+
+
+

30. RMLTTC0001e

+

Title: Single Target: Language Map

+

Description: Test exporting all triples with a given language tag to a single Target.

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTTC0001e/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix dcat: <http://www.w3.org/ns/dcat#> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@base <http://example.com/rules/> .
+
+<#DCATSourceAccess> a rml:Source, dcat:Distribution;
+    dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLTTC0001e/Friends.json>;
+.
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source <#DCATSourceAccess>;
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+      rml:languageMap [ a rml:LanguageMap;
+        rml:constant "en";
+        rml:logicalTarget <#TargetDump1>;
+      ];
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:Target, dcat:Distribution;
+    dcat:downloadURL <file://./dump1.nq>;
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+

Output 1

+
<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".
+
+

Output 2

+
<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 .
+
+
+

31. RMLTTC0001f

+

Title: Single Target: Datatype Map

+

Description: Test exporting all triples with a given datatype to a single Target.

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTTC0001f/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix dcat: <http://www.w3.org/ns/dcat#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@base <http://example.com/rules/> .
+
+<#DCATSourceAccess> a rml:Source, dcat:Distribution;
+    dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLTTC0001f/Friends.json>;
+.
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source <#DCATSourceAccess>;
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+      rml:datatypeMap [ a rml:DatatypeMap;
+        rml:constant xsd:integer;
+        rml:logicalTarget <#TargetDump1>;
+      ];
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:Target, dcat:Distribution;
+    dcat:downloadURL <file://./dump1.nq>;
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+

Output 1

+
<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" .
+
+

Output 2

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33"^^<http://www.w3.org/2001/XMLSchema#integer>.
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34"^^<http://www.w3.org/2001/XMLSchema#integer>.
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35"^^<http://www.w3.org/2001/XMLSchema#integer>.
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36"^^<http://www.w3.org/2001/XMLSchema#integer>.
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37"^^<http://www.w3.org/2001/XMLSchema#integer>.
+
+
+

32. RMLTTC0002a

+

Title: Multiple Targets: Same Term Map

+

Description: Test exporting all triples to multiple Targets in the same Term Map.

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTTC0002a/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix dcat: <http://www.w3.org/ns/dcat#> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@base <http://example.com/rules/> .
+
+<#DCATSourceAccess> a rml:Source, dcat:Distribution;
+    dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLTTC0002a/Friends.json>;
+.
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source <#DCATSourceAccess>;
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+    rml:logicalTarget <#TargetDump1>;
+    rml:logicalTarget <#TargetDump2>;
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:Target, dcat:Distribution;
+    dcat:downloadURL <file://./dump1.nq>;
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+<#TargetDump2> a rml:LogicalTarget;
+  rml:target [ a rml:Target, dcat:Distribution;
+    dcat:downloadURL <file://./dump2.nq>;
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+

Output 1

+

+
+

Output 2

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
+<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
+
+

Output 3

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
+<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
+
+
+

33. RMLTTC0002b

+

Title: Multiple Targets: Subject Map and Predicate Map

+

Description: Test exporting all triples to a Target in a Subject Map and a Target in a Predicate Map.

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTTC0002b/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix dcat: <http://www.w3.org/ns/dcat#> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@base <http://example.com/rules/> .
+
+<#DCATSourceAccess> a rml:Source, dcat:Distribution;
+    dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLTTC0002b/Friends.json>;
+.
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source <#DCATSourceAccess>;
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+    rml:logicalTarget <#TargetDump1>;
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+      rml:logicalTarget <#TargetDump2>;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:Target, dcat:Distribution;
+    dcat:downloadURL <file://./dump1.nq>;
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+<#TargetDump2> a rml:LogicalTarget;
+  rml:target [ a rml:Target, dcat:Distribution;
+    dcat:downloadURL <file://./dump2.nq>;
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+

Output 1

+

+
+

Output 2

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
+<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
+
+

Output 3

+
<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" .
+
+
+

34. RMLTTC0002c

+

Title: Multiple Targets: Subject Map and Object Map

+

Description: Test exporting all triples to a Target in a Subject Map and a Target in a Object Map.

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTTC0002c/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix dcat: <http://www.w3.org/ns/dcat#> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@base <http://example.com/rules/> .
+
+<#DCATSourceAccess> a rml:Source, dcat:Distribution;
+    dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLTTC0002c/Friends.json>;
+.
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source <#DCATSourceAccess>;
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+    rml:logicalTarget <#TargetDump1>;
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+      rml:logicalTarget <#TargetDump2>;
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:Target, dcat:Distribution;
+    dcat:downloadURL <file://./dump1.nq>;
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+<#TargetDump2> a rml:LogicalTarget;
+  rml:target [ a rml:Target, dcat:Distribution;
+    dcat:downloadURL <file://./dump2.nq>;
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+

Output 1

+

+
+

Output 2

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
+<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
+
+

Output 3

+
<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" .
+
+
+

35. RMLTTC0002d

+

Title: Multiple Targets: Predicate Map and Object Map

+

Description: Test exporting all triples to a Target in a Predicate Map and a Target in a Object Map.

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTTC0002d/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix dcat: <http://www.w3.org/ns/dcat#> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@base <http://example.com/rules/> .
+
+<#DCATSourceAccess> a rml:Source, dcat:Distribution;
+    dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLTTC0002d/Friends.json>;
+.
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source <#DCATSourceAccess>;
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+      rml:logicalTarget <#TargetDump1>;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+      rml:logicalTarget <#TargetDump2>;
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:Target, dcat:Distribution;
+    dcat:downloadURL <file://./dump1.nq>;
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+<#TargetDump2> a rml:LogicalTarget;
+  rml:target [ a rml:Target, dcat:Distribution;
+    dcat:downloadURL <file://./dump2.nq>;
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+

Output 1

+

+
+

Output 2

+
<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" .
+
+

Output 3

+
<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" .
+
+
+

36. RMLTTC0002e

+

Title: Multiple Targets: Subject Map, Predicate Map, and Object Map

+

Description: Test exporting all triples to a Target in a Subject Map, a Target in a Predicate Map, and a Target in a Object Map.

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTTC0002e/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix dcat: <http://www.w3.org/ns/dcat#> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@base <http://example.com/rules/> .
+
+<#DCATSourceAccess> a rml:Source, dcat:Distribution;
+    dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLTTC0002e/Friends.json>;
+.
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source <#DCATSourceAccess>;
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+    rml:logicalTarget <#TargetDump3>;
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+      rml:logicalTarget <#TargetDump1>;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+      rml:logicalTarget <#TargetDump2>;
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:Target, dcat:Distribution;
+    dcat:downloadURL <file://./dump1.nq>;
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+<#TargetDump2> a rml:LogicalTarget;
+  rml:target [ a rml:Target, dcat:Distribution;
+    dcat:downloadURL <file://./dump2.nq>;
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+<#TargetDump3> a rml:LogicalTarget;
+  rml:target [ a rml:Target, dcat:Distribution;
+    dcat:downloadURL <file://./dump3.nq>;
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+

Output 1

+

+
+

Output 2

+
<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" .
+
+

Output 3

+
<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" .
+
+
+

37. RMLTTC0002f

+

Title: Multiple Targets: Subject Map and Graph Map

+

Description: Test exporting all triples to a Target in a Subject Map and a Target in a Graph Map.

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTTC0002f/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix dcat: <http://www.w3.org/ns/dcat#> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@prefix ex: <http://example.org> .
+@base <http://example.com/rules/> .
+
+<#DCATSourceAccess> a rml:Source, dcat:Distribution;
+    dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLTTC0002f/Friends.json>;
+.
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source <#DCATSourceAccess>;
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+    rml:logicalTarget <#TargetDump1>;
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:graphMap [ a rml:GraphMap;
+      rml:constant ex:PeopleGraph;
+      rml:logicalTarget <#TargetDump2>;
+    ];
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:Target, dcat:Distribution;
+    dcat:downloadURL <file://./dump1.nq>;
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+<#TargetDump2> a rml:LogicalTarget;
+  rml:target [ a rml:Target, dcat:Distribution;
+    dcat:downloadURL <file://./dump2.nq>;
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+

Output 1

+

+
+

Output 2

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" <http://example.org/PeopleGraph>.
+<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" <http://example.org/PeopleGraph> .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" <http://example.org/PeopleGraph> .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" <http://example.org/PeopleGraph> .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" <http://example.org/PeopleGraph> .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" <http://example.org/PeopleGraph> .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" <http://example.org/PeopleGraph> .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" <http://example.org/PeopleGraph> .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" <http://example.org/PeopleGraph> .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" <http://example.org/PeopleGraph> .
+
+

Output 3

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

38. RMLTTC0002g

+

Title: Multiple Targets: Predicate Map and Graph Map

+

Description: Test exporting all triples to a Target in a Predicate Map and a Target in a Graph Map.

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTTC0002g/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix dcat: <http://www.w3.org/ns/dcat#> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@prefix ex: <http://example.org> .
+@base <http://example.com/rules/> .
+
+<#DCATSourceAccess> a rml:Source, dcat:Distribution;
+    dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLTTC0002g/Friends.json>;
+.
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source <#DCATSourceAccess>;
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:graphMap [ a rml:GraphMap;
+      rml:constant ex:PeopleGraph;
+      rml:logicalTarget <#TargetDump2>;
+    ];
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+      rml:logicalTarget <#TargetDump1>;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:Target, dcat:Distribution;
+    dcat:downloadURL <file://./dump1.nq>;
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+<#TargetDump2> a rml:LogicalTarget;
+  rml:target [ a rml:Target, dcat:Distribution;
+    dcat:downloadURL <file://./dump2.nq>;
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+

Output 1

+

+
+

Output 2

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" <http://example.org/PeopleGraph>.
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" <http://example.org/PeopleGraph> .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" <http://example.org/PeopleGraph> .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" <http://example.org/PeopleGraph> .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" <http://example.org/PeopleGraph> .
+
+

Output 3

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

39. RMLTTC0002h

+

Title: Multiple Targets: Object Map and Graph Map

+

Description: Test exporting all triples to a Target in a Object Map and a Target in a Graph Map.

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTTC0002h/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix dcat: <http://www.w3.org/ns/dcat#> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@prefix ex: <http://example.org> .
+@base <http://example.com/rules/> .
+
+<#DCATSourceAccess> a rml:Source, dcat:Distribution;
+    dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLTTC0002h/Friends.json>;
+.
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source <#DCATSourceAccess>;
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:graphMap [ a rml:GraphMap;
+      rml:constant ex:PeopleGraph;
+      rml:logicalTarget <#TargetDump2>;
+    ];
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+      rml:logicalTarget <#TargetDump1>;
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:Target, dcat:Distribution;
+    dcat:downloadURL <file://./dump1.nq>;
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+<#TargetDump2> a rml:LogicalTarget;
+  rml:target [ a rml:Target, dcat:Distribution;
+    dcat:downloadURL <file://./dump2.nq>;
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+

Output 1

+

+
+

Output 2

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" <http://example.org/PeopleGraph>.
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" <http://example.org/PeopleGraph> .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" <http://example.org/PeopleGraph> .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" <http://example.org/PeopleGraph> .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" <http://example.org/PeopleGraph> .
+
+

Output 3

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

40. RMLTTC0002i

+

Title: Multiple Targets: Language Map and Graph Map

+

Description: Test exporting all triples to a Target in a Language Map and a Target in a Graph Map.

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTTC0002i/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix dcat: <http://www.w3.org/ns/dcat#> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@prefix ex: <http://example.org> .
+@base <http://example.com/rules/> .
+
+<#DCATSourceAccess> a rml:Source, dcat:Distribution;
+    dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLTTC0002i/Friends.json>;
+.
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source <#DCATSourceAccess>;
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+      rml:languageMap [ a rml:LanguageMap;
+        rml:constant "en";
+        rml:logicalTarget <#TargetDump2>;
+      ];
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:graphMap [ a rml:GraphMap;
+      rml:constant ex:PeopleGraph; 
+      rml:logicalTarget <#TargetDump1>;
+    ];
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:Target, dcat:Distribution;
+    dcat:downloadURL <file://./dump1.nq>;
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+<#TargetDump2> a rml:LogicalTarget;
+  rml:target [ a rml:Target, dcat:Distribution;
+    dcat:downloadURL <file://./dump2.nq>;
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+

Output 1

+

+
+

Output 2

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" <http://example.org/PeopleGraph> .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" <http://example.org/PeopleGraph> .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" <http://example.org/PeopleGraph> .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" <http://example.org/PeopleGraph> .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" <http://example.org/PeopleGraph> .
+
+

Output 3

+
<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 .
+
+
+

41. RMLTTC0002j

+

Title: Multiple Targets: Language Map and Object Map

+

Description: Test exporting all triples to a Target in a Language Map and a Target in a Object Map.

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTTC0002j/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix dcat: <http://www.w3.org/ns/dcat#> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@prefix ex: <http://example.org> .
+@base <http://example.com/rules/> .
+
+<#DCATSourceAccess> a rml:Source, dcat:Distribution;
+    dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLTTC0002j/Friends.json>;
+.
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source <#DCATSourceAccess>;
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+      rml:languageMap [ a rml:LanguageMap;
+        rml:constant "en";
+        rml:logicalTarget <#TargetDump2>;
+      ];
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+      rml:logicalTarget <#TargetDump1>;
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:Target, dcat:Distribution;
+    dcat:downloadURL <file://./dump1.nq>;
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+<#TargetDump2> a rml:LogicalTarget;
+  rml:target [ a rml:Target, dcat:Distribution;
+    dcat:downloadURL <file://./dump2.nq>;
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+

Output 1

+

+
+

Output 2

+
<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" .
+
+

Output 3

+
<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 .
+
+
+

42. RMLTTC0002k

+

Title: Multiple Targets: Datatype Map and Graph Map

+

Description: Test exporting all triples to a Target in a Datatype Map and a Target in a Graph Map.

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTTC0002k/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix dcat: <http://www.w3.org/ns/dcat#> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix ex: <http://example.org> .
+@base <http://example.com/rules/> .
+
+<#DCATSourceAccess> a rml:Source, dcat:Distribution;
+    dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLTTC0002k/Friends.json>;
+.
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source <#DCATSourceAccess>;
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:graphMap [ a rml:GraphMap;
+      rml:constant ex:PeopleGraph; 
+      rml:logicalTarget <#TargetDump1>;
+    ];
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+      rml:datatypeMap [ a rml:DatatypeMap;
+        rml:constant xsd:integer;
+        rml:logicalTarget <#TargetDump2>;
+      ];
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:Target, dcat:Distribution;
+    dcat:downloadURL <file://./dump1.nq>;
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+<#TargetDump2> a rml:LogicalTarget;
+  rml:target [ a rml:Target, dcat:Distribution;
+    dcat:downloadURL <file://./dump2.nq>;
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+

Output 1

+

+
+

Output 2

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33"^^<http://www.w3.org/2001/XMLSchema#integer> <http://example.org/PeopleGraph> .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34"^^<http://www.w3.org/2001/XMLSchema#integer> <http://example.org/PeopleGraph> .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35"^^<http://www.w3.org/2001/XMLSchema#integer> <http://example.org/PeopleGraph> .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36"^^<http://www.w3.org/2001/XMLSchema#integer> <http://example.org/PeopleGraph> .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37"^^<http://www.w3.org/2001/XMLSchema#integer> <http://example.org/PeopleGraph> .
+
+

Output 3

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33"^^<http://www.w3.org/2001/XMLSchema#integer> <http://example.org/PeopleGraph> .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34"^^<http://www.w3.org/2001/XMLSchema#integer> <http://example.org/PeopleGraph> .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35"^^<http://www.w3.org/2001/XMLSchema#integer> <http://example.org/PeopleGraph> .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36"^^<http://www.w3.org/2001/XMLSchema#integer> <http://example.org/PeopleGraph> .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37"^^<http://www.w3.org/2001/XMLSchema#integer> <http://example.org/PeopleGraph> .
+
+
+

43. RMLTTC0002l

+

Title: Multiple Targets: Datatype Map and Object Map

+

Description: Test exporting all triples to a Target in a Datatype Map and a Target in a Object Map.

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTTC0002l/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix dcat: <http://www.w3.org/ns/dcat#> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix ex: <http://example.org> .
+@base <http://example.com/rules/> .
+
+<#DCATSourceAccess> a rml:Source, dcat:Distribution;
+    dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLTTC0002l/Friends.json>;
+.
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source <#DCATSourceAccess>;
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+      rml:logicalTarget <#TargetDump1>;
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+      rml:datatypeMap [ a rml:DatatypeMap;
+        rml:constant xsd:integer;
+        rml:logicalTarget <#TargetDump2>;
+      ];
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:Target, dcat:Distribution;
+    dcat:downloadURL <file://./dump1.nq>;
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+<#TargetDump2> a rml:LogicalTarget;
+  rml:target [ a rml:Target, dcat:Distribution;
+    dcat:downloadURL <file://./dump2.nq>;
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+

Output 1

+

+
+

Output 2

+
<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" .
+
+

Output 3

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33"^^<http://www.w3.org/2001/XMLSchema#integer> <http://example.org/PeopleGraph> .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34"^^<http://www.w3.org/2001/XMLSchema#integer> <http://example.org/PeopleGraph> .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35"^^<http://www.w3.org/2001/XMLSchema#integer> <http://example.org/PeopleGraph> .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36"^^<http://www.w3.org/2001/XMLSchema#integer> <http://example.org/PeopleGraph> .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37"^^<http://www.w3.org/2001/XMLSchema#integer> <http://example.org/PeopleGraph> .
+
+
+

44. RMLTTC0002m

+

Title: Multiple Targets: Multiple Predicate Maps

+

Description: Test exporting all triples to Targets in multiple Predicate Maps.

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTTC0002m/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix dcat: <http://www.w3.org/ns/dcat#> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@base <http://example.com/rules/> .
+
+<#DCATSourceAccess> a rml:Source, dcat:Distribution;
+    dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLTTC0002m/Friends.json>;
+.
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source <#DCATSourceAccess>;
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+      rml:logicalTarget <#TargetDump1>;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+      rml:logicalTarget <#TargetDump2>;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:Target, dcat:Distribution;
+    dcat:downloadURL <file://./dump1.nq>;
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+<#TargetDump2> a rml:LogicalTarget;
+  rml:target [ a rml:Target, dcat:Distribution;
+    dcat:downloadURL <file://./dump2.nq>;
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+

Output 1

+
<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".
+
+

Output 2

+
<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" .
+
+

Output 3

+
<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" .
+
+
+

45. RMLTTC0002n

+

Title: Multiple Targets: Multiple Object Maps

+

Description: Test exporting all triples to Targets in multiple Object Maps.

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTTC0002n/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix dcat: <http://www.w3.org/ns/dcat#> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@base <http://example.com/rules/> .
+
+<#DCATSourceAccess> a rml:Source, dcat:Distribution;
+    dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLTTC0002n/Friends.json>;
+.
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source <#DCATSourceAccess>;
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+      rml:logicalTarget <#TargetDump1>;
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+      rml:logicalTarget <#TargetDump2>;
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:Target, dcat:Distribution;
+    dcat:downloadURL <file://./dump1.nq>;
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+<#TargetDump2> a rml:LogicalTarget;
+  rml:target [ a rml:Target, dcat:Distribution;
+    dcat:downloadURL <file://./dump2.nq>;
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+

Output 1

+
<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".
+
+

Output 2

+
<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" .
+
+

Output 3

+
<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" .
+
+
+

46. RMLTTC0002o

+

Title: Multiple Targets: Multiple Graph Maps

+

Description: Test exporting all triples to Targets in multiple Graph Maps.

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTTC0002o/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix dcat: <http://www.w3.org/ns/dcat#> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@prefix ex: <http://example.org/> .
+@base <http://example.com/rules/> .
+
+<#DCATSourceAccess> a rml:Source, dcat:Distribution;
+    dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLTTC0002o/Friends.json>;
+.
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source <#DCATSourceAccess>;
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+    rml:graphMap [ a rml:GraphMap;
+      rml:constant ex:PeopleGraph1;
+      rml:logicalTarget <#TargetDump1>;
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+    rml:graphMap [ a rml:GraphMap;
+      rml:constant ex:PeopleGraph1;
+      rml:logicalTarget <#TargetDump1>;
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:Target, dcat:Distribution;
+    dcat:downloadURL <file://./dump1.nq>;
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+

Output 1

+

+
+

Output 2

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" <http://example.org/PeopleGraph1>.
+<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" <http://example.org/PeopleGraph1> .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" <http://example.org/PeopleGraph1> .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" <http://example.org/PeopleGraph1> .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" <http://example.org/PeopleGraph1> .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" <http://example.org/PeopleGraph1> .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" <http://example.org/PeopleGraph1> .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" <http://example.org/PeopleGraph1> .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" <http://example.org/PeopleGraph1> .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" <http://example.org/PeopleGraph1> .
+
+

Output 3

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

47. RMLTTC0002p

+

Title: Multiple Targets: Multiple Language Maps

+

Description: Test exporting all triples to Targets in multiple Language Maps.

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTTC0002p/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix dcat: <http://www.w3.org/ns/dcat#> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@base <http://example.com/rules/> .
+
+<#DCATSourceAccess> a rml:Source, dcat:Distribution;
+    dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLTTC0002p/Friends.json>;
+.
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source <#DCATSourceAccess>;
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+      rml:languageMap [ a rml:LanguageMap;
+        rml:constant "en";
+        rml:logicalTarget <#TargetDump1>;
+      ];
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+      rml:languageMap [ a rml:LanguageMap;
+        rml:constant "nl";
+        rml:logicalTarget <#TargetDump2>;
+      ];
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:Target, dcat:Distribution;
+    dcat:downloadURL <file://./dump1.nq>;
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+<#TargetDump2> a rml:LogicalTarget;
+  rml:target [ a rml:Target, dcat:Distribution;
+    dcat:downloadURL <file://./dump2.nq>;
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+

Output 1

+
<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".
+
+

Output 2

+
<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 .
+
+

Output 3

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller"@nl .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green"@nl .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani"@nl .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing"@nl .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller"@nl .
+
+
+

48. RMLTTC0002q

+

Title: Multiple Targets: Multiple Datatype Maps

+

Description: Test exporting all triples to Targets in multiple Datatype Maps.

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTTC0002q/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix dcat: <http://www.w3.org/ns/dcat#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@base <http://example.com/rules/> .
+
+<#DCATSourceAccess> a rml:Source, dcat:Distribution;
+    dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLTTC0002q/Friends.json>;
+.
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source <#DCATSourceAccess>;
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+      rml:datatypeMap [ a rml:DatatypeMap;
+        rml:constant xsd:integer;
+        rml:logicalTarget <#TargetDump1>;
+      ];
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+      rml:datatypeMap [ a rml:DatatypeMap;
+        rml:constant xsd:double;
+        rml:logicalTarget <#TargetDump2>;
+      ];
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:Target, dcat:Distribution;
+    dcat:downloadURL <file://./dump1.nq>;
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+<#TargetDump2> a rml:LogicalTarget;
+  rml:target [ a rml:Target, dcat:Distribution;
+    dcat:downloadURL <file://./dump2.nq>;
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+

Output 1

+
<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" .
+
+

Output 2

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33"^^<http://www.w3.org/2001/XMLSchema#integer>.
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34"^^<http://www.w3.org/2001/XMLSchema#integer>.
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35"^^<http://www.w3.org/2001/XMLSchema#integer>.
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36"^^<http://www.w3.org/2001/XMLSchema#integer>.
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37"^^<http://www.w3.org/2001/XMLSchema#integer>.
+
+

Output 3

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33"^^<http://www.w3.org/2001/XMLSchema#double>.
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34"^^<http://www.w3.org/2001/XMLSchema#double>.
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35"^^<http://www.w3.org/2001/XMLSchema#double>.
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36"^^<http://www.w3.org/2001/XMLSchema#double>.
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37"^^<http://www.w3.org/2001/XMLSchema#double>.
+
+
+

49. RMLTTC0002r

+

Title: Multiple Targets: Multiple Term Maps with same Target

+

Description: Test exporting all triples to same Target in multiple Term Maps.

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTTC0002r/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix dcat: <http://www.w3.org/ns/dcat#> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@base <http://example.com/rules/> .
+
+<#DCATSourceAccess> a rml:Source, dcat:Distribution;
+    dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLTTC0002r/Friends.json>;
+.
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source <#DCATSourceAccess>;
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+      rml:logicalTarget <#TargetDump1>;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+      rml:logicalTarget <#TargetDump1>;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:Target, dcat:Distribution;
+    dcat:downloadURL <file://./dump1.nq>;
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+

Output 1

+
<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".
+
+

Output 2

+
<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" .
+<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" .
+
+
+

50. RMLTTC0003a

+

Title: Overriding Targets: Seperate Triples Map

+

Description: Test exporting some triples to a different Target with a separate Triples Map.

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTTC0003a/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix dcat: <http://www.w3.org/ns/dcat#> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@base <http://example.com/rules/> .
+
+<#DCATSourceAccess> a rml:Source, dcat:Distribution;
+    dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLTTC0003a/Friends.json>;
+.
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source <#DCATSourceAccess>;
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+    rml:logicalTarget <#TargetDump2>;
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+<#TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source <#DCATSourceAccess>;
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+    rml:logicalTarget <#TargetDump1>;
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:Target, dcat:Distribution;
+    dcat:downloadURL <file://./dump1.nq>;
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+<#TargetDump2> a rml:LogicalTarget;
+  rml:target [ a rml:Target, dcat:Distribution;
+    dcat:downloadURL <file://./dump2.nq>;
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+

Output 1

+

+
+

Output 2

+
<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" .
+
+

Output 3

+
<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" .
+
+
+

51. RMLTTC0004a

+

Title: Target JSON-LD

+

Description: Test export all triples as JSON-LD

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTTC0004a/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix dcat: <http://www.w3.org/ns/dcat#> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@base <http://example.com/rules/> .
+
+<#DCATSourceAccess> a rml:Source, dcat:Distribution;
+    dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLTTC0004a/Friends.json>;
+.
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source <#DCATSourceAccess>;
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+    rml:logicalTarget <#TargetDump1>;
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:Target, dcat:Distribution;
+    dcat:downloadURL <file://./dump1.jsonld>;
+  ];
+  rml:serialization formats:JSON-LD;
+.
+
+

Output 1

+

+
+

Output 2

+
{
+  "@context": { 
+    "foaf": "http://xmlns.com/foaf/0.1/"
+  },
+  "@graph": [
+    {                                                                                
+
+      "@id": "http://example.org/0",
+      "foaf:name": "Monica Geller",
+      "foaf:age": "33"
+    },
+    {                                                                                
+      "@id": "http://example.org/1",
+      "foaf:name": "Rachel Green",
+      "foaf:age": "34"
+    },
+    {                                                                                
+      "@id": "http://example.org/2",
+      "foaf:name": "Joey Tribbiani",
+      "foaf:age": "35"
+    },
+    {                                                                                
+      "@id": "http://example.org/3",
+      "foaf:name": "Chandler Bing",
+      "foaf:age": "36"
+    },
+      {                                                                                
+      "@id": "http://example.org/4",
+      "foaf:name": "Ross Geller",
+      "foaf:age": "37"
+    }
+  ]
+}
+
+
+

52. RMLTTC0004b

+

Title: Target N3

+

Description: Test export all triples as N3

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTTC0004b/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix dcat: <http://www.w3.org/ns/dcat#> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@base <http://example.com/rules/> .
+
+<#DCATSourceAccess> a rml:Source, dcat:Distribution;
+    dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLTTC0004b/Friends.json>;
+.
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source <#DCATSourceAccess>;
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+    rml:logicalTarget <#TargetDump1>;
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:Target, dcat:Distribution;
+    dcat:downloadURL <file://./dump1.n3>;
+  ];
+  rml:serialization formats:N3;
+.
+
+

Output 1

+

+
+

Output 2

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix ex: <http://example.org/> .
+ex:0 <foaf:age> "33" ;
+     <foaf:name> "Monica Geller" .
+ex:1 <foaf:age> "34" ;
+     <foaf:name> "Rachel Green" .
+ex:2 <foaf:age> "35" ;
+     <foaf:name> "Joey Tribbiani" .
+ex:3 <foaf:age> "36" ;
+     <foaf:name> "Chandler Bing" .
+ex:4 <foaf:age> "37" ;
+     <foaf:name> "Ross Geller" .
+
+
+

53. RMLTTC0004c

+

Title: Target N-Triples

+

Description: Test export all triples as N-Triples

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTTC0004c/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix dcat: <http://www.w3.org/ns/dcat#> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@base <http://example.com/rules/> .
+
+<#DCATSourceAccess> a rml:Source, dcat:Distribution;
+    dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLTTC0004c/Friends.json>;
+.
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source <#DCATSourceAccess>;
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+    rml:logicalTarget <#TargetDump1>;
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:Target, dcat:Distribution;
+    dcat:downloadURL <file://./dump1.nt>;
+  ];
+  rml:serialization formats:N-Triples;
+.
+
+

Output 1

+

+
+

Output 2

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
+<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
+
+
+

54. RMLTTC0004d

+

Title: Target N-Quads

+

Description: Test export all triples as N-Quads

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTTC0004d/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix dcat: <http://www.w3.org/ns/dcat#> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@base <http://example.com/rules/> .
+
+<#DCATSourceAccess> a rml:Source, dcat:Distribution;
+    dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLTTC0004d/Friends.json>;
+.
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source <#DCATSourceAccess>;
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+    rml:logicalTarget <#TargetDump1>;
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:Target, dcat:Distribution;
+    dcat:downloadURL <file://./dump1.nq>;
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+

Output 1

+

+
+

Output 2

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
+<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
+
+
+

55. RMLTTC0004e

+

Title: Target RDF/JSON

+

Description: Test export all triples as RDF/JSON

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTTC0004e/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix dcat: <http://www.w3.org/ns/dcat#> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@base <http://example.com/rules/> .
+
+<#DCATSourceAccess> a rml:Source, dcat:Distribution;
+    dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLTTC0004e/Friends.json>;
+.
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source <#DCATSourceAccess>;
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+    rml:logicalTarget <#TargetDump1>;
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:Target, dcat:Distribution;
+    dcat:downloadURL <file://./dump1.rdfjson>;
+  ];
+  rml:serialization formats:RDF_JSON;
+.
+
+

Output 1

+

+
+

Output 2

+
{
+    "http://example.org/0" : {
+        "http://xmlns.com/foaf/0.1/age" : [ { "value" : "33" } ],
+        "http://xmlns.com/foaf/0.1/name" : [ { "value" : "Monica Geller" } ]
+    },
+    "http://example.org/1" : {
+        "http://xmlns.com/foaf/0.1/age" : [ { "value" : "34" } ],
+        "http://xmlns.com/foaf/0.1/name" : [ { "value" : "Rachel Green" } ]
+    },
+    "http://example.org/2" : {
+        "http://xmlns.com/foaf/0.1/age" : [ { "value" : "35" } ],
+        "http://xmlns.com/foaf/0.1/name" : [ { "value" : "Joey Tribbiani" } ]
+    },
+    "http://example.org/3" : {
+        "http://xmlns.com/foaf/0.1/age" : [ { "value" : "36" } ],
+        "http://xmlns.com/foaf/0.1/name" : [ { "value" : "Chandler Bing" } ]
+    },
+    "http://example.org/4" : {
+        "http://xmlns.com/foaf/0.1/age" : [ { "value" : "37" } ],
+        "http://xmlns.com/foaf/0.1/name" : [ { "value" : "Ross Geller" } ]
+    }
+}
+
+
+

56. RMLTTC0004f

+

Title: Target RDF/XML

+

Description: Test export all triples as RDF/XML

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTTC0004f/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix dcat: <http://www.w3.org/ns/dcat#> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@base <http://example.com/rules/> .
+
+<#DCATSourceAccess> a rml:Source, dcat:Distribution;
+    dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLTTC0004f/Friends.json>;
+.
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source <#DCATSourceAccess>;
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+    rml:logicalTarget <#TargetDump1>;
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:Target, dcat:Distribution;
+    dcat:downloadURL <file://./dump1.rdfxml>;
+  ];
+  rml:serialization formats:RDF_XML;
+.
+
+

Output 1

+

+
+

Output 2

+
<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:age>33</foaf:age>
+    <foaf:name>Monica Geller</foaf:name>
+  </rdf:Description>
+  <rdf:Description rdf:about="http://example.org/1">
+    <foaf:age>34</foaf:age>
+    <foaf:name>Rachel Green</foaf:name>
+  </rdf:Description>
+  <rdf:Description rdf:about="http://example.org/2">
+    <foaf:age>35</foaf:age>
+    <foaf:name>Joey Tribbiani</foaf:name>
+  </rdf:Description>
+  <rdf:Description rdf:about="http://example.org/3">
+    <foaf:age>36</foaf:age>
+    <foaf:name>Chandler Bing</foaf:name>
+  </rdf:Description>
+  <rdf:Description rdf:about="http://example.org/4">
+    <foaf:age>37</foaf:age>
+    <foaf:name>Ross Geller</foaf:name>
+  </rdf:Description>
+</rdf:RDF>
+
+
+

57. RMLTTC0004g

+

Title: Target Turtle

+

Description: Test export all triples as Turtle

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTTC0004g/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix dcat: <http://www.w3.org/ns/dcat#> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@base <http://example.com/rules/> .
+
+<#DCATSourceAccess> a rml:Source, dcat:Distribution;
+    dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLTTC0004g/Friends.json>;
+.
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source <#DCATSourceAccess>;
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+    rml:logicalTarget <#TargetDump1>;
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:Target, dcat:Distribution;
+    dcat:downloadURL <file://./dump1.ttl>;
+  ];
+  rml:serialization formats:Turtle;
+.
+
+

Output 1

+

+
+

Output 2

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix ex: <http://example.org/> .
+
+<ex:0> <foaf:age> "33" .
+<ex:0> <foaf:name> "Monica Geller" .
+<ex:1> <foaf:age> "34" .
+<ex:1> <foaf:name> "Rachel Green" .
+<ex:2> <foaf:age> "35" .
+<ex:2> <foaf:name> "Joey Tribbiani" .
+<ex:3> <foaf:age> "36" .
+<ex:3> <foaf:name> "Chandler Bing" .
+<ex:4> <foaf:age> "37" .
+<ex:4> <foaf:name> "Ross Geller" .
+
+
+

58. RMLTTC0005a

+

Title: Target UTF-8

+

Description: Test export all triples with UTF-8 encoding

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTTC0005a/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix dcat: <http://www.w3.org/ns/dcat#> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@base <http://example.com/rules/> .
+
+<#DCATSourceAccess> a rml:Source, dcat:Distribution;
+    dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLTTC0005a/Friends.json>;
+.
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source <#DCATSourceAccess>;
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+    rml:logicalTarget <#TargetDump1>;
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:Target, dcat:Distribution;
+    dcat:downloadURL <file://./dump1.nq>;
+  ];
+  rml:serialization formats:N-Quads;
+  rml:encoding rml:UTF-8;
+.
+
+

Output 1

+

+
+

Output 2

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
+<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
+
+
+

59. RMLTTC0005b

+

Title: Target UTF-16

+

Description: Test export all triples with UTF-16 encoding

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTTC0005b/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix dcat: <http://www.w3.org/ns/dcat#> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@base <http://example.com/rules/> .
+
+<#DCATSourceAccess> a rml:Source, dcat:Distribution;
+    dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLTTC0005b/Friends.json>;
+.
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source <#DCATSourceAccess>;
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+    rml:logicalTarget <#TargetDump1>;
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:Target, dcat:Distribution;
+    dcat:downloadURL <file://./dump1.nq>;
+  ];
+  rml:serialization formats:N-Quads;
+  rml:encoding rml:UTF-16;
+.
+
+

Output 1

+

+
+

Output 2

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
+<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
+
+
+

60. RMLTTC0006a

+

Title: Target no compression

+

Description: Test export all triples with no compression

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTTC0006a/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix dcat: <http://www.w3.org/ns/dcat#> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@base <http://example.com/rules/> .
+
+<#DCATSourceAccess> a rml:Source, dcat:Distribution;
+    dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLTTC0006a/Friends.json>;
+.
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source <#DCATSourceAccess>;
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+    rml:logicalTarget <#TargetDump1>;
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:Target, dcat:Distribution;
+    dcat:downloadURL <file://./dump1.nq>;
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+

Output 1

+

+
+

Output 2

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
+<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
+
+
+

61. RMLTTC0006b

+

Title: Target GZip compression

+

Description: Test export all triples with GZip compression

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTTC0006b/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix dcat: <http://www.w3.org/ns/dcat#> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@base <http://example.com/rules/> .
+
+<#DCATSourceAccess> a rml:Source, dcat:Distribution;
+    dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLTTC0006b/Friends.json>;
+.
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source <#DCATSourceAccess>;
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+    rml:logicalTarget <#TargetDump1>;
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:Target, dcat:Distribution;
+    dcat:downloadURL <file://./dump1.nq.gz>;
+  ];
+  rml:serialization formats:N-Quads;
+  rml:compression rml:gzip;
+.
+
+

Output 1

+

+
+

Output 2 + dump1.nq.gz

+
+

62. RMLTTC0006c

+

Title: Target Zip compression

+

Description: Test export all triples with ZIP compression

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTTC0006c/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix dcat: <http://www.w3.org/ns/dcat#> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@base <http://example.com/rules/> .
+
+<#DCATSourceAccess> a rml:Source, dcat:Distribution;
+    dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLTTC0006c/Friends.json>;
+.
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source <#DCATSourceAccess>;
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+    rml:logicalTarget <#TargetDump1>;
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:Target, dcat:Distribution;
+    dcat:downloadURL <file://./dump1.nq.zip>;
+  ];
+  rml:serialization formats:N-Quads;
+  rml:compression rml:zip;
+.
+
+

Output 1

+

+
+

Output 2 + dump1.nq.zip

+
+

63. RMLTTC0006d

+

Title: Target TarXz compression

+

Description: Test export all triples with TarXZ compression

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTTC0006d/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix dcat: <http://www.w3.org/ns/dcat#> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@prefix ex: <http://example.org/> .
+@base <http://example.com/rules/> .
+
+<#DCATSourceAccess> a rml:Source, dcat:Distribution;
+    dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLTTC0006d/Friends.json>;
+.
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source <#DCATSourceAccess>;
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+    rml:logicalTarget <#TargetDump1>;
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:Target, dcat:Distribution;
+    dcat:downloadURL <file://./dump1.nq.tar.xz>;
+  ];
+  rml:serialization formats:N-Quads;
+  rml:compression rml:tarxz;
+.
+
+

Output 1

+

+
+

Output 2 + dump1.nq.tar.xz

+
+

64. RMLTTC0006e

+

Title: Target TarGzip compression

+

Description: Test export all triples with TarGZip compression

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTTC0006e/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix dcat: <http://www.w3.org/ns/dcat#> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@base <http://example.com/rules/> .
+
+<#DCATSourceAccess> a rml:Source, dcat:Distribution;
+    dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLTTC0006e/Friends.json>;
+.
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source <#DCATSourceAccess>;
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+    rml:logicalTarget <#TargetDump1>;
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:Target, dcat:Distribution;
+    dcat:downloadURL <file://./dump1.nq.tar.gz>;
+  ];
+  rml:serialization formats:N-Quads;
+  rml:compression rml:targz;
+.
+
+

Output 1

+

+
+

Output 2 + dump1.nq.tar.gz

+
+

65. RMLTTC0007a

+

Title: Target with FilePath description

+

Description: Test export all triples to a target with File path access description

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLTTC0007a/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@base <http://example.com/rules/> .
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath, rml:Source;
+      rml:root rml:CurrentWorkingDirectory;
+      rml:path "./Friends.json";
+    ];
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+    rml:logicalTarget <#TargetDump1>;
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:Target, rml:FilePath;
+    rml:root rml:CurrentWorkingDirectory;
+    rml:path "./dump1.nq";
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+

Output 1

+

+
+

Output 2

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
+<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
+
+
+ + + + + \ No newline at end of file diff --git a/src/test/resources/rml-io/docs/20250228/index.html b/src/test/resources/rml-io/docs/20250228/index.html new file mode 100644 index 00000000..87cb8a9c --- /dev/null +++ b/src/test/resources/rml-io/docs/20250228/index.html @@ -0,0 +1,6190 @@ + + + + + + +RML-IO: Test Cases + + + + + + + + + + + + + + +
+ +

RML-IO: Test Cases

+

+ Draft Community Group Report + +

+
+ +
Latest published version:
+ https://www.w3.org/RML-IO-Testcases/ +
+
Latest editor's draft:
https://w3id.org/rml/io/test-cases/
+ + + + +
Editor:
+ Dylan Van Assche + + + + (IDLab – Ghent University – imec) +
+ +
Author:
+ Dylan Van Assche + + + + (IDLab – Ghent University – imec) +
+
Feedback:
+ GitHub kg-construct/rml-io + (pull requests, + new issue, + open issues) +
+ +
+ + +
+
+ + + +

Abstract

This document defines the RML-IO test cases to the determine the RML-IO specification conformance of tools.

+
+ +

Status of This Document

+ This specification was published by the + Knowledge Graph Construction Community Group. It is not a W3C Standard nor is it + on the W3C Standards Track. + + Please note that under the + W3C Community Contributor License Agreement (CLA) + there is a limited opt-out and other conditions apply. + + Learn more about + W3C Community and Business Groups. +

+ GitHub Issues are preferred for + discussion of this specification. + + +

+ +

1. Introduction

+

This document defines the RML-IO test cases, consisting of a collection of test case documents (input and expected output). +The purpose of the test cases is to determine the conformance of tools that execute RML rules to the RML-IO specification.

+
+ +

2. Data model

+

The test cases are semantically described for re-usability and shareability following the W3C Test case description. +Each test:Testcase as the following properties:

+
    +
  • dcterms:identifier: unique ID of the test case.
  • +
  • rmltest:hasError: if an error of the RML Processor is expected or not.
  • +
  • rmltest:input: One or more input data of the test case.
  • +
  • rmltest:output: One or more output data of the test case.
  • +
  • rmltest:inputFormat: the input data format.
  • +
  • rmltest:outputFormat: the output data format.
  • +
  • rmltest:mappingDocument: the RML mapping rules in Turtle.
  • +
+
+ +

3. Test cases

+

This section describes the RML-IO test cases. These descriptions are also available as RDF. +The files are available on GitHub in the folder test-cases. +Each test case is contained in a single folder, containing three types of files:

+
    +
  • Zero or more files containing the data sources, in the case of JSON, XML, CSV, or containing the SQL statements to create the necessary tables, in the case of MySQL, PostgreSQL, and SQL Server.
  • +
  • One file with the RML rules, called mapping.ttl, in the Turtle format.
  • +
  • Zero or more files with the expected RDF. No file is provided if an error is expected that must halt the generation of the RDF because of an error.
  • +
+
+ + +

4. RMLSTC0001a

+

Title: Source with UTF-8 encoding

+

Description: Test source with UTF-8 encoding

+

Error expected? No

+

Input

+
[
+  { 
+    "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
+  }
+]
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@base <http://example.com/rules/> .
+
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "Friends.json"
+    ];
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+

Output

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
+<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
+
+
+

5. RMLSTC0001b

+

Title: Source with UTF-16 encoding

+

Description: Test source with UTF-16 encoding

+

Error expected? No

+

Input

+
[
+  { 
+    "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
+  }
+]
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@base <http://example.com/rules/> .
+
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "Friends-UTF16.json"
+    ];
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+

Output

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
+<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
+
+
+

6. RMLSTC0002a

+

Title: Source no compression

+

Description: Test source without compression

+

Error expected? No

+

Input

+
[
+  { 
+    "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
+  }
+]
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@base <http://example.com/rules/> .
+
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "Friends.json"
+    ];
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+

Output

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
+<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
+
+
+

7. RMLSTC0002b

+

Title: Source GZip compression

+

Description: Test source with GZip compression

+

Error expected? No

+

Input + Friends.json.gz

+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@base <http://example.com/rules/> .
+
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "Friends.json.gz";
+      rml:compression rml:gzip;
+    ];
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+

Output

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
+<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
+
+
+

8. RMLSTC0002c

+

Title: Source Zip compression

+

Description: Test source with ZIP compression

+

Error expected? No

+

Input + Friends.json.zip

+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@base <http://example.com/rules/> .
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "Friends.json.zip";
+      rml:compression rml:zip;
+    ];
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+

Output

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
+<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
+
+
+

9. RMLSTC0002d

+

Title: Source TarXz compression

+

Description: Test source with TarXZ compression

+

Error expected? No

+

Input + Friends.json.tar.xz

+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@base <http://example.com/rules/> .
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "Friends.json.tar.xz";
+      rml:compression rml:tarxz;
+    ];
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+

Output

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
+<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
+
+
+

10. RMLSTC0002e

+

Title: Source TarGzip compression

+

Description: Test source with TarGZip compression

+

Error expected? No

+

Input + Friends.json.tar.gz

+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@base <http://example.com/rules/> .
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "Friends.json.tar.gz";
+      rml:compression rml:targz;
+    ];
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+

Output

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
+<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
+
+
+

11. RMLSTC0003

+

Title: Source with query

+

Description: Test source which requires a query

+

Error expected? No

+

Input

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
+<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@base <http://example.com/rules/> .
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+        rml:path "./Friends.nt";
+    ];
+    rml:iterator """
+    PREFIX foaf: <http://xmlns.com/foaf/0.1/>
+
+    SELECT ?person ?name ?age WHERE {
+        ?person foaf:name ?name .
+        ?person foaf:age ?age .
+    }
+    """;
+    rml:referenceFormulation formats:SPARQL_Results_CSV;
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:reference "person";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "age";
+    ];
+  ];
+.
+
+

Output

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
+<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
+
+
+

12. RMLSTC0004a

+

Title: Source with default NULL values

+

Description: Test source with default NULL values

+

Error expected? No

+

Input

+
id,name,age
+0,Monica Geller,33
+1,Rachel Green,34
+2,Joey Tribbiani,35
+3,Chandler Bing,36
+4,Ross Geller,37
+5,,
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@base <http://example.com/rules/> .
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "Friends-NULL.csv";
+    ];
+    rml:referenceFormulation rml:CSV;
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "age";
+    ];
+  ];
+.
+
+

Output

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
+<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
+
+
+

13. RMLSTC0004b

+

Title: Source with one NULL value

+

Description: Test source with one NULL value defined

+

Error expected? No

+

Input

+
id,name,age
+0,Monica Geller,33
+1,Rachel Green,34
+2,Joey Tribbiani,35
+3,Chandler Bing,36
+4,Ross Geller,37
+5,,
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@base <http://example.com/rules/> .
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "Friends-NULL.csv";
+      rml:null "";
+    ];
+    rml:referenceFormulation rml:CSV;
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "age";
+    ];
+  ];
+.
+
+

Output

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
+<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
+
+
+

14. RMLSTC0004c

+

Title: Source with multiple NULL values

+

Description: Test source with multiple NULL values defined

+

Error expected? No

+

Input

+
id,name,age
+0,Monica Geller,33
+1,Rachel Green,34
+2,Joey Tribbiani,35
+3,Chandler Bing,36
+4,Ross Geller,37
+5,,
+6,NULL,NULL
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@base <http://example.com/rules/> .
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "Friends-NULL.csv";
+      rml:null "";
+      rml:null "NULL";
+    ];
+    rml:referenceFormulation rml:CSV;
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "age";
+    ];
+  ];
+.
+
+

Output

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
+<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
+
+
+
+ + + + Error response + + +

Error response

+

Error code: 404

+

Message: File not found.

+

Error code explanation: 404 - Nothing matches the given URI.

+ +
+
+ + + + Error response + + +

Error response

+

Error code: 404

+

Message: File not found.

+

Error code explanation: 404 - Nothing matches the given URI.

+ +
+

15. RMLSTC0006a

+

Title: Source with D2RQ access description

+

Description: Test source with D2RQ access description for SQL databases

+

Error expected? No

+

Input

+
id, name, age
+0, Monica Geller, 33
+1, Rachel Green, 34
+2, Joey Tribbiani, 35
+3, Chandler Bing, 36
+4, Ross Geller, 37
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@base <http://example.com/rules/> .
+
+<#D2RQSourceAccess> a rml:Source, d2rq:Database;
+  d2rq:jdbcDSN "$CONNECTIONDSN";
+  d2rq:username "$USERNAME";
+  d2rq:password "$PASSWORD"
+.
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source <#D2RQSourceAccess>;
+    rml:referenceFormulation rml:SQL2008Table;
+    rml:iterator "Friends";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "age";
+    ];
+  ];
+.
+
+

Output

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
+<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
+
+
+

16. RMLSTC0006b

+

Title: Source with a Relative Path Source

+

Description: Test access to a file

+

Error expected? No

+

Input

+
id, name, age
+0, Monica Geller, 33
+1, Rachel Green, 34
+2, Joey Tribbiani, 35
+3, Chandler Bing, 36
+4, Ross Geller, 37
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@base <http://example.com/rules/> .
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath, rml:Source;
+      rml:root rml:CurrentWorkingDirectory;
+      rml:path "./Friends.csv"
+    ];
+    rml:referenceFormulation rml:CSV;
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "age";
+    ];
+  ];
+.
+
+

Output

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
+<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
+
+
+

17. RMLSTC0007a

+

Title: Source with JSONPath reference formulation

+

Description: Test source with JSONPath reference formulation

+

Error expected? No

+

Input

+
[
+  { 
+    "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
+  }
+]
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@base <http://example.com/rules/> .
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "Friends.json";
+      rml:encoding rml:UTF-8
+    ];
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+

Output

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
+<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
+
+
+

18. RMLSTC0007b

+

Title: Source with CSV reference formulation

+

Description: Test source with Tabular reference formulation

+

Error expected? No

+

Input

+
id,name,age
+0,Monica Geller,33
+1,Rachel Green,34
+2,Joey Tribbiani,35
+3,Chandler Bing,36
+4,Ross Geller,37
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@base <http://example.com/rules/> .
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "Friends.csv";
+    ];
+    rml:referenceFormulation rml:CSV;
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "age";
+    ];
+  ];
+.
+
+

Output

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
+<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
+
+
+

19. RMLSTC0007c

+

Title: Source with XPath reference formulation

+

Description: Test source with XPath reference formulation

+

Error expected? No

+

Input

+
<Friends>
+  <Character id="0">
+    <name>Monica Geller</name>
+    <age>33</age>
+  </Character>
+  <Character id="1">
+    <name>Rachel Green</name>
+    <age>34</age>
+  </Character>
+  <Character id="2">
+    <name>Joey Tribbiani</name>
+    <age>35</age>
+  </Character>
+  <Character id="3">
+    <name>Chandler Bing</name>
+    <age>36</age>
+  </Character>
+  <Character id="4">
+    <name>Ross Geller</name>
+    <age>37</age>
+  </Character>
+</Friends>
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@base <http://example.com/rules/> .
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "Friends.xml"
+    ];
+    rml:referenceFormulation rml:XPath;
+    rml:iterator "//Friends/Character";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{@id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "name/text()";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "age/text()";
+    ];
+  ];
+.
+
+

Output

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
+<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
+
+
+

20. RMLSTC0007d

+

Title: Source with XPath reference formulation with namespaces

+

Description: Test source with XPath reference formulation with namespaces

+

Error expected? No

+

Input

+
<Friends xmlns:ex="http://example.org">
+  <ex:Character id="0">
+    <ex:name>Monica Geller</ex:name>
+    <ex:age>33</ex:age>
+  </ex:Character>
+  <ex:Character id="1">
+    <ex:name>Rachel Green</ex:name>
+    <ex:age>34</ex:age>
+  </ex:Character>
+  <ex:Character id="2">
+    <ex:name>Joey Tribbiani</ex:name>
+    <ex:age>35</ex:age>
+  </ex:Character>
+  <ex:Character id="3">
+    <ex:name>Chandler Bing</ex:name>
+    <ex:age>36</ex:age>
+  </ex:Character>
+  <ex:Character id="4">
+    <ex:name>Ross Geller</ex:name>
+    <ex:age>37</ex:age>
+  </ex:Character>
+</Friends>
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@base <http://example.com/rules/> .
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "Friends.xml"
+    ];
+    rml:referenceFormulation [ a rml:XPathReferenceFormulation;
+      rml:namespace [ a rml:Namespace;
+        rml:namespacePrefix "ex";
+        rml:namespaceURL "http://example.org";
+      ];
+    ];
+    rml:iterator "//Friends/ex:Character";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{@id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "ex:name/text()";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "ex:age/text()";
+    ];
+  ];
+.
+
+

Output

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
+<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
+
+
+

21. RMLSTC0008a

+

Title: Multiple sources of same type

+

Description: Tests the generation of all triples from multiple homogeneous sources

+

Error expected? No

+

Input

+
[
+  { 
+    "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
+  }
+]
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@base <http://example.com/rules/> .
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "Friends.json";
+      rml:encoding rml:UTF-8
+    ];
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+<#TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:RelativePathSource;
+      rml:root rml:MappingDirectory;
+      rml:path "Friends2.json";
+      rml:encoding rml:UTF-8
+    ];
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+

Output

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
+<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
+<http://example.org/6> <http://xmlns.com/foaf/0.1/age> "37" .
+<http://example.org/6> <http://xmlns.com/foaf/0.1/name> "Phoebe Buffay" .
+
+
+

22. RMLSTC0008b

+

Title: Multiple sources of different type

+

Description: Tests the generation of all triples from multiple heterogeneous sources

+

Error expected? No

+

Input

+
[
+  { 
+    "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
+  }
+]
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@base <http://example.com/rules/> .
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "Friends.json";
+      rml:encoding rml:UTF-8
+    ];
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+<#TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:RelativePathSource;
+      rml:root rml:MappingDirectory;
+      rml:path "Friends.csv";
+      rml:encoding rml:UTF-8
+    ];
+    rml:referenceFormulation rml:CSV;
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "age";
+    ];
+  ];
+.
+
+

Output

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
+<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
+<http://example.org/6> <http://xmlns.com/foaf/0.1/age> "37" .
+<http://example.org/6> <http://xmlns.com/foaf/0.1/name> "Phoebe Buffay" .
+
+
+

23. RMLTTC0000

+

Title: Default target

+

Description: Test exporting all triples to the default Target when not Targets are specified.

+

Error expected? No

+

Input

+
[
+  { 
+    "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
+  }
+]
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@base <http://example.com/rules/> .
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "Friends.json";
+      rml:encoding rml:UTF-8
+    ];
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+

Output

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
+<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
+
+
+

24. RMLTTC0001a

+

Title: Single Target: Subject Map

+

Description: Test exporting all triples to a single Target with a given subject.

+

Error expected? No

+

Input

+
[
+  { 
+    "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
+  }
+]
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@base <http://example.com/rules/> .
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "Friends.json";
+    ];
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+    rml:logicalTarget <#TargetDump1>;
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:FilePath;
+    rml:root rml:CurrentWorkingDirectory;
+    rml:path "./dump1.nq";
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+

Output 1

+

+
+

Output 2

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
+<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
+
+
+

25. RMLTTC0001b

+

Title: Single Target: Predicate Map

+

Description: Test exporting all triples to a single Target with a given predicate.

+

Error expected? No

+

Input

+
[
+  { 
+    "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
+  }
+]
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@base <http://example.com/rules/> .
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "Friends.json";
+    ];
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+      rml:logicalTarget <#TargetDump1>;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:FilePath;
+    rml:root rml:CurrentWorkingDirectory;
+    rml:path "./dump1.nq";
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+

Output 1

+
<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".
+
+

Output 2

+
<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" .
+
+
+

26. RMLTTC0001c

+

Title: Single Target: Object Map

+

Description: Test exporting all triples to a single Target with a given object reference.

+

Error expected? No

+

Input

+
[
+  { 
+    "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
+  }
+]
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@base <http://example.com/rules/> .
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "Friends.json";
+    ];
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+      rml:logicalTarget <#TargetDump1>;
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:FilePath;
+    rml:root rml:CurrentWorkingDirectory;
+    rml:path "./dump1.nq";
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+

Output 1

+
<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".
+
+

Output 2

+
<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" .
+
+
+

27. RMLTTC0001d

+

Title: Single Target: Graph Map

+

Description: Test exporting all triples within a named graph to a single Target.

+

Error expected? No

+

Input

+
[
+  { 
+    "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
+  }
+]
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix dcat: <http://www.w3.org/ns/dcat#> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@prefix ex: <http://example.org/> .
+@base <http://example.com/rules/> .
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "Friends.json";
+    ];
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+    rml:graphMap [ a rml:GraphMap;
+      rml:constant ex:PeopleGraph;
+      rml:logicalTarget <#TargetDump1>;
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:FilePath;
+    rml:root rml:CurrentWorkingDirectory;
+    rml:path "./dump1.nq";
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+

Output 1

+

+
+

Output 2

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" <http://example.org/PeopleGraph>.
+<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" <http://example.org/PeopleGraph> .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" <http://example.org/PeopleGraph> .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" <http://example.org/PeopleGraph> .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" <http://example.org/PeopleGraph> .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" <http://example.org/PeopleGraph> .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" <http://example.org/PeopleGraph> .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" <http://example.org/PeopleGraph> .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" <http://example.org/PeopleGraph> .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" <http://example.org/PeopleGraph> .
+
+
+

28. RMLTTC0001e

+

Title: Single Target: Language Map

+

Description: Test exporting all triples with a given language tag to a single Target.

+

Error expected? No

+

Input

+
[
+  { 
+    "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
+  }
+]
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@base <http://example.com/rules/> .
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "Friends.json";
+    ];
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+      rml:languageMap [ a rml:LanguageMap;
+        rml:constant "en";
+        rml:logicalTarget <#TargetDump1>;
+      ];
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:FilePath;
+    rml:root rml:CurrentWorkingDirectory;
+    rml:path "./dump1.nq";
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+

Output 1

+
<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".
+
+

Output 2

+
<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 .
+
+
+

29. RMLTTC0001f

+

Title: Single Target: Datatype Map

+

Description: Test exporting all triples with a given datatype to a single Target.

+

Error expected? No

+

Input

+
[
+  { 
+    "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
+  }
+]
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@base <http://example.com/rules/> .
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "Friends.json";
+    ];
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+      rml:datatypeMap [ a rml:DatatypeMap;
+        rml:constant xsd:integer;
+        rml:logicalTarget <#TargetDump1>;
+      ];
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:FilePath;
+    rml:root rml:CurrentWorkingDirectory;
+    rml:path "./dump1.nq";
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+

Output 1

+
<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" .
+
+

Output 2

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33"^^<http://www.w3.org/2001/XMLSchema#integer>.
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34"^^<http://www.w3.org/2001/XMLSchema#integer>.
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35"^^<http://www.w3.org/2001/XMLSchema#integer>.
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36"^^<http://www.w3.org/2001/XMLSchema#integer>.
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37"^^<http://www.w3.org/2001/XMLSchema#integer>.
+
+
+

30. RMLTTC0002a

+

Title: Multiple Targets: Same Term Map

+

Description: Test exporting all triples to multiple Targets in the same Term Map.

+

Error expected? No

+

Input

+
[
+  { 
+    "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
+  }
+]
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@base <http://example.com/rules/> .
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "Friends.json";
+    ];
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+    rml:logicalTarget <#TargetDump1>;
+    rml:logicalTarget <#TargetDump2>;
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:FilePath;
+    rml:root rml:CurrentWorkingDirectory;
+    rml:path "./dump1.nq";
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+<#TargetDump2> a rml:LogicalTarget;
+  rml:target [ a rml:FilePath;
+    rml:root rml:CurrentWorkingDirectory;
+    rml:path "./dump2.nq";
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+

Output 1

+

+
+

Output 2

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
+<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
+
+

Output 3

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
+<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
+
+
+

31. RMLTTC0002b

+

Title: Multiple Targets: Subject Map and Predicate Map

+

Description: Test exporting all triples to a Target in a Subject Map and a Target in a Predicate Map.

+

Error expected? No

+

Input

+
[
+  { 
+    "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
+  }
+]
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@base <http://example.com/rules/> .
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "Friends.json";
+    ];
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+    rml:logicalTarget <#TargetDump1>;
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+      rml:logicalTarget <#TargetDump2>;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:FilePath;
+    rml:root rml:CurrentWorkingDirectory;
+    rml:path "./dump1.nq";
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+<#TargetDump2> a rml:LogicalTarget;
+  rml:target [ a rml:FilePath;
+    rml:root rml:CurrentWorkingDirectory;
+    rml:path "./dump2.nq";
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+

Output 1

+

+
+

Output 2

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
+<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
+
+

Output 3

+
<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" .
+
+
+

32. RMLTTC0002c

+

Title: Multiple Targets: Subject Map and Object Map

+

Description: Test exporting all triples to a Target in a Subject Map and a Target in a Object Map.

+

Error expected? No

+

Input

+
[
+  { 
+    "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
+  }
+]
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@base <http://example.com/rules/> .
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "Friends.json";
+    ];
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+    rml:logicalTarget <#TargetDump1>;
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+      rml:logicalTarget <#TargetDump2>;
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:FilePath;
+    rml:root rml:CurrentWorkingDirectory;
+    rml:path "./dump1.nq";
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+<#TargetDump2> a rml:LogicalTarget;
+  rml:target [ a rml:FilePath;
+    rml:root rml:CurrentWorkingDirectory;
+    rml:path "./dump2.nq";
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+

Output 1

+

+
+

Output 2

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
+<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
+
+

Output 3

+
<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" .
+
+
+

33. RMLTTC0002d

+

Title: Multiple Targets: Predicate Map and Object Map

+

Description: Test exporting all triples to a Target in a Predicate Map and a Target in a Object Map.

+

Error expected? No

+

Input

+
[
+  { 
+    "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
+  }
+]
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@base <http://example.com/rules/> .
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "Friends.json";
+    ];
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+      rml:logicalTarget <#TargetDump1>;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+      rml:logicalTarget <#TargetDump2>;
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:FilePath;
+    rml:root rml:CurrentWorkingDirectory;
+    rml:path "./dump1.nq";
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+<#TargetDump2> a rml:LogicalTarget;
+  rml:target [ a rml:FilePath;
+    rml:root rml:CurrentWorkingDirectory;
+    rml:path "./dump2.nq";
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+

Output 1

+

+
+

Output 2

+
<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" .
+
+

Output 3

+
<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" .
+
+
+

34. RMLTTC0002e

+

Title: Multiple Targets: Subject Map, Predicate Map, and Object Map

+

Description: Test exporting all triples to a Target in a Subject Map, a Target in a Predicate Map, and a Target in a Object Map.

+

Error expected? No

+

Input

+
[
+  { 
+    "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
+  }
+]
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@base <http://example.com/rules/> .
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "Friends.json";
+    ];
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+    rml:logicalTarget <#TargetDump3>;
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+      rml:logicalTarget <#TargetDump1>;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+      rml:logicalTarget <#TargetDump2>;
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:FilePath;
+    rml:root rml:CurrentWorkingDirectory;
+    rml:path "./dump1.nq";
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+<#TargetDump2> a rml:LogicalTarget;
+  rml:target [ a rml:FilePath;
+    rml:root rml:CurrentWorkingDirectory;
+    rml:path "./dump2.nq";
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+<#TargetDump3> a rml:LogicalTarget;
+  rml:target [ a rml:FilePath;
+    rml:root rml:CurrentWorkingDirectory;
+    rml:path "./dump3.nq";
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+

Output 1

+

+
+

Output 2

+
<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" .
+
+

Output 3

+
<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" .
+
+
+

35. RMLTTC0002f

+

Title: Multiple Targets: Subject Map and Graph Map

+

Description: Test exporting all triples to a Target in a Subject Map and a Target in a Graph Map.

+

Error expected? No

+

Input

+
[
+  { 
+    "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
+  }
+]
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@prefix ex: <http://example.org> .
+@base <http://example.com/rules/> .
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "Friends.json";
+    ];
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+    rml:logicalTarget <#TargetDump1>;
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:graphMap [ a rml:GraphMap;
+      rml:constant ex:PeopleGraph;
+      rml:logicalTarget <#TargetDump2>;
+    ];
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:FilePath;
+    rml:root rml:CurrentWorkingDirectory;
+    rml:path "./dump1.nq";
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+<#TargetDump2> a rml:LogicalTarget;
+  rml:target [ a rml:FilePath;
+    rml:root rml:CurrentWorkingDirectory;
+    rml:path "./dump2.nq";
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+

Output 1

+

+
+

Output 2

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" <http://example.org/PeopleGraph>.
+<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" <http://example.org/PeopleGraph> .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" <http://example.org/PeopleGraph> .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" <http://example.org/PeopleGraph> .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" <http://example.org/PeopleGraph> .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" <http://example.org/PeopleGraph> .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" <http://example.org/PeopleGraph> .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" <http://example.org/PeopleGraph> .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" <http://example.org/PeopleGraph> .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" <http://example.org/PeopleGraph> .
+
+

Output 3

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

36. RMLTTC0002g

+

Title: Multiple Targets: Predicate Map and Graph Map

+

Description: Test exporting all triples to a Target in a Predicate Map and a Target in a Graph Map.

+

Error expected? No

+

Input

+
[
+  { 
+    "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
+  }
+]
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@prefix ex: <http://example.org> .
+@base <http://example.com/rules/> .
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "Friends.json";
+    ];
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:graphMap [ a rml:GraphMap;
+      rml:constant ex:PeopleGraph;
+      rml:logicalTarget <#TargetDump2>;
+    ];
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+      rml:logicalTarget <#TargetDump1>;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:FilePath;
+    rml:root rml:CurrentWorkingDirectory;
+    rml:path "./dump1.nq";
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+<#TargetDump2> a rml:LogicalTarget;
+  rml:target [ a rml:FilePath;
+    rml:root rml:CurrentWorkingDirectory;
+    rml:path "./dump2.nq";
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+

Output 1

+

+
+

Output 2

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" <http://example.org/PeopleGraph>.
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" <http://example.org/PeopleGraph> .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" <http://example.org/PeopleGraph> .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" <http://example.org/PeopleGraph> .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" <http://example.org/PeopleGraph> .
+
+

Output 3

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

37. RMLTTC0002h

+

Title: Multiple Targets: Object Map and Graph Map

+

Description: Test exporting all triples to a Target in a Object Map and a Target in a Graph Map.

+

Error expected? No

+

Input

+
[
+  { 
+    "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
+  }
+]
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@prefix ex: <http://example.org> .
+@base <http://example.com/rules/> .
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "Friends.json";
+    ];
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:graphMap [ a rml:GraphMap;
+      rml:constant ex:PeopleGraph;
+      rml:logicalTarget <#TargetDump2>;
+    ];
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+      rml:logicalTarget <#TargetDump1>;
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:FilePath;
+    rml:root rml:CurrentWorkingDirectory;
+    rml:path "./dump1.nq";
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+<#TargetDump2> a rml:LogicalTarget;
+  rml:target [ a rml:FilePath;
+    rml:root rml:CurrentWorkingDirectory;
+    rml:path "./dump2.nq";
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+

Output 1

+

+
+

Output 2

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" <http://example.org/PeopleGraph>.
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" <http://example.org/PeopleGraph> .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" <http://example.org/PeopleGraph> .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" <http://example.org/PeopleGraph> .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" <http://example.org/PeopleGraph> .
+
+

Output 3

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

38. RMLTTC0002i

+

Title: Multiple Targets: Language Map and Graph Map

+

Description: Test exporting all triples to a Target in a Language Map and a Target in a Graph Map.

+

Error expected? No

+

Input

+
[
+  { 
+    "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
+  }
+]
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@prefix ex: <http://example.org> .
+@base <http://example.com/rules/> .
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "Friends.json";
+    ];
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+      rml:languageMap [ a rml:LanguageMap;
+        rml:constant "en";
+        rml:logicalTarget <#TargetDump2>;
+      ];
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:graphMap [ a rml:GraphMap;
+      rml:constant ex:PeopleGraph; 
+      rml:logicalTarget <#TargetDump1>;
+    ];
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:FilePath;
+    rml:root rml:CurrentWorkingDirectory;
+    rml:path "./dump1.nq";
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+<#TargetDump2> a rml:LogicalTarget;
+  rml:target [ a rml:FilePath;
+    rml:root rml:CurrentWorkingDirectory;
+    rml:path "./dump2.nq";
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+

Output 1

+

+
+

Output 2

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" <http://example.org/PeopleGraph> .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" <http://example.org/PeopleGraph> .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" <http://example.org/PeopleGraph> .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" <http://example.org/PeopleGraph> .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" <http://example.org/PeopleGraph> .
+
+

Output 3

+
<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 .
+
+
+

39. RMLTTC0002j

+

Title: Multiple Targets: Language Map and Object Map

+

Description: Test exporting all triples to a Target in a Language Map and a Target in a Object Map.

+

Error expected? No

+

Input

+
[
+  { 
+    "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
+  }
+]
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@prefix ex: <http://example.org> .
+@base <http://example.com/rules/> .
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "Friends.json";
+    ];
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+      rml:languageMap [ a rml:LanguageMap;
+        rml:constant "en";
+        rml:logicalTarget <#TargetDump2>;
+      ];
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+      rml:logicalTarget <#TargetDump1>;
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:Target, rml:FilePath;
+    rml:root rml:CurrentWorkingDirectory;
+    rml:path "./dump1.nq";
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+<#TargetDump2> a rml:LogicalTarget;
+  rml:target [ a rml:Target, rml:FilePath;
+    rml:root rml:CurrentWorkingDirectory;
+    rml:path "./dump2.nq";
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+

Output 1

+

+
+

Output 2

+
<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" .
+
+

Output 3

+
<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 .
+
+
+

40. RMLTTC0002k

+

Title: Multiple Targets: Datatype Map and Graph Map

+

Description: Test exporting all triples to a Target in a Datatype Map and a Target in a Graph Map.

+

Error expected? No

+

Input

+
[
+  { 
+    "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
+  }
+]
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix ex: <http://example.org> .
+@base <http://example.com/rules/> .
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "Friends.json";
+    ];
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:graphMap [ a rml:GraphMap;
+      rml:constant ex:PeopleGraph; 
+      rml:logicalTarget <#TargetDump1>;
+    ];
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+      rml:datatypeMap [ a rml:DatatypeMap;
+        rml:constant xsd:integer;
+        rml:logicalTarget <#TargetDump2>;
+      ];
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:Target, rml:FilePath;
+    rml:root rml:CurrentWorkingDirectory;
+    rml:path "./dump1.nq";
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+<#TargetDump2> a rml:LogicalTarget;
+  rml:target [ a rml:Target, rml:FilePath;
+    rml:root rml:CurrentWorkingDirectory;
+    rml:path "./dump2.nq";
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+

Output 1

+

+
+

Output 2

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33"^^<http://www.w3.org/2001/XMLSchema#integer> <http://example.org/PeopleGraph> .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34"^^<http://www.w3.org/2001/XMLSchema#integer> <http://example.org/PeopleGraph> .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35"^^<http://www.w3.org/2001/XMLSchema#integer> <http://example.org/PeopleGraph> .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36"^^<http://www.w3.org/2001/XMLSchema#integer> <http://example.org/PeopleGraph> .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37"^^<http://www.w3.org/2001/XMLSchema#integer> <http://example.org/PeopleGraph> .
+
+

Output 3

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33"^^<http://www.w3.org/2001/XMLSchema#integer> <http://example.org/PeopleGraph> .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34"^^<http://www.w3.org/2001/XMLSchema#integer> <http://example.org/PeopleGraph> .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35"^^<http://www.w3.org/2001/XMLSchema#integer> <http://example.org/PeopleGraph> .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36"^^<http://www.w3.org/2001/XMLSchema#integer> <http://example.org/PeopleGraph> .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37"^^<http://www.w3.org/2001/XMLSchema#integer> <http://example.org/PeopleGraph> .
+
+
+

41. RMLTTC0002l

+

Title: Multiple Targets: Datatype Map and Object Map

+

Description: Test exporting all triples to a Target in a Datatype Map and a Target in a Object Map.

+

Error expected? No

+

Input

+
[
+  { 
+    "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
+  }
+]
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix ex: <http://example.org> .
+@base <http://example.com/rules/> .
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "Friends.json";
+    ];
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+      rml:logicalTarget <#TargetDump1>;
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+      rml:datatypeMap [ a rml:DatatypeMap;
+        rml:constant xsd:integer;
+        rml:logicalTarget <#TargetDump2>;
+      ];
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:Target, rml:FilePath;
+    rml:root rml:CurrentWorkingDirectory;
+    rml:path "./dump1.nq";
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+<#TargetDump2> a rml:LogicalTarget;
+  rml:target [ a rml:Target, rml:FilePath;
+    rml:root rml:CurrentWorkingDirectory;
+    rml:path "./dump2.nq";
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+

Output 1

+

+
+

Output 2

+
<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" .
+
+

Output 3

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33"^^<http://www.w3.org/2001/XMLSchema#integer> <http://example.org/PeopleGraph> .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34"^^<http://www.w3.org/2001/XMLSchema#integer> <http://example.org/PeopleGraph> .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35"^^<http://www.w3.org/2001/XMLSchema#integer> <http://example.org/PeopleGraph> .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36"^^<http://www.w3.org/2001/XMLSchema#integer> <http://example.org/PeopleGraph> .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37"^^<http://www.w3.org/2001/XMLSchema#integer> <http://example.org/PeopleGraph> .
+
+
+

42. RMLTTC0002m

+

Title: Multiple Targets: Multiple Predicate Maps

+

Description: Test exporting all triples to Targets in multiple Predicate Maps.

+

Error expected? No

+

Input

+
[
+  { 
+    "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
+  }
+]
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@base <http://example.com/rules/> .
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "Friends.json";
+    ];
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+      rml:logicalTarget <#TargetDump1>;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+      rml:logicalTarget <#TargetDump2>;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:Target, rml:FilePath;
+    rml:root rml:CurrentWorkingDirectory;
+    rml:path "./dump1.nq";
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+<#TargetDump2> a rml:LogicalTarget;
+  rml:target [ a rml:Target, rml:FilePath;
+    rml:root rml:CurrentWorkingDirectory;
+    rml:path "./dump2.nq";
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+

Output 1

+
<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".
+
+

Output 2

+
<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" .
+
+

Output 3

+
<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" .
+
+
+

43. RMLTTC0002n

+

Title: Multiple Targets: Multiple Object Maps

+

Description: Test exporting all triples to Targets in multiple Object Maps.

+

Error expected? No

+

Input

+
[
+  { 
+    "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
+  }
+]
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@base <http://example.com/rules/> .
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "Friends.json";
+    ];
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+      rml:logicalTarget <#TargetDump1>;
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+      rml:logicalTarget <#TargetDump2>;
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:Target, rml:FilePath;
+    rml:root rml:CurrentWorkingDirectory;
+    rml:path "./dump1.nq";
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+<#TargetDump2> a rml:LogicalTarget;
+  rml:target [ a rml:Target, rml:FilePath;
+    rml:root rml:CurrentWorkingDirectory;
+    rml:path "./dump2.nq";
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+

Output 1

+
<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".
+
+

Output 2

+
<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" .
+
+

Output 3

+
<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" .
+
+
+

44. RMLTTC0002o

+

Title: Multiple Targets: Multiple Graph Maps

+

Description: Test exporting all triples to Targets in multiple Graph Maps.

+

Error expected? No

+

Input

+
[
+  { 
+    "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
+  }
+]
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix dcat: <http://www.w3.org/ns/dcat#> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@prefix ex: <http://example.org/> .
+@base <http://example.com/rules/> .
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "Friends.json";
+    ];
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+    rml:graphMap [ a rml:GraphMap;
+      rml:constant ex:PeopleGraph1;
+      rml:logicalTarget <#TargetDump1>;
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+    rml:graphMap [ a rml:GraphMap;
+      rml:constant ex:PeopleGraph1;
+      rml:logicalTarget <#TargetDump1>;
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:Target, rml:FilePath;
+    rml:root rml:CurrentWorkingDirectory;
+    rml:path "./dump1.nq";
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+

Output 1

+

+
+

Output 2

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" <http://example.org/PeopleGraph1>.
+<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" <http://example.org/PeopleGraph1> .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" <http://example.org/PeopleGraph1> .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" <http://example.org/PeopleGraph1> .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" <http://example.org/PeopleGraph1> .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" <http://example.org/PeopleGraph1> .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" <http://example.org/PeopleGraph1> .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" <http://example.org/PeopleGraph1> .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" <http://example.org/PeopleGraph1> .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" <http://example.org/PeopleGraph1> .
+
+

Output 3

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

45. RMLTTC0002p

+

Title: Multiple Targets: Multiple Language Maps

+

Description: Test exporting all triples to Targets in multiple Language Maps.

+

Error expected? No

+

Input

+
[
+  { 
+    "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
+  }
+]
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@base <http://example.com/rules/> .
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "Friends.json";
+    ];
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+      rml:languageMap [ a rml:LanguageMap;
+        rml:constant "en";
+        rml:logicalTarget <#TargetDump1>;
+      ];
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+      rml:languageMap [ a rml:LanguageMap;
+        rml:constant "nl";
+        rml:logicalTarget <#TargetDump2>;
+      ];
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:Target, rml:FilePath;
+    rml:root rml:CurrentWorkingDirectory;
+    rml:path "./dump1.nq";
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+<#TargetDump2> a rml:LogicalTarget;
+  rml:target [ a rml:Target, rml:FilePath;
+    rml:root rml:CurrentWorkingDirectory;
+    rml:path "./dump2.nq";
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+

Output 1

+
<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".
+
+

Output 2

+
<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 .
+
+

Output 3

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller"@nl .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green"@nl .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani"@nl .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing"@nl .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller"@nl .
+
+
+

46. RMLTTC0002q

+

Title: Multiple Targets: Multiple Datatype Maps

+

Description: Test exporting all triples to Targets in multiple Datatype Maps.

+

Error expected? No

+

Input

+
[
+  { 
+    "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
+  }
+]
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@base <http://example.com/rules/> .
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "Friends.json";
+    ];
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+      rml:datatypeMap [ a rml:DatatypeMap;
+        rml:constant xsd:integer;
+        rml:logicalTarget <#TargetDump1>;
+      ];
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+      rml:datatypeMap [ a rml:DatatypeMap;
+        rml:constant xsd:double;
+        rml:logicalTarget <#TargetDump2>;
+      ];
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:Target, rml:FilePath;
+    rml:root rml:CurrentWorkingDirectory;
+    rml:path "./dump1.nq";
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+<#TargetDump2> a rml:LogicalTarget;
+  rml:target [ a rml:Target, rml:FilePath;
+    rml:root rml:CurrentWorkingDirectory;
+    rml:path "./dump2.nq";
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+

Output 1

+
<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" .
+
+

Output 2

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33"^^<http://www.w3.org/2001/XMLSchema#integer>.
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34"^^<http://www.w3.org/2001/XMLSchema#integer>.
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35"^^<http://www.w3.org/2001/XMLSchema#integer>.
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36"^^<http://www.w3.org/2001/XMLSchema#integer>.
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37"^^<http://www.w3.org/2001/XMLSchema#integer>.
+
+

Output 3

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33"^^<http://www.w3.org/2001/XMLSchema#double>.
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34"^^<http://www.w3.org/2001/XMLSchema#double>.
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35"^^<http://www.w3.org/2001/XMLSchema#double>.
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36"^^<http://www.w3.org/2001/XMLSchema#double>.
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37"^^<http://www.w3.org/2001/XMLSchema#double>.
+
+
+

47. RMLTTC0002r

+

Title: Multiple Targets: Multiple Term Maps with same Target

+

Description: Test exporting all triples to same Target in multiple Term Maps.

+

Error expected? No

+

Input

+
[
+  { 
+    "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
+  }
+]
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@base <http://example.com/rules/> .
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "Friends.json";
+    ];
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+      rml:logicalTarget <#TargetDump1>;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+      rml:logicalTarget <#TargetDump1>;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:Target, rml:FilePath;
+    rml:root rml:CurrentWorkingDirectory;
+    rml:path "./dump1.nq";
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+

Output 1

+
<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".
+
+

Output 2

+
<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" .
+<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" .
+
+
+

48. RMLTTC0003a

+

Title: Overriding Targets: Seperate Triples Map

+

Description: Test exporting some triples to a different Target with a separate Triples Map.

+

Error expected? No

+

Input

+
[
+  { 
+    "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
+  }
+]
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@base <http://example.com/rules/> .
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "Friends.json";
+    ];
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+    rml:logicalTarget <#TargetDump2>;
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+<#TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "Friends.json";
+    ];
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+    rml:logicalTarget <#TargetDump1>;
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:Target, rml:FilePath;
+    rml:root rml:CurrentWorkingDirectory;
+    rml:path "./dump1.nq";
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+<#TargetDump2> a rml:LogicalTarget;
+  rml:target [ a rml:Target, rml:FilePath;
+    rml:root rml:CurrentWorkingDirectory;
+    rml:path "./dump2.nq";
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+

Output 1

+

+
+

Output 2

+
<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" .
+
+

Output 3

+
<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" .
+
+
+

49. RMLTTC0004a

+

Title: Target JSON-LD

+

Description: Test export all triples as JSON-LD

+

Error expected? No

+

Input

+
[
+  { 
+    "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
+  }
+]
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@base <http://example.com/rules/> .
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "Friends.json";
+    ];
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+    rml:logicalTarget <#TargetDump1>;
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:Target, rml:FilePath;
+    rml:root rml:CurrentWorkingDirectory;
+    rml:path "./dump1.jsonld";
+  ];
+  rml:serialization formats:JSON-LD;
+.
+
+

Output 1

+

+
+

Output 2

+
{
+  "@context": { 
+    "foaf": "http://xmlns.com/foaf/0.1/"
+  },
+  "@graph": [
+    {                                                                                
+
+      "@id": "http://example.org/0",
+      "foaf:name": "Monica Geller",
+      "foaf:age": "33"
+    },
+    {                                                                                
+      "@id": "http://example.org/1",
+      "foaf:name": "Rachel Green",
+      "foaf:age": "34"
+    },
+    {                                                                                
+      "@id": "http://example.org/2",
+      "foaf:name": "Joey Tribbiani",
+      "foaf:age": "35"
+    },
+    {                                                                                
+      "@id": "http://example.org/3",
+      "foaf:name": "Chandler Bing",
+      "foaf:age": "36"
+    },
+      {                                                                                
+      "@id": "http://example.org/4",
+      "foaf:name": "Ross Geller",
+      "foaf:age": "37"
+    }
+  ]
+}
+
+
+

50. RMLTTC0004b

+

Title: Target N3

+

Description: Test export all triples as N3

+

Error expected? No

+

Input

+
[
+  { 
+    "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
+  }
+]
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@base <http://example.com/rules/> .
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "Friends.json";
+    ];
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+    rml:logicalTarget <#TargetDump1>;
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:Target, rml:FilePath;
+    rml:root rml:CurrentWorkingDirectory;
+    rml:path "./dump1.n3";
+  ];
+  rml:serialization formats:N3;
+.
+
+

Output 1

+

+
+

Output 2

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix ex: <http://example.org/> .
+ex:0 <foaf:age> "33" ;
+     <foaf:name> "Monica Geller" .
+ex:1 <foaf:age> "34" ;
+     <foaf:name> "Rachel Green" .
+ex:2 <foaf:age> "35" ;
+     <foaf:name> "Joey Tribbiani" .
+ex:3 <foaf:age> "36" ;
+     <foaf:name> "Chandler Bing" .
+ex:4 <foaf:age> "37" ;
+     <foaf:name> "Ross Geller" .
+
+
+

51. RMLTTC0004c

+

Title: Target N-Triples

+

Description: Test export all triples as N-Triples

+

Error expected? No

+

Input

+
[
+  { 
+    "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
+  }
+]
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@base <http://example.com/rules/> .
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "Friends.json";
+    ];
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+    rml:logicalTarget <#TargetDump1>;
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:Target, rml:FilePath;
+    rml:root rml:CurrentWorkingDirectory;
+    rml:path "./dump1.nt";
+  ];
+  rml:serialization formats:N-Triples;
+.
+
+

Output 1

+

+
+

Output 2

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
+<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
+
+
+

52. RMLTTC0004d

+

Title: Target N-Quads

+

Description: Test export all triples as N-Quads

+

Error expected? No

+

Input

+
[
+  { 
+    "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
+  }
+]
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@base <http://example.com/rules/> .
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "Friends.json";
+    ];
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+    rml:logicalTarget <#TargetDump1>;
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:Target, rml:FilePath;
+    rml:root rml:CurrentWorkingDirectory;
+    rml:path "./dump1.nq";
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+

Output 1

+

+
+

Output 2

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
+<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
+
+
+

53. RMLTTC0004e

+

Title: Target RDF/JSON

+

Description: Test export all triples as RDF/JSON

+

Error expected? No

+

Input

+
[
+  { 
+    "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
+  }
+]
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@base <http://example.com/rules/> .
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "Friends.json";
+    ];
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+    rml:logicalTarget <#TargetDump1>;
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:Target, rml:FilePath;
+    rml:root rml:CurrentWorkingDirectory;
+    rml:path "./dump1.rdfjson";
+  ];
+  rml:serialization formats:RDF_JSON;
+.
+
+

Output 1

+

+
+

Output 2

+
{
+    "http://example.org/0" : {
+        "http://xmlns.com/foaf/0.1/age" : [ { "value" : "33" } ],
+        "http://xmlns.com/foaf/0.1/name" : [ { "value" : "Monica Geller" } ]
+    },
+    "http://example.org/1" : {
+        "http://xmlns.com/foaf/0.1/age" : [ { "value" : "34" } ],
+        "http://xmlns.com/foaf/0.1/name" : [ { "value" : "Rachel Green" } ]
+    },
+    "http://example.org/2" : {
+        "http://xmlns.com/foaf/0.1/age" : [ { "value" : "35" } ],
+        "http://xmlns.com/foaf/0.1/name" : [ { "value" : "Joey Tribbiani" } ]
+    },
+    "http://example.org/3" : {
+        "http://xmlns.com/foaf/0.1/age" : [ { "value" : "36" } ],
+        "http://xmlns.com/foaf/0.1/name" : [ { "value" : "Chandler Bing" } ]
+    },
+    "http://example.org/4" : {
+        "http://xmlns.com/foaf/0.1/age" : [ { "value" : "37" } ],
+        "http://xmlns.com/foaf/0.1/name" : [ { "value" : "Ross Geller" } ]
+    }
+}
+
+
+

54. RMLTTC0004f

+

Title: Target RDF/XML

+

Description: Test export all triples as RDF/XML

+

Error expected? No

+

Input

+
[
+  { 
+    "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
+  }
+]
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@base <http://example.com/rules/> .
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "Friends.json";
+    ];
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+    rml:logicalTarget <#TargetDump1>;
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:Target, rml:FilePath;
+    rml:root rml:CurrentWorkingDirectory;
+    rml:path "./dump1.nq";
+  ];
+  rml:serialization formats:RDF_XML;
+.
+
+

Output 1

+

+
+

Output 2

+
<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:age>33</foaf:age>
+    <foaf:name>Monica Geller</foaf:name>
+  </rdf:Description>
+  <rdf:Description rdf:about="http://example.org/1">
+    <foaf:age>34</foaf:age>
+    <foaf:name>Rachel Green</foaf:name>
+  </rdf:Description>
+  <rdf:Description rdf:about="http://example.org/2">
+    <foaf:age>35</foaf:age>
+    <foaf:name>Joey Tribbiani</foaf:name>
+  </rdf:Description>
+  <rdf:Description rdf:about="http://example.org/3">
+    <foaf:age>36</foaf:age>
+    <foaf:name>Chandler Bing</foaf:name>
+  </rdf:Description>
+  <rdf:Description rdf:about="http://example.org/4">
+    <foaf:age>37</foaf:age>
+    <foaf:name>Ross Geller</foaf:name>
+  </rdf:Description>
+</rdf:RDF>
+
+
+

55. RMLTTC0004g

+

Title: Target Turtle

+

Description: Test export all triples as Turtle

+

Error expected? No

+

Input

+
[
+  { 
+    "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
+  }
+]
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@base <http://example.com/rules/> .
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "Friends.json";
+    ];
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+    rml:logicalTarget <#TargetDump1>;
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:Target, rml:FilePath;
+    rml:root rml:CurrentWorkingDirectory;
+    rml:path "./dump1.nq";
+  ];
+  rml:serialization formats:Turtle;
+.
+
+

Output 1

+

+
+

Output 2

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix ex: <http://example.org/> .
+
+<ex:0> <foaf:age> "33" .
+<ex:0> <foaf:name> "Monica Geller" .
+<ex:1> <foaf:age> "34" .
+<ex:1> <foaf:name> "Rachel Green" .
+<ex:2> <foaf:age> "35" .
+<ex:2> <foaf:name> "Joey Tribbiani" .
+<ex:3> <foaf:age> "36" .
+<ex:3> <foaf:name> "Chandler Bing" .
+<ex:4> <foaf:age> "37" .
+<ex:4> <foaf:name> "Ross Geller" .
+
+
+

56. RMLTTC0005a

+

Title: Target UTF-8

+

Description: Test export all triples with UTF-8 encoding

+

Error expected? No

+

Input

+
[
+  { 
+    "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
+  }
+]
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@base <http://example.com/rules/> .
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "Friends.json";
+    ];
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+    rml:logicalTarget <#TargetDump1>;
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:Target, rml:FilePath;
+    rml:root rml:CurrentWorkingDirectory;
+    rml:path "./dump1.nq";
+  ];
+  rml:serialization formats:N-Quads;
+  rml:encoding rml:UTF-8;
+.
+
+

Output 1

+

+
+

Output 2

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
+<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
+
+
+

57. RMLTTC0005b

+

Title: Target UTF-16

+

Description: Test export all triples with UTF-16 encoding

+

Error expected? No

+

Input

+
[
+  { 
+    "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
+  }
+]
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@base <http://example.com/rules/> .
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "Friends.json";
+    ];
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+    rml:logicalTarget <#TargetDump1>;
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:Target, rml:FilePath;
+    rml:root rml:CurrentWorkingDirectory;
+    rml:path "./dump1.nq";
+  ];
+  rml:serialization formats:N-Quads;
+  rml:encoding rml:UTF-16;
+.
+
+

Output 1

+

+
+

Output 2

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
+<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
+
+
+

58. RMLTTC0006a

+

Title: Target no compression

+

Description: Test export all triples with no compression

+

Error expected? No

+

Input

+
[
+  { 
+    "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
+  }
+]
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@base <http://example.com/rules/> .
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "Friends.json";
+    ];
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+    rml:logicalTarget <#TargetDump1>;
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:Target, rml:FilePath;
+    rml:root rml:CurrentWorkingDirectory;
+    rml:path "./dump1.nq";
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+

Output 1

+

+
+

Output 2

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
+<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
+
+
+

59. RMLTTC0006b

+

Title: Target GZip compression

+

Description: Test export all triples with GZip compression

+

Error expected? No

+

Input

+
[
+  { 
+    "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
+  }
+]
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@base <http://example.com/rules/> .
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "Friends.json";
+    ];
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+    rml:logicalTarget <#TargetDump1>;
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:Target, rml:FilePath;
+    rml:root rml:CurrentWorkingDirectory;
+    rml:path "./dump1.nq.gz";
+  ];
+  rml:serialization formats:N-Quads;
+  rml:compression rml:gzip;
+.
+
+

Output 1

+

+
+

Output 2 + dump1.nq.gz

+
+

60. RMLTTC0006c

+

Title: Target Zip compression

+

Description: Test export all triples with ZIP compression

+

Error expected? No

+

Input

+
[
+  { 
+    "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
+  }
+]
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@base <http://example.com/rules/> .
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "Friends.json";
+    ];
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+    rml:logicalTarget <#TargetDump1>;
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:Target, rml:FilePath;
+    rml:root rml:CurrentWorkingDirectory;
+    rml:path "./dump1.nq.zip";
+  ];
+  rml:serialization formats:N-Quads;
+  rml:compression rml:zip;
+.
+
+

Output 1

+

+
+

Output 2 + dump1.nq.zip

+
+

61. RMLTTC0006d

+

Title: Target TarXz compression

+

Description: Test export all triples with TarXZ compression

+

Error expected? No

+

Input

+
[
+  { 
+    "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
+  }
+]
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@prefix ex: <http://example.org/> .
+@base <http://example.com/rules/> .
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "Friends.json";
+    ];
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+    rml:logicalTarget <#TargetDump1>;
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:Target, rml:FilePath;
+    rml:root rml:CurrentWorkingDirectory;
+    rml:path "./dump1.nq.tar.xz";
+  ];
+  rml:serialization formats:N-Quads;
+  rml:compression rml:tarxz;
+.
+
+

Output 1

+

+
+

Output 2 + dump1.nq.tar.xz

+
+

62. RMLTTC0006e

+

Title: Target TarGzip compression

+

Description: Test export all triples with TarGZip compression

+

Error expected? No

+

Input

+
[
+  { 
+    "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
+  }
+]
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@base <http://example.com/rules/> .
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "Friends.json";
+    ];
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+    rml:logicalTarget <#TargetDump1>;
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:Target, rml:FilePath;
+    rml:root rml:CurrentWorkingDirectory;
+    rml:path "./dump1.nq.tar.gz";
+  ];
+  rml:serialization formats:N-Quads;
+  rml:compression rml:targz;
+.
+
+

Output 1

+

+
+

Output 2 + dump1.nq.tar.gz

+
+

63. RMLTTC0007a

+

Title: Target with FilePath description

+

Description: Test export all triples to a target with File path access description

+

Error expected? No

+

Input

+
[
+  { 
+    "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
+  }
+]
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@base <http://example.com/rules/> .
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "Friends.json";
+    ];
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+    rml:logicalTarget <#TargetDump1>;
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:Target, rml:FilePath;
+    rml:root rml:CurrentWorkingDirectory;
+    rml:path "./dump1.nq";
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+

Output 1

+

+
+

Output 2

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
+<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
+
+
+ + + + + \ No newline at end of file diff --git a/src/test/resources/rml-io/docs/20250630/index.html b/src/test/resources/rml-io/docs/20250630/index.html new file mode 100644 index 00000000..55fa3c7b --- /dev/null +++ b/src/test/resources/rml-io/docs/20250630/index.html @@ -0,0 +1,6880 @@ + + + + + + +RML-IO: Test Cases + + + + + + + + + + + + + + + +
+ +

RML-IO: Test Cases

+

+ Draft Community Group Report + +

+
+ +
Latest published version:
+ https://www.w3.org/RML-IO-Testcases/ +
+
Latest editor's draft:
https://w3id.org/rml/io/test-cases/
+ + + + +
Editor:
+ Dylan Van Assche + + + + (IDLab – Ghent University – imec) +
+ +
Author:
+ Dylan Van Assche + + + + (IDLab – Ghent University – imec) +
+
Feedback:
+ GitHub kg-construct/rml-io + (pull requests, + new issue, + open issues) +
+ +
+ + +
+
+ + + +

Abstract

This document defines the RML-IO test cases to the determine the RML-IO specification conformance of tools.

+
+ +

Status of This Document

+ This specification was published by the + Knowledge Graph Construction Community Group. It is not a W3C Standard nor is it + on the W3C Standards Track. + + Please note that under the + W3C Community Contributor License Agreement (CLA) + there is a limited opt-out and other conditions apply. + + Learn more about + W3C Community and Business Groups. +

+ GitHub Issues are preferred for + discussion of this specification. + + +

+ +

1. Introduction

+

This document defines the RML-IO test cases, consisting of a collection of test case documents (input and expected output). +The purpose of the test cases is to determine the conformance of tools that execute RML rules to the RML-IO specification.

+
+ +

2. Data model

+

The test cases are semantically described for re-usability and shareability following the W3C Test case description. +Each test:Testcase as the following properties:

+
    +
  • dcterms:identifier: unique ID of the test case.
  • +
  • rmltest:hasError: if an error of the RML Processor is expected or not.
  • +
  • rmltest:input: One or more input data of the test case.
  • +
  • rmltest:output: One or more output data of the test case.
  • +
  • rmltest:inputFormat: the input data format.
  • +
  • rmltest:outputFormat: the output data format.
  • +
  • rmltest:mappingDocument: the RML mapping rules in Turtle.
  • +
+
+ +

3. Test cases

+

This section describes the RML-IO test cases. These descriptions are also available as RDF. +The files are available on GitHub in the folder test-cases. +Each test case is contained in a single folder, containing three types of files:

+
    +
  • Zero or more files containing the data sources, in the case of JSON, XML, CSV, or containing the SQL statements to create the necessary tables, in the case of MySQL, PostgreSQL, and SQL Server.
  • +
  • One file with the RML rules, called mapping.ttl, in the Turtle format.
  • +
  • Zero or more files with the expected RDF. No file is provided if an error is expected that must halt the generation of the RDF because of an error.
  • +
+
+ + +

4. RMLSTC0001a

+

Title: Source with UTF-8 encoding

+

Description: Test source with UTF-8 encoding

+

Error expected? No

+

Input

+
[
+  { 
+    "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
+  }
+]
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@base <http://example.com/rules/> .
+
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "Friends.json"
+    ];
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+

Output

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
+<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
+
+
+

5. RMLSTC0001b

+

Title: Source with UTF-16 encoding

+

Description: Test source with UTF-16 encoding

+

Error expected? No

+

Input

+
��[
+  { 
+    "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
+  }
+]
+
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@base <http://example.com/rules/> .
+
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "Friends-UTF16.json"
+    ];
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+

Output

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
+<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
+
+
+

6. RMLSTC0002a

+

Title: Source no compression

+

Description: Test source without compression

+

Error expected? No

+

Input

+
[
+  { 
+    "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
+  }
+]
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@base <http://example.com/rules/> .
+
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "Friends.json"
+    ];
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+

Output

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
+<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
+
+
+

7. RMLSTC0002b

+

Title: Source GZip compression

+

Description: Test source with GZip compression

+

Error expected? No

+

Input + Friends.json.gz

+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@base <http://example.com/rules/> .
+
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "Friends.json.gz";
+      rml:compression rml:gzip;
+    ];
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+

Output

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
+<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
+
+
+

8. RMLSTC0002c

+

Title: Source Zip compression

+

Description: Test source with ZIP compression

+

Error expected? No

+

Input + Friends.json.zip

+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@base <http://example.com/rules/> .
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "Friends.json.zip";
+      rml:compression rml:zip;
+    ];
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+

Output

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
+<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
+
+
+

9. RMLSTC0002d

+

Title: Source TarXz compression

+

Description: Test source with TarXZ compression

+

Error expected? No

+

Input + Friends.json.tar.xz

+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@base <http://example.com/rules/> .
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "Friends.json.tar.xz";
+      rml:compression rml:tarxz;
+    ];
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+

Output

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
+<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
+
+
+

10. RMLSTC0002e

+

Title: Source TarGzip compression

+

Description: Test source with TarGZip compression

+

Error expected? No

+

Input + Friends.json.tar.gz

+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@base <http://example.com/rules/> .
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "Friends.json.tar.gz";
+      rml:compression rml:targz;
+    ];
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+

Output

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
+<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
+
+
+

11. RMLSTC0003

+

Title: Source with query

+

Description: Test source which requires a query

+

Error expected? No

+

Input

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
+<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@base <http://example.com/rules/> .
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+        rml:path "./Friends.nt";
+    ];
+    rml:iterator """
+    PREFIX foaf: <http://xmlns.com/foaf/0.1/>
+
+    SELECT ?person ?name ?age WHERE {
+        ?person foaf:name ?name .
+        ?person foaf:age ?age .
+    }
+    """;
+    rml:referenceFormulation formats:SPARQL_Results_CSV;
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:reference "person";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "age";
+    ];
+  ];
+.
+
+

Output

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
+<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
+
+
+

12. RMLSTC0004a

+

Title: Source with default NULL values

+

Description: Test source with default NULL values

+

Error expected? No

+

Input

+
id,name,age
+0,Monica Geller,33
+1,Rachel Green,34
+2,Joey Tribbiani,35
+3,Chandler Bing,36
+4,Ross Geller,37
+5,,
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@base <http://example.com/rules/> .
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "Friends-NULL.csv";
+    ];
+    rml:referenceFormulation rml:CSV;
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "age";
+    ];
+  ];
+.
+
+

Output

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
+<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
+
+
+

13. RMLSTC0004b

+

Title: Source with one NULL value

+

Description: Test source with one NULL value defined

+

Error expected? No

+

Input

+
id,name,age
+0,Monica Geller,33
+1,Rachel Green,34
+2,Joey Tribbiani,35
+3,Chandler Bing,36
+4,Ross Geller,37
+5,,
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@base <http://example.com/rules/> .
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "Friends-NULL.csv";
+      rml:null "";
+    ];
+    rml:referenceFormulation rml:CSV;
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "age";
+    ];
+  ];
+.
+
+

Output

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
+<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
+
+
+

14. RMLSTC0004c

+

Title: Source with multiple NULL values

+

Description: Test source with multiple NULL values defined

+

Error expected? No

+

Input

+
id,name,age
+0,Monica Geller,33
+1,Rachel Green,34
+2,Joey Tribbiani,35
+3,Chandler Bing,36
+4,Ross Geller,37
+5,,
+6,NULL,NULL
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@base <http://example.com/rules/> .
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "Friends-NULL.csv";
+      rml:null "";
+      rml:null "NULL";
+    ];
+    rml:referenceFormulation rml:CSV;
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "age";
+    ];
+  ];
+.
+
+

Output

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
+<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
+
+
+

15. RMLSTC0006a

+

Title: Source with D2RQ access description

+

Description: Test source with D2RQ access description for SQL databases

+

Error expected? No

+

Input

+
id,name,age
+0,Monica Geller,33
+1,Rachel Green,34
+2,Joey Tribbiani,35
+3,Chandler Bing,36
+4,Ross Geller,37
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@base <http://example.com/rules/> .
+
+<#D2RQSourceAccess> a rml:Source, d2rq:Database;
+  d2rq:jdbcDSN "$CONNECTIONDSN";
+  d2rq:username "$USERNAME";
+  d2rq:password "$PASSWORD"
+.
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source <#D2RQSourceAccess>;
+    rml:referenceFormulation rml:SQL2008Table;
+    rml:iterator "Friends";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "age";
+    ];
+  ];
+.
+
+

Output

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
+<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
+
+
+

16. RMLSTC0006b

+

Title: Source with a Relative Path Source

+

Description: Test access to a file

+

Error expected? No

+

Input

+
id,name,age
+0,Monica Geller,33
+1,Rachel Green,34
+2,Joey Tribbiani,35
+3,Chandler Bing,36
+4,Ross Geller,37
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@base <http://example.com/rules/> .
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath, rml:Source;
+      rml:root rml:CurrentWorkingDirectory;
+      rml:path "./Friends.csv"
+    ];
+    rml:referenceFormulation rml:CSV;
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "age";
+    ];
+  ];
+.
+
+

Output

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
+<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
+
+
+

17. RMLSTC0007a

+

Title: Source with JSONPath reference formulation

+

Description: Test source with JSONPath reference formulation

+

Error expected? No

+

Input

+
[
+  { 
+    "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
+  }
+]
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@base <http://example.com/rules/> .
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "Friends.json";
+      rml:encoding rml:UTF-8
+    ];
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+

Output

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
+<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
+
+
+

18. RMLSTC0007b

+

Title: Source with CSV reference formulation

+

Description: Test source with Tabular reference formulation

+

Error expected? No

+

Input

+
id,name,age
+0,Monica Geller,33
+1,Rachel Green,34
+2,Joey Tribbiani,35
+3,Chandler Bing,36
+4,Ross Geller,37
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@base <http://example.com/rules/> .
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "Friends.csv";
+    ];
+    rml:referenceFormulation rml:CSV;
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "age";
+    ];
+  ];
+.
+
+

Output

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
+<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
+
+
+

19. RMLSTC0007c

+

Title: Source with XPath reference formulation

+

Description: Test source with XPath reference formulation

+

Error expected? No

+

Input

+
<Friends>
+  <Character id="0">
+    <name>Monica Geller</name>
+    <age>33</age>
+  </Character>
+  <Character id="1">
+    <name>Rachel Green</name>
+    <age>34</age>
+  </Character>
+  <Character id="2">
+    <name>Joey Tribbiani</name>
+    <age>35</age>
+  </Character>
+  <Character id="3">
+    <name>Chandler Bing</name>
+    <age>36</age>
+  </Character>
+  <Character id="4">
+    <name>Ross Geller</name>
+    <age>37</age>
+  </Character>
+</Friends>
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@base <http://example.com/rules/> .
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "Friends.xml"
+    ];
+    rml:referenceFormulation rml:XPath;
+    rml:iterator "//Friends/Character";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{@id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "name/text()";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "age/text()";
+    ];
+  ];
+.
+
+

Output

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
+<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
+
+
+

20. RMLSTC0007d

+

Title: Source with XPath reference formulation with namespaces

+

Description: Test source with XPath reference formulation with namespaces

+

Error expected? No

+

Input

+
<Friends xmlns:ex="http://example.org">
+  <ex:Character id="0">
+    <ex:name>Monica Geller</ex:name>
+    <ex:age>33</ex:age>
+  </ex:Character>
+  <ex:Character id="1">
+    <ex:name>Rachel Green</ex:name>
+    <ex:age>34</ex:age>
+  </ex:Character>
+  <ex:Character id="2">
+    <ex:name>Joey Tribbiani</ex:name>
+    <ex:age>35</ex:age>
+  </ex:Character>
+  <ex:Character id="3">
+    <ex:name>Chandler Bing</ex:name>
+    <ex:age>36</ex:age>
+  </ex:Character>
+  <ex:Character id="4">
+    <ex:name>Ross Geller</ex:name>
+    <ex:age>37</ex:age>
+  </ex:Character>
+</Friends>
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@base <http://example.com/rules/> .
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "Friends.xml"
+    ];
+    rml:referenceFormulation [ a rml:XPathReferenceFormulation;
+      rml:namespace [ a rml:Namespace;
+        rml:namespacePrefix "ex";
+        rml:namespaceURL "http://example.org";
+      ];
+    ];
+    rml:iterator "//Friends/ex:Character";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{@id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "ex:name/text()";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "ex:age/text()";
+    ];
+  ];
+.
+
+

Output

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
+<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
+
+
+

21. RMLSTC0008a

+

Title: Multiple sources of same type

+

Description: Tests the generation of all triples from multiple homogeneous sources

+

Error expected? No

+

Input

+
[
+  { 
+    "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
+  }
+]
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@base <http://example.com/rules/> .
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "Friends.json";
+      rml:encoding rml:UTF-8
+    ];
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+<#TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:RelativePathSource;
+      rml:root rml:MappingDirectory;
+      rml:path "Friends2.json";
+      rml:encoding rml:UTF-8
+    ];
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+

Output

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
+<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
+<http://example.org/6> <http://xmlns.com/foaf/0.1/age> "37" .
+<http://example.org/6> <http://xmlns.com/foaf/0.1/name> "Phoebe Buffay" .
+
+
+

22. RMLSTC0008b

+

Title: Multiple sources of different type

+

Description: Tests the generation of all triples from multiple heterogeneous sources

+

Error expected? No

+

Input

+
[
+  { 
+    "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
+  }
+]
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@base <http://example.com/rules/> .
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "Friends.json";
+      rml:encoding rml:UTF-8
+    ];
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+<#TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:RelativePathSource;
+      rml:root rml:MappingDirectory;
+      rml:path "Friends.csv";
+      rml:encoding rml:UTF-8
+    ];
+    rml:referenceFormulation rml:CSV;
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "age";
+    ];
+  ];
+.
+
+

Output

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
+<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
+<http://example.org/6> <http://xmlns.com/foaf/0.1/age> "37" .
+<http://example.org/6> <http://xmlns.com/foaf/0.1/name> "Phoebe Buffay" .
+
+
+

23. RMLSTC0009a

+

Title: Source with quoted columns

+

Description: Tests the generation of triples where columns are quoted

+

Error expected? Yes

+

Input

+
"id","name","age"
+0,Monica Geller,33
+1,Rachel Green,34
+2,Joey Tribbiani,35
+3,Chandler Bing,36
+4,Ross Geller,37
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@base <http://example.com/rules/> .
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "Friends.csv";
+    ];
+    rml:referenceFormulation rml:CSV;
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "age";
+    ];
+  ];
+.
+
+
+

24. RMLSTC0010a

+

Title: Invalid CSV source, reference to invalid column

+

Description: Tests the identification of invalid CSV sources

+

Error expected? Yes

+

Input

+
id,name,age
+6,Phoebe Buffay 37
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@base <http://example.com/rules/> .
+
+<#TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "Friends.csv";
+    ];
+    rml:referenceFormulation rml:CSV;
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "age";
+    ];
+  ].
+
+
+

25. RMLSTC0010b

+

Title: Invalid CSV source, no reference to invalid column

+

Description: Tests the identification of invalid CSV sources, even when all columns referenced are valid

+

Error expected? Yes

+

Input

+
id,name,age
+6,Phoebe Buffay 37
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@base <http://example.com/rules/> .
+
+<#TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "Friends.csv";
+    ];
+    rml:referenceFormulation rml:CSV;
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "name";
+    ];
+  ].
+
+
+

26. RMLSTC0011a

+

Title: Complex JSON source

+

Description: Tests the generation of triples from complex JSON sources

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLSTC0011a/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@base <http://example.com/rules/> .
+
+<#TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "companies.json";
+    ];
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$.companies[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{name}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ].
+
+

Output

+
<http://example.org/InnovateX> <http://xmlns.com/foaf/0.1/name> "InnovateX" .
+<http://example.org/TechCorp> <http://xmlns.com/foaf/0.1/name> "TechCorp" .
+
+
+

27. RMLSTC0011b

+

Title: Complex JSON source

+

Description: Tests the generation of triples from complex JSON sources

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLSTC0011b/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix ex: <http://example.com/> .
+@base <http://example.com/rules/> .
+
+<#TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "companies.json";
+    ];
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$.companies[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{name}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant ex:department;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.departments[*].name";
+    ];
+  ].
+
+

Output

+
<http://example.org/InnovateX> <http://example.com/department> "Research & Development" .
+<http://example.org/InnovateX> <http://example.com/department> "Sales" .
+<http://example.org/TechCorp> <http://example.com/department> "Engineering" .
+<http://example.org/TechCorp> <http://example.com/department> "Marketing" .
+
+
+

28. RMLSTC0011c

+

Title: Complex JSON source

+

Description: Tests the generation of triples from complex JSON sources

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLSTC0011c/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix ex: <http://example.com/> .
+@base <http://example.com/rules/> .
+
+<#TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "companies.json";
+    ];
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$.companies[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{name}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant ex:employee;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.departments[*].employees[*].name";
+    ];
+  ].
+
+

Output

+
<http://example.org/InnovateX> <http://example.com/employee> "Liam Brown" .
+<http://example.org/InnovateX> <http://example.com/employee> "Olivia Martinez" .
+<http://example.org/InnovateX> <http://example.com/employee> "Sophia White" .
+<http://example.org/TechCorp> <http://example.com/employee> "Bob Smith" .
+<http://example.org/TechCorp> <http://example.com/employee> "Eve Davis" .
+<http://example.org/TechCorp> <http://example.com/employee> "Sarah Lee" .
+
+
+

29. RMLSTC0011d

+

Title: Complex JSON source

+

Description: Tests the generation of triples from complex JSON sources

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLSTC0011d/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix ex: <http://example.com/> .
+@base <http://example.com/rules/> .
+
+<#TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "companies.json";
+    ];
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$.companies[*].departments[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{name}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.manager.name";
+    ];
+  ].
+
+

Output

+
<http://example.org/Engineering> <http://xmlns.com/foaf/0.1/name> "Alice Johnson" .
+<http://example.org/Marketing> <http://xmlns.com/foaf/0.1/name> "John Doe" .
+<http://example.org/Research%20%26%20Development> <http://xmlns.com/foaf/0.1/name> "Emma Wilson" .
+<http://example.org/Sales> <http://xmlns.com/foaf/0.1/name> "Michael Green" .
+
+
+

30. RMLSTC0011e

+

Title: Complex JSON source

+

Description: Tests the generation of triples from complex JSON sources

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLSTC0011e/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix ex: <http://example.com/> .
+@base <http://example.com/rules/> .
+
+<#TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "companies.json";
+    ];
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$.companies[*].departments[*].employees[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{name}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant ex:skill;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.skills[*]";
+    ];
+  ].
+
+

Output

+
<http://example.org/Bob%20Smith> <http://example.com/skill> "AWS" .
+<http://example.org/Bob%20Smith> <http://example.com/skill> "JavaScript" .
+<http://example.org/Bob%20Smith> <http://example.com/skill> "Python" .
+<http://example.org/Eve%20Davis> <http://example.com/skill> "Docker" .
+<http://example.org/Eve%20Davis> <http://example.com/skill> "Kubernetes" .
+<http://example.org/Eve%20Davis> <http://example.com/skill> "Terraform" .
+<http://example.org/Liam%20Brown> <http://example.com/skill> "Deep Learning" .
+<http://example.org/Liam%20Brown> <http://example.com/skill> "Machine Learning" .
+<http://example.org/Liam%20Brown> <http://example.com/skill> "Python" .
+<http://example.org/Olivia%20Martinez> <http://example.com/skill> "CRM" .
+<http://example.org/Olivia%20Martinez> <http://example.com/skill> "Lead Generation" .
+<http://example.org/Olivia%20Martinez> <http://example.com/skill> "Negotiation" .
+<http://example.org/Sarah%20Lee> <http://example.com/skill> "Copywriting" .
+<http://example.org/Sarah%20Lee> <http://example.com/skill> "Google Ads" .
+<http://example.org/Sarah%20Lee> <http://example.com/skill> "SEO" .
+<http://example.org/Sophia%20White> <http://example.com/skill> "Data Analysis" .
+<http://example.org/Sophia%20White> <http://example.com/skill> "R" .
+<http://example.org/Sophia%20White> <http://example.com/skill> "SQL" .
+
+
+

31. RMLSTC0012a

+

Title: Complex XML source

+

Description: Tests the generation of triples from complex XML sources

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLSTC0012a/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix ex: <http://example.com/> .
+@base <http://example.com/rules/> .
+
+<#TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "companies.xml";
+    ];
+    rml:referenceFormulation rml:XPath;
+    rml:iterator "/companies/company";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{@id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "name";
+    ];
+  ].
+
+

Output

+
<http://example.org/25> <http://xmlns.com/foaf/0.1/name> "TechCorp" .
+<http://example.org/35> <http://xmlns.com/foaf/0.1/name> "InnovateX" .
+
+
+

32. RMLSTC0012b

+

Title: Complex XML source

+

Description: Tests the generation of triples from complex XML sources

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLSTC0012b/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix ex: <http://example.com/> .
+@base <http://example.com/rules/> .
+
+<#TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "companies.xml";
+    ];
+    rml:referenceFormulation rml:XPath;
+    rml:iterator "/companies/company/departments";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{../@id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant ex:department;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "department/name";
+    ];
+  ].
+
+

Output

+
<http://example.org/25> <http://example.com/department> "Engineering" .
+<http://example.org/25> <http://example.com/department> "Marketing" .
+<http://example.org/35> <http://example.com/department> "Research & Development" .
+<http://example.org/35> <http://example.com/department> "Sales" .
+
+
+

33. RMLSTC0012c

+

Title: Complex XML source

+

Description: Tests the generation of triples from complex XML sources

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLSTC0012c/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix ex: <http://example.com/> .
+@base <http://example.com/rules/> .
+
+<#TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "companies.xml";
+    ];
+    rml:referenceFormulation rml:XPath;
+    rml:iterator "/companies/company/departments/department/employees";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{../../../@id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant ex:employee;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "employee/name";
+    ];
+  ].
+
+

Output

+
<http://example.org/25> <http://example.com/employee> "Bob Smith" .
+<http://example.org/25> <http://example.com/employee> "Eve Davis" .
+<http://example.org/25> <http://example.com/employee> "Sarah Lee" .
+<http://example.org/35> <http://example.com/employee> "Liam Brown" .
+<http://example.org/35> <http://example.com/employee> "Olivia Martinez" .
+<http://example.org/35> <http://example.com/employee> "Sophia White" .
+
+
+

34. RMLSTC0012d

+

Title: Complex XML source

+

Description: Tests the generation of triples from complex XML sources

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLSTC0012d/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix ex: <http://example.com/> .
+@base <http://example.com/rules/> .
+
+<#TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "companies.xml";
+    ];
+    rml:referenceFormulation rml:XPath;
+    rml:iterator "/companies/company/departments/department";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{../../@id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant ex:manager;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "manager/name";
+    ];
+  ].
+
+

Output

+
<http://example.org/25> <http://example.com/manager> "Alice Johnson" .
+<http://example.org/25> <http://example.com/manager> "John Doe" .
+<http://example.org/35> <http://example.com/manager> "Emma Wilson" .
+<http://example.org/35> <http://example.com/manager> "Michael Green" .
+
+
+

35. RMLSTC0012e

+

Title: Complex XML source

+

Description: Tests the generation of triples from complex XML sources

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLSTC0012e/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix ex: <http://example.com/> .
+@base <http://example.com/rules/> .
+
+<#TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "companies.xml";
+    ];
+    rml:referenceFormulation rml:XPath;
+    rml:iterator "/companies/company/departments/department/employees/employee";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{name}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant ex:skill;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "skills/skill";
+    ];
+  ].
+
+

Output

+
<http://example.org/Bob%20Smith> <http://example.com/employee> "AWS" .
+<http://example.org/Bob%20Smith> <http://example.com/employee> "JavaScript" .
+<http://example.org/Bob%20Smith> <http://example.com/employee> "Python" .
+<http://example.org/Eve%20Davis> <http://example.com/employee> "Docker" .
+<http://example.org/Eve%20Davis> <http://example.com/employee> "Kubernetes" .
+<http://example.org/Eve%20Davis> <http://example.com/employee> "Terraform" .
+<http://example.org/Liam%20Brown> <http://example.com/employee> "Deep Learning" .
+<http://example.org/Liam%20Brown> <http://example.com/employee> "Machine Learning" .
+<http://example.org/Liam%20Brown> <http://example.com/employee> "Python" .
+<http://example.org/Olivia%20Martinez> <http://example.com/employee> "CRM" .
+<http://example.org/Olivia%20Martinez> <http://example.com/employee> "Lead Generation" .
+<http://example.org/Olivia%20Martinez> <http://example.com/employee> "Negotiation" .
+<http://example.org/Sarah%20Lee> <http://example.com/employee> "Copywriting" .
+<http://example.org/Sarah%20Lee> <http://example.com/employee> "Google Ads" .
+<http://example.org/Sarah%20Lee> <http://example.com/employee> "SEO" .
+<http://example.org/Sophia%20White> <http://example.com/employee> "Data Analysis" .
+<http://example.org/Sophia%20White> <http://example.com/employee> "R" .
+<http://example.org/Sophia%20White> <http://example.com/employee> "SQL" .
+
+
+

36. RMLTTC0000

+

Title: Default target

+

Description: Test exporting all triples to the default Target when not Targets are specified.

+

Error expected? No

+

Input

+
[
+  { 
+    "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
+  }
+]
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@base <http://example.com/rules/> .
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "Friends.json";
+      rml:encoding rml:UTF-8
+    ];
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+

Output

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
+<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
+
+
+

37. RMLTTC0001a

+

Title: Single Target: Subject Map

+

Description: Test exporting all triples to a single Target with a given subject.

+

Error expected? No

+

Input

+
[
+  { 
+    "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
+  }
+]
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@base <http://example.com/rules/> .
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "Friends.json";
+    ];
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+    rml:logicalTarget <#TargetDump1>;
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:FilePath;
+    rml:root rml:CurrentWorkingDirectory;
+    rml:path "./dump1.nq";
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+

Output 1

+

+
+

Output 2

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
+<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
+
+
+

38. RMLTTC0001b

+

Title: Single Target: Predicate Map

+

Description: Test exporting all triples to a single Target with a given predicate.

+

Error expected? No

+

Input

+
[
+  { 
+    "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
+  }
+]
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@base <http://example.com/rules/> .
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "Friends.json";
+    ];
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+      rml:logicalTarget <#TargetDump1>;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:FilePath;
+    rml:root rml:CurrentWorkingDirectory;
+    rml:path "./dump1.nq";
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+

Output 1

+
<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".
+
+

Output 2

+
<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" .
+
+
+

39. RMLTTC0001c

+

Title: Single Target: Object Map

+

Description: Test exporting all triples to a single Target with a given object reference.

+

Error expected? No

+

Input

+
[
+  { 
+    "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
+  }
+]
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@base <http://example.com/rules/> .
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "Friends.json";
+    ];
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+      rml:logicalTarget <#TargetDump1>;
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:FilePath;
+    rml:root rml:CurrentWorkingDirectory;
+    rml:path "./dump1.nq";
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+

Output 1

+
<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".
+
+

Output 2

+
<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" .
+
+
+

40. RMLTTC0001d

+

Title: Single Target: Graph Map

+

Description: Test exporting all triples within a named graph to a single Target.

+

Error expected? No

+

Input

+
[
+  { 
+    "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
+  }
+]
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix dcat: <http://www.w3.org/ns/dcat#> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@prefix ex: <http://example.org/> .
+@base <http://example.com/rules/> .
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "Friends.json";
+    ];
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+    rml:graphMap [ a rml:GraphMap;
+      rml:constant ex:PeopleGraph;
+      rml:logicalTarget <#TargetDump1>;
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:FilePath;
+    rml:root rml:CurrentWorkingDirectory;
+    rml:path "./dump1.nq";
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+

Output 1

+

+
+

Output 2

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" <http://example.org/PeopleGraph>.
+<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" <http://example.org/PeopleGraph> .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" <http://example.org/PeopleGraph> .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" <http://example.org/PeopleGraph> .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" <http://example.org/PeopleGraph> .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" <http://example.org/PeopleGraph> .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" <http://example.org/PeopleGraph> .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" <http://example.org/PeopleGraph> .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" <http://example.org/PeopleGraph> .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" <http://example.org/PeopleGraph> .
+
+
+

41. RMLTTC0001e

+

Title: Single Target: Language Map

+

Description: Test exporting all triples with a given language tag to a single Target.

+

Error expected? No

+

Input

+
[
+  { 
+    "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
+  }
+]
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@base <http://example.com/rules/> .
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "Friends.json";
+    ];
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+      rml:languageMap [ a rml:LanguageMap;
+        rml:constant "en";
+        rml:logicalTarget <#TargetDump1>;
+      ];
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:FilePath;
+    rml:root rml:CurrentWorkingDirectory;
+    rml:path "./dump1.nq";
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+

Output 1

+
<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".
+
+

Output 2

+
<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 .
+
+
+

42. RMLTTC0001f

+

Title: Single Target: Datatype Map

+

Description: Test exporting all triples with a given datatype to a single Target.

+

Error expected? No

+

Input

+
[
+  { 
+    "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
+  }
+]
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@base <http://example.com/rules/> .
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "Friends.json";
+    ];
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+      rml:datatypeMap [ a rml:DatatypeMap;
+        rml:constant xsd:integer;
+        rml:logicalTarget <#TargetDump1>;
+      ];
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:FilePath;
+    rml:root rml:CurrentWorkingDirectory;
+    rml:path "./dump1.nq";
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+

Output 1

+
<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" .
+
+

Output 2

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33"^^<http://www.w3.org/2001/XMLSchema#integer>.
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34"^^<http://www.w3.org/2001/XMLSchema#integer>.
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35"^^<http://www.w3.org/2001/XMLSchema#integer>.
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36"^^<http://www.w3.org/2001/XMLSchema#integer>.
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37"^^<http://www.w3.org/2001/XMLSchema#integer>.
+
+
+

43. RMLTTC0002a

+

Title: Multiple Targets: Same Term Map

+

Description: Test exporting all triples to multiple Targets in the same Term Map.

+

Error expected? No

+

Input

+
[
+  { 
+    "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
+  }
+]
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@base <http://example.com/rules/> .
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "Friends.json";
+    ];
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+    rml:logicalTarget <#TargetDump1>;
+    rml:logicalTarget <#TargetDump2>;
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:FilePath;
+    rml:root rml:CurrentWorkingDirectory;
+    rml:path "./dump1.nq";
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+<#TargetDump2> a rml:LogicalTarget;
+  rml:target [ a rml:FilePath;
+    rml:root rml:CurrentWorkingDirectory;
+    rml:path "./dump2.nq";
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+

Output 1

+

+
+

Output 2

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
+<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
+
+

Output 3

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
+<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
+
+
+

44. RMLTTC0002b

+

Title: Multiple Targets: Subject Map and Predicate Map

+

Description: Test exporting all triples to a Target in a Subject Map and a Target in a Predicate Map.

+

Error expected? No

+

Input

+
[
+  { 
+    "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
+  }
+]
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@base <http://example.com/rules/> .
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "Friends.json";
+    ];
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+    rml:logicalTarget <#TargetDump1>;
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+      rml:logicalTarget <#TargetDump2>;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:FilePath;
+    rml:root rml:CurrentWorkingDirectory;
+    rml:path "./dump1.nq";
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+<#TargetDump2> a rml:LogicalTarget;
+  rml:target [ a rml:FilePath;
+    rml:root rml:CurrentWorkingDirectory;
+    rml:path "./dump2.nq";
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+

Output 1

+

+
+

Output 2

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
+<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
+
+

Output 3

+
<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" .
+
+
+

45. RMLTTC0002c

+

Title: Multiple Targets: Subject Map and Object Map

+

Description: Test exporting all triples to a Target in a Subject Map and a Target in a Object Map.

+

Error expected? No

+

Input

+
[
+  { 
+    "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
+  }
+]
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@base <http://example.com/rules/> .
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "Friends.json";
+    ];
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+    rml:logicalTarget <#TargetDump1>;
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+      rml:logicalTarget <#TargetDump2>;
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:FilePath;
+    rml:root rml:CurrentWorkingDirectory;
+    rml:path "./dump1.nq";
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+<#TargetDump2> a rml:LogicalTarget;
+  rml:target [ a rml:FilePath;
+    rml:root rml:CurrentWorkingDirectory;
+    rml:path "./dump2.nq";
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+

Output 1

+

+
+

Output 2

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
+<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
+
+

Output 3

+
<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" .
+
+
+

46. RMLTTC0002d

+

Title: Multiple Targets: Predicate Map and Object Map

+

Description: Test exporting all triples to a Target in a Predicate Map and a Target in a Object Map.

+

Error expected? No

+

Input

+
[
+  { 
+    "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
+  }
+]
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@base <http://example.com/rules/> .
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "Friends.json";
+    ];
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+      rml:logicalTarget <#TargetDump1>;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+      rml:logicalTarget <#TargetDump2>;
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:FilePath;
+    rml:root rml:CurrentWorkingDirectory;
+    rml:path "./dump1.nq";
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+<#TargetDump2> a rml:LogicalTarget;
+  rml:target [ a rml:FilePath;
+    rml:root rml:CurrentWorkingDirectory;
+    rml:path "./dump2.nq";
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+

Output 1

+

+
+

Output 2

+
<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" .
+
+

Output 3

+
<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" .
+
+
+

47. RMLTTC0002e

+

Title: Multiple Targets: Subject Map, Predicate Map, and Object Map

+

Description: Test exporting all triples to a Target in a Subject Map, a Target in a Predicate Map, and a Target in a Object Map.

+

Error expected? No

+

Input

+
[
+  { 
+    "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
+  }
+]
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@base <http://example.com/rules/> .
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "Friends.json";
+    ];
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+    rml:logicalTarget <#TargetDump3>;
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+      rml:logicalTarget <#TargetDump1>;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+      rml:logicalTarget <#TargetDump2>;
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:FilePath;
+    rml:root rml:CurrentWorkingDirectory;
+    rml:path "./dump1.nq";
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+<#TargetDump2> a rml:LogicalTarget;
+  rml:target [ a rml:FilePath;
+    rml:root rml:CurrentWorkingDirectory;
+    rml:path "./dump2.nq";
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+<#TargetDump3> a rml:LogicalTarget;
+  rml:target [ a rml:FilePath;
+    rml:root rml:CurrentWorkingDirectory;
+    rml:path "./dump3.nq";
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+

Output 1

+

+
+

Output 2

+
<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" .
+
+

Output 3

+
<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" .
+
+
+

48. RMLTTC0002f

+

Title: Multiple Targets: Subject Map and Graph Map

+

Description: Test exporting all triples to a Target in a Subject Map and a Target in a Graph Map.

+

Error expected? No

+

Input

+
[
+  { 
+    "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
+  }
+]
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@prefix ex: <http://example.org/> .
+@base <http://example.com/rules/> .
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "Friends.json";
+    ];
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+    rml:logicalTarget <#TargetDump1>;
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:graphMap [ a rml:GraphMap;
+      rml:constant ex:PeopleGraph;
+      rml:logicalTarget <#TargetDump2>;
+    ];
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:FilePath;
+    rml:root rml:CurrentWorkingDirectory;
+    rml:path "./dump1.nq";
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+<#TargetDump2> a rml:LogicalTarget;
+  rml:target [ a rml:FilePath;
+    rml:root rml:CurrentWorkingDirectory;
+    rml:path "./dump2.nq";
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+

Output 1

+

+
+

Output 2

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
+<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" <http://example.org/PeopleGraph> .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" <http://example.org/PeopleGraph> .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" <http://example.org/PeopleGraph> .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" <http://example.org/PeopleGraph> .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" <http://example.org/PeopleGraph> .
+
+

Output 3

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

49. RMLTTC0002g

+

Title: Multiple Targets: Predicate Map and Graph Map

+

Description: Test exporting all triples to a Target in a Predicate Map and a Target in a Graph Map.

+

Error expected? No

+

Input

+
[
+  { 
+    "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
+  }
+]
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@prefix ex: <http://example.org/> .
+@base <http://example.com/rules/> .
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "Friends.json";
+    ];
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:graphMap [ a rml:GraphMap;
+      rml:constant ex:PeopleGraph;
+      rml:logicalTarget <#TargetDump2>;
+    ];
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+      rml:logicalTarget <#TargetDump1>;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:FilePath;
+    rml:root rml:CurrentWorkingDirectory;
+    rml:path "./dump1.nq";
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+<#TargetDump2> a rml:LogicalTarget;
+  rml:target [ a rml:FilePath;
+    rml:root rml:CurrentWorkingDirectory;
+    rml:path "./dump2.nq";
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+

Output 1

+

+
+

Output 2

+
<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" .
+
+

Output 3

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

50. RMLTTC0002h

+

Title: Multiple Targets: Object Map and Graph Map

+

Description: Test exporting all triples to a Target in a Object Map and a Target in a Graph Map.

+

Error expected? No

+

Input

+
[
+  { 
+    "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
+  }
+]
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@prefix ex: <http://example.org/> .
+@base <http://example.com/rules/> .
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "Friends.json";
+    ];
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:graphMap [ a rml:GraphMap;
+      rml:constant ex:PeopleGraph;
+      rml:logicalTarget <#TargetDump2>;
+    ];
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+      rml:logicalTarget <#TargetDump1>;
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:FilePath;
+    rml:root rml:CurrentWorkingDirectory;
+    rml:path "./dump1.nq";
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+<#TargetDump2> a rml:LogicalTarget;
+  rml:target [ a rml:FilePath;
+    rml:root rml:CurrentWorkingDirectory;
+    rml:path "./dump2.nq";
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+

Output 1

+

+
+

Output 2

+
<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" .
+
+

Output 3

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

51. RMLTTC0002i

+

Title: Multiple Targets: Language Map and Graph Map

+

Description: Test exporting all triples to a Target in a Language Map and a Target in a Graph Map.

+

Error expected? No

+

Input

+
[
+  { 
+    "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
+  }
+]
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@prefix ex: <http://example.org/> .
+@base <http://example.com/rules/> .
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "Friends.json";
+    ];
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+      rml:languageMap [ a rml:LanguageMap;
+        rml:constant "en";
+        rml:logicalTarget <#TargetDump2>;
+      ];
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:graphMap [ a rml:GraphMap;
+      rml:constant ex:PeopleGraph; 
+      rml:logicalTarget <#TargetDump1>;
+    ];
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:FilePath;
+    rml:root rml:CurrentWorkingDirectory;
+    rml:path "./dump1.nq";
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+<#TargetDump2> a rml:LogicalTarget;
+  rml:target [ a rml:FilePath;
+    rml:root rml:CurrentWorkingDirectory;
+    rml:path "./dump2.nq";
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+

Output 1

+

+
+

Output 2

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" <http://example.org/PeopleGraph> .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" <http://example.org/PeopleGraph> .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" <http://example.org/PeopleGraph> .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" <http://example.org/PeopleGraph> .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" <http://example.org/PeopleGraph> .
+
+

Output 3

+
<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 .
+
+
+

52. RMLTTC0002j

+

Title: Multiple Targets: Language Map and Object Map

+

Description: Test exporting all triples to a Target in a Language Map and a Target in a Object Map.

+

Error expected? No

+

Input

+
[
+  { 
+    "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
+  }
+]
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@prefix ex: <http://example.org> .
+@base <http://example.com/rules/> .
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "Friends.json";
+    ];
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+      rml:languageMap [ a rml:LanguageMap;
+        rml:constant "en";
+        rml:logicalTarget <#TargetDump2>;
+      ];
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+      rml:logicalTarget <#TargetDump1>;
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:Target, rml:FilePath;
+    rml:root rml:CurrentWorkingDirectory;
+    rml:path "./dump1.nq";
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+<#TargetDump2> a rml:LogicalTarget;
+  rml:target [ a rml:Target, rml:FilePath;
+    rml:root rml:CurrentWorkingDirectory;
+    rml:path "./dump2.nq";
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+

Output 1

+

+
+

Output 2

+
<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" .
+
+

Output 3

+
<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 .
+
+
+

53. RMLTTC0002k

+

Title: Multiple Targets: Datatype Map and Graph Map

+

Description: Test exporting all triples to a Target in a Datatype Map and a Target in a Graph Map.

+

Error expected? No

+

Input

+
[
+  { 
+    "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
+  }
+]
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix ex: <http://example.org/> .
+@base <http://example.com/rules/> .
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "Friends.json";
+    ];
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:graphMap [ a rml:GraphMap;
+      rml:constant ex:PeopleGraph; 
+      rml:logicalTarget <#TargetDump1>;
+    ];
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+      rml:datatypeMap [ a rml:DatatypeMap;
+        rml:constant xsd:integer;
+        rml:logicalTarget <#TargetDump2>;
+      ];
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:Target, rml:FilePath;
+    rml:root rml:CurrentWorkingDirectory;
+    rml:path "./dump1.nq";
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+<#TargetDump2> a rml:LogicalTarget;
+  rml:target [ a rml:Target, rml:FilePath;
+    rml:root rml:CurrentWorkingDirectory;
+    rml:path "./dump2.nq";
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+

Output 1

+
<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 .
+
+

Output 2

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33"^^<http://www.w3.org/2001/XMLSchema#integer> <http://example.org/PeopleGraph> .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34"^^<http://www.w3.org/2001/XMLSchema#integer> <http://example.org/PeopleGraph> .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35"^^<http://www.w3.org/2001/XMLSchema#integer> <http://example.org/PeopleGraph> .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36"^^<http://www.w3.org/2001/XMLSchema#integer> <http://example.org/PeopleGraph> .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37"^^<http://www.w3.org/2001/XMLSchema#integer> <http://example.org/PeopleGraph> .
+
+

Output 3

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33"^^<http://www.w3.org/2001/XMLSchema#integer> <http://example.org/PeopleGraph> .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34"^^<http://www.w3.org/2001/XMLSchema#integer> <http://example.org/PeopleGraph> .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35"^^<http://www.w3.org/2001/XMLSchema#integer> <http://example.org/PeopleGraph> .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36"^^<http://www.w3.org/2001/XMLSchema#integer> <http://example.org/PeopleGraph> .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37"^^<http://www.w3.org/2001/XMLSchema#integer> <http://example.org/PeopleGraph> .
+
+
+

54. RMLTTC0002l

+

Title: Multiple Targets: Datatype Map and Object Map

+

Description: Test exporting all triples to a Target in a Datatype Map and a Target in a Object Map.

+

Error expected? No

+

Input

+
[
+  { 
+    "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
+  }
+]
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix ex: <http://example.org/> .
+@base <http://example.com/rules/> .
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "Friends.json";
+    ];
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+      rml:logicalTarget <#TargetDump1>;
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+      rml:datatypeMap [ a rml:DatatypeMap;
+        rml:constant xsd:integer;
+        rml:logicalTarget <#TargetDump2>;
+      ];
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:Target, rml:FilePath;
+    rml:root rml:CurrentWorkingDirectory;
+    rml:path "./dump1.nq";
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+<#TargetDump2> a rml:LogicalTarget;
+  rml:target [ a rml:Target, rml:FilePath;
+    rml:root rml:CurrentWorkingDirectory;
+    rml:path "./dump2.nq";
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+

Output 1

+

+
+

Output 2

+
<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" .
+
+

Output 3

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37"^^<http://www.w3.org/2001/XMLSchema#integer> .
+
+
+

55. RMLTTC0002m

+

Title: Multiple Targets: Multiple Predicate Maps

+

Description: Test exporting all triples to Targets in multiple Predicate Maps.

+

Error expected? No

+

Input

+
[
+  { 
+    "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
+  }
+]
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@base <http://example.com/rules/> .
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "Friends.json";
+    ];
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+      rml:logicalTarget <#TargetDump1>;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+      rml:logicalTarget <#TargetDump2>;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:Target, rml:FilePath;
+    rml:root rml:CurrentWorkingDirectory;
+    rml:path "./dump1.nq";
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+<#TargetDump2> a rml:LogicalTarget;
+  rml:target [ a rml:Target, rml:FilePath;
+    rml:root rml:CurrentWorkingDirectory;
+    rml:path "./dump2.nq";
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+

Output 1

+

+
+

Output 2

+
<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" .
+
+

Output 3

+
<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" .
+
+
+

56. RMLTTC0002n

+

Title: Multiple Targets: Multiple Object Maps

+

Description: Test exporting all triples to Targets in multiple Object Maps.

+

Error expected? No

+

Input

+
[
+  { 
+    "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
+  }
+]
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@base <http://example.com/rules/> .
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "Friends.json";
+    ];
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+      rml:logicalTarget <#TargetDump1>;
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+      rml:logicalTarget <#TargetDump2>;
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:Target, rml:FilePath;
+    rml:root rml:CurrentWorkingDirectory;
+    rml:path "./dump1.nq";
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+<#TargetDump2> a rml:LogicalTarget;
+  rml:target [ a rml:Target, rml:FilePath;
+    rml:root rml:CurrentWorkingDirectory;
+    rml:path "./dump2.nq";
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+

Output 1

+

+
+

Output 2

+
<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" .
+
+

Output 3

+
<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" .
+
+
+

57. RMLTTC0002o

+

Title: Multiple Targets: Multiple Graph Maps

+

Description: Test exporting all triples to Targets in multiple Graph Maps.

+

Error expected? No

+

Input

+
[
+  { 
+    "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
+  }
+]
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix dcat: <http://www.w3.org/ns/dcat#> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@prefix ex: <http://example.org/> .
+@base <http://example.com/rules/> .
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "Friends.json";
+    ];
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+    rml:graphMap [ a rml:GraphMap;
+      rml:constant ex:PeopleGraph1;
+      rml:logicalTarget <#TargetDump1>;
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+    rml:graphMap [ a rml:GraphMap;
+      rml:constant ex:PeopleGraph2;
+      rml:logicalTarget <#TargetDump2>;
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:Target, rml:FilePath;
+    rml:root rml:CurrentWorkingDirectory;
+    rml:path "./dump1.nq";
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+<#TargetDump2> a rml:LogicalTarget;
+  rml:target [ a rml:Target, rml:FilePath;
+    rml:root rml:CurrentWorkingDirectory;
+    rml:path "./dump2.nq";
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+

Output 1

+

+
+

Output 2

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" <http://example.org/PeopleGraph1>.
+<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" <http://example.org/PeopleGraph1> .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" <http://example.org/PeopleGraph1> .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" <http://example.org/PeopleGraph1> .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" <http://example.org/PeopleGraph1> .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" <http://example.org/PeopleGraph1> .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" <http://example.org/PeopleGraph1> .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" <http://example.org/PeopleGraph1> .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" <http://example.org/PeopleGraph1> .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" <http://example.org/PeopleGraph1> .
+
+

Output 3

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

58. RMLTTC0002p

+

Title: Multiple Targets: Multiple Language Maps

+

Description: Test exporting all triples to Targets in multiple Language Maps.

+

Error expected? No

+

Input

+
[
+  { 
+    "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
+  }
+]
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@base <http://example.com/rules/> .
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "Friends.json";
+    ];
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+      rml:languageMap [ a rml:LanguageMap;
+        rml:constant "en";
+        rml:logicalTarget <#TargetDump1>;
+      ];
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+      rml:languageMap [ a rml:LanguageMap;
+        rml:constant "nl";
+        rml:logicalTarget <#TargetDump2>;
+      ];
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:Target, rml:FilePath;
+    rml:root rml:CurrentWorkingDirectory;
+    rml:path "./dump1.nq";
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+<#TargetDump2> a rml:LogicalTarget;
+  rml:target [ a rml:Target, rml:FilePath;
+    rml:root rml:CurrentWorkingDirectory;
+    rml:path "./dump2.nq";
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+

Output 1

+
<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".
+
+

Output 2

+
<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 .
+
+

Output 3

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller"@nl .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green"@nl .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani"@nl .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing"@nl .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller"@nl .
+
+
+

59. RMLTTC0002q

+

Title: Multiple Targets: Multiple Datatype Maps

+

Description: Test exporting all triples to Targets in multiple Datatype Maps.

+

Error expected? No

+

Input

+
[
+  { 
+    "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
+  }
+]
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@base <http://example.com/rules/> .
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "Friends.json";
+    ];
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+      rml:datatypeMap [ a rml:DatatypeMap;
+        rml:constant xsd:integer;
+        rml:logicalTarget <#TargetDump1>;
+      ];
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+      rml:datatypeMap [ a rml:DatatypeMap;
+        rml:constant xsd:double;
+        rml:logicalTarget <#TargetDump2>;
+      ];
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:Target, rml:FilePath;
+    rml:root rml:CurrentWorkingDirectory;
+    rml:path "./dump1.nq";
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+<#TargetDump2> a rml:LogicalTarget;
+  rml:target [ a rml:Target, rml:FilePath;
+    rml:root rml:CurrentWorkingDirectory;
+    rml:path "./dump2.nq";
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+

Output 1

+
<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" .
+
+

Output 2

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33"^^<http://www.w3.org/2001/XMLSchema#integer>.
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34"^^<http://www.w3.org/2001/XMLSchema#integer>.
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35"^^<http://www.w3.org/2001/XMLSchema#integer>.
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36"^^<http://www.w3.org/2001/XMLSchema#integer>.
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37"^^<http://www.w3.org/2001/XMLSchema#integer>.
+
+

Output 3

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33"^^<http://www.w3.org/2001/XMLSchema#double>.
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34"^^<http://www.w3.org/2001/XMLSchema#double>.
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35"^^<http://www.w3.org/2001/XMLSchema#double>.
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36"^^<http://www.w3.org/2001/XMLSchema#double>.
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37"^^<http://www.w3.org/2001/XMLSchema#double>.
+
+
+

60. RMLTTC0002r

+

Title: Multiple Targets: Multiple Term Maps with same Target

+

Description: Test exporting all triples to same Target in multiple Term Maps.

+

Error expected? No

+

Input

+
[
+  { 
+    "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
+  }
+]
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@base <http://example.com/rules/> .
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "Friends.json";
+    ];
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+      rml:logicalTarget <#TargetDump1>;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+      rml:logicalTarget <#TargetDump1>;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:Target, rml:FilePath;
+    rml:root rml:CurrentWorkingDirectory;
+    rml:path "./dump1.nq";
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+

Output 1

+

+
+

Output 2

+
<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" .
+<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" .
+
+
+

61. RMLTTC0003a

+

Title: Overriding Targets: Seperate Triples Map

+

Description: Test exporting some triples to a different Target with a separate Triples Map.

+

Error expected? No

+

Input

+
[
+  { 
+    "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
+  }
+]
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@base <http://example.com/rules/> .
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "Friends.json";
+    ];
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+    rml:logicalTarget <#TargetDump2>;
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+<#TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "Friends.json";
+    ];
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+    rml:logicalTarget <#TargetDump1>;
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:Target, rml:FilePath;
+    rml:root rml:CurrentWorkingDirectory;
+    rml:path "./dump1.nq";
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+<#TargetDump2> a rml:LogicalTarget;
+  rml:target [ a rml:Target, rml:FilePath;
+    rml:root rml:CurrentWorkingDirectory;
+    rml:path "./dump2.nq";
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+

Output 1

+

+
+

Output 2

+
<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" .
+
+

Output 3

+
<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" .
+
+
+

62. RMLTTC0004a

+

Title: Target JSON-LD

+

Description: Test export all triples as JSON-LD

+

Error expected? No

+

Input

+
[
+  { 
+    "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
+  }
+]
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@base <http://example.com/rules/> .
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "Friends.json";
+    ];
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+    rml:logicalTarget <#TargetDump1>;
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:Target, rml:FilePath;
+    rml:root rml:CurrentWorkingDirectory;
+    rml:path "./dump1.jsonld";
+  ];
+  rml:serialization formats:JSON-LD;
+.
+
+

Output 1

+

+
+

Output 2

+
{
+  "@context": { 
+    "foaf": "http://xmlns.com/foaf/0.1/"
+  },
+  "@graph": [
+    {                                                                                
+
+      "@id": "http://example.org/0",
+      "foaf:name": "Monica Geller",
+      "foaf:age": "33"
+    },
+    {                                                                                
+      "@id": "http://example.org/1",
+      "foaf:name": "Rachel Green",
+      "foaf:age": "34"
+    },
+    {                                                                                
+      "@id": "http://example.org/2",
+      "foaf:name": "Joey Tribbiani",
+      "foaf:age": "35"
+    },
+    {                                                                                
+      "@id": "http://example.org/3",
+      "foaf:name": "Chandler Bing",
+      "foaf:age": "36"
+    },
+      {                                                                                
+      "@id": "http://example.org/4",
+      "foaf:name": "Ross Geller",
+      "foaf:age": "37"
+    }
+  ]
+}
+
+
+

63. RMLTTC0004b

+

Title: Target N3

+

Description: Test export all triples as N3

+

Error expected? No

+

Input

+
[
+  { 
+    "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
+  }
+]
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@base <http://example.com/rules/> .
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "Friends.json";
+    ];
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+    rml:logicalTarget <#TargetDump1>;
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:Target, rml:FilePath;
+    rml:root rml:CurrentWorkingDirectory;
+    rml:path "./dump1.n3";
+  ];
+  rml:serialization formats:N3;
+.
+
+

Output 1

+

+
+

Output 2

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix ex: <http://example.org/> .
+ex:0 <foaf:age> "33" ;
+     <foaf:name> "Monica Geller" .
+ex:1 <foaf:age> "34" ;
+     <foaf:name> "Rachel Green" .
+ex:2 <foaf:age> "35" ;
+     <foaf:name> "Joey Tribbiani" .
+ex:3 <foaf:age> "36" ;
+     <foaf:name> "Chandler Bing" .
+ex:4 <foaf:age> "37" ;
+     <foaf:name> "Ross Geller" .
+
+
+

64. RMLTTC0004c

+

Title: Target N-Triples

+

Description: Test export all triples as N-Triples

+

Error expected? No

+

Input

+
[
+  { 
+    "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
+  }
+]
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@base <http://example.com/rules/> .
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "Friends.json";
+    ];
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+    rml:logicalTarget <#TargetDump1>;
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:Target, rml:FilePath;
+    rml:root rml:CurrentWorkingDirectory;
+    rml:path "./dump1.nt";
+  ];
+  rml:serialization formats:N-Triples;
+.
+
+

Output 1

+

+
+

Output 2

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
+<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
+
+
+

65. RMLTTC0004d

+

Title: Target N-Quads

+

Description: Test export all triples as N-Quads

+

Error expected? No

+

Input

+
[
+  { 
+    "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
+  }
+]
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@base <http://example.com/rules/> .
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "Friends.json";
+    ];
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+    rml:logicalTarget <#TargetDump1>;
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:Target, rml:FilePath;
+    rml:root rml:CurrentWorkingDirectory;
+    rml:path "./dump1.nq";
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+

Output 1

+

+
+

Output 2

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
+<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
+
+
+

66. RMLTTC0004e

+

Title: Target RDF/JSON

+

Description: Test export all triples as RDF/JSON

+

Error expected? No

+

Input

+
[
+  { 
+    "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
+  }
+]
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@base <http://example.com/rules/> .
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "Friends.json";
+    ];
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+    rml:logicalTarget <#TargetDump1>;
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:Target, rml:FilePath;
+    rml:root rml:CurrentWorkingDirectory;
+    rml:path "./dump1.rdfjson";
+  ];
+  rml:serialization formats:RDF_JSON;
+.
+
+

Output 1

+

+
+

Output 2

+
{
+    "http://example.org/0" : {
+        "http://xmlns.com/foaf/0.1/age" : [ { "value" : "33" } ],
+        "http://xmlns.com/foaf/0.1/name" : [ { "value" : "Monica Geller" } ]
+    },
+    "http://example.org/1" : {
+        "http://xmlns.com/foaf/0.1/age" : [ { "value" : "34" } ],
+        "http://xmlns.com/foaf/0.1/name" : [ { "value" : "Rachel Green" } ]
+    },
+    "http://example.org/2" : {
+        "http://xmlns.com/foaf/0.1/age" : [ { "value" : "35" } ],
+        "http://xmlns.com/foaf/0.1/name" : [ { "value" : "Joey Tribbiani" } ]
+    },
+    "http://example.org/3" : {
+        "http://xmlns.com/foaf/0.1/age" : [ { "value" : "36" } ],
+        "http://xmlns.com/foaf/0.1/name" : [ { "value" : "Chandler Bing" } ]
+    },
+    "http://example.org/4" : {
+        "http://xmlns.com/foaf/0.1/age" : [ { "value" : "37" } ],
+        "http://xmlns.com/foaf/0.1/name" : [ { "value" : "Ross Geller" } ]
+    }
+}
+
+
+

67. RMLTTC0004f

+

Title: Target RDF/XML

+

Description: Test export all triples as RDF/XML

+

Error expected? No

+

Input

+
[
+  { 
+    "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
+  }
+]
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@base <http://example.com/rules/> .
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "Friends.json";
+    ];
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+    rml:logicalTarget <#TargetDump1>;
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:Target, rml:FilePath;
+    rml:root rml:CurrentWorkingDirectory;
+    rml:path "./dump1.rdfxml";
+  ];
+  rml:serialization formats:RDF_XML;
+.
+
+

Output 1

+

+
+

Output 2

+
<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:age>33</foaf:age>
+    <foaf:name>Monica Geller</foaf:name>
+  </rdf:Description>
+  <rdf:Description rdf:about="http://example.org/1">
+    <foaf:age>34</foaf:age>
+    <foaf:name>Rachel Green</foaf:name>
+  </rdf:Description>
+  <rdf:Description rdf:about="http://example.org/2">
+    <foaf:age>35</foaf:age>
+    <foaf:name>Joey Tribbiani</foaf:name>
+  </rdf:Description>
+  <rdf:Description rdf:about="http://example.org/3">
+    <foaf:age>36</foaf:age>
+    <foaf:name>Chandler Bing</foaf:name>
+  </rdf:Description>
+  <rdf:Description rdf:about="http://example.org/4">
+    <foaf:age>37</foaf:age>
+    <foaf:name>Ross Geller</foaf:name>
+  </rdf:Description>
+</rdf:RDF>
+
+
+

68. RMLTTC0004g

+

Title: Target Turtle

+

Description: Test export all triples as Turtle

+

Error expected? No

+

Input

+
[
+  { 
+    "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
+  }
+]
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@base <http://example.com/rules/> .
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "Friends.json";
+    ];
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+    rml:logicalTarget <#TargetDump1>;
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:Target, rml:FilePath;
+    rml:root rml:CurrentWorkingDirectory;
+    rml:path "./dump1.ttl";
+  ];
+  rml:serialization formats:Turtle;
+.
+
+

Output 1

+

+
+

Output 2

+
<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" .
+<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" .
+
+
+

69. RMLTTC0005a

+

Title: Target UTF-8

+

Description: Test export all triples with UTF-8 encoding

+

Error expected? No

+

Input

+
[
+  { 
+    "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
+  }
+]
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@base <http://example.com/rules/> .
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "Friends.json";
+    ];
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+    rml:logicalTarget <#TargetDump1>;
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:Target, rml:FilePath;
+    rml:root rml:CurrentWorkingDirectory;
+    rml:path "./dump1.nq";
+  ];
+  rml:serialization formats:N-Quads;
+  rml:encoding rml:UTF-8;
+.
+
+

Output 1

+

+
+

Output 2

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
+<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
+
+
+

70. RMLTTC0005b

+

Title: Target UTF-16

+

Description: Test export all triples with UTF-16 encoding

+

Error expected? No

+

Input

+
[
+  { 
+    "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
+  }
+]
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@base <http://example.com/rules/> .
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "Friends.json";
+    ];
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+    rml:logicalTarget <#TargetDump1>;
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:Target, rml:FilePath;
+    rml:root rml:CurrentWorkingDirectory;
+    rml:path "./dump1.nq";
+  ];
+  rml:serialization formats:N-Quads;
+  rml:encoding rml:UTF-16;
+.
+
+

Output 1

+

+
+

Output 2

+
��<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
+<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
+
+
+
+

71. RMLTTC0006a

+

Title: Target no compression

+

Description: Test export all triples with no compression

+

Error expected? No

+

Input

+
[
+  { 
+    "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
+  }
+]
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@base <http://example.com/rules/> .
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "Friends.json";
+    ];
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+    rml:logicalTarget <#TargetDump1>;
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:Target, rml:FilePath;
+    rml:root rml:CurrentWorkingDirectory;
+    rml:path "./dump1.nq";
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+

Output 1

+

+
+

Output 2

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
+<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
+
+
+

72. RMLTTC0006b

+

Title: Target GZip compression

+

Description: Test export all triples with GZip compression

+

Error expected? No

+

Input

+
[
+  { 
+    "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
+  }
+]
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@base <http://example.com/rules/> .
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "Friends.json";
+    ];
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+    rml:logicalTarget <#TargetDump1>;
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:Target, rml:FilePath;
+    rml:root rml:CurrentWorkingDirectory;
+    rml:path "./dump1.nq.gz";
+  ];
+  rml:serialization formats:N-Quads;
+  rml:compression rml:gzip;
+.
+
+

Output 1

+

+
+

Output 2 + dump1.nq.gz

+
+

73. RMLTTC0006c

+

Title: Target Zip compression

+

Description: Test export all triples with ZIP compression

+

Error expected? No

+

Input

+
[
+  { 
+    "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
+  }
+]
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@base <http://example.com/rules/> .
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "Friends.json";
+    ];
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+    rml:logicalTarget <#TargetDump1>;
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:Target, rml:FilePath;
+    rml:root rml:CurrentWorkingDirectory;
+    rml:path "./dump1.nq.zip";
+  ];
+  rml:serialization formats:N-Quads;
+  rml:compression rml:zip;
+.
+
+

Output 1

+

+
+

Output 2 + dump1.nq.zip

+
+

74. RMLTTC0006d

+

Title: Target TarXz compression

+

Description: Test export all triples with TarXZ compression

+

Error expected? No

+

Input

+
[
+  { 
+    "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
+  }
+]
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@prefix ex: <http://example.org/> .
+@base <http://example.com/rules/> .
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "Friends.json";
+    ];
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+    rml:logicalTarget <#TargetDump1>;
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:Target, rml:FilePath;
+    rml:root rml:CurrentWorkingDirectory;
+    rml:path "./dump1.nq.tar.xz";
+  ];
+  rml:serialization formats:N-Quads;
+  rml:compression rml:tarxz;
+.
+
+

Output 1

+

+
+

Output 2 + dump1.nq.tar.xz

+
+

75. RMLTTC0006e

+

Title: Target TarGzip compression

+

Description: Test export all triples with TarGZip compression

+

Error expected? No

+

Input

+
[
+  { 
+    "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
+  }
+]
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@base <http://example.com/rules/> .
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "Friends.json";
+    ];
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+    rml:logicalTarget <#TargetDump1>;
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:Target, rml:FilePath;
+    rml:root rml:CurrentWorkingDirectory;
+    rml:path "./dump1.nq.tar.gz";
+  ];
+  rml:serialization formats:N-Quads;
+  rml:compression rml:targz;
+.
+
+

Output 1

+

+
+

Output 2

+
����j�0�\�)B -�ҋ��0�����j &N-�o?�޸9�l��	ϟ1���%��D/UjX�6��@F*%R�H('�$B�O)�➥&��
+�$�:�����jWv]�ȹ��v����bO�ח���e�⧠O\0�ua�t��~������LӃq�4s��j]z���8zh��s��%5�u��K0W�����jo�F�K����c��R��?�d}17I-�]���%�����۷�o�M��((
+
+
+

76. RMLTTC0007a

+

Title: Target with FilePath description

+

Description: Test export all triples to a target with File path access description

+

Error expected? No

+

Input

+
[
+  { 
+    "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
+  }
+]
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@base <http://example.com/rules/> .
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "Friends.json";
+    ];
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+    rml:logicalTarget <#TargetDump1>;
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:Target, rml:FilePath;
+    rml:root rml:CurrentWorkingDirectory;
+    rml:path "./dump1.nq";
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+

Output 1

+

+
+

Output 2

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
+<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
+
+
+ + + + + \ No newline at end of file diff --git a/src/test/resources/rml-io/docs/index.html b/src/test/resources/rml-io/docs/index.html new file mode 100644 index 00000000..55fa3c7b --- /dev/null +++ b/src/test/resources/rml-io/docs/index.html @@ -0,0 +1,6880 @@ + + + + + + +RML-IO: Test Cases + + + + + + + + + + + + + + + +
+ +

RML-IO: Test Cases

+

+ Draft Community Group Report + +

+
+ +
Latest published version:
+ https://www.w3.org/RML-IO-Testcases/ +
+
Latest editor's draft:
https://w3id.org/rml/io/test-cases/
+ + + + +
Editor:
+ Dylan Van Assche + + + + (IDLab – Ghent University – imec) +
+ +
Author:
+ Dylan Van Assche + + + + (IDLab – Ghent University – imec) +
+
Feedback:
+ GitHub kg-construct/rml-io + (pull requests, + new issue, + open issues) +
+ +
+ + +
+
+ + + +

Abstract

This document defines the RML-IO test cases to the determine the RML-IO specification conformance of tools.

+
+ +

Status of This Document

+ This specification was published by the + Knowledge Graph Construction Community Group. It is not a W3C Standard nor is it + on the W3C Standards Track. + + Please note that under the + W3C Community Contributor License Agreement (CLA) + there is a limited opt-out and other conditions apply. + + Learn more about + W3C Community and Business Groups. +

+ GitHub Issues are preferred for + discussion of this specification. + + +

+ +

1. Introduction

+

This document defines the RML-IO test cases, consisting of a collection of test case documents (input and expected output). +The purpose of the test cases is to determine the conformance of tools that execute RML rules to the RML-IO specification.

+
+ +

2. Data model

+

The test cases are semantically described for re-usability and shareability following the W3C Test case description. +Each test:Testcase as the following properties:

+
    +
  • dcterms:identifier: unique ID of the test case.
  • +
  • rmltest:hasError: if an error of the RML Processor is expected or not.
  • +
  • rmltest:input: One or more input data of the test case.
  • +
  • rmltest:output: One or more output data of the test case.
  • +
  • rmltest:inputFormat: the input data format.
  • +
  • rmltest:outputFormat: the output data format.
  • +
  • rmltest:mappingDocument: the RML mapping rules in Turtle.
  • +
+
+ +

3. Test cases

+

This section describes the RML-IO test cases. These descriptions are also available as RDF. +The files are available on GitHub in the folder test-cases. +Each test case is contained in a single folder, containing three types of files:

+
    +
  • Zero or more files containing the data sources, in the case of JSON, XML, CSV, or containing the SQL statements to create the necessary tables, in the case of MySQL, PostgreSQL, and SQL Server.
  • +
  • One file with the RML rules, called mapping.ttl, in the Turtle format.
  • +
  • Zero or more files with the expected RDF. No file is provided if an error is expected that must halt the generation of the RDF because of an error.
  • +
+
+ + +

4. RMLSTC0001a

+

Title: Source with UTF-8 encoding

+

Description: Test source with UTF-8 encoding

+

Error expected? No

+

Input

+
[
+  { 
+    "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
+  }
+]
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@base <http://example.com/rules/> .
+
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "Friends.json"
+    ];
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+

Output

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
+<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
+
+
+

5. RMLSTC0001b

+

Title: Source with UTF-16 encoding

+

Description: Test source with UTF-16 encoding

+

Error expected? No

+

Input

+
��[
+  { 
+    "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
+  }
+]
+
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@base <http://example.com/rules/> .
+
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "Friends-UTF16.json"
+    ];
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+

Output

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
+<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
+
+
+

6. RMLSTC0002a

+

Title: Source no compression

+

Description: Test source without compression

+

Error expected? No

+

Input

+
[
+  { 
+    "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
+  }
+]
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@base <http://example.com/rules/> .
+
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "Friends.json"
+    ];
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+

Output

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
+<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
+
+
+

7. RMLSTC0002b

+

Title: Source GZip compression

+

Description: Test source with GZip compression

+

Error expected? No

+

Input + Friends.json.gz

+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@base <http://example.com/rules/> .
+
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "Friends.json.gz";
+      rml:compression rml:gzip;
+    ];
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+

Output

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
+<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
+
+
+

8. RMLSTC0002c

+

Title: Source Zip compression

+

Description: Test source with ZIP compression

+

Error expected? No

+

Input + Friends.json.zip

+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@base <http://example.com/rules/> .
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "Friends.json.zip";
+      rml:compression rml:zip;
+    ];
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+

Output

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
+<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
+
+
+

9. RMLSTC0002d

+

Title: Source TarXz compression

+

Description: Test source with TarXZ compression

+

Error expected? No

+

Input + Friends.json.tar.xz

+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@base <http://example.com/rules/> .
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "Friends.json.tar.xz";
+      rml:compression rml:tarxz;
+    ];
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+

Output

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
+<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
+
+
+

10. RMLSTC0002e

+

Title: Source TarGzip compression

+

Description: Test source with TarGZip compression

+

Error expected? No

+

Input + Friends.json.tar.gz

+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@base <http://example.com/rules/> .
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "Friends.json.tar.gz";
+      rml:compression rml:targz;
+    ];
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+

Output

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
+<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
+
+
+

11. RMLSTC0003

+

Title: Source with query

+

Description: Test source which requires a query

+

Error expected? No

+

Input

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
+<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@base <http://example.com/rules/> .
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+        rml:path "./Friends.nt";
+    ];
+    rml:iterator """
+    PREFIX foaf: <http://xmlns.com/foaf/0.1/>
+
+    SELECT ?person ?name ?age WHERE {
+        ?person foaf:name ?name .
+        ?person foaf:age ?age .
+    }
+    """;
+    rml:referenceFormulation formats:SPARQL_Results_CSV;
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:reference "person";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "age";
+    ];
+  ];
+.
+
+

Output

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
+<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
+
+
+

12. RMLSTC0004a

+

Title: Source with default NULL values

+

Description: Test source with default NULL values

+

Error expected? No

+

Input

+
id,name,age
+0,Monica Geller,33
+1,Rachel Green,34
+2,Joey Tribbiani,35
+3,Chandler Bing,36
+4,Ross Geller,37
+5,,
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@base <http://example.com/rules/> .
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "Friends-NULL.csv";
+    ];
+    rml:referenceFormulation rml:CSV;
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "age";
+    ];
+  ];
+.
+
+

Output

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
+<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
+
+
+

13. RMLSTC0004b

+

Title: Source with one NULL value

+

Description: Test source with one NULL value defined

+

Error expected? No

+

Input

+
id,name,age
+0,Monica Geller,33
+1,Rachel Green,34
+2,Joey Tribbiani,35
+3,Chandler Bing,36
+4,Ross Geller,37
+5,,
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@base <http://example.com/rules/> .
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "Friends-NULL.csv";
+      rml:null "";
+    ];
+    rml:referenceFormulation rml:CSV;
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "age";
+    ];
+  ];
+.
+
+

Output

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
+<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
+
+
+

14. RMLSTC0004c

+

Title: Source with multiple NULL values

+

Description: Test source with multiple NULL values defined

+

Error expected? No

+

Input

+
id,name,age
+0,Monica Geller,33
+1,Rachel Green,34
+2,Joey Tribbiani,35
+3,Chandler Bing,36
+4,Ross Geller,37
+5,,
+6,NULL,NULL
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@base <http://example.com/rules/> .
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "Friends-NULL.csv";
+      rml:null "";
+      rml:null "NULL";
+    ];
+    rml:referenceFormulation rml:CSV;
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "age";
+    ];
+  ];
+.
+
+

Output

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
+<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
+
+
+

15. RMLSTC0006a

+

Title: Source with D2RQ access description

+

Description: Test source with D2RQ access description for SQL databases

+

Error expected? No

+

Input

+
id,name,age
+0,Monica Geller,33
+1,Rachel Green,34
+2,Joey Tribbiani,35
+3,Chandler Bing,36
+4,Ross Geller,37
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@base <http://example.com/rules/> .
+
+<#D2RQSourceAccess> a rml:Source, d2rq:Database;
+  d2rq:jdbcDSN "$CONNECTIONDSN";
+  d2rq:username "$USERNAME";
+  d2rq:password "$PASSWORD"
+.
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source <#D2RQSourceAccess>;
+    rml:referenceFormulation rml:SQL2008Table;
+    rml:iterator "Friends";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "age";
+    ];
+  ];
+.
+
+

Output

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
+<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
+
+
+

16. RMLSTC0006b

+

Title: Source with a Relative Path Source

+

Description: Test access to a file

+

Error expected? No

+

Input

+
id,name,age
+0,Monica Geller,33
+1,Rachel Green,34
+2,Joey Tribbiani,35
+3,Chandler Bing,36
+4,Ross Geller,37
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@base <http://example.com/rules/> .
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath, rml:Source;
+      rml:root rml:CurrentWorkingDirectory;
+      rml:path "./Friends.csv"
+    ];
+    rml:referenceFormulation rml:CSV;
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "age";
+    ];
+  ];
+.
+
+

Output

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
+<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
+
+
+

17. RMLSTC0007a

+

Title: Source with JSONPath reference formulation

+

Description: Test source with JSONPath reference formulation

+

Error expected? No

+

Input

+
[
+  { 
+    "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
+  }
+]
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@base <http://example.com/rules/> .
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "Friends.json";
+      rml:encoding rml:UTF-8
+    ];
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+

Output

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
+<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
+
+
+

18. RMLSTC0007b

+

Title: Source with CSV reference formulation

+

Description: Test source with Tabular reference formulation

+

Error expected? No

+

Input

+
id,name,age
+0,Monica Geller,33
+1,Rachel Green,34
+2,Joey Tribbiani,35
+3,Chandler Bing,36
+4,Ross Geller,37
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@base <http://example.com/rules/> .
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "Friends.csv";
+    ];
+    rml:referenceFormulation rml:CSV;
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "age";
+    ];
+  ];
+.
+
+

Output

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
+<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
+
+
+

19. RMLSTC0007c

+

Title: Source with XPath reference formulation

+

Description: Test source with XPath reference formulation

+

Error expected? No

+

Input

+
<Friends>
+  <Character id="0">
+    <name>Monica Geller</name>
+    <age>33</age>
+  </Character>
+  <Character id="1">
+    <name>Rachel Green</name>
+    <age>34</age>
+  </Character>
+  <Character id="2">
+    <name>Joey Tribbiani</name>
+    <age>35</age>
+  </Character>
+  <Character id="3">
+    <name>Chandler Bing</name>
+    <age>36</age>
+  </Character>
+  <Character id="4">
+    <name>Ross Geller</name>
+    <age>37</age>
+  </Character>
+</Friends>
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@base <http://example.com/rules/> .
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "Friends.xml"
+    ];
+    rml:referenceFormulation rml:XPath;
+    rml:iterator "//Friends/Character";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{@id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "name/text()";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "age/text()";
+    ];
+  ];
+.
+
+

Output

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
+<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
+
+
+

20. RMLSTC0007d

+

Title: Source with XPath reference formulation with namespaces

+

Description: Test source with XPath reference formulation with namespaces

+

Error expected? No

+

Input

+
<Friends xmlns:ex="http://example.org">
+  <ex:Character id="0">
+    <ex:name>Monica Geller</ex:name>
+    <ex:age>33</ex:age>
+  </ex:Character>
+  <ex:Character id="1">
+    <ex:name>Rachel Green</ex:name>
+    <ex:age>34</ex:age>
+  </ex:Character>
+  <ex:Character id="2">
+    <ex:name>Joey Tribbiani</ex:name>
+    <ex:age>35</ex:age>
+  </ex:Character>
+  <ex:Character id="3">
+    <ex:name>Chandler Bing</ex:name>
+    <ex:age>36</ex:age>
+  </ex:Character>
+  <ex:Character id="4">
+    <ex:name>Ross Geller</ex:name>
+    <ex:age>37</ex:age>
+  </ex:Character>
+</Friends>
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@base <http://example.com/rules/> .
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "Friends.xml"
+    ];
+    rml:referenceFormulation [ a rml:XPathReferenceFormulation;
+      rml:namespace [ a rml:Namespace;
+        rml:namespacePrefix "ex";
+        rml:namespaceURL "http://example.org";
+      ];
+    ];
+    rml:iterator "//Friends/ex:Character";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{@id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "ex:name/text()";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "ex:age/text()";
+    ];
+  ];
+.
+
+

Output

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
+<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
+
+
+

21. RMLSTC0008a

+

Title: Multiple sources of same type

+

Description: Tests the generation of all triples from multiple homogeneous sources

+

Error expected? No

+

Input

+
[
+  { 
+    "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
+  }
+]
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@base <http://example.com/rules/> .
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "Friends.json";
+      rml:encoding rml:UTF-8
+    ];
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+<#TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:RelativePathSource;
+      rml:root rml:MappingDirectory;
+      rml:path "Friends2.json";
+      rml:encoding rml:UTF-8
+    ];
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+

Output

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
+<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
+<http://example.org/6> <http://xmlns.com/foaf/0.1/age> "37" .
+<http://example.org/6> <http://xmlns.com/foaf/0.1/name> "Phoebe Buffay" .
+
+
+

22. RMLSTC0008b

+

Title: Multiple sources of different type

+

Description: Tests the generation of all triples from multiple heterogeneous sources

+

Error expected? No

+

Input

+
[
+  { 
+    "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
+  }
+]
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@base <http://example.com/rules/> .
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "Friends.json";
+      rml:encoding rml:UTF-8
+    ];
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+<#TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:RelativePathSource;
+      rml:root rml:MappingDirectory;
+      rml:path "Friends.csv";
+      rml:encoding rml:UTF-8
+    ];
+    rml:referenceFormulation rml:CSV;
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "age";
+    ];
+  ];
+.
+
+

Output

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
+<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
+<http://example.org/6> <http://xmlns.com/foaf/0.1/age> "37" .
+<http://example.org/6> <http://xmlns.com/foaf/0.1/name> "Phoebe Buffay" .
+
+
+

23. RMLSTC0009a

+

Title: Source with quoted columns

+

Description: Tests the generation of triples where columns are quoted

+

Error expected? Yes

+

Input

+
"id","name","age"
+0,Monica Geller,33
+1,Rachel Green,34
+2,Joey Tribbiani,35
+3,Chandler Bing,36
+4,Ross Geller,37
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@base <http://example.com/rules/> .
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "Friends.csv";
+    ];
+    rml:referenceFormulation rml:CSV;
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "age";
+    ];
+  ];
+.
+
+
+

24. RMLSTC0010a

+

Title: Invalid CSV source, reference to invalid column

+

Description: Tests the identification of invalid CSV sources

+

Error expected? Yes

+

Input

+
id,name,age
+6,Phoebe Buffay 37
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@base <http://example.com/rules/> .
+
+<#TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "Friends.csv";
+    ];
+    rml:referenceFormulation rml:CSV;
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "age";
+    ];
+  ].
+
+
+

25. RMLSTC0010b

+

Title: Invalid CSV source, no reference to invalid column

+

Description: Tests the identification of invalid CSV sources, even when all columns referenced are valid

+

Error expected? Yes

+

Input

+
id,name,age
+6,Phoebe Buffay 37
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@base <http://example.com/rules/> .
+
+<#TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "Friends.csv";
+    ];
+    rml:referenceFormulation rml:CSV;
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "name";
+    ];
+  ].
+
+
+

26. RMLSTC0011a

+

Title: Complex JSON source

+

Description: Tests the generation of triples from complex JSON sources

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLSTC0011a/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@base <http://example.com/rules/> .
+
+<#TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "companies.json";
+    ];
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$.companies[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{name}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ].
+
+

Output

+
<http://example.org/InnovateX> <http://xmlns.com/foaf/0.1/name> "InnovateX" .
+<http://example.org/TechCorp> <http://xmlns.com/foaf/0.1/name> "TechCorp" .
+
+
+

27. RMLSTC0011b

+

Title: Complex JSON source

+

Description: Tests the generation of triples from complex JSON sources

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLSTC0011b/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix ex: <http://example.com/> .
+@base <http://example.com/rules/> .
+
+<#TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "companies.json";
+    ];
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$.companies[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{name}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant ex:department;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.departments[*].name";
+    ];
+  ].
+
+

Output

+
<http://example.org/InnovateX> <http://example.com/department> "Research & Development" .
+<http://example.org/InnovateX> <http://example.com/department> "Sales" .
+<http://example.org/TechCorp> <http://example.com/department> "Engineering" .
+<http://example.org/TechCorp> <http://example.com/department> "Marketing" .
+
+
+

28. RMLSTC0011c

+

Title: Complex JSON source

+

Description: Tests the generation of triples from complex JSON sources

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLSTC0011c/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix ex: <http://example.com/> .
+@base <http://example.com/rules/> .
+
+<#TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "companies.json";
+    ];
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$.companies[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{name}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant ex:employee;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.departments[*].employees[*].name";
+    ];
+  ].
+
+

Output

+
<http://example.org/InnovateX> <http://example.com/employee> "Liam Brown" .
+<http://example.org/InnovateX> <http://example.com/employee> "Olivia Martinez" .
+<http://example.org/InnovateX> <http://example.com/employee> "Sophia White" .
+<http://example.org/TechCorp> <http://example.com/employee> "Bob Smith" .
+<http://example.org/TechCorp> <http://example.com/employee> "Eve Davis" .
+<http://example.org/TechCorp> <http://example.com/employee> "Sarah Lee" .
+
+
+

29. RMLSTC0011d

+

Title: Complex JSON source

+

Description: Tests the generation of triples from complex JSON sources

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLSTC0011d/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix ex: <http://example.com/> .
+@base <http://example.com/rules/> .
+
+<#TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "companies.json";
+    ];
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$.companies[*].departments[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{name}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.manager.name";
+    ];
+  ].
+
+

Output

+
<http://example.org/Engineering> <http://xmlns.com/foaf/0.1/name> "Alice Johnson" .
+<http://example.org/Marketing> <http://xmlns.com/foaf/0.1/name> "John Doe" .
+<http://example.org/Research%20%26%20Development> <http://xmlns.com/foaf/0.1/name> "Emma Wilson" .
+<http://example.org/Sales> <http://xmlns.com/foaf/0.1/name> "Michael Green" .
+
+
+

30. RMLSTC0011e

+

Title: Complex JSON source

+

Description: Tests the generation of triples from complex JSON sources

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLSTC0011e/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix ex: <http://example.com/> .
+@base <http://example.com/rules/> .
+
+<#TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "companies.json";
+    ];
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$.companies[*].departments[*].employees[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{name}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant ex:skill;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.skills[*]";
+    ];
+  ].
+
+

Output

+
<http://example.org/Bob%20Smith> <http://example.com/skill> "AWS" .
+<http://example.org/Bob%20Smith> <http://example.com/skill> "JavaScript" .
+<http://example.org/Bob%20Smith> <http://example.com/skill> "Python" .
+<http://example.org/Eve%20Davis> <http://example.com/skill> "Docker" .
+<http://example.org/Eve%20Davis> <http://example.com/skill> "Kubernetes" .
+<http://example.org/Eve%20Davis> <http://example.com/skill> "Terraform" .
+<http://example.org/Liam%20Brown> <http://example.com/skill> "Deep Learning" .
+<http://example.org/Liam%20Brown> <http://example.com/skill> "Machine Learning" .
+<http://example.org/Liam%20Brown> <http://example.com/skill> "Python" .
+<http://example.org/Olivia%20Martinez> <http://example.com/skill> "CRM" .
+<http://example.org/Olivia%20Martinez> <http://example.com/skill> "Lead Generation" .
+<http://example.org/Olivia%20Martinez> <http://example.com/skill> "Negotiation" .
+<http://example.org/Sarah%20Lee> <http://example.com/skill> "Copywriting" .
+<http://example.org/Sarah%20Lee> <http://example.com/skill> "Google Ads" .
+<http://example.org/Sarah%20Lee> <http://example.com/skill> "SEO" .
+<http://example.org/Sophia%20White> <http://example.com/skill> "Data Analysis" .
+<http://example.org/Sophia%20White> <http://example.com/skill> "R" .
+<http://example.org/Sophia%20White> <http://example.com/skill> "SQL" .
+
+
+

31. RMLSTC0012a

+

Title: Complex XML source

+

Description: Tests the generation of triples from complex XML sources

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLSTC0012a/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix ex: <http://example.com/> .
+@base <http://example.com/rules/> .
+
+<#TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "companies.xml";
+    ];
+    rml:referenceFormulation rml:XPath;
+    rml:iterator "/companies/company";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{@id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "name";
+    ];
+  ].
+
+

Output

+
<http://example.org/25> <http://xmlns.com/foaf/0.1/name> "TechCorp" .
+<http://example.org/35> <http://xmlns.com/foaf/0.1/name> "InnovateX" .
+
+
+

32. RMLSTC0012b

+

Title: Complex XML source

+

Description: Tests the generation of triples from complex XML sources

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLSTC0012b/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix ex: <http://example.com/> .
+@base <http://example.com/rules/> .
+
+<#TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "companies.xml";
+    ];
+    rml:referenceFormulation rml:XPath;
+    rml:iterator "/companies/company/departments";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{../@id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant ex:department;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "department/name";
+    ];
+  ].
+
+

Output

+
<http://example.org/25> <http://example.com/department> "Engineering" .
+<http://example.org/25> <http://example.com/department> "Marketing" .
+<http://example.org/35> <http://example.com/department> "Research & Development" .
+<http://example.org/35> <http://example.com/department> "Sales" .
+
+
+

33. RMLSTC0012c

+

Title: Complex XML source

+

Description: Tests the generation of triples from complex XML sources

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLSTC0012c/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix ex: <http://example.com/> .
+@base <http://example.com/rules/> .
+
+<#TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "companies.xml";
+    ];
+    rml:referenceFormulation rml:XPath;
+    rml:iterator "/companies/company/departments/department/employees";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{../../../@id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant ex:employee;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "employee/name";
+    ];
+  ].
+
+

Output

+
<http://example.org/25> <http://example.com/employee> "Bob Smith" .
+<http://example.org/25> <http://example.com/employee> "Eve Davis" .
+<http://example.org/25> <http://example.com/employee> "Sarah Lee" .
+<http://example.org/35> <http://example.com/employee> "Liam Brown" .
+<http://example.org/35> <http://example.com/employee> "Olivia Martinez" .
+<http://example.org/35> <http://example.com/employee> "Sophia White" .
+
+
+

34. RMLSTC0012d

+

Title: Complex XML source

+

Description: Tests the generation of triples from complex XML sources

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLSTC0012d/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix ex: <http://example.com/> .
+@base <http://example.com/rules/> .
+
+<#TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "companies.xml";
+    ];
+    rml:referenceFormulation rml:XPath;
+    rml:iterator "/companies/company/departments/department";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{../../@id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant ex:manager;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "manager/name";
+    ];
+  ].
+
+

Output

+
<http://example.org/25> <http://example.com/manager> "Alice Johnson" .
+<http://example.org/25> <http://example.com/manager> "John Doe" .
+<http://example.org/35> <http://example.com/manager> "Emma Wilson" .
+<http://example.org/35> <http://example.com/manager> "Michael Green" .
+
+
+

35. RMLSTC0012e

+

Title: Complex XML source

+

Description: Tests the generation of triples from complex XML sources

+

Error expected? No

+

Input + http://w3id.org/rml/resources/rml-io/RMLSTC0012e/Friends.json

+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix ex: <http://example.com/> .
+@base <http://example.com/rules/> .
+
+<#TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "companies.xml";
+    ];
+    rml:referenceFormulation rml:XPath;
+    rml:iterator "/companies/company/departments/department/employees/employee";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{name}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant ex:skill;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "skills/skill";
+    ];
+  ].
+
+

Output

+
<http://example.org/Bob%20Smith> <http://example.com/employee> "AWS" .
+<http://example.org/Bob%20Smith> <http://example.com/employee> "JavaScript" .
+<http://example.org/Bob%20Smith> <http://example.com/employee> "Python" .
+<http://example.org/Eve%20Davis> <http://example.com/employee> "Docker" .
+<http://example.org/Eve%20Davis> <http://example.com/employee> "Kubernetes" .
+<http://example.org/Eve%20Davis> <http://example.com/employee> "Terraform" .
+<http://example.org/Liam%20Brown> <http://example.com/employee> "Deep Learning" .
+<http://example.org/Liam%20Brown> <http://example.com/employee> "Machine Learning" .
+<http://example.org/Liam%20Brown> <http://example.com/employee> "Python" .
+<http://example.org/Olivia%20Martinez> <http://example.com/employee> "CRM" .
+<http://example.org/Olivia%20Martinez> <http://example.com/employee> "Lead Generation" .
+<http://example.org/Olivia%20Martinez> <http://example.com/employee> "Negotiation" .
+<http://example.org/Sarah%20Lee> <http://example.com/employee> "Copywriting" .
+<http://example.org/Sarah%20Lee> <http://example.com/employee> "Google Ads" .
+<http://example.org/Sarah%20Lee> <http://example.com/employee> "SEO" .
+<http://example.org/Sophia%20White> <http://example.com/employee> "Data Analysis" .
+<http://example.org/Sophia%20White> <http://example.com/employee> "R" .
+<http://example.org/Sophia%20White> <http://example.com/employee> "SQL" .
+
+
+

36. RMLTTC0000

+

Title: Default target

+

Description: Test exporting all triples to the default Target when not Targets are specified.

+

Error expected? No

+

Input

+
[
+  { 
+    "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
+  }
+]
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@base <http://example.com/rules/> .
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "Friends.json";
+      rml:encoding rml:UTF-8
+    ];
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+

Output

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
+<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
+
+
+

37. RMLTTC0001a

+

Title: Single Target: Subject Map

+

Description: Test exporting all triples to a single Target with a given subject.

+

Error expected? No

+

Input

+
[
+  { 
+    "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
+  }
+]
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@base <http://example.com/rules/> .
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "Friends.json";
+    ];
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+    rml:logicalTarget <#TargetDump1>;
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:FilePath;
+    rml:root rml:CurrentWorkingDirectory;
+    rml:path "./dump1.nq";
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+

Output 1

+

+
+

Output 2

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
+<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
+
+
+

38. RMLTTC0001b

+

Title: Single Target: Predicate Map

+

Description: Test exporting all triples to a single Target with a given predicate.

+

Error expected? No

+

Input

+
[
+  { 
+    "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
+  }
+]
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@base <http://example.com/rules/> .
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "Friends.json";
+    ];
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+      rml:logicalTarget <#TargetDump1>;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:FilePath;
+    rml:root rml:CurrentWorkingDirectory;
+    rml:path "./dump1.nq";
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+

Output 1

+
<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".
+
+

Output 2

+
<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" .
+
+
+

39. RMLTTC0001c

+

Title: Single Target: Object Map

+

Description: Test exporting all triples to a single Target with a given object reference.

+

Error expected? No

+

Input

+
[
+  { 
+    "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
+  }
+]
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@base <http://example.com/rules/> .
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "Friends.json";
+    ];
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+      rml:logicalTarget <#TargetDump1>;
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:FilePath;
+    rml:root rml:CurrentWorkingDirectory;
+    rml:path "./dump1.nq";
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+

Output 1

+
<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".
+
+

Output 2

+
<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" .
+
+
+

40. RMLTTC0001d

+

Title: Single Target: Graph Map

+

Description: Test exporting all triples within a named graph to a single Target.

+

Error expected? No

+

Input

+
[
+  { 
+    "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
+  }
+]
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix dcat: <http://www.w3.org/ns/dcat#> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@prefix ex: <http://example.org/> .
+@base <http://example.com/rules/> .
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "Friends.json";
+    ];
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+    rml:graphMap [ a rml:GraphMap;
+      rml:constant ex:PeopleGraph;
+      rml:logicalTarget <#TargetDump1>;
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:FilePath;
+    rml:root rml:CurrentWorkingDirectory;
+    rml:path "./dump1.nq";
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+

Output 1

+

+
+

Output 2

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" <http://example.org/PeopleGraph>.
+<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" <http://example.org/PeopleGraph> .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" <http://example.org/PeopleGraph> .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" <http://example.org/PeopleGraph> .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" <http://example.org/PeopleGraph> .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" <http://example.org/PeopleGraph> .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" <http://example.org/PeopleGraph> .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" <http://example.org/PeopleGraph> .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" <http://example.org/PeopleGraph> .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" <http://example.org/PeopleGraph> .
+
+
+

41. RMLTTC0001e

+

Title: Single Target: Language Map

+

Description: Test exporting all triples with a given language tag to a single Target.

+

Error expected? No

+

Input

+
[
+  { 
+    "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
+  }
+]
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@base <http://example.com/rules/> .
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "Friends.json";
+    ];
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+      rml:languageMap [ a rml:LanguageMap;
+        rml:constant "en";
+        rml:logicalTarget <#TargetDump1>;
+      ];
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:FilePath;
+    rml:root rml:CurrentWorkingDirectory;
+    rml:path "./dump1.nq";
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+

Output 1

+
<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".
+
+

Output 2

+
<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 .
+
+
+

42. RMLTTC0001f

+

Title: Single Target: Datatype Map

+

Description: Test exporting all triples with a given datatype to a single Target.

+

Error expected? No

+

Input

+
[
+  { 
+    "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
+  }
+]
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@base <http://example.com/rules/> .
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "Friends.json";
+    ];
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+      rml:datatypeMap [ a rml:DatatypeMap;
+        rml:constant xsd:integer;
+        rml:logicalTarget <#TargetDump1>;
+      ];
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:FilePath;
+    rml:root rml:CurrentWorkingDirectory;
+    rml:path "./dump1.nq";
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+

Output 1

+
<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" .
+
+

Output 2

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33"^^<http://www.w3.org/2001/XMLSchema#integer>.
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34"^^<http://www.w3.org/2001/XMLSchema#integer>.
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35"^^<http://www.w3.org/2001/XMLSchema#integer>.
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36"^^<http://www.w3.org/2001/XMLSchema#integer>.
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37"^^<http://www.w3.org/2001/XMLSchema#integer>.
+
+
+

43. RMLTTC0002a

+

Title: Multiple Targets: Same Term Map

+

Description: Test exporting all triples to multiple Targets in the same Term Map.

+

Error expected? No

+

Input

+
[
+  { 
+    "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
+  }
+]
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@base <http://example.com/rules/> .
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "Friends.json";
+    ];
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+    rml:logicalTarget <#TargetDump1>;
+    rml:logicalTarget <#TargetDump2>;
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:FilePath;
+    rml:root rml:CurrentWorkingDirectory;
+    rml:path "./dump1.nq";
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+<#TargetDump2> a rml:LogicalTarget;
+  rml:target [ a rml:FilePath;
+    rml:root rml:CurrentWorkingDirectory;
+    rml:path "./dump2.nq";
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+

Output 1

+

+
+

Output 2

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
+<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
+
+

Output 3

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
+<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
+
+
+

44. RMLTTC0002b

+

Title: Multiple Targets: Subject Map and Predicate Map

+

Description: Test exporting all triples to a Target in a Subject Map and a Target in a Predicate Map.

+

Error expected? No

+

Input

+
[
+  { 
+    "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
+  }
+]
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@base <http://example.com/rules/> .
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "Friends.json";
+    ];
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+    rml:logicalTarget <#TargetDump1>;
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+      rml:logicalTarget <#TargetDump2>;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:FilePath;
+    rml:root rml:CurrentWorkingDirectory;
+    rml:path "./dump1.nq";
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+<#TargetDump2> a rml:LogicalTarget;
+  rml:target [ a rml:FilePath;
+    rml:root rml:CurrentWorkingDirectory;
+    rml:path "./dump2.nq";
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+

Output 1

+

+
+

Output 2

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
+<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
+
+

Output 3

+
<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" .
+
+
+

45. RMLTTC0002c

+

Title: Multiple Targets: Subject Map and Object Map

+

Description: Test exporting all triples to a Target in a Subject Map and a Target in a Object Map.

+

Error expected? No

+

Input

+
[
+  { 
+    "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
+  }
+]
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@base <http://example.com/rules/> .
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "Friends.json";
+    ];
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+    rml:logicalTarget <#TargetDump1>;
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+      rml:logicalTarget <#TargetDump2>;
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:FilePath;
+    rml:root rml:CurrentWorkingDirectory;
+    rml:path "./dump1.nq";
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+<#TargetDump2> a rml:LogicalTarget;
+  rml:target [ a rml:FilePath;
+    rml:root rml:CurrentWorkingDirectory;
+    rml:path "./dump2.nq";
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+

Output 1

+

+
+

Output 2

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
+<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
+
+

Output 3

+
<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" .
+
+
+

46. RMLTTC0002d

+

Title: Multiple Targets: Predicate Map and Object Map

+

Description: Test exporting all triples to a Target in a Predicate Map and a Target in a Object Map.

+

Error expected? No

+

Input

+
[
+  { 
+    "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
+  }
+]
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@base <http://example.com/rules/> .
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "Friends.json";
+    ];
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+      rml:logicalTarget <#TargetDump1>;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+      rml:logicalTarget <#TargetDump2>;
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:FilePath;
+    rml:root rml:CurrentWorkingDirectory;
+    rml:path "./dump1.nq";
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+<#TargetDump2> a rml:LogicalTarget;
+  rml:target [ a rml:FilePath;
+    rml:root rml:CurrentWorkingDirectory;
+    rml:path "./dump2.nq";
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+

Output 1

+

+
+

Output 2

+
<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" .
+
+

Output 3

+
<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" .
+
+
+

47. RMLTTC0002e

+

Title: Multiple Targets: Subject Map, Predicate Map, and Object Map

+

Description: Test exporting all triples to a Target in a Subject Map, a Target in a Predicate Map, and a Target in a Object Map.

+

Error expected? No

+

Input

+
[
+  { 
+    "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
+  }
+]
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@base <http://example.com/rules/> .
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "Friends.json";
+    ];
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+    rml:logicalTarget <#TargetDump3>;
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+      rml:logicalTarget <#TargetDump1>;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+      rml:logicalTarget <#TargetDump2>;
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:FilePath;
+    rml:root rml:CurrentWorkingDirectory;
+    rml:path "./dump1.nq";
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+<#TargetDump2> a rml:LogicalTarget;
+  rml:target [ a rml:FilePath;
+    rml:root rml:CurrentWorkingDirectory;
+    rml:path "./dump2.nq";
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+<#TargetDump3> a rml:LogicalTarget;
+  rml:target [ a rml:FilePath;
+    rml:root rml:CurrentWorkingDirectory;
+    rml:path "./dump3.nq";
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+

Output 1

+

+
+

Output 2

+
<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" .
+
+

Output 3

+
<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" .
+
+
+

48. RMLTTC0002f

+

Title: Multiple Targets: Subject Map and Graph Map

+

Description: Test exporting all triples to a Target in a Subject Map and a Target in a Graph Map.

+

Error expected? No

+

Input

+
[
+  { 
+    "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
+  }
+]
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@prefix ex: <http://example.org/> .
+@base <http://example.com/rules/> .
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "Friends.json";
+    ];
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+    rml:logicalTarget <#TargetDump1>;
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:graphMap [ a rml:GraphMap;
+      rml:constant ex:PeopleGraph;
+      rml:logicalTarget <#TargetDump2>;
+    ];
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:FilePath;
+    rml:root rml:CurrentWorkingDirectory;
+    rml:path "./dump1.nq";
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+<#TargetDump2> a rml:LogicalTarget;
+  rml:target [ a rml:FilePath;
+    rml:root rml:CurrentWorkingDirectory;
+    rml:path "./dump2.nq";
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+

Output 1

+

+
+

Output 2

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
+<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" <http://example.org/PeopleGraph> .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" <http://example.org/PeopleGraph> .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" <http://example.org/PeopleGraph> .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" <http://example.org/PeopleGraph> .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" <http://example.org/PeopleGraph> .
+
+

Output 3

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

49. RMLTTC0002g

+

Title: Multiple Targets: Predicate Map and Graph Map

+

Description: Test exporting all triples to a Target in a Predicate Map and a Target in a Graph Map.

+

Error expected? No

+

Input

+
[
+  { 
+    "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
+  }
+]
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@prefix ex: <http://example.org/> .
+@base <http://example.com/rules/> .
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "Friends.json";
+    ];
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:graphMap [ a rml:GraphMap;
+      rml:constant ex:PeopleGraph;
+      rml:logicalTarget <#TargetDump2>;
+    ];
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+      rml:logicalTarget <#TargetDump1>;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:FilePath;
+    rml:root rml:CurrentWorkingDirectory;
+    rml:path "./dump1.nq";
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+<#TargetDump2> a rml:LogicalTarget;
+  rml:target [ a rml:FilePath;
+    rml:root rml:CurrentWorkingDirectory;
+    rml:path "./dump2.nq";
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+

Output 1

+

+
+

Output 2

+
<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" .
+
+

Output 3

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

50. RMLTTC0002h

+

Title: Multiple Targets: Object Map and Graph Map

+

Description: Test exporting all triples to a Target in a Object Map and a Target in a Graph Map.

+

Error expected? No

+

Input

+
[
+  { 
+    "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
+  }
+]
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@prefix ex: <http://example.org/> .
+@base <http://example.com/rules/> .
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "Friends.json";
+    ];
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:graphMap [ a rml:GraphMap;
+      rml:constant ex:PeopleGraph;
+      rml:logicalTarget <#TargetDump2>;
+    ];
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+      rml:logicalTarget <#TargetDump1>;
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:FilePath;
+    rml:root rml:CurrentWorkingDirectory;
+    rml:path "./dump1.nq";
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+<#TargetDump2> a rml:LogicalTarget;
+  rml:target [ a rml:FilePath;
+    rml:root rml:CurrentWorkingDirectory;
+    rml:path "./dump2.nq";
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+

Output 1

+

+
+

Output 2

+
<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" .
+
+

Output 3

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

51. RMLTTC0002i

+

Title: Multiple Targets: Language Map and Graph Map

+

Description: Test exporting all triples to a Target in a Language Map and a Target in a Graph Map.

+

Error expected? No

+

Input

+
[
+  { 
+    "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
+  }
+]
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@prefix ex: <http://example.org/> .
+@base <http://example.com/rules/> .
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "Friends.json";
+    ];
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+      rml:languageMap [ a rml:LanguageMap;
+        rml:constant "en";
+        rml:logicalTarget <#TargetDump2>;
+      ];
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:graphMap [ a rml:GraphMap;
+      rml:constant ex:PeopleGraph; 
+      rml:logicalTarget <#TargetDump1>;
+    ];
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:FilePath;
+    rml:root rml:CurrentWorkingDirectory;
+    rml:path "./dump1.nq";
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+<#TargetDump2> a rml:LogicalTarget;
+  rml:target [ a rml:FilePath;
+    rml:root rml:CurrentWorkingDirectory;
+    rml:path "./dump2.nq";
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+

Output 1

+

+
+

Output 2

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" <http://example.org/PeopleGraph> .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" <http://example.org/PeopleGraph> .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" <http://example.org/PeopleGraph> .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" <http://example.org/PeopleGraph> .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" <http://example.org/PeopleGraph> .
+
+

Output 3

+
<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 .
+
+
+

52. RMLTTC0002j

+

Title: Multiple Targets: Language Map and Object Map

+

Description: Test exporting all triples to a Target in a Language Map and a Target in a Object Map.

+

Error expected? No

+

Input

+
[
+  { 
+    "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
+  }
+]
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@prefix ex: <http://example.org> .
+@base <http://example.com/rules/> .
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "Friends.json";
+    ];
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+      rml:languageMap [ a rml:LanguageMap;
+        rml:constant "en";
+        rml:logicalTarget <#TargetDump2>;
+      ];
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+      rml:logicalTarget <#TargetDump1>;
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:Target, rml:FilePath;
+    rml:root rml:CurrentWorkingDirectory;
+    rml:path "./dump1.nq";
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+<#TargetDump2> a rml:LogicalTarget;
+  rml:target [ a rml:Target, rml:FilePath;
+    rml:root rml:CurrentWorkingDirectory;
+    rml:path "./dump2.nq";
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+

Output 1

+

+
+

Output 2

+
<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" .
+
+

Output 3

+
<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 .
+
+
+

53. RMLTTC0002k

+

Title: Multiple Targets: Datatype Map and Graph Map

+

Description: Test exporting all triples to a Target in a Datatype Map and a Target in a Graph Map.

+

Error expected? No

+

Input

+
[
+  { 
+    "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
+  }
+]
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix ex: <http://example.org/> .
+@base <http://example.com/rules/> .
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "Friends.json";
+    ];
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:graphMap [ a rml:GraphMap;
+      rml:constant ex:PeopleGraph; 
+      rml:logicalTarget <#TargetDump1>;
+    ];
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+      rml:datatypeMap [ a rml:DatatypeMap;
+        rml:constant xsd:integer;
+        rml:logicalTarget <#TargetDump2>;
+      ];
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:Target, rml:FilePath;
+    rml:root rml:CurrentWorkingDirectory;
+    rml:path "./dump1.nq";
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+<#TargetDump2> a rml:LogicalTarget;
+  rml:target [ a rml:Target, rml:FilePath;
+    rml:root rml:CurrentWorkingDirectory;
+    rml:path "./dump2.nq";
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+

Output 1

+
<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 .
+
+

Output 2

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33"^^<http://www.w3.org/2001/XMLSchema#integer> <http://example.org/PeopleGraph> .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34"^^<http://www.w3.org/2001/XMLSchema#integer> <http://example.org/PeopleGraph> .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35"^^<http://www.w3.org/2001/XMLSchema#integer> <http://example.org/PeopleGraph> .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36"^^<http://www.w3.org/2001/XMLSchema#integer> <http://example.org/PeopleGraph> .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37"^^<http://www.w3.org/2001/XMLSchema#integer> <http://example.org/PeopleGraph> .
+
+

Output 3

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33"^^<http://www.w3.org/2001/XMLSchema#integer> <http://example.org/PeopleGraph> .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34"^^<http://www.w3.org/2001/XMLSchema#integer> <http://example.org/PeopleGraph> .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35"^^<http://www.w3.org/2001/XMLSchema#integer> <http://example.org/PeopleGraph> .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36"^^<http://www.w3.org/2001/XMLSchema#integer> <http://example.org/PeopleGraph> .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37"^^<http://www.w3.org/2001/XMLSchema#integer> <http://example.org/PeopleGraph> .
+
+
+

54. RMLTTC0002l

+

Title: Multiple Targets: Datatype Map and Object Map

+

Description: Test exporting all triples to a Target in a Datatype Map and a Target in a Object Map.

+

Error expected? No

+

Input

+
[
+  { 
+    "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
+  }
+]
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix ex: <http://example.org/> .
+@base <http://example.com/rules/> .
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "Friends.json";
+    ];
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+      rml:logicalTarget <#TargetDump1>;
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+      rml:datatypeMap [ a rml:DatatypeMap;
+        rml:constant xsd:integer;
+        rml:logicalTarget <#TargetDump2>;
+      ];
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:Target, rml:FilePath;
+    rml:root rml:CurrentWorkingDirectory;
+    rml:path "./dump1.nq";
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+<#TargetDump2> a rml:LogicalTarget;
+  rml:target [ a rml:Target, rml:FilePath;
+    rml:root rml:CurrentWorkingDirectory;
+    rml:path "./dump2.nq";
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+

Output 1

+

+
+

Output 2

+
<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" .
+
+

Output 3

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37"^^<http://www.w3.org/2001/XMLSchema#integer> .
+
+
+

55. RMLTTC0002m

+

Title: Multiple Targets: Multiple Predicate Maps

+

Description: Test exporting all triples to Targets in multiple Predicate Maps.

+

Error expected? No

+

Input

+
[
+  { 
+    "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
+  }
+]
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@base <http://example.com/rules/> .
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "Friends.json";
+    ];
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+      rml:logicalTarget <#TargetDump1>;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+      rml:logicalTarget <#TargetDump2>;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:Target, rml:FilePath;
+    rml:root rml:CurrentWorkingDirectory;
+    rml:path "./dump1.nq";
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+<#TargetDump2> a rml:LogicalTarget;
+  rml:target [ a rml:Target, rml:FilePath;
+    rml:root rml:CurrentWorkingDirectory;
+    rml:path "./dump2.nq";
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+

Output 1

+

+
+

Output 2

+
<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" .
+
+

Output 3

+
<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" .
+
+
+

56. RMLTTC0002n

+

Title: Multiple Targets: Multiple Object Maps

+

Description: Test exporting all triples to Targets in multiple Object Maps.

+

Error expected? No

+

Input

+
[
+  { 
+    "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
+  }
+]
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@base <http://example.com/rules/> .
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "Friends.json";
+    ];
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+      rml:logicalTarget <#TargetDump1>;
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+      rml:logicalTarget <#TargetDump2>;
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:Target, rml:FilePath;
+    rml:root rml:CurrentWorkingDirectory;
+    rml:path "./dump1.nq";
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+<#TargetDump2> a rml:LogicalTarget;
+  rml:target [ a rml:Target, rml:FilePath;
+    rml:root rml:CurrentWorkingDirectory;
+    rml:path "./dump2.nq";
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+

Output 1

+

+
+

Output 2

+
<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" .
+
+

Output 3

+
<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" .
+
+
+

57. RMLTTC0002o

+

Title: Multiple Targets: Multiple Graph Maps

+

Description: Test exporting all triples to Targets in multiple Graph Maps.

+

Error expected? No

+

Input

+
[
+  { 
+    "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
+  }
+]
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix dcat: <http://www.w3.org/ns/dcat#> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@prefix ex: <http://example.org/> .
+@base <http://example.com/rules/> .
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "Friends.json";
+    ];
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+    rml:graphMap [ a rml:GraphMap;
+      rml:constant ex:PeopleGraph1;
+      rml:logicalTarget <#TargetDump1>;
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+    rml:graphMap [ a rml:GraphMap;
+      rml:constant ex:PeopleGraph2;
+      rml:logicalTarget <#TargetDump2>;
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:Target, rml:FilePath;
+    rml:root rml:CurrentWorkingDirectory;
+    rml:path "./dump1.nq";
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+<#TargetDump2> a rml:LogicalTarget;
+  rml:target [ a rml:Target, rml:FilePath;
+    rml:root rml:CurrentWorkingDirectory;
+    rml:path "./dump2.nq";
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+

Output 1

+

+
+

Output 2

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" <http://example.org/PeopleGraph1>.
+<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" <http://example.org/PeopleGraph1> .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" <http://example.org/PeopleGraph1> .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" <http://example.org/PeopleGraph1> .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" <http://example.org/PeopleGraph1> .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" <http://example.org/PeopleGraph1> .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" <http://example.org/PeopleGraph1> .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" <http://example.org/PeopleGraph1> .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" <http://example.org/PeopleGraph1> .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" <http://example.org/PeopleGraph1> .
+
+

Output 3

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

58. RMLTTC0002p

+

Title: Multiple Targets: Multiple Language Maps

+

Description: Test exporting all triples to Targets in multiple Language Maps.

+

Error expected? No

+

Input

+
[
+  { 
+    "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
+  }
+]
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@base <http://example.com/rules/> .
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "Friends.json";
+    ];
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+      rml:languageMap [ a rml:LanguageMap;
+        rml:constant "en";
+        rml:logicalTarget <#TargetDump1>;
+      ];
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+      rml:languageMap [ a rml:LanguageMap;
+        rml:constant "nl";
+        rml:logicalTarget <#TargetDump2>;
+      ];
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:Target, rml:FilePath;
+    rml:root rml:CurrentWorkingDirectory;
+    rml:path "./dump1.nq";
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+<#TargetDump2> a rml:LogicalTarget;
+  rml:target [ a rml:Target, rml:FilePath;
+    rml:root rml:CurrentWorkingDirectory;
+    rml:path "./dump2.nq";
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+

Output 1

+
<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".
+
+

Output 2

+
<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 .
+
+

Output 3

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller"@nl .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green"@nl .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani"@nl .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing"@nl .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller"@nl .
+
+
+

59. RMLTTC0002q

+

Title: Multiple Targets: Multiple Datatype Maps

+

Description: Test exporting all triples to Targets in multiple Datatype Maps.

+

Error expected? No

+

Input

+
[
+  { 
+    "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
+  }
+]
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@base <http://example.com/rules/> .
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "Friends.json";
+    ];
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+      rml:datatypeMap [ a rml:DatatypeMap;
+        rml:constant xsd:integer;
+        rml:logicalTarget <#TargetDump1>;
+      ];
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+      rml:datatypeMap [ a rml:DatatypeMap;
+        rml:constant xsd:double;
+        rml:logicalTarget <#TargetDump2>;
+      ];
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:Target, rml:FilePath;
+    rml:root rml:CurrentWorkingDirectory;
+    rml:path "./dump1.nq";
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+<#TargetDump2> a rml:LogicalTarget;
+  rml:target [ a rml:Target, rml:FilePath;
+    rml:root rml:CurrentWorkingDirectory;
+    rml:path "./dump2.nq";
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+

Output 1

+
<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" .
+
+

Output 2

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33"^^<http://www.w3.org/2001/XMLSchema#integer>.
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34"^^<http://www.w3.org/2001/XMLSchema#integer>.
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35"^^<http://www.w3.org/2001/XMLSchema#integer>.
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36"^^<http://www.w3.org/2001/XMLSchema#integer>.
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37"^^<http://www.w3.org/2001/XMLSchema#integer>.
+
+

Output 3

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33"^^<http://www.w3.org/2001/XMLSchema#double>.
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34"^^<http://www.w3.org/2001/XMLSchema#double>.
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35"^^<http://www.w3.org/2001/XMLSchema#double>.
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36"^^<http://www.w3.org/2001/XMLSchema#double>.
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37"^^<http://www.w3.org/2001/XMLSchema#double>.
+
+
+

60. RMLTTC0002r

+

Title: Multiple Targets: Multiple Term Maps with same Target

+

Description: Test exporting all triples to same Target in multiple Term Maps.

+

Error expected? No

+

Input

+
[
+  { 
+    "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
+  }
+]
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@base <http://example.com/rules/> .
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "Friends.json";
+    ];
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+      rml:logicalTarget <#TargetDump1>;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+      rml:logicalTarget <#TargetDump1>;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:Target, rml:FilePath;
+    rml:root rml:CurrentWorkingDirectory;
+    rml:path "./dump1.nq";
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+

Output 1

+

+
+

Output 2

+
<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" .
+<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" .
+
+
+

61. RMLTTC0003a

+

Title: Overriding Targets: Seperate Triples Map

+

Description: Test exporting some triples to a different Target with a separate Triples Map.

+

Error expected? No

+

Input

+
[
+  { 
+    "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
+  }
+]
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@base <http://example.com/rules/> .
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "Friends.json";
+    ];
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+    rml:logicalTarget <#TargetDump2>;
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+<#TriplesMap2> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "Friends.json";
+    ];
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+    rml:logicalTarget <#TargetDump1>;
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:Target, rml:FilePath;
+    rml:root rml:CurrentWorkingDirectory;
+    rml:path "./dump1.nq";
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+<#TargetDump2> a rml:LogicalTarget;
+  rml:target [ a rml:Target, rml:FilePath;
+    rml:root rml:CurrentWorkingDirectory;
+    rml:path "./dump2.nq";
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+

Output 1

+

+
+

Output 2

+
<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" .
+
+

Output 3

+
<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" .
+
+
+

62. RMLTTC0004a

+

Title: Target JSON-LD

+

Description: Test export all triples as JSON-LD

+

Error expected? No

+

Input

+
[
+  { 
+    "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
+  }
+]
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@base <http://example.com/rules/> .
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "Friends.json";
+    ];
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+    rml:logicalTarget <#TargetDump1>;
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:Target, rml:FilePath;
+    rml:root rml:CurrentWorkingDirectory;
+    rml:path "./dump1.jsonld";
+  ];
+  rml:serialization formats:JSON-LD;
+.
+
+

Output 1

+

+
+

Output 2

+
{
+  "@context": { 
+    "foaf": "http://xmlns.com/foaf/0.1/"
+  },
+  "@graph": [
+    {                                                                                
+
+      "@id": "http://example.org/0",
+      "foaf:name": "Monica Geller",
+      "foaf:age": "33"
+    },
+    {                                                                                
+      "@id": "http://example.org/1",
+      "foaf:name": "Rachel Green",
+      "foaf:age": "34"
+    },
+    {                                                                                
+      "@id": "http://example.org/2",
+      "foaf:name": "Joey Tribbiani",
+      "foaf:age": "35"
+    },
+    {                                                                                
+      "@id": "http://example.org/3",
+      "foaf:name": "Chandler Bing",
+      "foaf:age": "36"
+    },
+      {                                                                                
+      "@id": "http://example.org/4",
+      "foaf:name": "Ross Geller",
+      "foaf:age": "37"
+    }
+  ]
+}
+
+
+

63. RMLTTC0004b

+

Title: Target N3

+

Description: Test export all triples as N3

+

Error expected? No

+

Input

+
[
+  { 
+    "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
+  }
+]
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@base <http://example.com/rules/> .
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "Friends.json";
+    ];
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+    rml:logicalTarget <#TargetDump1>;
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:Target, rml:FilePath;
+    rml:root rml:CurrentWorkingDirectory;
+    rml:path "./dump1.n3";
+  ];
+  rml:serialization formats:N3;
+.
+
+

Output 1

+

+
+

Output 2

+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix ex: <http://example.org/> .
+ex:0 <foaf:age> "33" ;
+     <foaf:name> "Monica Geller" .
+ex:1 <foaf:age> "34" ;
+     <foaf:name> "Rachel Green" .
+ex:2 <foaf:age> "35" ;
+     <foaf:name> "Joey Tribbiani" .
+ex:3 <foaf:age> "36" ;
+     <foaf:name> "Chandler Bing" .
+ex:4 <foaf:age> "37" ;
+     <foaf:name> "Ross Geller" .
+
+
+

64. RMLTTC0004c

+

Title: Target N-Triples

+

Description: Test export all triples as N-Triples

+

Error expected? No

+

Input

+
[
+  { 
+    "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
+  }
+]
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@base <http://example.com/rules/> .
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "Friends.json";
+    ];
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+    rml:logicalTarget <#TargetDump1>;
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:Target, rml:FilePath;
+    rml:root rml:CurrentWorkingDirectory;
+    rml:path "./dump1.nt";
+  ];
+  rml:serialization formats:N-Triples;
+.
+
+

Output 1

+

+
+

Output 2

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
+<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
+
+
+

65. RMLTTC0004d

+

Title: Target N-Quads

+

Description: Test export all triples as N-Quads

+

Error expected? No

+

Input

+
[
+  { 
+    "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
+  }
+]
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@base <http://example.com/rules/> .
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "Friends.json";
+    ];
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+    rml:logicalTarget <#TargetDump1>;
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:Target, rml:FilePath;
+    rml:root rml:CurrentWorkingDirectory;
+    rml:path "./dump1.nq";
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+

Output 1

+

+
+

Output 2

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
+<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
+
+
+

66. RMLTTC0004e

+

Title: Target RDF/JSON

+

Description: Test export all triples as RDF/JSON

+

Error expected? No

+

Input

+
[
+  { 
+    "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
+  }
+]
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@base <http://example.com/rules/> .
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "Friends.json";
+    ];
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+    rml:logicalTarget <#TargetDump1>;
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:Target, rml:FilePath;
+    rml:root rml:CurrentWorkingDirectory;
+    rml:path "./dump1.rdfjson";
+  ];
+  rml:serialization formats:RDF_JSON;
+.
+
+

Output 1

+

+
+

Output 2

+
{
+    "http://example.org/0" : {
+        "http://xmlns.com/foaf/0.1/age" : [ { "value" : "33" } ],
+        "http://xmlns.com/foaf/0.1/name" : [ { "value" : "Monica Geller" } ]
+    },
+    "http://example.org/1" : {
+        "http://xmlns.com/foaf/0.1/age" : [ { "value" : "34" } ],
+        "http://xmlns.com/foaf/0.1/name" : [ { "value" : "Rachel Green" } ]
+    },
+    "http://example.org/2" : {
+        "http://xmlns.com/foaf/0.1/age" : [ { "value" : "35" } ],
+        "http://xmlns.com/foaf/0.1/name" : [ { "value" : "Joey Tribbiani" } ]
+    },
+    "http://example.org/3" : {
+        "http://xmlns.com/foaf/0.1/age" : [ { "value" : "36" } ],
+        "http://xmlns.com/foaf/0.1/name" : [ { "value" : "Chandler Bing" } ]
+    },
+    "http://example.org/4" : {
+        "http://xmlns.com/foaf/0.1/age" : [ { "value" : "37" } ],
+        "http://xmlns.com/foaf/0.1/name" : [ { "value" : "Ross Geller" } ]
+    }
+}
+
+
+

67. RMLTTC0004f

+

Title: Target RDF/XML

+

Description: Test export all triples as RDF/XML

+

Error expected? No

+

Input

+
[
+  { 
+    "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
+  }
+]
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@base <http://example.com/rules/> .
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "Friends.json";
+    ];
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+    rml:logicalTarget <#TargetDump1>;
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:Target, rml:FilePath;
+    rml:root rml:CurrentWorkingDirectory;
+    rml:path "./dump1.rdfxml";
+  ];
+  rml:serialization formats:RDF_XML;
+.
+
+

Output 1

+

+
+

Output 2

+
<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:age>33</foaf:age>
+    <foaf:name>Monica Geller</foaf:name>
+  </rdf:Description>
+  <rdf:Description rdf:about="http://example.org/1">
+    <foaf:age>34</foaf:age>
+    <foaf:name>Rachel Green</foaf:name>
+  </rdf:Description>
+  <rdf:Description rdf:about="http://example.org/2">
+    <foaf:age>35</foaf:age>
+    <foaf:name>Joey Tribbiani</foaf:name>
+  </rdf:Description>
+  <rdf:Description rdf:about="http://example.org/3">
+    <foaf:age>36</foaf:age>
+    <foaf:name>Chandler Bing</foaf:name>
+  </rdf:Description>
+  <rdf:Description rdf:about="http://example.org/4">
+    <foaf:age>37</foaf:age>
+    <foaf:name>Ross Geller</foaf:name>
+  </rdf:Description>
+</rdf:RDF>
+
+
+

68. RMLTTC0004g

+

Title: Target Turtle

+

Description: Test export all triples as Turtle

+

Error expected? No

+

Input

+
[
+  { 
+    "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
+  }
+]
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@base <http://example.com/rules/> .
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "Friends.json";
+    ];
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+    rml:logicalTarget <#TargetDump1>;
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:Target, rml:FilePath;
+    rml:root rml:CurrentWorkingDirectory;
+    rml:path "./dump1.ttl";
+  ];
+  rml:serialization formats:Turtle;
+.
+
+

Output 1

+

+
+

Output 2

+
<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" .
+<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" .
+
+
+

69. RMLTTC0005a

+

Title: Target UTF-8

+

Description: Test export all triples with UTF-8 encoding

+

Error expected? No

+

Input

+
[
+  { 
+    "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
+  }
+]
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@base <http://example.com/rules/> .
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "Friends.json";
+    ];
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+    rml:logicalTarget <#TargetDump1>;
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:Target, rml:FilePath;
+    rml:root rml:CurrentWorkingDirectory;
+    rml:path "./dump1.nq";
+  ];
+  rml:serialization formats:N-Quads;
+  rml:encoding rml:UTF-8;
+.
+
+

Output 1

+

+
+

Output 2

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
+<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
+
+
+

70. RMLTTC0005b

+

Title: Target UTF-16

+

Description: Test export all triples with UTF-16 encoding

+

Error expected? No

+

Input

+
[
+  { 
+    "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
+  }
+]
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@base <http://example.com/rules/> .
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "Friends.json";
+    ];
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+    rml:logicalTarget <#TargetDump1>;
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:Target, rml:FilePath;
+    rml:root rml:CurrentWorkingDirectory;
+    rml:path "./dump1.nq";
+  ];
+  rml:serialization formats:N-Quads;
+  rml:encoding rml:UTF-16;
+.
+
+

Output 1

+

+
+

Output 2

+
��<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
+<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
+
+
+
+

71. RMLTTC0006a

+

Title: Target no compression

+

Description: Test export all triples with no compression

+

Error expected? No

+

Input

+
[
+  { 
+    "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
+  }
+]
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@base <http://example.com/rules/> .
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "Friends.json";
+    ];
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+    rml:logicalTarget <#TargetDump1>;
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:Target, rml:FilePath;
+    rml:root rml:CurrentWorkingDirectory;
+    rml:path "./dump1.nq";
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+

Output 1

+

+
+

Output 2

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
+<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
+
+
+

72. RMLTTC0006b

+

Title: Target GZip compression

+

Description: Test export all triples with GZip compression

+

Error expected? No

+

Input

+
[
+  { 
+    "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
+  }
+]
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@base <http://example.com/rules/> .
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "Friends.json";
+    ];
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+    rml:logicalTarget <#TargetDump1>;
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:Target, rml:FilePath;
+    rml:root rml:CurrentWorkingDirectory;
+    rml:path "./dump1.nq.gz";
+  ];
+  rml:serialization formats:N-Quads;
+  rml:compression rml:gzip;
+.
+
+

Output 1

+

+
+

Output 2 + dump1.nq.gz

+
+

73. RMLTTC0006c

+

Title: Target Zip compression

+

Description: Test export all triples with ZIP compression

+

Error expected? No

+

Input

+
[
+  { 
+    "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
+  }
+]
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@base <http://example.com/rules/> .
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "Friends.json";
+    ];
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+    rml:logicalTarget <#TargetDump1>;
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:Target, rml:FilePath;
+    rml:root rml:CurrentWorkingDirectory;
+    rml:path "./dump1.nq.zip";
+  ];
+  rml:serialization formats:N-Quads;
+  rml:compression rml:zip;
+.
+
+

Output 1

+

+
+

Output 2 + dump1.nq.zip

+
+

74. RMLTTC0006d

+

Title: Target TarXz compression

+

Description: Test export all triples with TarXZ compression

+

Error expected? No

+

Input

+
[
+  { 
+    "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
+  }
+]
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@prefix ex: <http://example.org/> .
+@base <http://example.com/rules/> .
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "Friends.json";
+    ];
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+    rml:logicalTarget <#TargetDump1>;
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:Target, rml:FilePath;
+    rml:root rml:CurrentWorkingDirectory;
+    rml:path "./dump1.nq.tar.xz";
+  ];
+  rml:serialization formats:N-Quads;
+  rml:compression rml:tarxz;
+.
+
+

Output 1

+

+
+

Output 2 + dump1.nq.tar.xz

+
+

75. RMLTTC0006e

+

Title: Target TarGzip compression

+

Description: Test export all triples with TarGZip compression

+

Error expected? No

+

Input

+
[
+  { 
+    "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
+  }
+]
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@base <http://example.com/rules/> .
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "Friends.json";
+    ];
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+    rml:logicalTarget <#TargetDump1>;
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:Target, rml:FilePath;
+    rml:root rml:CurrentWorkingDirectory;
+    rml:path "./dump1.nq.tar.gz";
+  ];
+  rml:serialization formats:N-Quads;
+  rml:compression rml:targz;
+.
+
+

Output 1

+

+
+

Output 2

+
����j�0�\�)B -�ҋ��0�����j &N-�o?�޸9�l��	ϟ1���%��D/UjX�6��@F*%R�H('�$B�O)�➥&��
+�$�:�����jWv]�ȹ��v����bO�ח���e�⧠O\0�ua�t��~������LӃq�4s��j]z���8zh��s��%5�u��K0W�����jo�F�K����c��R��?�d}17I-�]���%�����۷�o�M��((
+
+
+

76. RMLTTC0007a

+

Title: Target with FilePath description

+

Description: Test export all triples to a target with File path access description

+

Error expected? No

+

Input

+
[
+  { 
+    "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
+  }
+]
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix formats: <http://www.w3.org/ns/formats/> .
+@base <http://example.com/rules/> .
+
+<#TriplesMap> a rml:TriplesMap;
+  rml:logicalSource [ a rml:LogicalSource;
+    rml:source [ a rml:FilePath;
+      rml:root rml:MappingDirectory;
+      rml:path "Friends.json";
+    ];
+    rml:referenceFormulation rml:JSONPath;
+    rml:iterator "$[*]";
+  ];
+  rml:subjectMap [ a rml:SubjectMap;
+    rml:template "http://example.org/{$.id}";
+    rml:logicalTarget <#TargetDump1>;
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:name;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.name";
+    ];
+  ];
+  rml:predicateObjectMap [ a rml:PredicateObjectMap;
+    rml:predicateMap [ a rml:PredicateMap;
+      rml:constant foaf:age;
+    ];
+    rml:objectMap [ a rml:ObjectMap;
+      rml:reference "$.age";
+    ];
+  ];
+.
+
+<#TargetDump1> a rml:LogicalTarget;
+  rml:target [ a rml:Target, rml:FilePath;
+    rml:root rml:CurrentWorkingDirectory;
+    rml:path "./dump1.nq";
+  ];
+  rml:serialization formats:N-Quads;
+.
+
+

Output 1

+

+
+

Output 2

+
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
+<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
+<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
+<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
+<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
+<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
+
+
+ + + + + \ No newline at end of file diff --git a/src/test/resources/rml-io/list.sh b/src/test/resources/rml-io/list.sh new file mode 100755 index 00000000..12c32031 --- /dev/null +++ b/src/test/resources/rml-io/list.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +for i in RML*; do + echo "
" +done diff --git a/src/test/resources/rml-io/make-metadata.py b/src/test/resources/rml-io/make-metadata.py new file mode 100755 index 00000000..1b386867 --- /dev/null +++ b/src/test/resources/rml-io/make-metadata.py @@ -0,0 +1,210 @@ +#!/usr/bin/env python3 + +import os +import sys +import glob +import csv + +def get_title_description(testcase: str): + with open ('descriptions.csv') as csvfile: + reader = csv.reader(csvfile) + for row in reader: + if row[0] == testcase: + return row[1], row[2] + +def main(spec: str): + with open ('metadata.csv', 'w', newline='') as csvfile: + writer = csv.writer(csvfile) + writer.writerow(['ID', 'title', 'description', 'specification', + 'mapping', 'input_format1', 'input_format2', + 'input_format3', 'output_format1', 'output_format2', + 'output_format3', 'input1', 'input2', 'input3', + 'output1', 'output2', 'output3', 'error']) + for testcase in glob.glob('RML*'): + print(testcase) + title, description = get_title_description(testcase) + error = 'false' + input1 = '' + input2 = '' + input3 = '' + input_format1 = '' + input_format2 = '' + input_format3 = '' + output1 = '' + output2 = '' + output3 = '' + output_format1 = '' + output_format2 = '' + output_format3 = '' + + # Input file + if os.path.exists(os.path.join(testcase, 'Friends.json')): + input1 = 'Friends.json' + input_format1 = 'application/json' + elif os.path.exists(os.path.join(testcase, 'Friends-UTF16.json')): + input1 = 'Friends-UTF16.json' + input_format1 = 'application/json' + elif os.path.exists(os.path.join(testcase, 'Friends.json.gz')): + input1 = 'Friends.json.gz' + input_format1 = 'application/gzip+json' + elif os.path.exists(os.path.join(testcase, 'Friends.json.zip')): + input1 = 'Friends.json.zip' + input_format1 = 'application/gzip+json' + elif os.path.exists(os.path.join(testcase, 'Friends.json.tar.xz')): + input1 = 'Friends.json.tar.xz' + input_format1 = 'application/tarxz+json' + elif os.path.exists(os.path.join(testcase, 'Friends.json.tar.gz')): + input1 = 'Friends.json.tar.gz' + input_format1 = 'application/targz+json' + elif os.path.exists(os.path.join(testcase, 'Friends-NULL.csv')): + input1 = 'Friends-NULL.csv' + input_format1 = 'text/csv' + elif os.path.exists(os.path.join(testcase, 'Friends-NULL2.csv')): + input1 = 'Friends-NULL2.csv' + input_format1 = 'text/csv' + elif os.path.exists(os.path.join(testcase, 'Friends.nt')): + input1 = 'Friends.nt' + input_format1 = 'application/n-triples' + elif os.path.exists(os.path.join(testcase, 'Friends.csv')): + input1 = 'Friends.csv' + input_format1 = 'text/csv' + elif os.path.exists(os.path.join(testcase, 'Friends.json')): + input1 = 'Friends.json' + input_format1 = 'application/json' + elif os.path.exists(os.path.join(testcase, 'Friends.xml')): + input1 = 'Friends.xml' + input_format1 = 'text/xml' + else: + input1 = f'http://w3id.org/rml/resources/rml-io/{testcase}/Friends.json' + input_format1 = 'application/json' + + # Mapping file + if os.path.exists(os.path.join(testcase, 'mapping.ttl')): + mapping_file = 'mapping.ttl' + else: + raise ValueError('Mapping file missing!') + + # Output files + if os.path.exists(os.path.join(testcase, 'default.nq')): + output1 = 'default.nq' + output_format1 = 'application/n-quads' + else: + error = 'true' + + if os.path.exists(os.path.join(testcase, 'dump1.nq')): + output2 = 'dump1.nq' + output_format2 = 'application/n-quads' + elif os.path.exists(os.path.join(testcase, 'dump1.nt')): + output2 = 'dump1.nt' + output_format2 = 'application/n-quads' + elif os.path.exists(os.path.join(testcase, 'dump1.n3')): + output2 = 'dump1.n3' + output_format2 = 'application/n-quads' + elif os.path.exists(os.path.join(testcase, 'dump1.jsonld')): + output2 = 'dump1.jsonld' + output_format2 = 'application/n-quads' + elif os.path.exists(os.path.join(testcase, 'dump1.rdfjson')): + output2 = 'dump1.rdfjson' + output_format2 = 'application/n-quads' + elif os.path.exists(os.path.join(testcase, 'dump1.rdfxml')): + output2 = 'dump1.rdfxml' + output_format2 = 'application/n-quads' + elif os.path.exists(os.path.join(testcase, 'dump1.ttl')): + output2 = 'dump1.ttl' + output_format2 = 'application/n-quads' + elif os.path.exists(os.path.join(testcase, 'dump1.nq.gz')): + output2 = 'dump1.nq.gz' + output_format2 = 'application/n-quads' + elif os.path.exists(os.path.join(testcase, 'dump1.nq.zip')): + output2 = 'dump1.nq.zip' + output_format2 = 'application/n-quads' + elif os.path.exists(os.path.join(testcase, 'dump1.nq.tar.xz')): + output2 = 'dump1.nq.tar.xz' + output_format2 = 'application/n-quads' + elif os.path.exists(os.path.join(testcase, 'dump1.nq.tar.gz')): + output2 = 'dump1.nq.tar.gz' + output_format2 = 'application/n-quads' + + if os.path.exists(os.path.join(testcase, 'dump2.nq')): + output3 = 'dump2.nq' + output_format3 = 'application/n-quads' + + writer.writerow([testcase, title, description, spec, mapping_file, + input_format1, input_format2, input_format3, + output_format1, output_format2, output_format3, + input1, input2, input3, output1, output2, + output3, error]) + lines = [] + # Title and description + lines.append(f'## {testcase}\n\n') + lines.append(f'**Title**: {title}\n\n') + lines.append(f'**Description**: {description}\n\n') + if error == 'true': + error_html = 'Yes' + else: + error_html = 'No' + lines.append(f'**Error expected?** {error_html}\n\n') + + # Input + inputCount = '' + + for index, i in enumerate([input1, input2, input3]): + if not i: + break + + if 'http://w3id.org/rml/resources' in i: + input_html = f'**Input{inputCount}**\n [{i}]({i})\n\n' + else: + try: + with open(os.path.join(testcase, i)) as f: + input_html = f'**Input{inputCount}**\n```\n{f.read()}\n```\n\n' + except UnicodeDecodeError: + try: + with open(os.path.join(testcase, i), encoding='utf-16') as f: + input_html = f'**Input{inputCount}**\n```\n{f.read()}\n```\n\n' + except UnicodeError: + input_html = f'**Input{inputCount}**\n `{i}`\n\n' + + lines.append(input_html) + inputCount = f' {index + 1}' + + # Mapping + with open(os.path.join(testcase, mapping_file)) as f: + mapping_html = f'**Mapping**\n```\n{f.read()}\n```\n\n' + lines.append(mapping_html) + + # Output + outputCount = '' + if output2 or output3: + outputCount = ' 1' + + for index, i in enumerate([output1, output2, output3]): + if not i: + break + + if 'http://w3id.org/rml/resources' in i: + output_html = f'**Output{outputCount}**\n [{i}]({i})\n\n' + else: + try: + with open(os.path.join(testcase, i)) as f: + output_html = f'**Output{outputCount}**\n```\n{f.read()}\n```\n\n' + except UnicodeDecodeError: + try: + with open(os.path.join(testcase, i), encoding='utf-16') as f: + output_html = f'**Output{outputCount}**\n```\n{f.read()}\n```\n\n' + except UnicodeDecodeError: + output_html = f'**Output{outputCount}**\n `{i}`\n\n' + + lines.append(output_html) + outputCount = f' {index + 2}' + + + with open(os.path.join(testcase, 'README.md'), 'w') as f: + f.writelines(lines) + + +if __name__ == '__main__': + if len(sys.argv) != 2: + print('Usage: ./make-metadata.py ') + sys.exit(1) + main(sys.argv[1]) diff --git a/src/test/resources/rml-io/manifest.rml.ttl b/src/test/resources/rml-io/manifest.rml.ttl new file mode 100644 index 00000000..3f5dfbbd --- /dev/null +++ b/src/test/resources/rml-io/manifest.rml.ttl @@ -0,0 +1,267 @@ +@prefix xsd: . +@prefix dcterms: . +@prefix rml: . +@prefix rmltest: . +@prefix test: . +@base . + +# java -jar .\burp.jar -m manifest.rml.ttl -o manifest.ttl -b http://w3id.org/rml/io/test/ + +_:source + rml:source [ + a rml:RelativePathSource ; + rml:path "metadata.csv" ; + rml:null ""; + ]; + rml:referenceFormulation rml:CSV; +. + +<#TriplesMapTestcase> + a rml:TriplesMap; + + rml:logicalSource _:source; + + rml:subjectMap [ + rml:reference "ID"; + rml:class test:TestCase; + ]; + + rml:predicateObjectMap [ + rml:predicate dcterms:identifier; + rml:objectMap [ + rml:reference "ID"; + ]; + ]; + + rml:predicateObjectMap [ + rml:predicate rmltest:hasError; + rml:objectMap [ + rml:reference "error"; + rml:datatype xsd:boolean; + ]; + ]; + + rml:predicateObjectMap [ + rml:predicate rmltest:mappingDocument; + rml:objectMap [ + rml:reference "mapping"; + ]; + ]; + + rml:predicateObjectMap [ + rml:predicate rmltest:input; + rml:objectMap [ a rml:RefObjectMap; + rml:parentTriplesMap <#TriplesMapInput1>; + rml:joinCondition [ + rml:child "ID"; + rml:parent "ID"; + ]; + ]; + ]; + + rml:predicateObjectMap [ + rml:predicate rmltest:input; + rml:objectMap [ a rml:RefObjectMap; + rml:parentTriplesMap <#TriplesMapInput2>; + rml:joinCondition [ + rml:child "ID"; + rml:parent "ID"; + ]; + ]; + ]; + + rml:predicateObjectMap [ + rml:predicate rmltest:input; + rml:objectMap [ a rml:RefObjectMap; + rml:parentTriplesMap <#TriplesMapInput3>; + rml:joinCondition [ + rml:child "ID"; + rml:parent "ID"; + ]; + ]; + ]; + + rml:predicateObjectMap [ + rml:predicate rmltest:output; + rml:objectMap [ a rml:RefObjectMap; + rml:parentTriplesMap <#TriplesMapOutput1>; + rml:joinCondition [ + rml:child "ID"; + rml:parent "ID"; + ]; + ]; + ]; + + rml:predicateObjectMap [ + rml:predicate rmltest:output; + rml:objectMap [ a rml:RefObjectMap; + rml:parentTriplesMap <#TriplesMapOutput2>; + rml:joinCondition [ + rml:child "ID"; + rml:parent "ID"; + ]; + ]; + ]; + + rml:predicateObjectMap [ + rml:predicate rmltest:output; + rml:objectMap [ a rml:RefObjectMap; + rml:parentTriplesMap <#TriplesMapOutput3>; + rml:joinCondition [ + rml:child "ID"; + rml:parent "ID"; + ]; + ]; + ]; +. + +<#TriplesMapInput1> + a rml:TriplesMap; + + rml:logicalSource _:source ; + + rml:subjectMap [ + rml:template "{ID}/input/{input1}"; + rml:class rmltest:Input; + ]; + + rml:predicateObjectMap [ + rml:predicate rmltest:input; + rml:objectMap [ + rml:reference "input1"; + ]; + ]; + + rml:predicateObjectMap [ + rml:predicate rmltest:inputFormat; + rml:objectMap [ + rml:reference "input_format1"; + ]; + ]; +. + +<#TriplesMapInput2> + a rml:TriplesMap; + + rml:logicalSource _:source; + + rml:subjectMap [ + rml:template "{ID}/input/{input2}"; + rml:class rmltest:Input; + ]; + + rml:predicateObjectMap [ + rml:predicate rmltest:input; + rml:objectMap [ + rml:reference "input2"; + ]; + ]; + + rml:predicateObjectMap [ + rml:predicate rmltest:inputFormat; + rml:objectMap [ + rml:reference "input_format2"; + ]; + ]; +. + +<#TriplesMapInput3> + a rml:TriplesMap; + + rml:logicalSource _:source; + + rml:subjectMap [ + rml:template "{ID}/input/{input3}"; + rml:class rmltest:Input; + ]; + + rml:predicateObjectMap [ + rml:predicate rmltest:input; + rml:objectMap [ + rml:reference "input3"; + ]; + ]; + + rml:predicateObjectMap [ + rml:predicate rmltest:inputFormat; + rml:objectMap [ + rml:reference "input_format3"; + ]; + ]; +. + +<#TriplesMapOutput1> + a rml:TriplesMap; + + rml:logicalSource _:source; + + rml:subjectMap [ + rml:template "{ID}/output/{output1}"; + rml:class rmltest:Output; + ]; + + rml:predicateObjectMap [ + rml:predicate rmltest:output; + rml:objectMap [ + rml:reference "output1"; + ]; + ]; + + rml:predicateObjectMap [ + rml:predicate rmltest:outputFormat; + rml:objectMap [ + rml:reference "output_format1"; + ]; + ]; +. + +<#TriplesMapOutput2> + a rml:TriplesMap; + + rml:logicalSource _:source; + + rml:subjectMap [ + rml:template "{ID}/output/{output2}"; + rml:class rmltest:Output; + ]; + + rml:predicateObjectMap [ + rml:predicate rmltest:output; + rml:objectMap [ + rml:reference "output2"; + ]; + ]; + + rml:predicateObjectMap [ + rml:predicate rmltest:outputFormat; + rml:objectMap [ + rml:reference "output_format2"; + ]; + ]; +. + +<#TriplesMapOutput3> + a rml:TriplesMap; + + rml:logicalSource _:source; + + rml:subjectMap [ + rml:template "{ID}/output/{output3}"; + rml:class rmltest:Output; + ]; + + rml:predicateObjectMap [ + rml:predicate rmltest:output; + rml:objectMap [ + rml:reference "output3"; + ]; + ]; + + rml:predicateObjectMap [ + rml:predicate rmltest:outputFormat; + rml:objectMap [ + rml:reference "output_format3"; + ]; + ]; +. + diff --git a/src/test/resources/rml-io/manifest.ttl b/src/test/resources/rml-io/manifest.ttl new file mode 100644 index 00000000..2eb9a286 --- /dev/null +++ b/src/test/resources/rml-io/manifest.ttl @@ -0,0 +1,1096 @@ + "Friends.json" . + "application/json" . + . + "default.nq" . + "application/n-quads" . + . + "RMLSTC0001a" . + "false"^^ . + . + "mapping.ttl" . + . + . + "Friends-UTF16.json" . + "application/json" . + . + "default.nq" . + "application/n-quads" . + . + "RMLSTC0001b" . + "false"^^ . + . + "mapping.ttl" . + . + . + "Friends.json" . + "application/json" . + . + "default.nq" . + "application/n-quads" . + . + "RMLSTC0002a" . + "false"^^ . + . + "mapping.ttl" . + . + . + "Friends.json.gz" . + "application/gzip+json" . + . + "default.nq" . + "application/n-quads" . + . + "RMLSTC0002b" . + "false"^^ . + . + "mapping.ttl" . + . + . + "Friends.json.zip" . + "application/gzip+json" . + . + "default.nq" . + "application/n-quads" . + . + "RMLSTC0002c" . + "false"^^ . + . + "mapping.ttl" . + . + . + "Friends.json.tar.xz" . + "application/tarxz+json" . + . + "default.nq" . + "application/n-quads" . + . + "RMLSTC0002d" . + "false"^^ . + . + "mapping.ttl" . + . + . + "Friends.json.tar.gz" . + "application/targz+json" . + . + "default.nq" . + "application/n-quads" . + . + "RMLSTC0002e" . + "false"^^ . + . + "mapping.ttl" . + . + . + "Friends.nt" . + "application/n-triples" . + . + "default.nq" . + "application/n-quads" . + . + "RMLSTC0003" . + "false"^^ . + . + "mapping.ttl" . + . + . + "Friends-NULL.csv" . + "text/csv" . + . + "default.nq" . + "application/n-quads" . + . + "RMLSTC0004a" . + "false"^^ . + . + "mapping.ttl" . + . + . + "Friends-NULL.csv" . + "text/csv" . + . + "default.nq" . + "application/n-quads" . + . + "RMLSTC0004b" . + "false"^^ . + . + "mapping.ttl" . + . + . + "Friends-NULL.csv" . + "text/csv" . + . + "default.nq" . + "application/n-quads" . + . + "RMLSTC0004c" . + "false"^^ . + . + "mapping.ttl" . + . + . + "Friends.csv" . + "text/csv" . + . + "default.nq" . + "application/n-quads" . + . + "RMLSTC0006a" . + "false"^^ . + . + "mapping.ttl" . + . + . + "Friends.csv" . + "text/csv" . + . + "default.nq" . + "application/n-quads" . + . + "RMLSTC0006b" . + "false"^^ . + . + "mapping.ttl" . + . + . + "Friends.json" . + "application/json" . + . + "default.nq" . + "application/n-quads" . + . + "RMLSTC0007a" . + "false"^^ . + . + "mapping.ttl" . + . + . + "Friends.csv" . + "text/csv" . + . + "default.nq" . + "application/n-quads" . + . + "RMLSTC0007b" . + "false"^^ . + . + "mapping.ttl" . + . + . + "Friends.xml" . + "text/xml" . + . + "default.nq" . + "application/n-quads" . + . + "RMLSTC0007c" . + "false"^^ . + . + "mapping.ttl" . + . + . + "Friends.xml" . + "text/xml" . + . + "default.nq" . + "application/n-quads" . + . + "RMLSTC0007d" . + "false"^^ . + . + "mapping.ttl" . + . + . + "Friends.json" . + "application/json" . + . + "default.nq" . + "application/n-quads" . + . + "RMLSTC0008a" . + "false"^^ . + . + "mapping.ttl" . + . + . + "Friends.json" . + "application/json" . + . + "default.nq" . + "application/n-quads" . + . + "RMLSTC0008b" . + "false"^^ . + . + "mapping.ttl" . + . + . + "Friends.csv" . + "text/csv" . + . + "RMLSTC0009a" . + "true"^^ . + . + "mapping.ttl" . + . + "Friends.csv" . + "text/csv" . + . + "RMLSTC0010a" . + "true"^^ . + . + "mapping.ttl" . + . + "Friends.csv" . + "text/csv" . + . + "RMLSTC0010b" . + "true"^^ . + . + "mapping.ttl" . + . + "http://w3id.org/rml/resources/rml-io/RMLSTC0011a/Friends.json" . + "application/json" . + . + "default.nq" . + "application/n-quads" . + . + "RMLSTC0011a" . + "false"^^ . + . + "mapping.ttl" . + . + . + "http://w3id.org/rml/resources/rml-io/RMLSTC0011b/Friends.json" . + "application/json" . + . + "default.nq" . + "application/n-quads" . + . + "RMLSTC0011b" . + "false"^^ . + . + "mapping.ttl" . + . + . + "http://w3id.org/rml/resources/rml-io/RMLSTC0011c/Friends.json" . + "application/json" . + . + "default.nq" . + "application/n-quads" . + . + "RMLSTC0011c" . + "false"^^ . + . + "mapping.ttl" . + . + . + "http://w3id.org/rml/resources/rml-io/RMLSTC0011d/Friends.json" . + "application/json" . + . + "default.nq" . + "application/n-quads" . + . + "RMLSTC0011d" . + "false"^^ . + . + "mapping.ttl" . + . + . + "http://w3id.org/rml/resources/rml-io/RMLSTC0011e/Friends.json" . + "application/json" . + . + "default.nq" . + "application/n-quads" . + . + "RMLSTC0011e" . + "false"^^ . + . + "mapping.ttl" . + . + . + "http://w3id.org/rml/resources/rml-io/RMLSTC0012a/Friends.json" . + "application/json" . + . + "default.nq" . + "application/n-quads" . + . + "RMLSTC0012a" . + "false"^^ . + . + "mapping.ttl" . + . + . + "http://w3id.org/rml/resources/rml-io/RMLSTC0012b/Friends.json" . + "application/json" . + . + "default.nq" . + "application/n-quads" . + . + "RMLSTC0012b" . + "false"^^ . + . + "mapping.ttl" . + . + . + "http://w3id.org/rml/resources/rml-io/RMLSTC0012c/Friends.json" . + "application/json" . + . + "default.nq" . + "application/n-quads" . + . + "RMLSTC0012c" . + "false"^^ . + . + "mapping.ttl" . + . + . + "http://w3id.org/rml/resources/rml-io/RMLSTC0012d/Friends.json" . + "application/json" . + . + "default.nq" . + "application/n-quads" . + . + "RMLSTC0012d" . + "false"^^ . + . + "mapping.ttl" . + . + . + "http://w3id.org/rml/resources/rml-io/RMLSTC0012e/Friends.json" . + "application/json" . + . + "default.nq" . + "application/n-quads" . + . + "RMLSTC0012e" . + "false"^^ . + . + "mapping.ttl" . + . + . + "Friends.json" . + "application/json" . + . + "default.nq" . + "application/n-quads" . + . + "RMLTTC0000" . + "false"^^ . + . + "mapping.ttl" . + . + . + "Friends.json" . + "application/json" . + . + "default.nq" . + "application/n-quads" . + . + "dump1.nq" . + "application/n-quads" . + . + "RMLTTC0001a" . + "false"^^ . + . + "mapping.ttl" . + . + . + . + "Friends.json" . + "application/json" . + . + "default.nq" . + "application/n-quads" . + . + "dump1.nq" . + "application/n-quads" . + . + "RMLTTC0001b" . + "false"^^ . + . + "mapping.ttl" . + . + . + . + "Friends.json" . + "application/json" . + . + "default.nq" . + "application/n-quads" . + . + "dump1.nq" . + "application/n-quads" . + . + "RMLTTC0001c" . + "false"^^ . + . + "mapping.ttl" . + . + . + . + "Friends.json" . + "application/json" . + . + "default.nq" . + "application/n-quads" . + . + "dump1.nq" . + "application/n-quads" . + . + "RMLTTC0001d" . + "false"^^ . + . + "mapping.ttl" . + . + . + . + "Friends.json" . + "application/json" . + . + "default.nq" . + "application/n-quads" . + . + "dump1.nq" . + "application/n-quads" . + . + "RMLTTC0001e" . + "false"^^ . + . + "mapping.ttl" . + . + . + . + "Friends.json" . + "application/json" . + . + "default.nq" . + "application/n-quads" . + . + "dump1.nq" . + "application/n-quads" . + . + "RMLTTC0001f" . + "false"^^ . + . + "mapping.ttl" . + . + . + . + "Friends.json" . + "application/json" . + . + "default.nq" . + "application/n-quads" . + . + "dump1.nq" . + "application/n-quads" . + . + "dump2.nq" . + "application/n-quads" . + . + "RMLTTC0002a" . + "false"^^ . + . + "mapping.ttl" . + . + . + . + . + "Friends.json" . + "application/json" . + . + "default.nq" . + "application/n-quads" . + . + "dump1.nq" . + "application/n-quads" . + . + "dump2.nq" . + "application/n-quads" . + . + "RMLTTC0002b" . + "false"^^ . + . + "mapping.ttl" . + . + . + . + . + "Friends.json" . + "application/json" . + . + "default.nq" . + "application/n-quads" . + . + "dump1.nq" . + "application/n-quads" . + . + "dump2.nq" . + "application/n-quads" . + . + "RMLTTC0002c" . + "false"^^ . + . + "mapping.ttl" . + . + . + . + . + "Friends.json" . + "application/json" . + . + "default.nq" . + "application/n-quads" . + . + "dump1.nq" . + "application/n-quads" . + . + "dump2.nq" . + "application/n-quads" . + . + "RMLTTC0002d" . + "false"^^ . + . + "mapping.ttl" . + . + . + . + . + "Friends.json" . + "application/json" . + . + "default.nq" . + "application/n-quads" . + . + "dump1.nq" . + "application/n-quads" . + . + "dump2.nq" . + "application/n-quads" . + . + "RMLTTC0002e" . + "false"^^ . + . + "mapping.ttl" . + . + . + . + . + "Friends.json" . + "application/json" . + . + "default.nq" . + "application/n-quads" . + . + "dump1.nq" . + "application/n-quads" . + . + "dump2.nq" . + "application/n-quads" . + . + "RMLTTC0002f" . + "false"^^ . + . + "mapping.ttl" . + . + . + . + . + "Friends.json" . + "application/json" . + . + "default.nq" . + "application/n-quads" . + . + "dump1.nq" . + "application/n-quads" . + . + "dump2.nq" . + "application/n-quads" . + . + "RMLTTC0002g" . + "false"^^ . + . + "mapping.ttl" . + . + . + . + . + "Friends.json" . + "application/json" . + . + "default.nq" . + "application/n-quads" . + . + "dump1.nq" . + "application/n-quads" . + . + "dump2.nq" . + "application/n-quads" . + . + "RMLTTC0002h" . + "false"^^ . + . + "mapping.ttl" . + . + . + . + . + "Friends.json" . + "application/json" . + . + "default.nq" . + "application/n-quads" . + . + "dump1.nq" . + "application/n-quads" . + . + "dump2.nq" . + "application/n-quads" . + . + "RMLTTC0002i" . + "false"^^ . + . + "mapping.ttl" . + . + . + . + . + "Friends.json" . + "application/json" . + . + "default.nq" . + "application/n-quads" . + . + "dump1.nq" . + "application/n-quads" . + . + "dump2.nq" . + "application/n-quads" . + . + "RMLTTC0002j" . + "false"^^ . + . + "mapping.ttl" . + . + . + . + . + "Friends.json" . + "application/json" . + . + "default.nq" . + "application/n-quads" . + . + "dump1.nq" . + "application/n-quads" . + . + "dump2.nq" . + "application/n-quads" . + . + "RMLTTC0002k" . + "false"^^ . + . + "mapping.ttl" . + . + . + . + . + "Friends.json" . + "application/json" . + . + "default.nq" . + "application/n-quads" . + . + "dump1.nq" . + "application/n-quads" . + . + "dump2.nq" . + "application/n-quads" . + . + "RMLTTC0002l" . + "false"^^ . + . + "mapping.ttl" . + . + . + . + . + "Friends.json" . + "application/json" . + . + "default.nq" . + "application/n-quads" . + . + "dump1.nq" . + "application/n-quads" . + . + "dump2.nq" . + "application/n-quads" . + . + "RMLTTC0002m" . + "false"^^ . + . + "mapping.ttl" . + . + . + . + . + "Friends.json" . + "application/json" . + . + "default.nq" . + "application/n-quads" . + . + "dump1.nq" . + "application/n-quads" . + . + "dump2.nq" . + "application/n-quads" . + . + "RMLTTC0002n" . + "false"^^ . + . + "mapping.ttl" . + . + . + . + . + "Friends.json" . + "application/json" . + . + "default.nq" . + "application/n-quads" . + . + "dump1.nq" . + "application/n-quads" . + . + "dump2.nq" . + "application/n-quads" . + . + "RMLTTC0002o" . + "false"^^ . + . + "mapping.ttl" . + . + . + . + . + "Friends.json" . + "application/json" . + . + "default.nq" . + "application/n-quads" . + . + "dump1.nq" . + "application/n-quads" . + . + "dump2.nq" . + "application/n-quads" . + . + "RMLTTC0002p" . + "false"^^ . + . + "mapping.ttl" . + . + . + . + . + "Friends.json" . + "application/json" . + . + "default.nq" . + "application/n-quads" . + . + "dump1.nq" . + "application/n-quads" . + . + "dump2.nq" . + "application/n-quads" . + . + "RMLTTC0002q" . + "false"^^ . + . + "mapping.ttl" . + . + . + . + . + "Friends.json" . + "application/json" . + . + "default.nq" . + "application/n-quads" . + . + "dump1.nq" . + "application/n-quads" . + . + "RMLTTC0002r" . + "false"^^ . + . + "mapping.ttl" . + . + . + . + "Friends.json" . + "application/json" . + . + "default.nq" . + "application/n-quads" . + . + "dump1.nq" . + "application/n-quads" . + . + "dump2.nq" . + "application/n-quads" . + . + "RMLTTC0003a" . + "false"^^ . + . + "mapping.ttl" . + . + . + . + . + "Friends.json" . + "application/json" . + . + "default.nq" . + "application/n-quads" . + . + "dump1.jsonld" . + "application/n-quads" . + . + "RMLTTC0004a" . + "false"^^ . + . + "mapping.ttl" . + . + . + . + "Friends.json" . + "application/json" . + . + "default.nq" . + "application/n-quads" . + . + "dump1.n3" . + "application/n-quads" . + . + "RMLTTC0004b" . + "false"^^ . + . + "mapping.ttl" . + . + . + . + "Friends.json" . + "application/json" . + . + "default.nq" . + "application/n-quads" . + . + "dump1.nt" . + "application/n-quads" . + . + "RMLTTC0004c" . + "false"^^ . + . + "mapping.ttl" . + . + . + . + "Friends.json" . + "application/json" . + . + "default.nq" . + "application/n-quads" . + . + "dump1.nq" . + "application/n-quads" . + . + "RMLTTC0004d" . + "false"^^ . + . + "mapping.ttl" . + . + . + . + "Friends.json" . + "application/json" . + . + "default.nq" . + "application/n-quads" . + . + "dump1.rdfjson" . + "application/n-quads" . + . + "RMLTTC0004e" . + "false"^^ . + . + "mapping.ttl" . + . + . + . + "Friends.json" . + "application/json" . + . + "default.nq" . + "application/n-quads" . + . + "dump1.rdfxml" . + "application/n-quads" . + . + "RMLTTC0004f" . + "false"^^ . + . + "mapping.ttl" . + . + . + . + "Friends.json" . + "application/json" . + . + "default.nq" . + "application/n-quads" . + . + "dump1.ttl" . + "application/n-quads" . + . + "RMLTTC0004g" . + "false"^^ . + . + "mapping.ttl" . + . + . + . + "Friends.json" . + "application/json" . + . + "default.nq" . + "application/n-quads" . + . + "dump1.nq" . + "application/n-quads" . + . + "RMLTTC0005a" . + "false"^^ . + . + "mapping.ttl" . + . + . + . + "Friends.json" . + "application/json" . + . + "default.nq" . + "application/n-quads" . + . + "dump1.nq" . + "application/n-quads" . + . + "RMLTTC0005b" . + "false"^^ . + . + "mapping.ttl" . + . + . + . + "Friends.json" . + "application/json" . + . + "default.nq" . + "application/n-quads" . + . + "dump1.nq" . + "application/n-quads" . + . + "RMLTTC0006a" . + "false"^^ . + . + "mapping.ttl" . + . + . + . + "Friends.json" . + "application/json" . + . + "default.nq" . + "application/n-quads" . + . + "dump1.nq.gz" . + "application/n-quads" . + . + "RMLTTC0006b" . + "false"^^ . + . + "mapping.ttl" . + . + . + . + "Friends.json" . + "application/json" . + . + "default.nq" . + "application/n-quads" . + . + "dump1.nq.zip" . + "application/n-quads" . + . + "RMLTTC0006c" . + "false"^^ . + . + "mapping.ttl" . + . + . + . + "Friends.json" . + "application/json" . + . + "default.nq" . + "application/n-quads" . + . + "dump1.nq.tar.xz" . + "application/n-quads" . + . + "RMLTTC0006d" . + "false"^^ . + . + "mapping.ttl" . + . + . + . + "Friends.json" . + "application/json" . + . + "default.nq" . + "application/n-quads" . + . + "dump1.nq.tar.gz" . + "application/n-quads" . + . + "RMLTTC0006e" . + "false"^^ . + . + "mapping.ttl" . + . + . + . + "Friends.json" . + "application/json" . + . + "default.nq" . + "application/n-quads" . + . + "dump1.nq" . + "application/n-quads" . + . + "RMLTTC0007a" . + "false"^^ . + . + "mapping.ttl" . + . + . + . diff --git a/src/test/resources/rml-io/metadata.csv b/src/test/resources/rml-io/metadata.csv new file mode 100644 index 00000000..c89d031e --- /dev/null +++ b/src/test/resources/rml-io/metadata.csv @@ -0,0 +1,74 @@ +ID,title,description,specification,mapping,input_format1,input_format2,input_format3,output_format1,output_format2,output_format3,input1,input2,input3,output1,output2,output3,error +RMLSTC0001a,Source with UTF-8 encoding,Test source with UTF-8 encoding,http://w3id.org/rml/io/,mapping.ttl,application/json,,,application/n-quads,,,Friends.json,,,default.nq,,,false +RMLSTC0001b,Source with UTF-16 encoding,Test source with UTF-16 encoding,http://w3id.org/rml/io/,mapping.ttl,application/json,,,application/n-quads,,,Friends-UTF16.json,,,default.nq,,,false +RMLSTC0002a,Source no compression,Test source without compression,http://w3id.org/rml/io/,mapping.ttl,application/json,,,application/n-quads,,,Friends.json,,,default.nq,,,false +RMLSTC0002b,Source GZip compression,Test source with GZip compression,http://w3id.org/rml/io/,mapping.ttl,application/gzip+json,,,application/n-quads,,,Friends.json.gz,,,default.nq,,,false +RMLSTC0002c,Source Zip compression,Test source with ZIP compression,http://w3id.org/rml/io/,mapping.ttl,application/gzip+json,,,application/n-quads,,,Friends.json.zip,,,default.nq,,,false +RMLSTC0002d,Source TarXz compression,Test source with TarXZ compression,http://w3id.org/rml/io/,mapping.ttl,application/tarxz+json,,,application/n-quads,,,Friends.json.tar.xz,,,default.nq,,,false +RMLSTC0002e,Source TarGzip compression,Test source with TarGZip compression,http://w3id.org/rml/io/,mapping.ttl,application/targz+json,,,application/n-quads,,,Friends.json.tar.gz,,,default.nq,,,false +RMLSTC0003,Source with query,Test source which requires a query,http://w3id.org/rml/io/,mapping.ttl,application/n-triples,,,application/n-quads,,,Friends.nt,,,default.nq,,,false +RMLSTC0004a,Source with default NULL values,Test source with default NULL values,http://w3id.org/rml/io/,mapping.ttl,text/csv,,,application/n-quads,,,Friends-NULL.csv,,,default.nq,,,false +RMLSTC0004b,Source with one NULL value,Test source with one NULL value defined,http://w3id.org/rml/io/,mapping.ttl,text/csv,,,application/n-quads,,,Friends-NULL.csv,,,default.nq,,,false +RMLSTC0004c,Source with multiple NULL values,Test source with multiple NULL values defined,http://w3id.org/rml/io/,mapping.ttl,text/csv,,,application/n-quads,,,Friends-NULL.csv,,,default.nq,,,false +RMLSTC0006a,Source with D2RQ access description,Test source with D2RQ access description for SQL databases,http://w3id.org/rml/io/,mapping.ttl,text/csv,,,application/n-quads,,,Friends.csv,,,default.nq,,,false +RMLSTC0006b,Source with a Relative Path Source,Test access to a file,http://w3id.org/rml/io/,mapping.ttl,text/csv,,,application/n-quads,,,Friends.csv,,,default.nq,,,false +RMLSTC0007a,Source with JSONPath reference formulation,Test source with JSONPath reference formulation,http://w3id.org/rml/io/,mapping.ttl,application/json,,,application/n-quads,,,Friends.json,,,default.nq,,,false +RMLSTC0007b,Source with CSV reference formulation,Test source with Tabular reference formulation,http://w3id.org/rml/io/,mapping.ttl,text/csv,,,application/n-quads,,,Friends.csv,,,default.nq,,,false +RMLSTC0007c,Source with XPath reference formulation,Test source with XPath reference formulation,http://w3id.org/rml/io/,mapping.ttl,text/xml,,,application/n-quads,,,Friends.xml,,,default.nq,,,false +RMLSTC0007d,Source with XPath reference formulation with namespaces,Test source with XPath reference formulation with namespaces,http://w3id.org/rml/io/,mapping.ttl,text/xml,,,application/n-quads,,,Friends.xml,,,default.nq,,,false +RMLSTC0008a,Multiple sources of same type,Tests the generation of all triples from multiple homogeneous sources ,http://w3id.org/rml/io/,mapping.ttl,application/json,,,application/n-quads,,,Friends.json,,,default.nq,,,false +RMLSTC0008b,Multiple sources of different type,Tests the generation of all triples from multiple heterogeneous sources ,http://w3id.org/rml/io/,mapping.ttl,application/json,,,application/n-quads,,,Friends.json,,,default.nq,,,false +RMLSTC0009a,Source with quoted columns,Tests the generation of triples where columns are quoted,http://w3id.org/rml/io/,mapping.ttl,text/csv,,,,,,Friends.csv,,,,,,true +RMLSTC0010a,"Invalid CSV source, reference to invalid column",Tests the identification of invalid CSV sources,http://w3id.org/rml/io/,mapping.ttl,text/csv,,,,,,Friends.csv,,,,,,true +RMLSTC0010b,"Invalid CSV source, no reference to invalid column","Tests the identification of invalid CSV sources, even when all columns referenced are valid",http://w3id.org/rml/io/,mapping.ttl,text/csv,,,,,,Friends.csv,,,,,,true +RMLSTC0011a,Complex JSON source,Tests the generation of triples from complex JSON sources,http://w3id.org/rml/io/,mapping.ttl,application/json,,,application/n-quads,,,http://w3id.org/rml/resources/rml-io/RMLSTC0011a/Friends.json,,,default.nq,,,false +RMLSTC0011b,Complex JSON source,Tests the generation of triples from complex JSON sources,http://w3id.org/rml/io/,mapping.ttl,application/json,,,application/n-quads,,,http://w3id.org/rml/resources/rml-io/RMLSTC0011b/Friends.json,,,default.nq,,,false +RMLSTC0011c,Complex JSON source,Tests the generation of triples from complex JSON sources,http://w3id.org/rml/io/,mapping.ttl,application/json,,,application/n-quads,,,http://w3id.org/rml/resources/rml-io/RMLSTC0011c/Friends.json,,,default.nq,,,false +RMLSTC0011d,Complex JSON source,Tests the generation of triples from complex JSON sources,http://w3id.org/rml/io/,mapping.ttl,application/json,,,application/n-quads,,,http://w3id.org/rml/resources/rml-io/RMLSTC0011d/Friends.json,,,default.nq,,,false +RMLSTC0011e,Complex JSON source,Tests the generation of triples from complex JSON sources,http://w3id.org/rml/io/,mapping.ttl,application/json,,,application/n-quads,,,http://w3id.org/rml/resources/rml-io/RMLSTC0011e/Friends.json,,,default.nq,,,false +RMLSTC0012a,Complex XML source,Tests the generation of triples from complex XML sources,http://w3id.org/rml/io/,mapping.ttl,application/json,,,application/n-quads,,,http://w3id.org/rml/resources/rml-io/RMLSTC0012a/Friends.json,,,default.nq,,,false +RMLSTC0012b,Complex XML source,Tests the generation of triples from complex XML sources,http://w3id.org/rml/io/,mapping.ttl,application/json,,,application/n-quads,,,http://w3id.org/rml/resources/rml-io/RMLSTC0012b/Friends.json,,,default.nq,,,false +RMLSTC0012c,Complex XML source,Tests the generation of triples from complex XML sources,http://w3id.org/rml/io/,mapping.ttl,application/json,,,application/n-quads,,,http://w3id.org/rml/resources/rml-io/RMLSTC0012c/Friends.json,,,default.nq,,,false +RMLSTC0012d,Complex XML source,Tests the generation of triples from complex XML sources,http://w3id.org/rml/io/,mapping.ttl,application/json,,,application/n-quads,,,http://w3id.org/rml/resources/rml-io/RMLSTC0012d/Friends.json,,,default.nq,,,false +RMLSTC0012e,Complex XML source,Tests the generation of triples from complex XML sources,http://w3id.org/rml/io/,mapping.ttl,application/json,,,application/n-quads,,,http://w3id.org/rml/resources/rml-io/RMLSTC0012e/Friends.json,,,default.nq,,,false +RMLTTC0000,Default target,Test exporting all triples to the default Target when not Targets are specified.,http://w3id.org/rml/io/,mapping.ttl,application/json,,,application/n-quads,,,Friends.json,,,default.nq,,,false +RMLTTC0001a,Single Target: Subject Map,Test exporting all triples to a single Target with a given subject.,http://w3id.org/rml/io/,mapping.ttl,application/json,,,application/n-quads,application/n-quads,,Friends.json,,,default.nq,dump1.nq,,false +RMLTTC0001b,Single Target: Predicate Map,Test exporting all triples to a single Target with a given predicate.,http://w3id.org/rml/io/,mapping.ttl,application/json,,,application/n-quads,application/n-quads,,Friends.json,,,default.nq,dump1.nq,,false +RMLTTC0001c,Single Target: Object Map,Test exporting all triples to a single Target with a given object reference.,http://w3id.org/rml/io/,mapping.ttl,application/json,,,application/n-quads,application/n-quads,,Friends.json,,,default.nq,dump1.nq,,false +RMLTTC0001d,Single Target: Graph Map,Test exporting all triples within a named graph to a single Target.,http://w3id.org/rml/io/,mapping.ttl,application/json,,,application/n-quads,application/n-quads,,Friends.json,,,default.nq,dump1.nq,,false +RMLTTC0001e,Single Target: Language Map,Test exporting all triples with a given language tag to a single Target.,http://w3id.org/rml/io/,mapping.ttl,application/json,,,application/n-quads,application/n-quads,,Friends.json,,,default.nq,dump1.nq,,false +RMLTTC0001f,Single Target: Datatype Map,Test exporting all triples with a given datatype to a single Target.,http://w3id.org/rml/io/,mapping.ttl,application/json,,,application/n-quads,application/n-quads,,Friends.json,,,default.nq,dump1.nq,,false +RMLTTC0002a,Multiple Targets: Same Term Map,Test exporting all triples to multiple Targets in the same Term Map.,http://w3id.org/rml/io/,mapping.ttl,application/json,,,application/n-quads,application/n-quads,application/n-quads,Friends.json,,,default.nq,dump1.nq,dump2.nq,false +RMLTTC0002b,Multiple Targets: Subject Map and Predicate Map,Test exporting all triples to a Target in a Subject Map and a Target in a Predicate Map.,http://w3id.org/rml/io/,mapping.ttl,application/json,,,application/n-quads,application/n-quads,application/n-quads,Friends.json,,,default.nq,dump1.nq,dump2.nq,false +RMLTTC0002c,Multiple Targets: Subject Map and Object Map,Test exporting all triples to a Target in a Subject Map and a Target in a Object Map.,http://w3id.org/rml/io/,mapping.ttl,application/json,,,application/n-quads,application/n-quads,application/n-quads,Friends.json,,,default.nq,dump1.nq,dump2.nq,false +RMLTTC0002d,Multiple Targets: Predicate Map and Object Map,Test exporting all triples to a Target in a Predicate Map and a Target in a Object Map.,http://w3id.org/rml/io/,mapping.ttl,application/json,,,application/n-quads,application/n-quads,application/n-quads,Friends.json,,,default.nq,dump1.nq,dump2.nq,false +RMLTTC0002e,"Multiple Targets: Subject Map, Predicate Map, and Object Map","Test exporting all triples to a Target in a Subject Map, a Target in a Predicate Map, and a Target in a Object Map.",http://w3id.org/rml/io/,mapping.ttl,application/json,,,application/n-quads,application/n-quads,application/n-quads,Friends.json,,,default.nq,dump1.nq,dump2.nq,false +RMLTTC0002f,Multiple Targets: Subject Map and Graph Map,Test exporting all triples to a Target in a Subject Map and a Target in a Graph Map.,http://w3id.org/rml/io/,mapping.ttl,application/json,,,application/n-quads,application/n-quads,application/n-quads,Friends.json,,,default.nq,dump1.nq,dump2.nq,false +RMLTTC0002g,Multiple Targets: Predicate Map and Graph Map,Test exporting all triples to a Target in a Predicate Map and a Target in a Graph Map.,http://w3id.org/rml/io/,mapping.ttl,application/json,,,application/n-quads,application/n-quads,application/n-quads,Friends.json,,,default.nq,dump1.nq,dump2.nq,false +RMLTTC0002h,Multiple Targets: Object Map and Graph Map,Test exporting all triples to a Target in a Object Map and a Target in a Graph Map.,http://w3id.org/rml/io/,mapping.ttl,application/json,,,application/n-quads,application/n-quads,application/n-quads,Friends.json,,,default.nq,dump1.nq,dump2.nq,false +RMLTTC0002i,Multiple Targets: Language Map and Graph Map,Test exporting all triples to a Target in a Language Map and a Target in a Graph Map.,http://w3id.org/rml/io/,mapping.ttl,application/json,,,application/n-quads,application/n-quads,application/n-quads,Friends.json,,,default.nq,dump1.nq,dump2.nq,false +RMLTTC0002j,Multiple Targets: Language Map and Object Map,Test exporting all triples to a Target in a Language Map and a Target in a Object Map.,http://w3id.org/rml/io/,mapping.ttl,application/json,,,application/n-quads,application/n-quads,application/n-quads,Friends.json,,,default.nq,dump1.nq,dump2.nq,false +RMLTTC0002k,Multiple Targets: Datatype Map and Graph Map,Test exporting all triples to a Target in a Datatype Map and a Target in a Graph Map.,http://w3id.org/rml/io/,mapping.ttl,application/json,,,application/n-quads,application/n-quads,application/n-quads,Friends.json,,,default.nq,dump1.nq,dump2.nq,false +RMLTTC0002l,Multiple Targets: Datatype Map and Object Map,Test exporting all triples to a Target in a Datatype Map and a Target in a Object Map.,http://w3id.org/rml/io/,mapping.ttl,application/json,,,application/n-quads,application/n-quads,application/n-quads,Friends.json,,,default.nq,dump1.nq,dump2.nq,false +RMLTTC0002m,Multiple Targets: Multiple Predicate Maps,Test exporting all triples to Targets in multiple Predicate Maps.,http://w3id.org/rml/io/,mapping.ttl,application/json,,,application/n-quads,application/n-quads,application/n-quads,Friends.json,,,default.nq,dump1.nq,dump2.nq,false +RMLTTC0002n,Multiple Targets: Multiple Object Maps,Test exporting all triples to Targets in multiple Object Maps.,http://w3id.org/rml/io/,mapping.ttl,application/json,,,application/n-quads,application/n-quads,application/n-quads,Friends.json,,,default.nq,dump1.nq,dump2.nq,false +RMLTTC0002o,Multiple Targets: Multiple Graph Maps,Test exporting all triples to Targets in multiple Graph Maps.,http://w3id.org/rml/io/,mapping.ttl,application/json,,,application/n-quads,application/n-quads,application/n-quads,Friends.json,,,default.nq,dump1.nq,dump2.nq,false +RMLTTC0002p,Multiple Targets: Multiple Language Maps,Test exporting all triples to Targets in multiple Language Maps.,http://w3id.org/rml/io/,mapping.ttl,application/json,,,application/n-quads,application/n-quads,application/n-quads,Friends.json,,,default.nq,dump1.nq,dump2.nq,false +RMLTTC0002q,Multiple Targets: Multiple Datatype Maps,Test exporting all triples to Targets in multiple Datatype Maps.,http://w3id.org/rml/io/,mapping.ttl,application/json,,,application/n-quads,application/n-quads,application/n-quads,Friends.json,,,default.nq,dump1.nq,dump2.nq,false +RMLTTC0002r,Multiple Targets: Multiple Term Maps with same Target,Test exporting all triples to same Target in multiple Term Maps.,http://w3id.org/rml/io/,mapping.ttl,application/json,,,application/n-quads,application/n-quads,,Friends.json,,,default.nq,dump1.nq,,false +RMLTTC0003a,Overriding Targets: Seperate Triples Map,Test exporting some triples to a different Target with a separate Triples Map.,http://w3id.org/rml/io/,mapping.ttl,application/json,,,application/n-quads,application/n-quads,application/n-quads,Friends.json,,,default.nq,dump1.nq,dump2.nq,false +RMLTTC0004a,Target JSON-LD,Test export all triples as JSON-LD,http://w3id.org/rml/io/,mapping.ttl,application/json,,,application/n-quads,application/n-quads,,Friends.json,,,default.nq,dump1.jsonld,,false +RMLTTC0004b,Target N3,Test export all triples as N3,http://w3id.org/rml/io/,mapping.ttl,application/json,,,application/n-quads,application/n-quads,,Friends.json,,,default.nq,dump1.n3,,false +RMLTTC0004c,Target N-Triples,Test export all triples as N-Triples,http://w3id.org/rml/io/,mapping.ttl,application/json,,,application/n-quads,application/n-quads,,Friends.json,,,default.nq,dump1.nt,,false +RMLTTC0004d,Target N-Quads,Test export all triples as N-Quads,http://w3id.org/rml/io/,mapping.ttl,application/json,,,application/n-quads,application/n-quads,,Friends.json,,,default.nq,dump1.nq,,false +RMLTTC0004e,Target RDF/JSON,Test export all triples as RDF/JSON,http://w3id.org/rml/io/,mapping.ttl,application/json,,,application/n-quads,application/n-quads,,Friends.json,,,default.nq,dump1.rdfjson,,false +RMLTTC0004f,Target RDF/XML,Test export all triples as RDF/XML,http://w3id.org/rml/io/,mapping.ttl,application/json,,,application/n-quads,application/n-quads,,Friends.json,,,default.nq,dump1.rdfxml,,false +RMLTTC0004g,Target Turtle,Test export all triples as Turtle,http://w3id.org/rml/io/,mapping.ttl,application/json,,,application/n-quads,application/n-quads,,Friends.json,,,default.nq,dump1.ttl,,false +RMLTTC0005a,Target UTF-8,Test export all triples with UTF-8 encoding,http://w3id.org/rml/io/,mapping.ttl,application/json,,,application/n-quads,application/n-quads,,Friends.json,,,default.nq,dump1.nq,,false +RMLTTC0005b,Target UTF-16,Test export all triples with UTF-16 encoding,http://w3id.org/rml/io/,mapping.ttl,application/json,,,application/n-quads,application/n-quads,,Friends.json,,,default.nq,dump1.nq,,false +RMLTTC0006a,Target no compression,Test export all triples with no compression,http://w3id.org/rml/io/,mapping.ttl,application/json,,,application/n-quads,application/n-quads,,Friends.json,,,default.nq,dump1.nq,,false +RMLTTC0006b,Target GZip compression,Test export all triples with GZip compression,http://w3id.org/rml/io/,mapping.ttl,application/json,,,application/n-quads,application/n-quads,,Friends.json,,,default.nq,dump1.nq.gz,,false +RMLTTC0006c,Target Zip compression,Test export all triples with ZIP compression,http://w3id.org/rml/io/,mapping.ttl,application/json,,,application/n-quads,application/n-quads,,Friends.json,,,default.nq,dump1.nq.zip,,false +RMLTTC0006d,Target TarXz compression,Test export all triples with TarXZ compression,http://w3id.org/rml/io/,mapping.ttl,application/json,,,application/n-quads,application/n-quads,,Friends.json,,,default.nq,dump1.nq.tar.xz,,false +RMLTTC0006e,Target TarGzip compression,Test export all triples with TarGZip compression,http://w3id.org/rml/io/,mapping.ttl,application/json,,,application/n-quads,application/n-quads,,Friends.json,,,default.nq,dump1.nq.tar.gz,,false +RMLTTC0007a,Target with FilePath description,Test export all triples to a target with File path access description,http://w3id.org/rml/io/,mapping.ttl,application/json,,,application/n-quads,application/n-quads,,Friends.json,,,default.nq,dump1.nq,,false diff --git a/src/test/resources/rml-io/section/abstract.md b/src/test/resources/rml-io/section/abstract.md new file mode 100644 index 00000000..5b514ad9 --- /dev/null +++ b/src/test/resources/rml-io/section/abstract.md @@ -0,0 +1 @@ +This document defines the RML-IO test cases to the determine the RML-IO specification conformance of tools. diff --git a/src/test/resources/rml-io/section/data-model.md b/src/test/resources/rml-io/section/data-model.md new file mode 100644 index 00000000..f4c3ad6a --- /dev/null +++ b/src/test/resources/rml-io/section/data-model.md @@ -0,0 +1,12 @@ +# Data model + +The test cases are semantically described for re-usability and shareability following the [W3C Test case description](https://www.w3.org/2006/03/test-description). +Each `test:Testcase` as the following properties: + +- `dcterms:identifier`: unique ID of the test case. +- `rmltest:hasError`: if an error of the RML Processor is expected or not. +- `rmltest:input`: One or more input data of the test case. +- `rmltest:output`: One or more output data of the test case. +- `rmltest:inputFormat`: the input data format. +- `rmltest:outputFormat`: the output data format. +- `rmltest:mappingDocument`: the RML mapping rules in Turtle. diff --git a/src/test/resources/rml-io/section/introduction.md b/src/test/resources/rml-io/section/introduction.md new file mode 100644 index 00000000..086c84b6 --- /dev/null +++ b/src/test/resources/rml-io/section/introduction.md @@ -0,0 +1,4 @@ +# Introduction + +This document defines the RML-IO test cases, consisting of a collection of test case documents (input and expected output). +The purpose of the test cases is to determine the conformance of tools that execute RML rules to the RML-IO specification. diff --git a/src/test/resources/rml-io/section/test-cases.md b/src/test/resources/rml-io/section/test-cases.md new file mode 100644 index 00000000..5fd1ecfb --- /dev/null +++ b/src/test/resources/rml-io/section/test-cases.md @@ -0,0 +1,10 @@ +# Test cases + +This section describes the RML-IO test cases. These descriptions are also available as RDF. +The files are available on [GitHub](https://github.com/kg-construct/rml-io/tree/main/test-cases) in the folder `test-cases`. +Each test case is contained in a single folder, containing three types of files: + + - Zero or more files containing the data sources, in the case of JSON, XML, CSV, or containing the SQL statements to create the necessary tables, in the case of MySQL, PostgreSQL, and SQL Server. + - One file with the RML rules, called `mapping.ttl`, in the Turtle format. + - Zero or more files with the expected RDF. No file is provided if an error is expected that must halt the generation of the RDF because of an error. + diff --git a/src/test/resources/rml-lv/README.md b/src/test/resources/rml-lv/README.md new file mode 100644 index 00000000..57adbc3f --- /dev/null +++ b/src/test/resources/rml-lv/README.md @@ -0,0 +1,12 @@ +# RML LV test cases + +The test cases publication (html pages) can be generated as followed: + +1. Add the testcase description in `descriptions.csv` or fetch it from the [Google spreadsheet](https://docs.google.com/spreadsheets/d/1Ui216z2cF8bNAbdZvws-JoAhcjj4M2k_NlfzmCh1jh8/edit?gid=1769343477#gid=1769343477). +2. Navigate to folder ./test-cases +3. Execute the `make-metadata.py` script: `python3 make-metadata.py http://w3id.org/rml/lv/` + (This is based on the content of the folders with the test cases, and on the file descriptions.csv for the descriptions of the cases) +4. Download burp: `curl -LO https://github.com/kg-construct/BURP/releases/download/v0.1.1/burp.jar` +5. Generate the manifest with [Burp](https://github.com/kg-construct/BURP): `java -jar burp.jar -m manifest.rml.ttl -o manifest.ttl -b http://w3id.org/rml/lv/test/` +6. Run list.sh and insert output in dev.html +7. To publish the new HTML verson of the test cases, export `dev.html` as `index.html` in ./docs and in a subfolder with the date of the publication (maybe adapt the publication date) diff --git a/src/test/resources/rml-lv/RMLLVTC0000a/README.md b/src/test/resources/rml-lv/RMLLVTC0000a/README.md new file mode 100644 index 00000000..6fa5a1e9 --- /dev/null +++ b/src/test/resources/rml-lv/RMLLVTC0000a/README.md @@ -0,0 +1,82 @@ +## RMLLVTC0000a + +**Title**: Logical view on JSON source + +**Description**: Test a view on a hierarchical source + +**Error expected?** No + +**Input** +``` +{ + "people": [ + { + "name": "alice", + "items": [ + { + "type": "sword", + "weight": 1500 + }, + { + "type": "shield", + "weight": 2500 + } + ] + }, + { + "name": "bob", + "items": [ + { + "type": "flower", + "weight": 15 + } + ] + } + ] +} + +``` + +**Mapping** +``` +@prefix rml: . +@prefix : . + +:jsonSource a rml:LogicalSource ; + rml:source [ + a rml:RelativePathSource , rml:Source ; + rml:root rml:MappingDirectory ; + rml:path "people.json" ; + ] ; + rml:referenceFormulation rml:JSONPath ; + rml:iterator "$.people[*]" . + +:jsonView a rml:LogicalView ; + rml:viewOn :jsonSource ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "name" ; + rml:reference "$.name" ; + ] . + +:triplesMapPerson a rml:TriplesMap ; + rml:logicalSource :jsonView ; + rml:subjectMap [ + rml:template "http://example.org/person/{name}" ; + ] ; + rml:predicateObjectMap [ + rml:predicate :hasName ; + rml:objectMap [ + rml:reference "name" ; + ] ; + ] . + +``` + +**Output** +``` + "alice" . + "bob" . + +``` + diff --git a/src/test/resources/rml-lv/RMLLVTC0000a/mapping.ttl b/src/test/resources/rml-lv/RMLLVTC0000a/mapping.ttl new file mode 100644 index 00000000..ac68a610 --- /dev/null +++ b/src/test/resources/rml-lv/RMLLVTC0000a/mapping.ttl @@ -0,0 +1,31 @@ +@prefix rml: . +@prefix : . + +:jsonSource a rml:LogicalSource ; + rml:source [ + a rml:RelativePathSource , rml:Source ; + rml:root rml:MappingDirectory ; + rml:path "people.json" ; + ] ; + rml:referenceFormulation rml:JSONPath ; + rml:iterator "$.people[*]" . + +:jsonView a rml:LogicalView ; + rml:viewOn :jsonSource ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "name" ; + rml:reference "$.name" ; + ] . + +:triplesMapPerson a rml:TriplesMap ; + rml:logicalSource :jsonView ; + rml:subjectMap [ + rml:template "http://example.org/person/{name}" ; + ] ; + rml:predicateObjectMap [ + rml:predicate :hasName ; + rml:objectMap [ + rml:reference "name" ; + ] ; + ] . diff --git a/src/test/resources/rml-lv/RMLLVTC0000a/output.nq b/src/test/resources/rml-lv/RMLLVTC0000a/output.nq new file mode 100644 index 00000000..1112907a --- /dev/null +++ b/src/test/resources/rml-lv/RMLLVTC0000a/output.nq @@ -0,0 +1,2 @@ + "alice" . + "bob" . diff --git a/src/test/resources/rml-lv/RMLLVTC0000a/people.json b/src/test/resources/rml-lv/RMLLVTC0000a/people.json new file mode 100644 index 00000000..87d56294 --- /dev/null +++ b/src/test/resources/rml-lv/RMLLVTC0000a/people.json @@ -0,0 +1,26 @@ +{ + "people": [ + { + "name": "alice", + "items": [ + { + "type": "sword", + "weight": 1500 + }, + { + "type": "shield", + "weight": 2500 + } + ] + }, + { + "name": "bob", + "items": [ + { + "type": "flower", + "weight": 15 + } + ] + } + ] +} diff --git a/src/test/resources/rml-lv/RMLLVTC0000b/README.md b/src/test/resources/rml-lv/RMLLVTC0000b/README.md new file mode 100644 index 00000000..f94dd6f3 --- /dev/null +++ b/src/test/resources/rml-lv/RMLLVTC0000b/README.md @@ -0,0 +1,59 @@ +## RMLLVTC0000b + +**Title**: Logical view on CSV source + +**Description**: Test a view on a tabular source + +**Error expected?** No + +**Input** +``` +name,birthyear +alice,1995 +bob,1999 +tobias,2005 + +``` + +**Mapping** +``` +@prefix rml: . +@prefix : . + +:csvSource a rml:LogicalSource ; + rml:source [ + a rml:RelativePathSource , rml:Source ; + rml:root rml:MappingDirectory ; + rml:path "people.csv" ; + ] ; + rml:referenceFormulation rml:CSV . + +:csvView a rml:LogicalView ; + rml:viewOn :csvSource ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "name" ; + rml:reference "name" ; + ] . + +:triplesMapPerson a rml:TriplesMap ; + rml:logicalSource :csvView ; + rml:subjectMap [ + rml:template "http://example.org/person/{name}" ; + ] ; + rml:predicateObjectMap [ + rml:predicate :hasName ; + rml:objectMap [ + rml:reference "name" ; + ] ; + ] . + +``` + +**Output** +``` + "alice" . + "bob" . + "tobias" . +``` + diff --git a/src/test/resources/rml-lv/RMLLVTC0000b/mapping.ttl b/src/test/resources/rml-lv/RMLLVTC0000b/mapping.ttl new file mode 100644 index 00000000..75c424e4 --- /dev/null +++ b/src/test/resources/rml-lv/RMLLVTC0000b/mapping.ttl @@ -0,0 +1,30 @@ +@prefix rml: . +@prefix : . + +:csvSource a rml:LogicalSource ; + rml:source [ + a rml:RelativePathSource , rml:Source ; + rml:root rml:MappingDirectory ; + rml:path "people.csv" ; + ] ; + rml:referenceFormulation rml:CSV . + +:csvView a rml:LogicalView ; + rml:viewOn :csvSource ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "name" ; + rml:reference "name" ; + ] . + +:triplesMapPerson a rml:TriplesMap ; + rml:logicalSource :csvView ; + rml:subjectMap [ + rml:template "http://example.org/person/{name}" ; + ] ; + rml:predicateObjectMap [ + rml:predicate :hasName ; + rml:objectMap [ + rml:reference "name" ; + ] ; + ] . diff --git a/src/test/resources/rml-lv/RMLLVTC0000b/output.nq b/src/test/resources/rml-lv/RMLLVTC0000b/output.nq new file mode 100644 index 00000000..f611f1d9 --- /dev/null +++ b/src/test/resources/rml-lv/RMLLVTC0000b/output.nq @@ -0,0 +1,3 @@ + "alice" . + "bob" . + "tobias" . \ No newline at end of file diff --git a/src/test/resources/rml-lv/RMLLVTC0000b/people.csv b/src/test/resources/rml-lv/RMLLVTC0000b/people.csv new file mode 100644 index 00000000..edc942d0 --- /dev/null +++ b/src/test/resources/rml-lv/RMLLVTC0000b/people.csv @@ -0,0 +1,4 @@ +name,birthyear +alice,1995 +bob,1999 +tobias,2005 diff --git a/src/test/resources/rml-lv/RMLLVTC0000c/README.md b/src/test/resources/rml-lv/RMLLVTC0000c/README.md new file mode 100644 index 00000000..ba0afbb7 --- /dev/null +++ b/src/test/resources/rml-lv/RMLLVTC0000c/README.md @@ -0,0 +1,90 @@ +## RMLLVTC0000c + +**Title**: Logical View on Logical View + +**Description**: Test a view on a logical view + +**Error expected?** No + +**Input** +``` +{ + "people": [ + { + "name": "alice", + "items": [ + { + "type": "sword", + "weight": 1500 + }, + { + "type": "shield", + "weight": 2500 + } + ] + }, + { + "name": "bob", + "items": [ + { + "type": "flower", + "weight": 15 + } + ] + } + ] +} + +``` + +**Mapping** +``` +@prefix rml: . +@prefix : . + +:jsonSource a rml:LogicalSource ; + rml:source [ + a rml:RelativePathSource , rml:Source ; + rml:root rml:MappingDirectory ; + rml:path "people.json" ; + ] ; + rml:referenceFormulation rml:JSONPath ; + rml:iterator "$.people[*]" . + +:jsonView a rml:LogicalView ; + rml:viewOn :jsonSource ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "name" ; + rml:reference "$.name" ; + ] . + +:jsonViewOnJsonView a rml:LogicalView ; + rml:viewOn :jsonView ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "newName" ; + rml:reference "name" ; + ] . + +:triplesMapPerson a rml:TriplesMap ; + rml:logicalSource :jsonViewOnJsonView ; + rml:subjectMap [ + rml:template "http://example.org/person/{newName}" ; + ] ; + rml:predicateObjectMap [ + rml:predicate :hasName ; + rml:objectMap [ + rml:reference "newName" ; + ] ; + ] . + +``` + +**Output** +``` + "alice" . + "bob" . + +``` + diff --git a/src/test/resources/rml-lv/RMLLVTC0000c/mapping.ttl b/src/test/resources/rml-lv/RMLLVTC0000c/mapping.ttl new file mode 100644 index 00000000..3f5abf02 --- /dev/null +++ b/src/test/resources/rml-lv/RMLLVTC0000c/mapping.ttl @@ -0,0 +1,39 @@ +@prefix rml: . +@prefix : . + +:jsonSource a rml:LogicalSource ; + rml:source [ + a rml:RelativePathSource , rml:Source ; + rml:root rml:MappingDirectory ; + rml:path "people.json" ; + ] ; + rml:referenceFormulation rml:JSONPath ; + rml:iterator "$.people[*]" . + +:jsonView a rml:LogicalView ; + rml:viewOn :jsonSource ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "name" ; + rml:reference "$.name" ; + ] . + +:jsonViewOnJsonView a rml:LogicalView ; + rml:viewOn :jsonView ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "newName" ; + rml:reference "name" ; + ] . + +:triplesMapPerson a rml:TriplesMap ; + rml:logicalSource :jsonViewOnJsonView ; + rml:subjectMap [ + rml:template "http://example.org/person/{newName}" ; + ] ; + rml:predicateObjectMap [ + rml:predicate :hasName ; + rml:objectMap [ + rml:reference "newName" ; + ] ; + ] . diff --git a/src/test/resources/rml-lv/RMLLVTC0000c/output.nq b/src/test/resources/rml-lv/RMLLVTC0000c/output.nq new file mode 100644 index 00000000..1112907a --- /dev/null +++ b/src/test/resources/rml-lv/RMLLVTC0000c/output.nq @@ -0,0 +1,2 @@ + "alice" . + "bob" . diff --git a/src/test/resources/rml-lv/RMLLVTC0000c/people.json b/src/test/resources/rml-lv/RMLLVTC0000c/people.json new file mode 100644 index 00000000..87d56294 --- /dev/null +++ b/src/test/resources/rml-lv/RMLLVTC0000c/people.json @@ -0,0 +1,26 @@ +{ + "people": [ + { + "name": "alice", + "items": [ + { + "type": "sword", + "weight": 1500 + }, + { + "type": "shield", + "weight": 2500 + } + ] + }, + { + "name": "bob", + "items": [ + { + "type": "flower", + "weight": 15 + } + ] + } + ] +} diff --git a/src/test/resources/rml-lv/RMLLVTC0001a/README.md b/src/test/resources/rml-lv/RMLLVTC0001a/README.md new file mode 100644 index 00000000..ae410248 --- /dev/null +++ b/src/test/resources/rml-lv/RMLLVTC0001a/README.md @@ -0,0 +1,82 @@ +## RMLLVTC0001a + +**Title**: Expression Field: Reference + +**Description**: Test a reference in an expression field + +**Error expected?** No + +**Input** +``` +{ + "people": [ + { + "name": "alice", + "items": [ + { + "type": "sword", + "weight": 1500 + }, + { + "type": "shield", + "weight": 2500 + } + ] + }, + { + "name": "bob", + "items": [ + { + "type": "flower", + "weight": 15 + } + ] + } + ] +} + +``` + +**Mapping** +``` +@prefix rml: . +@prefix : . + +:jsonSource a rml:LogicalSource ; + rml:source [ + a rml:RelativePathSource , rml:Source ; + rml:root rml:MappingDirectory ; + rml:path "people.json" ; + ] ; + rml:referenceFormulation rml:JSONPath ; + rml:iterator "$.people[*]" . + +:jsonView a rml:LogicalView ; + rml:viewOn :jsonSource ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "name" ; + rml:reference "$.name" ; + ] . + +:triplesMapPerson a rml:TriplesMap ; + rml:logicalSource :jsonView ; + rml:subjectMap [ + rml:template "http://example.org/person/{name}" ; + ] ; + rml:predicateObjectMap [ + rml:predicate :hasName ; + rml:objectMap [ + rml:reference "name" ; + ] ; + ] . + +``` + +**Output** +``` + "alice" . + "bob" . + +``` + diff --git a/src/test/resources/rml-lv/RMLLVTC0001a/mapping.ttl b/src/test/resources/rml-lv/RMLLVTC0001a/mapping.ttl new file mode 100644 index 00000000..ac68a610 --- /dev/null +++ b/src/test/resources/rml-lv/RMLLVTC0001a/mapping.ttl @@ -0,0 +1,31 @@ +@prefix rml: . +@prefix : . + +:jsonSource a rml:LogicalSource ; + rml:source [ + a rml:RelativePathSource , rml:Source ; + rml:root rml:MappingDirectory ; + rml:path "people.json" ; + ] ; + rml:referenceFormulation rml:JSONPath ; + rml:iterator "$.people[*]" . + +:jsonView a rml:LogicalView ; + rml:viewOn :jsonSource ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "name" ; + rml:reference "$.name" ; + ] . + +:triplesMapPerson a rml:TriplesMap ; + rml:logicalSource :jsonView ; + rml:subjectMap [ + rml:template "http://example.org/person/{name}" ; + ] ; + rml:predicateObjectMap [ + rml:predicate :hasName ; + rml:objectMap [ + rml:reference "name" ; + ] ; + ] . diff --git a/src/test/resources/rml-lv/RMLLVTC0001a/output.nq b/src/test/resources/rml-lv/RMLLVTC0001a/output.nq new file mode 100644 index 00000000..1112907a --- /dev/null +++ b/src/test/resources/rml-lv/RMLLVTC0001a/output.nq @@ -0,0 +1,2 @@ + "alice" . + "bob" . diff --git a/src/test/resources/rml-lv/RMLLVTC0001a/people.json b/src/test/resources/rml-lv/RMLLVTC0001a/people.json new file mode 100644 index 00000000..87d56294 --- /dev/null +++ b/src/test/resources/rml-lv/RMLLVTC0001a/people.json @@ -0,0 +1,26 @@ +{ + "people": [ + { + "name": "alice", + "items": [ + { + "type": "sword", + "weight": 1500 + }, + { + "type": "shield", + "weight": 2500 + } + ] + }, + { + "name": "bob", + "items": [ + { + "type": "flower", + "weight": 15 + } + ] + } + ] +} diff --git a/src/test/resources/rml-lv/RMLLVTC0001b/README.md b/src/test/resources/rml-lv/RMLLVTC0001b/README.md new file mode 100644 index 00000000..3eb3a775 --- /dev/null +++ b/src/test/resources/rml-lv/RMLLVTC0001b/README.md @@ -0,0 +1,87 @@ +## RMLLVTC0001b + +**Title**: Expression Field: Template + +**Description**: Test a template in an expression field + +**Error expected?** No + +**Input** +``` +{ + "people": [ + { + "name": "alice", + "items": [ + { + "type": "sword", + "weight": 1500 + }, + { + "type": "shield", + "weight": 2500 + } + ] + }, + { + "name": "bob", + "items": [ + { + "type": "flower", + "weight": 15 + } + ] + } + ] +} + +``` + +**Mapping** +``` +@prefix rml: . +@prefix : . + +:jsonSource a rml:LogicalSource ; + rml:source [ + a rml:RelativePathSource , rml:Source ; + rml:root rml:MappingDirectory ; + rml:path "people.json" ; + ] ; + rml:referenceFormulation rml:JSONPath ; + rml:iterator "$.people[*]" . + +:jsonView a rml:LogicalView ; + rml:viewOn :jsonSource ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "name" ; + rml:reference "$.name" ; + ] ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "race" ; + rml:constant "human" ; + ] . + +:triplesMapPerson a rml:TriplesMap ; + rml:logicalSource :jsonView ; + rml:subjectMap [ + rml:template "http://example.org/person/{name}" ; + ] ; + rml:predicateObjectMap [ + rml:predicate :hasRace ; + rml:objectMap [ + rml:reference "race" ; + ] ; + ] . + +``` + +**Output** +``` + "human" . + "human" . + +``` + diff --git a/src/test/resources/rml-lv/RMLLVTC0001b/mapping.ttl b/src/test/resources/rml-lv/RMLLVTC0001b/mapping.ttl new file mode 100644 index 00000000..ff5012c6 --- /dev/null +++ b/src/test/resources/rml-lv/RMLLVTC0001b/mapping.ttl @@ -0,0 +1,36 @@ +@prefix rml: . +@prefix : . + +:jsonSource a rml:LogicalSource ; + rml:source [ + a rml:RelativePathSource , rml:Source ; + rml:root rml:MappingDirectory ; + rml:path "people.json" ; + ] ; + rml:referenceFormulation rml:JSONPath ; + rml:iterator "$.people[*]" . + +:jsonView a rml:LogicalView ; + rml:viewOn :jsonSource ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "name" ; + rml:reference "$.name" ; + ] ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "race" ; + rml:constant "human" ; + ] . + +:triplesMapPerson a rml:TriplesMap ; + rml:logicalSource :jsonView ; + rml:subjectMap [ + rml:template "http://example.org/person/{name}" ; + ] ; + rml:predicateObjectMap [ + rml:predicate :hasRace ; + rml:objectMap [ + rml:reference "race" ; + ] ; + ] . diff --git a/src/test/resources/rml-lv/RMLLVTC0001b/output.nq b/src/test/resources/rml-lv/RMLLVTC0001b/output.nq new file mode 100644 index 00000000..dcc01ba7 --- /dev/null +++ b/src/test/resources/rml-lv/RMLLVTC0001b/output.nq @@ -0,0 +1,2 @@ + "human" . + "human" . diff --git a/src/test/resources/rml-lv/RMLLVTC0001b/people.json b/src/test/resources/rml-lv/RMLLVTC0001b/people.json new file mode 100644 index 00000000..87d56294 --- /dev/null +++ b/src/test/resources/rml-lv/RMLLVTC0001b/people.json @@ -0,0 +1,26 @@ +{ + "people": [ + { + "name": "alice", + "items": [ + { + "type": "sword", + "weight": 1500 + }, + { + "type": "shield", + "weight": 2500 + } + ] + }, + { + "name": "bob", + "items": [ + { + "type": "flower", + "weight": 15 + } + ] + } + ] +} diff --git a/src/test/resources/rml-lv/RMLLVTC0001c/README.md b/src/test/resources/rml-lv/RMLLVTC0001c/README.md new file mode 100644 index 00000000..d393dd62 --- /dev/null +++ b/src/test/resources/rml-lv/RMLLVTC0001c/README.md @@ -0,0 +1,89 @@ +## RMLLVTC0001c + +**Title**: Expression Field: Constant + +**Description**: Test a constant expression in an expression field + +**Error expected?** No + +**Input** +``` +{ + "people": [ + { + "name": "alice", + "lastName": "smith", + "items": [ + { + "type": "sword", + "weight": 1500 + }, + { + "type": "shield", + "weight": 2500 + } + ] + }, + { + "name": "bob", + "lastName": "jones", + "items": [ + { + "type": "flower", + "weight": 15 + } + ] + } + ] +} + +``` + +**Mapping** +``` +@prefix rml: . +@prefix : . + +:jsonSource a rml:LogicalSource ; + rml:source [ + a rml:RelativePathSource , rml:Source ; + rml:root rml:MappingDirectory ; + rml:path "people.json" ; + ] ; + rml:referenceFormulation rml:JSONPath ; + rml:iterator "$.people[*]" . + +:jsonView a rml:LogicalView ; + rml:viewOn :jsonSource ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "name" ; + rml:reference "$.name" ; + ] ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "fullName" ; + rml:template "{name} {lastName}" ; + ] . + +:triplesMapPerson a rml:TriplesMap ; + rml:logicalSource :jsonView ; + rml:subjectMap [ + rml:template "http://example.org/person/{name}" ; + ] ; + rml:predicateObjectMap [ + rml:predicate :hasFullName ; + rml:objectMap [ + rml:reference "fullName" ; + ] ; + ] . + +``` + +**Output** +``` + "alice smith" . + "bob jones" . + +``` + diff --git a/src/test/resources/rml-lv/RMLLVTC0001c/mapping.ttl b/src/test/resources/rml-lv/RMLLVTC0001c/mapping.ttl new file mode 100644 index 00000000..14291044 --- /dev/null +++ b/src/test/resources/rml-lv/RMLLVTC0001c/mapping.ttl @@ -0,0 +1,36 @@ +@prefix rml: . +@prefix : . + +:jsonSource a rml:LogicalSource ; + rml:source [ + a rml:RelativePathSource , rml:Source ; + rml:root rml:MappingDirectory ; + rml:path "people.json" ; + ] ; + rml:referenceFormulation rml:JSONPath ; + rml:iterator "$.people[*]" . + +:jsonView a rml:LogicalView ; + rml:viewOn :jsonSource ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "name" ; + rml:reference "$.name" ; + ] ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "fullName" ; + rml:template "{name} {lastName}" ; + ] . + +:triplesMapPerson a rml:TriplesMap ; + rml:logicalSource :jsonView ; + rml:subjectMap [ + rml:template "http://example.org/person/{name}" ; + ] ; + rml:predicateObjectMap [ + rml:predicate :hasFullName ; + rml:objectMap [ + rml:reference "fullName" ; + ] ; + ] . diff --git a/src/test/resources/rml-lv/RMLLVTC0001c/output.nq b/src/test/resources/rml-lv/RMLLVTC0001c/output.nq new file mode 100644 index 00000000..69788f73 --- /dev/null +++ b/src/test/resources/rml-lv/RMLLVTC0001c/output.nq @@ -0,0 +1,2 @@ + "alice smith" . + "bob jones" . diff --git a/src/test/resources/rml-lv/RMLLVTC0001c/people.json b/src/test/resources/rml-lv/RMLLVTC0001c/people.json new file mode 100644 index 00000000..49969657 --- /dev/null +++ b/src/test/resources/rml-lv/RMLLVTC0001c/people.json @@ -0,0 +1,28 @@ +{ + "people": [ + { + "name": "alice", + "lastName": "smith", + "items": [ + { + "type": "sword", + "weight": 1500 + }, + { + "type": "shield", + "weight": 2500 + } + ] + }, + { + "name": "bob", + "lastName": "jones", + "items": [ + { + "type": "flower", + "weight": 15 + } + ] + } + ] +} diff --git a/src/test/resources/rml-lv/RMLLVTC0001d/README.md b/src/test/resources/rml-lv/RMLLVTC0001d/README.md new file mode 100644 index 00000000..325b3a8e --- /dev/null +++ b/src/test/resources/rml-lv/RMLLVTC0001d/README.md @@ -0,0 +1,90 @@ +## RMLLVTC0001d + +**Title**: Expression Field Siblings + +**Description**: Test multiple expression fields with the same parent + +**Error expected?** No + +**Input** +``` +{ + "people": [ + { + "name": "alice", + "lastName": "smith", + "items": [ + { + "type": "sword", + "weight": 1500 + }, + { + "type": "shield", + "weight": 2500 + } + ] + }, + { + "name": "bob", + "lastName": "jones", + "items": [ + { + "type": "flower", + "weight": 15 + } + ] + } + ] +} + +``` + +**Mapping** +``` +@prefix rml: . +@prefix : . + +:jsonSource a rml:LogicalSource ; + rml:source [ + a rml:RelativePathSource , rml:Source ; + rml:root rml:MappingDirectory ; + rml:path "people.json" ; + ] ; + rml:referenceFormulation rml:JSONPath ; + rml:iterator "$.people[*]" . + +:jsonView a rml:LogicalView ; + rml:viewOn :jsonSource ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "name" ; + rml:reference "$.name" ; + ] ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "lastName" ; + rml:reference "$.lastName" ; + ] . + +:triplesMapPerson a rml:TriplesMap ; + rml:logicalSource :jsonView ; + rml:subjectMap [ + rml:template "http://example.org/person/{name}" ; + ] ; + rml:predicateObjectMap [ + rml:predicate :hasFullName ; + rml:objectMap [ + rml:template "{name} {lastName}" ; + rml:termType rml:Literal ; + ] ; + ] . + +``` + +**Output** +``` + "alice smith" . + "bob jones" . + +``` + diff --git a/src/test/resources/rml-lv/RMLLVTC0001d/mapping.ttl b/src/test/resources/rml-lv/RMLLVTC0001d/mapping.ttl new file mode 100644 index 00000000..a380b398 --- /dev/null +++ b/src/test/resources/rml-lv/RMLLVTC0001d/mapping.ttl @@ -0,0 +1,37 @@ +@prefix rml: . +@prefix : . + +:jsonSource a rml:LogicalSource ; + rml:source [ + a rml:RelativePathSource , rml:Source ; + rml:root rml:MappingDirectory ; + rml:path "people.json" ; + ] ; + rml:referenceFormulation rml:JSONPath ; + rml:iterator "$.people[*]" . + +:jsonView a rml:LogicalView ; + rml:viewOn :jsonSource ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "name" ; + rml:reference "$.name" ; + ] ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "lastName" ; + rml:reference "$.lastName" ; + ] . + +:triplesMapPerson a rml:TriplesMap ; + rml:logicalSource :jsonView ; + rml:subjectMap [ + rml:template "http://example.org/person/{name}" ; + ] ; + rml:predicateObjectMap [ + rml:predicate :hasFullName ; + rml:objectMap [ + rml:template "{name} {lastName}" ; + rml:termType rml:Literal ; + ] ; + ] . diff --git a/src/test/resources/rml-lv/RMLLVTC0001d/output.nq b/src/test/resources/rml-lv/RMLLVTC0001d/output.nq new file mode 100644 index 00000000..69788f73 --- /dev/null +++ b/src/test/resources/rml-lv/RMLLVTC0001d/output.nq @@ -0,0 +1,2 @@ + "alice smith" . + "bob jones" . diff --git a/src/test/resources/rml-lv/RMLLVTC0001d/people.json b/src/test/resources/rml-lv/RMLLVTC0001d/people.json new file mode 100644 index 00000000..49969657 --- /dev/null +++ b/src/test/resources/rml-lv/RMLLVTC0001d/people.json @@ -0,0 +1,28 @@ +{ + "people": [ + { + "name": "alice", + "lastName": "smith", + "items": [ + { + "type": "sword", + "weight": 1500 + }, + { + "type": "shield", + "weight": 2500 + } + ] + }, + { + "name": "bob", + "lastName": "jones", + "items": [ + { + "type": "flower", + "weight": 15 + } + ] + } + ] +} diff --git a/src/test/resources/rml-lv/RMLLVTC0002a/README.md b/src/test/resources/rml-lv/RMLLVTC0002a/README.md new file mode 100644 index 00000000..b3b38af6 --- /dev/null +++ b/src/test/resources/rml-lv/RMLLVTC0002a/README.md @@ -0,0 +1,94 @@ +## RMLLVTC0002a + +**Title**: Iterable Field + +**Description**: Test a nested field construction: iterable field with expression field as child + +**Error expected?** No + +**Input** +``` +{ + "people": [ + { + "name": "alice", + "items": [ + { + "type": "sword", + "weight": 1500 + }, + { + "type": "shield", + "weight": 2500 + } + ] + }, + { + "name": "bob", + "items": [ + { + "type": "flower", + "weight": 15 + } + ] + } + ] +} + +``` + +**Mapping** +``` +@prefix rml: . +@prefix xsd: . +@prefix : . + +:jsonSource a rml:LogicalSource ; + rml:source [ + a rml:RelativePathSource , rml:Source ; + rml:root rml:MappingDirectory ; + rml:path "people.json" ; + ] ; + rml:referenceFormulation rml:JSONPath ; + rml:iterator "$.people[*]" . + +:jsonView a rml:LogicalView ; + rml:viewOn :jsonSource ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "name" ; + rml:reference "$.name" ; + ] ; + rml:field [ + a rml:IterableField ; + rml:fieldName "item" ; + rml:iterator "$.items[*]" ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "type" ; + rml:reference "$.type" ; + ] ; + ] . + +:triplesMapPerson a rml:TriplesMap ; + rml:logicalSource :jsonView ; + rml:subjectMap [ + rml:template "http://example.org/person/{name}" ; + ] ; + rml:predicateObjectMap [ + rml:predicate :hasItem ; + rml:objectMap [ + rml:template "http://example.org/person/{name}/item/{item.type}" ; + ] ; + ] . + +``` + +**Output** +``` + . + . + . + +``` + diff --git a/src/test/resources/rml-lv/RMLLVTC0002a/mapping.ttl b/src/test/resources/rml-lv/RMLLVTC0002a/mapping.ttl new file mode 100644 index 00000000..34c964e3 --- /dev/null +++ b/src/test/resources/rml-lv/RMLLVTC0002a/mapping.ttl @@ -0,0 +1,42 @@ +@prefix rml: . +@prefix xsd: . +@prefix : . + +:jsonSource a rml:LogicalSource ; + rml:source [ + a rml:RelativePathSource , rml:Source ; + rml:root rml:MappingDirectory ; + rml:path "people.json" ; + ] ; + rml:referenceFormulation rml:JSONPath ; + rml:iterator "$.people[*]" . + +:jsonView a rml:LogicalView ; + rml:viewOn :jsonSource ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "name" ; + rml:reference "$.name" ; + ] ; + rml:field [ + a rml:IterableField ; + rml:fieldName "item" ; + rml:iterator "$.items[*]" ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "type" ; + rml:reference "$.type" ; + ] ; + ] . + +:triplesMapPerson a rml:TriplesMap ; + rml:logicalSource :jsonView ; + rml:subjectMap [ + rml:template "http://example.org/person/{name}" ; + ] ; + rml:predicateObjectMap [ + rml:predicate :hasItem ; + rml:objectMap [ + rml:template "http://example.org/person/{name}/item/{item.type}" ; + ] ; + ] . diff --git a/src/test/resources/rml-lv/RMLLVTC0002a/output.nq b/src/test/resources/rml-lv/RMLLVTC0002a/output.nq new file mode 100644 index 00000000..c4b95144 --- /dev/null +++ b/src/test/resources/rml-lv/RMLLVTC0002a/output.nq @@ -0,0 +1,3 @@ + . + . + . diff --git a/src/test/resources/rml-lv/RMLLVTC0002a/people.json b/src/test/resources/rml-lv/RMLLVTC0002a/people.json new file mode 100644 index 00000000..87d56294 --- /dev/null +++ b/src/test/resources/rml-lv/RMLLVTC0002a/people.json @@ -0,0 +1,26 @@ +{ + "people": [ + { + "name": "alice", + "items": [ + { + "type": "sword", + "weight": 1500 + }, + { + "type": "shield", + "weight": 2500 + } + ] + }, + { + "name": "bob", + "items": [ + { + "type": "flower", + "weight": 15 + } + ] + } + ] +} diff --git a/src/test/resources/rml-lv/RMLLVTC0002b/README.md b/src/test/resources/rml-lv/RMLLVTC0002b/README.md new file mode 100644 index 00000000..658f01ec --- /dev/null +++ b/src/test/resources/rml-lv/RMLLVTC0002b/README.md @@ -0,0 +1,109 @@ +## RMLLVTC0002b + +**Title**: Iterable Field with Multiple Children + +**Description**: Test a nested field construction: iterable field with mulitple expression fields as children + +**Error expected?** No + +**Input** +``` +{ + "people": [ + { + "name": "alice", + "items": [ + { + "type": "sword", + "weight": 1500 + }, + { + "type": "shield", + "weight": 2500 + } + ] + }, + { + "name": "bob", + "items": [ + { + "type": "flower", + "weight": 15 + } + ] + } + ] +} + +``` + +**Mapping** +``` +@prefix rml: . +@prefix xsd: . +@prefix : . + +:jsonSource a rml:LogicalSource ; + rml:source [ + a rml:RelativePathSource , rml:Source ; + rml:root rml:MappingDirectory ; + rml:path "people.json" ; + ] ; + rml:referenceFormulation rml:JSONPath ; + rml:iterator "$.people[*]" . + +:jsonView a rml:LogicalView ; + rml:viewOn :jsonSource ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "name" ; + rml:reference "$.name" ; + ] ; + rml:field [ + a rml:IterableField ; + rml:fieldName "item" ; + rml:iterator "$.items[*]" ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "type" ; + rml:reference "$.type" ; + ] ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "weight" ; + rml:reference "$.weight" ; + ] ; + ] . + +:triplesMapItem a rml:TriplesMap ; + rml:logicalSource :jsonView ; + rml:subjectMap [ + rml:template "http://example.org/person/{name}/item/{item.type}" ; + ] ; + rml:predicateObjectMap [ + rml:predicate :hasName ; + rml:objectMap [ + rml:reference "item.type" ; + ] ; + ] ; + rml:predicateObjectMap [ + rml:predicate :hasWeight ; + rml:objectMap [ + rml:reference "item.weight" ; + rml:datatype xsd:integer ; + ] ; + ] . + +``` + +**Output** +``` + "sword" . + "1500"^^ . + "shield" . + "2500"^^ . + "flower" . + "15"^^ . + +``` + diff --git a/src/test/resources/rml-lv/RMLLVTC0002b/mapping.ttl b/src/test/resources/rml-lv/RMLLVTC0002b/mapping.ttl new file mode 100644 index 00000000..d7ad0c71 --- /dev/null +++ b/src/test/resources/rml-lv/RMLLVTC0002b/mapping.ttl @@ -0,0 +1,54 @@ +@prefix rml: . +@prefix xsd: . +@prefix : . + +:jsonSource a rml:LogicalSource ; + rml:source [ + a rml:RelativePathSource , rml:Source ; + rml:root rml:MappingDirectory ; + rml:path "people.json" ; + ] ; + rml:referenceFormulation rml:JSONPath ; + rml:iterator "$.people[*]" . + +:jsonView a rml:LogicalView ; + rml:viewOn :jsonSource ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "name" ; + rml:reference "$.name" ; + ] ; + rml:field [ + a rml:IterableField ; + rml:fieldName "item" ; + rml:iterator "$.items[*]" ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "type" ; + rml:reference "$.type" ; + ] ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "weight" ; + rml:reference "$.weight" ; + ] ; + ] . + +:triplesMapItem a rml:TriplesMap ; + rml:logicalSource :jsonView ; + rml:subjectMap [ + rml:template "http://example.org/person/{name}/item/{item.type}" ; + ] ; + rml:predicateObjectMap [ + rml:predicate :hasName ; + rml:objectMap [ + rml:reference "item.type" ; + ] ; + ] ; + rml:predicateObjectMap [ + rml:predicate :hasWeight ; + rml:objectMap [ + rml:reference "item.weight" ; + rml:datatype xsd:integer ; + ] ; + ] . diff --git a/src/test/resources/rml-lv/RMLLVTC0002b/output.nq b/src/test/resources/rml-lv/RMLLVTC0002b/output.nq new file mode 100644 index 00000000..83d339e1 --- /dev/null +++ b/src/test/resources/rml-lv/RMLLVTC0002b/output.nq @@ -0,0 +1,6 @@ + "sword" . + "1500"^^ . + "shield" . + "2500"^^ . + "flower" . + "15"^^ . diff --git a/src/test/resources/rml-lv/RMLLVTC0002b/people.json b/src/test/resources/rml-lv/RMLLVTC0002b/people.json new file mode 100644 index 00000000..87d56294 --- /dev/null +++ b/src/test/resources/rml-lv/RMLLVTC0002b/people.json @@ -0,0 +1,26 @@ +{ + "people": [ + { + "name": "alice", + "items": [ + { + "type": "sword", + "weight": 1500 + }, + { + "type": "shield", + "weight": 2500 + } + ] + }, + { + "name": "bob", + "items": [ + { + "type": "flower", + "weight": 15 + } + ] + } + ] +} diff --git a/src/test/resources/rml-lv/RMLLVTC0002c/README.md b/src/test/resources/rml-lv/RMLLVTC0002c/README.md new file mode 100644 index 00000000..b81753d2 --- /dev/null +++ b/src/test/resources/rml-lv/RMLLVTC0002c/README.md @@ -0,0 +1,112 @@ +## RMLLVTC0002c + +**Title**: Nested Iterable Fields + +**Description**: Test a nested field construction: iterable field with an iterable field as child + +**Error expected?** No + +**Input** +``` +{ + "people": [ + { + "name": "alice", + "items": [ + { + "type": "sword", + "measures": { + "weight": 1500, + "length": 30 + } + }, + { + "type": "shield", + "measures": { + "weight": 2500 + } + } + ] + }, + { + "name": "bob", + "items": [ + { + "type": "flower", + "measures" : { + "weight": 15, + "length" : 15 + } + } + ] + } + ] +} + +``` + +**Mapping** +``` +@prefix rml: . +@prefix xsd: . +@prefix : . + +:jsonSource a rml:LogicalSource ; + rml:source [ + a rml:RelativePathSource , rml:Source ; + rml:root rml:MappingDirectory ; + rml:path "people.json" ; + ] ; + rml:referenceFormulation rml:JSONPath ; + rml:iterator "$.people[*]" . + +:jsonView a rml:LogicalView ; + rml:viewOn :jsonSource ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "name" ; + rml:reference "$.name" ; + ] ; + rml:field [ + a rml:IterableField ; + rml:fieldName "item" ; + rml:iterator "$.items[*]" ; + rml:field [ + rml:fieldName "type" ; + rml:reference "$.type" ; + ] ; + rml:field [ + a rml:IterableField ; + rml:fieldName "measures"; + rml:iterator "$.measures"; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "weight" ; + rml:reference "$.weight" ; + ]; + ] ; + ] . + +:triplesMapItem a rml:TriplesMap ; + rml:logicalSource :jsonView ; + rml:subjectMap [ + rml:template "http://example.org/person/{name}/item/{item.type}" ; + ] ; + rml:predicateObjectMap [ + rml:predicate :hasWeight ; + rml:objectMap [ + rml:reference "item.measures.weight" ; + rml:datatype xsd:integer ; + ] ; + ] . + +``` + +**Output** +``` + "1500"^^ . + "2500"^^ . + "15"^^ . + +``` + diff --git a/src/test/resources/rml-lv/RMLLVTC0002c/mapping.ttl b/src/test/resources/rml-lv/RMLLVTC0002c/mapping.ttl new file mode 100644 index 00000000..01a2ad1b --- /dev/null +++ b/src/test/resources/rml-lv/RMLLVTC0002c/mapping.ttl @@ -0,0 +1,52 @@ +@prefix rml: . +@prefix xsd: . +@prefix : . + +:jsonSource a rml:LogicalSource ; + rml:source [ + a rml:RelativePathSource , rml:Source ; + rml:root rml:MappingDirectory ; + rml:path "people.json" ; + ] ; + rml:referenceFormulation rml:JSONPath ; + rml:iterator "$.people[*]" . + +:jsonView a rml:LogicalView ; + rml:viewOn :jsonSource ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "name" ; + rml:reference "$.name" ; + ] ; + rml:field [ + a rml:IterableField ; + rml:fieldName "item" ; + rml:iterator "$.items[*]" ; + rml:field [ + rml:fieldName "type" ; + rml:reference "$.type" ; + ] ; + rml:field [ + a rml:IterableField ; + rml:fieldName "measures"; + rml:iterator "$.measures"; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "weight" ; + rml:reference "$.weight" ; + ]; + ] ; + ] . + +:triplesMapItem a rml:TriplesMap ; + rml:logicalSource :jsonView ; + rml:subjectMap [ + rml:template "http://example.org/person/{name}/item/{item.type}" ; + ] ; + rml:predicateObjectMap [ + rml:predicate :hasWeight ; + rml:objectMap [ + rml:reference "item.measures.weight" ; + rml:datatype xsd:integer ; + ] ; + ] . diff --git a/src/test/resources/rml-lv/RMLLVTC0002c/output.nq b/src/test/resources/rml-lv/RMLLVTC0002c/output.nq new file mode 100644 index 00000000..21ccc919 --- /dev/null +++ b/src/test/resources/rml-lv/RMLLVTC0002c/output.nq @@ -0,0 +1,3 @@ + "1500"^^ . + "2500"^^ . + "15"^^ . diff --git a/src/test/resources/rml-lv/RMLLVTC0002c/people.json b/src/test/resources/rml-lv/RMLLVTC0002c/people.json new file mode 100644 index 00000000..485614f6 --- /dev/null +++ b/src/test/resources/rml-lv/RMLLVTC0002c/people.json @@ -0,0 +1,34 @@ +{ + "people": [ + { + "name": "alice", + "items": [ + { + "type": "sword", + "measures": { + "weight": 1500, + "length": 30 + } + }, + { + "type": "shield", + "measures": { + "weight": 2500 + } + } + ] + }, + { + "name": "bob", + "items": [ + { + "type": "flower", + "measures" : { + "weight": 15, + "length" : 15 + } + } + ] + } + ] +} diff --git a/src/test/resources/rml-lv/RMLLVTC0003a/README.md b/src/test/resources/rml-lv/RMLLVTC0003a/README.md new file mode 100644 index 00000000..d91733b0 --- /dev/null +++ b/src/test/resources/rml-lv/RMLLVTC0003a/README.md @@ -0,0 +1,84 @@ +## RMLLVTC0003a + +**Title**: Index Key: # + +**Description**: Test a reference to the index key # + +**Error expected?** No + +**Input** +``` +{ + "people": [ + { + "name": "alice", + "items": [ + { + "type": "sword", + "weight": 1500 + }, + { + "type": "shield", + "weight": 2500 + } + ] + }, + { + "name": "bob", + "items": [ + { + "type": "flower", + "weight": 15 + } + ] + } + ] +} + +``` + +**Mapping** +``` +@prefix rml: . +@prefix xsd: . +@prefix : . + +:jsonSource a rml:LogicalSource ; + rml:source [ + a rml:RelativePathSource , rml:Source ; + rml:root rml:MappingDirectory ; + rml:path "people.json" ; + ] ; + rml:referenceFormulation rml:JSONPath ; + rml:iterator "$.people[*]" . + +:jsonView a rml:LogicalView ; + rml:viewOn :jsonSource ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "name" ; + rml:reference "$.name" ; + ] . + +:triplesMapPerson a rml:TriplesMap ; + rml:logicalSource :jsonView ; + rml:subjectMap [ + rml:template "http://example.org/person/{name}" ; + ] ; + rml:predicateObjectMap [ + rml:predicate :hasSequenceNumber ; + rml:objectMap [ + rml:reference "#" ; + rml:datatype xsd:integer ; + ] ; + ] . + +``` + +**Output** +``` + "0"^^ . + "1"^^ . + +``` + diff --git a/src/test/resources/rml-lv/RMLLVTC0003a/mapping.ttl b/src/test/resources/rml-lv/RMLLVTC0003a/mapping.ttl new file mode 100644 index 00000000..bd016a26 --- /dev/null +++ b/src/test/resources/rml-lv/RMLLVTC0003a/mapping.ttl @@ -0,0 +1,33 @@ +@prefix rml: . +@prefix xsd: . +@prefix : . + +:jsonSource a rml:LogicalSource ; + rml:source [ + a rml:RelativePathSource , rml:Source ; + rml:root rml:MappingDirectory ; + rml:path "people.json" ; + ] ; + rml:referenceFormulation rml:JSONPath ; + rml:iterator "$.people[*]" . + +:jsonView a rml:LogicalView ; + rml:viewOn :jsonSource ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "name" ; + rml:reference "$.name" ; + ] . + +:triplesMapPerson a rml:TriplesMap ; + rml:logicalSource :jsonView ; + rml:subjectMap [ + rml:template "http://example.org/person/{name}" ; + ] ; + rml:predicateObjectMap [ + rml:predicate :hasSequenceNumber ; + rml:objectMap [ + rml:reference "#" ; + rml:datatype xsd:integer ; + ] ; + ] . diff --git a/src/test/resources/rml-lv/RMLLVTC0003a/output.nq b/src/test/resources/rml-lv/RMLLVTC0003a/output.nq new file mode 100644 index 00000000..39629980 --- /dev/null +++ b/src/test/resources/rml-lv/RMLLVTC0003a/output.nq @@ -0,0 +1,2 @@ + "0"^^ . + "1"^^ . diff --git a/src/test/resources/rml-lv/RMLLVTC0003a/people.json b/src/test/resources/rml-lv/RMLLVTC0003a/people.json new file mode 100644 index 00000000..87d56294 --- /dev/null +++ b/src/test/resources/rml-lv/RMLLVTC0003a/people.json @@ -0,0 +1,26 @@ +{ + "people": [ + { + "name": "alice", + "items": [ + { + "type": "sword", + "weight": 1500 + }, + { + "type": "shield", + "weight": 2500 + } + ] + }, + { + "name": "bob", + "items": [ + { + "type": "flower", + "weight": 15 + } + ] + } + ] +} diff --git a/src/test/resources/rml-lv/RMLLVTC0003b/README.md b/src/test/resources/rml-lv/RMLLVTC0003b/README.md new file mode 100644 index 00000000..b968da6d --- /dev/null +++ b/src/test/resources/rml-lv/RMLLVTC0003b/README.md @@ -0,0 +1,94 @@ +## RMLLVTC0003b + +**Title**: Index Key: Iterable Field + +**Description**: Test a reference to the index key of an iterable field + +**Error expected?** No + +**Input** +``` +{ + "people": [ + { + "name": "alice", + "items": [ + { + "type": "sword", + "weight": 1500 + }, + { + "type": "shield", + "weight": 2500 + } + ] + }, + { + "name": "bob", + "items": [ + { + "type": "flower", + "weight": 15 + } + ] + } + ] +} + +``` + +**Mapping** +``` +@prefix rml: . +@prefix : . + +:jsonSource a rml:LogicalSource ; + rml:source [ + a rml:RelativePathSource , rml:Source ; + rml:root rml:MappingDirectory ; + rml:path "people.json" ; + ] ; + rml:referenceFormulation rml:JSONPath ; + rml:iterator "$.people[*]" . + +:jsonView a rml:LogicalView ; + rml:viewOn :jsonSource ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "name" ; + rml:reference "$.name" ; + ] ; + rml:field [ + a rml:IterableField ; + rml:fieldName "item" ; + rml:iterator "$.items[*]" ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "type" ; + rml:reference "$.type" ; + ] ; + ] . + +:triplesMapPerson a rml:TriplesMap ; + rml:logicalSource :jsonView ; + rml:subjectMap [ + rml:template "http://example.org/person/{name}/item/{item.#}" ; + ] ; + rml:predicateObjectMap [ + rml:predicate :hasType ; + rml:objectMap [ + rml:reference "item.type" ; + ] ; + ] . + +``` + +**Output** +``` + "sword" . + "shield" . + "flower" . + + +``` + diff --git a/src/test/resources/rml-lv/RMLLVTC0003b/mapping.ttl b/src/test/resources/rml-lv/RMLLVTC0003b/mapping.ttl new file mode 100644 index 00000000..a1f81288 --- /dev/null +++ b/src/test/resources/rml-lv/RMLLVTC0003b/mapping.ttl @@ -0,0 +1,41 @@ +@prefix rml: . +@prefix : . + +:jsonSource a rml:LogicalSource ; + rml:source [ + a rml:RelativePathSource , rml:Source ; + rml:root rml:MappingDirectory ; + rml:path "people.json" ; + ] ; + rml:referenceFormulation rml:JSONPath ; + rml:iterator "$.people[*]" . + +:jsonView a rml:LogicalView ; + rml:viewOn :jsonSource ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "name" ; + rml:reference "$.name" ; + ] ; + rml:field [ + a rml:IterableField ; + rml:fieldName "item" ; + rml:iterator "$.items[*]" ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "type" ; + rml:reference "$.type" ; + ] ; + ] . + +:triplesMapPerson a rml:TriplesMap ; + rml:logicalSource :jsonView ; + rml:subjectMap [ + rml:template "http://example.org/person/{name}/item/{item.#}" ; + ] ; + rml:predicateObjectMap [ + rml:predicate :hasType ; + rml:objectMap [ + rml:reference "item.type" ; + ] ; + ] . diff --git a/src/test/resources/rml-lv/RMLLVTC0003b/output.nq b/src/test/resources/rml-lv/RMLLVTC0003b/output.nq new file mode 100644 index 00000000..7a701645 --- /dev/null +++ b/src/test/resources/rml-lv/RMLLVTC0003b/output.nq @@ -0,0 +1,4 @@ + "sword" . + "shield" . + "flower" . + diff --git a/src/test/resources/rml-lv/RMLLVTC0003b/people.json b/src/test/resources/rml-lv/RMLLVTC0003b/people.json new file mode 100644 index 00000000..87d56294 --- /dev/null +++ b/src/test/resources/rml-lv/RMLLVTC0003b/people.json @@ -0,0 +1,26 @@ +{ + "people": [ + { + "name": "alice", + "items": [ + { + "type": "sword", + "weight": 1500 + }, + { + "type": "shield", + "weight": 2500 + } + ] + }, + { + "name": "bob", + "items": [ + { + "type": "flower", + "weight": 15 + } + ] + } + ] +} diff --git a/src/test/resources/rml-lv/RMLLVTC0003c/README.md b/src/test/resources/rml-lv/RMLLVTC0003c/README.md new file mode 100644 index 00000000..2db9a5fe --- /dev/null +++ b/src/test/resources/rml-lv/RMLLVTC0003c/README.md @@ -0,0 +1,80 @@ +## RMLLVTC0003c + +**Title**: Index Key: Expression field + +**Description**: Test a reference to the index key of an expression field + +**Error expected?** No + +**Input** +``` +{ + "people": [ + { + "name": "alice", + "items": [ + "sword", + "shield" + ] + }, + { + "name": "bob", + "items": [ + "flower" + ] + } + ] +} + +``` + +**Mapping** +``` +@prefix rml: . +@prefix xsd: . +@prefix : . + +:jsonSource a rml:LogicalSource ; + rml:source [ + a rml:RelativePathSource , rml:Source ; + rml:root rml:MappingDirectory ; + rml:path "people.json" ; + ] ; + rml:referenceFormulation rml:JSONPath ; + rml:iterator "$.people[*]" . + +:jsonView a rml:LogicalView ; + rml:viewOn :jsonSource ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "name" ; + rml:reference "$.name" ; + ] ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "item" ; + rml:reference "$.items[*]" ; + ] . + +:triplesMapItem a rml:TriplesMap ; + rml:logicalSource :jsonView ; + rml:subjectMap [ + rml:template "http://example.org/person/{name}/item/{item.#}" ; + ] ; + rml:predicateObjectMap [ + rml:predicate :hasType ; + rml:objectMap [ + rml:reference "item" ; + ] ; + ] . + +``` + +**Output** +``` + "sword" . + "shield" . + "flower" . + +``` + diff --git a/src/test/resources/rml-lv/RMLLVTC0003c/mapping.ttl b/src/test/resources/rml-lv/RMLLVTC0003c/mapping.ttl new file mode 100644 index 00000000..56ec415c --- /dev/null +++ b/src/test/resources/rml-lv/RMLLVTC0003c/mapping.ttl @@ -0,0 +1,37 @@ +@prefix rml: . +@prefix xsd: . +@prefix : . + +:jsonSource a rml:LogicalSource ; + rml:source [ + a rml:RelativePathSource , rml:Source ; + rml:root rml:MappingDirectory ; + rml:path "people.json" ; + ] ; + rml:referenceFormulation rml:JSONPath ; + rml:iterator "$.people[*]" . + +:jsonView a rml:LogicalView ; + rml:viewOn :jsonSource ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "name" ; + rml:reference "$.name" ; + ] ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "item" ; + rml:reference "$.items[*]" ; + ] . + +:triplesMapItem a rml:TriplesMap ; + rml:logicalSource :jsonView ; + rml:subjectMap [ + rml:template "http://example.org/person/{name}/item/{item.#}" ; + ] ; + rml:predicateObjectMap [ + rml:predicate :hasType ; + rml:objectMap [ + rml:reference "item" ; + ] ; + ] . diff --git a/src/test/resources/rml-lv/RMLLVTC0003c/output.nq b/src/test/resources/rml-lv/RMLLVTC0003c/output.nq new file mode 100644 index 00000000..55e161ec --- /dev/null +++ b/src/test/resources/rml-lv/RMLLVTC0003c/output.nq @@ -0,0 +1,3 @@ + "sword" . + "shield" . + "flower" . diff --git a/src/test/resources/rml-lv/RMLLVTC0003c/people.json b/src/test/resources/rml-lv/RMLLVTC0003c/people.json new file mode 100644 index 00000000..c2fd489f --- /dev/null +++ b/src/test/resources/rml-lv/RMLLVTC0003c/people.json @@ -0,0 +1,17 @@ +{ + "people": [ + { + "name": "alice", + "items": [ + "sword", + "shield" + ] + }, + { + "name": "bob", + "items": [ + "flower" + ] + } + ] +} diff --git a/src/test/resources/rml-lv/RMLLVTC0004a/README.md b/src/test/resources/rml-lv/RMLLVTC0004a/README.md new file mode 100644 index 00000000..63999a1a --- /dev/null +++ b/src/test/resources/rml-lv/RMLLVTC0004a/README.md @@ -0,0 +1,82 @@ +## RMLLVTC0004a + +**Title**: Natural Datatype: Index # + +**Description**: Test the natural datatype mapping for the index # + +**Error expected?** No + +**Input** +``` +{ + "people": [ + { + "name": "alice", + "items": [ + { + "type": "sword", + "weight": 1500 + }, + { + "type": "shield", + "weight": 2500 + } + ] + }, + { + "name": "bob", + "items": [ + { + "type": "flower", + "weight": 15 + } + ] + } + ] +} + +``` + +**Mapping** +``` +@prefix rml: . +@prefix : . + +:jsonSource a rml:LogicalSource ; + rml:source [ + a rml:RelativePathSource , rml:Source ; + rml:root rml:MappingDirectory ; + rml:path "people.json" ; + ] ; + rml:referenceFormulation rml:JSONPath ; + rml:iterator "$.people[*]" . + +:jsonView a rml:LogicalView ; + rml:viewOn :jsonSource ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "name" ; + rml:reference "$.name" ; + ] . + +:triplesMapPerson a rml:TriplesMap ; + rml:logicalSource :jsonView ; + rml:subjectMap [ + rml:template "http://example.org/person/{name}" ; + ] ; + rml:predicateObjectMap [ + rml:predicate :hasSequenceNumber ; + rml:objectMap [ + rml:reference "#" ; + ] ; + ] . + +``` + +**Output** +``` + "0"^^ . + "1"^^ . + +``` + diff --git a/src/test/resources/rml-lv/RMLLVTC0004a/mapping.ttl b/src/test/resources/rml-lv/RMLLVTC0004a/mapping.ttl new file mode 100644 index 00000000..12e315bd --- /dev/null +++ b/src/test/resources/rml-lv/RMLLVTC0004a/mapping.ttl @@ -0,0 +1,31 @@ +@prefix rml: . +@prefix : . + +:jsonSource a rml:LogicalSource ; + rml:source [ + a rml:RelativePathSource , rml:Source ; + rml:root rml:MappingDirectory ; + rml:path "people.json" ; + ] ; + rml:referenceFormulation rml:JSONPath ; + rml:iterator "$.people[*]" . + +:jsonView a rml:LogicalView ; + rml:viewOn :jsonSource ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "name" ; + rml:reference "$.name" ; + ] . + +:triplesMapPerson a rml:TriplesMap ; + rml:logicalSource :jsonView ; + rml:subjectMap [ + rml:template "http://example.org/person/{name}" ; + ] ; + rml:predicateObjectMap [ + rml:predicate :hasSequenceNumber ; + rml:objectMap [ + rml:reference "#" ; + ] ; + ] . diff --git a/src/test/resources/rml-lv/RMLLVTC0004a/output.nq b/src/test/resources/rml-lv/RMLLVTC0004a/output.nq new file mode 100644 index 00000000..39629980 --- /dev/null +++ b/src/test/resources/rml-lv/RMLLVTC0004a/output.nq @@ -0,0 +1,2 @@ + "0"^^ . + "1"^^ . diff --git a/src/test/resources/rml-lv/RMLLVTC0004a/people.json b/src/test/resources/rml-lv/RMLLVTC0004a/people.json new file mode 100644 index 00000000..87d56294 --- /dev/null +++ b/src/test/resources/rml-lv/RMLLVTC0004a/people.json @@ -0,0 +1,26 @@ +{ + "people": [ + { + "name": "alice", + "items": [ + { + "type": "sword", + "weight": 1500 + }, + { + "type": "shield", + "weight": 2500 + } + ] + }, + { + "name": "bob", + "items": [ + { + "type": "flower", + "weight": 15 + } + ] + } + ] +} diff --git a/src/test/resources/rml-lv/RMLLVTC0004b/README.md b/src/test/resources/rml-lv/RMLLVTC0004b/README.md new file mode 100644 index 00000000..d598e0ef --- /dev/null +++ b/src/test/resources/rml-lv/RMLLVTC0004b/README.md @@ -0,0 +1,93 @@ +## RMLLVTC0004b + +**Title**: Natural Datatype: Index Expression Field + +**Description**: Test the natural datatype mapping for the index of an expression field + +**Error expected?** No + +**Input** +``` +{ + "people": [ + { + "name": "alice", + "items": [ + { + "type": "sword", + "weight": 1500 + }, + { + "type": "shield", + "weight": 2500 + } + ] + }, + { + "name": "bob", + "items": [ + { + "type": "flower", + "weight": 15 + } + ] + } + ] +} + +``` + +**Mapping** +``` +@prefix rml: . +@prefix : . + +:jsonSource a rml:LogicalSource ; + rml:source [ + a rml:RelativePathSource , rml:Source ; + rml:root rml:MappingDirectory ; + rml:path "people.json" ; + ] ; + rml:referenceFormulation rml:JSONPath ; + rml:iterator "$.people[*]" . + +:jsonView a rml:LogicalView ; + rml:viewOn :jsonSource ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "name" ; + rml:reference "$.name" ; + ] ; + rml:field [ + a rml:IterableField ; + rml:fieldName "item" ; + rml:iterator "$.items[*]" ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "type" ; + rml:reference "$.type" ; + ] ; + ] . + +:triplesMapPerson a rml:TriplesMap ; + rml:logicalSource :jsonView ; + rml:subjectMap [ + rml:template "http://example.org/person/{name}/item/{item.type}" ; + ] ; + rml:predicateObjectMap [ + rml:predicate :hasSequenceNumber ; + rml:objectMap [ + rml:reference "item.#" ; + ] ; + ] . + +``` + +**Output** +``` + "0"^^ . + "1"^^ . + "0"^^ . + +``` + diff --git a/src/test/resources/rml-lv/RMLLVTC0004b/mapping.ttl b/src/test/resources/rml-lv/RMLLVTC0004b/mapping.ttl new file mode 100644 index 00000000..95dc2d43 --- /dev/null +++ b/src/test/resources/rml-lv/RMLLVTC0004b/mapping.ttl @@ -0,0 +1,41 @@ +@prefix rml: . +@prefix : . + +:jsonSource a rml:LogicalSource ; + rml:source [ + a rml:RelativePathSource , rml:Source ; + rml:root rml:MappingDirectory ; + rml:path "people.json" ; + ] ; + rml:referenceFormulation rml:JSONPath ; + rml:iterator "$.people[*]" . + +:jsonView a rml:LogicalView ; + rml:viewOn :jsonSource ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "name" ; + rml:reference "$.name" ; + ] ; + rml:field [ + a rml:IterableField ; + rml:fieldName "item" ; + rml:iterator "$.items[*]" ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "type" ; + rml:reference "$.type" ; + ] ; + ] . + +:triplesMapPerson a rml:TriplesMap ; + rml:logicalSource :jsonView ; + rml:subjectMap [ + rml:template "http://example.org/person/{name}/item/{item.type}" ; + ] ; + rml:predicateObjectMap [ + rml:predicate :hasSequenceNumber ; + rml:objectMap [ + rml:reference "item.#" ; + ] ; + ] . diff --git a/src/test/resources/rml-lv/RMLLVTC0004b/output.nq b/src/test/resources/rml-lv/RMLLVTC0004b/output.nq new file mode 100644 index 00000000..ad329751 --- /dev/null +++ b/src/test/resources/rml-lv/RMLLVTC0004b/output.nq @@ -0,0 +1,3 @@ + "0"^^ . + "1"^^ . + "0"^^ . diff --git a/src/test/resources/rml-lv/RMLLVTC0004b/people.json b/src/test/resources/rml-lv/RMLLVTC0004b/people.json new file mode 100644 index 00000000..87d56294 --- /dev/null +++ b/src/test/resources/rml-lv/RMLLVTC0004b/people.json @@ -0,0 +1,26 @@ +{ + "people": [ + { + "name": "alice", + "items": [ + { + "type": "sword", + "weight": 1500 + }, + { + "type": "shield", + "weight": 2500 + } + ] + }, + { + "name": "bob", + "items": [ + { + "type": "flower", + "weight": 15 + } + ] + } + ] +} diff --git a/src/test/resources/rml-lv/RMLLVTC0004c/README.md b/src/test/resources/rml-lv/RMLLVTC0004c/README.md new file mode 100644 index 00000000..8ab10b2d --- /dev/null +++ b/src/test/resources/rml-lv/RMLLVTC0004c/README.md @@ -0,0 +1,80 @@ +## RMLLVTC0004c + +**Title**: Natural Datatype: Index Iterable Field + +**Description**: Test the natural datatype mapping for the index of an iterable field + +**Error expected?** No + +**Input** +``` +{ + "people": [ + { + "name": "alice", + "items": [ + "sword", + "shield" + ] + }, + { + "name": "bob", + "items": [ + "flower" + ] + } + ] +} + +``` + +**Mapping** +``` +@prefix rml: . +@prefix xsd: . +@prefix : . + +:jsonSource a rml:LogicalSource ; + rml:source [ + a rml:RelativePathSource , rml:Source ; + rml:root rml:MappingDirectory ; + rml:path "people.json" ; + ] ; + rml:referenceFormulation rml:JSONPath ; + rml:iterator "$.people[*]" . + +:jsonView a rml:LogicalView ; + rml:viewOn :jsonSource ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "name" ; + rml:reference "$.name" ; + ] ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "item" ; + rml:reference "$.items[*]" ; + ] . + +:triplesMapItem a rml:TriplesMap ; + rml:logicalSource :jsonView ; + rml:subjectMap [ + rml:template "http://example.org/person/{name}/item/{item}" ; + ] ; + rml:predicateObjectMap [ + rml:predicate :hasSequenceNumber ; + rml:objectMap [ + rml:reference "item.#" ; + ] ; + ] . + +``` + +**Output** +``` + "0"^^ . + "1"^^ . + "0"^^ . + +``` + diff --git a/src/test/resources/rml-lv/RMLLVTC0004c/mapping.ttl b/src/test/resources/rml-lv/RMLLVTC0004c/mapping.ttl new file mode 100644 index 00000000..5d4e57d7 --- /dev/null +++ b/src/test/resources/rml-lv/RMLLVTC0004c/mapping.ttl @@ -0,0 +1,37 @@ +@prefix rml: . +@prefix xsd: . +@prefix : . + +:jsonSource a rml:LogicalSource ; + rml:source [ + a rml:RelativePathSource , rml:Source ; + rml:root rml:MappingDirectory ; + rml:path "people.json" ; + ] ; + rml:referenceFormulation rml:JSONPath ; + rml:iterator "$.people[*]" . + +:jsonView a rml:LogicalView ; + rml:viewOn :jsonSource ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "name" ; + rml:reference "$.name" ; + ] ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "item" ; + rml:reference "$.items[*]" ; + ] . + +:triplesMapItem a rml:TriplesMap ; + rml:logicalSource :jsonView ; + rml:subjectMap [ + rml:template "http://example.org/person/{name}/item/{item}" ; + ] ; + rml:predicateObjectMap [ + rml:predicate :hasSequenceNumber ; + rml:objectMap [ + rml:reference "item.#" ; + ] ; + ] . diff --git a/src/test/resources/rml-lv/RMLLVTC0004c/output.nq b/src/test/resources/rml-lv/RMLLVTC0004c/output.nq new file mode 100644 index 00000000..ad329751 --- /dev/null +++ b/src/test/resources/rml-lv/RMLLVTC0004c/output.nq @@ -0,0 +1,3 @@ + "0"^^ . + "1"^^ . + "0"^^ . diff --git a/src/test/resources/rml-lv/RMLLVTC0004c/people.json b/src/test/resources/rml-lv/RMLLVTC0004c/people.json new file mode 100644 index 00000000..c2fd489f --- /dev/null +++ b/src/test/resources/rml-lv/RMLLVTC0004c/people.json @@ -0,0 +1,17 @@ +{ + "people": [ + { + "name": "alice", + "items": [ + "sword", + "shield" + ] + }, + { + "name": "bob", + "items": [ + "flower" + ] + } + ] +} diff --git a/src/test/resources/rml-lv/RMLLVTC0004d/README.md b/src/test/resources/rml-lv/RMLLVTC0004d/README.md new file mode 100644 index 00000000..66c92b6c --- /dev/null +++ b/src/test/resources/rml-lv/RMLLVTC0004d/README.md @@ -0,0 +1,74 @@ +## RMLLVTC0004d + +**Title**: Natural Datatype: Record Expression Field + +**Description**: Test the natural datatype mapping for a record of an expression field + +**Error expected?** No + +**Input** +``` +{ + "people": [ + { + "name": "alice", + "birth_year": 1995 + }, + { + "name": "bob", + "birth_year": 1999 + } + ] +} + +``` + +**Mapping** +``` +@prefix rml: . +@prefix xsd: . +@prefix : . + +:jsonSource a rml:LogicalSource ; + rml:source [ + a rml:RelativePathSource , rml:Source ; + rml:root rml:MappingDirectory ; + rml:path "people.json" ; + ] ; + rml:referenceFormulation rml:JSONPath ; + rml:iterator "$.people[*]" . + +:jsonView a rml:LogicalView ; + rml:viewOn :jsonSource ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "name" ; + rml:reference "$.name" ; + ] ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "birthyear" ; + rml:reference "$.birth_year" ; + ] . + +:triplesMapItem a rml:TriplesMap ; + rml:logicalSource :jsonView ; + rml:subjectMap [ + rml:template "http://example.org/person/{name}" ; + ] ; + rml:predicateObjectMap [ + rml:predicate :hasBirthYear ; + rml:objectMap [ + rml:reference "birthyear" ; + ] ; + ] . + +``` + +**Output** +``` + "1995"^^ . + "1999"^^ . + +``` + diff --git a/src/test/resources/rml-lv/RMLLVTC0004d/mapping.ttl b/src/test/resources/rml-lv/RMLLVTC0004d/mapping.ttl new file mode 100644 index 00000000..f7a7b45d --- /dev/null +++ b/src/test/resources/rml-lv/RMLLVTC0004d/mapping.ttl @@ -0,0 +1,37 @@ +@prefix rml: . +@prefix xsd: . +@prefix : . + +:jsonSource a rml:LogicalSource ; + rml:source [ + a rml:RelativePathSource , rml:Source ; + rml:root rml:MappingDirectory ; + rml:path "people.json" ; + ] ; + rml:referenceFormulation rml:JSONPath ; + rml:iterator "$.people[*]" . + +:jsonView a rml:LogicalView ; + rml:viewOn :jsonSource ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "name" ; + rml:reference "$.name" ; + ] ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "birthyear" ; + rml:reference "$.birth_year" ; + ] . + +:triplesMapItem a rml:TriplesMap ; + rml:logicalSource :jsonView ; + rml:subjectMap [ + rml:template "http://example.org/person/{name}" ; + ] ; + rml:predicateObjectMap [ + rml:predicate :hasBirthYear ; + rml:objectMap [ + rml:reference "birthyear" ; + ] ; + ] . diff --git a/src/test/resources/rml-lv/RMLLVTC0004d/output.nq b/src/test/resources/rml-lv/RMLLVTC0004d/output.nq new file mode 100644 index 00000000..3eda03ce --- /dev/null +++ b/src/test/resources/rml-lv/RMLLVTC0004d/output.nq @@ -0,0 +1,2 @@ + "1995"^^ . + "1999"^^ . diff --git a/src/test/resources/rml-lv/RMLLVTC0004d/people.json b/src/test/resources/rml-lv/RMLLVTC0004d/people.json new file mode 100644 index 00000000..8ed0174c --- /dev/null +++ b/src/test/resources/rml-lv/RMLLVTC0004d/people.json @@ -0,0 +1,12 @@ +{ + "people": [ + { + "name": "alice", + "birth_year": 1995 + }, + { + "name": "bob", + "birth_year": 1999 + } + ] +} diff --git a/src/test/resources/rml-lv/RMLLVTC0005a/README.md b/src/test/resources/rml-lv/RMLLVTC0005a/README.md new file mode 100644 index 00000000..915c20b9 --- /dev/null +++ b/src/test/resources/rml-lv/RMLLVTC0005a/README.md @@ -0,0 +1,75 @@ +## RMLLVTC0005a + +**Title**: Referencing a Non-Existing Key + +**Description**: Test a reference to a non-existing key + +**Error expected?** Yes + +**Input** +``` +{ + "people": [ + { + "name": "alice", + "items": [ + { + "type": "sword", + "weight": 1500 + }, + { + "type": "shield", + "weight": 2500 + } + ] + }, + { + "name": "bob", + "items": [ + { + "type": "flower", + "weight": 15 + } + ] + } + ] +} + +``` + +**Mapping** +``` +@prefix rml: . +@prefix : . + +:jsonSource a rml:LogicalSource ; + rml:source [ + a rml:RelativePathSource , rml:Source ; + rml:root rml:MappingDirectory ; + rml:path "people.json" ; + ] ; + rml:referenceFormulation rml:JSONPath ; + rml:iterator "$.people[*]" . + +:jsonView a rml:LogicalView ; + rml:viewOn :jsonSource ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "name" ; + rml:reference "$.name" ; + ] . + +:triplesMapPerson a rml:TriplesMap ; + rml:logicalSource :jsonView ; + rml:subjectMap [ + rml:template "http://example.org/person/{Name}" ; + ] ; + rml:predicateObjectMap [ + rml:predicate :hasName ; + rml:objectMap [ + rml:reference "Name" ; + ] ; + ] . + +``` + diff --git a/src/test/resources/rml-lv/RMLLVTC0005a/mapping.ttl b/src/test/resources/rml-lv/RMLLVTC0005a/mapping.ttl new file mode 100644 index 00000000..c5ff6f41 --- /dev/null +++ b/src/test/resources/rml-lv/RMLLVTC0005a/mapping.ttl @@ -0,0 +1,31 @@ +@prefix rml: . +@prefix : . + +:jsonSource a rml:LogicalSource ; + rml:source [ + a rml:RelativePathSource , rml:Source ; + rml:root rml:MappingDirectory ; + rml:path "people.json" ; + ] ; + rml:referenceFormulation rml:JSONPath ; + rml:iterator "$.people[*]" . + +:jsonView a rml:LogicalView ; + rml:viewOn :jsonSource ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "name" ; + rml:reference "$.name" ; + ] . + +:triplesMapPerson a rml:TriplesMap ; + rml:logicalSource :jsonView ; + rml:subjectMap [ + rml:template "http://example.org/person/{Name}" ; + ] ; + rml:predicateObjectMap [ + rml:predicate :hasName ; + rml:objectMap [ + rml:reference "Name" ; + ] ; + ] . diff --git a/src/test/resources/rml-lv/RMLLVTC0005a/people.json b/src/test/resources/rml-lv/RMLLVTC0005a/people.json new file mode 100644 index 00000000..87d56294 --- /dev/null +++ b/src/test/resources/rml-lv/RMLLVTC0005a/people.json @@ -0,0 +1,26 @@ +{ + "people": [ + { + "name": "alice", + "items": [ + { + "type": "sword", + "weight": 1500 + }, + { + "type": "shield", + "weight": 2500 + } + ] + }, + { + "name": "bob", + "items": [ + { + "type": "flower", + "weight": 15 + } + ] + } + ] +} diff --git a/src/test/resources/rml-lv/RMLLVTC0005b/README.md b/src/test/resources/rml-lv/RMLLVTC0005b/README.md new file mode 100644 index 00000000..d56b87eb --- /dev/null +++ b/src/test/resources/rml-lv/RMLLVTC0005b/README.md @@ -0,0 +1,75 @@ +## RMLLVTC0005b + +**Title**: Referencing the Record Key + +**Description**: Test a reference to the record key + +**Error expected?** Yes + +**Input** +``` +{ + "people": [ + { + "name": "alice", + "items": [ + { + "type": "sword", + "weight": 1500 + }, + { + "type": "shield", + "weight": 2500 + } + ] + }, + { + "name": "bob", + "items": [ + { + "type": "flower", + "weight": 15 + } + ] + } + ] +} + +``` + +**Mapping** +``` +@prefix rml: . +@prefix : . + +:jsonSource a rml:LogicalSource ; + rml:source [ + a rml:RelativePathSource , rml:Source ; + rml:root rml:MappingDirectory ; + rml:path "people.json" ; + ] ; + rml:referenceFormulation rml:JSONPath ; + rml:iterator "$.people[*]" . + +:jsonView a rml:LogicalView ; + rml:viewOn :jsonSource ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "name" ; + rml:reference "$.name" ; + ] . + +:triplesMapPerson a rml:TriplesMap ; + rml:logicalSource :jsonView ; + rml:subjectMap [ + rml:template "http://example.org/person/{name}" ; + ] ; + rml:predicateObjectMap [ + rml:predicate :isDerivedFrom ; + rml:objectMap [ + rml:reference "" ; + ] ; + ] . + +``` + diff --git a/src/test/resources/rml-lv/RMLLVTC0005b/mapping.ttl b/src/test/resources/rml-lv/RMLLVTC0005b/mapping.ttl new file mode 100644 index 00000000..3e9544bd --- /dev/null +++ b/src/test/resources/rml-lv/RMLLVTC0005b/mapping.ttl @@ -0,0 +1,31 @@ +@prefix rml: . +@prefix : . + +:jsonSource a rml:LogicalSource ; + rml:source [ + a rml:RelativePathSource , rml:Source ; + rml:root rml:MappingDirectory ; + rml:path "people.json" ; + ] ; + rml:referenceFormulation rml:JSONPath ; + rml:iterator "$.people[*]" . + +:jsonView a rml:LogicalView ; + rml:viewOn :jsonSource ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "name" ; + rml:reference "$.name" ; + ] . + +:triplesMapPerson a rml:TriplesMap ; + rml:logicalSource :jsonView ; + rml:subjectMap [ + rml:template "http://example.org/person/{name}" ; + ] ; + rml:predicateObjectMap [ + rml:predicate :isDerivedFrom ; + rml:objectMap [ + rml:reference "" ; + ] ; + ] . diff --git a/src/test/resources/rml-lv/RMLLVTC0005b/people.json b/src/test/resources/rml-lv/RMLLVTC0005b/people.json new file mode 100644 index 00000000..87d56294 --- /dev/null +++ b/src/test/resources/rml-lv/RMLLVTC0005b/people.json @@ -0,0 +1,26 @@ +{ + "people": [ + { + "name": "alice", + "items": [ + { + "type": "sword", + "weight": 1500 + }, + { + "type": "shield", + "weight": 2500 + } + ] + }, + { + "name": "bob", + "items": [ + { + "type": "flower", + "weight": 15 + } + ] + } + ] +} diff --git a/src/test/resources/rml-lv/RMLLVTC0005c/README.md b/src/test/resources/rml-lv/RMLLVTC0005c/README.md new file mode 100644 index 00000000..5881d48f --- /dev/null +++ b/src/test/resources/rml-lv/RMLLVTC0005c/README.md @@ -0,0 +1,86 @@ +## RMLLVTC0005c + +**Title**: Referencing the Record Key of an Iterable Field + +**Description**: Test a reference to the record key of an iterable field + +**Error expected?** Yes + +**Input** +``` +{ + "people": [ + { + "name": "alice", + "items": [ + { + "type": "sword", + "weight": 1500 + }, + { + "type": "shield", + "weight": 2500 + } + ] + }, + { + "name": "bob", + "items": [ + { + "type": "flower", + "weight": 15 + } + ] + } + ] +} + +``` + +**Mapping** +``` +@prefix rml: . +@prefix xsd: . +@prefix : . + +:jsonSource a rml:LogicalSource ; + rml:source [ + a rml:RelativePathSource , rml:Source ; + rml:root rml:MappingDirectory ; + rml:path "people.json" ; + ] ; + rml:referenceFormulation rml:JSONPath ; + rml:iterator "$.people[*]" . + +:jsonView a rml:LogicalView ; + rml:viewOn :jsonSource ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "name" ; + rml:reference "$.name" ; + ] ; + rml:field [ + a rml:IterableField ; + rml:fieldName "item" ; + rml:iterator "$.items[*]" ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "type" ; + rml:reference "$.type" ; + ] ; + ] . + +:triplesMapPerson a rml:TriplesMap ; + rml:logicalSource :jsonView ; + rml:subjectMap [ + rml:template "http://example.org/person/{name}" ; + ] ; + rml:predicateObjectMap [ + rml:predicate :hasItem ; + rml:objectMap [ + rml:template "http://example.org/person/{name}/{item}" ; + ] ; + ] . + +``` + diff --git a/src/test/resources/rml-lv/RMLLVTC0005c/mapping.ttl b/src/test/resources/rml-lv/RMLLVTC0005c/mapping.ttl new file mode 100644 index 00000000..52490995 --- /dev/null +++ b/src/test/resources/rml-lv/RMLLVTC0005c/mapping.ttl @@ -0,0 +1,42 @@ +@prefix rml: . +@prefix xsd: . +@prefix : . + +:jsonSource a rml:LogicalSource ; + rml:source [ + a rml:RelativePathSource , rml:Source ; + rml:root rml:MappingDirectory ; + rml:path "people.json" ; + ] ; + rml:referenceFormulation rml:JSONPath ; + rml:iterator "$.people[*]" . + +:jsonView a rml:LogicalView ; + rml:viewOn :jsonSource ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "name" ; + rml:reference "$.name" ; + ] ; + rml:field [ + a rml:IterableField ; + rml:fieldName "item" ; + rml:iterator "$.items[*]" ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "type" ; + rml:reference "$.type" ; + ] ; + ] . + +:triplesMapPerson a rml:TriplesMap ; + rml:logicalSource :jsonView ; + rml:subjectMap [ + rml:template "http://example.org/person/{name}" ; + ] ; + rml:predicateObjectMap [ + rml:predicate :hasItem ; + rml:objectMap [ + rml:template "http://example.org/person/{name}/{item}" ; + ] ; + ] . diff --git a/src/test/resources/rml-lv/RMLLVTC0005c/people.json b/src/test/resources/rml-lv/RMLLVTC0005c/people.json new file mode 100644 index 00000000..87d56294 --- /dev/null +++ b/src/test/resources/rml-lv/RMLLVTC0005c/people.json @@ -0,0 +1,26 @@ +{ + "people": [ + { + "name": "alice", + "items": [ + { + "type": "sword", + "weight": 1500 + }, + { + "type": "shield", + "weight": 2500 + } + ] + }, + { + "name": "bob", + "items": [ + { + "type": "flower", + "weight": 15 + } + ] + } + ] +} diff --git a/src/test/resources/rml-lv/RMLLVTC0006a/README.md b/src/test/resources/rml-lv/RMLLVTC0006a/README.md new file mode 100644 index 00000000..6b61668e --- /dev/null +++ b/src/test/resources/rml-lv/RMLLVTC0006a/README.md @@ -0,0 +1,133 @@ +## RMLLVTC0006a + +**Title**: Left Join + +**Description**: Test a left join + +**Error expected?** No + +**Input** +``` +{ + "people": [ + { + "name": "alice", + "items": [ + "sword", + "shield" + ] + }, + { + "name": "bob", + "items": [ + "flower" + ] + } + ] +} + +``` + +**Input 1** +``` +name,birthyear +alice,1995 +bob,1999 +tobias,2005 + +``` + +**Mapping** +``` +@prefix rml: . +@prefix xsd: . +@prefix : . + +:jsonSource a rml:LogicalSource ; + rml:source [ + a rml:RelativePathSource , rml:Source ; + rml:root rml:MappingDirectory ; + rml:path "people.json" ; + ] ; + rml:referenceFormulation rml:JSONPath ; + rml:iterator "$.people[*]" . + +:jsonView a rml:LogicalView ; + rml:viewOn :jsonSource ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "name" ; + rml:reference "$.name" ; + ] ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "item" ; + rml:reference "$.items[*]" ; + ] . + +:csvSource a rml:LogicalSource ; + rml:source [ + a rml:RelativePathSource , rml:Source ; + rml:root rml:MappingDirectory ; + rml:path "people.csv" ; + ] ; + rml:referenceFormulation rml:CSV . + +:csvView a rml:LogicalView ; + rml:viewOn :csvSource ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "name" ; + rml:reference "name" ; + ] ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "birthyear" ; + rml:reference "birthyear" ; + ] ; + rml:leftJoin [ + rml:parentLogicalView :jsonView ; + rml:joinCondition [ + rml:parent "name" ; + rml:child "name" ; + ] ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "json_item" ; + rml:reference "item" ; + ] ; + ] . + + +:triplesMapPerson a rml:TriplesMap ; + rml:logicalSource :csvView ; + rml:subjectMap [ + rml:template "http://example.org/person/{name}" ; + ] ; + rml:predicateObjectMap [ + rml:predicate :hasBirthYear ; + rml:objectMap [ + rml:reference "birthyear" ; + rml:datatype xsd:gYear ; + ] ; + ] ; + rml:predicateObjectMap [ + rml:predicate :hasItem ; + rml:objectMap [ + rml:template "http://example.org/person/{name}/item/{json_item}" ; + ] ; + ] . + +``` + +**Output** +``` + "1995"^^ . + . + . + "1999"^^ . + . + "2005"^^ . + +``` + diff --git a/src/test/resources/rml-lv/RMLLVTC0006a/mapping.ttl b/src/test/resources/rml-lv/RMLLVTC0006a/mapping.ttl new file mode 100644 index 00000000..57e71072 --- /dev/null +++ b/src/test/resources/rml-lv/RMLLVTC0006a/mapping.ttl @@ -0,0 +1,78 @@ +@prefix rml: . +@prefix xsd: . +@prefix : . + +:jsonSource a rml:LogicalSource ; + rml:source [ + a rml:RelativePathSource , rml:Source ; + rml:root rml:MappingDirectory ; + rml:path "people.json" ; + ] ; + rml:referenceFormulation rml:JSONPath ; + rml:iterator "$.people[*]" . + +:jsonView a rml:LogicalView ; + rml:viewOn :jsonSource ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "name" ; + rml:reference "$.name" ; + ] ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "item" ; + rml:reference "$.items[*]" ; + ] . + +:csvSource a rml:LogicalSource ; + rml:source [ + a rml:RelativePathSource , rml:Source ; + rml:root rml:MappingDirectory ; + rml:path "people.csv" ; + ] ; + rml:referenceFormulation rml:CSV . + +:csvView a rml:LogicalView ; + rml:viewOn :csvSource ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "name" ; + rml:reference "name" ; + ] ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "birthyear" ; + rml:reference "birthyear" ; + ] ; + rml:leftJoin [ + rml:parentLogicalView :jsonView ; + rml:joinCondition [ + rml:parent "name" ; + rml:child "name" ; + ] ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "json_item" ; + rml:reference "item" ; + ] ; + ] . + + +:triplesMapPerson a rml:TriplesMap ; + rml:logicalSource :csvView ; + rml:subjectMap [ + rml:template "http://example.org/person/{name}" ; + ] ; + rml:predicateObjectMap [ + rml:predicate :hasBirthYear ; + rml:objectMap [ + rml:reference "birthyear" ; + rml:datatype xsd:gYear ; + ] ; + ] ; + rml:predicateObjectMap [ + rml:predicate :hasItem ; + rml:objectMap [ + rml:template "http://example.org/person/{name}/item/{json_item}" ; + ] ; + ] . diff --git a/src/test/resources/rml-lv/RMLLVTC0006a/output.nq b/src/test/resources/rml-lv/RMLLVTC0006a/output.nq new file mode 100644 index 00000000..f9fd2a83 --- /dev/null +++ b/src/test/resources/rml-lv/RMLLVTC0006a/output.nq @@ -0,0 +1,6 @@ + "1995"^^ . + . + . + "1999"^^ . + . + "2005"^^ . diff --git a/src/test/resources/rml-lv/RMLLVTC0006a/people.csv b/src/test/resources/rml-lv/RMLLVTC0006a/people.csv new file mode 100644 index 00000000..edc942d0 --- /dev/null +++ b/src/test/resources/rml-lv/RMLLVTC0006a/people.csv @@ -0,0 +1,4 @@ +name,birthyear +alice,1995 +bob,1999 +tobias,2005 diff --git a/src/test/resources/rml-lv/RMLLVTC0006a/people.json b/src/test/resources/rml-lv/RMLLVTC0006a/people.json new file mode 100644 index 00000000..c2fd489f --- /dev/null +++ b/src/test/resources/rml-lv/RMLLVTC0006a/people.json @@ -0,0 +1,17 @@ +{ + "people": [ + { + "name": "alice", + "items": [ + "sword", + "shield" + ] + }, + { + "name": "bob", + "items": [ + "flower" + ] + } + ] +} diff --git a/src/test/resources/rml-lv/RMLLVTC0006b/README.md b/src/test/resources/rml-lv/RMLLVTC0006b/README.md new file mode 100644 index 00000000..b4704924 --- /dev/null +++ b/src/test/resources/rml-lv/RMLLVTC0006b/README.md @@ -0,0 +1,132 @@ +## RMLLVTC0006b + +**Title**: Inner Join + +**Description**: Test an inner join + +**Error expected?** No + +**Input** +``` +{ + "people": [ + { + "name": "alice", + "items": [ + "sword", + "shield" + ] + }, + { + "name": "bob", + "items": [ + "flower" + ] + } + ] +} + +``` + +**Input 1** +``` +name,birthyear +alice,1995 +bob,1999 +tobias,2005 + +``` + +**Mapping** +``` +@prefix rml: . +@prefix xsd: . +@prefix : . + +:jsonSource a rml:LogicalSource ; + rml:source [ + a rml:RelativePathSource , rml:Source ; + rml:root rml:MappingDirectory ; + rml:path "people.json" ; + ] ; + rml:referenceFormulation rml:JSONPath ; + rml:iterator "$.people[*]" . + +:jsonView a rml:LogicalView ; + rml:viewOn :jsonSource ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "name" ; + rml:reference "$.name" ; + ] ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "item" ; + rml:reference "$.items[*]" ; + ] . + +:csvSource a rml:LogicalSource ; + rml:source [ + a rml:RelativePathSource , rml:Source ; + rml:root rml:MappingDirectory ; + rml:path "people.csv" ; + ] ; + rml:referenceFormulation rml:CSV . + +:csvView a rml:LogicalView ; + rml:viewOn :csvSource ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "name" ; + rml:reference "name" ; + ] ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "birthyear" ; + rml:reference "birthyear" ; + ] ; + rml:innerJoin [ + rml:parentLogicalView :jsonView ; + rml:joinCondition [ + rml:parent "name" ; + rml:child "name" ; + ] ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "json_item" ; + rml:reference "item" ; + ] ; + ] . + + +:triplesMapPerson a rml:TriplesMap ; + rml:logicalSource :csvView ; + rml:subjectMap [ + rml:template "http://example.org/person/{name}" ; + ] ; + rml:predicateObjectMap [ + rml:predicate :hasBirthYear ; + rml:objectMap [ + rml:reference "birthyear" ; + rml:datatype xsd:gYear ; + ] ; + ] ; + rml:predicateObjectMap [ + rml:predicate :hasItem ; + rml:objectMap [ + rml:template "http://example.org/person/{name}/item/{json_item}" ; + ] ; + ] . + +``` + +**Output** +``` + "1995"^^ . + . + . + "1999"^^ . + . + +``` + diff --git a/src/test/resources/rml-lv/RMLLVTC0006b/mapping.ttl b/src/test/resources/rml-lv/RMLLVTC0006b/mapping.ttl new file mode 100644 index 00000000..ee5f0a23 --- /dev/null +++ b/src/test/resources/rml-lv/RMLLVTC0006b/mapping.ttl @@ -0,0 +1,78 @@ +@prefix rml: . +@prefix xsd: . +@prefix : . + +:jsonSource a rml:LogicalSource ; + rml:source [ + a rml:RelativePathSource , rml:Source ; + rml:root rml:MappingDirectory ; + rml:path "people.json" ; + ] ; + rml:referenceFormulation rml:JSONPath ; + rml:iterator "$.people[*]" . + +:jsonView a rml:LogicalView ; + rml:viewOn :jsonSource ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "name" ; + rml:reference "$.name" ; + ] ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "item" ; + rml:reference "$.items[*]" ; + ] . + +:csvSource a rml:LogicalSource ; + rml:source [ + a rml:RelativePathSource , rml:Source ; + rml:root rml:MappingDirectory ; + rml:path "people.csv" ; + ] ; + rml:referenceFormulation rml:CSV . + +:csvView a rml:LogicalView ; + rml:viewOn :csvSource ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "name" ; + rml:reference "name" ; + ] ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "birthyear" ; + rml:reference "birthyear" ; + ] ; + rml:innerJoin [ + rml:parentLogicalView :jsonView ; + rml:joinCondition [ + rml:parent "name" ; + rml:child "name" ; + ] ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "json_item" ; + rml:reference "item" ; + ] ; + ] . + + +:triplesMapPerson a rml:TriplesMap ; + rml:logicalSource :csvView ; + rml:subjectMap [ + rml:template "http://example.org/person/{name}" ; + ] ; + rml:predicateObjectMap [ + rml:predicate :hasBirthYear ; + rml:objectMap [ + rml:reference "birthyear" ; + rml:datatype xsd:gYear ; + ] ; + ] ; + rml:predicateObjectMap [ + rml:predicate :hasItem ; + rml:objectMap [ + rml:template "http://example.org/person/{name}/item/{json_item}" ; + ] ; + ] . diff --git a/src/test/resources/rml-lv/RMLLVTC0006b/output.nq b/src/test/resources/rml-lv/RMLLVTC0006b/output.nq new file mode 100644 index 00000000..24fec8f3 --- /dev/null +++ b/src/test/resources/rml-lv/RMLLVTC0006b/output.nq @@ -0,0 +1,5 @@ + "1995"^^ . + . + . + "1999"^^ . + . diff --git a/src/test/resources/rml-lv/RMLLVTC0006b/people.csv b/src/test/resources/rml-lv/RMLLVTC0006b/people.csv new file mode 100644 index 00000000..edc942d0 --- /dev/null +++ b/src/test/resources/rml-lv/RMLLVTC0006b/people.csv @@ -0,0 +1,4 @@ +name,birthyear +alice,1995 +bob,1999 +tobias,2005 diff --git a/src/test/resources/rml-lv/RMLLVTC0006b/people.json b/src/test/resources/rml-lv/RMLLVTC0006b/people.json new file mode 100644 index 00000000..c2fd489f --- /dev/null +++ b/src/test/resources/rml-lv/RMLLVTC0006b/people.json @@ -0,0 +1,17 @@ +{ + "people": [ + { + "name": "alice", + "items": [ + "sword", + "shield" + ] + }, + { + "name": "bob", + "items": [ + "flower" + ] + } + ] +} diff --git a/src/test/resources/rml-lv/RMLLVTC0006c/README.md b/src/test/resources/rml-lv/RMLLVTC0006c/README.md new file mode 100644 index 00000000..34ac3709 --- /dev/null +++ b/src/test/resources/rml-lv/RMLLVTC0006c/README.md @@ -0,0 +1,176 @@ +## RMLLVTC0006c + +**Title**: Two Left Joins + +**Description**: Test two left joins in one logical view + +**Error expected?** No + +**Input** +``` +{ + "people": [ + { + "name": "alice", + "items": [ + "sword", + "shield" + ] + }, + { + "name": "bob", + "items": [ + "flower" + ] + } + ] +} + +``` + +**Input 1** +``` +name,birthyear +alice,1995 +bob,1999 +tobias,2005 + +``` + +**Input 2** +``` +name,id +alice,123 +bob,456 +tobias,789 + +``` + +**Mapping** +``` +@prefix rml: . +@prefix xsd: . +@prefix : . + +:jsonSource a rml:LogicalSource ; + rml:source [ + a rml:RelativePathSource , rml:Source ; + rml:root rml:MappingDirectory ; + rml:path "people.json" ; + ] ; + rml:referenceFormulation rml:JSONPath ; + rml:iterator "$.people[*]" . + +:jsonView a rml:LogicalView ; + rml:viewOn :jsonSource ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "name" ; + rml:reference "$.name" ; + ] ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "item" ; + rml:reference "$.items[*]" ; + ] . + +:additionalCsvSource a rml:LogicalSource ; + rml:source [ + a rml:RelativePathSource , rml:Source ; + rml:root rml:MappingDirectory ; + rml:path "people2.csv" ; + ] ; + rml:referenceFormulation rml:CSV . + +:additionalCsvView a rml:LogicalView ; + rml:viewOn :additionalCsvSource ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "name" ; + rml:reference "name" ; + ] ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "id" ; + rml:reference "id" ; + ] ; +. + +:csvSource a rml:LogicalSource ; + rml:source [ + a rml:RelativePathSource , rml:Source ; + rml:root rml:MappingDirectory ; + rml:path "people.csv" ; + ] ; + rml:referenceFormulation rml:CSV . + +:csvView a rml:LogicalView ; + rml:viewOn :csvSource ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "name" ; + rml:reference "name" ; + ] ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "birthyear" ; + rml:reference "birthyear" ; + ] ; + rml:leftJoin [ + rml:parentLogicalView :jsonView ; + rml:joinCondition [ + rml:parent "name" ; + rml:child "name" ; + ] ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "json_item" ; + rml:reference "item" ; + ] ; + ] ; + rml:leftJoin [ + rml:parentLogicalView :additionalCsvView ; + rml:joinCondition [ + rml:parent "name" ; + rml:child "name" ; + ] ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "csv2_id" ; + rml:reference "id" ; + ] ; + ] . + + +:triplesMapPerson a rml:TriplesMap ; + rml:logicalSource :csvView ; + rml:subjectMap [ + rml:template "http://example.org/person/{csv2_id}" ; + ] ; + rml:predicateObjectMap [ + rml:predicate :hasBirthYear ; + rml:objectMap [ + rml:reference "birthyear" ; + rml:datatype xsd:gYear ; + ] ; + ] ; + rml:predicateObjectMap [ + rml:predicate :hasItem ; + rml:objectMap [ + rml:template "http://example.org/person/{csv2_id}/item/{json_item}" ; + ] ; + ] . + +``` + +**Output** +``` + "1995"^^ . + . + . + "1999"^^ . + . + "2005"^^ . + +``` + diff --git a/src/test/resources/rml-lv/RMLLVTC0006c/mapping.ttl b/src/test/resources/rml-lv/RMLLVTC0006c/mapping.ttl new file mode 100644 index 00000000..cdcc7ec4 --- /dev/null +++ b/src/test/resources/rml-lv/RMLLVTC0006c/mapping.ttl @@ -0,0 +1,112 @@ +@prefix rml: . +@prefix xsd: . +@prefix : . + +:jsonSource a rml:LogicalSource ; + rml:source [ + a rml:RelativePathSource , rml:Source ; + rml:root rml:MappingDirectory ; + rml:path "people.json" ; + ] ; + rml:referenceFormulation rml:JSONPath ; + rml:iterator "$.people[*]" . + +:jsonView a rml:LogicalView ; + rml:viewOn :jsonSource ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "name" ; + rml:reference "$.name" ; + ] ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "item" ; + rml:reference "$.items[*]" ; + ] . + +:additionalCsvSource a rml:LogicalSource ; + rml:source [ + a rml:RelativePathSource , rml:Source ; + rml:root rml:MappingDirectory ; + rml:path "people2.csv" ; + ] ; + rml:referenceFormulation rml:CSV . + +:additionalCsvView a rml:LogicalView ; + rml:viewOn :additionalCsvSource ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "name" ; + rml:reference "name" ; + ] ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "id" ; + rml:reference "id" ; + ] ; +. + +:csvSource a rml:LogicalSource ; + rml:source [ + a rml:RelativePathSource , rml:Source ; + rml:root rml:MappingDirectory ; + rml:path "people.csv" ; + ] ; + rml:referenceFormulation rml:CSV . + +:csvView a rml:LogicalView ; + rml:viewOn :csvSource ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "name" ; + rml:reference "name" ; + ] ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "birthyear" ; + rml:reference "birthyear" ; + ] ; + rml:leftJoin [ + rml:parentLogicalView :jsonView ; + rml:joinCondition [ + rml:parent "name" ; + rml:child "name" ; + ] ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "json_item" ; + rml:reference "item" ; + ] ; + ] ; + rml:leftJoin [ + rml:parentLogicalView :additionalCsvView ; + rml:joinCondition [ + rml:parent "name" ; + rml:child "name" ; + ] ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "csv2_id" ; + rml:reference "id" ; + ] ; + ] . + + +:triplesMapPerson a rml:TriplesMap ; + rml:logicalSource :csvView ; + rml:subjectMap [ + rml:template "http://example.org/person/{csv2_id}" ; + ] ; + rml:predicateObjectMap [ + rml:predicate :hasBirthYear ; + rml:objectMap [ + rml:reference "birthyear" ; + rml:datatype xsd:gYear ; + ] ; + ] ; + rml:predicateObjectMap [ + rml:predicate :hasItem ; + rml:objectMap [ + rml:template "http://example.org/person/{csv2_id}/item/{json_item}" ; + ] ; + ] . diff --git a/src/test/resources/rml-lv/RMLLVTC0006c/output.nq b/src/test/resources/rml-lv/RMLLVTC0006c/output.nq new file mode 100644 index 00000000..43c6b6d9 --- /dev/null +++ b/src/test/resources/rml-lv/RMLLVTC0006c/output.nq @@ -0,0 +1,6 @@ + "1995"^^ . + . + . + "1999"^^ . + . + "2005"^^ . diff --git a/src/test/resources/rml-lv/RMLLVTC0006c/people.csv b/src/test/resources/rml-lv/RMLLVTC0006c/people.csv new file mode 100644 index 00000000..edc942d0 --- /dev/null +++ b/src/test/resources/rml-lv/RMLLVTC0006c/people.csv @@ -0,0 +1,4 @@ +name,birthyear +alice,1995 +bob,1999 +tobias,2005 diff --git a/src/test/resources/rml-lv/RMLLVTC0006c/people.json b/src/test/resources/rml-lv/RMLLVTC0006c/people.json new file mode 100644 index 00000000..c2fd489f --- /dev/null +++ b/src/test/resources/rml-lv/RMLLVTC0006c/people.json @@ -0,0 +1,17 @@ +{ + "people": [ + { + "name": "alice", + "items": [ + "sword", + "shield" + ] + }, + { + "name": "bob", + "items": [ + "flower" + ] + } + ] +} diff --git a/src/test/resources/rml-lv/RMLLVTC0006c/people2.csv b/src/test/resources/rml-lv/RMLLVTC0006c/people2.csv new file mode 100644 index 00000000..103cc9b0 --- /dev/null +++ b/src/test/resources/rml-lv/RMLLVTC0006c/people2.csv @@ -0,0 +1,4 @@ +name,id +alice,123 +bob,456 +tobias,789 diff --git a/src/test/resources/rml-lv/RMLLVTC0006d/README.md b/src/test/resources/rml-lv/RMLLVTC0006d/README.md new file mode 100644 index 00000000..203731c8 --- /dev/null +++ b/src/test/resources/rml-lv/RMLLVTC0006d/README.md @@ -0,0 +1,175 @@ +## RMLLVTC0006d + +**Title**: Inner Join and Left Join + +**Description**: Test an inner join and a left join in one logical view + +**Error expected?** No + +**Input** +``` +{ + "people": [ + { + "name": "alice", + "items": [ + "sword", + "shield" + ] + }, + { + "name": "bob", + "items": [ + "flower" + ] + } + ] +} + +``` + +**Input 1** +``` +name,birthyear +alice,1995 +bob,1999 +tobias,2005 + +``` + +**Input 2** +``` +name,id +alice,123 +bob,456 +tobias,789 + +``` + +**Mapping** +``` +@prefix rml: . +@prefix xsd: . +@prefix : . + +:jsonSource a rml:LogicalSource ; + rml:source [ + a rml:RelativePathSource , rml:Source ; + rml:root rml:MappingDirectory ; + rml:path "people.json" ; + ] ; + rml:referenceFormulation rml:JSONPath ; + rml:iterator "$.people[*]" . + +:jsonView a rml:LogicalView ; + rml:viewOn :jsonSource ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "name" ; + rml:reference "$.name" ; + ] ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "item" ; + rml:reference "$.items[*]" ; + ] . + +:additionalCsvSource a rml:LogicalSource ; + rml:source [ + a rml:RelativePathSource , rml:Source ; + rml:root rml:MappingDirectory ; + rml:path "people2.csv" ; + ] ; + rml:referenceFormulation rml:CSV . + +:additionalCsvView a rml:LogicalView ; + rml:viewOn :additionalCsvSource ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "name" ; + rml:reference "name" ; + ] ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "id" ; + rml:reference "id" ; + ] ; +. + +:csvSource a rml:LogicalSource ; + rml:source [ + a rml:RelativePathSource , rml:Source ; + rml:root rml:MappingDirectory ; + rml:path "people.csv" ; + ] ; + rml:referenceFormulation rml:CSV . + +:csvView a rml:LogicalView ; + rml:viewOn :csvSource ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "name" ; + rml:reference "name" ; + ] ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "birthyear" ; + rml:reference "birthyear" ; + ] ; + rml:innerJoin [ + rml:parentLogicalView :jsonView ; + rml:joinCondition [ + rml:parent "name" ; + rml:child "name" ; + ] ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "json_item" ; + rml:reference "item" ; + ] ; + ] ; + rml:leftJoin [ + rml:parentLogicalView :additionalCsvView ; + rml:joinCondition [ + rml:parent "name" ; + rml:child "name" ; + ] ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "csv2_id" ; + rml:reference "id" ; + ] ; + ] . + + +:triplesMapPerson a rml:TriplesMap ; + rml:logicalSource :csvView ; + rml:subjectMap [ + rml:template "http://example.org/person/{csv2_id}" ; + ] ; + rml:predicateObjectMap [ + rml:predicate :hasBirthYear ; + rml:objectMap [ + rml:reference "birthyear" ; + rml:datatype xsd:gYear ; + ] ; + ] ; + rml:predicateObjectMap [ + rml:predicate :hasItem ; + rml:objectMap [ + rml:template "http://example.org/person/{csv2_id}/item/{json_item}" ; + ] ; + ] . + +``` + +**Output** +``` + "1995"^^ . + . + . + "1999"^^ . + . + +``` + diff --git a/src/test/resources/rml-lv/RMLLVTC0006d/mapping.ttl b/src/test/resources/rml-lv/RMLLVTC0006d/mapping.ttl new file mode 100644 index 00000000..84508df4 --- /dev/null +++ b/src/test/resources/rml-lv/RMLLVTC0006d/mapping.ttl @@ -0,0 +1,112 @@ +@prefix rml: . +@prefix xsd: . +@prefix : . + +:jsonSource a rml:LogicalSource ; + rml:source [ + a rml:RelativePathSource , rml:Source ; + rml:root rml:MappingDirectory ; + rml:path "people.json" ; + ] ; + rml:referenceFormulation rml:JSONPath ; + rml:iterator "$.people[*]" . + +:jsonView a rml:LogicalView ; + rml:viewOn :jsonSource ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "name" ; + rml:reference "$.name" ; + ] ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "item" ; + rml:reference "$.items[*]" ; + ] . + +:additionalCsvSource a rml:LogicalSource ; + rml:source [ + a rml:RelativePathSource , rml:Source ; + rml:root rml:MappingDirectory ; + rml:path "people2.csv" ; + ] ; + rml:referenceFormulation rml:CSV . + +:additionalCsvView a rml:LogicalView ; + rml:viewOn :additionalCsvSource ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "name" ; + rml:reference "name" ; + ] ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "id" ; + rml:reference "id" ; + ] ; +. + +:csvSource a rml:LogicalSource ; + rml:source [ + a rml:RelativePathSource , rml:Source ; + rml:root rml:MappingDirectory ; + rml:path "people.csv" ; + ] ; + rml:referenceFormulation rml:CSV . + +:csvView a rml:LogicalView ; + rml:viewOn :csvSource ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "name" ; + rml:reference "name" ; + ] ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "birthyear" ; + rml:reference "birthyear" ; + ] ; + rml:innerJoin [ + rml:parentLogicalView :jsonView ; + rml:joinCondition [ + rml:parent "name" ; + rml:child "name" ; + ] ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "json_item" ; + rml:reference "item" ; + ] ; + ] ; + rml:leftJoin [ + rml:parentLogicalView :additionalCsvView ; + rml:joinCondition [ + rml:parent "name" ; + rml:child "name" ; + ] ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "csv2_id" ; + rml:reference "id" ; + ] ; + ] . + + +:triplesMapPerson a rml:TriplesMap ; + rml:logicalSource :csvView ; + rml:subjectMap [ + rml:template "http://example.org/person/{csv2_id}" ; + ] ; + rml:predicateObjectMap [ + rml:predicate :hasBirthYear ; + rml:objectMap [ + rml:reference "birthyear" ; + rml:datatype xsd:gYear ; + ] ; + ] ; + rml:predicateObjectMap [ + rml:predicate :hasItem ; + rml:objectMap [ + rml:template "http://example.org/person/{csv2_id}/item/{json_item}" ; + ] ; + ] . diff --git a/src/test/resources/rml-lv/RMLLVTC0006d/output.nq b/src/test/resources/rml-lv/RMLLVTC0006d/output.nq new file mode 100644 index 00000000..dffa206c --- /dev/null +++ b/src/test/resources/rml-lv/RMLLVTC0006d/output.nq @@ -0,0 +1,5 @@ + "1995"^^ . + . + . + "1999"^^ . + . diff --git a/src/test/resources/rml-lv/RMLLVTC0006d/people.csv b/src/test/resources/rml-lv/RMLLVTC0006d/people.csv new file mode 100644 index 00000000..edc942d0 --- /dev/null +++ b/src/test/resources/rml-lv/RMLLVTC0006d/people.csv @@ -0,0 +1,4 @@ +name,birthyear +alice,1995 +bob,1999 +tobias,2005 diff --git a/src/test/resources/rml-lv/RMLLVTC0006d/people.json b/src/test/resources/rml-lv/RMLLVTC0006d/people.json new file mode 100644 index 00000000..c2fd489f --- /dev/null +++ b/src/test/resources/rml-lv/RMLLVTC0006d/people.json @@ -0,0 +1,17 @@ +{ + "people": [ + { + "name": "alice", + "items": [ + "sword", + "shield" + ] + }, + { + "name": "bob", + "items": [ + "flower" + ] + } + ] +} diff --git a/src/test/resources/rml-lv/RMLLVTC0006d/people2.csv b/src/test/resources/rml-lv/RMLLVTC0006d/people2.csv new file mode 100644 index 00000000..103cc9b0 --- /dev/null +++ b/src/test/resources/rml-lv/RMLLVTC0006d/people2.csv @@ -0,0 +1,4 @@ +name,id +alice,123 +bob,456 +tobias,789 diff --git a/src/test/resources/rml-lv/RMLLVTC0006e/README.md b/src/test/resources/rml-lv/RMLLVTC0006e/README.md new file mode 100644 index 00000000..2e9ac2e9 --- /dev/null +++ b/src/test/resources/rml-lv/RMLLVTC0006e/README.md @@ -0,0 +1,171 @@ +## RMLLVTC0006e + +**Title**: Two Inner Joins + +**Description**: Test two left joins in one logical view + +**Error expected?** No + +**Input** +``` +{ + "people": [ + { + "name": "alice", + "items": [ + "sword", + "shield" + ] + }, + { + "name": "bob", + "items": [ + "flower" + ] + } + ] +} + +``` + +**Input 1** +``` +name,birthyear +alice,1995 +bob,1999 +tobias,2005 + +``` + +**Input 2** +``` +name,id +alice,123 + +``` + +**Mapping** +``` +@prefix rml: . +@prefix xsd: . +@prefix : . + +:jsonSource a rml:LogicalSource ; + rml:source [ + a rml:RelativePathSource , rml:Source ; + rml:root rml:MappingDirectory ; + rml:path "people.json" ; + ] ; + rml:referenceFormulation rml:JSONPath ; + rml:iterator "$.people[*]" . + +:jsonView a rml:LogicalView ; + rml:viewOn :jsonSource ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "name" ; + rml:reference "$.name" ; + ] ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "item" ; + rml:reference "$.items[*]" ; + ] . + +:additionalCsvSource a rml:LogicalSource ; + rml:source [ + a rml:RelativePathSource , rml:Source ; + rml:root rml:MappingDirectory ; + rml:path "people2.csv" ; + ] ; + rml:referenceFormulation rml:CSV . + +:additionalCsvView a rml:LogicalView ; + rml:viewOn :additionalCsvSource ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "name" ; + rml:reference "name" ; + ] ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "id" ; + rml:reference "id" ; + ] ; +. + +:csvSource a rml:LogicalSource ; + rml:source [ + a rml:RelativePathSource , rml:Source ; + rml:root rml:MappingDirectory ; + rml:path "people.csv" ; + ] ; + rml:referenceFormulation rml:CSV . + +:csvView a rml:LogicalView ; + rml:viewOn :csvSource ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "name" ; + rml:reference "name" ; + ] ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "birthyear" ; + rml:reference "birthyear" ; + ] ; + rml:innerJoin [ + rml:parentLogicalView :jsonView ; + rml:joinCondition [ + rml:parent "name" ; + rml:child "name" ; + ] ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "json_item" ; + rml:reference "item" ; + ] ; + ] ; + rml:innerJoin [ + rml:parentLogicalView :additionalCsvView ; + rml:joinCondition [ + rml:parent "name" ; + rml:child "name" ; + ] ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "csv2_id" ; + rml:reference "id" ; + ] ; + ] . + + +:triplesMapPerson a rml:TriplesMap ; + rml:logicalSource :csvView ; + rml:subjectMap [ + rml:template "http://example.org/person/{csv2_id}" ; + ] ; + rml:predicateObjectMap [ + rml:predicate :hasBirthYear ; + rml:objectMap [ + rml:reference "birthyear" ; + rml:datatype xsd:gYear ; + ] ; + ] ; + rml:predicateObjectMap [ + rml:predicate :hasItem ; + rml:objectMap [ + rml:template "http://example.org/person/{csv2_id}/item/{json_item}" ; + ] ; + ] . + +``` + +**Output** +``` + "1995"^^ . + . + . + +``` + diff --git a/src/test/resources/rml-lv/RMLLVTC0006e/mapping.ttl b/src/test/resources/rml-lv/RMLLVTC0006e/mapping.ttl new file mode 100644 index 00000000..8cad87cd --- /dev/null +++ b/src/test/resources/rml-lv/RMLLVTC0006e/mapping.ttl @@ -0,0 +1,112 @@ +@prefix rml: . +@prefix xsd: . +@prefix : . + +:jsonSource a rml:LogicalSource ; + rml:source [ + a rml:RelativePathSource , rml:Source ; + rml:root rml:MappingDirectory ; + rml:path "people.json" ; + ] ; + rml:referenceFormulation rml:JSONPath ; + rml:iterator "$.people[*]" . + +:jsonView a rml:LogicalView ; + rml:viewOn :jsonSource ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "name" ; + rml:reference "$.name" ; + ] ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "item" ; + rml:reference "$.items[*]" ; + ] . + +:additionalCsvSource a rml:LogicalSource ; + rml:source [ + a rml:RelativePathSource , rml:Source ; + rml:root rml:MappingDirectory ; + rml:path "people2.csv" ; + ] ; + rml:referenceFormulation rml:CSV . + +:additionalCsvView a rml:LogicalView ; + rml:viewOn :additionalCsvSource ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "name" ; + rml:reference "name" ; + ] ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "id" ; + rml:reference "id" ; + ] ; +. + +:csvSource a rml:LogicalSource ; + rml:source [ + a rml:RelativePathSource , rml:Source ; + rml:root rml:MappingDirectory ; + rml:path "people.csv" ; + ] ; + rml:referenceFormulation rml:CSV . + +:csvView a rml:LogicalView ; + rml:viewOn :csvSource ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "name" ; + rml:reference "name" ; + ] ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "birthyear" ; + rml:reference "birthyear" ; + ] ; + rml:innerJoin [ + rml:parentLogicalView :jsonView ; + rml:joinCondition [ + rml:parent "name" ; + rml:child "name" ; + ] ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "json_item" ; + rml:reference "item" ; + ] ; + ] ; + rml:innerJoin [ + rml:parentLogicalView :additionalCsvView ; + rml:joinCondition [ + rml:parent "name" ; + rml:child "name" ; + ] ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "csv2_id" ; + rml:reference "id" ; + ] ; + ] . + + +:triplesMapPerson a rml:TriplesMap ; + rml:logicalSource :csvView ; + rml:subjectMap [ + rml:template "http://example.org/person/{csv2_id}" ; + ] ; + rml:predicateObjectMap [ + rml:predicate :hasBirthYear ; + rml:objectMap [ + rml:reference "birthyear" ; + rml:datatype xsd:gYear ; + ] ; + ] ; + rml:predicateObjectMap [ + rml:predicate :hasItem ; + rml:objectMap [ + rml:template "http://example.org/person/{csv2_id}/item/{json_item}" ; + ] ; + ] . diff --git a/src/test/resources/rml-lv/RMLLVTC0006e/output.nq b/src/test/resources/rml-lv/RMLLVTC0006e/output.nq new file mode 100644 index 00000000..2449c7d3 --- /dev/null +++ b/src/test/resources/rml-lv/RMLLVTC0006e/output.nq @@ -0,0 +1,3 @@ + "1995"^^ . + . + . diff --git a/src/test/resources/rml-lv/RMLLVTC0006e/people.csv b/src/test/resources/rml-lv/RMLLVTC0006e/people.csv new file mode 100644 index 00000000..edc942d0 --- /dev/null +++ b/src/test/resources/rml-lv/RMLLVTC0006e/people.csv @@ -0,0 +1,4 @@ +name,birthyear +alice,1995 +bob,1999 +tobias,2005 diff --git a/src/test/resources/rml-lv/RMLLVTC0006e/people.json b/src/test/resources/rml-lv/RMLLVTC0006e/people.json new file mode 100644 index 00000000..c2fd489f --- /dev/null +++ b/src/test/resources/rml-lv/RMLLVTC0006e/people.json @@ -0,0 +1,17 @@ +{ + "people": [ + { + "name": "alice", + "items": [ + "sword", + "shield" + ] + }, + { + "name": "bob", + "items": [ + "flower" + ] + } + ] +} diff --git a/src/test/resources/rml-lv/RMLLVTC0006e/people2.csv b/src/test/resources/rml-lv/RMLLVTC0006e/people2.csv new file mode 100644 index 00000000..526c93c7 --- /dev/null +++ b/src/test/resources/rml-lv/RMLLVTC0006e/people2.csv @@ -0,0 +1,2 @@ +name,id +alice,123 diff --git a/src/test/resources/rml-lv/RMLLVTC0006f/README.md b/src/test/resources/rml-lv/RMLLVTC0006f/README.md new file mode 100644 index 00000000..009bccba --- /dev/null +++ b/src/test/resources/rml-lv/RMLLVTC0006f/README.md @@ -0,0 +1,133 @@ +## RMLLVTC0006f + +**Title**: Index Key of Field in Join + +**Description**: Test references to indexes of fields from a join + +**Error expected?** No + +**Input** +``` +{ + "people": [ + { + "name": "alice", + "items": [ + "sword", + "shield" + ] + }, + { + "name": "bob", + "items": [ + "flower" + ] + } + ] +} + +``` + +**Input 1** +``` +name,birthyear +alice,1995 +tobias,2005 +bob,1999 + +``` + +**Mapping** +``` +@prefix rml: . +@prefix xsd: . +@prefix : . + +:jsonSource a rml:LogicalSource ; + rml:source [ + a rml:RelativePathSource , rml:Source ; + rml:root rml:MappingDirectory ; + rml:path "people.json" ; + ] ; + rml:referenceFormulation rml:JSONPath ; + rml:iterator "$.people[*]" . + +:jsonView a rml:LogicalView ; + rml:viewOn :jsonSource ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "name" ; + rml:reference "$.name" ; + ] ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "item" ; + rml:reference "$.items[*]" ; + ] . + +:csvSource a rml:LogicalSource ; + rml:source [ + a rml:RelativePathSource , rml:Source ; + rml:root rml:MappingDirectory ; + rml:path "people.csv" ; + ] ; + rml:referenceFormulation rml:CSV . + +:csvView a rml:LogicalView ; + rml:viewOn :csvSource ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "name" ; + rml:reference "name" ; + ] ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "birthyear" ; + rml:reference "birthyear" ; + ] ; + rml:innerJoin [ + rml:parentLogicalView :jsonView ; + rml:joinCondition [ + rml:parent "name" ; + rml:child "name" ; + ] ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "json_item" ; + rml:reference "item" ; + ] ; + ] . + + +:triplesMapPerson a rml:TriplesMap ; + rml:logicalSource :csvView ; + rml:subjectMap [ + rml:template "http://example.org/person/{#}" ; + ] ; + rml:predicateObjectMap [ + rml:predicate :hasBirthYear ; + rml:objectMap [ + rml:reference "birthyear" ; + rml:datatype xsd:gYear ; + ] ; + ] ; + rml:predicateObjectMap [ + rml:predicate :hasItem ; + rml:objectMap [ + rml:template "http://example.org/person/{#}/item/{json_item.#}/{json_item}" ; + ] ; + ] . + +``` + +**Output** +``` + "1995"^^ . + . + . + "1999"^^ . + . + + +``` + diff --git a/src/test/resources/rml-lv/RMLLVTC0006f/mapping.ttl b/src/test/resources/rml-lv/RMLLVTC0006f/mapping.ttl new file mode 100644 index 00000000..3b109d96 --- /dev/null +++ b/src/test/resources/rml-lv/RMLLVTC0006f/mapping.ttl @@ -0,0 +1,78 @@ +@prefix rml: . +@prefix xsd: . +@prefix : . + +:jsonSource a rml:LogicalSource ; + rml:source [ + a rml:RelativePathSource , rml:Source ; + rml:root rml:MappingDirectory ; + rml:path "people.json" ; + ] ; + rml:referenceFormulation rml:JSONPath ; + rml:iterator "$.people[*]" . + +:jsonView a rml:LogicalView ; + rml:viewOn :jsonSource ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "name" ; + rml:reference "$.name" ; + ] ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "item" ; + rml:reference "$.items[*]" ; + ] . + +:csvSource a rml:LogicalSource ; + rml:source [ + a rml:RelativePathSource , rml:Source ; + rml:root rml:MappingDirectory ; + rml:path "people.csv" ; + ] ; + rml:referenceFormulation rml:CSV . + +:csvView a rml:LogicalView ; + rml:viewOn :csvSource ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "name" ; + rml:reference "name" ; + ] ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "birthyear" ; + rml:reference "birthyear" ; + ] ; + rml:innerJoin [ + rml:parentLogicalView :jsonView ; + rml:joinCondition [ + rml:parent "name" ; + rml:child "name" ; + ] ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "json_item" ; + rml:reference "item" ; + ] ; + ] . + + +:triplesMapPerson a rml:TriplesMap ; + rml:logicalSource :csvView ; + rml:subjectMap [ + rml:template "http://example.org/person/{#}" ; + ] ; + rml:predicateObjectMap [ + rml:predicate :hasBirthYear ; + rml:objectMap [ + rml:reference "birthyear" ; + rml:datatype xsd:gYear ; + ] ; + ] ; + rml:predicateObjectMap [ + rml:predicate :hasItem ; + rml:objectMap [ + rml:template "http://example.org/person/{#}/item/{json_item.#}/{json_item}" ; + ] ; + ] . diff --git a/src/test/resources/rml-lv/RMLLVTC0006f/output.nq b/src/test/resources/rml-lv/RMLLVTC0006f/output.nq new file mode 100644 index 00000000..5a125374 --- /dev/null +++ b/src/test/resources/rml-lv/RMLLVTC0006f/output.nq @@ -0,0 +1,6 @@ + "1995"^^ . + . + . + "1999"^^ . + . + diff --git a/src/test/resources/rml-lv/RMLLVTC0006f/people.csv b/src/test/resources/rml-lv/RMLLVTC0006f/people.csv new file mode 100644 index 00000000..0bf782c4 --- /dev/null +++ b/src/test/resources/rml-lv/RMLLVTC0006f/people.csv @@ -0,0 +1,4 @@ +name,birthyear +alice,1995 +tobias,2005 +bob,1999 diff --git a/src/test/resources/rml-lv/RMLLVTC0006f/people.json b/src/test/resources/rml-lv/RMLLVTC0006f/people.json new file mode 100644 index 00000000..c2fd489f --- /dev/null +++ b/src/test/resources/rml-lv/RMLLVTC0006f/people.json @@ -0,0 +1,17 @@ +{ + "people": [ + { + "name": "alice", + "items": [ + "sword", + "shield" + ] + }, + { + "name": "bob", + "items": [ + "flower" + ] + } + ] +} diff --git a/src/test/resources/rml-lv/RMLLVTC0007a/README.md b/src/test/resources/rml-lv/RMLLVTC0007a/README.md new file mode 100644 index 00000000..3d2571d1 --- /dev/null +++ b/src/test/resources/rml-lv/RMLLVTC0007a/README.md @@ -0,0 +1,91 @@ +## RMLLVTC0007a + +**Title**: Change Reference Formulations: CSV including JSON array + +**Description**: Test a change of reference formulations: csv source including json array + +**Error expected?** No + +**Input** +``` +name,items +alice,"[{""type"":""sword"",""weight"":1500},{""type"":""shield"",""weight"":2500}]" +bob,"[{""type"":""flower"",""weight"":15}]" + +``` + +**Mapping** +``` +@prefix rml: . +@prefix xsd: . +@prefix : . + +:mixedCSVSource a rml:LogicalSource ; + rml:source [ + a rml:RelativePathSource , rml:Source ; + rml:root rml:MappingDirectory ; + rml:path "people.csv" ; + ] ; + rml:referenceFormulation rml:CSV . + +:mixedCSVView a rml:LogicalView ; + rml:viewOn :mixedCSVSource ; + rml:field [ + a rml:ExpressionField; + rml:fieldName "name" ; + rml:reference "name" ; + ] ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "items" ; + rml:reference "items" ; + rml:field [ + a rml:IterableField ; + rml:referenceFormulation rml:JSONPath ; + rml:iterator "$[*]" ; + rml:fieldName "item" ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "type" ; + rml:reference "$.type" ; + ] ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "weight" ; + rml:reference "$.weight" ; + ] ; + ] ; + ] . + +:triplesMapItem a rml:TriplesMap ; + rml:logicalSource :mixedCSVView ; + rml:subjectMap [ + rml:template "http://example.org/item_{#}_{items.item.#}" ; + ] ; + rml:predicateObjectMap [ + rml:predicate :hasType ; + rml:objectMap [ + rml:reference "items.item.type" ; + ] ; + ] ; + rml:predicateObjectMap [ + rml:predicate :hasWeight ; + rml:objectMap [ + rml:reference "items.item.weight" ; + rml:datatype xsd:integer ; + ] ; + ] . + +``` + +**Output** +``` + "sword" . + "1500"^^ . + "shield" . + "2500"^^ . + "flower" . + "15"^^ . + +``` + diff --git a/src/test/resources/rml-lv/RMLLVTC0007a/mapping.ttl b/src/test/resources/rml-lv/RMLLVTC0007a/mapping.ttl new file mode 100644 index 00000000..6f8c6f12 --- /dev/null +++ b/src/test/resources/rml-lv/RMLLVTC0007a/mapping.ttl @@ -0,0 +1,59 @@ +@prefix rml: . +@prefix xsd: . +@prefix : . + +:mixedCSVSource a rml:LogicalSource ; + rml:source [ + a rml:RelativePathSource , rml:Source ; + rml:root rml:MappingDirectory ; + rml:path "people.csv" ; + ] ; + rml:referenceFormulation rml:CSV . + +:mixedCSVView a rml:LogicalView ; + rml:viewOn :mixedCSVSource ; + rml:field [ + a rml:ExpressionField; + rml:fieldName "name" ; + rml:reference "name" ; + ] ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "items" ; + rml:reference "items" ; + rml:field [ + a rml:IterableField ; + rml:referenceFormulation rml:JSONPath ; + rml:iterator "$[*]" ; + rml:fieldName "item" ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "type" ; + rml:reference "$.type" ; + ] ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "weight" ; + rml:reference "$.weight" ; + ] ; + ] ; + ] . + +:triplesMapItem a rml:TriplesMap ; + rml:logicalSource :mixedCSVView ; + rml:subjectMap [ + rml:template "http://example.org/item_{#}_{items.item.#}" ; + ] ; + rml:predicateObjectMap [ + rml:predicate :hasType ; + rml:objectMap [ + rml:reference "items.item.type" ; + ] ; + ] ; + rml:predicateObjectMap [ + rml:predicate :hasWeight ; + rml:objectMap [ + rml:reference "items.item.weight" ; + rml:datatype xsd:integer ; + ] ; + ] . diff --git a/src/test/resources/rml-lv/RMLLVTC0007a/output.nq b/src/test/resources/rml-lv/RMLLVTC0007a/output.nq new file mode 100644 index 00000000..da66633b --- /dev/null +++ b/src/test/resources/rml-lv/RMLLVTC0007a/output.nq @@ -0,0 +1,6 @@ + "sword" . + "1500"^^ . + "shield" . + "2500"^^ . + "flower" . + "15"^^ . diff --git a/src/test/resources/rml-lv/RMLLVTC0007a/people.csv b/src/test/resources/rml-lv/RMLLVTC0007a/people.csv new file mode 100644 index 00000000..cec6cb6b --- /dev/null +++ b/src/test/resources/rml-lv/RMLLVTC0007a/people.csv @@ -0,0 +1,3 @@ +name,items +alice,"[{""type"":""sword"",""weight"":1500},{""type"":""shield"",""weight"":2500}]" +bob,"[{""type"":""flower"",""weight"":15}]" diff --git a/src/test/resources/rml-lv/RMLLVTC0007b/README.md b/src/test/resources/rml-lv/RMLLVTC0007b/README.md new file mode 100644 index 00000000..6b1c2d3c --- /dev/null +++ b/src/test/resources/rml-lv/RMLLVTC0007b/README.md @@ -0,0 +1,91 @@ +## RMLLVTC0007b + +**Title**: Change Reference Formulations: CSV including JSON object + +**Description**: Test a change of reference formulations: csv source including json object + +**Error expected?** No + +**Input** +``` +name,item +alice,"{""type"":""sword"",""weight"":1500}" +alice,"{""type"":""shield"",""weight"":2500}" +bob,"{""type"":""flower"",""weight"":15}" + +``` + +**Mapping** +``` +@prefix rml: . +@prefix xsd: . +@prefix : . + +:mixedCSVSource a rml:LogicalSource ; + rml:source [ + a rml:RelativePathSource , rml:Source ; + rml:root rml:MappingDirectory ; + rml:path "people.csv" ; + ] ; + rml:referenceFormulation rml:CSV . + +:mixedCSVView a rml:LogicalView ; + rml:viewOn :mixedCSVSource ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "name" ; + rml:reference "name" ; + ] ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "item" ; + rml:reference "item" ; + rml:field [ + a rml:IterableField ; + rml:referenceFormulation rml:JSONPath ; + rml:iterator "$" ; + rml:fieldName "itemJson" ; + rml:field [ + a rml:ExpressionField; + rml:fieldName "type" ; + rml:reference "$.type" ; ] ; + rml:field [ + a rml:ExpressionField; + rml:fieldName "weight" ; + rml:reference "$.weight" ; + ] ; + ] ; + ] . + +:triplesMapItem a rml:TriplesMap ; + rml:logicalSource :mixedCSVView ; + rml:subjectMap [ + rml:template "http://example.org/item_{#}_{item.#}" ; + ] ; + rml:predicateObjectMap [ + rml:predicate :hasType ; + rml:objectMap [ + rml:reference "item.itemJson.type" ; + ] ; + ] ; + rml:predicateObjectMap [ + rml:predicate :hasWeight ; + rml:objectMap [ + rml:reference "item.itemJson.weight" ; + rml:datatype xsd:integer ; + ] ; + ] . + +``` + +**Output** +``` + "sword" . + "1500"^^ . + "shield" . + "2500"^^ . + "flower" . + "15"^^ . + +``` + diff --git a/src/test/resources/rml-lv/RMLLVTC0007b/mapping.ttl b/src/test/resources/rml-lv/RMLLVTC0007b/mapping.ttl new file mode 100644 index 00000000..e984ea50 --- /dev/null +++ b/src/test/resources/rml-lv/RMLLVTC0007b/mapping.ttl @@ -0,0 +1,58 @@ +@prefix rml: . +@prefix xsd: . +@prefix : . + +:mixedCSVSource a rml:LogicalSource ; + rml:source [ + a rml:RelativePathSource , rml:Source ; + rml:root rml:MappingDirectory ; + rml:path "people.csv" ; + ] ; + rml:referenceFormulation rml:CSV . + +:mixedCSVView a rml:LogicalView ; + rml:viewOn :mixedCSVSource ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "name" ; + rml:reference "name" ; + ] ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "item" ; + rml:reference "item" ; + rml:field [ + a rml:IterableField ; + rml:referenceFormulation rml:JSONPath ; + rml:iterator "$" ; + rml:fieldName "itemJson" ; + rml:field [ + a rml:ExpressionField; + rml:fieldName "type" ; + rml:reference "$.type" ; ] ; + rml:field [ + a rml:ExpressionField; + rml:fieldName "weight" ; + rml:reference "$.weight" ; + ] ; + ] ; + ] . + +:triplesMapItem a rml:TriplesMap ; + rml:logicalSource :mixedCSVView ; + rml:subjectMap [ + rml:template "http://example.org/item_{#}_{item.#}" ; + ] ; + rml:predicateObjectMap [ + rml:predicate :hasType ; + rml:objectMap [ + rml:reference "item.itemJson.type" ; + ] ; + ] ; + rml:predicateObjectMap [ + rml:predicate :hasWeight ; + rml:objectMap [ + rml:reference "item.itemJson.weight" ; + rml:datatype xsd:integer ; + ] ; + ] . diff --git a/src/test/resources/rml-lv/RMLLVTC0007b/output.nq b/src/test/resources/rml-lv/RMLLVTC0007b/output.nq new file mode 100644 index 00000000..e52543f1 --- /dev/null +++ b/src/test/resources/rml-lv/RMLLVTC0007b/output.nq @@ -0,0 +1,6 @@ + "sword" . + "1500"^^ . + "shield" . + "2500"^^ . + "flower" . + "15"^^ . diff --git a/src/test/resources/rml-lv/RMLLVTC0007b/people.csv b/src/test/resources/rml-lv/RMLLVTC0007b/people.csv new file mode 100644 index 00000000..eda1eb05 --- /dev/null +++ b/src/test/resources/rml-lv/RMLLVTC0007b/people.csv @@ -0,0 +1,4 @@ +name,item +alice,"{""type"":""sword"",""weight"":1500}" +alice,"{""type"":""shield"",""weight"":2500}" +bob,"{""type"":""flower"",""weight"":15}" diff --git a/src/test/resources/rml-lv/RMLLVTC0007c/README.md b/src/test/resources/rml-lv/RMLLVTC0007c/README.md new file mode 100644 index 00000000..1dbd0667 --- /dev/null +++ b/src/test/resources/rml-lv/RMLLVTC0007c/README.md @@ -0,0 +1,100 @@ +## RMLLVTC0007c + +**Title**: Change Reference Formulations: JSON including CSV + +**Description**: Test a change of reference formulations: json source including csv data + +**Error expected?** No + +**Input** +``` +{ + "people": [ + { + "name": "alice", + "items": "type,weight\nsword,1500\nshield,2500" + }, + { + "name": "bob", + "items": "type,weight\nflower,15" + } + ] +} + +``` + +**Mapping** +``` +@prefix rml: . +@prefix xsd: . +@prefix : . + +:mixedJSONSource a rml:LogicalSource ; + rml:source [ + a rml:RelativePathSource , rml:Source ; + rml:root rml:MappingDirectory ; + rml:path "people.json" ; + ] ; + rml:referenceFormulation rml:JSONPath ; + rml:iterator "$.people[*]" . + +:mixedJSONView a rml:LogicalView ; + rml:viewOn :mixedJSONSource ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "name" ; + rml:reference "$.name" ; + ] ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "items" ; + rml:reference "$.items" ; + rml:field [ + a rml:IterableField ; + rml:referenceFormulation rml:CSV ; + rml:fieldName "item"; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "type" ; + rml:reference "type" ; + ] ; + rml:field [ + a rml:expressionField ; + rml:fieldName "weight" ; + rml:reference "weight" ; + ] ; + ] ; + ]. + +:triplesMapItem a rml:TriplesMap ; + rml:logicalSource :mixedJSONView ; + rml:subjectMap [ + rml:template "http://example.org/item_{#}_{items.item.#}" ; + ] ; + rml:predicateObjectMap [ + rml:predicate :hasType ; + rml:objectMap [ + rml:reference "items.item.type" ; + ] ; + ] ; + rml:predicateObjectMap [ + rml:predicate :hasWeight ; + rml:objectMap [ + rml:reference "items.item.weight" ; + rml:datatype xsd:integer ; + ] ; + ] . + +``` + +**Output** +``` + "sword" . + "1500"^^ . + "shield" . + "2500"^^ . + "flower" . + "15"^^ . + +``` + diff --git a/src/test/resources/rml-lv/RMLLVTC0007c/mapping.ttl b/src/test/resources/rml-lv/RMLLVTC0007c/mapping.ttl new file mode 100644 index 00000000..0bec70b8 --- /dev/null +++ b/src/test/resources/rml-lv/RMLLVTC0007c/mapping.ttl @@ -0,0 +1,59 @@ +@prefix rml: . +@prefix xsd: . +@prefix : . + +:mixedJSONSource a rml:LogicalSource ; + rml:source [ + a rml:RelativePathSource , rml:Source ; + rml:root rml:MappingDirectory ; + rml:path "people.json" ; + ] ; + rml:referenceFormulation rml:JSONPath ; + rml:iterator "$.people[*]" . + +:mixedJSONView a rml:LogicalView ; + rml:viewOn :mixedJSONSource ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "name" ; + rml:reference "$.name" ; + ] ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "items" ; + rml:reference "$.items" ; + rml:field [ + a rml:IterableField ; + rml:referenceFormulation rml:CSV ; + rml:fieldName "item"; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "type" ; + rml:reference "type" ; + ] ; + rml:field [ + a rml:expressionField ; + rml:fieldName "weight" ; + rml:reference "weight" ; + ] ; + ] ; + ]. + +:triplesMapItem a rml:TriplesMap ; + rml:logicalSource :mixedJSONView ; + rml:subjectMap [ + rml:template "http://example.org/item_{#}_{items.item.#}" ; + ] ; + rml:predicateObjectMap [ + rml:predicate :hasType ; + rml:objectMap [ + rml:reference "items.item.type" ; + ] ; + ] ; + rml:predicateObjectMap [ + rml:predicate :hasWeight ; + rml:objectMap [ + rml:reference "items.item.weight" ; + rml:datatype xsd:integer ; + ] ; + ] . diff --git a/src/test/resources/rml-lv/RMLLVTC0007c/output.nq b/src/test/resources/rml-lv/RMLLVTC0007c/output.nq new file mode 100644 index 00000000..da66633b --- /dev/null +++ b/src/test/resources/rml-lv/RMLLVTC0007c/output.nq @@ -0,0 +1,6 @@ + "sword" . + "1500"^^ . + "shield" . + "2500"^^ . + "flower" . + "15"^^ . diff --git a/src/test/resources/rml-lv/RMLLVTC0007c/people.json b/src/test/resources/rml-lv/RMLLVTC0007c/people.json new file mode 100644 index 00000000..af0dd764 --- /dev/null +++ b/src/test/resources/rml-lv/RMLLVTC0007c/people.json @@ -0,0 +1,12 @@ +{ + "people": [ + { + "name": "alice", + "items": "type,weight\nsword,1500\nshield,2500" + }, + { + "name": "bob", + "items": "type,weight\nflower,15" + } + ] +} diff --git a/src/test/resources/rml-lv/RMLLVTC0008a/README.md b/src/test/resources/rml-lv/RMLLVTC0008a/README.md new file mode 100644 index 00000000..8dab0871 --- /dev/null +++ b/src/test/resources/rml-lv/RMLLVTC0008a/README.md @@ -0,0 +1,43 @@ +## RMLLVTC0008a + +**Title**: Cycle: Abstract Logical Source + +**Description**: Test a cycle in the abstract logical source of a logical view + +**Error expected?** Yes + +**Mapping** +``` +@prefix rml: . +@prefix : . + +:view1 a rml:LogicalView ; + rml:viewOn :view2 ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "name1" ; + rml:reference "name2" ; + ] . + +:view2 a rml:LogicalView ; + rml:viewOn :view1 ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "name2" ; + rml:reference "name1" ; + ] . + +:triplesMapPerson a rml:TriplesMap ; + rml:logicalSource :view2 ; + rml:subjectMap [ + rml:template "http://example.org/person/{name2}" ; + ] ; + rml:predicateObjectMap [ + rml:predicate :hasName ; + rml:objectMap [ + rml:reference "name2" ; + ] ; + ] . + +``` + diff --git a/src/test/resources/rml-lv/RMLLVTC0008a/mapping.ttl b/src/test/resources/rml-lv/RMLLVTC0008a/mapping.ttl new file mode 100644 index 00000000..8295ade6 --- /dev/null +++ b/src/test/resources/rml-lv/RMLLVTC0008a/mapping.ttl @@ -0,0 +1,30 @@ +@prefix rml: . +@prefix : . + +:view1 a rml:LogicalView ; + rml:viewOn :view2 ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "name1" ; + rml:reference "name2" ; + ] . + +:view2 a rml:LogicalView ; + rml:viewOn :view1 ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "name2" ; + rml:reference "name1" ; + ] . + +:triplesMapPerson a rml:TriplesMap ; + rml:logicalSource :view2 ; + rml:subjectMap [ + rml:template "http://example.org/person/{name2}" ; + ] ; + rml:predicateObjectMap [ + rml:predicate :hasName ; + rml:objectMap [ + rml:reference "name2" ; + ] ; + ] . diff --git a/src/test/resources/rml-lv/RMLLVTC0008b/README.md b/src/test/resources/rml-lv/RMLLVTC0008b/README.md new file mode 100644 index 00000000..bfa0672a --- /dev/null +++ b/src/test/resources/rml-lv/RMLLVTC0008b/README.md @@ -0,0 +1,134 @@ +## RMLLVTC0008b + +**Title**: Cycle: Joins + +**Description**: Test a cycle in two joins of two logical views + +**Error expected?** Yes + +**Input** +``` +{ + "people": [ + { + "name": "alice", + "items": [ + "sword", + "shield" + ] + }, + { + "name": "bob", + "items": [ + "flower" + ] + } + ] +} + +``` + +**Input 1** +``` +name,birthyear +alice,1995 +bob,1999 +tobias,2005 + +``` + +**Mapping** +``` +@prefix rml: . +@prefix xsd: . +@prefix : . + +:jsonSource a rml:LogicalSource ; + rml:source [ + a rml:RelativePathSource , rml:Source ; + rml:root rml:MappingDirectory ; + rml:path "people.json" ; + ] ; + rml:referenceFormulation rml:JSONPath ; + rml:iterator "$.people[*]" . + +:jsonView a rml:LogicalView ; + rml:viewOn :jsonSource ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "name" ; + rml:reference "$.name" ; + ] ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "item" ; + rml:reference "$.items[*]" ; + ] ; + rml:leftJoin [ + rml:parentLogicalView :csvView ; + rml:joinCondition [ + rml:parent "name" ; + rml:child "name" ; + ] ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "csv_birthyear" ; + rml:reference "birthyear" ; + ] ; + ] . + +:csvSource a rml:LogicalSource ; + rml:source [ + a rml:RelativePathSource , rml:Source ; + rml:root rml:MappingDirectory ; + rml:path "people.csv" ; + ] ; + rml:referenceFormulation rml:CSV . + +:csvView a rml:LogicalView ; + rml:viewOn :csvSource ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "name" ; + rml:reference "name" ; + ] ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "birthyear" ; + rml:reference "birthyear" ; + ] ; + rml:leftJoin [ + rml:parentLogicalView :jsonView ; + rml:joinCondition [ + rml:parent "name" ; + rml:child "name" ; + ] ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "json_item" ; + rml:reference "item" ; + ] ; + ] . + + +:triplesMapPerson a rml:TriplesMap ; + rml:logicalSource :csvView ; + rml:subjectMap [ + rml:template "http://example.org/person/{name}" ; + ] ; + rml:predicateObjectMap [ + rml:predicate :hasBirthYear ; + rml:objectMap [ + rml:reference "birthyear" ; + rml:datatype xsd:gYear ; + ] ; + ] ; + rml:predicateObjectMap [ + rml:predicate :hasItem ; + rml:objectMap [ + rml:template "http://example.org/person/{name}/item/{json_item}" ; + ] ; + ] . + +``` + diff --git a/src/test/resources/rml-lv/RMLLVTC0008b/mapping.ttl b/src/test/resources/rml-lv/RMLLVTC0008b/mapping.ttl new file mode 100644 index 00000000..fed9db6c --- /dev/null +++ b/src/test/resources/rml-lv/RMLLVTC0008b/mapping.ttl @@ -0,0 +1,90 @@ +@prefix rml: . +@prefix xsd: . +@prefix : . + +:jsonSource a rml:LogicalSource ; + rml:source [ + a rml:RelativePathSource , rml:Source ; + rml:root rml:MappingDirectory ; + rml:path "people.json" ; + ] ; + rml:referenceFormulation rml:JSONPath ; + rml:iterator "$.people[*]" . + +:jsonView a rml:LogicalView ; + rml:viewOn :jsonSource ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "name" ; + rml:reference "$.name" ; + ] ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "item" ; + rml:reference "$.items[*]" ; + ] ; + rml:leftJoin [ + rml:parentLogicalView :csvView ; + rml:joinCondition [ + rml:parent "name" ; + rml:child "name" ; + ] ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "csv_birthyear" ; + rml:reference "birthyear" ; + ] ; + ] . + +:csvSource a rml:LogicalSource ; + rml:source [ + a rml:RelativePathSource , rml:Source ; + rml:root rml:MappingDirectory ; + rml:path "people.csv" ; + ] ; + rml:referenceFormulation rml:CSV . + +:csvView a rml:LogicalView ; + rml:viewOn :csvSource ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "name" ; + rml:reference "name" ; + ] ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "birthyear" ; + rml:reference "birthyear" ; + ] ; + rml:leftJoin [ + rml:parentLogicalView :jsonView ; + rml:joinCondition [ + rml:parent "name" ; + rml:child "name" ; + ] ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "json_item" ; + rml:reference "item" ; + ] ; + ] . + + +:triplesMapPerson a rml:TriplesMap ; + rml:logicalSource :csvView ; + rml:subjectMap [ + rml:template "http://example.org/person/{name}" ; + ] ; + rml:predicateObjectMap [ + rml:predicate :hasBirthYear ; + rml:objectMap [ + rml:reference "birthyear" ; + rml:datatype xsd:gYear ; + ] ; + ] ; + rml:predicateObjectMap [ + rml:predicate :hasItem ; + rml:objectMap [ + rml:template "http://example.org/person/{name}/item/{json_item}" ; + ] ; + ] . diff --git a/src/test/resources/rml-lv/RMLLVTC0008b/output.nq b/src/test/resources/rml-lv/RMLLVTC0008b/output.nq new file mode 100644 index 00000000..f9fd2a83 --- /dev/null +++ b/src/test/resources/rml-lv/RMLLVTC0008b/output.nq @@ -0,0 +1,6 @@ + "1995"^^ . + . + . + "1999"^^ . + . + "2005"^^ . diff --git a/src/test/resources/rml-lv/RMLLVTC0008b/people.csv b/src/test/resources/rml-lv/RMLLVTC0008b/people.csv new file mode 100644 index 00000000..edc942d0 --- /dev/null +++ b/src/test/resources/rml-lv/RMLLVTC0008b/people.csv @@ -0,0 +1,4 @@ +name,birthyear +alice,1995 +bob,1999 +tobias,2005 diff --git a/src/test/resources/rml-lv/RMLLVTC0008b/people.json b/src/test/resources/rml-lv/RMLLVTC0008b/people.json new file mode 100644 index 00000000..c2fd489f --- /dev/null +++ b/src/test/resources/rml-lv/RMLLVTC0008b/people.json @@ -0,0 +1,17 @@ +{ + "people": [ + { + "name": "alice", + "items": [ + "sword", + "shield" + ] + }, + { + "name": "bob", + "items": [ + "flower" + ] + } + ] +} diff --git a/src/test/resources/rml-lv/RMLLVTC0008c/README.md b/src/test/resources/rml-lv/RMLLVTC0008c/README.md new file mode 100644 index 00000000..2a3de1b6 --- /dev/null +++ b/src/test/resources/rml-lv/RMLLVTC0008c/README.md @@ -0,0 +1,87 @@ +## RMLLVTC0008c + +**Title**: Cycle: Self-Join + +**Description**: Test a cycle in a join of a logical view: self-join + +**Error expected?** Yes + +**Input** +``` +{ + "people": [ + { + "name": "alice", + "items": [ + { + "type": "sword", + "weight": 1500 + }, + { + "type": "shield", + "weight": 2500 + } + ] + }, + { + "name": "bob", + "items": [ + { + "type": "flower", + "weight": 15 + } + ] + } + ] +} + +``` + +**Mapping** +``` +@prefix rml: . +@prefix : . + +:jsonSource a rml:LogicalSource ; + rml:source [ + a rml:RelativePathSource , rml:Source ; + rml:root rml:MappingDirectory ; + rml:path "people.json" ; + ] ; + rml:referenceFormulation rml:JSONPath ; + rml:iterator "$.people[*]" . + +:jsonView a rml:LogicalView ; + rml:viewOn :jsonSource ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "name" ; + rml:reference "$.name" ; + ] ; + rml:leftJoin [ + rml:parentLogicalView :jsonView ; + rml:joinCondition [ + rml:parent "name" ; + rml:child "name" ; + ] ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "newName" ; + rml:reference "name" ; + ] ; + ] . + +:triplesMapPerson a rml:TriplesMap ; + rml:logicalSource :jsonView ; + rml:subjectMap [ + rml:template "http://example.org/person/{newName}" ; + ] ; + rml:predicateObjectMap [ + rml:predicate :hasName ; + rml:objectMap [ + rml:reference "newName" ; + ] ; + ] . + +``` + diff --git a/src/test/resources/rml-lv/RMLLVTC0008c/mapping.ttl b/src/test/resources/rml-lv/RMLLVTC0008c/mapping.ttl new file mode 100644 index 00000000..b238c10f --- /dev/null +++ b/src/test/resources/rml-lv/RMLLVTC0008c/mapping.ttl @@ -0,0 +1,43 @@ +@prefix rml: . +@prefix : . + +:jsonSource a rml:LogicalSource ; + rml:source [ + a rml:RelativePathSource , rml:Source ; + rml:root rml:MappingDirectory ; + rml:path "people.json" ; + ] ; + rml:referenceFormulation rml:JSONPath ; + rml:iterator "$.people[*]" . + +:jsonView a rml:LogicalView ; + rml:viewOn :jsonSource ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "name" ; + rml:reference "$.name" ; + ] ; + rml:leftJoin [ + rml:parentLogicalView :jsonView ; + rml:joinCondition [ + rml:parent "name" ; + rml:child "name" ; + ] ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "newName" ; + rml:reference "name" ; + ] ; + ] . + +:triplesMapPerson a rml:TriplesMap ; + rml:logicalSource :jsonView ; + rml:subjectMap [ + rml:template "http://example.org/person/{newName}" ; + ] ; + rml:predicateObjectMap [ + rml:predicate :hasName ; + rml:objectMap [ + rml:reference "newName" ; + ] ; + ] . diff --git a/src/test/resources/rml-lv/RMLLVTC0008c/people.json b/src/test/resources/rml-lv/RMLLVTC0008c/people.json new file mode 100644 index 00000000..87d56294 --- /dev/null +++ b/src/test/resources/rml-lv/RMLLVTC0008c/people.json @@ -0,0 +1,26 @@ +{ + "people": [ + { + "name": "alice", + "items": [ + { + "type": "sword", + "weight": 1500 + }, + { + "type": "shield", + "weight": 2500 + } + ] + }, + { + "name": "bob", + "items": [ + { + "type": "flower", + "weight": 15 + } + ] + } + ] +} diff --git a/src/test/resources/rml-lv/RMLLVTC0008d/README.md b/src/test/resources/rml-lv/RMLLVTC0008d/README.md new file mode 100644 index 00000000..02362e36 --- /dev/null +++ b/src/test/resources/rml-lv/RMLLVTC0008d/README.md @@ -0,0 +1,70 @@ +## RMLLVTC0008d + +**Title**: Cycle: Fields + +**Description**: Test a cycle in nested fields + +**Error expected?** Yes + +**Input** +``` +{ + "people": [ + { + "name": "alice", + "items": [ + { + "type": "sword", + "weight": 1500 + }, + { + "type": "shield", + "weight": 2500 + } + ] + }, + { + "name": "bob", + "items": [ + { + "type": "flower", + "weight": 15 + } + ] + } + ] +} + +``` + +**Mapping** +``` +@prefix rml: . +@prefix : . + +:jsonSource a rml:LogicalSource ; + rml:source [ + a rml:RelativePathSource , rml:Source ; + rml:root rml:MappingDirectory ; + rml:path "people.json" ; + ] ; + rml:referenceFormulation rml:JSONPath ; + rml:iterator "$.people[*]" . + +:jsonView a rml:LogicalView ; + rml:viewOn :jsonSource ; + rml:field :field1 . + +:field1 a rml:IterableField ; + rml:fieldName "item" ; + rml:referenceFormulation rml:JSONPath ; + rml:iterator "$.items[*]" ; + rml:field :field2. + +:field2 a rml:ExpressionField ; + rml:fieldName "type" ; + rml:reference "$.type" ; + rml:field :field1. + +``` + diff --git a/src/test/resources/rml-lv/RMLLVTC0008d/mapping.ttl b/src/test/resources/rml-lv/RMLLVTC0008d/mapping.ttl new file mode 100644 index 00000000..6d32c26e --- /dev/null +++ b/src/test/resources/rml-lv/RMLLVTC0008d/mapping.ttl @@ -0,0 +1,26 @@ +@prefix rml: . +@prefix : . + +:jsonSource a rml:LogicalSource ; + rml:source [ + a rml:RelativePathSource , rml:Source ; + rml:root rml:MappingDirectory ; + rml:path "people.json" ; + ] ; + rml:referenceFormulation rml:JSONPath ; + rml:iterator "$.people[*]" . + +:jsonView a rml:LogicalView ; + rml:viewOn :jsonSource ; + rml:field :field1 . + +:field1 a rml:IterableField ; + rml:fieldName "item" ; + rml:referenceFormulation rml:JSONPath ; + rml:iterator "$.items[*]" ; + rml:field :field2. + +:field2 a rml:ExpressionField ; + rml:fieldName "type" ; + rml:reference "$.type" ; + rml:field :field1. diff --git a/src/test/resources/rml-lv/RMLLVTC0008d/people.json b/src/test/resources/rml-lv/RMLLVTC0008d/people.json new file mode 100644 index 00000000..87d56294 --- /dev/null +++ b/src/test/resources/rml-lv/RMLLVTC0008d/people.json @@ -0,0 +1,26 @@ +{ + "people": [ + { + "name": "alice", + "items": [ + { + "type": "sword", + "weight": 1500 + }, + { + "type": "shield", + "weight": 2500 + } + ] + }, + { + "name": "bob", + "items": [ + { + "type": "flower", + "weight": 15 + } + ] + } + ] +} diff --git a/src/test/resources/rml-lv/RMLLVTC0009a/README.md b/src/test/resources/rml-lv/RMLLVTC0009a/README.md new file mode 100644 index 00000000..547b9108 --- /dev/null +++ b/src/test/resources/rml-lv/RMLLVTC0009a/README.md @@ -0,0 +1,65 @@ +## RMLLVTC0009a + +**Title**: Name collision: between Fields with the same Parent + +**Description**: Test a name collision between fields with the same parent + +**Error expected?** Yes + +**Input** +``` +{ + "people": [ + { + "givenName": "Alice", + "familyName": "Smith" + }, + { + "givenName": "Bob", + "familyName": "Johnson" + } + ] +} + +``` + +**Mapping** +``` +@prefix rml: . +@prefix : . + +:jsonSource a rml:LogicalSource ; + rml:source [ + a rml:RelativePathSource , rml:Source ; + rml:root rml:MappingDirectory ; + rml:path "people.json" ; + ] ; + rml:referenceFormulation rml:JSONPath ; + rml:iterator "$.people[*]" . + +:jsonView a rml:LogicalView ; + rml:viewOn :jsonSource ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "name" ; + rml:reference "$.givenName" ; + ], [ + a rml:ExpressionField ; + rml:fieldName "name" ; + rml:reference "$.familyName" ; + ] . + +:triplesMapPerson a rml:TriplesMap ; + rml:logicalSource :jsonView ; + rml:subjectMap [ + rml:template "http://example.org/person/{name}" ; + ] ; + rml:predicateObjectMap [ + rml:predicate :hasName ; + rml:objectMap [ + rml:reference "name" ; + ] ; + ] . + +``` + diff --git a/src/test/resources/rml-lv/RMLLVTC0009a/mapping.ttl b/src/test/resources/rml-lv/RMLLVTC0009a/mapping.ttl new file mode 100644 index 00000000..a5e46121 --- /dev/null +++ b/src/test/resources/rml-lv/RMLLVTC0009a/mapping.ttl @@ -0,0 +1,35 @@ +@prefix rml: . +@prefix : . + +:jsonSource a rml:LogicalSource ; + rml:source [ + a rml:RelativePathSource , rml:Source ; + rml:root rml:MappingDirectory ; + rml:path "people.json" ; + ] ; + rml:referenceFormulation rml:JSONPath ; + rml:iterator "$.people[*]" . + +:jsonView a rml:LogicalView ; + rml:viewOn :jsonSource ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "name" ; + rml:reference "$.givenName" ; + ], [ + a rml:ExpressionField ; + rml:fieldName "name" ; + rml:reference "$.familyName" ; + ] . + +:triplesMapPerson a rml:TriplesMap ; + rml:logicalSource :jsonView ; + rml:subjectMap [ + rml:template "http://example.org/person/{name}" ; + ] ; + rml:predicateObjectMap [ + rml:predicate :hasName ; + rml:objectMap [ + rml:reference "name" ; + ] ; + ] . diff --git a/src/test/resources/rml-lv/RMLLVTC0009a/people.json b/src/test/resources/rml-lv/RMLLVTC0009a/people.json new file mode 100644 index 00000000..2361327a --- /dev/null +++ b/src/test/resources/rml-lv/RMLLVTC0009a/people.json @@ -0,0 +1,12 @@ +{ + "people": [ + { + "givenName": "Alice", + "familyName": "Smith" + }, + { + "givenName": "Bob", + "familyName": "Johnson" + } + ] +} diff --git a/src/test/resources/rml-lv/RMLLVTC0009b/README.md b/src/test/resources/rml-lv/RMLLVTC0009b/README.md new file mode 100644 index 00000000..6916b82f --- /dev/null +++ b/src/test/resources/rml-lv/RMLLVTC0009b/README.md @@ -0,0 +1,118 @@ +## RMLLVTC0009b + +**Title**: Name collision: caused by Field from a Join + +**Description**: Test a name collision caused by a field from a join + +**Error expected?** Yes + +**Input** +``` +{ + "people": [ + { + "givenName": "alice", + "familyName": "smith", + "items": [ + "sword", + "shield" + ] + }, + { + "givenName": "bob", + "familyName": "johnson", + "items": [ + "flower" + ] + } + ] +} + +``` + +**Input 1** +``` +name,birthyear +alice,1995 +bob,1999 +tobias,2005 + +``` + +**Mapping** +``` +@prefix rml: . +@prefix xsd: . +@prefix : . + +:jsonSource a rml:LogicalSource ; + rml:source [ + a rml:RelativePathSource , rml:Source ; + rml:root rml:MappingDirectory ; + rml:path "people.json" ; + ] ; + rml:referenceFormulation rml:JSONPath ; + rml:iterator "$.people[*]" . + +:jsonView a rml:LogicalView ; + rml:viewOn :jsonSource ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "givenName" ; + rml:reference "$.givenName" ; + ] ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "familyName" ; + rml:reference "$.familyName" ; + ] . + +:csvSource a rml:LogicalSource ; + rml:source [ + a rml:RelativePathSource , rml:Source ; + rml:root rml:MappingDirectory ; + rml:path "people.csv" ; + ] ; + rml:referenceFormulation rml:CSV . + +:csvView a rml:LogicalView ; + rml:viewOn :csvSource ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "name" ; + rml:reference "name" ; + ] ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "birthyear" ; + rml:reference "birthyear" ; + ] ; + rml:leftJoin [ + rml:parentLogicalView :jsonView ; + rml:joinCondition [ + rml:parent "givenName" ; + rml:child "name" ; + ] ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "name" ; + rml:reference "familyName" ; + ] ; + ] . + + +:triplesMapPerson a rml:TriplesMap ; + rml:logicalSource :csvView ; + rml:subjectMap [ + rml:template "http://example.org/person/{name}" ; + ] ; + rml:predicateObjectMap [ + rml:predicate :hasBirthYear ; + rml:objectMap [ + rml:reference "birthyear" ; + rml:datatype xsd:gYear ; + ] ; + ] . + +``` + diff --git a/src/test/resources/rml-lv/RMLLVTC0009b/mapping.ttl b/src/test/resources/rml-lv/RMLLVTC0009b/mapping.ttl new file mode 100644 index 00000000..458d72f0 --- /dev/null +++ b/src/test/resources/rml-lv/RMLLVTC0009b/mapping.ttl @@ -0,0 +1,72 @@ +@prefix rml: . +@prefix xsd: . +@prefix : . + +:jsonSource a rml:LogicalSource ; + rml:source [ + a rml:RelativePathSource , rml:Source ; + rml:root rml:MappingDirectory ; + rml:path "people.json" ; + ] ; + rml:referenceFormulation rml:JSONPath ; + rml:iterator "$.people[*]" . + +:jsonView a rml:LogicalView ; + rml:viewOn :jsonSource ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "givenName" ; + rml:reference "$.givenName" ; + ] ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "familyName" ; + rml:reference "$.familyName" ; + ] . + +:csvSource a rml:LogicalSource ; + rml:source [ + a rml:RelativePathSource , rml:Source ; + rml:root rml:MappingDirectory ; + rml:path "people.csv" ; + ] ; + rml:referenceFormulation rml:CSV . + +:csvView a rml:LogicalView ; + rml:viewOn :csvSource ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "name" ; + rml:reference "name" ; + ] ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "birthyear" ; + rml:reference "birthyear" ; + ] ; + rml:leftJoin [ + rml:parentLogicalView :jsonView ; + rml:joinCondition [ + rml:parent "givenName" ; + rml:child "name" ; + ] ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "name" ; + rml:reference "familyName" ; + ] ; + ] . + + +:triplesMapPerson a rml:TriplesMap ; + rml:logicalSource :csvView ; + rml:subjectMap [ + rml:template "http://example.org/person/{name}" ; + ] ; + rml:predicateObjectMap [ + rml:predicate :hasBirthYear ; + rml:objectMap [ + rml:reference "birthyear" ; + rml:datatype xsd:gYear ; + ] ; + ] . diff --git a/src/test/resources/rml-lv/RMLLVTC0009b/people.csv b/src/test/resources/rml-lv/RMLLVTC0009b/people.csv new file mode 100644 index 00000000..edc942d0 --- /dev/null +++ b/src/test/resources/rml-lv/RMLLVTC0009b/people.csv @@ -0,0 +1,4 @@ +name,birthyear +alice,1995 +bob,1999 +tobias,2005 diff --git a/src/test/resources/rml-lv/RMLLVTC0009b/people.json b/src/test/resources/rml-lv/RMLLVTC0009b/people.json new file mode 100644 index 00000000..35085f72 --- /dev/null +++ b/src/test/resources/rml-lv/RMLLVTC0009b/people.json @@ -0,0 +1,19 @@ +{ + "people": [ + { + "givenName": "alice", + "familyName": "smith", + "items": [ + "sword", + "shield" + ] + }, + { + "givenName": "bob", + "familyName": "johnson", + "items": [ + "flower" + ] + } + ] +} diff --git a/src/test/resources/rml-lv/RMLLVTC0009c/README.md b/src/test/resources/rml-lv/RMLLVTC0009c/README.md new file mode 100644 index 00000000..88b86d15 --- /dev/null +++ b/src/test/resources/rml-lv/RMLLVTC0009c/README.md @@ -0,0 +1,156 @@ +## RMLLVTC0009c + +**Title**: Name collision: between Fields from different Joins + +**Description**: Test a name collision between fields from different joins + +**Error expected?** Yes + +**Input** +``` +{ + "people": [ + { + "name": "alice", + "items": [ + "sword", + "shield" + ] + }, + { + "name": "bob", + "items": [ + "flower" + ] + } + ] +} + +``` + +**Input 1** +``` +name,id +alice,123 +bob,456 +tobias,789 + +``` + +**Input 2** +``` +name,item +alice,lantern +bob,leaf +``` + +**Mapping** +``` +@prefix rml: . +@prefix xsd: . +@prefix : . + +:jsonSource a rml:LogicalSource ; + rml:source [ + a rml:RelativePathSource , rml:Source ; + rml:root rml:MappingDirectory ; + rml:path "people.json" ; + ] ; + rml:referenceFormulation rml:JSONPath ; + rml:iterator "$.people[*]" . + +:jsonView a rml:LogicalView ; + rml:viewOn :jsonSource ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "name" ; + rml:reference "$.name" ; + ] ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "jsonitem" ; + rml:reference "$.items[*]" ; + ] . + +:additionalCsvSource a rml:LogicalSource ; + rml:source [ + a rml:RelativePathSource , rml:Source ; + rml:root rml:MappingDirectory ; + rml:path "people2.csv" ; + ] ; + rml:referenceFormulation rml:CSV . + +:additionalCsvView a rml:LogicalView ; + rml:viewOn :additionalCsvSource ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "name" ; + rml:reference "name" ; + ] ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "csvitem" ; + rml:reference "item" ; + ] ; +. + +:csvSource a rml:LogicalSource ; + rml:source [ + a rml:RelativePathSource , rml:Source ; + rml:root rml:MappingDirectory ; + rml:path "people.csv" ; + ] ; + rml:referenceFormulation rml:CSV . + +:csvView a rml:LogicalView ; + rml:viewOn :csvSource ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "name" ; + rml:reference "name" ; + ] ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "id" ; + rml:reference "id" ; + ] ; + rml:leftJoin [ + rml:parentLogicalView :jsonView ; + rml:joinCondition [ + rml:parent "name" ; + rml:child "name" ; + ] ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "item" ; + rml:reference "jsonitem" ; + ] ; + ] ; + rml:leftJoin [ + rml:parentLogicalView :additionalCsvView ; + rml:joinCondition [ + rml:parent "name" ; + rml:child "name" ; + ] ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "item" ; + rml:reference "csvitem" ; + ] ; + ] . + + +:triplesMapPerson a rml:TriplesMap ; + rml:logicalSource :csvView ; + rml:subjectMap [ + rml:template "http://example.org/person/{id}" ; + ] ; + rml:predicateObjectMap [ + rml:predicate :hasItem ; + rml:objectMap [ + rml:template "http://example.org/person/{id}/item/{item}" ; + ] ; + ] . + +``` + diff --git a/src/test/resources/rml-lv/RMLLVTC0009c/mapping.ttl b/src/test/resources/rml-lv/RMLLVTC0009c/mapping.ttl new file mode 100644 index 00000000..b5695694 --- /dev/null +++ b/src/test/resources/rml-lv/RMLLVTC0009c/mapping.ttl @@ -0,0 +1,105 @@ +@prefix rml: . +@prefix xsd: . +@prefix : . + +:jsonSource a rml:LogicalSource ; + rml:source [ + a rml:RelativePathSource , rml:Source ; + rml:root rml:MappingDirectory ; + rml:path "people.json" ; + ] ; + rml:referenceFormulation rml:JSONPath ; + rml:iterator "$.people[*]" . + +:jsonView a rml:LogicalView ; + rml:viewOn :jsonSource ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "name" ; + rml:reference "$.name" ; + ] ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "jsonitem" ; + rml:reference "$.items[*]" ; + ] . + +:additionalCsvSource a rml:LogicalSource ; + rml:source [ + a rml:RelativePathSource , rml:Source ; + rml:root rml:MappingDirectory ; + rml:path "people2.csv" ; + ] ; + rml:referenceFormulation rml:CSV . + +:additionalCsvView a rml:LogicalView ; + rml:viewOn :additionalCsvSource ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "name" ; + rml:reference "name" ; + ] ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "csvitem" ; + rml:reference "item" ; + ] ; +. + +:csvSource a rml:LogicalSource ; + rml:source [ + a rml:RelativePathSource , rml:Source ; + rml:root rml:MappingDirectory ; + rml:path "people.csv" ; + ] ; + rml:referenceFormulation rml:CSV . + +:csvView a rml:LogicalView ; + rml:viewOn :csvSource ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "name" ; + rml:reference "name" ; + ] ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "id" ; + rml:reference "id" ; + ] ; + rml:leftJoin [ + rml:parentLogicalView :jsonView ; + rml:joinCondition [ + rml:parent "name" ; + rml:child "name" ; + ] ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "item" ; + rml:reference "jsonitem" ; + ] ; + ] ; + rml:leftJoin [ + rml:parentLogicalView :additionalCsvView ; + rml:joinCondition [ + rml:parent "name" ; + rml:child "name" ; + ] ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "item" ; + rml:reference "csvitem" ; + ] ; + ] . + + +:triplesMapPerson a rml:TriplesMap ; + rml:logicalSource :csvView ; + rml:subjectMap [ + rml:template "http://example.org/person/{id}" ; + ] ; + rml:predicateObjectMap [ + rml:predicate :hasItem ; + rml:objectMap [ + rml:template "http://example.org/person/{id}/item/{item}" ; + ] ; + ] . diff --git a/src/test/resources/rml-lv/RMLLVTC0009c/people.csv b/src/test/resources/rml-lv/RMLLVTC0009c/people.csv new file mode 100644 index 00000000..103cc9b0 --- /dev/null +++ b/src/test/resources/rml-lv/RMLLVTC0009c/people.csv @@ -0,0 +1,4 @@ +name,id +alice,123 +bob,456 +tobias,789 diff --git a/src/test/resources/rml-lv/RMLLVTC0009c/people.json b/src/test/resources/rml-lv/RMLLVTC0009c/people.json new file mode 100644 index 00000000..c2fd489f --- /dev/null +++ b/src/test/resources/rml-lv/RMLLVTC0009c/people.json @@ -0,0 +1,17 @@ +{ + "people": [ + { + "name": "alice", + "items": [ + "sword", + "shield" + ] + }, + { + "name": "bob", + "items": [ + "flower" + ] + } + ] +} diff --git a/src/test/resources/rml-lv/RMLLVTC0009c/people2.csv b/src/test/resources/rml-lv/RMLLVTC0009c/people2.csv new file mode 100644 index 00000000..54d25229 --- /dev/null +++ b/src/test/resources/rml-lv/RMLLVTC0009c/people2.csv @@ -0,0 +1,3 @@ +name,item +alice,lantern +bob,leaf \ No newline at end of file diff --git a/src/test/resources/rml-lv/config.js b/src/test/resources/rml-lv/config.js new file mode 100644 index 00000000..7973ff32 --- /dev/null +++ b/src/test/resources/rml-lv/config.js @@ -0,0 +1,87 @@ +async function loadTurtle() { + //this is the function you call in 'preProcess', to load the highlighter + const worker = await new Promise(resolve => { + require(["core/worker"], ({ worker }) => resolve(worker)); + }); + const action = "highlight-load-lang"; + const langURL = + "https://cdn.jsdelivr.net/gh/redmer/highlightjs-turtle/src/languages/turtle.js"; + const propName = "hljsDefineTurtle"; // This funtion is defined in the highlighter being loaded + const lang = "turtle"; // this is the class you use to identify the language + worker.postMessage({ action, langURL, propName, lang }); + return new Promise(resolve => { + worker.addEventListener("message", function listener({ data }) { + const { action: responseAction, lang: responseLang } = data; + if (responseAction === action && responseLang === lang) { + worker.removeEventListener("message", listener); + resolve(); + } + }); + }); +} + +var respecConfig = { + // check https://respec.org/docs/ for the meaning of these keys + preProcess: [loadTurtle], + authors: [ + { + name: "Pano Maria", + mailto: "pano@skemu.com", + url: "https://panomaria.com", + company: "Skemu", + companyURL: "https://skemu.com" + }, + { + name: "Els de Vleeschauwer", + mailto: "els.devleeschauwer@ugent.be", + company: "Ghent University – imec – IDLab", + orcidid: "0000-0002-8630-3947", + companyURL: "https://idlab.technology/" + } + ], + edDraftURI: "https://w3id.org/rml/lv/test-cases/", + editors: [ + { + name: "Pano Maria", + mailto: "pano@skemu.com", + url: "https://panomaria.com", + company: "Skemu", + companyURL: "https://skemu.com" + }, + { + name: "Els de Vleeschauwer", + mailto: "els.devleeschauwer@ugent.be", + company: "Ghent University – imec – IDLab", + orcidid: "0000-0002-8630-3947", + companyURL: "https://idlab.technology/" + } + ], + formerEditors: [ + ], + github: "https://github.com/kg-construct/rml-lv", + license: "w3c-software-doc", + localBiblio: { + "RML-Core": { + title: "RML-Core", + href: "https://w3id.org/rml/core/spec", + status: "Draft Community Group Report", + publisher: "W3C", + date: "07 August 2024", + }, + "RML-IO": { + title: "RML-IO", + href: "https://w3id.org/rml/io/spec", + status: "Draft Community Group Report", + publisher: "W3C", + date: "12 March 2024", + }, + }, + publishDate: "2025-08-05", + otherLinks: [], + shortName: "RML-LV-Testcases", + specStatus: "CG-DRAFT", + // W3C config + copyrightStart: "2024", + doJsonLd: true, + group: "kg-construct", +}; diff --git a/src/test/resources/rml-lv/descriptions.csv b/src/test/resources/rml-lv/descriptions.csv new file mode 100644 index 00000000..f95d42af --- /dev/null +++ b/src/test/resources/rml-lv/descriptions.csv @@ -0,0 +1,41 @@ +RML ID,Title,Purpose,"Error +expected?","Input +1","Input +2","Input +3","Output +default","Output +1","Output +2","Output +3",Comment +RMLLVTC0000a,Logical view on JSON source,Test a view on a hierarchical source,no,people.json,,,output.nq,,,, +RMLLVTC0000b,Logical view on CSV source,Test a view on a tabular source,no,people.csv,,,output.nq,,,, +RMLLVTC0000c,Logical View on Logical View,Test a view on a logical view,no,people.json,,,output.nq,,,, +RMLLVTC0001a,Expression Field: Reference,Test a reference in an expression field,no,people.json,,,output.nq,,,, +RMLLVTC0001b,Expression Field: Template,Test a template in an expression field,no,people.json,,,output.nq,,,, +RMLLVTC0001c,Expression Field: Constant,Test a constant expression in an expression field,no,people.json,,,output.nq,,,, +RMLLVTC0001d,Expression Field Siblings,Test multiple expression fields with the same parent,no,people.json,,,output.nq,,,, +RMLLVTC0002a,Iterable Field,Test a nested field construction: iterable field with expression field as child,no,people.json,,,output.nq,,,, +RMLLVTC0002b,Iterable Field with Multiple Children,Test a nested field construction: iterable field with mulitple expression fields as children,no,people.json,,,output.nq,,,, +RMLLVTC0002c,Nested Iterable Fields,Test a nested field construction: iterable field with an iterable field as child,no,people.json,,,output.nq,,,, +RMLLVTC0003a,Index Key: #,Test a reference to the index key #,no,people.json,,,output.nq,,,, +RMLLVTC0003b,Index Key: Iterable Field,Test a reference to the index key of an iterable field,no,people.json,,,output.nq,,,, +RMLLVTC0003c,Index Key: Expression field,Test a reference to the index key of an expression field,no,people.json,,,output.nq,,,, +RMLLVTC0004a,Natural Datatype: Index #,Test the natural datatype mapping for the index #,no,people.json,,,output.nq,,,, +RMLLVTC0004b,Natural Datatype: Index Expression Field,Test the natural datatype mapping for the index of an expression field,no,people.json,,,output.nq,,,, +RMLLVTC0004c,Natural Datatype: Index Iterable Field,Test the natural datatype mapping for the index of an iterable field,no,people.json,,,output.nq,,,, +RMLLVTC0004d,Natural Datatype: Record Expression Field,Test the natural datatype mapping for a record of an expression field,no,people.json,,,output.nq,,,, +RMLLVTC0005a,Referencing a Non-Existing Key,Test a reference to a non-existing key,yes,people.json,,,,,,, +RMLLVTC0005b,Referencing the Record Key ,Test a reference to the record key ,yes,people.json,,,,,,, +RMLLVTC0005c,Referencing the Record Key of an Iterable Field,Test a reference to the record key of an iterable field,yes,people.json,,,,,,, +RMLLVTC0006a,Left Join,Test a left join,no,people.json,people.csv,,output.nq,,,, +RMLLVTC0006b,Inner Join,Test an inner join,no,people.json,people.csv,,output.nq,,,, +RMLLVTC0006c,Two Left Joins,Test two left joins in one logical view,no,people.json,people.csv,people2.csv,output.nq,,,, +RMLLVTC0006d,Inner Join and Left Join,Test an inner join and a left join in one logical view,no,people.json,people.csv,people2.csv,output.nq,,,, +RMLLVTC0006e,Two Inner Joins,Test two left joins in one logical view,no,people.json,people.csv,people2.csv,output.nq,,,, +RMLLVTC0006f,Index Key of Field in Join,Test references to indexes of fields from a join,no,people.json,people.csv,,output.nq,,,, +RMLLVTC0007a,Change Reference Formulations: CSV including JSON array,Test a change of reference formulations: csv source including json array,no,people.csv,,,output.nq,,,, +RMLLVTC0007b,Change Reference Formulations: CSV including JSON object,Test a change of reference formulations: csv source including json object,no,people.csv,,,output.nq,,,, +RMLLVTC0007c,Change Reference Formulations: JSON including CSV,Test a change of reference formulations: json source including csv data,no,people.json,,,output.nq,,,, +RMLLVTC0008a,Cycle: Abstract Logical Source,Test a cycle in the abstract logical source of a logical view,yes,,,,,,,, +RMLLVTC0008b,Cycle: Joins,Test a cycle in two joins of two logical views,yes,people.json,people.csv,,,,,, +RMLLVTC0008c,Cycle: Self-Join,Test a cycle in a join of a logical view: self-join,yes,people.json,people.csv,,,,,, diff --git a/src/test/resources/rml-lv/dev.html b/src/test/resources/rml-lv/dev.html new file mode 100644 index 00000000..9868a5e3 --- /dev/null +++ b/src/test/resources/rml-lv/dev.html @@ -0,0 +1,133 @@ + + + + + RML-LV: Test Cases + + + + + + + + + + +
+ +
+ +
+ +
+ +
+ + +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ + + + + diff --git a/src/test/resources/rml-lv/docs/20250130/index.html b/src/test/resources/rml-lv/docs/20250130/index.html new file mode 100644 index 00000000..ac943f89 --- /dev/null +++ b/src/test/resources/rml-lv/docs/20250130/index.html @@ -0,0 +1,1742 @@ + + + + + + +RML-LV: Test Cases + + + + + + + + + + + + + + +
+ +

RML-LV: Test Cases

+

+ Draft Community Group Report + +

+
+ +
Latest published version:
+ https://www.w3.org/RML-LV-Testcases/ +
+
Latest editor's draft:
https://w3id.org/rml/lv/test-cases/
+ + + + +
Editor:
+ Dylan Van Assche + + + + (IDLab – Ghent University – imec) +
+ +
Author:
+ Dylan Van Assche + + + + (IDLab – Ghent University – imec) +
+
Feedback:
+ GitHub kg-construct/rml-io + (pull requests, + new issue, + open issues) +
+ +
+ + +
+
+ + + +

Abstract

This document defines the RML-LV test cases to the determine the RML-LV specification conformance of tools.

+
+ +

Status of This Document

+ This specification was published by the + Knowledge Graph Construction Community Group. It is not a W3C Standard nor is it + on the W3C Standards Track. + + Please note that under the + W3C Community Contributor License Agreement (CLA) + there is a limited opt-out and other conditions apply. + + Learn more about + W3C Community and Business Groups. +

+ GitHub Issues are preferred for + discussion of this specification. + + +

+ +

1. Introduction

+

This document defines the RML-LV test cases, consisting of a collection of test case documents (input and expected output). +The purpose of the test cases is to determine the conformance of tools that execute RML rules to the RML-LV specification.

+
+ +

2. Data model

+

The test cases are semantically described for re-usability and shareability following the W3C Test case description. +Each test:Testcase as the following properties:

+
    +
  • dcterms:identifier: unique ID of the test case.
  • +
  • rmltest:hasError: if an error of the RML Processor is expected or not.
  • +
  • rmltest:input: One or more input data of the test case.
  • +
  • rmltest:output: One or more output data of the test case.
  • +
  • rmltest:inputFormat: the input data format.
  • +
  • rmltest:outputFormat: the output data format.
  • +
  • rmltest:mappingDocument: the RML mapping rules in Turtle.
  • +
+
+ +

3. Test cases

+

This section describes the RML-LV test cases. These descriptions are also available as RDF. +The files are available on GitHub in the folder test-cases. +Each test case is contained in a single folder, containing three types of files:

+
    +
  • Zero or more files containing the data sources, in the case of JSON, XML, CSV, or containing the SQL statements to create the necessary tables, in the case of MySQL, PostgreSQL, and SQL Server.
  • +
  • One file with the RML rules, called mapping.ttl, in the Turtle format.
  • +
  • Zero or more files with the expected RDF. No file is provided if an error is expected that must halt the generation of the RDF because of an error.
  • +
+
+ + +

4. RMLLVTC0001

+

Title: Expression Field

+

Description: Test expression field

+

Error expected? No

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "items": [
+        {
+          "type": "sword",
+          "weight": 1500
+        },
+        {
+          "type": "shield",
+          "weight": 2500
+        }
+      ]
+    },
+    {
+      "name": "bob",
+      "items": [
+        {
+          "type": "flower",
+          "weight": 15
+        }
+      ]
+    }
+  ]
+}
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+  rml:viewOn :jsonSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+  ] .
+
+:triplesMapPerson a rml:TriplesMap ;
+  rml:logicalSource :jsonView ;
+  rml:subjectMap [
+    rml:template "http://example.org/people/{name}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasName ;
+    rml:objectMap [
+      rml:reference "name" ;
+    ] ;
+  ] .
+
+

Output

+
<http://example.org/people/alice> <http://example.org/hasName> "alice" .
+<http://example.org/people/bob> <http://example.org/hasName> "bob" .
+
+
+

5. RMLLVTC0002

+

Title: Iterable Field

+

Description: Test nested expression field, with iterable field as parent

+

Error expected? No

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "items": [
+        {
+          "type": "sword",
+          "weight": 1500
+        },
+        {
+          "type": "shield",
+          "weight": 2500
+        }
+      ]
+    },
+    {
+      "name": "bob",
+      "items": [
+        {
+          "type": "flower",
+          "weight": 15
+        }
+      ]
+    }
+  ]
+}
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+  rml:viewOn :jsonSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+  ] ;
+  rml:field [
+    a rml:IterableField ;
+    rml:fieldName "item" ;
+    rml:iterator "$.items[*]" ;
+    rml:field [
+      a rml:ExpressionField ;
+      rml:fieldName "type" ;
+      rml:reference "$.type" ;
+    ] ;
+    rml:field [
+      a rml:ExpressionField ;
+      rml:fieldName "weight" ;
+      rml:reference "$.weight" ;
+    ] ;
+  ] .
+
+:triplesMapPerson a rml:TriplesMap ;
+  rml:logicalSource :jsonView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{name}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasName ;
+    rml:objectMap [
+      rml:reference "name" ;
+    ] ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasItem ;
+    rml:objectMap [
+      rml:parentTriplesMap :triplesMapItem ;
+    ] ;
+  ] .
+
+:triplesMapItem a rml:TriplesMap ;
+  rml:logicalSource :jsonView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{name}/item/{item.type}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasName ;
+    rml:objectMap [
+      rml:reference "item.type" ;
+    ] ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasWeight ;
+    rml:objectMap [
+      rml:reference "item.weight" ;
+      rml:datatype xsd:integer ;
+    ] ;
+  ] .
+
+

Output

+
<http://example.org/person/alice> <http://example.org/hasName> "alice" .
+<http://example.org/person/alice> <http://example.org/hasItem> <http://example.org/person/alice/item/sword> .
+<http://example.org/person/alice> <http://example.org/hasItem> <http://example.org/person/alice/item/shield> .
+<http://example.org/person/bob> <http://example.org/hasName> "bob" .
+<http://example.org/person/bob> <http://example.org/hasItem> <http://example.org/person/bob/item/flower> .
+<http://example.org/person/alice/item/sword> <http://example.org/hasName> "sword" .
+<http://example.org/person/alice/item/sword> <http://example.org/hasWeight> "1500"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.org/person/alice/item/shield> <http://example.org/hasName> "shield" .
+<http://example.org/person/alice/item/shield> <http://example.org/hasWeight> "2500"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.org/person/bob/item/flower> <http://example.org/hasName> "flower" .
+<http://example.org/person/bob/item/flower> <http://example.org/hasWeight> "15"^^<http://www.w3.org/2001/XMLSchema#integer> .
+
+
+

6. RMLLVTC0003

+

Title: Left Join

+

Description: Test left join

+

Error expected? No

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "items": [
+        {
+          "type": "sword",
+          "weight": 1500
+        },
+        {
+          "type": "shield",
+          "weight": 2500
+        }
+      ]
+    },
+    {
+      "name": "bob",
+      "items": [
+        {
+          "type": "flower",
+          "weight": 15
+        }
+      ]
+    }
+  ]
+}
+
+

Input 1

+
name,birthyear
+alice,1995
+bob,1999
+tobias,2005
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+  rml:viewOn :jsonSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+  ] ;
+  rml:field [
+    a rml:IterableField ;
+    rml:fieldName "item" ;
+    rml:iterator "$.items[*]" ;
+    rml:field [
+      a rml:ExpressionField ;
+      rml:fieldName "type" ;
+      rml:reference "$.type" ;
+    ] ;
+    rml:field [
+      a rml:ExpressionField ;
+      rml:fieldName "weight" ;
+      rml:reference "$.weight" ;
+    ] ;
+  ] .
+
+:csvSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.csv" ;
+  ] ;
+  rml:referenceFormulation rml:CSV .
+
+:csvView a rml:LogicalView ;
+  rml:viewOn :csvSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "name" ;
+  ] ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "birthyear" ;
+    rml:reference "birthyear" ;
+  ] ;
+  rml:leftJoin [
+    rml:parentLogicalView :jsonView ;
+    rml:joinCondition [
+      rml:parent "name" ;
+      rml:child "name" ;
+    ] ;
+    rml:field [
+      a rml:ExpressionField ;
+      rml:fieldName "item_type" ;
+      rml:reference "item.type" ;
+    ] ;
+    rml:field [
+      a rml:ExpressionField ;
+      rml:fieldName "item_weight" ;
+      rml:reference "item.weight" ;
+    ] ;
+  ] .
+
+
+:triplesMapPerson a rml:TriplesMap ;
+  rml:logicalSource :csvView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{name}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasName ;
+    rml:objectMap [
+      rml:reference "name" ;
+    ] ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasBirthyear ;
+    rml:objectMap [
+      rml:reference "birthyear" ;
+      rml:datatype xsd:gYear ;
+    ] ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasItem ;
+    rml:objectMap [
+      rml:parentTriplesMap :triplesMapItem ;
+    ] ;
+  ] .
+
+:triplesMapItem a rml:TriplesMap ;
+  rml:logicalSource :csvView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{name}/item/{item_type}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasType ;
+    rml:objectMap [
+      rml:reference "item_type" ;
+    ] ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasWeight ;
+    rml:objectMap [
+      rml:reference "item_weight" ;
+      rml:datatype xsd:integer ;
+    ] ;
+  ] .
+
+

Output

+
<http://example.org/person/alice> <http://example.org/hasName> "alice" .
+<http://example.org/person/alice> <http://example.org/hasBirthyear> "1995"^^<http://www.w3.org/2001/XMLSchema#gYear> .
+<http://example.org/person/alice> <http://example.org/hasItem> <http://example.org/person/alice/item/sword> .
+<http://example.org/person/alice> <http://example.org/hasItem> <http://example.org/person/alice/item/shield> .
+<http://example.org/person/alice/item/sword> <http://example.org/hasType> "sword" .
+<http://example.org/person/alice/item/sword> <http://example.org/hasWeight> "1500"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.org/person/alice/item/shield> <http://example.org/hasType> "shield" .
+<http://example.org/person/alice/item/shield> <http://example.org/hasWeight> "2500"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.org/person/bob> <http://example.org/hasName> "bob" .
+<http://example.org/person/bob> <http://example.org/hasBirthyear> "1999"^^<http://www.w3.org/2001/XMLSchema#gYear> .
+<http://example.org/person/bob> <http://example.org/hasItem> <http://example.org/person/bob/item/flower> .
+<http://example.org/person/bob/item/flower> <http://example.org/hasType> "flower" .
+<http://example.org/person/bob/item/flower> <http://example.org/hasWeight> "15"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.org/person/tobias> <http://example.org/hasName> "tobias" .
+<http://example.org/person/tobias> <http://example.org/hasBirthyear> "2005"^^<http://www.w3.org/2001/XMLSchema#gYear> .
+
+
+

7. RMLLVTC0004

+

Title: Inner Join

+

Description: Test inner join

+

Error expected? No

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "items": [
+        {
+          "type": "sword",
+          "weight": 1500
+        },
+        {
+          "type": "shield",
+          "weight": 2500
+        }
+      ]
+    },
+    {
+      "name": "bob",
+      "items": [
+        {
+          "type": "flower",
+          "weight": 15
+        }
+      ]
+    }
+  ]
+}
+
+

Input 1

+
name,birthyear
+alice,1995
+bob,1999
+tobias,2005
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+  rml:viewOn :jsonSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+  ] ;
+  rml:field [
+    a rml:IterableField ;
+    rml:fieldName "item" ;
+    rml:iterator "$.items[*]" ;
+    rml:field [
+      a rml:ExpressionField ;
+      rml:fieldName "type" ;
+      rml:reference "$.type" ;
+    ] ;
+    rml:field [
+      a rml:ExpressionField ;
+      rml:fieldName "weight" ;
+      rml:reference "$.weight" ;
+    ] ;
+  ] .
+
+:csvSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.csv" ;
+  ] ;
+  rml:referenceFormulation rml:CSV .
+
+:csvView a rml:LogicalView ;
+  rml:viewOn :csvSource ;
+  rml:field [ a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "name" ;
+  ] ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "birthyear" ;
+    rml:reference "birthyear" ;
+  ] ;
+  rml:innerJoin [
+    rml:parentLogicalView :jsonView ;
+    rml:joinCondition [
+      rml:parent "name" ;
+      rml:child "name" ;
+    ] ;
+    rml:field [
+      a rml:ExpressionField ;
+      rml:fieldName "item_type" ;
+      rml:reference "item.type" ;
+    ] ;
+    rml:field [
+      a rml:ExpressionField ;
+      rml:fieldName "item_weight" ;
+      rml:reference "item.weight" ;
+    ] ;
+  ] .
+
+
+:triplesMapPerson a rml:TriplesMap ;
+  rml:logicalSource :csvView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{name}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasName ;
+    rml:objectMap [
+      rml:reference "name" ;
+    ] ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasBirthyear ;
+    rml:objectMap [
+      rml:reference "birthyear" ;
+      rml:datatype xsd:gYear ;
+    ] ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasItem ;
+    rml:objectMap [
+      rml:parentTriplesMap :triplesMapItem ;
+    ] ;
+  ] .
+
+:triplesMapItem a rml:TriplesMap ;
+  rml:logicalSource :csvView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{name}/item/{item_type}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasType ;
+    rml:objectMap [
+      rml:reference "item_type" ;
+    ] ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasWeight ;
+    rml:objectMap [
+      rml:reference "item_weight" ;
+      rml:datatype xsd:integer ;
+    ] ;
+  ] .
+
+

Output

+
<http://example.org/person/alice> <http://example.org/hasName> "alice" .
+<http://example.org/person/alice> <http://example.org/hasBirthyear> "1995"^^<http://www.w3.org/2001/XMLSchema#gYear> .
+<http://example.org/person/alice> <http://example.org/hasItem> <http://example.org/person/alice/item/sword> .
+<http://example.org/person/alice> <http://example.org/hasItem> <http://example.org/person/alice/item/shield> .
+<http://example.org/person/alice/item/sword> <http://example.org/hasType> "sword" .
+<http://example.org/person/alice/item/sword> <http://example.org/hasWeight> "1500"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.org/person/alice/item/shield> <http://example.org/hasType> "shield" .
+<http://example.org/person/alice/item/shield> <http://example.org/hasWeight> "2500"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.org/person/bob> <http://example.org/hasName> "bob" .
+<http://example.org/person/bob> <http://example.org/hasBirthyear> "1999"^^<http://www.w3.org/2001/XMLSchema#gYear> .
+<http://example.org/person/bob> <http://example.org/hasItem> <http://example.org/person/bob/item/flower> .
+<http://example.org/person/bob/item/flower> <http://example.org/hasType> "flower" .
+<http://example.org/person/bob/item/flower> <http://example.org/hasWeight> "15"^^<http://www.w3.org/2001/XMLSchema#integer> .
+
+
+

8. RMLLVTC0005

+

Title: Index

+

Description: Test references to index keys, including joins

+

Error expected? No

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "items": [
+        {
+          "type": "sword",
+          "weight": 1500
+        },
+        {
+          "type": "shield",
+          "weight": 2500
+        }
+      ]
+    },
+    {
+      "name": "bob",
+      "items": [
+        {
+          "type": "flower",
+          "weight": 15
+        }
+      ]
+    }
+  ]
+}
+
+

Input 1

+
name,birthyear
+alice,1995
+bob,1999
+tobias,2005
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+  rml:viewOn :jsonSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+  ] ;
+  rml:field [
+    a rml:IterableField ;
+    rml:fieldName "item" ;
+    rml:iterator "$.items[*]" ;
+    rml:field [
+      a rml:ExpressionField ;
+      rml:fieldName "type" ;
+      rml:reference "$.type" ;
+    ] ;
+    rml:field [
+      a rml:ExpressionField ;
+      rml:fieldName "weight" ;
+      rml:reference "$.weight" ;
+    ] ;
+  ] .
+
+:csvSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.csv" ;
+  ] ;
+  rml:referenceFormulation rml:CSV .
+
+:csvView a rml:LogicalView ;
+  rml:viewOn :csvSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "name" ;
+  ] ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "birthyear" ;
+    rml:reference "birthyear" ;
+  ] ;
+  rml:innerJoin [
+    rml:parentLogicalView :jsonView ;
+    rml:joinCondition [
+      rml:parent "name" ;
+      rml:child "name" ;
+    ] ;
+    rml:field [
+      a rml:ExpressionField ;
+      rml:fieldName "item_type" ;
+      rml:reference "item.type" ;
+    ] ;
+    rml:field [
+      a rml:ExpressionField ;
+      rml:fieldName "item_weight" ;
+      rml:reference "item.weight" ;
+    ] ;
+  ] .
+
+:triplesMapPerson a rml:TriplesMap ;
+  rml:logicalSource :csvView ;
+  rml:subjectMap [
+    rml:template "http://example.org/people/{name}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasName ;
+    rml:objectMap [
+      rml:reference "name" ;
+    ] ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasBirthyear ;
+    rml:objectMap [
+      rml:reference "birthyear" ;
+      rml:datatype xsd:gYear ;
+    ] ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasItem ;
+    rml:objectMap [
+      rml:parentTriplesMap :triplesMapItem ;
+    ] ;
+  ] .
+
+:triplesMapItem a rml:TriplesMap ;
+  rml:logicalSource :csvView ;
+  rml:subjectMap [
+    rml:template "item_{#}_{item_type.#}" ;
+    rml:termType rml:BlankNode ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasType ;
+    rml:objectMap [
+      rml:reference "item_type" ;
+    ] ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasWeight ;
+    rml:objectMap [
+      rml:reference "item_weight" ;
+      rml:datatype xsd:integer ;
+    ] ;
+  ] .
+
+

Output

+
<http://example.org/people/alice> <http://example.org/hasName> "alice" .
+<http://example.org/people/alice> <http://example.org/hasBirthyear> "1995"^^<http://www.w3.org/2001/XMLSchema#gYear> .
+<http://example.org/people/alice> <http://example.org/hasItem> _:item_0_0 .
+<http://example.org/people/alice> <http://example.org/hasItem> _:item_0_1 .
+_:item_0_0 <http://example.org/hasType> "sword" .
+_:item_0_0 <http://example.org/hasWeight> "1500"^^<http://www.w3.org/2001/XMLSchema#integer> .
+_:item_0_1 <http://example.org/hasType> "shield" .
+_:item_0_1 <http://example.org/hasWeight> "2500"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.org/people/bob> <http://example.org/hasName> "bob" .
+<http://example.org/people/bob> <http://example.org/hasBirthyear> "1999"^^<http://www.w3.org/2001/XMLSchema#gYear> .
+<http://example.org/people/bob> <http://example.org/hasItem> _:item_1_0 .
+_:item_1_0 <http://example.org/hasType> "flower" .
+_:item_1_0 <http://example.org/hasWeight> "15"^^<http://www.w3.org/2001/XMLSchema#integer> .
+
+
+

9. RMLLVTC0006

+

Title: Change Reference Formulations: CSV, including JSON array

+

Description: Test a change of reference formulations: csv source including json array

+

Error expected? No

+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+
+:mixedCSVSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.csv" ;
+  ] ;
+  rml:referenceFormulation rml:CSV .
+
+:mixedCSVView a rml:LogicalView ;
+  rml:viewOn :mixedCSVSource ;
+  rml:field [
+    a rml:ExpressionField;
+    rml:fieldName "name" ;
+    rml:reference "name" ;
+  ] ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "items" ;
+    rml:reference "items" ;
+    rml:field [
+      a rml:IterableField ;
+      rml:referenceFormulation rml:JSONPath ;
+      rml:iterator "$[*]" ;
+      rml:fieldName "item" ;
+      rml:field [
+        a rml:ExpressionField ;
+        rml:fieldName "type" ;
+        rml:reference "$.type" ;
+      ] ;
+      rml:field [
+        a rml:ExpressionField ;
+        rml:fieldName "weight" ;
+        rml:reference "$.weight" ;
+      ] ;
+    ] ;
+  ] .
+
+:triplesMapItem a rml:TriplesMap ;
+  rml:logicalSource :mixedCSVView ;
+  rml:subjectMap [
+    rml:template "http://example.org/item_{#}_{items.item.#}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasType ;
+    rml:objectMap [
+      rml:reference "items.item.type" ;
+    ] ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasWeight ;
+    rml:objectMap [
+      rml:reference "items.item.weight" ;
+      rml:datatype xsd:integer ;
+    ] ;
+  ] .
+
+

Output

+
<http://example.org/item_0_0> <http://example.org/hasType> "sword" .
+<http://example.org/item_0_0> <http://example.org/hasWeight> "1500"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.org/item_0_1> <http://example.org/hasType> "shield" .
+<http://example.org/item_0_1> <http://example.org/hasWeight> "2500"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.org/item_1_0> <http://example.org/hasType> "flower" .
+<http://example.org/item_1_0> <http://example.org/hasWeight> "15"^^<http://www.w3.org/2001/XMLSchema#integer> .
+
+
+

10. RMLLVTC0007

+

Title: Change Reference Formulations: CSV including JSON object

+

Description: Test a change of reference formulations: csv source including json object

+

Error expected? No

+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+
+:mixedCSVSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.csv" ;
+  ] ;
+  rml:referenceFormulation rml:CSV .
+
+:mixedCSVView a rml:LogicalView ;
+  rml:viewOn :mixedCSVSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "name" ;
+  ] ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "item" ;
+    rml:reference "item" ;
+    rml:field [
+      a rml:IterableField ;
+      rml:referenceFormulation rml:JSONPath ;
+      rml:iterator "$[*]" ;
+      rml:fieldName "itemJson" ;
+      rml:field [
+        a rml:ExpressionField;
+        rml:fieldName "type" ;
+        rml:reference "$.type" ; ] ;
+      rml:field [
+        a rml:ExpressionField;
+        rml:fieldName "weight" ;
+        rml:reference "$.weight" ;
+      ] ;
+    ] ;
+  ] .
+
+:triplesMapItem a rml:TriplesMap ;
+  rml:logicalSource :mixedCSVView ;
+  rml:subjectMap [
+    rml:template "http://example.org/item_{#}_{item.#}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasType ;
+    rml:objectMap [
+      rml:reference "item.itemJson.type" ;
+    ] ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasWeight ;
+    rml:objectMap [
+      rml:reference "item.itemJson.weight" ;
+      rml:datatype xsd:integer ;
+    ] ;
+  ] .
+
+

Output

+
<http://example.org/item_0_0> <http://example.org/hasType> "sword" .
+<http://example.org/item_0_0> <http://example.org/hasWeight> "1500"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.org/item_1_0> <http://example.org/hasType> "shield" .
+<http://example.org/item_1_0> <http://example.org/hasWeight> "2500"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.org/item_2_0> <http://example.org/hasType> "flower" .
+<http://example.org/item_2_0> <http://example.org/hasWeight> "15"^^<http://www.w3.org/2001/XMLSchema#integer> .
+
+
+

11. RMLLVTC0008

+

Title: Change Reference Formulations: JSON including CSV

+

Description: Test a change of reference formulations: json source including csv data

+

Error expected? No

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "items": "type,weight\nsword,1500\nshield,2500"
+    },
+    {
+      "name": "bob",
+      "items": "type,weight\nflower,15"
+    }
+  ]
+}
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+
+:mixedJSONSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:mixedJSONView a rml:LogicalView ;
+  rml:viewOn :mixedJSONSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+    ] ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "items" ;
+    rml:reference "$.items" ;
+    rml:field [
+      a rml:IterableField ;
+      rml:referenceFormulation rml:CSV ;
+      rml:fieldName "item";
+      rml:field [
+        a rml:ExpressionField ;
+        rml:fieldName "type" ;
+        rml:reference "type" ;
+      ] ;
+      rml:field [
+        a rml:expressionField ;
+        rml:fieldName "weight" ;
+        rml:reference "weight" ;
+      ] ;
+    ] ;
+  ].
+
+:triplesMapItem a rml:TriplesMap ;
+  rml:logicalSource :mixedJSONView ;
+  rml:subjectMap [
+    rml:template "http://example.org/item_{#}_{items.item.#}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasType ;
+    rml:objectMap [
+      rml:reference "items.item.type" ;
+    ] ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasWeight ;
+    rml:objectMap [
+      rml:reference "items.item.weight" ;
+      rml:datatype xsd:integer ;
+    ] ;
+  ] .
+
+

Output

+
<http://example.org/item_0_0> <http://example.org/hasType> "sword" .
+<http://example.org/item_0_0> <http://example.org/hasWeight> "1500"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.org/item_0_1> <http://example.org/hasType> "shield" .
+<http://example.org/item_0_1> <http://example.org/hasWeight> "2500"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.org/item_1_0> <http://example.org/hasType> "flower" .
+<http://example.org/item_1_0> <http://example.org/hasWeight> "15"^^<http://www.w3.org/2001/XMLSchema#integer> .
+
+
+

12. RMLLVTC0009

+

Title: Two Left Joins

+

Description: Test two left joins

+

Error expected? No

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "items": [
+        {
+          "type": "sword",
+          "weight": 1500
+        },
+        {
+          "type": "shield",
+          "weight": 2500
+        }
+      ]
+    },
+    {
+      "name": "bob",
+      "items": [
+        {
+          "type": "flower",
+          "weight": 15
+        }
+      ]
+    }
+  ]
+}
+
+

Input 1

+
name,birthyear
+alice,1995
+bob,1999
+tobias,2005
+
+

Input 2

+
name,id
+alice,123
+bob,456
+tobias,789
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+  rml:viewOn :jsonSource ;
+  rml:field [ a
+    rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+  ] ;
+  rml:field [
+    a rml:IterableField ;
+    rml:fieldName "item" ;
+    rml:iterator "$.items[*]" ;
+    rml:field [
+      a rml:ExpressionField ;
+      rml:fieldName "type" ;
+      rml:reference "$.type" ;
+    ] ;
+    rml:field [
+      a rml:ExpressionField ;
+      rml:fieldName "weight" ;
+      rml:reference "$.weight" ;
+    ] ;
+  ] .
+
+  :additionalCsvSource a rml:LogicalSource ;
+    rml:source [
+      a rml:RelativePathSource , rml:Source ;
+      rml:root rml:MappingDirectory ;
+      rml:path "people2.csv" ;
+    ] ;
+    rml:referenceFormulation rml:CSV .
+
+  :additionalCsvView a rml:LogicalView ;
+    rml:viewOn :additionalCsvSource ;
+    rml:field [
+      a rml:ExpressionField ;
+      rml:fieldName "name" ;
+      rml:reference "name" ;
+    ] ;
+    rml:field [
+      a rml:ExpressionField ;
+      rml:fieldName "id" ;
+      rml:reference "id" ;
+    ] ;
+    .
+
+:csvSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.csv" ;
+  ] ;
+  rml:referenceFormulation rml:CSV .
+
+:csvView a rml:LogicalView ;
+  rml:viewOn :csvSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "name" ;
+  ] ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "birthyear" ;
+    rml:reference "birthyear" ;
+  ] ;
+  rml:leftJoin [
+    rml:parentLogicalView :jsonView ;
+    rml:joinCondition [
+      rml:parent "name" ;
+      rml:child "name" ;
+    ] ;
+    rml:field [
+      a rml:ExpressionField ;
+      rml:fieldName "item_type" ;
+      rml:reference "item.type" ;
+    ] ;
+    rml:field [
+      a rml:ExpressionField ;
+      rml:fieldName "item_weight" ;
+      rml:reference "item.weight" ;
+    ] ;
+  ] ;
+  rml:leftJoin [
+    rml:parentLogicalView :additionalCsvView ;
+    rml:joinCondition [
+      rml:parent "name" ;
+      rml:child "name" ;
+    ] ;
+    rml:field [
+      a rml:ExpressionField ;
+      rml:fieldName "id" ;
+      rml:reference "id" ;
+    ] ;
+  ] .
+
+:triplesMapPerson a rml:TriplesMap ;
+  rml:logicalSource :csvView ;
+  rml:subjectMap [
+    rml:template "http://example.org/people/{id}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasName ;
+    rml:objectMap [
+      rml:reference "name" ;
+    ] ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasBirthyear ;
+    rml:objectMap [
+      rml:reference "birthyear" ;
+      rml:datatype xsd:gYear ;
+    ] ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasItem ;
+    rml:objectMap [
+      rml:parentTriplesMap :triplesMapItem ;
+    ] ;
+  ] .
+
+:triplesMapItem a rml:TriplesMap ;
+  rml:logicalSource :csvView ;
+  rml:subjectMap [
+    rml:template "http://example.org/item_{#}_{item_type.#}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasType ;
+    rml:objectMap [
+      rml:reference "item_type" ;
+    ] ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasWeight ;
+    rml:objectMap [
+      rml:reference "item_weight" ;
+      rml:datatype xsd:integer ;
+    ] ;
+  ] .
+
+

Output

+
<http://example.org/people/123> <http://example.org/hasName> "alice" .
+<http://example.org/people/123> <http://example.org/hasBirthyear> "1995"^^<http://www.w3.org/2001/XMLSchema#gYear> .
+<http://example.org/people/123> <http://example.org/hasItem> <http://example.org/item_0_0> .
+<http://example.org/people/123> <http://example.org/hasItem> <http://example.org/item_0_1> .
+<http://example.org/item_0_0> <http://example.org/hasType> "sword" .
+<http://example.org/item_0_0> <http://example.org/hasWeight> "1500"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.org/item_0_1> <http://example.org/hasType> "shield" .
+<http://example.org/item_0_1> <http://example.org/hasWeight> "2500"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.org/people/456> <http://example.org/hasName> "bob" .
+<http://example.org/people/456> <http://example.org/hasBirthyear> "1999"^^<http://www.w3.org/2001/XMLSchema#gYear> .
+<http://example.org/people/456> <http://example.org/hasItem> <http://example.org/item_1_0> .
+<http://example.org/item_1_0> <http://example.org/hasType> "flower" .
+<http://example.org/item_1_0> <http://example.org/hasWeight> "15"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.org/people/789> <http://example.org/hasName> "tobias" .
+<http://example.org/people/789> <http://example.org/hasBirthyear> "2005"^^<http://www.w3.org/2001/XMLSchema#gYear> .
+
+
+ + + + + \ No newline at end of file diff --git a/src/test/resources/rml-lv/docs/20250204/index.html b/src/test/resources/rml-lv/docs/20250204/index.html new file mode 100644 index 00000000..8fa4666e --- /dev/null +++ b/src/test/resources/rml-lv/docs/20250204/index.html @@ -0,0 +1,1742 @@ + + + + + + +RML-LV: Test Cases + + + + + + + + + + + + + + +
+ +

RML-LV: Test Cases

+

+ Draft Community Group Report + +

+
+ +
Latest published version:
+ https://www.w3.org/RML-LV-Testcases/ +
+
Latest editor's draft:
https://w3id.org/rml/lv/test-cases/
+ + + + +
Editor:
+ Dylan Van Assche + + + + (IDLab – Ghent University – imec) +
+ +
Author:
+ Dylan Van Assche + + + + (IDLab – Ghent University – imec) +
+
Feedback:
+ GitHub kg-construct/rml-lv + (pull requests, + new issue, + open issues) +
+ +
+ + +
+
+ + + +

Abstract

This document defines the RML-LV test cases to the determine the RML-LV specification conformance of tools.

+
+ +

Status of This Document

+ This specification was published by the + Knowledge Graph Construction Community Group. It is not a W3C Standard nor is it + on the W3C Standards Track. + + Please note that under the + W3C Community Contributor License Agreement (CLA) + there is a limited opt-out and other conditions apply. + + Learn more about + W3C Community and Business Groups. +

+ GitHub Issues are preferred for + discussion of this specification. + + +

+ +

1. Introduction

+

This document defines the RML-LV test cases, consisting of a collection of test case documents (input and expected output). +The purpose of the test cases is to determine the conformance of tools that execute RML rules to the RML-LV specification.

+
+ +

2. Data model

+

The test cases are semantically described for re-usability and shareability following the W3C Test case description. +Each test:Testcase as the following properties:

+
    +
  • dcterms:identifier: unique ID of the test case.
  • +
  • rmltest:hasError: if an error of the RML Processor is expected or not.
  • +
  • rmltest:input: One or more input data of the test case.
  • +
  • rmltest:output: One or more output data of the test case.
  • +
  • rmltest:inputFormat: the input data format.
  • +
  • rmltest:outputFormat: the output data format.
  • +
  • rmltest:mappingDocument: the RML mapping rules in Turtle.
  • +
+
+ +

3. Test cases

+

This section describes the RML-LV test cases. These descriptions are also available as RDF. +The files are available on GitHub in the folder test-cases. +Each test case is contained in a single folder, containing three types of files:

+
    +
  • Zero or more files containing the data sources, in the case of JSON, XML, CSV, or containing the SQL statements to create the necessary tables, in the case of MySQL, PostgreSQL, and SQL Server.
  • +
  • One file with the RML rules, called mapping.ttl, in the Turtle format.
  • +
  • Zero or more files with the expected RDF. No file is provided if an error is expected that must halt the generation of the RDF because of an error.
  • +
+
+ + +

4. RMLLVTC0001

+

Title: Expression Field

+

Description: Test expression field

+

Error expected? No

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "items": [
+        {
+          "type": "sword",
+          "weight": 1500
+        },
+        {
+          "type": "shield",
+          "weight": 2500
+        }
+      ]
+    },
+    {
+      "name": "bob",
+      "items": [
+        {
+          "type": "flower",
+          "weight": 15
+        }
+      ]
+    }
+  ]
+}
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+  rml:viewOn :jsonSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+  ] .
+
+:triplesMapPerson a rml:TriplesMap ;
+  rml:logicalSource :jsonView ;
+  rml:subjectMap [
+    rml:template "http://example.org/people/{name}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasName ;
+    rml:objectMap [
+      rml:reference "name" ;
+    ] ;
+  ] .
+
+

Output

+
<http://example.org/people/alice> <http://example.org/hasName> "alice" .
+<http://example.org/people/bob> <http://example.org/hasName> "bob" .
+
+
+

5. RMLLVTC0002

+

Title: Iterable Field

+

Description: Test nested expression field, with iterable field as parent

+

Error expected? No

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "items": [
+        {
+          "type": "sword",
+          "weight": 1500
+        },
+        {
+          "type": "shield",
+          "weight": 2500
+        }
+      ]
+    },
+    {
+      "name": "bob",
+      "items": [
+        {
+          "type": "flower",
+          "weight": 15
+        }
+      ]
+    }
+  ]
+}
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+  rml:viewOn :jsonSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+  ] ;
+  rml:field [
+    a rml:IterableField ;
+    rml:fieldName "item" ;
+    rml:iterator "$.items[*]" ;
+    rml:field [
+      a rml:ExpressionField ;
+      rml:fieldName "type" ;
+      rml:reference "$.type" ;
+    ] ;
+    rml:field [
+      a rml:ExpressionField ;
+      rml:fieldName "weight" ;
+      rml:reference "$.weight" ;
+    ] ;
+  ] .
+
+:triplesMapPerson a rml:TriplesMap ;
+  rml:logicalSource :jsonView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{name}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasName ;
+    rml:objectMap [
+      rml:reference "name" ;
+    ] ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasItem ;
+    rml:objectMap [
+      rml:parentTriplesMap :triplesMapItem ;
+    ] ;
+  ] .
+
+:triplesMapItem a rml:TriplesMap ;
+  rml:logicalSource :jsonView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{name}/item/{item.type}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasName ;
+    rml:objectMap [
+      rml:reference "item.type" ;
+    ] ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasWeight ;
+    rml:objectMap [
+      rml:reference "item.weight" ;
+      rml:datatype xsd:integer ;
+    ] ;
+  ] .
+
+

Output

+
<http://example.org/person/alice> <http://example.org/hasName> "alice" .
+<http://example.org/person/alice> <http://example.org/hasItem> <http://example.org/person/alice/item/sword> .
+<http://example.org/person/alice> <http://example.org/hasItem> <http://example.org/person/alice/item/shield> .
+<http://example.org/person/bob> <http://example.org/hasName> "bob" .
+<http://example.org/person/bob> <http://example.org/hasItem> <http://example.org/person/bob/item/flower> .
+<http://example.org/person/alice/item/sword> <http://example.org/hasName> "sword" .
+<http://example.org/person/alice/item/sword> <http://example.org/hasWeight> "1500"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.org/person/alice/item/shield> <http://example.org/hasName> "shield" .
+<http://example.org/person/alice/item/shield> <http://example.org/hasWeight> "2500"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.org/person/bob/item/flower> <http://example.org/hasName> "flower" .
+<http://example.org/person/bob/item/flower> <http://example.org/hasWeight> "15"^^<http://www.w3.org/2001/XMLSchema#integer> .
+
+
+

6. RMLLVTC0003

+

Title: Left Join

+

Description: Test left join

+

Error expected? No

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "items": [
+        {
+          "type": "sword",
+          "weight": 1500
+        },
+        {
+          "type": "shield",
+          "weight": 2500
+        }
+      ]
+    },
+    {
+      "name": "bob",
+      "items": [
+        {
+          "type": "flower",
+          "weight": 15
+        }
+      ]
+    }
+  ]
+}
+
+

Input 1

+
name,birthyear
+alice,1995
+bob,1999
+tobias,2005
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+  rml:viewOn :jsonSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+  ] ;
+  rml:field [
+    a rml:IterableField ;
+    rml:fieldName "item" ;
+    rml:iterator "$.items[*]" ;
+    rml:field [
+      a rml:ExpressionField ;
+      rml:fieldName "type" ;
+      rml:reference "$.type" ;
+    ] ;
+    rml:field [
+      a rml:ExpressionField ;
+      rml:fieldName "weight" ;
+      rml:reference "$.weight" ;
+    ] ;
+  ] .
+
+:csvSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.csv" ;
+  ] ;
+  rml:referenceFormulation rml:CSV .
+
+:csvView a rml:LogicalView ;
+  rml:viewOn :csvSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "name" ;
+  ] ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "birthyear" ;
+    rml:reference "birthyear" ;
+  ] ;
+  rml:leftJoin [
+    rml:parentLogicalView :jsonView ;
+    rml:joinCondition [
+      rml:parent "name" ;
+      rml:child "name" ;
+    ] ;
+    rml:field [
+      a rml:ExpressionField ;
+      rml:fieldName "item_type" ;
+      rml:reference "item.type" ;
+    ] ;
+    rml:field [
+      a rml:ExpressionField ;
+      rml:fieldName "item_weight" ;
+      rml:reference "item.weight" ;
+    ] ;
+  ] .
+
+
+:triplesMapPerson a rml:TriplesMap ;
+  rml:logicalSource :csvView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{name}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasName ;
+    rml:objectMap [
+      rml:reference "name" ;
+    ] ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasBirthyear ;
+    rml:objectMap [
+      rml:reference "birthyear" ;
+      rml:datatype xsd:gYear ;
+    ] ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasItem ;
+    rml:objectMap [
+      rml:parentTriplesMap :triplesMapItem ;
+    ] ;
+  ] .
+
+:triplesMapItem a rml:TriplesMap ;
+  rml:logicalSource :csvView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{name}/item/{item_type}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasType ;
+    rml:objectMap [
+      rml:reference "item_type" ;
+    ] ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasWeight ;
+    rml:objectMap [
+      rml:reference "item_weight" ;
+      rml:datatype xsd:integer ;
+    ] ;
+  ] .
+
+

Output

+
<http://example.org/person/alice> <http://example.org/hasName> "alice" .
+<http://example.org/person/alice> <http://example.org/hasBirthyear> "1995"^^<http://www.w3.org/2001/XMLSchema#gYear> .
+<http://example.org/person/alice> <http://example.org/hasItem> <http://example.org/person/alice/item/sword> .
+<http://example.org/person/alice> <http://example.org/hasItem> <http://example.org/person/alice/item/shield> .
+<http://example.org/person/alice/item/sword> <http://example.org/hasType> "sword" .
+<http://example.org/person/alice/item/sword> <http://example.org/hasWeight> "1500"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.org/person/alice/item/shield> <http://example.org/hasType> "shield" .
+<http://example.org/person/alice/item/shield> <http://example.org/hasWeight> "2500"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.org/person/bob> <http://example.org/hasName> "bob" .
+<http://example.org/person/bob> <http://example.org/hasBirthyear> "1999"^^<http://www.w3.org/2001/XMLSchema#gYear> .
+<http://example.org/person/bob> <http://example.org/hasItem> <http://example.org/person/bob/item/flower> .
+<http://example.org/person/bob/item/flower> <http://example.org/hasType> "flower" .
+<http://example.org/person/bob/item/flower> <http://example.org/hasWeight> "15"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.org/person/tobias> <http://example.org/hasName> "tobias" .
+<http://example.org/person/tobias> <http://example.org/hasBirthyear> "2005"^^<http://www.w3.org/2001/XMLSchema#gYear> .
+
+
+

7. RMLLVTC0004

+

Title: Inner Join

+

Description: Test inner join

+

Error expected? No

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "items": [
+        {
+          "type": "sword",
+          "weight": 1500
+        },
+        {
+          "type": "shield",
+          "weight": 2500
+        }
+      ]
+    },
+    {
+      "name": "bob",
+      "items": [
+        {
+          "type": "flower",
+          "weight": 15
+        }
+      ]
+    }
+  ]
+}
+
+

Input 1

+
name,birthyear
+alice,1995
+bob,1999
+tobias,2005
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+  rml:viewOn :jsonSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+  ] ;
+  rml:field [
+    a rml:IterableField ;
+    rml:fieldName "item" ;
+    rml:iterator "$.items[*]" ;
+    rml:field [
+      a rml:ExpressionField ;
+      rml:fieldName "type" ;
+      rml:reference "$.type" ;
+    ] ;
+    rml:field [
+      a rml:ExpressionField ;
+      rml:fieldName "weight" ;
+      rml:reference "$.weight" ;
+    ] ;
+  ] .
+
+:csvSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.csv" ;
+  ] ;
+  rml:referenceFormulation rml:CSV .
+
+:csvView a rml:LogicalView ;
+  rml:viewOn :csvSource ;
+  rml:field [ a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "name" ;
+  ] ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "birthyear" ;
+    rml:reference "birthyear" ;
+  ] ;
+  rml:innerJoin [
+    rml:parentLogicalView :jsonView ;
+    rml:joinCondition [
+      rml:parent "name" ;
+      rml:child "name" ;
+    ] ;
+    rml:field [
+      a rml:ExpressionField ;
+      rml:fieldName "item_type" ;
+      rml:reference "item.type" ;
+    ] ;
+    rml:field [
+      a rml:ExpressionField ;
+      rml:fieldName "item_weight" ;
+      rml:reference "item.weight" ;
+    ] ;
+  ] .
+
+
+:triplesMapPerson a rml:TriplesMap ;
+  rml:logicalSource :csvView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{name}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasName ;
+    rml:objectMap [
+      rml:reference "name" ;
+    ] ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasBirthyear ;
+    rml:objectMap [
+      rml:reference "birthyear" ;
+      rml:datatype xsd:gYear ;
+    ] ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasItem ;
+    rml:objectMap [
+      rml:parentTriplesMap :triplesMapItem ;
+    ] ;
+  ] .
+
+:triplesMapItem a rml:TriplesMap ;
+  rml:logicalSource :csvView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{name}/item/{item_type}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasType ;
+    rml:objectMap [
+      rml:reference "item_type" ;
+    ] ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasWeight ;
+    rml:objectMap [
+      rml:reference "item_weight" ;
+      rml:datatype xsd:integer ;
+    ] ;
+  ] .
+
+

Output

+
<http://example.org/person/alice> <http://example.org/hasName> "alice" .
+<http://example.org/person/alice> <http://example.org/hasBirthyear> "1995"^^<http://www.w3.org/2001/XMLSchema#gYear> .
+<http://example.org/person/alice> <http://example.org/hasItem> <http://example.org/person/alice/item/sword> .
+<http://example.org/person/alice> <http://example.org/hasItem> <http://example.org/person/alice/item/shield> .
+<http://example.org/person/alice/item/sword> <http://example.org/hasType> "sword" .
+<http://example.org/person/alice/item/sword> <http://example.org/hasWeight> "1500"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.org/person/alice/item/shield> <http://example.org/hasType> "shield" .
+<http://example.org/person/alice/item/shield> <http://example.org/hasWeight> "2500"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.org/person/bob> <http://example.org/hasName> "bob" .
+<http://example.org/person/bob> <http://example.org/hasBirthyear> "1999"^^<http://www.w3.org/2001/XMLSchema#gYear> .
+<http://example.org/person/bob> <http://example.org/hasItem> <http://example.org/person/bob/item/flower> .
+<http://example.org/person/bob/item/flower> <http://example.org/hasType> "flower" .
+<http://example.org/person/bob/item/flower> <http://example.org/hasWeight> "15"^^<http://www.w3.org/2001/XMLSchema#integer> .
+
+
+

8. RMLLVTC0005

+

Title: Index

+

Description: Test references to index keys, including joins

+

Error expected? No

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "items": [
+        {
+          "type": "sword",
+          "weight": 1500
+        },
+        {
+          "type": "shield",
+          "weight": 2500
+        }
+      ]
+    },
+    {
+      "name": "bob",
+      "items": [
+        {
+          "type": "flower",
+          "weight": 15
+        }
+      ]
+    }
+  ]
+}
+
+

Input 1

+
name,birthyear
+alice,1995
+bob,1999
+tobias,2005
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+  rml:viewOn :jsonSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+  ] ;
+  rml:field [
+    a rml:IterableField ;
+    rml:fieldName "item" ;
+    rml:iterator "$.items[*]" ;
+    rml:field [
+      a rml:ExpressionField ;
+      rml:fieldName "type" ;
+      rml:reference "$.type" ;
+    ] ;
+    rml:field [
+      a rml:ExpressionField ;
+      rml:fieldName "weight" ;
+      rml:reference "$.weight" ;
+    ] ;
+  ] .
+
+:csvSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.csv" ;
+  ] ;
+  rml:referenceFormulation rml:CSV .
+
+:csvView a rml:LogicalView ;
+  rml:viewOn :csvSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "name" ;
+  ] ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "birthyear" ;
+    rml:reference "birthyear" ;
+  ] ;
+  rml:innerJoin [
+    rml:parentLogicalView :jsonView ;
+    rml:joinCondition [
+      rml:parent "name" ;
+      rml:child "name" ;
+    ] ;
+    rml:field [
+      a rml:ExpressionField ;
+      rml:fieldName "item_type" ;
+      rml:reference "item.type" ;
+    ] ;
+    rml:field [
+      a rml:ExpressionField ;
+      rml:fieldName "item_weight" ;
+      rml:reference "item.weight" ;
+    ] ;
+  ] .
+
+:triplesMapPerson a rml:TriplesMap ;
+  rml:logicalSource :csvView ;
+  rml:subjectMap [
+    rml:template "http://example.org/people/{name}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasName ;
+    rml:objectMap [
+      rml:reference "name" ;
+    ] ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasBirthyear ;
+    rml:objectMap [
+      rml:reference "birthyear" ;
+      rml:datatype xsd:gYear ;
+    ] ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasItem ;
+    rml:objectMap [
+      rml:parentTriplesMap :triplesMapItem ;
+    ] ;
+  ] .
+
+:triplesMapItem a rml:TriplesMap ;
+  rml:logicalSource :csvView ;
+  rml:subjectMap [
+    rml:template "item_{#}_{item_type.#}" ;
+    rml:termType rml:BlankNode ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasType ;
+    rml:objectMap [
+      rml:reference "item_type" ;
+    ] ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasWeight ;
+    rml:objectMap [
+      rml:reference "item_weight" ;
+      rml:datatype xsd:integer ;
+    ] ;
+  ] .
+
+

Output

+
<http://example.org/people/alice> <http://example.org/hasName> "alice" .
+<http://example.org/people/alice> <http://example.org/hasBirthyear> "1995"^^<http://www.w3.org/2001/XMLSchema#gYear> .
+<http://example.org/people/alice> <http://example.org/hasItem> _:item_0_0 .
+<http://example.org/people/alice> <http://example.org/hasItem> _:item_0_1 .
+_:item_0_0 <http://example.org/hasType> "sword" .
+_:item_0_0 <http://example.org/hasWeight> "1500"^^<http://www.w3.org/2001/XMLSchema#integer> .
+_:item_0_1 <http://example.org/hasType> "shield" .
+_:item_0_1 <http://example.org/hasWeight> "2500"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.org/people/bob> <http://example.org/hasName> "bob" .
+<http://example.org/people/bob> <http://example.org/hasBirthyear> "1999"^^<http://www.w3.org/2001/XMLSchema#gYear> .
+<http://example.org/people/bob> <http://example.org/hasItem> _:item_1_0 .
+_:item_1_0 <http://example.org/hasType> "flower" .
+_:item_1_0 <http://example.org/hasWeight> "15"^^<http://www.w3.org/2001/XMLSchema#integer> .
+
+
+

9. RMLLVTC0006

+

Title: Change Reference Formulations: CSV, including JSON array

+

Description: Test a change of reference formulations: csv source including json array

+

Error expected? No

+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+
+:mixedCSVSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.csv" ;
+  ] ;
+  rml:referenceFormulation rml:CSV .
+
+:mixedCSVView a rml:LogicalView ;
+  rml:viewOn :mixedCSVSource ;
+  rml:field [
+    a rml:ExpressionField;
+    rml:fieldName "name" ;
+    rml:reference "name" ;
+  ] ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "items" ;
+    rml:reference "items" ;
+    rml:field [
+      a rml:IterableField ;
+      rml:referenceFormulation rml:JSONPath ;
+      rml:iterator "$[*]" ;
+      rml:fieldName "item" ;
+      rml:field [
+        a rml:ExpressionField ;
+        rml:fieldName "type" ;
+        rml:reference "$.type" ;
+      ] ;
+      rml:field [
+        a rml:ExpressionField ;
+        rml:fieldName "weight" ;
+        rml:reference "$.weight" ;
+      ] ;
+    ] ;
+  ] .
+
+:triplesMapItem a rml:TriplesMap ;
+  rml:logicalSource :mixedCSVView ;
+  rml:subjectMap [
+    rml:template "http://example.org/item_{#}_{items.item.#}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasType ;
+    rml:objectMap [
+      rml:reference "items.item.type" ;
+    ] ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasWeight ;
+    rml:objectMap [
+      rml:reference "items.item.weight" ;
+      rml:datatype xsd:integer ;
+    ] ;
+  ] .
+
+

Output

+
<http://example.org/item_0_0> <http://example.org/hasType> "sword" .
+<http://example.org/item_0_0> <http://example.org/hasWeight> "1500"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.org/item_0_1> <http://example.org/hasType> "shield" .
+<http://example.org/item_0_1> <http://example.org/hasWeight> "2500"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.org/item_1_0> <http://example.org/hasType> "flower" .
+<http://example.org/item_1_0> <http://example.org/hasWeight> "15"^^<http://www.w3.org/2001/XMLSchema#integer> .
+
+
+

10. RMLLVTC0007

+

Title: Change Reference Formulations: CSV including JSON object

+

Description: Test a change of reference formulations: csv source including json object

+

Error expected? No

+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+
+:mixedCSVSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.csv" ;
+  ] ;
+  rml:referenceFormulation rml:CSV .
+
+:mixedCSVView a rml:LogicalView ;
+  rml:viewOn :mixedCSVSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "name" ;
+  ] ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "item" ;
+    rml:reference "item" ;
+    rml:field [
+      a rml:IterableField ;
+      rml:referenceFormulation rml:JSONPath ;
+      rml:iterator "$[*]" ;
+      rml:fieldName "itemJson" ;
+      rml:field [
+        a rml:ExpressionField;
+        rml:fieldName "type" ;
+        rml:reference "$.type" ; ] ;
+      rml:field [
+        a rml:ExpressionField;
+        rml:fieldName "weight" ;
+        rml:reference "$.weight" ;
+      ] ;
+    ] ;
+  ] .
+
+:triplesMapItem a rml:TriplesMap ;
+  rml:logicalSource :mixedCSVView ;
+  rml:subjectMap [
+    rml:template "http://example.org/item_{#}_{item.#}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasType ;
+    rml:objectMap [
+      rml:reference "item.itemJson.type" ;
+    ] ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasWeight ;
+    rml:objectMap [
+      rml:reference "item.itemJson.weight" ;
+      rml:datatype xsd:integer ;
+    ] ;
+  ] .
+
+

Output

+
<http://example.org/item_0_0> <http://example.org/hasType> "sword" .
+<http://example.org/item_0_0> <http://example.org/hasWeight> "1500"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.org/item_1_0> <http://example.org/hasType> "shield" .
+<http://example.org/item_1_0> <http://example.org/hasWeight> "2500"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.org/item_2_0> <http://example.org/hasType> "flower" .
+<http://example.org/item_2_0> <http://example.org/hasWeight> "15"^^<http://www.w3.org/2001/XMLSchema#integer> .
+
+
+

11. RMLLVTC0008

+

Title: Change Reference Formulations: JSON including CSV

+

Description: Test a change of reference formulations: json source including csv data

+

Error expected? No

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "items": "type,weight\nsword,1500\nshield,2500"
+    },
+    {
+      "name": "bob",
+      "items": "type,weight\nflower,15"
+    }
+  ]
+}
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+
+:mixedJSONSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:mixedJSONView a rml:LogicalView ;
+  rml:viewOn :mixedJSONSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+    ] ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "items" ;
+    rml:reference "$.items" ;
+    rml:field [
+      a rml:IterableField ;
+      rml:referenceFormulation rml:CSV ;
+      rml:fieldName "item";
+      rml:field [
+        a rml:ExpressionField ;
+        rml:fieldName "type" ;
+        rml:reference "type" ;
+      ] ;
+      rml:field [
+        a rml:expressionField ;
+        rml:fieldName "weight" ;
+        rml:reference "weight" ;
+      ] ;
+    ] ;
+  ].
+
+:triplesMapItem a rml:TriplesMap ;
+  rml:logicalSource :mixedJSONView ;
+  rml:subjectMap [
+    rml:template "http://example.org/item_{#}_{items.item.#}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasType ;
+    rml:objectMap [
+      rml:reference "items.item.type" ;
+    ] ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasWeight ;
+    rml:objectMap [
+      rml:reference "items.item.weight" ;
+      rml:datatype xsd:integer ;
+    ] ;
+  ] .
+
+

Output

+
<http://example.org/item_0_0> <http://example.org/hasType> "sword" .
+<http://example.org/item_0_0> <http://example.org/hasWeight> "1500"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.org/item_0_1> <http://example.org/hasType> "shield" .
+<http://example.org/item_0_1> <http://example.org/hasWeight> "2500"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.org/item_1_0> <http://example.org/hasType> "flower" .
+<http://example.org/item_1_0> <http://example.org/hasWeight> "15"^^<http://www.w3.org/2001/XMLSchema#integer> .
+
+
+

12. RMLLVTC0009

+

Title: Two Left Joins

+

Description: Test two left joins

+

Error expected? No

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "items": [
+        {
+          "type": "sword",
+          "weight": 1500
+        },
+        {
+          "type": "shield",
+          "weight": 2500
+        }
+      ]
+    },
+    {
+      "name": "bob",
+      "items": [
+        {
+          "type": "flower",
+          "weight": 15
+        }
+      ]
+    }
+  ]
+}
+
+

Input 1

+
name,birthyear
+alice,1995
+bob,1999
+tobias,2005
+
+

Input 2

+
name,id
+alice,123
+bob,456
+tobias,789
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+  rml:viewOn :jsonSource ;
+  rml:field [ a
+    rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+  ] ;
+  rml:field [
+    a rml:IterableField ;
+    rml:fieldName "item" ;
+    rml:iterator "$.items[*]" ;
+    rml:field [
+      a rml:ExpressionField ;
+      rml:fieldName "type" ;
+      rml:reference "$.type" ;
+    ] ;
+    rml:field [
+      a rml:ExpressionField ;
+      rml:fieldName "weight" ;
+      rml:reference "$.weight" ;
+    ] ;
+  ] .
+
+  :additionalCsvSource a rml:LogicalSource ;
+    rml:source [
+      a rml:RelativePathSource , rml:Source ;
+      rml:root rml:MappingDirectory ;
+      rml:path "people2.csv" ;
+    ] ;
+    rml:referenceFormulation rml:CSV .
+
+  :additionalCsvView a rml:LogicalView ;
+    rml:viewOn :additionalCsvSource ;
+    rml:field [
+      a rml:ExpressionField ;
+      rml:fieldName "name" ;
+      rml:reference "name" ;
+    ] ;
+    rml:field [
+      a rml:ExpressionField ;
+      rml:fieldName "id" ;
+      rml:reference "id" ;
+    ] ;
+    .
+
+:csvSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.csv" ;
+  ] ;
+  rml:referenceFormulation rml:CSV .
+
+:csvView a rml:LogicalView ;
+  rml:viewOn :csvSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "name" ;
+  ] ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "birthyear" ;
+    rml:reference "birthyear" ;
+  ] ;
+  rml:leftJoin [
+    rml:parentLogicalView :jsonView ;
+    rml:joinCondition [
+      rml:parent "name" ;
+      rml:child "name" ;
+    ] ;
+    rml:field [
+      a rml:ExpressionField ;
+      rml:fieldName "item_type" ;
+      rml:reference "item.type" ;
+    ] ;
+    rml:field [
+      a rml:ExpressionField ;
+      rml:fieldName "item_weight" ;
+      rml:reference "item.weight" ;
+    ] ;
+  ] ;
+  rml:leftJoin [
+    rml:parentLogicalView :additionalCsvView ;
+    rml:joinCondition [
+      rml:parent "name" ;
+      rml:child "name" ;
+    ] ;
+    rml:field [
+      a rml:ExpressionField ;
+      rml:fieldName "id" ;
+      rml:reference "id" ;
+    ] ;
+  ] .
+
+:triplesMapPerson a rml:TriplesMap ;
+  rml:logicalSource :csvView ;
+  rml:subjectMap [
+    rml:template "http://example.org/people/{id}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasName ;
+    rml:objectMap [
+      rml:reference "name" ;
+    ] ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasBirthyear ;
+    rml:objectMap [
+      rml:reference "birthyear" ;
+      rml:datatype xsd:gYear ;
+    ] ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasItem ;
+    rml:objectMap [
+      rml:parentTriplesMap :triplesMapItem ;
+    ] ;
+  ] .
+
+:triplesMapItem a rml:TriplesMap ;
+  rml:logicalSource :csvView ;
+  rml:subjectMap [
+    rml:template "http://example.org/item_{#}_{item_type.#}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasType ;
+    rml:objectMap [
+      rml:reference "item_type" ;
+    ] ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasWeight ;
+    rml:objectMap [
+      rml:reference "item_weight" ;
+      rml:datatype xsd:integer ;
+    ] ;
+  ] .
+
+

Output

+
<http://example.org/people/123> <http://example.org/hasName> "alice" .
+<http://example.org/people/123> <http://example.org/hasBirthyear> "1995"^^<http://www.w3.org/2001/XMLSchema#gYear> .
+<http://example.org/people/123> <http://example.org/hasItem> <http://example.org/item_0_0> .
+<http://example.org/people/123> <http://example.org/hasItem> <http://example.org/item_0_1> .
+<http://example.org/item_0_0> <http://example.org/hasType> "sword" .
+<http://example.org/item_0_0> <http://example.org/hasWeight> "1500"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.org/item_0_1> <http://example.org/hasType> "shield" .
+<http://example.org/item_0_1> <http://example.org/hasWeight> "2500"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.org/people/456> <http://example.org/hasName> "bob" .
+<http://example.org/people/456> <http://example.org/hasBirthyear> "1999"^^<http://www.w3.org/2001/XMLSchema#gYear> .
+<http://example.org/people/456> <http://example.org/hasItem> <http://example.org/item_1_0> .
+<http://example.org/item_1_0> <http://example.org/hasType> "flower" .
+<http://example.org/item_1_0> <http://example.org/hasWeight> "15"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.org/people/789> <http://example.org/hasName> "tobias" .
+<http://example.org/people/789> <http://example.org/hasBirthyear> "2005"^^<http://www.w3.org/2001/XMLSchema#gYear> .
+
+
+ + + + + \ No newline at end of file diff --git a/src/test/resources/rml-lv/docs/20250216/index.html b/src/test/resources/rml-lv/docs/20250216/index.html new file mode 100644 index 00000000..3588dcc1 --- /dev/null +++ b/src/test/resources/rml-lv/docs/20250216/index.html @@ -0,0 +1,2142 @@ + + + + + + +RML-LV: Test Cases + + + + + + + + + + + + + + +
+ +

RML-LV: Test Cases

+

+ Draft Community Group Report + +

+
+ +
Latest published version:
+ https://www.w3.org/RML-LV-Testcases/ +
+
Latest editor's draft:
https://w3id.org/rml/lv/test-cases/
+ + + + +
Editors:
+ (Skemu) +
+ (Ghent University – imec – IDLab) +
+ +
Authors:
+ (Skemu) +
+ (Ghent University – imec – IDLab) +
+
Feedback:
+ GitHub kg-construct/rml-lv + (pull requests, + new issue, + open issues) +
+ +
+ + +
+
+ + + +

Abstract

This document defines the RML-LV test cases to the determine the RML-LV specification conformance of tools.

+
+ +

Status of This Document

+ This specification was published by the + Knowledge Graph Construction Community Group. It is not a W3C Standard nor is it + on the W3C Standards Track. + + Please note that under the + W3C Community Contributor License Agreement (CLA) + there is a limited opt-out and other conditions apply. + + Learn more about + W3C Community and Business Groups. +

+ GitHub Issues are preferred for + discussion of this specification. + + +

+ +

1. Introduction

+

This document defines the RML-LV test cases, consisting of a collection of test case documents (input and expected output). +The purpose of the test cases is to determine the conformance of tools that execute RML rules to the RML-LV specification.

+
+ +

2. Data model

+

The test cases are semantically described for re-usability and shareability following the W3C Test case description. +Each test:Testcase as the following properties:

+
    +
  • dcterms:identifier: unique ID of the test case.
  • +
  • rmltest:hasError: if an error of the RML Processor is expected or not.
  • +
  • rmltest:input: One or more input data of the test case.
  • +
  • rmltest:output: One or more output data of the test case.
  • +
  • rmltest:inputFormat: the input data format.
  • +
  • rmltest:outputFormat: the output data format.
  • +
  • rmltest:mappingDocument: the RML mapping rules in Turtle.
  • +
+
+ +

3. Test cases

+

This section describes the RML-LV test cases. These descriptions are also available as RDF. +The files are available on GitHub in the folder test-cases. +Each test case is contained in a single folder, containing three types of files:

+
    +
  • Zero or more files containing the data sources, in the case of JSON, XML, CSV, or containing the SQL statements to create the necessary tables, in the case of MySQL, PostgreSQL, and SQL Server.
  • +
  • One file with the RML rules, called mapping.ttl, in the Turtle format.
  • +
  • Zero or more files with the expected RDF. No file is provided if an error is expected that must halt the generation of the RDF because of an error.
  • +
+
+ + +

4. RMLLVTC0000a

+

Title: Logical view on JSON source

+

Description: Test a view on a hierarchical source

+

Error expected? No

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "items": [
+        {
+          "type": "sword",
+          "weight": 1500
+        },
+        {
+          "type": "shield",
+          "weight": 2500
+        }
+      ]
+    },
+    {
+      "name": "bob",
+      "items": [
+        {
+          "type": "flower",
+          "weight": 15
+        }
+      ]
+    }
+  ]
+}
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+  rml:viewOn :jsonSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+  ] .
+
+:triplesMapPerson a rml:TriplesMap ;
+  rml:logicalSource :jsonView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{name}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasName ;
+    rml:objectMap [
+      rml:reference "name" ;
+    ] ;
+  ] .
+
+

Output

+
<http://example.org/person/alice> <http://example.org/hasName> "alice" .
+<http://example.org/person/bob> <http://example.org/hasName> "bob" .
+
+
+

5. RMLLVTC0000b

+

Title: Logical view on CSV source

+

Description: Test a view on a tabular source

+

Error expected? No

+

Input

+
name,birthyear
+alice,1995
+bob,1999
+tobias,2005
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix : <http://example.org/> .
+
+:csvSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.csv" ;
+  ] ;
+  rml:referenceFormulation rml:CSV .
+
+:csvView a rml:LogicalView ;
+  rml:viewOn :csvSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "name" ;
+  ] .
+
+:triplesMapPerson a rml:TriplesMap ;
+  rml:logicalSource :csvView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{name}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasName ;
+    rml:objectMap [
+      rml:reference "name" ;
+    ] ;
+  ] .
+
+

Output

+
<http://example.org/person/alice> <http://example.org/hasName> "alice" .
+<http://example.org/person/bob> <http://example.org/hasName> "bob" .
+<http://example.org/person/tobias> <http://example.org/hasName> "tobias" .
+
+
+

6. RMLLVTC0000c

+

Title: Logical View on Logical View

+

Description: Test a view on a logical view

+

Error expected? No

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "items": [
+        {
+          "type": "sword",
+          "weight": 1500
+        },
+        {
+          "type": "shield",
+          "weight": 2500
+        }
+      ]
+    },
+    {
+      "name": "bob",
+      "items": [
+        {
+          "type": "flower",
+          "weight": 15
+        }
+      ]
+    }
+  ]
+}
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+  rml:viewOn :jsonSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+  ] .
+
+:jsonViewOnJsonView a rml:LogicalView ;
+  rml:viewOn :jsonView ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "newName" ;
+    rml:reference "name" ;
+  ] .
+
+:triplesMapPerson a rml:TriplesMap ;
+  rml:logicalSource :jsonViewOnJsonView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{newName}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasName ;
+    rml:objectMap [
+      rml:reference "newName" ;
+    ] ;
+  ] .
+
+

Output

+
<http://example.org/person/alice> <http://example.org/hasName> "alice" .
+<http://example.org/person/bob> <http://example.org/hasName> "bob" .
+
+
+

7. RMLLVTC0001a

+

Title: Expression Field: Reference

+

Description: Test a reference in an expression field

+

Error expected? No

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "items": [
+        {
+          "type": "sword",
+          "weight": 1500
+        },
+        {
+          "type": "shield",
+          "weight": 2500
+        }
+      ]
+    },
+    {
+      "name": "bob",
+      "items": [
+        {
+          "type": "flower",
+          "weight": 15
+        }
+      ]
+    }
+  ]
+}
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+  rml:viewOn :jsonSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+  ] .
+
+:triplesMapPerson a rml:TriplesMap ;
+  rml:logicalSource :jsonView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{name}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasName ;
+    rml:objectMap [
+      rml:reference "name" ;
+    ] ;
+  ] .
+
+

Output

+
<http://example.org/person/alice> <http://example.org/hasName> "alice" .
+<http://example.org/person/bob> <http://example.org/hasName> "bob" .
+
+
+

8. RMLLVTC0001b

+

Title: Expression Field: Template

+

Description: Test a template in an expression field

+

Error expected? No

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "items": [
+        {
+          "type": "sword",
+          "weight": 1500
+        },
+        {
+          "type": "shield",
+          "weight": 2500
+        }
+      ]
+    },
+    {
+      "name": "bob",
+      "items": [
+        {
+          "type": "flower",
+          "weight": 15
+        }
+      ]
+    }
+  ]
+}
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+  rml:viewOn :jsonSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+  ] ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "race" ;
+    rml:constant "human" ;
+  ] .
+
+:triplesMapPerson a rml:TriplesMap ;
+  rml:logicalSource :jsonView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{name}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasRace ;
+    rml:objectMap [
+      rml:reference "race" ;
+    ] ;
+  ] .
+
+

Output

+
<http://example.org/person/alice> <http://example.org/hasRace> "human" .
+<http://example.org/person/bob> <http://example.org/hasRace> "human" .
+
+
+

9. RMLLVTC0001c

+

Title: Expression Field: Constant

+

Description: Test a constant expression in an expression field

+

Error expected? No

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "lastName": "smith",
+      "items": [
+        {
+          "type": "sword",
+          "weight": 1500
+        },
+        {
+          "type": "shield",
+          "weight": 2500
+        }
+      ]
+    },
+    {
+      "name": "bob",
+      "lastName": "jones",
+      "items": [
+        {
+          "type": "flower",
+          "weight": 15
+        }
+      ]
+    }
+  ]
+}
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+  rml:viewOn :jsonSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+  ] ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "fullName" ;
+    rml:template "{name} {lastName}" ;
+  ] .
+
+:triplesMapPerson a rml:TriplesMap ;
+  rml:logicalSource :jsonView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{name}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasFullName ;
+    rml:objectMap [
+      rml:reference "fullName" ;
+    ] ;
+  ] .
+
+

Output

+
<http://example.org/person/alice> <http://example.org/hasFullName> "alice smith" .
+<http://example.org/person/bob> <http://example.org/hasFullName> "bob jones" .
+
+
+

10. RMLLVTC0001d

+

Title: Expression Field Siblings

+

Description: Test multiple expression fields with the same parent

+

Error expected? No

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "lastName": "smith",
+      "items": [
+        {
+          "type": "sword",
+          "weight": 1500
+        },
+        {
+          "type": "shield",
+          "weight": 2500
+        }
+      ]
+    },
+    {
+      "name": "bob",
+      "lastName": "jones",
+      "items": [
+        {
+          "type": "flower",
+          "weight": 15
+        }
+      ]
+    }
+  ]
+}
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+  rml:viewOn :jsonSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+  ] ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "lastName" ;
+    rml:reference "$.lastName" ;
+  ] .
+
+:triplesMapPerson a rml:TriplesMap ;
+  rml:logicalSource :jsonView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{name}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasFullName ;
+    rml:objectMap [
+      rml:template "{name} {lastName}" ;
+      rml:termType rml:Literal ;
+    ] ;
+  ] .
+
+

Output

+
<http://example.org/person/alice> <http://example.org/hasFullName> "alice smith" .
+<http://example.org/person/bob> <http://example.org/hasFullName> "bob jones" .
+
+
+

11. RMLLVTC0002a

+

Title: Iterable Field

+

Description: Test a nested field construction: iterable field with expression field as child

+

Error expected? No

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "items": [
+        {
+          "type": "sword",
+          "weight": 1500
+        },
+        {
+          "type": "shield",
+          "weight": 2500
+        }
+      ]
+    },
+    {
+      "name": "bob",
+      "items": [
+        {
+          "type": "flower",
+          "weight": 15
+        }
+      ]
+    }
+  ]
+}
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+  rml:viewOn :jsonSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+  ] ;
+  rml:field [
+    a rml:IterableField ;
+    rml:fieldName "item" ;
+    rml:iterator "$.items[*]" ;
+    rml:field [
+      a rml:ExpressionField ;
+      rml:fieldName "type" ;
+      rml:reference "$.type" ;
+    ] ;
+  ] .
+
+:triplesMapPerson a rml:TriplesMap ;
+  rml:logicalSource :jsonView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{name}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasItem ;
+    rml:objectMap [
+      rml:template "http://example.org/person/{name}/item/{item.type}" ;
+    ] ;
+  ] .
+
+

Output

+
<http://example.org/person/alice> <http://example.org/hasItem> <http://example.org/person/alice/item/sword> .
+<http://example.org/person/alice> <http://example.org/hasItem> <http://example.org/person/alice/item/shield> .
+<http://example.org/person/bob> <http://example.org/hasItem> <http://example.org/person/bob/item/flower> .
+
+
+

12. RMLLVTC0002b

+

Title: Iterable Field with Multiple Children

+

Description: Test a nested field construction: iterable field with mulitple expression fields as children

+

Error expected? No

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "items": [
+        {
+          "type": "sword",
+          "weight": 1500
+        },
+        {
+          "type": "shield",
+          "weight": 2500
+        }
+      ]
+    },
+    {
+      "name": "bob",
+      "items": [
+        {
+          "type": "flower",
+          "weight": 15
+        }
+      ]
+    }
+  ]
+}
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+  rml:viewOn :jsonSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+  ] ;
+  rml:field [
+    a rml:IterableField ;
+    rml:fieldName "item" ;
+    rml:iterator "$.items[*]" ;
+    rml:field [
+      a rml:ExpressionField ;
+      rml:fieldName "type" ;
+      rml:reference "$.type" ;
+    ] ;
+    rml:field [
+      a rml:ExpressionField ;
+      rml:fieldName "weight" ;
+      rml:reference "$.weight" ;
+    ] ;
+  ] .
+
+:triplesMapItem a rml:TriplesMap ;
+  rml:logicalSource :jsonView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{name}/item/{item.type}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasName ;
+    rml:objectMap [
+      rml:reference "item.type" ;
+    ] ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasWeight ;
+    rml:objectMap [
+      rml:reference "item.weight" ;
+      rml:datatype xsd:integer ;
+    ] ;
+  ] .
+
+

Output

+
<http://example.org/person/alice/item/sword> <http://example.org/hasName> "sword" .
+<http://example.org/person/alice/item/sword> <http://example.org/hasWeight> "1500"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.org/person/alice/item/shield> <http://example.org/hasName> "shield" .
+<http://example.org/person/alice/item/shield> <http://example.org/hasWeight> "2500"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.org/person/bob/item/flower> <http://example.org/hasName> "flower" .
+<http://example.org/person/bob/item/flower> <http://example.org/hasWeight> "15"^^<http://www.w3.org/2001/XMLSchema#integer> .
+
+
+

13. RMLLVTC0002c

+

Title: Nested Iterable Fields

+

Description: Test a nested field construction: iterable field with an iterable field as child

+

Error expected? No

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "items": [
+        {
+          "type": "sword",
+          "measures": {
+            "weight": 1500,
+            "length": 30
+          }
+        },
+        {
+          "type": "shield",
+          "measures": {
+            "weight": 2500
+          }
+        }
+      ]
+    },
+    {
+      "name": "bob",
+      "items": [
+        {
+          "type": "flower",
+          "measures" : {
+            "weight": 15,
+            "length" : 15
+          }
+        }
+      ]
+    }
+  ]
+}
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+  rml:viewOn :jsonSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+  ] ;
+  rml:field [
+    a rml:IterableField ;
+    rml:fieldName "item" ;
+    rml:iterator "$.items[*]" ;
+    rml:field [
+      rml:fieldName "type" ;
+      rml:reference "$.type" ;
+    ] ;
+    rml:field [
+      a rml:IterableField ;
+      rml:fieldName "measures";
+      rml:iterator "$.measures";
+      rml:field [
+        a rml:ExpressionField ;
+        rml:fieldName "weight" ;
+        rml:reference "$.weight" ;
+        ];
+      rml:field [
+        a rml:ExpressionField ;
+        rml:fieldName "length" ;
+        rml:reference "$.length" ;
+      ]
+    ] ;
+  ] .
+
+:triplesMapItem a rml:TriplesMap ;
+  rml:logicalSource :jsonView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{name}/item/{item.type}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasWeight ;
+    rml:objectMap [
+      rml:reference "item.measures.weight" ;
+      rml:datatype xsd:integer ;
+    ] ;
+  ] .
+
+

Output

+
<http://example.org/person/alice/item/sword> <http://example.org/hasWeight> "1500"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.org/person/alice/item/shield> <http://example.org/hasWeight> "2500"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.org/person/bob/item/flower> <http://example.org/hasWeight> "15"^^<http://www.w3.org/2001/XMLSchema#integer> .
+
+
+

14. RMLLVTC0003a

+

Title: Index Key: #

+

Description: Test a reference to the index key #

+

Error expected? No

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "items": [
+        {
+          "type": "sword",
+          "weight": 1500
+        },
+        {
+          "type": "shield",
+          "weight": 2500
+        }
+      ]
+    },
+    {
+      "name": "bob",
+      "items": [
+        {
+          "type": "flower",
+          "weight": 15
+        }
+      ]
+    }
+  ]
+}
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+  rml:viewOn :jsonSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+  ] .
+
+:triplesMapPerson a rml:TriplesMap ;
+  rml:logicalSource :jsonView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{name}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasSequenceNumber ;
+    rml:objectMap [
+      rml:reference "#" ;
+      rml:datatype xsd:integer ;
+    ] ;
+  ] .
+
+

Output

+
<http://example.org/person/alice> <http://example.org/hasSequenceNumber> "0"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.org/person/bob> <http://example.org/hasSequenceNumber> "1"^^<http://www.w3.org/2001/XMLSchema#integer> .
+
+
+

15. RMLLVTC0003b

+

Title: Index Key: Iterable Field

+

Description: Test a reference to the index key of an iterable field

+

Error expected? No

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "items": [
+        {
+          "type": "sword",
+          "weight": 1500
+        },
+        {
+          "type": "shield",
+          "weight": 2500
+        }
+      ]
+    },
+    {
+      "name": "bob",
+      "items": [
+        {
+          "type": "flower",
+          "weight": 15
+        }
+      ]
+    }
+  ]
+}
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+  rml:viewOn :jsonSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+  ] ;
+  rml:field [
+    a rml:IterableField ;
+    rml:fieldName "item" ;
+    rml:iterator "$.items[*]" ;
+    rml:field [
+      a rml:ExpressionField ;
+      rml:fieldName "type" ;
+      rml:reference "$.type" ;
+    ] ;
+  ] .
+
+:triplesMapPerson a rml:TriplesMap ;
+  rml:logicalSource :jsonView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{name}/item/{item.#}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasType ;
+    rml:objectMap [
+      rml:reference "item.type" ;
+    ] ;
+  ] .
+
+

Output

+
<http://example.org/person/alice/item/0> <http://example.org/hasType> "sword" .
+<http://example.org/person/alice/item/1> <http://example.org/hasType> "shield" .
+<http://example.org/person/bob/item/0> <http://example.org/hasType> "flower" .
+
+
+
+

16. RMLLVTC0003c

+

Title: Index Key: Expression field

+

Description: Test a reference to the index key of an expression field

+

Error expected? No

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "items": [
+        "sword",
+        "shield"
+      ]
+    },
+    {
+      "name": "bob",
+      "items": [
+        "flower"
+      ]
+    }
+  ]
+}
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+  rml:viewOn :jsonSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+  ] ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "item" ;
+    rml:reference "$.items[*]" ;
+  ] .
+
+:triplesMapItem a rml:TriplesMap ;
+  rml:logicalSource :jsonView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{name}/item/{item.#}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasType ;
+    rml:objectMap [
+      rml:reference "item" ;
+    ] ;
+  ] .
+
+

Output

+
<http://example.org/person/alice/item/0> <http://example.org/hasType> "sword" .
+<http://example.org/person/alice/item/1> <http://example.org/hasType> "shield" .
+<http://example.org/person/bob/item/0> <http://example.org/hasType> "flower" .
+
+
+

17. RMLLVTC0004a

+

Title: Natural Datatype: Index #

+

Description: Test the natural datatype mapping for the index #

+

Error expected? No

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "items": [
+        {
+          "type": "sword",
+          "weight": 1500
+        },
+        {
+          "type": "shield",
+          "weight": 2500
+        }
+      ]
+    },
+    {
+      "name": "bob",
+      "items": [
+        {
+          "type": "flower",
+          "weight": 15
+        }
+      ]
+    }
+  ]
+}
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+  rml:viewOn :jsonSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+  ] .
+
+:triplesMapPerson a rml:TriplesMap ;
+  rml:logicalSource :jsonView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{name}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasSequenceNumber ;
+    rml:objectMap [
+      rml:reference "#" ;
+    ] ;
+  ] .
+
+

Output

+
<http://example.org/person/alice> <http://example.org/hasSequenceNumber> "0"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.org/person/bob> <http://example.org/hasSequenceNumber> "1"^^<http://www.w3.org/2001/XMLSchema#integer> .
+
+
+

18. RMLLVTC0007a

+

Title: Change Reference Formulations: CSV including JSON array

+

Description: Test a change of reference formulations: csv source including json array

+

Error expected? No

+

Input

+
name,items
+alice,"[{""type"":""sword"",""weight"":1500},{""type"":""shield"",""weight"":2500}]"
+bob,"[{""type"":""flower"",""weight"":15}]"
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+
+:mixedCSVSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.csv" ;
+  ] ;
+  rml:referenceFormulation rml:CSV .
+
+:mixedCSVView a rml:LogicalView ;
+  rml:viewOn :mixedCSVSource ;
+  rml:field [
+    a rml:ExpressionField;
+    rml:fieldName "name" ;
+    rml:reference "name" ;
+  ] ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "items" ;
+    rml:reference "items" ;
+    rml:field [
+      a rml:IterableField ;
+      rml:referenceFormulation rml:JSONPath ;
+      rml:iterator "$[*]" ;
+      rml:fieldName "item" ;
+      rml:field [
+        a rml:ExpressionField ;
+        rml:fieldName "type" ;
+        rml:reference "$.type" ;
+      ] ;
+      rml:field [
+        a rml:ExpressionField ;
+        rml:fieldName "weight" ;
+        rml:reference "$.weight" ;
+      ] ;
+    ] ;
+  ] .
+
+:triplesMapItem a rml:TriplesMap ;
+  rml:logicalSource :mixedCSVView ;
+  rml:subjectMap [
+    rml:template "http://example.org/item_{#}_{items.item.#}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasType ;
+    rml:objectMap [
+      rml:reference "items.item.type" ;
+    ] ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasWeight ;
+    rml:objectMap [
+      rml:reference "items.item.weight" ;
+      rml:datatype xsd:integer ;
+    ] ;
+  ] .
+
+

Output

+
<http://example.org/item_0_0> <http://example.org/hasType> "sword" .
+<http://example.org/item_0_0> <http://example.org/hasWeight> "1500"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.org/item_0_1> <http://example.org/hasType> "shield" .
+<http://example.org/item_0_1> <http://example.org/hasWeight> "2500"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.org/item_1_0> <http://example.org/hasType> "flower" .
+<http://example.org/item_1_0> <http://example.org/hasWeight> "15"^^<http://www.w3.org/2001/XMLSchema#integer> .
+
+
+

19. RMLLVTC0007b

+

Title: Change Reference Formulations: CSV including JSON object

+

Description: Test a change of reference formulations: csv source including json object

+

Error expected? No

+

Input

+
name,item
+alice,"{""type"":""sword"",""weight"":1500}"
+alice,"{""type"":""shield"",""weight"":2500}"
+bob,"{""type"":""flower"",""weight"":15}"
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+
+:mixedCSVSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.csv" ;
+  ] ;
+  rml:referenceFormulation rml:CSV .
+
+:mixedCSVView a rml:LogicalView ;
+  rml:viewOn :mixedCSVSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "name" ;
+  ] ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "item" ;
+    rml:reference "item" ;
+    rml:field [
+      a rml:IterableField ;
+      rml:referenceFormulation rml:JSONPath ;
+      rml:iterator "$[*]" ;
+      rml:fieldName "itemJson" ;
+      rml:field [
+        a rml:ExpressionField;
+        rml:fieldName "type" ;
+        rml:reference "$.type" ; ] ;
+      rml:field [
+        a rml:ExpressionField;
+        rml:fieldName "weight" ;
+        rml:reference "$.weight" ;
+      ] ;
+    ] ;
+  ] .
+
+:triplesMapItem a rml:TriplesMap ;
+  rml:logicalSource :mixedCSVView ;
+  rml:subjectMap [
+    rml:template "http://example.org/item_{#}_{item.#}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasType ;
+    rml:objectMap [
+      rml:reference "item.itemJson.type" ;
+    ] ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasWeight ;
+    rml:objectMap [
+      rml:reference "item.itemJson.weight" ;
+      rml:datatype xsd:integer ;
+    ] ;
+  ] .
+
+

Output

+
<http://example.org/item_0_0> <http://example.org/hasType> "sword" .
+<http://example.org/item_0_0> <http://example.org/hasWeight> "1500"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.org/item_1_0> <http://example.org/hasType> "shield" .
+<http://example.org/item_1_0> <http://example.org/hasWeight> "2500"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.org/item_2_0> <http://example.org/hasType> "flower" .
+<http://example.org/item_2_0> <http://example.org/hasWeight> "15"^^<http://www.w3.org/2001/XMLSchema#integer> .
+
+
+

20. RMLLVTC0007c

+

Title: Change Reference Formulations: JSON including CSV

+

Description: Test a change of reference formulations: json source including csv data

+

Error expected? No

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "items": "type,weight\nsword,1500\nshield,2500"
+    },
+    {
+      "name": "bob",
+      "items": "type,weight\nflower,15"
+    }
+  ]
+}
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+
+:mixedJSONSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:mixedJSONView a rml:LogicalView ;
+  rml:viewOn :mixedJSONSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+    ] ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "items" ;
+    rml:reference "$.items" ;
+    rml:field [
+      a rml:IterableField ;
+      rml:referenceFormulation rml:CSV ;
+      rml:fieldName "item";
+      rml:field [
+        a rml:ExpressionField ;
+        rml:fieldName "type" ;
+        rml:reference "type" ;
+      ] ;
+      rml:field [
+        a rml:expressionField ;
+        rml:fieldName "weight" ;
+        rml:reference "weight" ;
+      ] ;
+    ] ;
+  ].
+
+:triplesMapItem a rml:TriplesMap ;
+  rml:logicalSource :mixedJSONView ;
+  rml:subjectMap [
+    rml:template "http://example.org/item_{#}_{items.item.#}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasType ;
+    rml:objectMap [
+      rml:reference "items.item.type" ;
+    ] ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasWeight ;
+    rml:objectMap [
+      rml:reference "items.item.weight" ;
+      rml:datatype xsd:integer ;
+    ] ;
+  ] .
+
+

Output

+
<http://example.org/item_0_0> <http://example.org/hasType> "sword" .
+<http://example.org/item_0_0> <http://example.org/hasWeight> "1500"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.org/item_0_1> <http://example.org/hasType> "shield" .
+<http://example.org/item_0_1> <http://example.org/hasWeight> "2500"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.org/item_1_0> <http://example.org/hasType> "flower" .
+<http://example.org/item_1_0> <http://example.org/hasWeight> "15"^^<http://www.w3.org/2001/XMLSchema#integer> .
+
+
+

21. RMLLVTC0008a

+

Title: Cycle: Abstract Logical Source

+

Description: Test a cycle in the abstract logical source of a logical view

+

Error expected? Yes

+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix : <http://example.org/> .
+
+:view1 a rml:LogicalView ;
+  rml:viewOn :view2 ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name1" ;
+    rml:reference "name2" ;
+  ] .
+
+:view2 a rml:LogicalView ;
+  rml:viewOn :view1 ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name2" ;
+    rml:reference "name1" ;
+  ] .
+
+:triplesMapPerson a rml:TriplesMap ;
+  rml:logicalSource :view2 ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{name2}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasName ;
+    rml:objectMap [
+      rml:reference "name2" ;
+    ] ;
+  ] .
+
+
+

22. RMLLVTC0008b

+

Title: Cycle: Joins

+

Description: Test a cycle in two joins of two logical views

+

Error expected? No

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "items": [
+        "sword",
+        "shield"
+      ]
+    },
+    {
+      "name": "bob",
+      "items": [
+        "flower"
+      ]
+    }
+  ]
+}
+
+

Input 1

+
name,birthyear
+alice,1995
+bob,1999
+tobias,2005
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+  rml:viewOn :jsonSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+  ] ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "item" ;
+    rml:reference "$.items[*]" ;
+  ] ;
+  rml:leftJoin [
+    rml:parentLogicalView :csvView ;
+    rml:joinCondition [
+      rml:parent "name" ;
+      rml:child "name" ;
+    ] ;
+    rml:field [
+      a rml:ExpressionField ;
+      rml:fieldName "csv_birthyear" ;
+      rml:reference "birthyear" ;
+    ] ;
+  ] .
+
+:csvSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.csv" ;
+  ] ;
+  rml:referenceFormulation rml:CSV .
+
+:csvView a rml:LogicalView ;
+  rml:viewOn :csvSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "name" ;
+  ] ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "birthyear" ;
+    rml:reference "birthyear" ;
+  ] ;
+  rml:leftJoin [
+    rml:parentLogicalView :jsonView ;
+    rml:joinCondition [
+      rml:parent "name" ;
+      rml:child "name" ;
+    ] ;
+    rml:field [
+      a rml:ExpressionField ;
+      rml:fieldName "json_item" ;
+      rml:reference "item" ;
+    ] ;
+  ] .
+
+
+:triplesMapPerson a rml:TriplesMap ;
+  rml:logicalSource :csvView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{name}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasBirthYear ;
+    rml:objectMap [
+      rml:reference "birthyear" ;
+      rml:datatype xsd:gYear ;
+    ] ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasItem ;
+    rml:objectMap [
+      rml:template "http://example.org/person/{name}/item/{json_item}" ;
+    ] ;
+  ] .
+
+

Output

+
<http://example.org/person/alice> <http://example.org/hasBirthYear> "1995"^^<http://www.w3.org/2001/XMLSchema#gYear> .
+<http://example.org/person/alice> <http://example.org/hasItem> <http://example.org/person/alice/item/sword> .
+<http://example.org/person/alice> <http://example.org/hasItem> <http://example.org/person/alice/item/shield> .
+<http://example.org/person/bob> <http://example.org/hasBirthYear> "1999"^^<http://www.w3.org/2001/XMLSchema#gYear> .
+<http://example.org/person/bob> <http://example.org/hasItem> <http://example.org/person/bob/item/flower> .
+<http://example.org/person/tobias> <http://example.org/hasBirthYear> "2005"^^<http://www.w3.org/2001/XMLSchema#gYear> .
+
+
+

23. RMLLVTC0008c

+

Title: Cycle: Self-Join

+

Description: Test a cycle in a join of a logical view: self-join

+

Error expected? Yes

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "items": [
+        {
+          "type": "sword",
+          "weight": 1500
+        },
+        {
+          "type": "shield",
+          "weight": 2500
+        }
+      ]
+    },
+    {
+      "name": "bob",
+      "items": [
+        {
+          "type": "flower",
+          "weight": 15
+        }
+      ]
+    }
+  ]
+}
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+  rml:viewOn :jsonSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+  ] ;
+  rml:leftJoin [
+    rml:parentLogicalView :jsonView ;
+    rml:joinCondition [
+      rml:parent "name" ;
+      rml:child "name" ;
+    ] ;
+    rml:field [
+      a rml:ExpressionField ;
+      rml:fieldName "newName" ;
+      rml:reference "name" ;
+    ] ;
+  ] .
+
+:triplesMapPerson a rml:TriplesMap ;
+  rml:logicalSource :jsonView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{newName}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasName ;
+    rml:objectMap [
+      rml:reference "newName" ;
+    ] ;
+  ] .
+
+
+ + + + + \ No newline at end of file diff --git a/src/test/resources/rml-lv/docs/20250228/index.html b/src/test/resources/rml-lv/docs/20250228/index.html new file mode 100644 index 00000000..f95999f8 --- /dev/null +++ b/src/test/resources/rml-lv/docs/20250228/index.html @@ -0,0 +1,3383 @@ + + + + + + +RML-LV: Test Cases + + + + + + + + + + + + + + +
+ +

RML-LV: Test Cases

+

+ Draft Community Group Report + +

+
+ +
Latest published version:
+ https://www.w3.org/RML-LV-Testcases/ +
+
Latest editor's draft:
https://w3id.org/rml/lv/test-cases/
+ + + + +
Editors:
+ (Skemu) +
+ (Ghent University – imec – IDLab) +
+ +
Authors:
+ (Skemu) +
+ (Ghent University – imec – IDLab) +
+
Feedback:
+ GitHub kg-construct/rml-lv + (pull requests, + new issue, + open issues) +
+ +
+ + +
+
+ + + +

Abstract

This document defines the RML-LV test cases to the determine the RML-LV specification conformance of tools.

+
+ +

Status of This Document

+ This specification was published by the + Knowledge Graph Construction Community Group. It is not a W3C Standard nor is it + on the W3C Standards Track. + + Please note that under the + W3C Community Contributor License Agreement (CLA) + there is a limited opt-out and other conditions apply. + + Learn more about + W3C Community and Business Groups. +

+ GitHub Issues are preferred for + discussion of this specification. + + +

+ +

1. Introduction

+

This document defines the RML-LV test cases, consisting of a collection of test case documents (input and expected output). +The purpose of the test cases is to determine the conformance of tools that execute RML rules to the RML-LV specification.

+
+ +

2. Data model

+

The test cases are semantically described for re-usability and shareability following the W3C Test case description. +Each test:Testcase as the following properties:

+
    +
  • dcterms:identifier: unique ID of the test case.
  • +
  • rmltest:hasError: if an error of the RML Processor is expected or not.
  • +
  • rmltest:input: One or more input data of the test case.
  • +
  • rmltest:output: One or more output data of the test case.
  • +
  • rmltest:inputFormat: the input data format.
  • +
  • rmltest:outputFormat: the output data format.
  • +
  • rmltest:mappingDocument: the RML mapping rules in Turtle.
  • +
+
+ +

3. Test cases

+

This section describes the RML-LV test cases. These descriptions are also available as RDF. +The files are available on GitHub in the folder test-cases. +Each test case is contained in a single folder, containing three types of files:

+
    +
  • Zero or more files containing the data sources, in the case of JSON, XML, CSV, or containing the SQL statements to create the necessary tables, in the case of MySQL, PostgreSQL, and SQL Server.
  • +
  • One file with the RML rules, called mapping.ttl, in the Turtle format.
  • +
  • Zero or more files with the expected RDF. No file is provided if an error is expected that must halt the generation of the RDF because of an error.
  • +
+
+ + +

4. RMLLVTC0000a

+

Title: Logical view on JSON source

+

Description: Test a view on a hierarchical source

+

Error expected? No

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "items": [
+        {
+          "type": "sword",
+          "weight": 1500
+        },
+        {
+          "type": "shield",
+          "weight": 2500
+        }
+      ]
+    },
+    {
+      "name": "bob",
+      "items": [
+        {
+          "type": "flower",
+          "weight": 15
+        }
+      ]
+    }
+  ]
+}
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+  rml:viewOn :jsonSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+  ] .
+
+:triplesMapPerson a rml:TriplesMap ;
+  rml:logicalSource :jsonView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{name}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasName ;
+    rml:objectMap [
+      rml:reference "name" ;
+    ] ;
+  ] .
+
+

Output

+
<http://example.org/person/alice> <http://example.org/hasName> "alice" .
+<http://example.org/person/bob> <http://example.org/hasName> "bob" .
+
+
+

5. RMLLVTC0000b

+

Title: Logical view on CSV source

+

Description: Test a view on a tabular source

+

Error expected? No

+

Input

+
name,birthyear
+alice,1995
+bob,1999
+tobias,2005
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix : <http://example.org/> .
+
+:csvSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.csv" ;
+  ] ;
+  rml:referenceFormulation rml:CSV .
+
+:csvView a rml:LogicalView ;
+  rml:viewOn :csvSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "name" ;
+  ] .
+
+:triplesMapPerson a rml:TriplesMap ;
+  rml:logicalSource :csvView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{name}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasName ;
+    rml:objectMap [
+      rml:reference "name" ;
+    ] ;
+  ] .
+
+

Output

+
<http://example.org/person/alice> <http://example.org/hasName> "alice" .
+<http://example.org/person/bob> <http://example.org/hasName> "bob" .
+<http://example.org/person/tobias> <http://example.org/hasName> "tobias" .
+
+
+

6. RMLLVTC0000c

+

Title: Logical View on Logical View

+

Description: Test a view on a logical view

+

Error expected? No

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "items": [
+        {
+          "type": "sword",
+          "weight": 1500
+        },
+        {
+          "type": "shield",
+          "weight": 2500
+        }
+      ]
+    },
+    {
+      "name": "bob",
+      "items": [
+        {
+          "type": "flower",
+          "weight": 15
+        }
+      ]
+    }
+  ]
+}
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+  rml:viewOn :jsonSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+  ] .
+
+:jsonViewOnJsonView a rml:LogicalView ;
+  rml:viewOn :jsonView ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "newName" ;
+    rml:reference "name" ;
+  ] .
+
+:triplesMapPerson a rml:TriplesMap ;
+  rml:logicalSource :jsonViewOnJsonView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{newName}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasName ;
+    rml:objectMap [
+      rml:reference "newName" ;
+    ] ;
+  ] .
+
+

Output

+
<http://example.org/person/alice> <http://example.org/hasName> "alice" .
+<http://example.org/person/bob> <http://example.org/hasName> "bob" .
+
+
+

7. RMLLVTC0001a

+

Title: Expression Field: Reference

+

Description: Test a reference in an expression field

+

Error expected? No

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "items": [
+        {
+          "type": "sword",
+          "weight": 1500
+        },
+        {
+          "type": "shield",
+          "weight": 2500
+        }
+      ]
+    },
+    {
+      "name": "bob",
+      "items": [
+        {
+          "type": "flower",
+          "weight": 15
+        }
+      ]
+    }
+  ]
+}
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+  rml:viewOn :jsonSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+  ] .
+
+:triplesMapPerson a rml:TriplesMap ;
+  rml:logicalSource :jsonView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{name}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasName ;
+    rml:objectMap [
+      rml:reference "name" ;
+    ] ;
+  ] .
+
+

Output

+
<http://example.org/person/alice> <http://example.org/hasName> "alice" .
+<http://example.org/person/bob> <http://example.org/hasName> "bob" .
+
+
+

8. RMLLVTC0001b

+

Title: Expression Field: Template

+

Description: Test a template in an expression field

+

Error expected? No

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "items": [
+        {
+          "type": "sword",
+          "weight": 1500
+        },
+        {
+          "type": "shield",
+          "weight": 2500
+        }
+      ]
+    },
+    {
+      "name": "bob",
+      "items": [
+        {
+          "type": "flower",
+          "weight": 15
+        }
+      ]
+    }
+  ]
+}
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+  rml:viewOn :jsonSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+  ] ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "race" ;
+    rml:constant "human" ;
+  ] .
+
+:triplesMapPerson a rml:TriplesMap ;
+  rml:logicalSource :jsonView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{name}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasRace ;
+    rml:objectMap [
+      rml:reference "race" ;
+    ] ;
+  ] .
+
+

Output

+
<http://example.org/person/alice> <http://example.org/hasRace> "human" .
+<http://example.org/person/bob> <http://example.org/hasRace> "human" .
+
+
+

9. RMLLVTC0001c

+

Title: Expression Field: Constant

+

Description: Test a constant expression in an expression field

+

Error expected? No

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "lastName": "smith",
+      "items": [
+        {
+          "type": "sword",
+          "weight": 1500
+        },
+        {
+          "type": "shield",
+          "weight": 2500
+        }
+      ]
+    },
+    {
+      "name": "bob",
+      "lastName": "jones",
+      "items": [
+        {
+          "type": "flower",
+          "weight": 15
+        }
+      ]
+    }
+  ]
+}
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+  rml:viewOn :jsonSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+  ] ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "fullName" ;
+    rml:template "{name} {lastName}" ;
+  ] .
+
+:triplesMapPerson a rml:TriplesMap ;
+  rml:logicalSource :jsonView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{name}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasFullName ;
+    rml:objectMap [
+      rml:reference "fullName" ;
+    ] ;
+  ] .
+
+

Output

+
<http://example.org/person/alice> <http://example.org/hasFullName> "alice smith" .
+<http://example.org/person/bob> <http://example.org/hasFullName> "bob jones" .
+
+
+

10. RMLLVTC0001d

+

Title: Expression Field Siblings

+

Description: Test multiple expression fields with the same parent

+

Error expected? No

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "lastName": "smith",
+      "items": [
+        {
+          "type": "sword",
+          "weight": 1500
+        },
+        {
+          "type": "shield",
+          "weight": 2500
+        }
+      ]
+    },
+    {
+      "name": "bob",
+      "lastName": "jones",
+      "items": [
+        {
+          "type": "flower",
+          "weight": 15
+        }
+      ]
+    }
+  ]
+}
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+  rml:viewOn :jsonSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+  ] ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "lastName" ;
+    rml:reference "$.lastName" ;
+  ] .
+
+:triplesMapPerson a rml:TriplesMap ;
+  rml:logicalSource :jsonView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{name}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasFullName ;
+    rml:objectMap [
+      rml:template "{name} {lastName}" ;
+      rml:termType rml:Literal ;
+    ] ;
+  ] .
+
+

Output

+
<http://example.org/person/alice> <http://example.org/hasFullName> "alice smith" .
+<http://example.org/person/bob> <http://example.org/hasFullName> "bob jones" .
+
+
+

11. RMLLVTC0002a

+

Title: Iterable Field

+

Description: Test a nested field construction: iterable field with expression field as child

+

Error expected? No

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "items": [
+        {
+          "type": "sword",
+          "weight": 1500
+        },
+        {
+          "type": "shield",
+          "weight": 2500
+        }
+      ]
+    },
+    {
+      "name": "bob",
+      "items": [
+        {
+          "type": "flower",
+          "weight": 15
+        }
+      ]
+    }
+  ]
+}
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+  rml:viewOn :jsonSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+  ] ;
+  rml:field [
+    a rml:IterableField ;
+    rml:fieldName "item" ;
+    rml:iterator "$.items[*]" ;
+    rml:field [
+      a rml:ExpressionField ;
+      rml:fieldName "type" ;
+      rml:reference "$.type" ;
+    ] ;
+  ] .
+
+:triplesMapPerson a rml:TriplesMap ;
+  rml:logicalSource :jsonView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{name}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasItem ;
+    rml:objectMap [
+      rml:template "http://example.org/person/{name}/item/{item.type}" ;
+    ] ;
+  ] .
+
+

Output

+
<http://example.org/person/alice> <http://example.org/hasItem> <http://example.org/person/alice/item/sword> .
+<http://example.org/person/alice> <http://example.org/hasItem> <http://example.org/person/alice/item/shield> .
+<http://example.org/person/bob> <http://example.org/hasItem> <http://example.org/person/bob/item/flower> .
+
+
+

12. RMLLVTC0002b

+

Title: Iterable Field with Multiple Children

+

Description: Test a nested field construction: iterable field with mulitple expression fields as children

+

Error expected? No

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "items": [
+        {
+          "type": "sword",
+          "weight": 1500
+        },
+        {
+          "type": "shield",
+          "weight": 2500
+        }
+      ]
+    },
+    {
+      "name": "bob",
+      "items": [
+        {
+          "type": "flower",
+          "weight": 15
+        }
+      ]
+    }
+  ]
+}
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+  rml:viewOn :jsonSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+  ] ;
+  rml:field [
+    a rml:IterableField ;
+    rml:fieldName "item" ;
+    rml:iterator "$.items[*]" ;
+    rml:field [
+      a rml:ExpressionField ;
+      rml:fieldName "type" ;
+      rml:reference "$.type" ;
+    ] ;
+    rml:field [
+      a rml:ExpressionField ;
+      rml:fieldName "weight" ;
+      rml:reference "$.weight" ;
+    ] ;
+  ] .
+
+:triplesMapItem a rml:TriplesMap ;
+  rml:logicalSource :jsonView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{name}/item/{item.type}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasName ;
+    rml:objectMap [
+      rml:reference "item.type" ;
+    ] ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasWeight ;
+    rml:objectMap [
+      rml:reference "item.weight" ;
+      rml:datatype xsd:integer ;
+    ] ;
+  ] .
+
+

Output

+
<http://example.org/person/alice/item/sword> <http://example.org/hasName> "sword" .
+<http://example.org/person/alice/item/sword> <http://example.org/hasWeight> "1500"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.org/person/alice/item/shield> <http://example.org/hasName> "shield" .
+<http://example.org/person/alice/item/shield> <http://example.org/hasWeight> "2500"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.org/person/bob/item/flower> <http://example.org/hasName> "flower" .
+<http://example.org/person/bob/item/flower> <http://example.org/hasWeight> "15"^^<http://www.w3.org/2001/XMLSchema#integer> .
+
+
+

13. RMLLVTC0002c

+

Title: Nested Iterable Fields

+

Description: Test a nested field construction: iterable field with an iterable field as child

+

Error expected? No

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "items": [
+        {
+          "type": "sword",
+          "measures": {
+            "weight": 1500,
+            "length": 30
+          }
+        },
+        {
+          "type": "shield",
+          "measures": {
+            "weight": 2500
+          }
+        }
+      ]
+    },
+    {
+      "name": "bob",
+      "items": [
+        {
+          "type": "flower",
+          "measures" : {
+            "weight": 15,
+            "length" : 15
+          }
+        }
+      ]
+    }
+  ]
+}
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+  rml:viewOn :jsonSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+  ] ;
+  rml:field [
+    a rml:IterableField ;
+    rml:fieldName "item" ;
+    rml:iterator "$.items[*]" ;
+    rml:field [
+      rml:fieldName "type" ;
+      rml:reference "$.type" ;
+    ] ;
+    rml:field [
+      a rml:IterableField ;
+      rml:fieldName "measures";
+      rml:iterator "$.measures";
+      rml:field [
+        a rml:ExpressionField ;
+        rml:fieldName "weight" ;
+        rml:reference "$.weight" ;
+        ];
+      rml:field [
+        a rml:ExpressionField ;
+        rml:fieldName "length" ;
+        rml:reference "$.length" ;
+      ]
+    ] ;
+  ] .
+
+:triplesMapItem a rml:TriplesMap ;
+  rml:logicalSource :jsonView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{name}/item/{item.type}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasWeight ;
+    rml:objectMap [
+      rml:reference "item.measures.weight" ;
+      rml:datatype xsd:integer ;
+    ] ;
+  ] .
+
+

Output

+
<http://example.org/person/alice/item/sword> <http://example.org/hasWeight> "1500"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.org/person/alice/item/shield> <http://example.org/hasWeight> "2500"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.org/person/bob/item/flower> <http://example.org/hasWeight> "15"^^<http://www.w3.org/2001/XMLSchema#integer> .
+
+
+

14. RMLLVTC0003a

+

Title: Index Key: #

+

Description: Test a reference to the index key #

+

Error expected? No

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "items": [
+        {
+          "type": "sword",
+          "weight": 1500
+        },
+        {
+          "type": "shield",
+          "weight": 2500
+        }
+      ]
+    },
+    {
+      "name": "bob",
+      "items": [
+        {
+          "type": "flower",
+          "weight": 15
+        }
+      ]
+    }
+  ]
+}
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+  rml:viewOn :jsonSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+  ] .
+
+:triplesMapPerson a rml:TriplesMap ;
+  rml:logicalSource :jsonView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{name}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasSequenceNumber ;
+    rml:objectMap [
+      rml:reference "#" ;
+      rml:datatype xsd:integer ;
+    ] ;
+  ] .
+
+

Output

+
<http://example.org/person/alice> <http://example.org/hasSequenceNumber> "0"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.org/person/bob> <http://example.org/hasSequenceNumber> "1"^^<http://www.w3.org/2001/XMLSchema#integer> .
+
+
+

15. RMLLVTC0003b

+

Title: Index Key: Iterable Field

+

Description: Test a reference to the index key of an iterable field

+

Error expected? No

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "items": [
+        {
+          "type": "sword",
+          "weight": 1500
+        },
+        {
+          "type": "shield",
+          "weight": 2500
+        }
+      ]
+    },
+    {
+      "name": "bob",
+      "items": [
+        {
+          "type": "flower",
+          "weight": 15
+        }
+      ]
+    }
+  ]
+}
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+  rml:viewOn :jsonSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+  ] ;
+  rml:field [
+    a rml:IterableField ;
+    rml:fieldName "item" ;
+    rml:iterator "$.items[*]" ;
+    rml:field [
+      a rml:ExpressionField ;
+      rml:fieldName "type" ;
+      rml:reference "$.type" ;
+    ] ;
+  ] .
+
+:triplesMapPerson a rml:TriplesMap ;
+  rml:logicalSource :jsonView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{name}/item/{item.#}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasType ;
+    rml:objectMap [
+      rml:reference "item.type" ;
+    ] ;
+  ] .
+
+

Output

+
<http://example.org/person/alice/item/0> <http://example.org/hasType> "sword" .
+<http://example.org/person/alice/item/1> <http://example.org/hasType> "shield" .
+<http://example.org/person/bob/item/0> <http://example.org/hasType> "flower" .
+
+
+
+

16. RMLLVTC0003c

+

Title: Index Key: Expression field

+

Description: Test a reference to the index key of an expression field

+

Error expected? No

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "items": [
+        "sword",
+        "shield"
+      ]
+    },
+    {
+      "name": "bob",
+      "items": [
+        "flower"
+      ]
+    }
+  ]
+}
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+  rml:viewOn :jsonSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+  ] ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "item" ;
+    rml:reference "$.items[*]" ;
+  ] .
+
+:triplesMapItem a rml:TriplesMap ;
+  rml:logicalSource :jsonView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{name}/item/{item.#}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasType ;
+    rml:objectMap [
+      rml:reference "item" ;
+    ] ;
+  ] .
+
+

Output

+
<http://example.org/person/alice/item/0> <http://example.org/hasType> "sword" .
+<http://example.org/person/alice/item/1> <http://example.org/hasType> "shield" .
+<http://example.org/person/bob/item/0> <http://example.org/hasType> "flower" .
+
+
+

17. RMLLVTC0004a

+

Title: Natural Datatype: Index #

+

Description: Test the natural datatype mapping for the index #

+

Error expected? No

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "items": [
+        {
+          "type": "sword",
+          "weight": 1500
+        },
+        {
+          "type": "shield",
+          "weight": 2500
+        }
+      ]
+    },
+    {
+      "name": "bob",
+      "items": [
+        {
+          "type": "flower",
+          "weight": 15
+        }
+      ]
+    }
+  ]
+}
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+  rml:viewOn :jsonSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+  ] .
+
+:triplesMapPerson a rml:TriplesMap ;
+  rml:logicalSource :jsonView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{name}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasSequenceNumber ;
+    rml:objectMap [
+      rml:reference "#" ;
+    ] ;
+  ] .
+
+

Output

+
<http://example.org/person/alice> <http://example.org/hasSequenceNumber> "0"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.org/person/bob> <http://example.org/hasSequenceNumber> "1"^^<http://www.w3.org/2001/XMLSchema#integer> .
+
+
+

18. RMLLVTC0004b

+

Title: Natural Datatype: Index Expression Field

+

Description: Test the natural datatype mapping for the index of an expression field

+

Error expected? No

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "items": [
+        {
+          "type": "sword",
+          "weight": 1500
+        },
+        {
+          "type": "shield",
+          "weight": 2500
+        }
+      ]
+    },
+    {
+      "name": "bob",
+      "items": [
+        {
+          "type": "flower",
+          "weight": 15
+        }
+      ]
+    }
+  ]
+}
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+  rml:viewOn :jsonSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+  ] ;
+  rml:field [
+    a rml:IterableField ;
+    rml:fieldName "item" ;
+    rml:iterator "$.items[*]" ;
+    rml:field [
+      a rml:ExpressionField ;
+      rml:fieldName "type" ;
+      rml:reference "$.type" ;
+    ] ;
+  ] .
+
+:triplesMapPerson a rml:TriplesMap ;
+  rml:logicalSource :jsonView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{name}/item/{item.type}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasSequenceNumber ;
+    rml:objectMap [
+      rml:reference "item.#" ;
+    ] ;
+  ] .
+
+

Output

+
<http://example.org/person/alice/item/sword> <http://example.org/hasSequenceNumber> "0"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.org/person/alice/item/shield> <http://example.org/hasSequenceNumber> "1"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.org/person/bob/item/flower> <http://example.org/hasSequenceNumber> "0"^^<http://www.w3.org/2001/XMLSchema#integer> .
+
+
+

19. RMLLVTC0004c

+

Title: Natural Datatype: Index Iterable Field

+

Description: Test the natural datatype mapping for the index of an iterable field

+

Error expected? No

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "items": [
+        "sword",
+        "shield"
+      ]
+    },
+    {
+      "name": "bob",
+      "items": [
+        "flower"
+      ]
+    }
+  ]
+}
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+  rml:viewOn :jsonSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+  ] ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "item" ;
+    rml:reference "$.items[*]" ;
+  ] .
+
+:triplesMapItem a rml:TriplesMap ;
+  rml:logicalSource :jsonView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{name}/item/{item}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasSequenceNumber ;
+    rml:objectMap [
+      rml:reference "item.#" ;
+    ] ;
+  ] .
+
+

Output

+
<http://example.org/person/alice/item/sword> <http://example.org/hasSequenceNumber> "0"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.org/person/alice/item/shield> <http://example.org/hasSequenceNumber> "1"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.org/person/bob/item/flower> <http://example.org/hasSequenceNumber> "0"^^<http://www.w3.org/2001/XMLSchema#integer> .
+
+
+

20. RMLLVTC0004d

+

Title: Natural Datatype: Record Expression Field

+

Description: Test the natural datatype mapping for a record of an expression field

+

Error expected? No

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "birth_year": 1995
+    },
+    {
+      "name": "bob",
+      "birth_year": 1999
+    }
+  ]
+}
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+  rml:viewOn :jsonSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+  ] ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "birthyear" ;
+    rml:reference "$.birth_year" ;
+  ] .
+
+:triplesMapItem a rml:TriplesMap ;
+  rml:logicalSource :jsonView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{name}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasBirthYear ;
+    rml:objectMap [
+      rml:reference "birthyear" ;
+    ] ;
+  ] .
+
+

Output

+
<http://example.org/person/alice> <http://example.org/hasBirthYear> "1995"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.org/person/bob> <http://example.org/hasBirthYear> "1999"^^<http://www.w3.org/2001/XMLSchema#integer> .
+
+
+

21. RMLLVTC0005a

+

Title: Referencing a Non-Existing Key

+

Description: Test a reference to a non-existing key

+

Error expected? Yes

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "items": [
+        {
+          "type": "sword",
+          "weight": 1500
+        },
+        {
+          "type": "shield",
+          "weight": 2500
+        }
+      ]
+    },
+    {
+      "name": "bob",
+      "items": [
+        {
+          "type": "flower",
+          "weight": 15
+        }
+      ]
+    }
+  ]
+}
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+  rml:viewOn :jsonSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+  ] .
+
+:triplesMapPerson a rml:TriplesMap ;
+  rml:logicalSource :jsonView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{Name}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasName ;
+    rml:objectMap [
+      rml:reference "Name" ;
+    ] ;
+  ] .
+
+
+

22. RMLLVTC0005b

+

Title: Referencing the Record Key

+

Description: Test a reference to the record key

+

Error expected? Yes

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "items": [
+        {
+          "type": "sword",
+          "weight": 1500
+        },
+        {
+          "type": "shield",
+          "weight": 2500
+        }
+      ]
+    },
+    {
+      "name": "bob",
+      "items": [
+        {
+          "type": "flower",
+          "weight": 15
+        }
+      ]
+    }
+  ]
+}
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+  rml:viewOn :jsonSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+  ] .
+
+:triplesMapPerson a rml:TriplesMap ;
+  rml:logicalSource :jsonView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{name}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :isDerivedFrom ;
+    rml:objectMap [
+      rml:reference "<it>" ;
+    ] ;
+  ] .
+
+
+

23. RMLLVTC0005c

+

Title: Referencing the Record Key of an Iterable Field

+

Description: Test a reference to the record key of an iterable field

+

Error expected? Yes

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "items": [
+        {
+          "type": "sword",
+          "weight": 1500
+        },
+        {
+          "type": "shield",
+          "weight": 2500
+        }
+      ]
+    },
+    {
+      "name": "bob",
+      "items": [
+        {
+          "type": "flower",
+          "weight": 15
+        }
+      ]
+    }
+  ]
+}
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+  rml:viewOn :jsonSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+  ] ;
+  rml:field [
+    a rml:IterableField ;
+    rml:fieldName "item" ;
+    rml:iterator "$.items[*]" ;
+    rml:field [
+      a rml:ExpressionField ;
+      rml:fieldName "type" ;
+      rml:reference "$.type" ;
+    ] ;
+  ] .
+
+:triplesMapPerson a rml:TriplesMap ;
+  rml:logicalSource :jsonView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{name}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasItem ;
+    rml:objectMap [
+      rml:template "http://example.org/person/{name}/{item}" ;
+    ] ;
+  ] .
+
+
+

24. RMLLVTC0006a

+

Title: Left Join

+

Description: Test a left join

+

Error expected? No

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "items": [
+        "sword",
+        "shield"
+      ]
+    },
+    {
+      "name": "bob",
+      "items": [
+        "flower"
+      ]
+    }
+  ]
+}
+
+

Input 1

+
name,birthyear
+alice,1995
+bob,1999
+tobias,2005
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+  rml:viewOn :jsonSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+  ] ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "item" ;
+    rml:reference "$.items[*]" ;
+  ] .
+
+:csvSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.csv" ;
+  ] ;
+  rml:referenceFormulation rml:CSV .
+
+:csvView a rml:LogicalView ;
+  rml:viewOn :csvSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "name" ;
+  ] ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "birthyear" ;
+    rml:reference "birthyear" ;
+  ] ;
+  rml:leftJoin [
+    rml:parentLogicalView :jsonView ;
+    rml:joinCondition [
+      rml:parent "name" ;
+      rml:child "name" ;
+    ] ;
+    rml:field [
+      a rml:ExpressionField ;
+      rml:fieldName "json_item" ;
+      rml:reference "item" ;
+    ] ;
+  ] .
+
+
+:triplesMapPerson a rml:TriplesMap ;
+  rml:logicalSource :csvView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{name}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasBirthYear ;
+    rml:objectMap [
+      rml:reference "birthyear" ;
+      rml:datatype xsd:gYear ;
+    ] ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasItem ;
+    rml:objectMap [
+      rml:template "http://example.org/person/{name}/item/{json_item}" ;
+    ] ;
+  ] .
+
+

Output

+
<http://example.org/person/alice> <http://example.org/hasBirthYear> "1995"^^<http://www.w3.org/2001/XMLSchema#gYear> .
+<http://example.org/person/alice> <http://example.org/hasItem> <http://example.org/person/alice/item/sword> .
+<http://example.org/person/alice> <http://example.org/hasItem> <http://example.org/person/alice/item/shield> .
+<http://example.org/person/bob> <http://example.org/hasBirthYear> "1999"^^<http://www.w3.org/2001/XMLSchema#gYear> .
+<http://example.org/person/bob> <http://example.org/hasItem> <http://example.org/person/bob/item/flower> .
+<http://example.org/person/tobias> <http://example.org/hasBirthYear> "2005"^^<http://www.w3.org/2001/XMLSchema#gYear> .
+
+
+

25. RMLLVTC0006b

+

Title: Inner Join

+

Description: Test an inner join

+

Error expected? No

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "items": [
+        "sword",
+        "shield"
+      ]
+    },
+    {
+      "name": "bob",
+      "items": [
+        "flower"
+      ]
+    }
+  ]
+}
+
+

Input 1

+
name,birthyear
+alice,1995
+bob,1999
+tobias,2005
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+  rml:viewOn :jsonSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+  ] ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "item" ;
+    rml:reference "$.items[*]" ;
+  ] .
+
+:csvSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.csv" ;
+  ] ;
+  rml:referenceFormulation rml:CSV .
+
+:csvView a rml:LogicalView ;
+  rml:viewOn :csvSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "name" ;
+  ] ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "birthyear" ;
+    rml:reference "birthyear" ;
+  ] ;
+  rml:innerJoin [
+    rml:parentLogicalView :jsonView ;
+    rml:joinCondition [
+      rml:parent "name" ;
+      rml:child "name" ;
+    ] ;
+    rml:field [
+      a rml:ExpressionField ;
+      rml:fieldName "json_item" ;
+      rml:reference "item" ;
+    ] ;
+  ] .
+
+
+:triplesMapPerson a rml:TriplesMap ;
+  rml:logicalSource :csvView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{name}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasBirthYear ;
+    rml:objectMap [
+      rml:reference "birthyear" ;
+      rml:datatype xsd:gYear ;
+    ] ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasItem ;
+    rml:objectMap [
+      rml:template "http://example.org/person/{name}/item/{json_item}" ;
+    ] ;
+  ] .
+
+

Output

+
<http://example.org/person/alice> <http://example.org/hasBirthYear> "1995"^^<http://www.w3.org/2001/XMLSchema#gYear> .
+<http://example.org/person/alice> <http://example.org/hasItem> <http://example.org/person/alice/item/sword> .
+<http://example.org/person/alice> <http://example.org/hasItem> <http://example.org/person/alice/item/shield> .
+<http://example.org/person/bob> <http://example.org/hasBirthYear> "1999"^^<http://www.w3.org/2001/XMLSchema#gYear> .
+<http://example.org/person/bob> <http://example.org/hasItem> <http://example.org/person/bob/item/flower> .
+
+
+

26. RMLLVTC0006c

+

Title: Two Left Joins

+

Description: Test two left joins in one logical view

+

Error expected? No

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "items": [
+        "sword",
+        "shield"
+      ]
+    },
+    {
+      "name": "bob",
+      "items": [
+        "flower"
+      ]
+    }
+  ]
+}
+
+

Input 1

+
name,birthyear
+alice,1995
+bob,1999
+tobias,2005
+
+

Input 2

+
name,id
+alice,123
+bob,456
+tobias,789
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+  rml:viewOn :jsonSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+  ] ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "item" ;
+    rml:reference "$.items[*]" ;
+  ] .
+
+:additionalCsvSource a rml:LogicalSource ;
+  rml:source [
+   a rml:RelativePathSource , rml:Source ;
+   rml:root rml:MappingDirectory ;
+   rml:path "people2.csv" ;
+  ] ;
+  rml:referenceFormulation rml:CSV .
+
+:additionalCsvView a rml:LogicalView ;
+  rml:viewOn :additionalCsvSource ;
+    rml:field [
+     a rml:ExpressionField ;
+     rml:fieldName "name" ;
+     rml:reference "name" ;
+    ] ;
+    rml:field [
+     a rml:ExpressionField ;
+     rml:fieldName "id" ;
+     rml:reference "id" ;
+    ] ;
+.
+
+:csvSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.csv" ;
+  ] ;
+  rml:referenceFormulation rml:CSV .
+
+:csvView a rml:LogicalView ;
+  rml:viewOn :csvSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "name" ;
+  ] ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "birthyear" ;
+    rml:reference "birthyear" ;
+  ] ;
+  rml:leftJoin [
+    rml:parentLogicalView :jsonView ;
+    rml:joinCondition [
+      rml:parent "name" ;
+      rml:child "name" ;
+    ] ;
+    rml:field [
+      a rml:ExpressionField ;
+      rml:fieldName "json_item" ;
+      rml:reference "item" ;
+    ] ;
+  ] ;
+  rml:leftJoin [
+    rml:parentLogicalView :additionalCsvView ;
+    rml:joinCondition [
+      rml:parent "name" ;
+      rml:child "name" ;
+    ] ;
+    rml:field [
+      a rml:ExpressionField ;
+      rml:fieldName "csv2_id" ;
+      rml:reference "id" ;
+    ] ;
+  ] .
+
+
+:triplesMapPerson a rml:TriplesMap ;
+  rml:logicalSource :csvView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{csv2_id}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasBirthYear ;
+    rml:objectMap [
+      rml:reference "birthyear" ;
+      rml:datatype xsd:gYear ;
+    ] ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasItem ;
+    rml:objectMap [
+      rml:template "http://example.org/person/{csv2_id}/item/{json_item}" ;
+    ] ;
+  ] .
+
+

Output

+
<http://example.org/person/123> <http://example.org/hasBirthYear> "1995"^^<http://www.w3.org/2001/XMLSchema#gYear> .
+<http://example.org/person/123> <http://example.org/hasItem> <http://example.org/person/123/item/sword> .
+<http://example.org/person/123> <http://example.org/hasItem> <http://example.org/person/123/item/shield> .
+<http://example.org/person/456> <http://example.org/hasBirthYear> "1999"^^<http://www.w3.org/2001/XMLSchema#gYear> .
+<http://example.org/person/456> <http://example.org/hasItem> <http://example.org/person/456/item/flower> .
+<http://example.org/person/789> <http://example.org/hasBirthYear> "2005"^^<http://www.w3.org/2001/XMLSchema#gYear> .
+
+
+

27. RMLLVTC0006d

+

Title: Inner Join and Left Join

+

Description: Test an inner join and a left join in one logical view

+

Error expected? No

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "items": [
+        "sword",
+        "shield"
+      ]
+    },
+    {
+      "name": "bob",
+      "items": [
+        "flower"
+      ]
+    }
+  ]
+}
+
+

Input 1

+
name,birthyear
+alice,1995
+bob,1999
+tobias,2005
+
+

Input 2

+
name,id
+alice,123
+bob,456
+tobias,789
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+  rml:viewOn :jsonSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+  ] ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "item" ;
+    rml:reference "$.items[*]" ;
+  ] .
+
+:additionalCsvSource a rml:LogicalSource ;
+  rml:source [
+   a rml:RelativePathSource , rml:Source ;
+   rml:root rml:MappingDirectory ;
+   rml:path "people2.csv" ;
+  ] ;
+  rml:referenceFormulation rml:CSV .
+
+:additionalCsvView a rml:LogicalView ;
+  rml:viewOn :additionalCsvSource ;
+    rml:field [
+     a rml:ExpressionField ;
+     rml:fieldName "name" ;
+     rml:reference "name" ;
+    ] ;
+    rml:field [
+     a rml:ExpressionField ;
+     rml:fieldName "id" ;
+     rml:reference "id" ;
+    ] ;
+.
+
+:csvSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.csv" ;
+  ] ;
+  rml:referenceFormulation rml:CSV .
+
+:csvView a rml:LogicalView ;
+  rml:viewOn :csvSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "name" ;
+  ] ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "birthyear" ;
+    rml:reference "birthyear" ;
+  ] ;
+  rml:innerJoin [
+    rml:parentLogicalView :jsonView ;
+    rml:joinCondition [
+      rml:parent "name" ;
+      rml:child "name" ;
+    ] ;
+    rml:field [
+      a rml:ExpressionField ;
+      rml:fieldName "json_item" ;
+      rml:reference "item" ;
+    ] ;
+  ] ;
+  rml:leftJoin [
+    rml:parentLogicalView :additionalCsvView ;
+    rml:joinCondition [
+      rml:parent "name" ;
+      rml:child "name" ;
+    ] ;
+    rml:field [
+      a rml:ExpressionField ;
+      rml:fieldName "csv2_id" ;
+      rml:reference "id" ;
+    ] ;
+  ] .
+
+
+:triplesMapPerson a rml:TriplesMap ;
+  rml:logicalSource :csvView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{csv2_id}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasBirthYear ;
+    rml:objectMap [
+      rml:reference "birthyear" ;
+      rml:datatype xsd:gYear ;
+    ] ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasItem ;
+    rml:objectMap [
+      rml:template "http://example.org/person/{csv2_id}/item/{json_item}" ;
+    ] ;
+  ] .
+
+

Output

+
<http://example.org/person/123> <http://example.org/hasBirthYear> "1995"^^<http://www.w3.org/2001/XMLSchema#gYear> .
+<http://example.org/person/123> <http://example.org/hasItem> <http://example.org/person/123/item/sword> .
+<http://example.org/person/123> <http://example.org/hasItem> <http://example.org/person/123/item/shield> .
+<http://example.org/person/456> <http://example.org/hasBirthYear> "1999"^^<http://www.w3.org/2001/XMLSchema#gYear> .
+<http://example.org/person/456> <http://example.org/hasItem> <http://example.org/person/456/item/flower> .
+
+
+

28. RMLLVTC0006e

+

Title: Two Inner Joins

+

Description: Test two left joins in one logical view

+

Error expected? No

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "items": [
+        "sword",
+        "shield"
+      ]
+    },
+    {
+      "name": "bob",
+      "items": [
+        "flower"
+      ]
+    }
+  ]
+}
+
+

Input 1

+
name,birthyear
+alice,1995
+bob,1999
+tobias,2005
+
+

Input 2

+
name,id
+alice,123
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+  rml:viewOn :jsonSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+  ] ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "item" ;
+    rml:reference "$.items[*]" ;
+  ] .
+
+:additionalCsvSource a rml:LogicalSource ;
+  rml:source [
+   a rml:RelativePathSource , rml:Source ;
+   rml:root rml:MappingDirectory ;
+   rml:path "people2.csv" ;
+  ] ;
+  rml:referenceFormulation rml:CSV .
+
+:additionalCsvView a rml:LogicalView ;
+  rml:viewOn :additionalCsvSource ;
+    rml:field [
+     a rml:ExpressionField ;
+     rml:fieldName "name" ;
+     rml:reference "name" ;
+    ] ;
+    rml:field [
+     a rml:ExpressionField ;
+     rml:fieldName "id" ;
+     rml:reference "id" ;
+    ] ;
+.
+
+:csvSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.csv" ;
+  ] ;
+  rml:referenceFormulation rml:CSV .
+
+:csvView a rml:LogicalView ;
+  rml:viewOn :csvSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "name" ;
+  ] ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "birthyear" ;
+    rml:reference "birthyear" ;
+  ] ;
+  rml:innerJoin [
+    rml:parentLogicalView :jsonView ;
+    rml:joinCondition [
+      rml:parent "name" ;
+      rml:child "name" ;
+    ] ;
+    rml:field [
+      a rml:ExpressionField ;
+      rml:fieldName "json_item" ;
+      rml:reference "item" ;
+    ] ;
+  ] ;
+  rml:innerJoin [
+    rml:parentLogicalView :additionalCsvView ;
+    rml:joinCondition [
+      rml:parent "name" ;
+      rml:child "name" ;
+    ] ;
+    rml:field [
+      a rml:ExpressionField ;
+      rml:fieldName "csv2_id" ;
+      rml:reference "id" ;
+    ] ;
+  ] .
+
+
+:triplesMapPerson a rml:TriplesMap ;
+  rml:logicalSource :csvView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{csv2_id}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasBirthYear ;
+    rml:objectMap [
+      rml:reference "birthyear" ;
+      rml:datatype xsd:gYear ;
+    ] ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasItem ;
+    rml:objectMap [
+      rml:template "http://example.org/person/{csv2_id}/item/{json_item}" ;
+    ] ;
+  ] .
+
+

Output

+
<http://example.org/person/123> <http://example.org/hasBirthYear> "1995"^^<http://www.w3.org/2001/XMLSchema#gYear> .
+<http://example.org/person/123> <http://example.org/hasItem> <http://example.org/person/123/item/sword> .
+<http://example.org/person/123> <http://example.org/hasItem> <http://example.org/person/123/item/shield> .
+
+
+

29. RMLLVTC0006f

+

Title: Index Key of Field in Join

+

Description: Test references to indexes of fields from a join

+

Error expected? No

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "items": [
+        "sword",
+        "shield"
+      ]
+    },
+    {
+      "name": "bob",
+      "items": [
+        "flower"
+      ]
+    }
+  ]
+}
+
+

Input 1

+
name,birthyear
+alice,1995
+tobias,2005
+bob,1999
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+  rml:viewOn :jsonSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+  ] ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "item" ;
+    rml:reference "$.items[*]" ;
+  ] .
+
+:csvSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.csv" ;
+  ] ;
+  rml:referenceFormulation rml:CSV .
+
+:csvView a rml:LogicalView ;
+  rml:viewOn :csvSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "name" ;
+  ] ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "birthyear" ;
+    rml:reference "birthyear" ;
+  ] ;
+  rml:innerJoin [
+    rml:parentLogicalView :jsonView ;
+    rml:joinCondition [
+      rml:parent "name" ;
+      rml:child "name" ;
+    ] ;
+    rml:field [
+      a rml:ExpressionField ;
+      rml:fieldName "json_item" ;
+      rml:reference "item" ;
+    ] ;
+  ] .
+
+
+:triplesMapPerson a rml:TriplesMap ;
+  rml:logicalSource :csvView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{#}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasBirthYear ;
+    rml:objectMap [
+      rml:reference "birthyear" ;
+      rml:datatype xsd:gYear ;
+    ] ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasItem ;
+    rml:objectMap [
+      rml:template "http://example.org/person/{#}/item/{json_item.#}/{json_item}" ;
+    ] ;
+  ] .
+
+

Output

+
<http://example.org/person/0> <http://example.org/hasBirthYear> "1995"^^<http://www.w3.org/2001/XMLSchema#gYear> .
+<http://example.org/person/0> <http://example.org/hasItem> <http://example.org/person/0/item/0/sword> .
+<http://example.org/person/0> <http://example.org/hasItem> <http://example.org/person/0/item/1/shield> .
+<http://example.org/person/2> <http://example.org/hasBirthYear> "1999"^^<http://www.w3.org/2001/XMLSchema#gYear> .
+<http://example.org/person/2> <http://example.org/hasItem> <http://example.org/person/2/item/0/flower> .
+
+
+
+

30. RMLLVTC0007a

+

Title: Change Reference Formulations: CSV including JSON array

+

Description: Test a change of reference formulations: csv source including json array

+

Error expected? No

+

Input

+
name,items
+alice,"[{""type"":""sword"",""weight"":1500},{""type"":""shield"",""weight"":2500}]"
+bob,"[{""type"":""flower"",""weight"":15}]"
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+
+:mixedCSVSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.csv" ;
+  ] ;
+  rml:referenceFormulation rml:CSV .
+
+:mixedCSVView a rml:LogicalView ;
+  rml:viewOn :mixedCSVSource ;
+  rml:field [
+    a rml:ExpressionField;
+    rml:fieldName "name" ;
+    rml:reference "name" ;
+  ] ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "items" ;
+    rml:reference "items" ;
+    rml:field [
+      a rml:IterableField ;
+      rml:referenceFormulation rml:JSONPath ;
+      rml:iterator "$[*]" ;
+      rml:fieldName "item" ;
+      rml:field [
+        a rml:ExpressionField ;
+        rml:fieldName "type" ;
+        rml:reference "$.type" ;
+      ] ;
+      rml:field [
+        a rml:ExpressionField ;
+        rml:fieldName "weight" ;
+        rml:reference "$.weight" ;
+      ] ;
+    ] ;
+  ] .
+
+:triplesMapItem a rml:TriplesMap ;
+  rml:logicalSource :mixedCSVView ;
+  rml:subjectMap [
+    rml:template "http://example.org/item_{#}_{items.item.#}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasType ;
+    rml:objectMap [
+      rml:reference "items.item.type" ;
+    ] ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasWeight ;
+    rml:objectMap [
+      rml:reference "items.item.weight" ;
+      rml:datatype xsd:integer ;
+    ] ;
+  ] .
+
+

Output

+
<http://example.org/item_0_0> <http://example.org/hasType> "sword" .
+<http://example.org/item_0_0> <http://example.org/hasWeight> "1500"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.org/item_0_1> <http://example.org/hasType> "shield" .
+<http://example.org/item_0_1> <http://example.org/hasWeight> "2500"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.org/item_1_0> <http://example.org/hasType> "flower" .
+<http://example.org/item_1_0> <http://example.org/hasWeight> "15"^^<http://www.w3.org/2001/XMLSchema#integer> .
+
+
+

31. RMLLVTC0007b

+

Title: Change Reference Formulations: CSV including JSON object

+

Description: Test a change of reference formulations: csv source including json object

+

Error expected? No

+

Input

+
name,item
+alice,"{""type"":""sword"",""weight"":1500}"
+alice,"{""type"":""shield"",""weight"":2500}"
+bob,"{""type"":""flower"",""weight"":15}"
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+
+:mixedCSVSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.csv" ;
+  ] ;
+  rml:referenceFormulation rml:CSV .
+
+:mixedCSVView a rml:LogicalView ;
+  rml:viewOn :mixedCSVSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "name" ;
+  ] ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "item" ;
+    rml:reference "item" ;
+    rml:field [
+      a rml:IterableField ;
+      rml:referenceFormulation rml:JSONPath ;
+      rml:iterator "$[*]" ;
+      rml:fieldName "itemJson" ;
+      rml:field [
+        a rml:ExpressionField;
+        rml:fieldName "type" ;
+        rml:reference "$.type" ; ] ;
+      rml:field [
+        a rml:ExpressionField;
+        rml:fieldName "weight" ;
+        rml:reference "$.weight" ;
+      ] ;
+    ] ;
+  ] .
+
+:triplesMapItem a rml:TriplesMap ;
+  rml:logicalSource :mixedCSVView ;
+  rml:subjectMap [
+    rml:template "http://example.org/item_{#}_{item.#}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasType ;
+    rml:objectMap [
+      rml:reference "item.itemJson.type" ;
+    ] ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasWeight ;
+    rml:objectMap [
+      rml:reference "item.itemJson.weight" ;
+      rml:datatype xsd:integer ;
+    ] ;
+  ] .
+
+

Output

+
<http://example.org/item_0_0> <http://example.org/hasType> "sword" .
+<http://example.org/item_0_0> <http://example.org/hasWeight> "1500"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.org/item_1_0> <http://example.org/hasType> "shield" .
+<http://example.org/item_1_0> <http://example.org/hasWeight> "2500"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.org/item_2_0> <http://example.org/hasType> "flower" .
+<http://example.org/item_2_0> <http://example.org/hasWeight> "15"^^<http://www.w3.org/2001/XMLSchema#integer> .
+
+
+

32. RMLLVTC0007c

+

Title: Change Reference Formulations: JSON including CSV

+

Description: Test a change of reference formulations: json source including csv data

+

Error expected? No

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "items": "type,weight\nsword,1500\nshield,2500"
+    },
+    {
+      "name": "bob",
+      "items": "type,weight\nflower,15"
+    }
+  ]
+}
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+
+:mixedJSONSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:mixedJSONView a rml:LogicalView ;
+  rml:viewOn :mixedJSONSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+    ] ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "items" ;
+    rml:reference "$.items" ;
+    rml:field [
+      a rml:IterableField ;
+      rml:referenceFormulation rml:CSV ;
+      rml:fieldName "item";
+      rml:field [
+        a rml:ExpressionField ;
+        rml:fieldName "type" ;
+        rml:reference "type" ;
+      ] ;
+      rml:field [
+        a rml:expressionField ;
+        rml:fieldName "weight" ;
+        rml:reference "weight" ;
+      ] ;
+    ] ;
+  ].
+
+:triplesMapItem a rml:TriplesMap ;
+  rml:logicalSource :mixedJSONView ;
+  rml:subjectMap [
+    rml:template "http://example.org/item_{#}_{items.item.#}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasType ;
+    rml:objectMap [
+      rml:reference "items.item.type" ;
+    ] ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasWeight ;
+    rml:objectMap [
+      rml:reference "items.item.weight" ;
+      rml:datatype xsd:integer ;
+    ] ;
+  ] .
+
+

Output

+
<http://example.org/item_0_0> <http://example.org/hasType> "sword" .
+<http://example.org/item_0_0> <http://example.org/hasWeight> "1500"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.org/item_0_1> <http://example.org/hasType> "shield" .
+<http://example.org/item_0_1> <http://example.org/hasWeight> "2500"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.org/item_1_0> <http://example.org/hasType> "flower" .
+<http://example.org/item_1_0> <http://example.org/hasWeight> "15"^^<http://www.w3.org/2001/XMLSchema#integer> .
+
+
+

33. RMLLVTC0008a

+

Title: Cycle: Abstract Logical Source

+

Description: Test a cycle in the abstract logical source of a logical view

+

Error expected? Yes

+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix : <http://example.org/> .
+
+:view1 a rml:LogicalView ;
+  rml:viewOn :view2 ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name1" ;
+    rml:reference "name2" ;
+  ] .
+
+:view2 a rml:LogicalView ;
+  rml:viewOn :view1 ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name2" ;
+    rml:reference "name1" ;
+  ] .
+
+:triplesMapPerson a rml:TriplesMap ;
+  rml:logicalSource :view2 ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{name2}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasName ;
+    rml:objectMap [
+      rml:reference "name2" ;
+    ] ;
+  ] .
+
+
+

34. RMLLVTC0008b

+

Title: Cycle: Joins

+

Description: Test a cycle in two joins of two logical views

+

Error expected? No

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "items": [
+        "sword",
+        "shield"
+      ]
+    },
+    {
+      "name": "bob",
+      "items": [
+        "flower"
+      ]
+    }
+  ]
+}
+
+

Input 1

+
name,birthyear
+alice,1995
+bob,1999
+tobias,2005
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+  rml:viewOn :jsonSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+  ] ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "item" ;
+    rml:reference "$.items[*]" ;
+  ] ;
+  rml:leftJoin [
+    rml:parentLogicalView :csvView ;
+    rml:joinCondition [
+      rml:parent "name" ;
+      rml:child "name" ;
+    ] ;
+    rml:field [
+      a rml:ExpressionField ;
+      rml:fieldName "csv_birthyear" ;
+      rml:reference "birthyear" ;
+    ] ;
+  ] .
+
+:csvSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.csv" ;
+  ] ;
+  rml:referenceFormulation rml:CSV .
+
+:csvView a rml:LogicalView ;
+  rml:viewOn :csvSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "name" ;
+  ] ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "birthyear" ;
+    rml:reference "birthyear" ;
+  ] ;
+  rml:leftJoin [
+    rml:parentLogicalView :jsonView ;
+    rml:joinCondition [
+      rml:parent "name" ;
+      rml:child "name" ;
+    ] ;
+    rml:field [
+      a rml:ExpressionField ;
+      rml:fieldName "json_item" ;
+      rml:reference "item" ;
+    ] ;
+  ] .
+
+
+:triplesMapPerson a rml:TriplesMap ;
+  rml:logicalSource :csvView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{name}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasBirthYear ;
+    rml:objectMap [
+      rml:reference "birthyear" ;
+      rml:datatype xsd:gYear ;
+    ] ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasItem ;
+    rml:objectMap [
+      rml:template "http://example.org/person/{name}/item/{json_item}" ;
+    ] ;
+  ] .
+
+

Output

+
<http://example.org/person/alice> <http://example.org/hasBirthYear> "1995"^^<http://www.w3.org/2001/XMLSchema#gYear> .
+<http://example.org/person/alice> <http://example.org/hasItem> <http://example.org/person/alice/item/sword> .
+<http://example.org/person/alice> <http://example.org/hasItem> <http://example.org/person/alice/item/shield> .
+<http://example.org/person/bob> <http://example.org/hasBirthYear> "1999"^^<http://www.w3.org/2001/XMLSchema#gYear> .
+<http://example.org/person/bob> <http://example.org/hasItem> <http://example.org/person/bob/item/flower> .
+<http://example.org/person/tobias> <http://example.org/hasBirthYear> "2005"^^<http://www.w3.org/2001/XMLSchema#gYear> .
+
+
+

35. RMLLVTC0008c

+

Title: Cycle: Self-Join

+

Description: Test a cycle in a join of a logical view: self-join

+

Error expected? Yes

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "items": [
+        {
+          "type": "sword",
+          "weight": 1500
+        },
+        {
+          "type": "shield",
+          "weight": 2500
+        }
+      ]
+    },
+    {
+      "name": "bob",
+      "items": [
+        {
+          "type": "flower",
+          "weight": 15
+        }
+      ]
+    }
+  ]
+}
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+  rml:viewOn :jsonSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+  ] ;
+  rml:leftJoin [
+    rml:parentLogicalView :jsonView ;
+    rml:joinCondition [
+      rml:parent "name" ;
+      rml:child "name" ;
+    ] ;
+    rml:field [
+      a rml:ExpressionField ;
+      rml:fieldName "newName" ;
+      rml:reference "name" ;
+    ] ;
+  ] .
+
+:triplesMapPerson a rml:TriplesMap ;
+  rml:logicalSource :jsonView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{newName}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasName ;
+    rml:objectMap [
+      rml:reference "newName" ;
+    ] ;
+  ] .
+
+
+ + + + + \ No newline at end of file diff --git a/src/test/resources/rml-lv/docs/20250508/index.html b/src/test/resources/rml-lv/docs/20250508/index.html new file mode 100644 index 00000000..70bbcb8a --- /dev/null +++ b/src/test/resources/rml-lv/docs/20250508/index.html @@ -0,0 +1,3529 @@ + + + + + + +RML-LV: Test Cases + + + + + + + + + + + + + + + + +
+ +

RML-LV: Test Cases

+

+ Draft Community Group Report + +

+
+ +
Latest published version:
+ https://www.w3.org/RML-LV-Testcases/ +
+
Latest editor's draft:
https://w3id.org/rml/lv/test-cases/
+ + + + +
Editors:
+ (Skemu) +
+ (Ghent University – imec – IDLab) +
+ +
Authors:
+ (Skemu) +
+ (Ghent University – imec – IDLab) +
+
Feedback:
+ GitHub kg-construct/rml-lv + (pull requests, + new issue, + open issues) +
+ +
+ + +
+
+ + + +

Abstract

This document defines the RML-LV test cases to the determine the RML-LV specification conformance of tools.

+
+ +

Status of This Document

+ This specification was published by the + Knowledge Graph Construction Community Group. It is not a W3C Standard nor is it + on the W3C Standards Track. + + Please note that under the + W3C Community Contributor License Agreement (CLA) + there is a limited opt-out and other conditions apply. + + Learn more about + W3C Community and Business Groups. +

+ GitHub Issues are preferred for + discussion of this specification. + + +

+ +

1. Introduction

+

This document defines the RML-LV test cases, consisting of a collection of test case documents (input and expected output). +The purpose of the test cases is to determine the conformance of tools that execute RML rules to the RML-LV specification.

+
+ +

2. Data model

+

The test cases are semantically described for re-usability and shareability following the W3C Test case description. +Each test:Testcase as the following properties:

+
    +
  • dcterms:identifier: unique ID of the test case.
  • +
  • rmltest:hasError: if an error of the RML Processor is expected or not.
  • +
  • rmltest:input: One or more input data of the test case.
  • +
  • rmltest:output: One or more output data of the test case.
  • +
  • rmltest:inputFormat: the input data format.
  • +
  • rmltest:outputFormat: the output data format.
  • +
  • rmltest:mappingDocument: the RML mapping rules in Turtle.
  • +
+
+ +

3. Test cases

+

This section describes the RML-LV test cases. These descriptions are also available as RDF. +The files are available on GitHub in the folder test-cases. +Each test case is contained in a single folder, containing three types of files:

+
    +
  • Zero or more files containing the data sources, in the case of JSON, XML, CSV, or containing the SQL statements to create the necessary tables, in the case of MySQL, PostgreSQL, and SQL Server.
  • +
  • One file with the RML rules, called mapping.ttl, in the Turtle format.
  • +
  • Zero or more files with the expected RDF. No file is provided if an error is expected that must halt the generation of the RDF because of an error.
  • +
+
+ + +

4. RMLLVTC0000a

+

Title: Logical view on JSON source

+

Description: Test a view on a hierarchical source

+

Error expected? No

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "items": [
+        {
+          "type": "sword",
+          "weight": 1500
+        },
+        {
+          "type": "shield",
+          "weight": 2500
+        }
+      ]
+    },
+    {
+      "name": "bob",
+      "items": [
+        {
+          "type": "flower",
+          "weight": 15
+        }
+      ]
+    }
+  ]
+}
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+  rml:viewOn :jsonSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+  ] .
+
+:triplesMapPerson a rml:TriplesMap ;
+  rml:logicalSource :jsonView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{name}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasName ;
+    rml:objectMap [
+      rml:reference "name" ;
+    ] ;
+  ] .
+
+

Output

+
<http://example.org/person/alice> <http://example.org/hasName> "alice" .
+<http://example.org/person/bob> <http://example.org/hasName> "bob" .
+
+
+

5. RMLLVTC0000b

+

Title: Logical view on CSV source

+

Description: Test a view on a tabular source

+

Error expected? No

+

Input

+
name,birthyear
+alice,1995
+bob,1999
+tobias,2005
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix : <http://example.org/> .
+
+:csvSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.csv" ;
+  ] ;
+  rml:referenceFormulation rml:CSV .
+
+:csvView a rml:LogicalView ;
+  rml:viewOn :csvSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "name" ;
+  ] .
+
+:triplesMapPerson a rml:TriplesMap ;
+  rml:logicalSource :csvView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{name}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasName ;
+    rml:objectMap [
+      rml:reference "name" ;
+    ] ;
+  ] .
+
+

Output

+
<http://example.org/person/alice> <http://example.org/hasName> "alice" .
+<http://example.org/person/bob> <http://example.org/hasName> "bob" .
+<http://example.org/person/tobias> <http://example.org/hasName> "tobias" .
+
+
+

6. RMLLVTC0000c

+

Title: Logical View on Logical View

+

Description: Test a view on a logical view

+

Error expected? No

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "items": [
+        {
+          "type": "sword",
+          "weight": 1500
+        },
+        {
+          "type": "shield",
+          "weight": 2500
+        }
+      ]
+    },
+    {
+      "name": "bob",
+      "items": [
+        {
+          "type": "flower",
+          "weight": 15
+        }
+      ]
+    }
+  ]
+}
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+  rml:viewOn :jsonSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+  ] .
+
+:jsonViewOnJsonView a rml:LogicalView ;
+  rml:viewOn :jsonView ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "newName" ;
+    rml:reference "name" ;
+  ] .
+
+:triplesMapPerson a rml:TriplesMap ;
+  rml:logicalSource :jsonViewOnJsonView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{newName}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasName ;
+    rml:objectMap [
+      rml:reference "newName" ;
+    ] ;
+  ] .
+
+

Output

+
<http://example.org/person/alice> <http://example.org/hasName> "alice" .
+<http://example.org/person/bob> <http://example.org/hasName> "bob" .
+
+
+

7. RMLLVTC0001a

+

Title: Expression Field: Reference

+

Description: Test a reference in an expression field

+

Error expected? No

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "items": [
+        {
+          "type": "sword",
+          "weight": 1500
+        },
+        {
+          "type": "shield",
+          "weight": 2500
+        }
+      ]
+    },
+    {
+      "name": "bob",
+      "items": [
+        {
+          "type": "flower",
+          "weight": 15
+        }
+      ]
+    }
+  ]
+}
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+  rml:viewOn :jsonSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+  ] .
+
+:triplesMapPerson a rml:TriplesMap ;
+  rml:logicalSource :jsonView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{name}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasName ;
+    rml:objectMap [
+      rml:reference "name" ;
+    ] ;
+  ] .
+
+

Output

+
<http://example.org/person/alice> <http://example.org/hasName> "alice" .
+<http://example.org/person/bob> <http://example.org/hasName> "bob" .
+
+
+

8. RMLLVTC0001b

+

Title: Expression Field: Template

+

Description: Test a template in an expression field

+

Error expected? No

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "items": [
+        {
+          "type": "sword",
+          "weight": 1500
+        },
+        {
+          "type": "shield",
+          "weight": 2500
+        }
+      ]
+    },
+    {
+      "name": "bob",
+      "items": [
+        {
+          "type": "flower",
+          "weight": 15
+        }
+      ]
+    }
+  ]
+}
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+  rml:viewOn :jsonSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+  ] ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "race" ;
+    rml:constant "human" ;
+  ] .
+
+:triplesMapPerson a rml:TriplesMap ;
+  rml:logicalSource :jsonView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{name}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasRace ;
+    rml:objectMap [
+      rml:reference "race" ;
+    ] ;
+  ] .
+
+

Output

+
<http://example.org/person/alice> <http://example.org/hasRace> "human" .
+<http://example.org/person/bob> <http://example.org/hasRace> "human" .
+
+
+

9. RMLLVTC0001c

+

Title: Expression Field: Constant

+

Description: Test a constant expression in an expression field

+

Error expected? No

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "lastName": "smith",
+      "items": [
+        {
+          "type": "sword",
+          "weight": 1500
+        },
+        {
+          "type": "shield",
+          "weight": 2500
+        }
+      ]
+    },
+    {
+      "name": "bob",
+      "lastName": "jones",
+      "items": [
+        {
+          "type": "flower",
+          "weight": 15
+        }
+      ]
+    }
+  ]
+}
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+  rml:viewOn :jsonSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+  ] ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "fullName" ;
+    rml:template "{name} {lastName}" ;
+  ] .
+
+:triplesMapPerson a rml:TriplesMap ;
+  rml:logicalSource :jsonView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{name}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasFullName ;
+    rml:objectMap [
+      rml:reference "fullName" ;
+    ] ;
+  ] .
+
+

Output

+
<http://example.org/person/alice> <http://example.org/hasFullName> "alice smith" .
+<http://example.org/person/bob> <http://example.org/hasFullName> "bob jones" .
+
+
+

10. RMLLVTC0001d

+

Title: Expression Field Siblings

+

Description: Test multiple expression fields with the same parent

+

Error expected? No

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "lastName": "smith",
+      "items": [
+        {
+          "type": "sword",
+          "weight": 1500
+        },
+        {
+          "type": "shield",
+          "weight": 2500
+        }
+      ]
+    },
+    {
+      "name": "bob",
+      "lastName": "jones",
+      "items": [
+        {
+          "type": "flower",
+          "weight": 15
+        }
+      ]
+    }
+  ]
+}
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+  rml:viewOn :jsonSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+  ] ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "lastName" ;
+    rml:reference "$.lastName" ;
+  ] .
+
+:triplesMapPerson a rml:TriplesMap ;
+  rml:logicalSource :jsonView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{name}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasFullName ;
+    rml:objectMap [
+      rml:template "{name} {lastName}" ;
+      rml:termType rml:Literal ;
+    ] ;
+  ] .
+
+

Output

+
<http://example.org/person/alice> <http://example.org/hasFullName> "alice smith" .
+<http://example.org/person/bob> <http://example.org/hasFullName> "bob jones" .
+
+
+

11. RMLLVTC0002a

+

Title: Iterable Field

+

Description: Test a nested field construction: iterable field with expression field as child

+

Error expected? No

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "items": [
+        {
+          "type": "sword",
+          "weight": 1500
+        },
+        {
+          "type": "shield",
+          "weight": 2500
+        }
+      ]
+    },
+    {
+      "name": "bob",
+      "items": [
+        {
+          "type": "flower",
+          "weight": 15
+        }
+      ]
+    }
+  ]
+}
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+  rml:viewOn :jsonSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+  ] ;
+  rml:field [
+    a rml:IterableField ;
+    rml:fieldName "item" ;
+    rml:iterator "$.items[*]" ;
+    rml:field [
+      a rml:ExpressionField ;
+      rml:fieldName "type" ;
+      rml:reference "$.type" ;
+    ] ;
+  ] .
+
+:triplesMapPerson a rml:TriplesMap ;
+  rml:logicalSource :jsonView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{name}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasItem ;
+    rml:objectMap [
+      rml:template "http://example.org/person/{name}/item/{item.type}" ;
+    ] ;
+  ] .
+
+

Output

+
<http://example.org/person/alice> <http://example.org/hasItem> <http://example.org/person/alice/item/sword> .
+<http://example.org/person/alice> <http://example.org/hasItem> <http://example.org/person/alice/item/shield> .
+<http://example.org/person/bob> <http://example.org/hasItem> <http://example.org/person/bob/item/flower> .
+
+
+

12. RMLLVTC0002b

+

Title: Iterable Field with Multiple Children

+

Description: Test a nested field construction: iterable field with mulitple expression fields as children

+

Error expected? No

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "items": [
+        {
+          "type": "sword",
+          "weight": 1500
+        },
+        {
+          "type": "shield",
+          "weight": 2500
+        }
+      ]
+    },
+    {
+      "name": "bob",
+      "items": [
+        {
+          "type": "flower",
+          "weight": 15
+        }
+      ]
+    }
+  ]
+}
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+  rml:viewOn :jsonSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+  ] ;
+  rml:field [
+    a rml:IterableField ;
+    rml:fieldName "item" ;
+    rml:iterator "$.items[*]" ;
+    rml:field [
+      a rml:ExpressionField ;
+      rml:fieldName "type" ;
+      rml:reference "$.type" ;
+    ] ;
+    rml:field [
+      a rml:ExpressionField ;
+      rml:fieldName "weight" ;
+      rml:reference "$.weight" ;
+    ] ;
+  ] .
+
+:triplesMapItem a rml:TriplesMap ;
+  rml:logicalSource :jsonView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{name}/item/{item.type}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasName ;
+    rml:objectMap [
+      rml:reference "item.type" ;
+    ] ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasWeight ;
+    rml:objectMap [
+      rml:reference "item.weight" ;
+      rml:datatype xsd:integer ;
+    ] ;
+  ] .
+
+

Output

+
<http://example.org/person/alice/item/sword> <http://example.org/hasName> "sword" .
+<http://example.org/person/alice/item/sword> <http://example.org/hasWeight> "1500"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.org/person/alice/item/shield> <http://example.org/hasName> "shield" .
+<http://example.org/person/alice/item/shield> <http://example.org/hasWeight> "2500"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.org/person/bob/item/flower> <http://example.org/hasName> "flower" .
+<http://example.org/person/bob/item/flower> <http://example.org/hasWeight> "15"^^<http://www.w3.org/2001/XMLSchema#integer> .
+
+
+

13. RMLLVTC0002c

+

Title: Nested Iterable Fields

+

Description: Test a nested field construction: iterable field with an iterable field as child

+

Error expected? No

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "items": [
+        {
+          "type": "sword",
+          "measures": {
+            "weight": 1500,
+            "length": 30
+          }
+        },
+        {
+          "type": "shield",
+          "measures": {
+            "weight": 2500
+          }
+        }
+      ]
+    },
+    {
+      "name": "bob",
+      "items": [
+        {
+          "type": "flower",
+          "measures" : {
+            "weight": 15,
+            "length" : 15
+          }
+        }
+      ]
+    }
+  ]
+}
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+  rml:viewOn :jsonSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+  ] ;
+  rml:field [
+    a rml:IterableField ;
+    rml:fieldName "item" ;
+    rml:iterator "$.items[*]" ;
+    rml:field [
+      rml:fieldName "type" ;
+      rml:reference "$.type" ;
+    ] ;
+    rml:field [
+      a rml:IterableField ;
+      rml:fieldName "measures";
+      rml:iterator "$.measures";
+      rml:field [
+        a rml:ExpressionField ;
+        rml:fieldName "weight" ;
+        rml:reference "$.weight" ;
+        ];
+      rml:field [
+        a rml:ExpressionField ;
+        rml:fieldName "length" ;
+        rml:reference "$.length" ;
+      ]
+    ] ;
+  ] .
+
+:triplesMapItem a rml:TriplesMap ;
+  rml:logicalSource :jsonView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{name}/item/{item.type}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasWeight ;
+    rml:objectMap [
+      rml:reference "item.measures.weight" ;
+      rml:datatype xsd:integer ;
+    ] ;
+  ] .
+
+

Output

+
<http://example.org/person/alice/item/sword> <http://example.org/hasWeight> "1500"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.org/person/alice/item/shield> <http://example.org/hasWeight> "2500"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.org/person/bob/item/flower> <http://example.org/hasWeight> "15"^^<http://www.w3.org/2001/XMLSchema#integer> .
+
+
+

14. RMLLVTC0003a

+

Title: Index Key: #

+

Description: Test a reference to the index key #

+

Error expected? No

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "items": [
+        {
+          "type": "sword",
+          "weight": 1500
+        },
+        {
+          "type": "shield",
+          "weight": 2500
+        }
+      ]
+    },
+    {
+      "name": "bob",
+      "items": [
+        {
+          "type": "flower",
+          "weight": 15
+        }
+      ]
+    }
+  ]
+}
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+  rml:viewOn :jsonSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+  ] .
+
+:triplesMapPerson a rml:TriplesMap ;
+  rml:logicalSource :jsonView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{name}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasSequenceNumber ;
+    rml:objectMap [
+      rml:reference "#" ;
+      rml:datatype xsd:integer ;
+    ] ;
+  ] .
+
+

Output

+
<http://example.org/person/alice> <http://example.org/hasSequenceNumber> "0"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.org/person/bob> <http://example.org/hasSequenceNumber> "1"^^<http://www.w3.org/2001/XMLSchema#integer> .
+
+
+

15. RMLLVTC0003b

+

Title: Index Key: Iterable Field

+

Description: Test a reference to the index key of an iterable field

+

Error expected? No

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "items": [
+        {
+          "type": "sword",
+          "weight": 1500
+        },
+        {
+          "type": "shield",
+          "weight": 2500
+        }
+      ]
+    },
+    {
+      "name": "bob",
+      "items": [
+        {
+          "type": "flower",
+          "weight": 15
+        }
+      ]
+    }
+  ]
+}
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+  rml:viewOn :jsonSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+  ] ;
+  rml:field [
+    a rml:IterableField ;
+    rml:fieldName "item" ;
+    rml:iterator "$.items[*]" ;
+    rml:field [
+      a rml:ExpressionField ;
+      rml:fieldName "type" ;
+      rml:reference "$.type" ;
+    ] ;
+  ] .
+
+:triplesMapPerson a rml:TriplesMap ;
+  rml:logicalSource :jsonView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{name}/item/{item.#}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasType ;
+    rml:objectMap [
+      rml:reference "item.type" ;
+    ] ;
+  ] .
+
+

Output

+
<http://example.org/person/alice/item/0> <http://example.org/hasType> "sword" .
+<http://example.org/person/alice/item/1> <http://example.org/hasType> "shield" .
+<http://example.org/person/bob/item/0> <http://example.org/hasType> "flower" .
+
+
+
+

16. RMLLVTC0003c

+

Title: Index Key: Expression field

+

Description: Test a reference to the index key of an expression field

+

Error expected? No

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "items": [
+        "sword",
+        "shield"
+      ]
+    },
+    {
+      "name": "bob",
+      "items": [
+        "flower"
+      ]
+    }
+  ]
+}
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+  rml:viewOn :jsonSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+  ] ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "item" ;
+    rml:reference "$.items[*]" ;
+  ] .
+
+:triplesMapItem a rml:TriplesMap ;
+  rml:logicalSource :jsonView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{name}/item/{item.#}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasType ;
+    rml:objectMap [
+      rml:reference "item" ;
+    ] ;
+  ] .
+
+

Output

+
<http://example.org/person/alice/item/0> <http://example.org/hasType> "sword" .
+<http://example.org/person/alice/item/1> <http://example.org/hasType> "shield" .
+<http://example.org/person/bob/item/0> <http://example.org/hasType> "flower" .
+
+
+

17. RMLLVTC0004a

+

Title: Natural Datatype: Index #

+

Description: Test the natural datatype mapping for the index #

+

Error expected? No

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "items": [
+        {
+          "type": "sword",
+          "weight": 1500
+        },
+        {
+          "type": "shield",
+          "weight": 2500
+        }
+      ]
+    },
+    {
+      "name": "bob",
+      "items": [
+        {
+          "type": "flower",
+          "weight": 15
+        }
+      ]
+    }
+  ]
+}
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+  rml:viewOn :jsonSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+  ] .
+
+:triplesMapPerson a rml:TriplesMap ;
+  rml:logicalSource :jsonView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{name}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasSequenceNumber ;
+    rml:objectMap [
+      rml:reference "#" ;
+    ] ;
+  ] .
+
+

Output

+
<http://example.org/person/alice> <http://example.org/hasSequenceNumber> "0"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.org/person/bob> <http://example.org/hasSequenceNumber> "1"^^<http://www.w3.org/2001/XMLSchema#integer> .
+
+
+

18. RMLLVTC0004b

+

Title: Natural Datatype: Index Expression Field

+

Description: Test the natural datatype mapping for the index of an expression field

+

Error expected? No

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "items": [
+        {
+          "type": "sword",
+          "weight": 1500
+        },
+        {
+          "type": "shield",
+          "weight": 2500
+        }
+      ]
+    },
+    {
+      "name": "bob",
+      "items": [
+        {
+          "type": "flower",
+          "weight": 15
+        }
+      ]
+    }
+  ]
+}
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+  rml:viewOn :jsonSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+  ] ;
+  rml:field [
+    a rml:IterableField ;
+    rml:fieldName "item" ;
+    rml:iterator "$.items[*]" ;
+    rml:field [
+      a rml:ExpressionField ;
+      rml:fieldName "type" ;
+      rml:reference "$.type" ;
+    ] ;
+  ] .
+
+:triplesMapPerson a rml:TriplesMap ;
+  rml:logicalSource :jsonView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{name}/item/{item.type}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasSequenceNumber ;
+    rml:objectMap [
+      rml:reference "item.#" ;
+    ] ;
+  ] .
+
+

Output

+
<http://example.org/person/alice/item/sword> <http://example.org/hasSequenceNumber> "0"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.org/person/alice/item/shield> <http://example.org/hasSequenceNumber> "1"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.org/person/bob/item/flower> <http://example.org/hasSequenceNumber> "0"^^<http://www.w3.org/2001/XMLSchema#integer> .
+
+
+

19. RMLLVTC0004c

+

Title: Natural Datatype: Index Iterable Field

+

Description: Test the natural datatype mapping for the index of an iterable field

+

Error expected? No

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "items": [
+        "sword",
+        "shield"
+      ]
+    },
+    {
+      "name": "bob",
+      "items": [
+        "flower"
+      ]
+    }
+  ]
+}
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+  rml:viewOn :jsonSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+  ] ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "item" ;
+    rml:reference "$.items[*]" ;
+  ] .
+
+:triplesMapItem a rml:TriplesMap ;
+  rml:logicalSource :jsonView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{name}/item/{item}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasSequenceNumber ;
+    rml:objectMap [
+      rml:reference "item.#" ;
+    ] ;
+  ] .
+
+

Output

+
<http://example.org/person/alice/item/sword> <http://example.org/hasSequenceNumber> "0"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.org/person/alice/item/shield> <http://example.org/hasSequenceNumber> "1"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.org/person/bob/item/flower> <http://example.org/hasSequenceNumber> "0"^^<http://www.w3.org/2001/XMLSchema#integer> .
+
+
+

20. RMLLVTC0004d

+

Title: Natural Datatype: Record Expression Field

+

Description: Test the natural datatype mapping for a record of an expression field

+

Error expected? No

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "birth_year": 1995
+    },
+    {
+      "name": "bob",
+      "birth_year": 1999
+    }
+  ]
+}
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+  rml:viewOn :jsonSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+  ] ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "birthyear" ;
+    rml:reference "$.birth_year" ;
+  ] .
+
+:triplesMapItem a rml:TriplesMap ;
+  rml:logicalSource :jsonView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{name}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasBirthYear ;
+    rml:objectMap [
+      rml:reference "birthyear" ;
+    ] ;
+  ] .
+
+

Output

+
<http://example.org/person/alice> <http://example.org/hasBirthYear> "1995"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.org/person/bob> <http://example.org/hasBirthYear> "1999"^^<http://www.w3.org/2001/XMLSchema#integer> .
+
+
+

21. RMLLVTC0005a

+

Title: Referencing a Non-Existing Key

+

Description: Test a reference to a non-existing key

+

Error expected? Yes

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "items": [
+        {
+          "type": "sword",
+          "weight": 1500
+        },
+        {
+          "type": "shield",
+          "weight": 2500
+        }
+      ]
+    },
+    {
+      "name": "bob",
+      "items": [
+        {
+          "type": "flower",
+          "weight": 15
+        }
+      ]
+    }
+  ]
+}
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+  rml:viewOn :jsonSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+  ] .
+
+:triplesMapPerson a rml:TriplesMap ;
+  rml:logicalSource :jsonView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{Name}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasName ;
+    rml:objectMap [
+      rml:reference "Name" ;
+    ] ;
+  ] .
+
+
+

22. RMLLVTC0005b

+

Title: Referencing the Record Key

+

Description: Test a reference to the record key

+

Error expected? Yes

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "items": [
+        {
+          "type": "sword",
+          "weight": 1500
+        },
+        {
+          "type": "shield",
+          "weight": 2500
+        }
+      ]
+    },
+    {
+      "name": "bob",
+      "items": [
+        {
+          "type": "flower",
+          "weight": 15
+        }
+      ]
+    }
+  ]
+}
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+  rml:viewOn :jsonSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+  ] .
+
+:triplesMapPerson a rml:TriplesMap ;
+  rml:logicalSource :jsonView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{name}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :isDerivedFrom ;
+    rml:objectMap [
+      rml:reference "<it>" ;
+    ] ;
+  ] .
+
+
+

23. RMLLVTC0005c

+

Title: Referencing the Record Key of an Iterable Field

+

Description: Test a reference to the record key of an iterable field

+

Error expected? Yes

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "items": [
+        {
+          "type": "sword",
+          "weight": 1500
+        },
+        {
+          "type": "shield",
+          "weight": 2500
+        }
+      ]
+    },
+    {
+      "name": "bob",
+      "items": [
+        {
+          "type": "flower",
+          "weight": 15
+        }
+      ]
+    }
+  ]
+}
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+  rml:viewOn :jsonSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+  ] ;
+  rml:field [
+    a rml:IterableField ;
+    rml:fieldName "item" ;
+    rml:iterator "$.items[*]" ;
+    rml:field [
+      a rml:ExpressionField ;
+      rml:fieldName "type" ;
+      rml:reference "$.type" ;
+    ] ;
+  ] .
+
+:triplesMapPerson a rml:TriplesMap ;
+  rml:logicalSource :jsonView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{name}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasItem ;
+    rml:objectMap [
+      rml:template "http://example.org/person/{name}/{item}" ;
+    ] ;
+  ] .
+
+
+

24. RMLLVTC0006a

+

Title: Left Join

+

Description: Test a left join

+

Error expected? No

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "items": [
+        "sword",
+        "shield"
+      ]
+    },
+    {
+      "name": "bob",
+      "items": [
+        "flower"
+      ]
+    }
+  ]
+}
+
+

Input 1

+
name,birthyear
+alice,1995
+bob,1999
+tobias,2005
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+  rml:viewOn :jsonSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+  ] ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "item" ;
+    rml:reference "$.items[*]" ;
+  ] .
+
+:csvSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.csv" ;
+  ] ;
+  rml:referenceFormulation rml:CSV .
+
+:csvView a rml:LogicalView ;
+  rml:viewOn :csvSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "name" ;
+  ] ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "birthyear" ;
+    rml:reference "birthyear" ;
+  ] ;
+  rml:leftJoin [
+    rml:parentLogicalView :jsonView ;
+    rml:joinCondition [
+      rml:parent "name" ;
+      rml:child "name" ;
+    ] ;
+    rml:field [
+      a rml:ExpressionField ;
+      rml:fieldName "json_item" ;
+      rml:reference "item" ;
+    ] ;
+  ] .
+
+
+:triplesMapPerson a rml:TriplesMap ;
+  rml:logicalSource :csvView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{name}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasBirthYear ;
+    rml:objectMap [
+      rml:reference "birthyear" ;
+      rml:datatype xsd:gYear ;
+    ] ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasItem ;
+    rml:objectMap [
+      rml:template "http://example.org/person/{name}/item/{json_item}" ;
+    ] ;
+  ] .
+
+

Output

+
<http://example.org/person/alice> <http://example.org/hasBirthYear> "1995"^^<http://www.w3.org/2001/XMLSchema#gYear> .
+<http://example.org/person/alice> <http://example.org/hasItem> <http://example.org/person/alice/item/sword> .
+<http://example.org/person/alice> <http://example.org/hasItem> <http://example.org/person/alice/item/shield> .
+<http://example.org/person/bob> <http://example.org/hasBirthYear> "1999"^^<http://www.w3.org/2001/XMLSchema#gYear> .
+<http://example.org/person/bob> <http://example.org/hasItem> <http://example.org/person/bob/item/flower> .
+<http://example.org/person/tobias> <http://example.org/hasBirthYear> "2005"^^<http://www.w3.org/2001/XMLSchema#gYear> .
+
+
+

25. RMLLVTC0006b

+

Title: Inner Join

+

Description: Test an inner join

+

Error expected? No

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "items": [
+        "sword",
+        "shield"
+      ]
+    },
+    {
+      "name": "bob",
+      "items": [
+        "flower"
+      ]
+    }
+  ]
+}
+
+

Input 1

+
name,birthyear
+alice,1995
+bob,1999
+tobias,2005
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+  rml:viewOn :jsonSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+  ] ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "item" ;
+    rml:reference "$.items[*]" ;
+  ] .
+
+:csvSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.csv" ;
+  ] ;
+  rml:referenceFormulation rml:CSV .
+
+:csvView a rml:LogicalView ;
+  rml:viewOn :csvSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "name" ;
+  ] ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "birthyear" ;
+    rml:reference "birthyear" ;
+  ] ;
+  rml:innerJoin [
+    rml:parentLogicalView :jsonView ;
+    rml:joinCondition [
+      rml:parent "name" ;
+      rml:child "name" ;
+    ] ;
+    rml:field [
+      a rml:ExpressionField ;
+      rml:fieldName "json_item" ;
+      rml:reference "item" ;
+    ] ;
+  ] .
+
+
+:triplesMapPerson a rml:TriplesMap ;
+  rml:logicalSource :csvView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{name}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasBirthYear ;
+    rml:objectMap [
+      rml:reference "birthyear" ;
+      rml:datatype xsd:gYear ;
+    ] ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasItem ;
+    rml:objectMap [
+      rml:template "http://example.org/person/{name}/item/{json_item}" ;
+    ] ;
+  ] .
+
+

Output

+
<http://example.org/person/alice> <http://example.org/hasBirthYear> "1995"^^<http://www.w3.org/2001/XMLSchema#gYear> .
+<http://example.org/person/alice> <http://example.org/hasItem> <http://example.org/person/alice/item/sword> .
+<http://example.org/person/alice> <http://example.org/hasItem> <http://example.org/person/alice/item/shield> .
+<http://example.org/person/bob> <http://example.org/hasBirthYear> "1999"^^<http://www.w3.org/2001/XMLSchema#gYear> .
+<http://example.org/person/bob> <http://example.org/hasItem> <http://example.org/person/bob/item/flower> .
+
+
+

26. RMLLVTC0006c

+

Title: Two Left Joins

+

Description: Test two left joins in one logical view

+

Error expected? No

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "items": [
+        "sword",
+        "shield"
+      ]
+    },
+    {
+      "name": "bob",
+      "items": [
+        "flower"
+      ]
+    }
+  ]
+}
+
+

Input 1

+
name,birthyear
+alice,1995
+bob,1999
+tobias,2005
+
+

Input 2

+
name,id
+alice,123
+bob,456
+tobias,789
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+  rml:viewOn :jsonSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+  ] ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "item" ;
+    rml:reference "$.items[*]" ;
+  ] .
+
+:additionalCsvSource a rml:LogicalSource ;
+  rml:source [
+   a rml:RelativePathSource , rml:Source ;
+   rml:root rml:MappingDirectory ;
+   rml:path "people2.csv" ;
+  ] ;
+  rml:referenceFormulation rml:CSV .
+
+:additionalCsvView a rml:LogicalView ;
+  rml:viewOn :additionalCsvSource ;
+    rml:field [
+     a rml:ExpressionField ;
+     rml:fieldName "name" ;
+     rml:reference "name" ;
+    ] ;
+    rml:field [
+     a rml:ExpressionField ;
+     rml:fieldName "id" ;
+     rml:reference "id" ;
+    ] ;
+.
+
+:csvSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.csv" ;
+  ] ;
+  rml:referenceFormulation rml:CSV .
+
+:csvView a rml:LogicalView ;
+  rml:viewOn :csvSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "name" ;
+  ] ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "birthyear" ;
+    rml:reference "birthyear" ;
+  ] ;
+  rml:leftJoin [
+    rml:parentLogicalView :jsonView ;
+    rml:joinCondition [
+      rml:parent "name" ;
+      rml:child "name" ;
+    ] ;
+    rml:field [
+      a rml:ExpressionField ;
+      rml:fieldName "json_item" ;
+      rml:reference "item" ;
+    ] ;
+  ] ;
+  rml:leftJoin [
+    rml:parentLogicalView :additionalCsvView ;
+    rml:joinCondition [
+      rml:parent "name" ;
+      rml:child "name" ;
+    ] ;
+    rml:field [
+      a rml:ExpressionField ;
+      rml:fieldName "csv2_id" ;
+      rml:reference "id" ;
+    ] ;
+  ] .
+
+
+:triplesMapPerson a rml:TriplesMap ;
+  rml:logicalSource :csvView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{csv2_id}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasBirthYear ;
+    rml:objectMap [
+      rml:reference "birthyear" ;
+      rml:datatype xsd:gYear ;
+    ] ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasItem ;
+    rml:objectMap [
+      rml:template "http://example.org/person/{csv2_id}/item/{json_item}" ;
+    ] ;
+  ] .
+
+

Output

+
<http://example.org/person/123> <http://example.org/hasBirthYear> "1995"^^<http://www.w3.org/2001/XMLSchema#gYear> .
+<http://example.org/person/123> <http://example.org/hasItem> <http://example.org/person/123/item/sword> .
+<http://example.org/person/123> <http://example.org/hasItem> <http://example.org/person/123/item/shield> .
+<http://example.org/person/456> <http://example.org/hasBirthYear> "1999"^^<http://www.w3.org/2001/XMLSchema#gYear> .
+<http://example.org/person/456> <http://example.org/hasItem> <http://example.org/person/456/item/flower> .
+<http://example.org/person/789> <http://example.org/hasBirthYear> "2005"^^<http://www.w3.org/2001/XMLSchema#gYear> .
+
+
+

27. RMLLVTC0006d

+

Title: Inner Join and Left Join

+

Description: Test an inner join and a left join in one logical view

+

Error expected? No

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "items": [
+        "sword",
+        "shield"
+      ]
+    },
+    {
+      "name": "bob",
+      "items": [
+        "flower"
+      ]
+    }
+  ]
+}
+
+

Input 1

+
name,birthyear
+alice,1995
+bob,1999
+tobias,2005
+
+

Input 2

+
name,id
+alice,123
+bob,456
+tobias,789
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+  rml:viewOn :jsonSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+  ] ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "item" ;
+    rml:reference "$.items[*]" ;
+  ] .
+
+:additionalCsvSource a rml:LogicalSource ;
+  rml:source [
+   a rml:RelativePathSource , rml:Source ;
+   rml:root rml:MappingDirectory ;
+   rml:path "people2.csv" ;
+  ] ;
+  rml:referenceFormulation rml:CSV .
+
+:additionalCsvView a rml:LogicalView ;
+  rml:viewOn :additionalCsvSource ;
+    rml:field [
+     a rml:ExpressionField ;
+     rml:fieldName "name" ;
+     rml:reference "name" ;
+    ] ;
+    rml:field [
+     a rml:ExpressionField ;
+     rml:fieldName "id" ;
+     rml:reference "id" ;
+    ] ;
+.
+
+:csvSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.csv" ;
+  ] ;
+  rml:referenceFormulation rml:CSV .
+
+:csvView a rml:LogicalView ;
+  rml:viewOn :csvSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "name" ;
+  ] ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "birthyear" ;
+    rml:reference "birthyear" ;
+  ] ;
+  rml:innerJoin [
+    rml:parentLogicalView :jsonView ;
+    rml:joinCondition [
+      rml:parent "name" ;
+      rml:child "name" ;
+    ] ;
+    rml:field [
+      a rml:ExpressionField ;
+      rml:fieldName "json_item" ;
+      rml:reference "item" ;
+    ] ;
+  ] ;
+  rml:leftJoin [
+    rml:parentLogicalView :additionalCsvView ;
+    rml:joinCondition [
+      rml:parent "name" ;
+      rml:child "name" ;
+    ] ;
+    rml:field [
+      a rml:ExpressionField ;
+      rml:fieldName "csv2_id" ;
+      rml:reference "id" ;
+    ] ;
+  ] .
+
+
+:triplesMapPerson a rml:TriplesMap ;
+  rml:logicalSource :csvView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{csv2_id}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasBirthYear ;
+    rml:objectMap [
+      rml:reference "birthyear" ;
+      rml:datatype xsd:gYear ;
+    ] ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasItem ;
+    rml:objectMap [
+      rml:template "http://example.org/person/{csv2_id}/item/{json_item}" ;
+    ] ;
+  ] .
+
+

Output

+
<http://example.org/person/123> <http://example.org/hasBirthYear> "1995"^^<http://www.w3.org/2001/XMLSchema#gYear> .
+<http://example.org/person/123> <http://example.org/hasItem> <http://example.org/person/123/item/sword> .
+<http://example.org/person/123> <http://example.org/hasItem> <http://example.org/person/123/item/shield> .
+<http://example.org/person/456> <http://example.org/hasBirthYear> "1999"^^<http://www.w3.org/2001/XMLSchema#gYear> .
+<http://example.org/person/456> <http://example.org/hasItem> <http://example.org/person/456/item/flower> .
+
+
+

28. RMLLVTC0006e

+

Title: Two Inner Joins

+

Description: Test two left joins in one logical view

+

Error expected? No

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "items": [
+        "sword",
+        "shield"
+      ]
+    },
+    {
+      "name": "bob",
+      "items": [
+        "flower"
+      ]
+    }
+  ]
+}
+
+

Input 1

+
name,birthyear
+alice,1995
+bob,1999
+tobias,2005
+
+

Input 2

+
name,id
+alice,123
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+  rml:viewOn :jsonSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+  ] ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "item" ;
+    rml:reference "$.items[*]" ;
+  ] .
+
+:additionalCsvSource a rml:LogicalSource ;
+  rml:source [
+   a rml:RelativePathSource , rml:Source ;
+   rml:root rml:MappingDirectory ;
+   rml:path "people2.csv" ;
+  ] ;
+  rml:referenceFormulation rml:CSV .
+
+:additionalCsvView a rml:LogicalView ;
+  rml:viewOn :additionalCsvSource ;
+    rml:field [
+     a rml:ExpressionField ;
+     rml:fieldName "name" ;
+     rml:reference "name" ;
+    ] ;
+    rml:field [
+     a rml:ExpressionField ;
+     rml:fieldName "id" ;
+     rml:reference "id" ;
+    ] ;
+.
+
+:csvSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.csv" ;
+  ] ;
+  rml:referenceFormulation rml:CSV .
+
+:csvView a rml:LogicalView ;
+  rml:viewOn :csvSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "name" ;
+  ] ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "birthyear" ;
+    rml:reference "birthyear" ;
+  ] ;
+  rml:innerJoin [
+    rml:parentLogicalView :jsonView ;
+    rml:joinCondition [
+      rml:parent "name" ;
+      rml:child "name" ;
+    ] ;
+    rml:field [
+      a rml:ExpressionField ;
+      rml:fieldName "json_item" ;
+      rml:reference "item" ;
+    ] ;
+  ] ;
+  rml:innerJoin [
+    rml:parentLogicalView :additionalCsvView ;
+    rml:joinCondition [
+      rml:parent "name" ;
+      rml:child "name" ;
+    ] ;
+    rml:field [
+      a rml:ExpressionField ;
+      rml:fieldName "csv2_id" ;
+      rml:reference "id" ;
+    ] ;
+  ] .
+
+
+:triplesMapPerson a rml:TriplesMap ;
+  rml:logicalSource :csvView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{csv2_id}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasBirthYear ;
+    rml:objectMap [
+      rml:reference "birthyear" ;
+      rml:datatype xsd:gYear ;
+    ] ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasItem ;
+    rml:objectMap [
+      rml:template "http://example.org/person/{csv2_id}/item/{json_item}" ;
+    ] ;
+  ] .
+
+

Output

+
<http://example.org/person/123> <http://example.org/hasBirthYear> "1995"^^<http://www.w3.org/2001/XMLSchema#gYear> .
+<http://example.org/person/123> <http://example.org/hasItem> <http://example.org/person/123/item/sword> .
+<http://example.org/person/123> <http://example.org/hasItem> <http://example.org/person/123/item/shield> .
+
+
+

29. RMLLVTC0006f

+

Title: Index Key of Field in Join

+

Description: Test references to indexes of fields from a join

+

Error expected? No

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "items": [
+        "sword",
+        "shield"
+      ]
+    },
+    {
+      "name": "bob",
+      "items": [
+        "flower"
+      ]
+    }
+  ]
+}
+
+

Input 1

+
name,birthyear
+alice,1995
+tobias,2005
+bob,1999
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+  rml:viewOn :jsonSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+  ] ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "item" ;
+    rml:reference "$.items[*]" ;
+  ] .
+
+:csvSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.csv" ;
+  ] ;
+  rml:referenceFormulation rml:CSV .
+
+:csvView a rml:LogicalView ;
+  rml:viewOn :csvSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "name" ;
+  ] ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "birthyear" ;
+    rml:reference "birthyear" ;
+  ] ;
+  rml:innerJoin [
+    rml:parentLogicalView :jsonView ;
+    rml:joinCondition [
+      rml:parent "name" ;
+      rml:child "name" ;
+    ] ;
+    rml:field [
+      a rml:ExpressionField ;
+      rml:fieldName "json_item" ;
+      rml:reference "item" ;
+    ] ;
+  ] .
+
+
+:triplesMapPerson a rml:TriplesMap ;
+  rml:logicalSource :csvView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{#}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasBirthYear ;
+    rml:objectMap [
+      rml:reference "birthyear" ;
+      rml:datatype xsd:gYear ;
+    ] ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasItem ;
+    rml:objectMap [
+      rml:template "http://example.org/person/{#}/item/{json_item.#}/{json_item}" ;
+    ] ;
+  ] .
+
+

Output

+
<http://example.org/person/0> <http://example.org/hasBirthYear> "1995"^^<http://www.w3.org/2001/XMLSchema#gYear> .
+<http://example.org/person/0> <http://example.org/hasItem> <http://example.org/person/0/item/0/sword> .
+<http://example.org/person/0> <http://example.org/hasItem> <http://example.org/person/0/item/1/shield> .
+<http://example.org/person/2> <http://example.org/hasBirthYear> "1999"^^<http://www.w3.org/2001/XMLSchema#gYear> .
+<http://example.org/person/2> <http://example.org/hasItem> <http://example.org/person/2/item/0/flower> .
+
+
+
+

30. RMLLVTC0007a

+

Title: Change Reference Formulations: CSV including JSON array

+

Description: Test a change of reference formulations: csv source including json array

+

Error expected? No

+

Input

+
name,items
+alice,"[{""type"":""sword"",""weight"":1500},{""type"":""shield"",""weight"":2500}]"
+bob,"[{""type"":""flower"",""weight"":15}]"
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+
+:mixedCSVSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.csv" ;
+  ] ;
+  rml:referenceFormulation rml:CSV .
+
+:mixedCSVView a rml:LogicalView ;
+  rml:viewOn :mixedCSVSource ;
+  rml:field [
+    a rml:ExpressionField;
+    rml:fieldName "name" ;
+    rml:reference "name" ;
+  ] ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "items" ;
+    rml:reference "items" ;
+    rml:field [
+      a rml:IterableField ;
+      rml:referenceFormulation rml:JSONPath ;
+      rml:iterator "$[*]" ;
+      rml:fieldName "item" ;
+      rml:field [
+        a rml:ExpressionField ;
+        rml:fieldName "type" ;
+        rml:reference "$.type" ;
+      ] ;
+      rml:field [
+        a rml:ExpressionField ;
+        rml:fieldName "weight" ;
+        rml:reference "$.weight" ;
+      ] ;
+    ] ;
+  ] .
+
+:triplesMapItem a rml:TriplesMap ;
+  rml:logicalSource :mixedCSVView ;
+  rml:subjectMap [
+    rml:template "http://example.org/item_{#}_{items.item.#}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasType ;
+    rml:objectMap [
+      rml:reference "items.item.type" ;
+    ] ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasWeight ;
+    rml:objectMap [
+      rml:reference "items.item.weight" ;
+      rml:datatype xsd:integer ;
+    ] ;
+  ] .
+
+

Output

+
<http://example.org/item_0_0> <http://example.org/hasType> "sword" .
+<http://example.org/item_0_0> <http://example.org/hasWeight> "1500"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.org/item_0_1> <http://example.org/hasType> "shield" .
+<http://example.org/item_0_1> <http://example.org/hasWeight> "2500"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.org/item_1_0> <http://example.org/hasType> "flower" .
+<http://example.org/item_1_0> <http://example.org/hasWeight> "15"^^<http://www.w3.org/2001/XMLSchema#integer> .
+
+
+

31. RMLLVTC0007b

+

Title: Change Reference Formulations: CSV including JSON object

+

Description: Test a change of reference formulations: csv source including json object

+

Error expected? No

+

Input

+
name,item
+alice,"{""type"":""sword"",""weight"":1500}"
+alice,"{""type"":""shield"",""weight"":2500}"
+bob,"{""type"":""flower"",""weight"":15}"
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+
+:mixedCSVSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.csv" ;
+  ] ;
+  rml:referenceFormulation rml:CSV .
+
+:mixedCSVView a rml:LogicalView ;
+  rml:viewOn :mixedCSVSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "name" ;
+  ] ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "item" ;
+    rml:reference "item" ;
+    rml:field [
+      a rml:IterableField ;
+      rml:referenceFormulation rml:JSONPath ;
+      rml:iterator "$[*]" ;
+      rml:fieldName "itemJson" ;
+      rml:field [
+        a rml:ExpressionField;
+        rml:fieldName "type" ;
+        rml:reference "$.type" ; ] ;
+      rml:field [
+        a rml:ExpressionField;
+        rml:fieldName "weight" ;
+        rml:reference "$.weight" ;
+      ] ;
+    ] ;
+  ] .
+
+:triplesMapItem a rml:TriplesMap ;
+  rml:logicalSource :mixedCSVView ;
+  rml:subjectMap [
+    rml:template "http://example.org/item_{#}_{item.#}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasType ;
+    rml:objectMap [
+      rml:reference "item.itemJson.type" ;
+    ] ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasWeight ;
+    rml:objectMap [
+      rml:reference "item.itemJson.weight" ;
+      rml:datatype xsd:integer ;
+    ] ;
+  ] .
+
+

Output

+
<http://example.org/item_0_0> <http://example.org/hasType> "sword" .
+<http://example.org/item_0_0> <http://example.org/hasWeight> "1500"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.org/item_1_0> <http://example.org/hasType> "shield" .
+<http://example.org/item_1_0> <http://example.org/hasWeight> "2500"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.org/item_2_0> <http://example.org/hasType> "flower" .
+<http://example.org/item_2_0> <http://example.org/hasWeight> "15"^^<http://www.w3.org/2001/XMLSchema#integer> .
+
+
+

32. RMLLVTC0007c

+

Title: Change Reference Formulations: JSON including CSV

+

Description: Test a change of reference formulations: json source including csv data

+

Error expected? No

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "items": "type,weight\nsword,1500\nshield,2500"
+    },
+    {
+      "name": "bob",
+      "items": "type,weight\nflower,15"
+    }
+  ]
+}
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+
+:mixedJSONSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:mixedJSONView a rml:LogicalView ;
+  rml:viewOn :mixedJSONSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+    ] ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "items" ;
+    rml:reference "$.items" ;
+    rml:field [
+      a rml:IterableField ;
+      rml:referenceFormulation rml:CSV ;
+      rml:fieldName "item";
+      rml:field [
+        a rml:ExpressionField ;
+        rml:fieldName "type" ;
+        rml:reference "type" ;
+      ] ;
+      rml:field [
+        a rml:expressionField ;
+        rml:fieldName "weight" ;
+        rml:reference "weight" ;
+      ] ;
+    ] ;
+  ].
+
+:triplesMapItem a rml:TriplesMap ;
+  rml:logicalSource :mixedJSONView ;
+  rml:subjectMap [
+    rml:template "http://example.org/item_{#}_{items.item.#}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasType ;
+    rml:objectMap [
+      rml:reference "items.item.type" ;
+    ] ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasWeight ;
+    rml:objectMap [
+      rml:reference "items.item.weight" ;
+      rml:datatype xsd:integer ;
+    ] ;
+  ] .
+
+

Output

+
<http://example.org/item_0_0> <http://example.org/hasType> "sword" .
+<http://example.org/item_0_0> <http://example.org/hasWeight> "1500"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.org/item_0_1> <http://example.org/hasType> "shield" .
+<http://example.org/item_0_1> <http://example.org/hasWeight> "2500"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.org/item_1_0> <http://example.org/hasType> "flower" .
+<http://example.org/item_1_0> <http://example.org/hasWeight> "15"^^<http://www.w3.org/2001/XMLSchema#integer> .
+
+
+

33. RMLLVTC0008a

+

Title: Cycle: Abstract Logical Source

+

Description: Test a cycle in the abstract logical source of a logical view

+

Error expected? Yes

+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix : <http://example.org/> .
+
+:view1 a rml:LogicalView ;
+  rml:viewOn :view2 ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name1" ;
+    rml:reference "name2" ;
+  ] .
+
+:view2 a rml:LogicalView ;
+  rml:viewOn :view1 ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name2" ;
+    rml:reference "name1" ;
+  ] .
+
+:triplesMapPerson a rml:TriplesMap ;
+  rml:logicalSource :view2 ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{name2}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasName ;
+    rml:objectMap [
+      rml:reference "name2" ;
+    ] ;
+  ] .
+
+
+

34. RMLLVTC0008b

+

Title: Cycle: Joins

+

Description: Test a cycle in two joins of two logical views

+

Error expected? Yes

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "items": [
+        "sword",
+        "shield"
+      ]
+    },
+    {
+      "name": "bob",
+      "items": [
+        "flower"
+      ]
+    }
+  ]
+}
+
+

Input 1

+
name,birthyear
+alice,1995
+bob,1999
+tobias,2005
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+  rml:viewOn :jsonSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+  ] ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "item" ;
+    rml:reference "$.items[*]" ;
+  ] ;
+  rml:leftJoin [
+    rml:parentLogicalView :csvView ;
+    rml:joinCondition [
+      rml:parent "name" ;
+      rml:child "name" ;
+    ] ;
+    rml:field [
+      a rml:ExpressionField ;
+      rml:fieldName "csv_birthyear" ;
+      rml:reference "birthyear" ;
+    ] ;
+  ] .
+
+:csvSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.csv" ;
+  ] ;
+  rml:referenceFormulation rml:CSV .
+
+:csvView a rml:LogicalView ;
+  rml:viewOn :csvSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "name" ;
+  ] ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "birthyear" ;
+    rml:reference "birthyear" ;
+  ] ;
+  rml:leftJoin [
+    rml:parentLogicalView :jsonView ;
+    rml:joinCondition [
+      rml:parent "name" ;
+      rml:child "name" ;
+    ] ;
+    rml:field [
+      a rml:ExpressionField ;
+      rml:fieldName "json_item" ;
+      rml:reference "item" ;
+    ] ;
+  ] .
+
+
+:triplesMapPerson a rml:TriplesMap ;
+  rml:logicalSource :csvView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{name}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasBirthYear ;
+    rml:objectMap [
+      rml:reference "birthyear" ;
+      rml:datatype xsd:gYear ;
+    ] ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasItem ;
+    rml:objectMap [
+      rml:template "http://example.org/person/{name}/item/{json_item}" ;
+    ] ;
+  ] .
+
+
+

35. RMLLVTC0008c

+

Title: Cycle: Self-Join

+

Description: Test a cycle in a join of a logical view: self-join

+

Error expected? Yes

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "items": [
+        {
+          "type": "sword",
+          "weight": 1500
+        },
+        {
+          "type": "shield",
+          "weight": 2500
+        }
+      ]
+    },
+    {
+      "name": "bob",
+      "items": [
+        {
+          "type": "flower",
+          "weight": 15
+        }
+      ]
+    }
+  ]
+}
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+  rml:viewOn :jsonSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+  ] ;
+  rml:leftJoin [
+    rml:parentLogicalView :jsonView ;
+    rml:joinCondition [
+      rml:parent "name" ;
+      rml:child "name" ;
+    ] ;
+    rml:field [
+      a rml:ExpressionField ;
+      rml:fieldName "newName" ;
+      rml:reference "name" ;
+    ] ;
+  ] .
+
+:triplesMapPerson a rml:TriplesMap ;
+  rml:logicalSource :jsonView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{newName}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasName ;
+    rml:objectMap [
+      rml:reference "newName" ;
+    ] ;
+  ] .
+
+
+ + + + + + \ No newline at end of file diff --git a/src/test/resources/rml-lv/docs/20250725/index.html b/src/test/resources/rml-lv/docs/20250725/index.html new file mode 100644 index 00000000..b0c480a5 --- /dev/null +++ b/src/test/resources/rml-lv/docs/20250725/index.html @@ -0,0 +1,3490 @@ + + + + + + +RML-LV: Test Cases + + + + + + + + + + + + + + + +
+ +

RML-LV: Test Cases

+

+ Draft Community Group Report + +

+
+ +
Latest published version:
+ https://www.w3.org/RML-LV-Testcases/ +
+
Latest editor's draft:
https://w3id.org/rml/lv/test-cases/
+ + + + +
Editors:
+ (Skemu) +
+ (Ghent University – imec – IDLab) +
+ +
Authors:
+ (Skemu) +
+ (Ghent University – imec – IDLab) +
+
Feedback:
+ GitHub kg-construct/rml-lv + (pull requests, + new issue, + open issues) +
+ +
+ + +
+
+ + + +

Abstract

This document defines the RML-LV test cases to the determine the RML-LV specification conformance of tools.

+
+ +

Status of This Document

+ This specification was published by the + Knowledge Graph Construction Community Group. It is not a W3C Standard nor is it + on the W3C Standards Track. + + Please note that under the + W3C Community Contributor License Agreement (CLA) + there is a limited opt-out and other conditions apply. + + Learn more about + W3C Community and Business Groups. +

+ GitHub Issues are preferred for + discussion of this specification. + + +

+ +

1. Introduction

+

This document defines the RML-LV test cases, consisting of a collection of test case documents (input and expected output). +The purpose of the test cases is to determine the conformance of tools that execute RML rules to the RML-LV specification.

+
+ +

2. Data model

+

The test cases are semantically described for re-usability and shareability following the W3C Test case description. +Each test:Testcase as the following properties:

+
    +
  • dcterms:identifier: unique ID of the test case.
  • +
  • rmltest:hasError: if an error of the RML Processor is expected or not.
  • +
  • rmltest:input: One or more input data of the test case.
  • +
  • rmltest:output: One or more output data of the test case.
  • +
  • rmltest:inputFormat: the input data format.
  • +
  • rmltest:outputFormat: the output data format.
  • +
  • rmltest:mappingDocument: the RML mapping rules in Turtle.
  • +
+
+ +

3. Test cases

+

This section describes the RML-LV test cases. These descriptions are also available as RDF. +The files are available on GitHub in the folder test-cases. +Each test case is contained in a single folder, containing three types of files:

+
    +
  • Zero or more files containing the data sources, in the case of JSON, XML, CSV, or containing the SQL statements to create the necessary tables, in the case of MySQL, PostgreSQL, and SQL Server.
  • +
  • One file with the RML rules, called mapping.ttl, in the Turtle format.
  • +
  • Zero or more files with the expected RDF. No file is provided if an error is expected that must halt the generation of the RDF because of an error.
  • +
+
+ + +

4. RMLLVTC0000a

+

Title: Logical view on JSON source

+

Description: Test a view on a hierarchical source

+

Error expected? No

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "items": [
+        {
+          "type": "sword",
+          "weight": 1500
+        },
+        {
+          "type": "shield",
+          "weight": 2500
+        }
+      ]
+    },
+    {
+      "name": "bob",
+      "items": [
+        {
+          "type": "flower",
+          "weight": 15
+        }
+      ]
+    }
+  ]
+}
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+  rml:viewOn :jsonSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+  ] .
+
+:triplesMapPerson a rml:TriplesMap ;
+  rml:logicalSource :jsonView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{name}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasName ;
+    rml:objectMap [
+      rml:reference "name" ;
+    ] ;
+  ] .
+
+

Output

+
<http://example.org/person/alice> <http://example.org/hasName> "alice" .
+<http://example.org/person/bob> <http://example.org/hasName> "bob" .
+
+
+

5. RMLLVTC0000b

+

Title: Logical view on CSV source

+

Description: Test a view on a tabular source

+

Error expected? No

+

Input

+
name,birthyear
+alice,1995
+bob,1999
+tobias,2005
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix : <http://example.org/> .
+
+:csvSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.csv" ;
+  ] ;
+  rml:referenceFormulation rml:CSV .
+
+:csvView a rml:LogicalView ;
+  rml:viewOn :csvSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "name" ;
+  ] .
+
+:triplesMapPerson a rml:TriplesMap ;
+  rml:logicalSource :csvView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{name}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasName ;
+    rml:objectMap [
+      rml:reference "name" ;
+    ] ;
+  ] .
+
+

Output

+
<http://example.org/person/alice> <http://example.org/hasName> "alice" .
+<http://example.org/person/bob> <http://example.org/hasName> "bob" .
+<http://example.org/person/tobias> <http://example.org/hasName> "tobias" .
+
+
+

6. RMLLVTC0000c

+

Title: Logical View on Logical View

+

Description: Test a view on a logical view

+

Error expected? No

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "items": [
+        {
+          "type": "sword",
+          "weight": 1500
+        },
+        {
+          "type": "shield",
+          "weight": 2500
+        }
+      ]
+    },
+    {
+      "name": "bob",
+      "items": [
+        {
+          "type": "flower",
+          "weight": 15
+        }
+      ]
+    }
+  ]
+}
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+  rml:viewOn :jsonSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+  ] .
+
+:jsonViewOnJsonView a rml:LogicalView ;
+  rml:viewOn :jsonView ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "newName" ;
+    rml:reference "name" ;
+  ] .
+
+:triplesMapPerson a rml:TriplesMap ;
+  rml:logicalSource :jsonViewOnJsonView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{newName}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasName ;
+    rml:objectMap [
+      rml:reference "newName" ;
+    ] ;
+  ] .
+
+

Output

+
<http://example.org/person/alice> <http://example.org/hasName> "alice" .
+<http://example.org/person/bob> <http://example.org/hasName> "bob" .
+
+
+

7. RMLLVTC0001a

+

Title: Expression Field: Reference

+

Description: Test a reference in an expression field

+

Error expected? No

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "items": [
+        {
+          "type": "sword",
+          "weight": 1500
+        },
+        {
+          "type": "shield",
+          "weight": 2500
+        }
+      ]
+    },
+    {
+      "name": "bob",
+      "items": [
+        {
+          "type": "flower",
+          "weight": 15
+        }
+      ]
+    }
+  ]
+}
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+  rml:viewOn :jsonSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+  ] .
+
+:triplesMapPerson a rml:TriplesMap ;
+  rml:logicalSource :jsonView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{name}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasName ;
+    rml:objectMap [
+      rml:reference "name" ;
+    ] ;
+  ] .
+
+

Output

+
<http://example.org/person/alice> <http://example.org/hasName> "alice" .
+<http://example.org/person/bob> <http://example.org/hasName> "bob" .
+
+
+

8. RMLLVTC0001b

+

Title: Expression Field: Template

+

Description: Test a template in an expression field

+

Error expected? No

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "items": [
+        {
+          "type": "sword",
+          "weight": 1500
+        },
+        {
+          "type": "shield",
+          "weight": 2500
+        }
+      ]
+    },
+    {
+      "name": "bob",
+      "items": [
+        {
+          "type": "flower",
+          "weight": 15
+        }
+      ]
+    }
+  ]
+}
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+  rml:viewOn :jsonSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+  ] ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "race" ;
+    rml:constant "human" ;
+  ] .
+
+:triplesMapPerson a rml:TriplesMap ;
+  rml:logicalSource :jsonView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{name}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasRace ;
+    rml:objectMap [
+      rml:reference "race" ;
+    ] ;
+  ] .
+
+

Output

+
<http://example.org/person/alice> <http://example.org/hasRace> "human" .
+<http://example.org/person/bob> <http://example.org/hasRace> "human" .
+
+
+

9. RMLLVTC0001c

+

Title: Expression Field: Constant

+

Description: Test a constant expression in an expression field

+

Error expected? No

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "lastName": "smith",
+      "items": [
+        {
+          "type": "sword",
+          "weight": 1500
+        },
+        {
+          "type": "shield",
+          "weight": 2500
+        }
+      ]
+    },
+    {
+      "name": "bob",
+      "lastName": "jones",
+      "items": [
+        {
+          "type": "flower",
+          "weight": 15
+        }
+      ]
+    }
+  ]
+}
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+  rml:viewOn :jsonSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+  ] ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "fullName" ;
+    rml:template "{name} {lastName}" ;
+  ] .
+
+:triplesMapPerson a rml:TriplesMap ;
+  rml:logicalSource :jsonView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{name}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasFullName ;
+    rml:objectMap [
+      rml:reference "fullName" ;
+    ] ;
+  ] .
+
+

Output

+
<http://example.org/person/alice> <http://example.org/hasFullName> "alice smith" .
+<http://example.org/person/bob> <http://example.org/hasFullName> "bob jones" .
+
+
+

10. RMLLVTC0001d

+

Title: Expression Field Siblings

+

Description: Test multiple expression fields with the same parent

+

Error expected? No

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "lastName": "smith",
+      "items": [
+        {
+          "type": "sword",
+          "weight": 1500
+        },
+        {
+          "type": "shield",
+          "weight": 2500
+        }
+      ]
+    },
+    {
+      "name": "bob",
+      "lastName": "jones",
+      "items": [
+        {
+          "type": "flower",
+          "weight": 15
+        }
+      ]
+    }
+  ]
+}
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+  rml:viewOn :jsonSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+  ] ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "lastName" ;
+    rml:reference "$.lastName" ;
+  ] .
+
+:triplesMapPerson a rml:TriplesMap ;
+  rml:logicalSource :jsonView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{name}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasFullName ;
+    rml:objectMap [
+      rml:template "{name} {lastName}" ;
+      rml:termType rml:Literal ;
+    ] ;
+  ] .
+
+

Output

+
<http://example.org/person/alice> <http://example.org/hasFullName> "alice smith" .
+<http://example.org/person/bob> <http://example.org/hasFullName> "bob jones" .
+
+
+

11. RMLLVTC0002a

+

Title: Iterable Field

+

Description: Test a nested field construction: iterable field with expression field as child

+

Error expected? No

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "items": [
+        {
+          "type": "sword",
+          "weight": 1500
+        },
+        {
+          "type": "shield",
+          "weight": 2500
+        }
+      ]
+    },
+    {
+      "name": "bob",
+      "items": [
+        {
+          "type": "flower",
+          "weight": 15
+        }
+      ]
+    }
+  ]
+}
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+  rml:viewOn :jsonSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+  ] ;
+  rml:field [
+    a rml:IterableField ;
+    rml:fieldName "item" ;
+    rml:iterator "$.items[*]" ;
+    rml:field [
+      a rml:ExpressionField ;
+      rml:fieldName "type" ;
+      rml:reference "$.type" ;
+    ] ;
+  ] .
+
+:triplesMapPerson a rml:TriplesMap ;
+  rml:logicalSource :jsonView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{name}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasItem ;
+    rml:objectMap [
+      rml:template "http://example.org/person/{name}/item/{item.type}" ;
+    ] ;
+  ] .
+
+

Output

+
<http://example.org/person/alice> <http://example.org/hasItem> <http://example.org/person/alice/item/sword> .
+<http://example.org/person/alice> <http://example.org/hasItem> <http://example.org/person/alice/item/shield> .
+<http://example.org/person/bob> <http://example.org/hasItem> <http://example.org/person/bob/item/flower> .
+
+
+

12. RMLLVTC0002b

+

Title: Iterable Field with Multiple Children

+

Description: Test a nested field construction: iterable field with mulitple expression fields as children

+

Error expected? No

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "items": [
+        {
+          "type": "sword",
+          "weight": 1500
+        },
+        {
+          "type": "shield",
+          "weight": 2500
+        }
+      ]
+    },
+    {
+      "name": "bob",
+      "items": [
+        {
+          "type": "flower",
+          "weight": 15
+        }
+      ]
+    }
+  ]
+}
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+  rml:viewOn :jsonSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+  ] ;
+  rml:field [
+    a rml:IterableField ;
+    rml:fieldName "item" ;
+    rml:iterator "$.items[*]" ;
+    rml:field [
+      a rml:ExpressionField ;
+      rml:fieldName "type" ;
+      rml:reference "$.type" ;
+    ] ;
+    rml:field [
+      a rml:ExpressionField ;
+      rml:fieldName "weight" ;
+      rml:reference "$.weight" ;
+    ] ;
+  ] .
+
+:triplesMapItem a rml:TriplesMap ;
+  rml:logicalSource :jsonView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{name}/item/{item.type}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasName ;
+    rml:objectMap [
+      rml:reference "item.type" ;
+    ] ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasWeight ;
+    rml:objectMap [
+      rml:reference "item.weight" ;
+      rml:datatype xsd:integer ;
+    ] ;
+  ] .
+
+

Output

+
<http://example.org/person/alice/item/sword> <http://example.org/hasName> "sword" .
+<http://example.org/person/alice/item/sword> <http://example.org/hasWeight> "1500"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.org/person/alice/item/shield> <http://example.org/hasName> "shield" .
+<http://example.org/person/alice/item/shield> <http://example.org/hasWeight> "2500"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.org/person/bob/item/flower> <http://example.org/hasName> "flower" .
+<http://example.org/person/bob/item/flower> <http://example.org/hasWeight> "15"^^<http://www.w3.org/2001/XMLSchema#integer> .
+
+
+

13. RMLLVTC0002c

+

Title: Nested Iterable Fields

+

Description: Test a nested field construction: iterable field with an iterable field as child

+

Error expected? No

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "items": [
+        {
+          "type": "sword",
+          "measures": {
+            "weight": 1500,
+            "length": 30
+          }
+        },
+        {
+          "type": "shield",
+          "measures": {
+            "weight": 2500
+          }
+        }
+      ]
+    },
+    {
+      "name": "bob",
+      "items": [
+        {
+          "type": "flower",
+          "measures" : {
+            "weight": 15,
+            "length" : 15
+          }
+        }
+      ]
+    }
+  ]
+}
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+  rml:viewOn :jsonSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+  ] ;
+  rml:field [
+    a rml:IterableField ;
+    rml:fieldName "item" ;
+    rml:iterator "$.items[*]" ;
+    rml:field [
+      rml:fieldName "type" ;
+      rml:reference "$.type" ;
+    ] ;
+    rml:field [
+      a rml:IterableField ;
+      rml:fieldName "measures";
+      rml:iterator "$.measures";
+      rml:field [
+        a rml:ExpressionField ;
+        rml:fieldName "weight" ;
+        rml:reference "$.weight" ;
+        ];
+      rml:field [
+        a rml:ExpressionField ;
+        rml:fieldName "length" ;
+        rml:reference "$.length" ;
+      ]
+    ] ;
+  ] .
+
+:triplesMapItem a rml:TriplesMap ;
+  rml:logicalSource :jsonView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{name}/item/{item.type}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasWeight ;
+    rml:objectMap [
+      rml:reference "item.measures.weight" ;
+      rml:datatype xsd:integer ;
+    ] ;
+  ] .
+
+

Output

+
<http://example.org/person/alice/item/sword> <http://example.org/hasWeight> "1500"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.org/person/alice/item/shield> <http://example.org/hasWeight> "2500"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.org/person/bob/item/flower> <http://example.org/hasWeight> "15"^^<http://www.w3.org/2001/XMLSchema#integer> .
+
+
+

14. RMLLVTC0003a

+

Title: Index Key: #

+

Description: Test a reference to the index key #

+

Error expected? No

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "items": [
+        {
+          "type": "sword",
+          "weight": 1500
+        },
+        {
+          "type": "shield",
+          "weight": 2500
+        }
+      ]
+    },
+    {
+      "name": "bob",
+      "items": [
+        {
+          "type": "flower",
+          "weight": 15
+        }
+      ]
+    }
+  ]
+}
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+  rml:viewOn :jsonSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+  ] .
+
+:triplesMapPerson a rml:TriplesMap ;
+  rml:logicalSource :jsonView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{name}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasSequenceNumber ;
+    rml:objectMap [
+      rml:reference "#" ;
+      rml:datatype xsd:integer ;
+    ] ;
+  ] .
+
+

Output

+
<http://example.org/person/alice> <http://example.org/hasSequenceNumber> "0"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.org/person/bob> <http://example.org/hasSequenceNumber> "1"^^<http://www.w3.org/2001/XMLSchema#integer> .
+
+
+

15. RMLLVTC0003b

+

Title: Index Key: Iterable Field

+

Description: Test a reference to the index key of an iterable field

+

Error expected? No

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "items": [
+        {
+          "type": "sword",
+          "weight": 1500
+        },
+        {
+          "type": "shield",
+          "weight": 2500
+        }
+      ]
+    },
+    {
+      "name": "bob",
+      "items": [
+        {
+          "type": "flower",
+          "weight": 15
+        }
+      ]
+    }
+  ]
+}
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+  rml:viewOn :jsonSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+  ] ;
+  rml:field [
+    a rml:IterableField ;
+    rml:fieldName "item" ;
+    rml:iterator "$.items[*]" ;
+    rml:field [
+      a rml:ExpressionField ;
+      rml:fieldName "type" ;
+      rml:reference "$.type" ;
+    ] ;
+  ] .
+
+:triplesMapPerson a rml:TriplesMap ;
+  rml:logicalSource :jsonView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{name}/item/{item.#}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasType ;
+    rml:objectMap [
+      rml:reference "item.type" ;
+    ] ;
+  ] .
+
+

Output

+
<http://example.org/person/alice/item/0> <http://example.org/hasType> "sword" .
+<http://example.org/person/alice/item/1> <http://example.org/hasType> "shield" .
+<http://example.org/person/bob/item/0> <http://example.org/hasType> "flower" .
+
+
+
+

16. RMLLVTC0003c

+

Title: Index Key: Expression field

+

Description: Test a reference to the index key of an expression field

+

Error expected? No

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "items": [
+        "sword",
+        "shield"
+      ]
+    },
+    {
+      "name": "bob",
+      "items": [
+        "flower"
+      ]
+    }
+  ]
+}
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+  rml:viewOn :jsonSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+  ] ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "item" ;
+    rml:reference "$.items[*]" ;
+  ] .
+
+:triplesMapItem a rml:TriplesMap ;
+  rml:logicalSource :jsonView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{name}/item/{item.#}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasType ;
+    rml:objectMap [
+      rml:reference "item" ;
+    ] ;
+  ] .
+
+

Output

+
<http://example.org/person/alice/item/0> <http://example.org/hasType> "sword" .
+<http://example.org/person/alice/item/1> <http://example.org/hasType> "shield" .
+<http://example.org/person/bob/item/0> <http://example.org/hasType> "flower" .
+
+
+

17. RMLLVTC0004a

+

Title: Natural Datatype: Index #

+

Description: Test the natural datatype mapping for the index #

+

Error expected? No

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "items": [
+        {
+          "type": "sword",
+          "weight": 1500
+        },
+        {
+          "type": "shield",
+          "weight": 2500
+        }
+      ]
+    },
+    {
+      "name": "bob",
+      "items": [
+        {
+          "type": "flower",
+          "weight": 15
+        }
+      ]
+    }
+  ]
+}
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+  rml:viewOn :jsonSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+  ] .
+
+:triplesMapPerson a rml:TriplesMap ;
+  rml:logicalSource :jsonView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{name}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasSequenceNumber ;
+    rml:objectMap [
+      rml:reference "#" ;
+    ] ;
+  ] .
+
+

Output

+
<http://example.org/person/alice> <http://example.org/hasSequenceNumber> "0"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.org/person/bob> <http://example.org/hasSequenceNumber> "1"^^<http://www.w3.org/2001/XMLSchema#integer> .
+
+
+

18. RMLLVTC0004b

+

Title: Natural Datatype: Index Expression Field

+

Description: Test the natural datatype mapping for the index of an expression field

+

Error expected? No

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "items": [
+        {
+          "type": "sword",
+          "weight": 1500
+        },
+        {
+          "type": "shield",
+          "weight": 2500
+        }
+      ]
+    },
+    {
+      "name": "bob",
+      "items": [
+        {
+          "type": "flower",
+          "weight": 15
+        }
+      ]
+    }
+  ]
+}
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+  rml:viewOn :jsonSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+  ] ;
+  rml:field [
+    a rml:IterableField ;
+    rml:fieldName "item" ;
+    rml:iterator "$.items[*]" ;
+    rml:field [
+      a rml:ExpressionField ;
+      rml:fieldName "type" ;
+      rml:reference "$.type" ;
+    ] ;
+  ] .
+
+:triplesMapPerson a rml:TriplesMap ;
+  rml:logicalSource :jsonView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{name}/item/{item.type}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasSequenceNumber ;
+    rml:objectMap [
+      rml:reference "item.#" ;
+    ] ;
+  ] .
+
+

Output

+
<http://example.org/person/alice/item/sword> <http://example.org/hasSequenceNumber> "0"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.org/person/alice/item/shield> <http://example.org/hasSequenceNumber> "1"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.org/person/bob/item/flower> <http://example.org/hasSequenceNumber> "0"^^<http://www.w3.org/2001/XMLSchema#integer> .
+
+
+

19. RMLLVTC0004c

+

Title: Natural Datatype: Index Iterable Field

+

Description: Test the natural datatype mapping for the index of an iterable field

+

Error expected? No

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "items": [
+        "sword",
+        "shield"
+      ]
+    },
+    {
+      "name": "bob",
+      "items": [
+        "flower"
+      ]
+    }
+  ]
+}
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+  rml:viewOn :jsonSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+  ] ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "item" ;
+    rml:reference "$.items[*]" ;
+  ] .
+
+:triplesMapItem a rml:TriplesMap ;
+  rml:logicalSource :jsonView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{name}/item/{item}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasSequenceNumber ;
+    rml:objectMap [
+      rml:reference "item.#" ;
+    ] ;
+  ] .
+
+

Output

+
<http://example.org/person/alice/item/sword> <http://example.org/hasSequenceNumber> "0"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.org/person/alice/item/shield> <http://example.org/hasSequenceNumber> "1"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.org/person/bob/item/flower> <http://example.org/hasSequenceNumber> "0"^^<http://www.w3.org/2001/XMLSchema#integer> .
+
+
+

20. RMLLVTC0004d

+

Title: Natural Datatype: Record Expression Field

+

Description: Test the natural datatype mapping for a record of an expression field

+

Error expected? No

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "birth_year": 1995
+    },
+    {
+      "name": "bob",
+      "birth_year": 1999
+    }
+  ]
+}
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+  rml:viewOn :jsonSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+  ] ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "birthyear" ;
+    rml:reference "$.birth_year" ;
+  ] .
+
+:triplesMapItem a rml:TriplesMap ;
+  rml:logicalSource :jsonView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{name}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasBirthYear ;
+    rml:objectMap [
+      rml:reference "birthyear" ;
+    ] ;
+  ] .
+
+

Output

+
<http://example.org/person/alice> <http://example.org/hasBirthYear> "1995"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.org/person/bob> <http://example.org/hasBirthYear> "1999"^^<http://www.w3.org/2001/XMLSchema#integer> .
+
+
+

21. RMLLVTC0005a

+

Title: Referencing a Non-Existing Key

+

Description: Test a reference to a non-existing key

+

Error expected? Yes

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "items": [
+        {
+          "type": "sword",
+          "weight": 1500
+        },
+        {
+          "type": "shield",
+          "weight": 2500
+        }
+      ]
+    },
+    {
+      "name": "bob",
+      "items": [
+        {
+          "type": "flower",
+          "weight": 15
+        }
+      ]
+    }
+  ]
+}
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+  rml:viewOn :jsonSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+  ] .
+
+:triplesMapPerson a rml:TriplesMap ;
+  rml:logicalSource :jsonView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{Name}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasName ;
+    rml:objectMap [
+      rml:reference "Name" ;
+    ] ;
+  ] .
+
+
+

22. RMLLVTC0005b

+

Title: Referencing the Record Key

+

Description: Test a reference to the record key

+

Error expected? Yes

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "items": [
+        {
+          "type": "sword",
+          "weight": 1500
+        },
+        {
+          "type": "shield",
+          "weight": 2500
+        }
+      ]
+    },
+    {
+      "name": "bob",
+      "items": [
+        {
+          "type": "flower",
+          "weight": 15
+        }
+      ]
+    }
+  ]
+}
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+  rml:viewOn :jsonSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+  ] .
+
+:triplesMapPerson a rml:TriplesMap ;
+  rml:logicalSource :jsonView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{name}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :isDerivedFrom ;
+    rml:objectMap [
+      rml:reference "<it>" ;
+    ] ;
+  ] .
+
+
+

23. RMLLVTC0005c

+

Title: Referencing the Record Key of an Iterable Field

+

Description: Test a reference to the record key of an iterable field

+

Error expected? Yes

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "items": [
+        {
+          "type": "sword",
+          "weight": 1500
+        },
+        {
+          "type": "shield",
+          "weight": 2500
+        }
+      ]
+    },
+    {
+      "name": "bob",
+      "items": [
+        {
+          "type": "flower",
+          "weight": 15
+        }
+      ]
+    }
+  ]
+}
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+  rml:viewOn :jsonSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+  ] ;
+  rml:field [
+    a rml:IterableField ;
+    rml:fieldName "item" ;
+    rml:iterator "$.items[*]" ;
+    rml:field [
+      a rml:ExpressionField ;
+      rml:fieldName "type" ;
+      rml:reference "$.type" ;
+    ] ;
+  ] .
+
+:triplesMapPerson a rml:TriplesMap ;
+  rml:logicalSource :jsonView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{name}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasItem ;
+    rml:objectMap [
+      rml:template "http://example.org/person/{name}/{item}" ;
+    ] ;
+  ] .
+
+
+

24. RMLLVTC0006a

+

Title: Left Join

+

Description: Test a left join

+

Error expected? No

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "items": [
+        "sword",
+        "shield"
+      ]
+    },
+    {
+      "name": "bob",
+      "items": [
+        "flower"
+      ]
+    }
+  ]
+}
+
+

Input 1

+
name,birthyear
+alice,1995
+bob,1999
+tobias,2005
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+  rml:viewOn :jsonSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+  ] ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "item" ;
+    rml:reference "$.items[*]" ;
+  ] .
+
+:csvSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.csv" ;
+  ] ;
+  rml:referenceFormulation rml:CSV .
+
+:csvView a rml:LogicalView ;
+  rml:viewOn :csvSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "name" ;
+  ] ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "birthyear" ;
+    rml:reference "birthyear" ;
+  ] ;
+  rml:leftJoin [
+    rml:parentLogicalView :jsonView ;
+    rml:joinCondition [
+      rml:parent "name" ;
+      rml:child "name" ;
+    ] ;
+    rml:field [
+      a rml:ExpressionField ;
+      rml:fieldName "json_item" ;
+      rml:reference "item" ;
+    ] ;
+  ] .
+
+
+:triplesMapPerson a rml:TriplesMap ;
+  rml:logicalSource :csvView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{name}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasBirthYear ;
+    rml:objectMap [
+      rml:reference "birthyear" ;
+      rml:datatype xsd:gYear ;
+    ] ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasItem ;
+    rml:objectMap [
+      rml:template "http://example.org/person/{name}/item/{json_item}" ;
+    ] ;
+  ] .
+
+

Output

+
<http://example.org/person/alice> <http://example.org/hasBirthYear> "1995"^^<http://www.w3.org/2001/XMLSchema#gYear> .
+<http://example.org/person/alice> <http://example.org/hasItem> <http://example.org/person/alice/item/sword> .
+<http://example.org/person/alice> <http://example.org/hasItem> <http://example.org/person/alice/item/shield> .
+<http://example.org/person/bob> <http://example.org/hasBirthYear> "1999"^^<http://www.w3.org/2001/XMLSchema#gYear> .
+<http://example.org/person/bob> <http://example.org/hasItem> <http://example.org/person/bob/item/flower> .
+<http://example.org/person/tobias> <http://example.org/hasBirthYear> "2005"^^<http://www.w3.org/2001/XMLSchema#gYear> .
+
+
+

25. RMLLVTC0006b

+

Title: Inner Join

+

Description: Test an inner join

+

Error expected? No

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "items": [
+        "sword",
+        "shield"
+      ]
+    },
+    {
+      "name": "bob",
+      "items": [
+        "flower"
+      ]
+    }
+  ]
+}
+
+

Input 1

+
name,birthyear
+alice,1995
+bob,1999
+tobias,2005
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+  rml:viewOn :jsonSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+  ] ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "item" ;
+    rml:reference "$.items[*]" ;
+  ] .
+
+:csvSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.csv" ;
+  ] ;
+  rml:referenceFormulation rml:CSV .
+
+:csvView a rml:LogicalView ;
+  rml:viewOn :csvSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "name" ;
+  ] ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "birthyear" ;
+    rml:reference "birthyear" ;
+  ] ;
+  rml:innerJoin [
+    rml:parentLogicalView :jsonView ;
+    rml:joinCondition [
+      rml:parent "name" ;
+      rml:child "name" ;
+    ] ;
+    rml:field [
+      a rml:ExpressionField ;
+      rml:fieldName "json_item" ;
+      rml:reference "item" ;
+    ] ;
+  ] .
+
+
+:triplesMapPerson a rml:TriplesMap ;
+  rml:logicalSource :csvView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{name}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasBirthYear ;
+    rml:objectMap [
+      rml:reference "birthyear" ;
+      rml:datatype xsd:gYear ;
+    ] ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasItem ;
+    rml:objectMap [
+      rml:template "http://example.org/person/{name}/item/{json_item}" ;
+    ] ;
+  ] .
+
+

Output

+
<http://example.org/person/alice> <http://example.org/hasBirthYear> "1995"^^<http://www.w3.org/2001/XMLSchema#gYear> .
+<http://example.org/person/alice> <http://example.org/hasItem> <http://example.org/person/alice/item/sword> .
+<http://example.org/person/alice> <http://example.org/hasItem> <http://example.org/person/alice/item/shield> .
+<http://example.org/person/bob> <http://example.org/hasBirthYear> "1999"^^<http://www.w3.org/2001/XMLSchema#gYear> .
+<http://example.org/person/bob> <http://example.org/hasItem> <http://example.org/person/bob/item/flower> .
+
+
+

26. RMLLVTC0006c

+

Title: Two Left Joins

+

Description: Test two left joins in one logical view

+

Error expected? No

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "items": [
+        "sword",
+        "shield"
+      ]
+    },
+    {
+      "name": "bob",
+      "items": [
+        "flower"
+      ]
+    }
+  ]
+}
+
+

Input 1

+
name,birthyear
+alice,1995
+bob,1999
+tobias,2005
+
+

Input 2

+
name,id
+alice,123
+bob,456
+tobias,789
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+  rml:viewOn :jsonSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+  ] ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "item" ;
+    rml:reference "$.items[*]" ;
+  ] .
+
+:additionalCsvSource a rml:LogicalSource ;
+  rml:source [
+   a rml:RelativePathSource , rml:Source ;
+   rml:root rml:MappingDirectory ;
+   rml:path "people2.csv" ;
+  ] ;
+  rml:referenceFormulation rml:CSV .
+
+:additionalCsvView a rml:LogicalView ;
+  rml:viewOn :additionalCsvSource ;
+    rml:field [
+     a rml:ExpressionField ;
+     rml:fieldName "name" ;
+     rml:reference "name" ;
+    ] ;
+    rml:field [
+     a rml:ExpressionField ;
+     rml:fieldName "id" ;
+     rml:reference "id" ;
+    ] ;
+.
+
+:csvSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.csv" ;
+  ] ;
+  rml:referenceFormulation rml:CSV .
+
+:csvView a rml:LogicalView ;
+  rml:viewOn :csvSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "name" ;
+  ] ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "birthyear" ;
+    rml:reference "birthyear" ;
+  ] ;
+  rml:leftJoin [
+    rml:parentLogicalView :jsonView ;
+    rml:joinCondition [
+      rml:parent "name" ;
+      rml:child "name" ;
+    ] ;
+    rml:field [
+      a rml:ExpressionField ;
+      rml:fieldName "json_item" ;
+      rml:reference "item" ;
+    ] ;
+  ] ;
+  rml:leftJoin [
+    rml:parentLogicalView :additionalCsvView ;
+    rml:joinCondition [
+      rml:parent "name" ;
+      rml:child "name" ;
+    ] ;
+    rml:field [
+      a rml:ExpressionField ;
+      rml:fieldName "csv2_id" ;
+      rml:reference "id" ;
+    ] ;
+  ] .
+
+
+:triplesMapPerson a rml:TriplesMap ;
+  rml:logicalSource :csvView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{csv2_id}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasBirthYear ;
+    rml:objectMap [
+      rml:reference "birthyear" ;
+      rml:datatype xsd:gYear ;
+    ] ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasItem ;
+    rml:objectMap [
+      rml:template "http://example.org/person/{csv2_id}/item/{json_item}" ;
+    ] ;
+  ] .
+
+

Output

+
<http://example.org/person/123> <http://example.org/hasBirthYear> "1995"^^<http://www.w3.org/2001/XMLSchema#gYear> .
+<http://example.org/person/123> <http://example.org/hasItem> <http://example.org/person/123/item/sword> .
+<http://example.org/person/123> <http://example.org/hasItem> <http://example.org/person/123/item/shield> .
+<http://example.org/person/456> <http://example.org/hasBirthYear> "1999"^^<http://www.w3.org/2001/XMLSchema#gYear> .
+<http://example.org/person/456> <http://example.org/hasItem> <http://example.org/person/456/item/flower> .
+<http://example.org/person/789> <http://example.org/hasBirthYear> "2005"^^<http://www.w3.org/2001/XMLSchema#gYear> .
+
+
+

27. RMLLVTC0006d

+

Title: Inner Join and Left Join

+

Description: Test an inner join and a left join in one logical view

+

Error expected? No

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "items": [
+        "sword",
+        "shield"
+      ]
+    },
+    {
+      "name": "bob",
+      "items": [
+        "flower"
+      ]
+    }
+  ]
+}
+
+

Input 1

+
name,birthyear
+alice,1995
+bob,1999
+tobias,2005
+
+

Input 2

+
name,id
+alice,123
+bob,456
+tobias,789
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+  rml:viewOn :jsonSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+  ] ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "item" ;
+    rml:reference "$.items[*]" ;
+  ] .
+
+:additionalCsvSource a rml:LogicalSource ;
+  rml:source [
+   a rml:RelativePathSource , rml:Source ;
+   rml:root rml:MappingDirectory ;
+   rml:path "people2.csv" ;
+  ] ;
+  rml:referenceFormulation rml:CSV .
+
+:additionalCsvView a rml:LogicalView ;
+  rml:viewOn :additionalCsvSource ;
+    rml:field [
+     a rml:ExpressionField ;
+     rml:fieldName "name" ;
+     rml:reference "name" ;
+    ] ;
+    rml:field [
+     a rml:ExpressionField ;
+     rml:fieldName "id" ;
+     rml:reference "id" ;
+    ] ;
+.
+
+:csvSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.csv" ;
+  ] ;
+  rml:referenceFormulation rml:CSV .
+
+:csvView a rml:LogicalView ;
+  rml:viewOn :csvSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "name" ;
+  ] ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "birthyear" ;
+    rml:reference "birthyear" ;
+  ] ;
+  rml:innerJoin [
+    rml:parentLogicalView :jsonView ;
+    rml:joinCondition [
+      rml:parent "name" ;
+      rml:child "name" ;
+    ] ;
+    rml:field [
+      a rml:ExpressionField ;
+      rml:fieldName "json_item" ;
+      rml:reference "item" ;
+    ] ;
+  ] ;
+  rml:leftJoin [
+    rml:parentLogicalView :additionalCsvView ;
+    rml:joinCondition [
+      rml:parent "name" ;
+      rml:child "name" ;
+    ] ;
+    rml:field [
+      a rml:ExpressionField ;
+      rml:fieldName "csv2_id" ;
+      rml:reference "id" ;
+    ] ;
+  ] .
+
+
+:triplesMapPerson a rml:TriplesMap ;
+  rml:logicalSource :csvView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{csv2_id}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasBirthYear ;
+    rml:objectMap [
+      rml:reference "birthyear" ;
+      rml:datatype xsd:gYear ;
+    ] ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasItem ;
+    rml:objectMap [
+      rml:template "http://example.org/person/{csv2_id}/item/{json_item}" ;
+    ] ;
+  ] .
+
+

Output

+
<http://example.org/person/123> <http://example.org/hasBirthYear> "1995"^^<http://www.w3.org/2001/XMLSchema#gYear> .
+<http://example.org/person/123> <http://example.org/hasItem> <http://example.org/person/123/item/sword> .
+<http://example.org/person/123> <http://example.org/hasItem> <http://example.org/person/123/item/shield> .
+<http://example.org/person/456> <http://example.org/hasBirthYear> "1999"^^<http://www.w3.org/2001/XMLSchema#gYear> .
+<http://example.org/person/456> <http://example.org/hasItem> <http://example.org/person/456/item/flower> .
+
+
+

28. RMLLVTC0006e

+

Title: Two Inner Joins

+

Description: Test two left joins in one logical view

+

Error expected? No

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "items": [
+        "sword",
+        "shield"
+      ]
+    },
+    {
+      "name": "bob",
+      "items": [
+        "flower"
+      ]
+    }
+  ]
+}
+
+

Input 1

+
name,birthyear
+alice,1995
+bob,1999
+tobias,2005
+
+

Input 2

+
name,id
+alice,123
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+  rml:viewOn :jsonSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+  ] ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "item" ;
+    rml:reference "$.items[*]" ;
+  ] .
+
+:additionalCsvSource a rml:LogicalSource ;
+  rml:source [
+   a rml:RelativePathSource , rml:Source ;
+   rml:root rml:MappingDirectory ;
+   rml:path "people2.csv" ;
+  ] ;
+  rml:referenceFormulation rml:CSV .
+
+:additionalCsvView a rml:LogicalView ;
+  rml:viewOn :additionalCsvSource ;
+    rml:field [
+     a rml:ExpressionField ;
+     rml:fieldName "name" ;
+     rml:reference "name" ;
+    ] ;
+    rml:field [
+     a rml:ExpressionField ;
+     rml:fieldName "id" ;
+     rml:reference "id" ;
+    ] ;
+.
+
+:csvSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.csv" ;
+  ] ;
+  rml:referenceFormulation rml:CSV .
+
+:csvView a rml:LogicalView ;
+  rml:viewOn :csvSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "name" ;
+  ] ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "birthyear" ;
+    rml:reference "birthyear" ;
+  ] ;
+  rml:innerJoin [
+    rml:parentLogicalView :jsonView ;
+    rml:joinCondition [
+      rml:parent "name" ;
+      rml:child "name" ;
+    ] ;
+    rml:field [
+      a rml:ExpressionField ;
+      rml:fieldName "json_item" ;
+      rml:reference "item" ;
+    ] ;
+  ] ;
+  rml:innerJoin [
+    rml:parentLogicalView :additionalCsvView ;
+    rml:joinCondition [
+      rml:parent "name" ;
+      rml:child "name" ;
+    ] ;
+    rml:field [
+      a rml:ExpressionField ;
+      rml:fieldName "csv2_id" ;
+      rml:reference "id" ;
+    ] ;
+  ] .
+
+
+:triplesMapPerson a rml:TriplesMap ;
+  rml:logicalSource :csvView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{csv2_id}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasBirthYear ;
+    rml:objectMap [
+      rml:reference "birthyear" ;
+      rml:datatype xsd:gYear ;
+    ] ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasItem ;
+    rml:objectMap [
+      rml:template "http://example.org/person/{csv2_id}/item/{json_item}" ;
+    ] ;
+  ] .
+
+

Output

+
<http://example.org/person/123> <http://example.org/hasBirthYear> "1995"^^<http://www.w3.org/2001/XMLSchema#gYear> .
+<http://example.org/person/123> <http://example.org/hasItem> <http://example.org/person/123/item/sword> .
+<http://example.org/person/123> <http://example.org/hasItem> <http://example.org/person/123/item/shield> .
+
+
+

29. RMLLVTC0006f

+

Title: Index Key of Field in Join

+

Description: Test references to indexes of fields from a join

+

Error expected? No

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "items": [
+        "sword",
+        "shield"
+      ]
+    },
+    {
+      "name": "bob",
+      "items": [
+        "flower"
+      ]
+    }
+  ]
+}
+
+

Input 1

+
name,birthyear
+alice,1995
+tobias,2005
+bob,1999
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+  rml:viewOn :jsonSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+  ] ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "item" ;
+    rml:reference "$.items[*]" ;
+  ] .
+
+:csvSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.csv" ;
+  ] ;
+  rml:referenceFormulation rml:CSV .
+
+:csvView a rml:LogicalView ;
+  rml:viewOn :csvSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "name" ;
+  ] ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "birthyear" ;
+    rml:reference "birthyear" ;
+  ] ;
+  rml:innerJoin [
+    rml:parentLogicalView :jsonView ;
+    rml:joinCondition [
+      rml:parent "name" ;
+      rml:child "name" ;
+    ] ;
+    rml:field [
+      a rml:ExpressionField ;
+      rml:fieldName "json_item" ;
+      rml:reference "item" ;
+    ] ;
+  ] .
+
+
+:triplesMapPerson a rml:TriplesMap ;
+  rml:logicalSource :csvView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{#}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasBirthYear ;
+    rml:objectMap [
+      rml:reference "birthyear" ;
+      rml:datatype xsd:gYear ;
+    ] ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasItem ;
+    rml:objectMap [
+      rml:template "http://example.org/person/{#}/item/{json_item.#}/{json_item}" ;
+    ] ;
+  ] .
+
+

Output

+
<http://example.org/person/0> <http://example.org/hasBirthYear> "1995"^^<http://www.w3.org/2001/XMLSchema#gYear> .
+<http://example.org/person/0> <http://example.org/hasItem> <http://example.org/person/0/item/0/sword> .
+<http://example.org/person/0> <http://example.org/hasItem> <http://example.org/person/0/item/1/shield> .
+<http://example.org/person/2> <http://example.org/hasBirthYear> "1999"^^<http://www.w3.org/2001/XMLSchema#gYear> .
+<http://example.org/person/2> <http://example.org/hasItem> <http://example.org/person/2/item/0/flower> .
+
+
+
+

30. RMLLVTC0007a

+

Title: Change Reference Formulations: CSV including JSON array

+

Description: Test a change of reference formulations: csv source including json array

+

Error expected? No

+

Input

+
name,items
+alice,"[{""type"":""sword"",""weight"":1500},{""type"":""shield"",""weight"":2500}]"
+bob,"[{""type"":""flower"",""weight"":15}]"
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+
+:mixedCSVSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.csv" ;
+  ] ;
+  rml:referenceFormulation rml:CSV .
+
+:mixedCSVView a rml:LogicalView ;
+  rml:viewOn :mixedCSVSource ;
+  rml:field [
+    a rml:ExpressionField;
+    rml:fieldName "name" ;
+    rml:reference "name" ;
+  ] ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "items" ;
+    rml:reference "items" ;
+    rml:field [
+      a rml:IterableField ;
+      rml:referenceFormulation rml:JSONPath ;
+      rml:iterator "$[*]" ;
+      rml:fieldName "item" ;
+      rml:field [
+        a rml:ExpressionField ;
+        rml:fieldName "type" ;
+        rml:reference "$.type" ;
+      ] ;
+      rml:field [
+        a rml:ExpressionField ;
+        rml:fieldName "weight" ;
+        rml:reference "$.weight" ;
+      ] ;
+    ] ;
+  ] .
+
+:triplesMapItem a rml:TriplesMap ;
+  rml:logicalSource :mixedCSVView ;
+  rml:subjectMap [
+    rml:template "http://example.org/item_{#}_{items.item.#}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasType ;
+    rml:objectMap [
+      rml:reference "items.item.type" ;
+    ] ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasWeight ;
+    rml:objectMap [
+      rml:reference "items.item.weight" ;
+      rml:datatype xsd:integer ;
+    ] ;
+  ] .
+
+

Output

+
<http://example.org/item_0_0> <http://example.org/hasType> "sword" .
+<http://example.org/item_0_0> <http://example.org/hasWeight> "1500"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.org/item_0_1> <http://example.org/hasType> "shield" .
+<http://example.org/item_0_1> <http://example.org/hasWeight> "2500"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.org/item_1_0> <http://example.org/hasType> "flower" .
+<http://example.org/item_1_0> <http://example.org/hasWeight> "15"^^<http://www.w3.org/2001/XMLSchema#integer> .
+
+
+

31. RMLLVTC0007b

+

Title: Change Reference Formulations: CSV including JSON object

+

Description: Test a change of reference formulations: csv source including json object

+

Error expected? No

+

Input

+
name,item
+alice,"{""type"":""sword"",""weight"":1500}"
+alice,"{""type"":""shield"",""weight"":2500}"
+bob,"{""type"":""flower"",""weight"":15}"
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+
+:mixedCSVSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.csv" ;
+  ] ;
+  rml:referenceFormulation rml:CSV .
+
+:mixedCSVView a rml:LogicalView ;
+  rml:viewOn :mixedCSVSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "name" ;
+  ] ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "item" ;
+    rml:reference "item" ;
+    rml:field [
+      a rml:IterableField ;
+      rml:referenceFormulation rml:JSONPath ;
+      rml:iterator "$" ;
+      rml:fieldName "itemJson" ;
+      rml:field [
+        a rml:ExpressionField;
+        rml:fieldName "type" ;
+        rml:reference "$.type" ; ] ;
+      rml:field [
+        a rml:ExpressionField;
+        rml:fieldName "weight" ;
+        rml:reference "$.weight" ;
+      ] ;
+    ] ;
+  ] .
+
+:triplesMapItem a rml:TriplesMap ;
+  rml:logicalSource :mixedCSVView ;
+  rml:subjectMap [
+    rml:template "http://example.org/item_{#}_{item.#}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasType ;
+    rml:objectMap [
+      rml:reference "item.itemJson.type" ;
+    ] ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasWeight ;
+    rml:objectMap [
+      rml:reference "item.itemJson.weight" ;
+      rml:datatype xsd:integer ;
+    ] ;
+  ] .
+
+

Output

+
<http://example.org/item_0_0> <http://example.org/hasType> "sword" .
+<http://example.org/item_0_0> <http://example.org/hasWeight> "1500"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.org/item_1_0> <http://example.org/hasType> "shield" .
+<http://example.org/item_1_0> <http://example.org/hasWeight> "2500"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.org/item_2_0> <http://example.org/hasType> "flower" .
+<http://example.org/item_2_0> <http://example.org/hasWeight> "15"^^<http://www.w3.org/2001/XMLSchema#integer> .
+
+
+

32. RMLLVTC0007c

+

Title: Change Reference Formulations: JSON including CSV

+

Description: Test a change of reference formulations: json source including csv data

+

Error expected? No

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "items": "type,weight\nsword,1500\nshield,2500"
+    },
+    {
+      "name": "bob",
+      "items": "type,weight\nflower,15"
+    }
+  ]
+}
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+
+:mixedJSONSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:mixedJSONView a rml:LogicalView ;
+  rml:viewOn :mixedJSONSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+    ] ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "items" ;
+    rml:reference "$.items" ;
+    rml:field [
+      a rml:IterableField ;
+      rml:referenceFormulation rml:CSV ;
+      rml:fieldName "item";
+      rml:field [
+        a rml:ExpressionField ;
+        rml:fieldName "type" ;
+        rml:reference "type" ;
+      ] ;
+      rml:field [
+        a rml:expressionField ;
+        rml:fieldName "weight" ;
+        rml:reference "weight" ;
+      ] ;
+    ] ;
+  ].
+
+:triplesMapItem a rml:TriplesMap ;
+  rml:logicalSource :mixedJSONView ;
+  rml:subjectMap [
+    rml:template "http://example.org/item_{#}_{items.item.#}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasType ;
+    rml:objectMap [
+      rml:reference "items.item.type" ;
+    ] ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasWeight ;
+    rml:objectMap [
+      rml:reference "items.item.weight" ;
+      rml:datatype xsd:integer ;
+    ] ;
+  ] .
+
+

Output

+
<http://example.org/item_0_0> <http://example.org/hasType> "sword" .
+<http://example.org/item_0_0> <http://example.org/hasWeight> "1500"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.org/item_0_1> <http://example.org/hasType> "shield" .
+<http://example.org/item_0_1> <http://example.org/hasWeight> "2500"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.org/item_1_0> <http://example.org/hasType> "flower" .
+<http://example.org/item_1_0> <http://example.org/hasWeight> "15"^^<http://www.w3.org/2001/XMLSchema#integer> .
+
+
+

33. RMLLVTC0008a

+

Title: Cycle: Abstract Logical Source

+

Description: Test a cycle in the abstract logical source of a logical view

+

Error expected? Yes

+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix : <http://example.org/> .
+
+:view1 a rml:LogicalView ;
+  rml:viewOn :view2 ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name1" ;
+    rml:reference "name2" ;
+  ] .
+
+:view2 a rml:LogicalView ;
+  rml:viewOn :view1 ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name2" ;
+    rml:reference "name1" ;
+  ] .
+
+:triplesMapPerson a rml:TriplesMap ;
+  rml:logicalSource :view2 ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{name2}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasName ;
+    rml:objectMap [
+      rml:reference "name2" ;
+    ] ;
+  ] .
+
+
+

34. RMLLVTC0008b

+

Title: Cycle: Joins

+

Description: Test a cycle in two joins of two logical views

+

Error expected? Yes

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "items": [
+        "sword",
+        "shield"
+      ]
+    },
+    {
+      "name": "bob",
+      "items": [
+        "flower"
+      ]
+    }
+  ]
+}
+
+

Input 1

+
name,birthyear
+alice,1995
+bob,1999
+tobias,2005
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+  rml:viewOn :jsonSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+  ] ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "item" ;
+    rml:reference "$.items[*]" ;
+  ] ;
+  rml:leftJoin [
+    rml:parentLogicalView :csvView ;
+    rml:joinCondition [
+      rml:parent "name" ;
+      rml:child "name" ;
+    ] ;
+    rml:field [
+      a rml:ExpressionField ;
+      rml:fieldName "csv_birthyear" ;
+      rml:reference "birthyear" ;
+    ] ;
+  ] .
+
+:csvSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.csv" ;
+  ] ;
+  rml:referenceFormulation rml:CSV .
+
+:csvView a rml:LogicalView ;
+  rml:viewOn :csvSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "name" ;
+  ] ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "birthyear" ;
+    rml:reference "birthyear" ;
+  ] ;
+  rml:leftJoin [
+    rml:parentLogicalView :jsonView ;
+    rml:joinCondition [
+      rml:parent "name" ;
+      rml:child "name" ;
+    ] ;
+    rml:field [
+      a rml:ExpressionField ;
+      rml:fieldName "json_item" ;
+      rml:reference "item" ;
+    ] ;
+  ] .
+
+
+:triplesMapPerson a rml:TriplesMap ;
+  rml:logicalSource :csvView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{name}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasBirthYear ;
+    rml:objectMap [
+      rml:reference "birthyear" ;
+      rml:datatype xsd:gYear ;
+    ] ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasItem ;
+    rml:objectMap [
+      rml:template "http://example.org/person/{name}/item/{json_item}" ;
+    ] ;
+  ] .
+
+
+

35. RMLLVTC0008c

+

Title: Cycle: Self-Join

+

Description: Test a cycle in a join of a logical view: self-join

+

Error expected? Yes

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "items": [
+        {
+          "type": "sword",
+          "weight": 1500
+        },
+        {
+          "type": "shield",
+          "weight": 2500
+        }
+      ]
+    },
+    {
+      "name": "bob",
+      "items": [
+        {
+          "type": "flower",
+          "weight": 15
+        }
+      ]
+    }
+  ]
+}
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+  rml:viewOn :jsonSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+  ] ;
+  rml:leftJoin [
+    rml:parentLogicalView :jsonView ;
+    rml:joinCondition [
+      rml:parent "name" ;
+      rml:child "name" ;
+    ] ;
+    rml:field [
+      a rml:ExpressionField ;
+      rml:fieldName "newName" ;
+      rml:reference "name" ;
+    ] ;
+  ] .
+
+:triplesMapPerson a rml:TriplesMap ;
+  rml:logicalSource :jsonView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{newName}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasName ;
+    rml:objectMap [
+      rml:reference "newName" ;
+    ] ;
+  ] .
+
+
+ + + + + + \ No newline at end of file diff --git a/src/test/resources/rml-lv/docs/20250805/index.html b/src/test/resources/rml-lv/docs/20250805/index.html new file mode 100644 index 00000000..c74314d0 --- /dev/null +++ b/src/test/resources/rml-lv/docs/20250805/index.html @@ -0,0 +1,3524 @@ + + + + + + +RML-LV: Test Cases + + + + + + + + + + + + + + + +
+ +

RML-LV: Test Cases

+

+ Draft Community Group Report + +

+
+ +
Latest published version:
+ https://www.w3.org/RML-LV-Testcases/ +
+
Latest editor's draft:
https://w3id.org/rml/lv/test-cases/
+ + + + +
Editors:
+ (Skemu) +
+ (Ghent University – imec – IDLab) +
+ +
Authors:
+ (Skemu) +
+ (Ghent University – imec – IDLab) +
+
Feedback:
+ GitHub kg-construct/rml-lv + (pull requests, + new issue, + open issues) +
+ +
+ + +
+
+ + + +

Abstract

This document defines the RML-LV test cases to the determine the RML-LV specification conformance of tools.

+
+ +

Status of This Document

+ This specification was published by the + Knowledge Graph Construction Community Group. It is not a W3C Standard nor is it + on the W3C Standards Track. + + Please note that under the + W3C Community Contributor License Agreement (CLA) + there is a limited opt-out and other conditions apply. + + Learn more about + W3C Community and Business Groups. +

+ GitHub Issues are preferred for + discussion of this specification. + + +

+ +

1. Introduction

+

This document defines the RML-LV test cases, consisting of a collection of test case documents (input and expected output). +The purpose of the test cases is to determine the conformance of tools that execute RML rules to the RML-LV specification.

+
+ +

2. Data model

+

The test cases are semantically described for re-usability and shareability following the W3C Test case description. +Each test:Testcase as the following properties:

+
    +
  • dcterms:identifier: unique ID of the test case.
  • +
  • rmltest:hasError: if an error of the RML Processor is expected or not.
  • +
  • rmltest:input: One or more input data of the test case.
  • +
  • rmltest:output: One or more output data of the test case.
  • +
  • rmltest:inputFormat: the input data format.
  • +
  • rmltest:outputFormat: the output data format.
  • +
  • rmltest:mappingDocument: the RML mapping rules in Turtle.
  • +
+
+ +

3. Test cases

+

This section describes the RML-LV test cases. These descriptions are also available as RDF. +The files are available on GitHub in the folder test-cases. +Each test case is contained in a single folder, containing three types of files:

+
    +
  • Zero or more files containing the data sources, in the case of JSON, XML, CSV, or containing the SQL statements to create the necessary tables, in the case of MySQL, PostgreSQL, and SQL Server.
  • +
  • One file with the RML rules, called mapping.ttl, in the Turtle format.
  • +
  • Zero or more files with the expected RDF. No file is provided if an error is expected that must halt the generation of the RDF because of an error.
  • +
+
+ + +

4. RMLLVTC0000a

+

Title: Logical view on JSON source

+

Description: Test a view on a hierarchical source

+

Error expected? No

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "items": [
+        {
+          "type": "sword",
+          "weight": 1500
+        },
+        {
+          "type": "shield",
+          "weight": 2500
+        }
+      ]
+    },
+    {
+      "name": "bob",
+      "items": [
+        {
+          "type": "flower",
+          "weight": 15
+        }
+      ]
+    }
+  ]
+}
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+  rml:viewOn :jsonSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+  ] .
+
+:triplesMapPerson a rml:TriplesMap ;
+  rml:logicalSource :jsonView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{name}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasName ;
+    rml:objectMap [
+      rml:reference "name" ;
+    ] ;
+  ] .
+
+

Output

+
<http://example.org/person/alice> <http://example.org/hasName> "alice" .
+<http://example.org/person/bob> <http://example.org/hasName> "bob" .
+
+
+

5. RMLLVTC0000b

+

Title: Logical view on CSV source

+

Description: Test a view on a tabular source

+

Error expected? No

+

Input

+
name,birthyear
+alice,1995
+bob,1999
+tobias,2005
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix : <http://example.org/> .
+
+:csvSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.csv" ;
+  ] ;
+  rml:referenceFormulation rml:CSV .
+
+:csvView a rml:LogicalView ;
+  rml:viewOn :csvSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "name" ;
+  ] .
+
+:triplesMapPerson a rml:TriplesMap ;
+  rml:logicalSource :csvView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{name}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasName ;
+    rml:objectMap [
+      rml:reference "name" ;
+    ] ;
+  ] .
+
+

Output

+
<http://example.org/person/alice> <http://example.org/hasName> "alice" .
+<http://example.org/person/bob> <http://example.org/hasName> "bob" .
+<http://example.org/person/tobias> <http://example.org/hasName> "tobias" .
+
+
+

6. RMLLVTC0000c

+

Title: Logical View on Logical View

+

Description: Test a view on a logical view

+

Error expected? No

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "items": [
+        {
+          "type": "sword",
+          "weight": 1500
+        },
+        {
+          "type": "shield",
+          "weight": 2500
+        }
+      ]
+    },
+    {
+      "name": "bob",
+      "items": [
+        {
+          "type": "flower",
+          "weight": 15
+        }
+      ]
+    }
+  ]
+}
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+  rml:viewOn :jsonSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+  ] .
+
+:jsonViewOnJsonView a rml:LogicalView ;
+  rml:viewOn :jsonView ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "newName" ;
+    rml:reference "name" ;
+  ] .
+
+:triplesMapPerson a rml:TriplesMap ;
+  rml:logicalSource :jsonViewOnJsonView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{newName}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasName ;
+    rml:objectMap [
+      rml:reference "newName" ;
+    ] ;
+  ] .
+
+

Output

+
<http://example.org/person/alice> <http://example.org/hasName> "alice" .
+<http://example.org/person/bob> <http://example.org/hasName> "bob" .
+
+
+

7. RMLLVTC0001a

+

Title: Expression Field: Reference

+

Description: Test a reference in an expression field

+

Error expected? No

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "items": [
+        {
+          "type": "sword",
+          "weight": 1500
+        },
+        {
+          "type": "shield",
+          "weight": 2500
+        }
+      ]
+    },
+    {
+      "name": "bob",
+      "items": [
+        {
+          "type": "flower",
+          "weight": 15
+        }
+      ]
+    }
+  ]
+}
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+  rml:viewOn :jsonSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+  ] .
+
+:triplesMapPerson a rml:TriplesMap ;
+  rml:logicalSource :jsonView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{name}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasName ;
+    rml:objectMap [
+      rml:reference "name" ;
+    ] ;
+  ] .
+
+

Output

+
<http://example.org/person/alice> <http://example.org/hasName> "alice" .
+<http://example.org/person/bob> <http://example.org/hasName> "bob" .
+
+
+

8. RMLLVTC0001b

+

Title: Expression Field: Template

+

Description: Test a template in an expression field

+

Error expected? No

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "items": [
+        {
+          "type": "sword",
+          "weight": 1500
+        },
+        {
+          "type": "shield",
+          "weight": 2500
+        }
+      ]
+    },
+    {
+      "name": "bob",
+      "items": [
+        {
+          "type": "flower",
+          "weight": 15
+        }
+      ]
+    }
+  ]
+}
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+  rml:viewOn :jsonSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+  ] ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "race" ;
+    rml:constant "human" ;
+  ] .
+
+:triplesMapPerson a rml:TriplesMap ;
+  rml:logicalSource :jsonView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{name}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasRace ;
+    rml:objectMap [
+      rml:reference "race" ;
+    ] ;
+  ] .
+
+

Output

+
<http://example.org/person/alice> <http://example.org/hasRace> "human" .
+<http://example.org/person/bob> <http://example.org/hasRace> "human" .
+
+
+

9. RMLLVTC0001c

+

Title: Expression Field: Constant

+

Description: Test a constant expression in an expression field

+

Error expected? No

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "lastName": "smith",
+      "items": [
+        {
+          "type": "sword",
+          "weight": 1500
+        },
+        {
+          "type": "shield",
+          "weight": 2500
+        }
+      ]
+    },
+    {
+      "name": "bob",
+      "lastName": "jones",
+      "items": [
+        {
+          "type": "flower",
+          "weight": 15
+        }
+      ]
+    }
+  ]
+}
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+  rml:viewOn :jsonSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+  ] ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "fullName" ;
+    rml:template "{name} {lastName}" ;
+  ] .
+
+:triplesMapPerson a rml:TriplesMap ;
+  rml:logicalSource :jsonView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{name}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasFullName ;
+    rml:objectMap [
+      rml:reference "fullName" ;
+    ] ;
+  ] .
+
+

Output

+
<http://example.org/person/alice> <http://example.org/hasFullName> "alice smith" .
+<http://example.org/person/bob> <http://example.org/hasFullName> "bob jones" .
+
+
+

10. RMLLVTC0001d

+

Title: Expression Field Siblings

+

Description: Test multiple expression fields with the same parent

+

Error expected? No

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "lastName": "smith",
+      "items": [
+        {
+          "type": "sword",
+          "weight": 1500
+        },
+        {
+          "type": "shield",
+          "weight": 2500
+        }
+      ]
+    },
+    {
+      "name": "bob",
+      "lastName": "jones",
+      "items": [
+        {
+          "type": "flower",
+          "weight": 15
+        }
+      ]
+    }
+  ]
+}
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+  rml:viewOn :jsonSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+  ] ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "lastName" ;
+    rml:reference "$.lastName" ;
+  ] .
+
+:triplesMapPerson a rml:TriplesMap ;
+  rml:logicalSource :jsonView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{name}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasFullName ;
+    rml:objectMap [
+      rml:template "{name} {lastName}" ;
+      rml:termType rml:Literal ;
+    ] ;
+  ] .
+
+

Output

+
<http://example.org/person/alice> <http://example.org/hasFullName> "alice smith" .
+<http://example.org/person/bob> <http://example.org/hasFullName> "bob jones" .
+
+
+

11. RMLLVTC0002a

+

Title: Iterable Field

+

Description: Test a nested field construction: iterable field with expression field as child

+

Error expected? No

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "items": [
+        {
+          "type": "sword",
+          "weight": 1500
+        },
+        {
+          "type": "shield",
+          "weight": 2500
+        }
+      ]
+    },
+    {
+      "name": "bob",
+      "items": [
+        {
+          "type": "flower",
+          "weight": 15
+        }
+      ]
+    }
+  ]
+}
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+  rml:viewOn :jsonSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+  ] ;
+  rml:field [
+    a rml:IterableField ;
+    rml:fieldName "item" ;
+    rml:iterator "$.items[*]" ;
+    rml:field [
+      a rml:ExpressionField ;
+      rml:fieldName "type" ;
+      rml:reference "$.type" ;
+    ] ;
+  ] .
+
+:triplesMapPerson a rml:TriplesMap ;
+  rml:logicalSource :jsonView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{name}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasItem ;
+    rml:objectMap [
+      rml:template "http://example.org/person/{name}/item/{item.type}" ;
+    ] ;
+  ] .
+
+

Output

+
<http://example.org/person/alice> <http://example.org/hasItem> <http://example.org/person/alice/item/sword> .
+<http://example.org/person/alice> <http://example.org/hasItem> <http://example.org/person/alice/item/shield> .
+<http://example.org/person/bob> <http://example.org/hasItem> <http://example.org/person/bob/item/flower> .
+
+
+

12. RMLLVTC0002b

+

Title: Iterable Field with Multiple Children

+

Description: Test a nested field construction: iterable field with mulitple expression fields as children

+

Error expected? No

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "items": [
+        {
+          "type": "sword",
+          "weight": 1500
+        },
+        {
+          "type": "shield",
+          "weight": 2500
+        }
+      ]
+    },
+    {
+      "name": "bob",
+      "items": [
+        {
+          "type": "flower",
+          "weight": 15
+        }
+      ]
+    }
+  ]
+}
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+  rml:viewOn :jsonSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+  ] ;
+  rml:field [
+    a rml:IterableField ;
+    rml:fieldName "item" ;
+    rml:iterator "$.items[*]" ;
+    rml:field [
+      a rml:ExpressionField ;
+      rml:fieldName "type" ;
+      rml:reference "$.type" ;
+    ] ;
+    rml:field [
+      a rml:ExpressionField ;
+      rml:fieldName "weight" ;
+      rml:reference "$.weight" ;
+    ] ;
+  ] .
+
+:triplesMapItem a rml:TriplesMap ;
+  rml:logicalSource :jsonView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{name}/item/{item.type}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasName ;
+    rml:objectMap [
+      rml:reference "item.type" ;
+    ] ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasWeight ;
+    rml:objectMap [
+      rml:reference "item.weight" ;
+      rml:datatype xsd:integer ;
+    ] ;
+  ] .
+
+

Output

+
<http://example.org/person/alice/item/sword> <http://example.org/hasName> "sword" .
+<http://example.org/person/alice/item/sword> <http://example.org/hasWeight> "1500"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.org/person/alice/item/shield> <http://example.org/hasName> "shield" .
+<http://example.org/person/alice/item/shield> <http://example.org/hasWeight> "2500"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.org/person/bob/item/flower> <http://example.org/hasName> "flower" .
+<http://example.org/person/bob/item/flower> <http://example.org/hasWeight> "15"^^<http://www.w3.org/2001/XMLSchema#integer> .
+
+
+

13. RMLLVTC0002c

+

Title: Nested Iterable Fields

+

Description: Test a nested field construction: iterable field with an iterable field as child

+

Error expected? No

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "items": [
+        {
+          "type": "sword",
+          "measures": {
+            "weight": 1500,
+            "length": 30
+          }
+        },
+        {
+          "type": "shield",
+          "measures": {
+            "weight": 2500
+          }
+        }
+      ]
+    },
+    {
+      "name": "bob",
+      "items": [
+        {
+          "type": "flower",
+          "measures" : {
+            "weight": 15,
+            "length" : 15
+          }
+        }
+      ]
+    }
+  ]
+}
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+  rml:viewOn :jsonSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+  ] ;
+  rml:field [
+    a rml:IterableField ;
+    rml:fieldName "item" ;
+    rml:iterator "$.items[*]" ;
+    rml:field [
+      rml:fieldName "type" ;
+      rml:reference "$.type" ;
+    ] ;
+    rml:field [
+      a rml:IterableField ;
+      rml:fieldName "measures";
+      rml:iterator "$.measures";
+      rml:field [
+        a rml:ExpressionField ;
+        rml:fieldName "weight" ;
+        rml:reference "$.weight" ;
+        ];
+    ] ;
+  ] .
+
+:triplesMapItem a rml:TriplesMap ;
+  rml:logicalSource :jsonView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{name}/item/{item.type}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasWeight ;
+    rml:objectMap [
+      rml:reference "item.measures.weight" ;
+      rml:datatype xsd:integer ;
+    ] ;
+  ] .
+
+

Output

+
<http://example.org/person/alice/item/sword> <http://example.org/hasWeight> "1500"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.org/person/alice/item/shield> <http://example.org/hasWeight> "2500"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.org/person/bob/item/flower> <http://example.org/hasWeight> "15"^^<http://www.w3.org/2001/XMLSchema#integer> .
+
+
+

14. RMLLVTC0003a

+

Title: Index Key: #

+

Description: Test a reference to the index key #

+

Error expected? No

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "items": [
+        {
+          "type": "sword",
+          "weight": 1500
+        },
+        {
+          "type": "shield",
+          "weight": 2500
+        }
+      ]
+    },
+    {
+      "name": "bob",
+      "items": [
+        {
+          "type": "flower",
+          "weight": 15
+        }
+      ]
+    }
+  ]
+}
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+  rml:viewOn :jsonSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+  ] .
+
+:triplesMapPerson a rml:TriplesMap ;
+  rml:logicalSource :jsonView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{name}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasSequenceNumber ;
+    rml:objectMap [
+      rml:reference "#" ;
+      rml:datatype xsd:integer ;
+    ] ;
+  ] .
+
+

Output

+
<http://example.org/person/alice> <http://example.org/hasSequenceNumber> "0"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.org/person/bob> <http://example.org/hasSequenceNumber> "1"^^<http://www.w3.org/2001/XMLSchema#integer> .
+
+
+

15. RMLLVTC0003b

+

Title: Index Key: Iterable Field

+

Description: Test a reference to the index key of an iterable field

+

Error expected? No

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "items": [
+        {
+          "type": "sword",
+          "weight": 1500
+        },
+        {
+          "type": "shield",
+          "weight": 2500
+        }
+      ]
+    },
+    {
+      "name": "bob",
+      "items": [
+        {
+          "type": "flower",
+          "weight": 15
+        }
+      ]
+    }
+  ]
+}
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+  rml:viewOn :jsonSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+  ] ;
+  rml:field [
+    a rml:IterableField ;
+    rml:fieldName "item" ;
+    rml:iterator "$.items[*]" ;
+    rml:field [
+      a rml:ExpressionField ;
+      rml:fieldName "type" ;
+      rml:reference "$.type" ;
+    ] ;
+  ] .
+
+:triplesMapPerson a rml:TriplesMap ;
+  rml:logicalSource :jsonView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{name}/item/{item.#}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasType ;
+    rml:objectMap [
+      rml:reference "item.type" ;
+    ] ;
+  ] .
+
+

Output

+
<http://example.org/person/alice/item/0> <http://example.org/hasType> "sword" .
+<http://example.org/person/alice/item/1> <http://example.org/hasType> "shield" .
+<http://example.org/person/bob/item/0> <http://example.org/hasType> "flower" .
+
+
+
+

16. RMLLVTC0003c

+

Title: Index Key: Expression field

+

Description: Test a reference to the index key of an expression field

+

Error expected? No

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "items": [
+        "sword",
+        "shield"
+      ]
+    },
+    {
+      "name": "bob",
+      "items": [
+        "flower"
+      ]
+    }
+  ]
+}
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+  rml:viewOn :jsonSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+  ] ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "item" ;
+    rml:reference "$.items[*]" ;
+  ] .
+
+:triplesMapItem a rml:TriplesMap ;
+  rml:logicalSource :jsonView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{name}/item/{item.#}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasType ;
+    rml:objectMap [
+      rml:reference "item" ;
+    ] ;
+  ] .
+
+

Output

+
<http://example.org/person/alice/item/0> <http://example.org/hasType> "sword" .
+<http://example.org/person/alice/item/1> <http://example.org/hasType> "shield" .
+<http://example.org/person/bob/item/0> <http://example.org/hasType> "flower" .
+
+
+

17. RMLLVTC0004a

+

Title: Natural Datatype: Index #

+

Description: Test the natural datatype mapping for the index #

+

Error expected? No

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "items": [
+        {
+          "type": "sword",
+          "weight": 1500
+        },
+        {
+          "type": "shield",
+          "weight": 2500
+        }
+      ]
+    },
+    {
+      "name": "bob",
+      "items": [
+        {
+          "type": "flower",
+          "weight": 15
+        }
+      ]
+    }
+  ]
+}
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+  rml:viewOn :jsonSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+  ] .
+
+:triplesMapPerson a rml:TriplesMap ;
+  rml:logicalSource :jsonView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{name}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasSequenceNumber ;
+    rml:objectMap [
+      rml:reference "#" ;
+    ] ;
+  ] .
+
+

Output

+
<http://example.org/person/alice> <http://example.org/hasSequenceNumber> "0"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.org/person/bob> <http://example.org/hasSequenceNumber> "1"^^<http://www.w3.org/2001/XMLSchema#integer> .
+
+
+

18. RMLLVTC0004b

+

Title: Natural Datatype: Index Expression Field

+

Description: Test the natural datatype mapping for the index of an expression field

+

Error expected? No

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "items": [
+        {
+          "type": "sword",
+          "weight": 1500
+        },
+        {
+          "type": "shield",
+          "weight": 2500
+        }
+      ]
+    },
+    {
+      "name": "bob",
+      "items": [
+        {
+          "type": "flower",
+          "weight": 15
+        }
+      ]
+    }
+  ]
+}
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+  rml:viewOn :jsonSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+  ] ;
+  rml:field [
+    a rml:IterableField ;
+    rml:fieldName "item" ;
+    rml:iterator "$.items[*]" ;
+    rml:field [
+      a rml:ExpressionField ;
+      rml:fieldName "type" ;
+      rml:reference "$.type" ;
+    ] ;
+  ] .
+
+:triplesMapPerson a rml:TriplesMap ;
+  rml:logicalSource :jsonView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{name}/item/{item.type}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasSequenceNumber ;
+    rml:objectMap [
+      rml:reference "item.#" ;
+    ] ;
+  ] .
+
+

Output

+
<http://example.org/person/alice/item/sword> <http://example.org/hasSequenceNumber> "0"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.org/person/alice/item/shield> <http://example.org/hasSequenceNumber> "1"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.org/person/bob/item/flower> <http://example.org/hasSequenceNumber> "0"^^<http://www.w3.org/2001/XMLSchema#integer> .
+
+
+

19. RMLLVTC0004c

+

Title: Natural Datatype: Index Iterable Field

+

Description: Test the natural datatype mapping for the index of an iterable field

+

Error expected? No

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "items": [
+        "sword",
+        "shield"
+      ]
+    },
+    {
+      "name": "bob",
+      "items": [
+        "flower"
+      ]
+    }
+  ]
+}
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+  rml:viewOn :jsonSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+  ] ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "item" ;
+    rml:reference "$.items[*]" ;
+  ] .
+
+:triplesMapItem a rml:TriplesMap ;
+  rml:logicalSource :jsonView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{name}/item/{item}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasSequenceNumber ;
+    rml:objectMap [
+      rml:reference "item.#" ;
+    ] ;
+  ] .
+
+

Output

+
<http://example.org/person/alice/item/sword> <http://example.org/hasSequenceNumber> "0"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.org/person/alice/item/shield> <http://example.org/hasSequenceNumber> "1"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.org/person/bob/item/flower> <http://example.org/hasSequenceNumber> "0"^^<http://www.w3.org/2001/XMLSchema#integer> .
+
+
+

20. RMLLVTC0004d

+

Title: Natural Datatype: Record Expression Field

+

Description: Test the natural datatype mapping for a record of an expression field

+

Error expected? No

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "birth_year": 1995
+    },
+    {
+      "name": "bob",
+      "birth_year": 1999
+    }
+  ]
+}
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+  rml:viewOn :jsonSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+  ] ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "birthyear" ;
+    rml:reference "$.birth_year" ;
+  ] .
+
+:triplesMapItem a rml:TriplesMap ;
+  rml:logicalSource :jsonView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{name}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasBirthYear ;
+    rml:objectMap [
+      rml:reference "birthyear" ;
+    ] ;
+  ] .
+
+

Output

+
<http://example.org/person/alice> <http://example.org/hasBirthYear> "1995"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.org/person/bob> <http://example.org/hasBirthYear> "1999"^^<http://www.w3.org/2001/XMLSchema#integer> .
+
+
+

21. RMLLVTC0005a

+

Title: Referencing a Non-Existing Key

+

Description: Test a reference to a non-existing key

+

Error expected? Yes

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "items": [
+        {
+          "type": "sword",
+          "weight": 1500
+        },
+        {
+          "type": "shield",
+          "weight": 2500
+        }
+      ]
+    },
+    {
+      "name": "bob",
+      "items": [
+        {
+          "type": "flower",
+          "weight": 15
+        }
+      ]
+    }
+  ]
+}
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+  rml:viewOn :jsonSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+  ] .
+
+:triplesMapPerson a rml:TriplesMap ;
+  rml:logicalSource :jsonView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{Name}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasName ;
+    rml:objectMap [
+      rml:reference "Name" ;
+    ] ;
+  ] .
+
+
+

22. RMLLVTC0005b

+

Title: Referencing the Record Key

+

Description: Test a reference to the record key

+

Error expected? Yes

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "items": [
+        {
+          "type": "sword",
+          "weight": 1500
+        },
+        {
+          "type": "shield",
+          "weight": 2500
+        }
+      ]
+    },
+    {
+      "name": "bob",
+      "items": [
+        {
+          "type": "flower",
+          "weight": 15
+        }
+      ]
+    }
+  ]
+}
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+  rml:viewOn :jsonSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+  ] .
+
+:triplesMapPerson a rml:TriplesMap ;
+  rml:logicalSource :jsonView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{name}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :isDerivedFrom ;
+    rml:objectMap [
+      rml:reference "<it>" ;
+    ] ;
+  ] .
+
+
+

23. RMLLVTC0005c

+

Title: Referencing the Record Key of an Iterable Field

+

Description: Test a reference to the record key of an iterable field

+

Error expected? Yes

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "items": [
+        {
+          "type": "sword",
+          "weight": 1500
+        },
+        {
+          "type": "shield",
+          "weight": 2500
+        }
+      ]
+    },
+    {
+      "name": "bob",
+      "items": [
+        {
+          "type": "flower",
+          "weight": 15
+        }
+      ]
+    }
+  ]
+}
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+  rml:viewOn :jsonSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+  ] ;
+  rml:field [
+    a rml:IterableField ;
+    rml:fieldName "item" ;
+    rml:iterator "$.items[*]" ;
+    rml:field [
+      a rml:ExpressionField ;
+      rml:fieldName "type" ;
+      rml:reference "$.type" ;
+    ] ;
+  ] .
+
+:triplesMapPerson a rml:TriplesMap ;
+  rml:logicalSource :jsonView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{name}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasItem ;
+    rml:objectMap [
+      rml:template "http://example.org/person/{name}/{item}" ;
+    ] ;
+  ] .
+
+
+

24. RMLLVTC0006a

+

Title: Left Join

+

Description: Test a left join

+

Error expected? No

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "items": [
+        "sword",
+        "shield"
+      ]
+    },
+    {
+      "name": "bob",
+      "items": [
+        "flower"
+      ]
+    }
+  ]
+}
+
+

Input 1

+
name,birthyear
+alice,1995
+bob,1999
+tobias,2005
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+  rml:viewOn :jsonSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+  ] ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "item" ;
+    rml:reference "$.items[*]" ;
+  ] .
+
+:csvSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.csv" ;
+  ] ;
+  rml:referenceFormulation rml:CSV .
+
+:csvView a rml:LogicalView ;
+  rml:viewOn :csvSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "name" ;
+  ] ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "birthyear" ;
+    rml:reference "birthyear" ;
+  ] ;
+  rml:leftJoin [
+    rml:parentLogicalView :jsonView ;
+    rml:joinCondition [
+      rml:parent "name" ;
+      rml:child "name" ;
+    ] ;
+    rml:field [
+      a rml:ExpressionField ;
+      rml:fieldName "json_item" ;
+      rml:reference "item" ;
+    ] ;
+  ] .
+
+
+:triplesMapPerson a rml:TriplesMap ;
+  rml:logicalSource :csvView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{name}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasBirthYear ;
+    rml:objectMap [
+      rml:reference "birthyear" ;
+      rml:datatype xsd:gYear ;
+    ] ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasItem ;
+    rml:objectMap [
+      rml:template "http://example.org/person/{name}/item/{json_item}" ;
+    ] ;
+  ] .
+
+

Output

+
<http://example.org/person/alice> <http://example.org/hasBirthYear> "1995"^^<http://www.w3.org/2001/XMLSchema#gYear> .
+<http://example.org/person/alice> <http://example.org/hasItem> <http://example.org/person/alice/item/sword> .
+<http://example.org/person/alice> <http://example.org/hasItem> <http://example.org/person/alice/item/shield> .
+<http://example.org/person/bob> <http://example.org/hasBirthYear> "1999"^^<http://www.w3.org/2001/XMLSchema#gYear> .
+<http://example.org/person/bob> <http://example.org/hasItem> <http://example.org/person/bob/item/flower> .
+<http://example.org/person/tobias> <http://example.org/hasBirthYear> "2005"^^<http://www.w3.org/2001/XMLSchema#gYear> .
+
+
+

25. RMLLVTC0006b

+

Title: Inner Join

+

Description: Test an inner join

+

Error expected? No

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "items": [
+        "sword",
+        "shield"
+      ]
+    },
+    {
+      "name": "bob",
+      "items": [
+        "flower"
+      ]
+    }
+  ]
+}
+
+

Input 1

+
name,birthyear
+alice,1995
+bob,1999
+tobias,2005
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+  rml:viewOn :jsonSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+  ] ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "item" ;
+    rml:reference "$.items[*]" ;
+  ] .
+
+:csvSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.csv" ;
+  ] ;
+  rml:referenceFormulation rml:CSV .
+
+:csvView a rml:LogicalView ;
+  rml:viewOn :csvSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "name" ;
+  ] ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "birthyear" ;
+    rml:reference "birthyear" ;
+  ] ;
+  rml:innerJoin [
+    rml:parentLogicalView :jsonView ;
+    rml:joinCondition [
+      rml:parent "name" ;
+      rml:child "name" ;
+    ] ;
+    rml:field [
+      a rml:ExpressionField ;
+      rml:fieldName "json_item" ;
+      rml:reference "item" ;
+    ] ;
+  ] .
+
+
+:triplesMapPerson a rml:TriplesMap ;
+  rml:logicalSource :csvView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{name}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasBirthYear ;
+    rml:objectMap [
+      rml:reference "birthyear" ;
+      rml:datatype xsd:gYear ;
+    ] ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasItem ;
+    rml:objectMap [
+      rml:template "http://example.org/person/{name}/item/{json_item}" ;
+    ] ;
+  ] .
+
+

Output

+
<http://example.org/person/alice> <http://example.org/hasBirthYear> "1995"^^<http://www.w3.org/2001/XMLSchema#gYear> .
+<http://example.org/person/alice> <http://example.org/hasItem> <http://example.org/person/alice/item/sword> .
+<http://example.org/person/alice> <http://example.org/hasItem> <http://example.org/person/alice/item/shield> .
+<http://example.org/person/bob> <http://example.org/hasBirthYear> "1999"^^<http://www.w3.org/2001/XMLSchema#gYear> .
+<http://example.org/person/bob> <http://example.org/hasItem> <http://example.org/person/bob/item/flower> .
+
+
+

26. RMLLVTC0006c

+

Title: Two Left Joins

+

Description: Test two left joins in one logical view

+

Error expected? No

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "items": [
+        "sword",
+        "shield"
+      ]
+    },
+    {
+      "name": "bob",
+      "items": [
+        "flower"
+      ]
+    }
+  ]
+}
+
+

Input 1

+
name,birthyear
+alice,1995
+bob,1999
+tobias,2005
+
+

Input 2

+
name,id
+alice,123
+bob,456
+tobias,789
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+  rml:viewOn :jsonSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+  ] ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "item" ;
+    rml:reference "$.items[*]" ;
+  ] .
+
+:additionalCsvSource a rml:LogicalSource ;
+  rml:source [
+   a rml:RelativePathSource , rml:Source ;
+   rml:root rml:MappingDirectory ;
+   rml:path "people2.csv" ;
+  ] ;
+  rml:referenceFormulation rml:CSV .
+
+:additionalCsvView a rml:LogicalView ;
+  rml:viewOn :additionalCsvSource ;
+    rml:field [
+     a rml:ExpressionField ;
+     rml:fieldName "name" ;
+     rml:reference "name" ;
+    ] ;
+    rml:field [
+     a rml:ExpressionField ;
+     rml:fieldName "id" ;
+     rml:reference "id" ;
+    ] ;
+.
+
+:csvSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.csv" ;
+  ] ;
+  rml:referenceFormulation rml:CSV .
+
+:csvView a rml:LogicalView ;
+  rml:viewOn :csvSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "name" ;
+  ] ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "birthyear" ;
+    rml:reference "birthyear" ;
+  ] ;
+  rml:leftJoin [
+    rml:parentLogicalView :jsonView ;
+    rml:joinCondition [
+      rml:parent "name" ;
+      rml:child "name" ;
+    ] ;
+    rml:field [
+      a rml:ExpressionField ;
+      rml:fieldName "json_item" ;
+      rml:reference "item" ;
+    ] ;
+  ] ;
+  rml:leftJoin [
+    rml:parentLogicalView :additionalCsvView ;
+    rml:joinCondition [
+      rml:parent "name" ;
+      rml:child "name" ;
+    ] ;
+    rml:field [
+      a rml:ExpressionField ;
+      rml:fieldName "csv2_id" ;
+      rml:reference "id" ;
+    ] ;
+  ] .
+
+
+:triplesMapPerson a rml:TriplesMap ;
+  rml:logicalSource :csvView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{csv2_id}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasBirthYear ;
+    rml:objectMap [
+      rml:reference "birthyear" ;
+      rml:datatype xsd:gYear ;
+    ] ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasItem ;
+    rml:objectMap [
+      rml:template "http://example.org/person/{csv2_id}/item/{json_item}" ;
+    ] ;
+  ] .
+
+

Output

+
<http://example.org/person/123> <http://example.org/hasBirthYear> "1995"^^<http://www.w3.org/2001/XMLSchema#gYear> .
+<http://example.org/person/123> <http://example.org/hasItem> <http://example.org/person/123/item/sword> .
+<http://example.org/person/123> <http://example.org/hasItem> <http://example.org/person/123/item/shield> .
+<http://example.org/person/456> <http://example.org/hasBirthYear> "1999"^^<http://www.w3.org/2001/XMLSchema#gYear> .
+<http://example.org/person/456> <http://example.org/hasItem> <http://example.org/person/456/item/flower> .
+<http://example.org/person/789> <http://example.org/hasBirthYear> "2005"^^<http://www.w3.org/2001/XMLSchema#gYear> .
+
+
+

27. RMLLVTC0006d

+

Title: Inner Join and Left Join

+

Description: Test an inner join and a left join in one logical view

+

Error expected? No

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "items": [
+        "sword",
+        "shield"
+      ]
+    },
+    {
+      "name": "bob",
+      "items": [
+        "flower"
+      ]
+    }
+  ]
+}
+
+

Input 1

+
name,birthyear
+alice,1995
+bob,1999
+tobias,2005
+
+

Input 2

+
name,id
+alice,123
+bob,456
+tobias,789
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+  rml:viewOn :jsonSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+  ] ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "item" ;
+    rml:reference "$.items[*]" ;
+  ] .
+
+:additionalCsvSource a rml:LogicalSource ;
+  rml:source [
+   a rml:RelativePathSource , rml:Source ;
+   rml:root rml:MappingDirectory ;
+   rml:path "people2.csv" ;
+  ] ;
+  rml:referenceFormulation rml:CSV .
+
+:additionalCsvView a rml:LogicalView ;
+  rml:viewOn :additionalCsvSource ;
+    rml:field [
+     a rml:ExpressionField ;
+     rml:fieldName "name" ;
+     rml:reference "name" ;
+    ] ;
+    rml:field [
+     a rml:ExpressionField ;
+     rml:fieldName "id" ;
+     rml:reference "id" ;
+    ] ;
+.
+
+:csvSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.csv" ;
+  ] ;
+  rml:referenceFormulation rml:CSV .
+
+:csvView a rml:LogicalView ;
+  rml:viewOn :csvSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "name" ;
+  ] ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "birthyear" ;
+    rml:reference "birthyear" ;
+  ] ;
+  rml:innerJoin [
+    rml:parentLogicalView :jsonView ;
+    rml:joinCondition [
+      rml:parent "name" ;
+      rml:child "name" ;
+    ] ;
+    rml:field [
+      a rml:ExpressionField ;
+      rml:fieldName "json_item" ;
+      rml:reference "item" ;
+    ] ;
+  ] ;
+  rml:leftJoin [
+    rml:parentLogicalView :additionalCsvView ;
+    rml:joinCondition [
+      rml:parent "name" ;
+      rml:child "name" ;
+    ] ;
+    rml:field [
+      a rml:ExpressionField ;
+      rml:fieldName "csv2_id" ;
+      rml:reference "id" ;
+    ] ;
+  ] .
+
+
+:triplesMapPerson a rml:TriplesMap ;
+  rml:logicalSource :csvView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{csv2_id}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasBirthYear ;
+    rml:objectMap [
+      rml:reference "birthyear" ;
+      rml:datatype xsd:gYear ;
+    ] ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasItem ;
+    rml:objectMap [
+      rml:template "http://example.org/person/{csv2_id}/item/{json_item}" ;
+    ] ;
+  ] .
+
+

Output

+
<http://example.org/person/123> <http://example.org/hasBirthYear> "1995"^^<http://www.w3.org/2001/XMLSchema#gYear> .
+<http://example.org/person/123> <http://example.org/hasItem> <http://example.org/person/123/item/sword> .
+<http://example.org/person/123> <http://example.org/hasItem> <http://example.org/person/123/item/shield> .
+<http://example.org/person/456> <http://example.org/hasBirthYear> "1999"^^<http://www.w3.org/2001/XMLSchema#gYear> .
+<http://example.org/person/456> <http://example.org/hasItem> <http://example.org/person/456/item/flower> .
+
+
+

28. RMLLVTC0006e

+

Title: Two Inner Joins

+

Description: Test two left joins in one logical view

+

Error expected? No

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "items": [
+        "sword",
+        "shield"
+      ]
+    },
+    {
+      "name": "bob",
+      "items": [
+        "flower"
+      ]
+    }
+  ]
+}
+
+

Input 1

+
name,birthyear
+alice,1995
+bob,1999
+tobias,2005
+
+

Input 2

+
name,id
+alice,123
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+  rml:viewOn :jsonSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+  ] ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "item" ;
+    rml:reference "$.items[*]" ;
+  ] .
+
+:additionalCsvSource a rml:LogicalSource ;
+  rml:source [
+   a rml:RelativePathSource , rml:Source ;
+   rml:root rml:MappingDirectory ;
+   rml:path "people2.csv" ;
+  ] ;
+  rml:referenceFormulation rml:CSV .
+
+:additionalCsvView a rml:LogicalView ;
+  rml:viewOn :additionalCsvSource ;
+    rml:field [
+     a rml:ExpressionField ;
+     rml:fieldName "name" ;
+     rml:reference "name" ;
+    ] ;
+    rml:field [
+     a rml:ExpressionField ;
+     rml:fieldName "id" ;
+     rml:reference "id" ;
+    ] ;
+.
+
+:csvSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.csv" ;
+  ] ;
+  rml:referenceFormulation rml:CSV .
+
+:csvView a rml:LogicalView ;
+  rml:viewOn :csvSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "name" ;
+  ] ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "birthyear" ;
+    rml:reference "birthyear" ;
+  ] ;
+  rml:innerJoin [
+    rml:parentLogicalView :jsonView ;
+    rml:joinCondition [
+      rml:parent "name" ;
+      rml:child "name" ;
+    ] ;
+    rml:field [
+      a rml:ExpressionField ;
+      rml:fieldName "json_item" ;
+      rml:reference "item" ;
+    ] ;
+  ] ;
+  rml:innerJoin [
+    rml:parentLogicalView :additionalCsvView ;
+    rml:joinCondition [
+      rml:parent "name" ;
+      rml:child "name" ;
+    ] ;
+    rml:field [
+      a rml:ExpressionField ;
+      rml:fieldName "csv2_id" ;
+      rml:reference "id" ;
+    ] ;
+  ] .
+
+
+:triplesMapPerson a rml:TriplesMap ;
+  rml:logicalSource :csvView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{csv2_id}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasBirthYear ;
+    rml:objectMap [
+      rml:reference "birthyear" ;
+      rml:datatype xsd:gYear ;
+    ] ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasItem ;
+    rml:objectMap [
+      rml:template "http://example.org/person/{csv2_id}/item/{json_item}" ;
+    ] ;
+  ] .
+
+

Output

+
<http://example.org/person/123> <http://example.org/hasBirthYear> "1995"^^<http://www.w3.org/2001/XMLSchema#gYear> .
+<http://example.org/person/123> <http://example.org/hasItem> <http://example.org/person/123/item/sword> .
+<http://example.org/person/123> <http://example.org/hasItem> <http://example.org/person/123/item/shield> .
+
+
+

29. RMLLVTC0006f

+

Title: Index Key of Field in Join

+

Description: Test references to indexes of fields from a join

+

Error expected? No

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "items": [
+        "sword",
+        "shield"
+      ]
+    },
+    {
+      "name": "bob",
+      "items": [
+        "flower"
+      ]
+    }
+  ]
+}
+
+

Input 1

+
name,birthyear
+alice,1995
+tobias,2005
+bob,1999
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+  rml:viewOn :jsonSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+  ] ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "item" ;
+    rml:reference "$.items[*]" ;
+  ] .
+
+:csvSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.csv" ;
+  ] ;
+  rml:referenceFormulation rml:CSV .
+
+:csvView a rml:LogicalView ;
+  rml:viewOn :csvSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "name" ;
+  ] ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "birthyear" ;
+    rml:reference "birthyear" ;
+  ] ;
+  rml:innerJoin [
+    rml:parentLogicalView :jsonView ;
+    rml:joinCondition [
+      rml:parent "name" ;
+      rml:child "name" ;
+    ] ;
+    rml:field [
+      a rml:ExpressionField ;
+      rml:fieldName "json_item" ;
+      rml:reference "item" ;
+    ] ;
+  ] .
+
+
+:triplesMapPerson a rml:TriplesMap ;
+  rml:logicalSource :csvView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{#}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasBirthYear ;
+    rml:objectMap [
+      rml:reference "birthyear" ;
+      rml:datatype xsd:gYear ;
+    ] ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasItem ;
+    rml:objectMap [
+      rml:template "http://example.org/person/{#}/item/{json_item.#}/{json_item}" ;
+    ] ;
+  ] .
+
+

Output

+
<http://example.org/person/0> <http://example.org/hasBirthYear> "1995"^^<http://www.w3.org/2001/XMLSchema#gYear> .
+<http://example.org/person/0> <http://example.org/hasItem> <http://example.org/person/0/item/0/sword> .
+<http://example.org/person/0> <http://example.org/hasItem> <http://example.org/person/0/item/1/shield> .
+<http://example.org/person/2> <http://example.org/hasBirthYear> "1999"^^<http://www.w3.org/2001/XMLSchema#gYear> .
+<http://example.org/person/2> <http://example.org/hasItem> <http://example.org/person/2/item/0/flower> .
+
+
+
+

30. RMLLVTC0007a

+

Title: Change Reference Formulations: CSV including JSON array

+

Description: Test a change of reference formulations: csv source including json array

+

Error expected? No

+

Input

+
name,items
+alice,"[{""type"":""sword"",""weight"":1500},{""type"":""shield"",""weight"":2500}]"
+bob,"[{""type"":""flower"",""weight"":15}]"
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+
+:mixedCSVSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.csv" ;
+  ] ;
+  rml:referenceFormulation rml:CSV .
+
+:mixedCSVView a rml:LogicalView ;
+  rml:viewOn :mixedCSVSource ;
+  rml:field [
+    a rml:ExpressionField;
+    rml:fieldName "name" ;
+    rml:reference "name" ;
+  ] ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "items" ;
+    rml:reference "items" ;
+    rml:field [
+      a rml:IterableField ;
+      rml:referenceFormulation rml:JSONPath ;
+      rml:iterator "$[*]" ;
+      rml:fieldName "item" ;
+      rml:field [
+        a rml:ExpressionField ;
+        rml:fieldName "type" ;
+        rml:reference "$.type" ;
+      ] ;
+      rml:field [
+        a rml:ExpressionField ;
+        rml:fieldName "weight" ;
+        rml:reference "$.weight" ;
+      ] ;
+    ] ;
+  ] .
+
+:triplesMapItem a rml:TriplesMap ;
+  rml:logicalSource :mixedCSVView ;
+  rml:subjectMap [
+    rml:template "http://example.org/item_{#}_{items.item.#}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasType ;
+    rml:objectMap [
+      rml:reference "items.item.type" ;
+    ] ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasWeight ;
+    rml:objectMap [
+      rml:reference "items.item.weight" ;
+      rml:datatype xsd:integer ;
+    ] ;
+  ] .
+
+

Output

+
<http://example.org/item_0_0> <http://example.org/hasType> "sword" .
+<http://example.org/item_0_0> <http://example.org/hasWeight> "1500"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.org/item_0_1> <http://example.org/hasType> "shield" .
+<http://example.org/item_0_1> <http://example.org/hasWeight> "2500"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.org/item_1_0> <http://example.org/hasType> "flower" .
+<http://example.org/item_1_0> <http://example.org/hasWeight> "15"^^<http://www.w3.org/2001/XMLSchema#integer> .
+
+
+

31. RMLLVTC0007b

+

Title: Change Reference Formulations: CSV including JSON object

+

Description: Test a change of reference formulations: csv source including json object

+

Error expected? No

+

Input

+
name,item
+alice,"{""type"":""sword"",""weight"":1500}"
+alice,"{""type"":""shield"",""weight"":2500}"
+bob,"{""type"":""flower"",""weight"":15}"
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+
+:mixedCSVSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.csv" ;
+  ] ;
+  rml:referenceFormulation rml:CSV .
+
+:mixedCSVView a rml:LogicalView ;
+  rml:viewOn :mixedCSVSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "name" ;
+  ] ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "item" ;
+    rml:reference "item" ;
+    rml:field [
+      a rml:IterableField ;
+      rml:referenceFormulation rml:JSONPath ;
+      rml:iterator "$" ;
+      rml:fieldName "itemJson" ;
+      rml:field [
+        a rml:ExpressionField;
+        rml:fieldName "type" ;
+        rml:reference "$.type" ; ] ;
+      rml:field [
+        a rml:ExpressionField;
+        rml:fieldName "weight" ;
+        rml:reference "$.weight" ;
+      ] ;
+    ] ;
+  ] .
+
+:triplesMapItem a rml:TriplesMap ;
+  rml:logicalSource :mixedCSVView ;
+  rml:subjectMap [
+    rml:template "http://example.org/item_{#}_{item.#}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasType ;
+    rml:objectMap [
+      rml:reference "item.itemJson.type" ;
+    ] ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasWeight ;
+    rml:objectMap [
+      rml:reference "item.itemJson.weight" ;
+      rml:datatype xsd:integer ;
+    ] ;
+  ] .
+
+

Output

+
<http://example.org/item_0_0> <http://example.org/hasType> "sword" .
+<http://example.org/item_0_0> <http://example.org/hasWeight> "1500"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.org/item_1_0> <http://example.org/hasType> "shield" .
+<http://example.org/item_1_0> <http://example.org/hasWeight> "2500"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.org/item_2_0> <http://example.org/hasType> "flower" .
+<http://example.org/item_2_0> <http://example.org/hasWeight> "15"^^<http://www.w3.org/2001/XMLSchema#integer> .
+
+
+

32. RMLLVTC0007c

+

Title: Change Reference Formulations: JSON including CSV

+

Description: Test a change of reference formulations: json source including csv data

+

Error expected? No

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "items": "type,weight\nsword,1500\nshield,2500"
+    },
+    {
+      "name": "bob",
+      "items": "type,weight\nflower,15"
+    }
+  ]
+}
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+
+:mixedJSONSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:mixedJSONView a rml:LogicalView ;
+  rml:viewOn :mixedJSONSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+    ] ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "items" ;
+    rml:reference "$.items" ;
+    rml:field [
+      a rml:IterableField ;
+      rml:referenceFormulation rml:CSV ;
+      rml:fieldName "item";
+      rml:field [
+        a rml:ExpressionField ;
+        rml:fieldName "type" ;
+        rml:reference "type" ;
+      ] ;
+      rml:field [
+        a rml:expressionField ;
+        rml:fieldName "weight" ;
+        rml:reference "weight" ;
+      ] ;
+    ] ;
+  ].
+
+:triplesMapItem a rml:TriplesMap ;
+  rml:logicalSource :mixedJSONView ;
+  rml:subjectMap [
+    rml:template "http://example.org/item_{#}_{items.item.#}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasType ;
+    rml:objectMap [
+      rml:reference "items.item.type" ;
+    ] ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasWeight ;
+    rml:objectMap [
+      rml:reference "items.item.weight" ;
+      rml:datatype xsd:integer ;
+    ] ;
+  ] .
+
+

Output

+
<http://example.org/item_0_0> <http://example.org/hasType> "sword" .
+<http://example.org/item_0_0> <http://example.org/hasWeight> "1500"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.org/item_0_1> <http://example.org/hasType> "shield" .
+<http://example.org/item_0_1> <http://example.org/hasWeight> "2500"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.org/item_1_0> <http://example.org/hasType> "flower" .
+<http://example.org/item_1_0> <http://example.org/hasWeight> "15"^^<http://www.w3.org/2001/XMLSchema#integer> .
+
+
+

33. RMLLVTC0008a

+

Title: Cycle: Abstract Logical Source

+

Description: Test a cycle in the abstract logical source of a logical view

+

Error expected? Yes

+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix : <http://example.org/> .
+
+:view1 a rml:LogicalView ;
+  rml:viewOn :view2 ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name1" ;
+    rml:reference "name2" ;
+  ] .
+
+:view2 a rml:LogicalView ;
+  rml:viewOn :view1 ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name2" ;
+    rml:reference "name1" ;
+  ] .
+
+:triplesMapPerson a rml:TriplesMap ;
+  rml:logicalSource :view2 ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{name2}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasName ;
+    rml:objectMap [
+      rml:reference "name2" ;
+    ] ;
+  ] .
+
+
+

34. RMLLVTC0008b

+

Title: Cycle: Joins

+

Description: Test a cycle in two joins of two logical views

+

Error expected? Yes

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "items": [
+        "sword",
+        "shield"
+      ]
+    },
+    {
+      "name": "bob",
+      "items": [
+        "flower"
+      ]
+    }
+  ]
+}
+
+

Input 1

+
name,birthyear
+alice,1995
+bob,1999
+tobias,2005
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+  rml:viewOn :jsonSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+  ] ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "item" ;
+    rml:reference "$.items[*]" ;
+  ] ;
+  rml:leftJoin [
+    rml:parentLogicalView :csvView ;
+    rml:joinCondition [
+      rml:parent "name" ;
+      rml:child "name" ;
+    ] ;
+    rml:field [
+      a rml:ExpressionField ;
+      rml:fieldName "csv_birthyear" ;
+      rml:reference "birthyear" ;
+    ] ;
+  ] .
+
+:csvSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.csv" ;
+  ] ;
+  rml:referenceFormulation rml:CSV .
+
+:csvView a rml:LogicalView ;
+  rml:viewOn :csvSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "name" ;
+  ] ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "birthyear" ;
+    rml:reference "birthyear" ;
+  ] ;
+  rml:leftJoin [
+    rml:parentLogicalView :jsonView ;
+    rml:joinCondition [
+      rml:parent "name" ;
+      rml:child "name" ;
+    ] ;
+    rml:field [
+      a rml:ExpressionField ;
+      rml:fieldName "json_item" ;
+      rml:reference "item" ;
+    ] ;
+  ] .
+
+
+:triplesMapPerson a rml:TriplesMap ;
+  rml:logicalSource :csvView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{name}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasBirthYear ;
+    rml:objectMap [
+      rml:reference "birthyear" ;
+      rml:datatype xsd:gYear ;
+    ] ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasItem ;
+    rml:objectMap [
+      rml:template "http://example.org/person/{name}/item/{json_item}" ;
+    ] ;
+  ] .
+
+
+

35. RMLLVTC0008c

+

Title: Cycle: Self-Join

+

Description: Test a cycle in a join of a logical view: self-join

+

Error expected? Yes

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "items": [
+        {
+          "type": "sword",
+          "weight": 1500
+        },
+        {
+          "type": "shield",
+          "weight": 2500
+        }
+      ]
+    },
+    {
+      "name": "bob",
+      "items": [
+        {
+          "type": "flower",
+          "weight": 15
+        }
+      ]
+    }
+  ]
+}
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+  rml:viewOn :jsonSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+  ] ;
+  rml:leftJoin [
+    rml:parentLogicalView :jsonView ;
+    rml:joinCondition [
+      rml:parent "name" ;
+      rml:child "name" ;
+    ] ;
+    rml:field [
+      a rml:ExpressionField ;
+      rml:fieldName "newName" ;
+      rml:reference "name" ;
+    ] ;
+  ] .
+
+:triplesMapPerson a rml:TriplesMap ;
+  rml:logicalSource :jsonView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{newName}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasName ;
+    rml:objectMap [
+      rml:reference "newName" ;
+    ] ;
+  ] .
+
+
+ + + + + + \ No newline at end of file diff --git a/src/test/resources/rml-lv/docs/20251029/index.html b/src/test/resources/rml-lv/docs/20251029/index.html new file mode 100644 index 00000000..9cc552ae --- /dev/null +++ b/src/test/resources/rml-lv/docs/20251029/index.html @@ -0,0 +1,3850 @@ + + + + + + +RML-LV: Test Cases + + + + + + + + + + + + + + + +
+ +

RML-LV: Test Cases

+

+ Draft Community Group Report + +

+
+ +
Latest published version:
+ https://www.w3.org/RML-LV-Testcases/ +
+
Latest editor's draft:
https://w3id.org/rml/lv/test-cases/
+ + + + +
Editors:
+ (Skemu) +
+ (Ghent University – imec – IDLab) +
+ +
Authors:
+ (Skemu) +
+ (Ghent University – imec – IDLab) +
+
Feedback:
+ GitHub kg-construct/rml-lv + (pull requests, + new issue, + open issues) +
+ +
+ + +
+
+ + + +

Abstract

This document defines the RML-LV test cases to the determine the RML-LV specification conformance of tools.

+
+ +

Status of This Document

+ This specification was published by the + Knowledge Graph Construction Community Group. It is not a W3C Standard nor is it + on the W3C Standards Track. + + Please note that under the + W3C Community Contributor License Agreement (CLA) + there is a limited opt-out and other conditions apply. + + Learn more about + W3C Community and Business Groups. +

+ GitHub Issues are preferred for + discussion of this specification. + + +

+ +

1. Introduction

+

This document defines the RML-LV test cases, consisting of a collection of test case documents (input and expected output). +The purpose of the test cases is to determine the conformance of tools that execute RML rules to the RML-LV specification.

+
+ +

2. Data model

+

The test cases are semantically described for re-usability and shareability following the W3C Test case description. +Each test:Testcase as the following properties:

+
    +
  • dcterms:identifier: unique ID of the test case.
  • +
  • rmltest:hasError: if an error of the RML Processor is expected or not.
  • +
  • rmltest:input: One or more input data of the test case.
  • +
  • rmltest:output: One or more output data of the test case.
  • +
  • rmltest:inputFormat: the input data format.
  • +
  • rmltest:outputFormat: the output data format.
  • +
  • rmltest:mappingDocument: the RML mapping rules in Turtle.
  • +
+
+ +

3. Test cases

+

This section describes the RML-LV test cases. These descriptions are also available as RDF. +The files are available on GitHub in the folder test-cases. +Each test case is contained in a single folder, containing three types of files:

+
    +
  • Zero or more files containing the data sources, in the case of JSON, XML, CSV, or containing the SQL statements to create the necessary tables, in the case of MySQL, PostgreSQL, and SQL Server.
  • +
  • One file with the RML rules, called mapping.ttl, in the Turtle format.
  • +
  • Zero or more files with the expected RDF. No file is provided if an error is expected that must halt the generation of the RDF because of an error.
  • +
+
+ + +

4. RMLLVTC0000a

+

Title: Logical view on JSON source

+

Description: Test a view on a hierarchical source

+

Error expected? No

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "items": [
+        {
+          "type": "sword",
+          "weight": 1500
+        },
+        {
+          "type": "shield",
+          "weight": 2500
+        }
+      ]
+    },
+    {
+      "name": "bob",
+      "items": [
+        {
+          "type": "flower",
+          "weight": 15
+        }
+      ]
+    }
+  ]
+}
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+  rml:viewOn :jsonSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+  ] .
+
+:triplesMapPerson a rml:TriplesMap ;
+  rml:logicalSource :jsonView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{name}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasName ;
+    rml:objectMap [
+      rml:reference "name" ;
+    ] ;
+  ] .
+
+

Output

+
<http://example.org/person/alice> <http://example.org/hasName> "alice" .
+<http://example.org/person/bob> <http://example.org/hasName> "bob" .
+
+
+

5. RMLLVTC0000b

+

Title: Logical view on CSV source

+

Description: Test a view on a tabular source

+

Error expected? No

+

Input

+
name,birthyear
+alice,1995
+bob,1999
+tobias,2005
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix : <http://example.org/> .
+
+:csvSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.csv" ;
+  ] ;
+  rml:referenceFormulation rml:CSV .
+
+:csvView a rml:LogicalView ;
+  rml:viewOn :csvSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "name" ;
+  ] .
+
+:triplesMapPerson a rml:TriplesMap ;
+  rml:logicalSource :csvView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{name}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasName ;
+    rml:objectMap [
+      rml:reference "name" ;
+    ] ;
+  ] .
+
+

Output

+
<http://example.org/person/alice> <http://example.org/hasName> "alice" .
+<http://example.org/person/bob> <http://example.org/hasName> "bob" .
+<http://example.org/person/tobias> <http://example.org/hasName> "tobias" .
+
+
+

6. RMLLVTC0000c

+

Title: Logical View on Logical View

+

Description: Test a view on a logical view

+

Error expected? No

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "items": [
+        {
+          "type": "sword",
+          "weight": 1500
+        },
+        {
+          "type": "shield",
+          "weight": 2500
+        }
+      ]
+    },
+    {
+      "name": "bob",
+      "items": [
+        {
+          "type": "flower",
+          "weight": 15
+        }
+      ]
+    }
+  ]
+}
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+  rml:viewOn :jsonSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+  ] .
+
+:jsonViewOnJsonView a rml:LogicalView ;
+  rml:viewOn :jsonView ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "newName" ;
+    rml:reference "name" ;
+  ] .
+
+:triplesMapPerson a rml:TriplesMap ;
+  rml:logicalSource :jsonViewOnJsonView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{newName}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasName ;
+    rml:objectMap [
+      rml:reference "newName" ;
+    ] ;
+  ] .
+
+

Output

+
<http://example.org/person/alice> <http://example.org/hasName> "alice" .
+<http://example.org/person/bob> <http://example.org/hasName> "bob" .
+
+
+

7. RMLLVTC0001a

+

Title: Expression Field: Reference

+

Description: Test a reference in an expression field

+

Error expected? No

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "items": [
+        {
+          "type": "sword",
+          "weight": 1500
+        },
+        {
+          "type": "shield",
+          "weight": 2500
+        }
+      ]
+    },
+    {
+      "name": "bob",
+      "items": [
+        {
+          "type": "flower",
+          "weight": 15
+        }
+      ]
+    }
+  ]
+}
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+  rml:viewOn :jsonSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+  ] .
+
+:triplesMapPerson a rml:TriplesMap ;
+  rml:logicalSource :jsonView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{name}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasName ;
+    rml:objectMap [
+      rml:reference "name" ;
+    ] ;
+  ] .
+
+

Output

+
<http://example.org/person/alice> <http://example.org/hasName> "alice" .
+<http://example.org/person/bob> <http://example.org/hasName> "bob" .
+
+
+

8. RMLLVTC0001b

+

Title: Expression Field: Template

+

Description: Test a template in an expression field

+

Error expected? No

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "items": [
+        {
+          "type": "sword",
+          "weight": 1500
+        },
+        {
+          "type": "shield",
+          "weight": 2500
+        }
+      ]
+    },
+    {
+      "name": "bob",
+      "items": [
+        {
+          "type": "flower",
+          "weight": 15
+        }
+      ]
+    }
+  ]
+}
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+  rml:viewOn :jsonSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+  ] ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "race" ;
+    rml:constant "human" ;
+  ] .
+
+:triplesMapPerson a rml:TriplesMap ;
+  rml:logicalSource :jsonView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{name}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasRace ;
+    rml:objectMap [
+      rml:reference "race" ;
+    ] ;
+  ] .
+
+

Output

+
<http://example.org/person/alice> <http://example.org/hasRace> "human" .
+<http://example.org/person/bob> <http://example.org/hasRace> "human" .
+
+
+

9. RMLLVTC0001c

+

Title: Expression Field: Constant

+

Description: Test a constant expression in an expression field

+

Error expected? No

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "lastName": "smith",
+      "items": [
+        {
+          "type": "sword",
+          "weight": 1500
+        },
+        {
+          "type": "shield",
+          "weight": 2500
+        }
+      ]
+    },
+    {
+      "name": "bob",
+      "lastName": "jones",
+      "items": [
+        {
+          "type": "flower",
+          "weight": 15
+        }
+      ]
+    }
+  ]
+}
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+  rml:viewOn :jsonSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+  ] ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "fullName" ;
+    rml:template "{name} {lastName}" ;
+  ] .
+
+:triplesMapPerson a rml:TriplesMap ;
+  rml:logicalSource :jsonView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{name}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasFullName ;
+    rml:objectMap [
+      rml:reference "fullName" ;
+    ] ;
+  ] .
+
+

Output

+
<http://example.org/person/alice> <http://example.org/hasFullName> "alice smith" .
+<http://example.org/person/bob> <http://example.org/hasFullName> "bob jones" .
+
+
+

10. RMLLVTC0001d

+

Title: Expression Field Siblings

+

Description: Test multiple expression fields with the same parent

+

Error expected? No

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "lastName": "smith",
+      "items": [
+        {
+          "type": "sword",
+          "weight": 1500
+        },
+        {
+          "type": "shield",
+          "weight": 2500
+        }
+      ]
+    },
+    {
+      "name": "bob",
+      "lastName": "jones",
+      "items": [
+        {
+          "type": "flower",
+          "weight": 15
+        }
+      ]
+    }
+  ]
+}
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+  rml:viewOn :jsonSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+  ] ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "lastName" ;
+    rml:reference "$.lastName" ;
+  ] .
+
+:triplesMapPerson a rml:TriplesMap ;
+  rml:logicalSource :jsonView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{name}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasFullName ;
+    rml:objectMap [
+      rml:template "{name} {lastName}" ;
+      rml:termType rml:Literal ;
+    ] ;
+  ] .
+
+

Output

+
<http://example.org/person/alice> <http://example.org/hasFullName> "alice smith" .
+<http://example.org/person/bob> <http://example.org/hasFullName> "bob jones" .
+
+
+

11. RMLLVTC0002a

+

Title: Iterable Field

+

Description: Test a nested field construction: iterable field with expression field as child

+

Error expected? No

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "items": [
+        {
+          "type": "sword",
+          "weight": 1500
+        },
+        {
+          "type": "shield",
+          "weight": 2500
+        }
+      ]
+    },
+    {
+      "name": "bob",
+      "items": [
+        {
+          "type": "flower",
+          "weight": 15
+        }
+      ]
+    }
+  ]
+}
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+  rml:viewOn :jsonSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+  ] ;
+  rml:field [
+    a rml:IterableField ;
+    rml:fieldName "item" ;
+    rml:iterator "$.items[*]" ;
+    rml:field [
+      a rml:ExpressionField ;
+      rml:fieldName "type" ;
+      rml:reference "$.type" ;
+    ] ;
+  ] .
+
+:triplesMapPerson a rml:TriplesMap ;
+  rml:logicalSource :jsonView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{name}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasItem ;
+    rml:objectMap [
+      rml:template "http://example.org/person/{name}/item/{item.type}" ;
+    ] ;
+  ] .
+
+

Output

+
<http://example.org/person/alice> <http://example.org/hasItem> <http://example.org/person/alice/item/sword> .
+<http://example.org/person/alice> <http://example.org/hasItem> <http://example.org/person/alice/item/shield> .
+<http://example.org/person/bob> <http://example.org/hasItem> <http://example.org/person/bob/item/flower> .
+
+
+

12. RMLLVTC0002b

+

Title: Iterable Field with Multiple Children

+

Description: Test a nested field construction: iterable field with mulitple expression fields as children

+

Error expected? No

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "items": [
+        {
+          "type": "sword",
+          "weight": 1500
+        },
+        {
+          "type": "shield",
+          "weight": 2500
+        }
+      ]
+    },
+    {
+      "name": "bob",
+      "items": [
+        {
+          "type": "flower",
+          "weight": 15
+        }
+      ]
+    }
+  ]
+}
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+  rml:viewOn :jsonSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+  ] ;
+  rml:field [
+    a rml:IterableField ;
+    rml:fieldName "item" ;
+    rml:iterator "$.items[*]" ;
+    rml:field [
+      a rml:ExpressionField ;
+      rml:fieldName "type" ;
+      rml:reference "$.type" ;
+    ] ;
+    rml:field [
+      a rml:ExpressionField ;
+      rml:fieldName "weight" ;
+      rml:reference "$.weight" ;
+    ] ;
+  ] .
+
+:triplesMapItem a rml:TriplesMap ;
+  rml:logicalSource :jsonView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{name}/item/{item.type}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasName ;
+    rml:objectMap [
+      rml:reference "item.type" ;
+    ] ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasWeight ;
+    rml:objectMap [
+      rml:reference "item.weight" ;
+      rml:datatype xsd:integer ;
+    ] ;
+  ] .
+
+

Output

+
<http://example.org/person/alice/item/sword> <http://example.org/hasName> "sword" .
+<http://example.org/person/alice/item/sword> <http://example.org/hasWeight> "1500"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.org/person/alice/item/shield> <http://example.org/hasName> "shield" .
+<http://example.org/person/alice/item/shield> <http://example.org/hasWeight> "2500"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.org/person/bob/item/flower> <http://example.org/hasName> "flower" .
+<http://example.org/person/bob/item/flower> <http://example.org/hasWeight> "15"^^<http://www.w3.org/2001/XMLSchema#integer> .
+
+
+

13. RMLLVTC0002c

+

Title: Nested Iterable Fields

+

Description: Test a nested field construction: iterable field with an iterable field as child

+

Error expected? No

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "items": [
+        {
+          "type": "sword",
+          "measures": {
+            "weight": 1500,
+            "length": 30
+          }
+        },
+        {
+          "type": "shield",
+          "measures": {
+            "weight": 2500
+          }
+        }
+      ]
+    },
+    {
+      "name": "bob",
+      "items": [
+        {
+          "type": "flower",
+          "measures" : {
+            "weight": 15,
+            "length" : 15
+          }
+        }
+      ]
+    }
+  ]
+}
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+  rml:viewOn :jsonSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+  ] ;
+  rml:field [
+    a rml:IterableField ;
+    rml:fieldName "item" ;
+    rml:iterator "$.items[*]" ;
+    rml:field [
+      rml:fieldName "type" ;
+      rml:reference "$.type" ;
+    ] ;
+    rml:field [
+      a rml:IterableField ;
+      rml:fieldName "measures";
+      rml:iterator "$.measures";
+      rml:field [
+        a rml:ExpressionField ;
+        rml:fieldName "weight" ;
+        rml:reference "$.weight" ;
+        ];
+    ] ;
+  ] .
+
+:triplesMapItem a rml:TriplesMap ;
+  rml:logicalSource :jsonView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{name}/item/{item.type}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasWeight ;
+    rml:objectMap [
+      rml:reference "item.measures.weight" ;
+      rml:datatype xsd:integer ;
+    ] ;
+  ] .
+
+

Output

+
<http://example.org/person/alice/item/sword> <http://example.org/hasWeight> "1500"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.org/person/alice/item/shield> <http://example.org/hasWeight> "2500"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.org/person/bob/item/flower> <http://example.org/hasWeight> "15"^^<http://www.w3.org/2001/XMLSchema#integer> .
+
+
+

14. RMLLVTC0003a

+

Title: Index Key: #

+

Description: Test a reference to the index key #

+

Error expected? No

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "items": [
+        {
+          "type": "sword",
+          "weight": 1500
+        },
+        {
+          "type": "shield",
+          "weight": 2500
+        }
+      ]
+    },
+    {
+      "name": "bob",
+      "items": [
+        {
+          "type": "flower",
+          "weight": 15
+        }
+      ]
+    }
+  ]
+}
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+  rml:viewOn :jsonSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+  ] .
+
+:triplesMapPerson a rml:TriplesMap ;
+  rml:logicalSource :jsonView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{name}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasSequenceNumber ;
+    rml:objectMap [
+      rml:reference "#" ;
+      rml:datatype xsd:integer ;
+    ] ;
+  ] .
+
+

Output

+
<http://example.org/person/alice> <http://example.org/hasSequenceNumber> "0"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.org/person/bob> <http://example.org/hasSequenceNumber> "1"^^<http://www.w3.org/2001/XMLSchema#integer> .
+
+
+

15. RMLLVTC0003b

+

Title: Index Key: Iterable Field

+

Description: Test a reference to the index key of an iterable field

+

Error expected? No

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "items": [
+        {
+          "type": "sword",
+          "weight": 1500
+        },
+        {
+          "type": "shield",
+          "weight": 2500
+        }
+      ]
+    },
+    {
+      "name": "bob",
+      "items": [
+        {
+          "type": "flower",
+          "weight": 15
+        }
+      ]
+    }
+  ]
+}
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+  rml:viewOn :jsonSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+  ] ;
+  rml:field [
+    a rml:IterableField ;
+    rml:fieldName "item" ;
+    rml:iterator "$.items[*]" ;
+    rml:field [
+      a rml:ExpressionField ;
+      rml:fieldName "type" ;
+      rml:reference "$.type" ;
+    ] ;
+  ] .
+
+:triplesMapPerson a rml:TriplesMap ;
+  rml:logicalSource :jsonView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{name}/item/{item.#}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasType ;
+    rml:objectMap [
+      rml:reference "item.type" ;
+    ] ;
+  ] .
+
+

Output

+
<http://example.org/person/alice/item/0> <http://example.org/hasType> "sword" .
+<http://example.org/person/alice/item/1> <http://example.org/hasType> "shield" .
+<http://example.org/person/bob/item/0> <http://example.org/hasType> "flower" .
+
+
+
+

16. RMLLVTC0003c

+

Title: Index Key: Expression field

+

Description: Test a reference to the index key of an expression field

+

Error expected? No

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "items": [
+        "sword",
+        "shield"
+      ]
+    },
+    {
+      "name": "bob",
+      "items": [
+        "flower"
+      ]
+    }
+  ]
+}
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+  rml:viewOn :jsonSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+  ] ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "item" ;
+    rml:reference "$.items[*]" ;
+  ] .
+
+:triplesMapItem a rml:TriplesMap ;
+  rml:logicalSource :jsonView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{name}/item/{item.#}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasType ;
+    rml:objectMap [
+      rml:reference "item" ;
+    ] ;
+  ] .
+
+

Output

+
<http://example.org/person/alice/item/0> <http://example.org/hasType> "sword" .
+<http://example.org/person/alice/item/1> <http://example.org/hasType> "shield" .
+<http://example.org/person/bob/item/0> <http://example.org/hasType> "flower" .
+
+
+

17. RMLLVTC0004a

+

Title: Natural Datatype: Index #

+

Description: Test the natural datatype mapping for the index #

+

Error expected? No

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "items": [
+        {
+          "type": "sword",
+          "weight": 1500
+        },
+        {
+          "type": "shield",
+          "weight": 2500
+        }
+      ]
+    },
+    {
+      "name": "bob",
+      "items": [
+        {
+          "type": "flower",
+          "weight": 15
+        }
+      ]
+    }
+  ]
+}
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+  rml:viewOn :jsonSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+  ] .
+
+:triplesMapPerson a rml:TriplesMap ;
+  rml:logicalSource :jsonView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{name}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasSequenceNumber ;
+    rml:objectMap [
+      rml:reference "#" ;
+    ] ;
+  ] .
+
+

Output

+
<http://example.org/person/alice> <http://example.org/hasSequenceNumber> "0"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.org/person/bob> <http://example.org/hasSequenceNumber> "1"^^<http://www.w3.org/2001/XMLSchema#integer> .
+
+
+

18. RMLLVTC0004b

+

Title: Natural Datatype: Index Expression Field

+

Description: Test the natural datatype mapping for the index of an expression field

+

Error expected? No

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "items": [
+        {
+          "type": "sword",
+          "weight": 1500
+        },
+        {
+          "type": "shield",
+          "weight": 2500
+        }
+      ]
+    },
+    {
+      "name": "bob",
+      "items": [
+        {
+          "type": "flower",
+          "weight": 15
+        }
+      ]
+    }
+  ]
+}
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+  rml:viewOn :jsonSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+  ] ;
+  rml:field [
+    a rml:IterableField ;
+    rml:fieldName "item" ;
+    rml:iterator "$.items[*]" ;
+    rml:field [
+      a rml:ExpressionField ;
+      rml:fieldName "type" ;
+      rml:reference "$.type" ;
+    ] ;
+  ] .
+
+:triplesMapPerson a rml:TriplesMap ;
+  rml:logicalSource :jsonView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{name}/item/{item.type}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasSequenceNumber ;
+    rml:objectMap [
+      rml:reference "item.#" ;
+    ] ;
+  ] .
+
+

Output

+
<http://example.org/person/alice/item/sword> <http://example.org/hasSequenceNumber> "0"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.org/person/alice/item/shield> <http://example.org/hasSequenceNumber> "1"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.org/person/bob/item/flower> <http://example.org/hasSequenceNumber> "0"^^<http://www.w3.org/2001/XMLSchema#integer> .
+
+
+

19. RMLLVTC0004c

+

Title: Natural Datatype: Index Iterable Field

+

Description: Test the natural datatype mapping for the index of an iterable field

+

Error expected? No

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "items": [
+        "sword",
+        "shield"
+      ]
+    },
+    {
+      "name": "bob",
+      "items": [
+        "flower"
+      ]
+    }
+  ]
+}
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+  rml:viewOn :jsonSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+  ] ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "item" ;
+    rml:reference "$.items[*]" ;
+  ] .
+
+:triplesMapItem a rml:TriplesMap ;
+  rml:logicalSource :jsonView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{name}/item/{item}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasSequenceNumber ;
+    rml:objectMap [
+      rml:reference "item.#" ;
+    ] ;
+  ] .
+
+

Output

+
<http://example.org/person/alice/item/sword> <http://example.org/hasSequenceNumber> "0"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.org/person/alice/item/shield> <http://example.org/hasSequenceNumber> "1"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.org/person/bob/item/flower> <http://example.org/hasSequenceNumber> "0"^^<http://www.w3.org/2001/XMLSchema#integer> .
+
+
+

20. RMLLVTC0004d

+

Title: Natural Datatype: Record Expression Field

+

Description: Test the natural datatype mapping for a record of an expression field

+

Error expected? No

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "birth_year": 1995
+    },
+    {
+      "name": "bob",
+      "birth_year": 1999
+    }
+  ]
+}
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+  rml:viewOn :jsonSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+  ] ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "birthyear" ;
+    rml:reference "$.birth_year" ;
+  ] .
+
+:triplesMapItem a rml:TriplesMap ;
+  rml:logicalSource :jsonView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{name}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasBirthYear ;
+    rml:objectMap [
+      rml:reference "birthyear" ;
+    ] ;
+  ] .
+
+

Output

+
<http://example.org/person/alice> <http://example.org/hasBirthYear> "1995"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.org/person/bob> <http://example.org/hasBirthYear> "1999"^^<http://www.w3.org/2001/XMLSchema#integer> .
+
+
+

21. RMLLVTC0005a

+

Title: Referencing a Non-Existing Key

+

Description: Test a reference to a non-existing key

+

Error expected? Yes

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "items": [
+        {
+          "type": "sword",
+          "weight": 1500
+        },
+        {
+          "type": "shield",
+          "weight": 2500
+        }
+      ]
+    },
+    {
+      "name": "bob",
+      "items": [
+        {
+          "type": "flower",
+          "weight": 15
+        }
+      ]
+    }
+  ]
+}
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+  rml:viewOn :jsonSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+  ] .
+
+:triplesMapPerson a rml:TriplesMap ;
+  rml:logicalSource :jsonView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{Name}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasName ;
+    rml:objectMap [
+      rml:reference "Name" ;
+    ] ;
+  ] .
+
+
+

22. RMLLVTC0005b

+

Title: Referencing the Record Key

+

Description: Test a reference to the record key

+

Error expected? Yes

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "items": [
+        {
+          "type": "sword",
+          "weight": 1500
+        },
+        {
+          "type": "shield",
+          "weight": 2500
+        }
+      ]
+    },
+    {
+      "name": "bob",
+      "items": [
+        {
+          "type": "flower",
+          "weight": 15
+        }
+      ]
+    }
+  ]
+}
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+  rml:viewOn :jsonSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+  ] .
+
+:triplesMapPerson a rml:TriplesMap ;
+  rml:logicalSource :jsonView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{name}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :isDerivedFrom ;
+    rml:objectMap [
+      rml:reference "<it>" ;
+    ] ;
+  ] .
+
+
+

23. RMLLVTC0005c

+

Title: Referencing the Record Key of an Iterable Field

+

Description: Test a reference to the record key of an iterable field

+

Error expected? Yes

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "items": [
+        {
+          "type": "sword",
+          "weight": 1500
+        },
+        {
+          "type": "shield",
+          "weight": 2500
+        }
+      ]
+    },
+    {
+      "name": "bob",
+      "items": [
+        {
+          "type": "flower",
+          "weight": 15
+        }
+      ]
+    }
+  ]
+}
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+  rml:viewOn :jsonSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+  ] ;
+  rml:field [
+    a rml:IterableField ;
+    rml:fieldName "item" ;
+    rml:iterator "$.items[*]" ;
+    rml:field [
+      a rml:ExpressionField ;
+      rml:fieldName "type" ;
+      rml:reference "$.type" ;
+    ] ;
+  ] .
+
+:triplesMapPerson a rml:TriplesMap ;
+  rml:logicalSource :jsonView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{name}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasItem ;
+    rml:objectMap [
+      rml:template "http://example.org/person/{name}/{item}" ;
+    ] ;
+  ] .
+
+
+

24. RMLLVTC0006a

+

Title: Left Join

+

Description: Test a left join

+

Error expected? No

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "items": [
+        "sword",
+        "shield"
+      ]
+    },
+    {
+      "name": "bob",
+      "items": [
+        "flower"
+      ]
+    }
+  ]
+}
+
+

Input 1

+
name,birthyear
+alice,1995
+bob,1999
+tobias,2005
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+  rml:viewOn :jsonSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+  ] ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "item" ;
+    rml:reference "$.items[*]" ;
+  ] .
+
+:csvSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.csv" ;
+  ] ;
+  rml:referenceFormulation rml:CSV .
+
+:csvView a rml:LogicalView ;
+  rml:viewOn :csvSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "name" ;
+  ] ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "birthyear" ;
+    rml:reference "birthyear" ;
+  ] ;
+  rml:leftJoin [
+    rml:parentLogicalView :jsonView ;
+    rml:joinCondition [
+      rml:parent "name" ;
+      rml:child "name" ;
+    ] ;
+    rml:field [
+      a rml:ExpressionField ;
+      rml:fieldName "json_item" ;
+      rml:reference "item" ;
+    ] ;
+  ] .
+
+
+:triplesMapPerson a rml:TriplesMap ;
+  rml:logicalSource :csvView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{name}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasBirthYear ;
+    rml:objectMap [
+      rml:reference "birthyear" ;
+      rml:datatype xsd:gYear ;
+    ] ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasItem ;
+    rml:objectMap [
+      rml:template "http://example.org/person/{name}/item/{json_item}" ;
+    ] ;
+  ] .
+
+

Output

+
<http://example.org/person/alice> <http://example.org/hasBirthYear> "1995"^^<http://www.w3.org/2001/XMLSchema#gYear> .
+<http://example.org/person/alice> <http://example.org/hasItem> <http://example.org/person/alice/item/sword> .
+<http://example.org/person/alice> <http://example.org/hasItem> <http://example.org/person/alice/item/shield> .
+<http://example.org/person/bob> <http://example.org/hasBirthYear> "1999"^^<http://www.w3.org/2001/XMLSchema#gYear> .
+<http://example.org/person/bob> <http://example.org/hasItem> <http://example.org/person/bob/item/flower> .
+<http://example.org/person/tobias> <http://example.org/hasBirthYear> "2005"^^<http://www.w3.org/2001/XMLSchema#gYear> .
+
+
+

25. RMLLVTC0006b

+

Title: Inner Join

+

Description: Test an inner join

+

Error expected? No

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "items": [
+        "sword",
+        "shield"
+      ]
+    },
+    {
+      "name": "bob",
+      "items": [
+        "flower"
+      ]
+    }
+  ]
+}
+
+

Input 1

+
name,birthyear
+alice,1995
+bob,1999
+tobias,2005
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+  rml:viewOn :jsonSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+  ] ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "item" ;
+    rml:reference "$.items[*]" ;
+  ] .
+
+:csvSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.csv" ;
+  ] ;
+  rml:referenceFormulation rml:CSV .
+
+:csvView a rml:LogicalView ;
+  rml:viewOn :csvSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "name" ;
+  ] ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "birthyear" ;
+    rml:reference "birthyear" ;
+  ] ;
+  rml:innerJoin [
+    rml:parentLogicalView :jsonView ;
+    rml:joinCondition [
+      rml:parent "name" ;
+      rml:child "name" ;
+    ] ;
+    rml:field [
+      a rml:ExpressionField ;
+      rml:fieldName "json_item" ;
+      rml:reference "item" ;
+    ] ;
+  ] .
+
+
+:triplesMapPerson a rml:TriplesMap ;
+  rml:logicalSource :csvView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{name}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasBirthYear ;
+    rml:objectMap [
+      rml:reference "birthyear" ;
+      rml:datatype xsd:gYear ;
+    ] ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasItem ;
+    rml:objectMap [
+      rml:template "http://example.org/person/{name}/item/{json_item}" ;
+    ] ;
+  ] .
+
+

Output

+
<http://example.org/person/alice> <http://example.org/hasBirthYear> "1995"^^<http://www.w3.org/2001/XMLSchema#gYear> .
+<http://example.org/person/alice> <http://example.org/hasItem> <http://example.org/person/alice/item/sword> .
+<http://example.org/person/alice> <http://example.org/hasItem> <http://example.org/person/alice/item/shield> .
+<http://example.org/person/bob> <http://example.org/hasBirthYear> "1999"^^<http://www.w3.org/2001/XMLSchema#gYear> .
+<http://example.org/person/bob> <http://example.org/hasItem> <http://example.org/person/bob/item/flower> .
+
+
+

26. RMLLVTC0006c

+

Title: Two Left Joins

+

Description: Test two left joins in one logical view

+

Error expected? No

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "items": [
+        "sword",
+        "shield"
+      ]
+    },
+    {
+      "name": "bob",
+      "items": [
+        "flower"
+      ]
+    }
+  ]
+}
+
+

Input 1

+
name,birthyear
+alice,1995
+bob,1999
+tobias,2005
+
+

Input 2

+
name,id
+alice,123
+bob,456
+tobias,789
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+  rml:viewOn :jsonSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+  ] ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "item" ;
+    rml:reference "$.items[*]" ;
+  ] .
+
+:additionalCsvSource a rml:LogicalSource ;
+  rml:source [
+   a rml:RelativePathSource , rml:Source ;
+   rml:root rml:MappingDirectory ;
+   rml:path "people2.csv" ;
+  ] ;
+  rml:referenceFormulation rml:CSV .
+
+:additionalCsvView a rml:LogicalView ;
+  rml:viewOn :additionalCsvSource ;
+    rml:field [
+     a rml:ExpressionField ;
+     rml:fieldName "name" ;
+     rml:reference "name" ;
+    ] ;
+    rml:field [
+     a rml:ExpressionField ;
+     rml:fieldName "id" ;
+     rml:reference "id" ;
+    ] ;
+.
+
+:csvSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.csv" ;
+  ] ;
+  rml:referenceFormulation rml:CSV .
+
+:csvView a rml:LogicalView ;
+  rml:viewOn :csvSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "name" ;
+  ] ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "birthyear" ;
+    rml:reference "birthyear" ;
+  ] ;
+  rml:leftJoin [
+    rml:parentLogicalView :jsonView ;
+    rml:joinCondition [
+      rml:parent "name" ;
+      rml:child "name" ;
+    ] ;
+    rml:field [
+      a rml:ExpressionField ;
+      rml:fieldName "json_item" ;
+      rml:reference "item" ;
+    ] ;
+  ] ;
+  rml:leftJoin [
+    rml:parentLogicalView :additionalCsvView ;
+    rml:joinCondition [
+      rml:parent "name" ;
+      rml:child "name" ;
+    ] ;
+    rml:field [
+      a rml:ExpressionField ;
+      rml:fieldName "csv2_id" ;
+      rml:reference "id" ;
+    ] ;
+  ] .
+
+
+:triplesMapPerson a rml:TriplesMap ;
+  rml:logicalSource :csvView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{csv2_id}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasBirthYear ;
+    rml:objectMap [
+      rml:reference "birthyear" ;
+      rml:datatype xsd:gYear ;
+    ] ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasItem ;
+    rml:objectMap [
+      rml:template "http://example.org/person/{csv2_id}/item/{json_item}" ;
+    ] ;
+  ] .
+
+

Output

+
<http://example.org/person/123> <http://example.org/hasBirthYear> "1995"^^<http://www.w3.org/2001/XMLSchema#gYear> .
+<http://example.org/person/123> <http://example.org/hasItem> <http://example.org/person/123/item/sword> .
+<http://example.org/person/123> <http://example.org/hasItem> <http://example.org/person/123/item/shield> .
+<http://example.org/person/456> <http://example.org/hasBirthYear> "1999"^^<http://www.w3.org/2001/XMLSchema#gYear> .
+<http://example.org/person/456> <http://example.org/hasItem> <http://example.org/person/456/item/flower> .
+<http://example.org/person/789> <http://example.org/hasBirthYear> "2005"^^<http://www.w3.org/2001/XMLSchema#gYear> .
+
+
+

27. RMLLVTC0006d

+

Title: Inner Join and Left Join

+

Description: Test an inner join and a left join in one logical view

+

Error expected? No

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "items": [
+        "sword",
+        "shield"
+      ]
+    },
+    {
+      "name": "bob",
+      "items": [
+        "flower"
+      ]
+    }
+  ]
+}
+
+

Input 1

+
name,birthyear
+alice,1995
+bob,1999
+tobias,2005
+
+

Input 2

+
name,id
+alice,123
+bob,456
+tobias,789
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+  rml:viewOn :jsonSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+  ] ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "item" ;
+    rml:reference "$.items[*]" ;
+  ] .
+
+:additionalCsvSource a rml:LogicalSource ;
+  rml:source [
+   a rml:RelativePathSource , rml:Source ;
+   rml:root rml:MappingDirectory ;
+   rml:path "people2.csv" ;
+  ] ;
+  rml:referenceFormulation rml:CSV .
+
+:additionalCsvView a rml:LogicalView ;
+  rml:viewOn :additionalCsvSource ;
+    rml:field [
+     a rml:ExpressionField ;
+     rml:fieldName "name" ;
+     rml:reference "name" ;
+    ] ;
+    rml:field [
+     a rml:ExpressionField ;
+     rml:fieldName "id" ;
+     rml:reference "id" ;
+    ] ;
+.
+
+:csvSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.csv" ;
+  ] ;
+  rml:referenceFormulation rml:CSV .
+
+:csvView a rml:LogicalView ;
+  rml:viewOn :csvSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "name" ;
+  ] ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "birthyear" ;
+    rml:reference "birthyear" ;
+  ] ;
+  rml:innerJoin [
+    rml:parentLogicalView :jsonView ;
+    rml:joinCondition [
+      rml:parent "name" ;
+      rml:child "name" ;
+    ] ;
+    rml:field [
+      a rml:ExpressionField ;
+      rml:fieldName "json_item" ;
+      rml:reference "item" ;
+    ] ;
+  ] ;
+  rml:leftJoin [
+    rml:parentLogicalView :additionalCsvView ;
+    rml:joinCondition [
+      rml:parent "name" ;
+      rml:child "name" ;
+    ] ;
+    rml:field [
+      a rml:ExpressionField ;
+      rml:fieldName "csv2_id" ;
+      rml:reference "id" ;
+    ] ;
+  ] .
+
+
+:triplesMapPerson a rml:TriplesMap ;
+  rml:logicalSource :csvView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{csv2_id}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasBirthYear ;
+    rml:objectMap [
+      rml:reference "birthyear" ;
+      rml:datatype xsd:gYear ;
+    ] ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasItem ;
+    rml:objectMap [
+      rml:template "http://example.org/person/{csv2_id}/item/{json_item}" ;
+    ] ;
+  ] .
+
+

Output

+
<http://example.org/person/123> <http://example.org/hasBirthYear> "1995"^^<http://www.w3.org/2001/XMLSchema#gYear> .
+<http://example.org/person/123> <http://example.org/hasItem> <http://example.org/person/123/item/sword> .
+<http://example.org/person/123> <http://example.org/hasItem> <http://example.org/person/123/item/shield> .
+<http://example.org/person/456> <http://example.org/hasBirthYear> "1999"^^<http://www.w3.org/2001/XMLSchema#gYear> .
+<http://example.org/person/456> <http://example.org/hasItem> <http://example.org/person/456/item/flower> .
+
+
+

28. RMLLVTC0006e

+

Title: Two Inner Joins

+

Description: Test two left joins in one logical view

+

Error expected? No

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "items": [
+        "sword",
+        "shield"
+      ]
+    },
+    {
+      "name": "bob",
+      "items": [
+        "flower"
+      ]
+    }
+  ]
+}
+
+

Input 1

+
name,birthyear
+alice,1995
+bob,1999
+tobias,2005
+
+

Input 2

+
name,id
+alice,123
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+  rml:viewOn :jsonSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+  ] ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "item" ;
+    rml:reference "$.items[*]" ;
+  ] .
+
+:additionalCsvSource a rml:LogicalSource ;
+  rml:source [
+   a rml:RelativePathSource , rml:Source ;
+   rml:root rml:MappingDirectory ;
+   rml:path "people2.csv" ;
+  ] ;
+  rml:referenceFormulation rml:CSV .
+
+:additionalCsvView a rml:LogicalView ;
+  rml:viewOn :additionalCsvSource ;
+    rml:field [
+     a rml:ExpressionField ;
+     rml:fieldName "name" ;
+     rml:reference "name" ;
+    ] ;
+    rml:field [
+     a rml:ExpressionField ;
+     rml:fieldName "id" ;
+     rml:reference "id" ;
+    ] ;
+.
+
+:csvSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.csv" ;
+  ] ;
+  rml:referenceFormulation rml:CSV .
+
+:csvView a rml:LogicalView ;
+  rml:viewOn :csvSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "name" ;
+  ] ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "birthyear" ;
+    rml:reference "birthyear" ;
+  ] ;
+  rml:innerJoin [
+    rml:parentLogicalView :jsonView ;
+    rml:joinCondition [
+      rml:parent "name" ;
+      rml:child "name" ;
+    ] ;
+    rml:field [
+      a rml:ExpressionField ;
+      rml:fieldName "json_item" ;
+      rml:reference "item" ;
+    ] ;
+  ] ;
+  rml:innerJoin [
+    rml:parentLogicalView :additionalCsvView ;
+    rml:joinCondition [
+      rml:parent "name" ;
+      rml:child "name" ;
+    ] ;
+    rml:field [
+      a rml:ExpressionField ;
+      rml:fieldName "csv2_id" ;
+      rml:reference "id" ;
+    ] ;
+  ] .
+
+
+:triplesMapPerson a rml:TriplesMap ;
+  rml:logicalSource :csvView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{csv2_id}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasBirthYear ;
+    rml:objectMap [
+      rml:reference "birthyear" ;
+      rml:datatype xsd:gYear ;
+    ] ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasItem ;
+    rml:objectMap [
+      rml:template "http://example.org/person/{csv2_id}/item/{json_item}" ;
+    ] ;
+  ] .
+
+

Output

+
<http://example.org/person/123> <http://example.org/hasBirthYear> "1995"^^<http://www.w3.org/2001/XMLSchema#gYear> .
+<http://example.org/person/123> <http://example.org/hasItem> <http://example.org/person/123/item/sword> .
+<http://example.org/person/123> <http://example.org/hasItem> <http://example.org/person/123/item/shield> .
+
+
+

29. RMLLVTC0006f

+

Title: Index Key of Field in Join

+

Description: Test references to indexes of fields from a join

+

Error expected? No

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "items": [
+        "sword",
+        "shield"
+      ]
+    },
+    {
+      "name": "bob",
+      "items": [
+        "flower"
+      ]
+    }
+  ]
+}
+
+

Input 1

+
name,birthyear
+alice,1995
+tobias,2005
+bob,1999
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+  rml:viewOn :jsonSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+  ] ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "item" ;
+    rml:reference "$.items[*]" ;
+  ] .
+
+:csvSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.csv" ;
+  ] ;
+  rml:referenceFormulation rml:CSV .
+
+:csvView a rml:LogicalView ;
+  rml:viewOn :csvSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "name" ;
+  ] ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "birthyear" ;
+    rml:reference "birthyear" ;
+  ] ;
+  rml:innerJoin [
+    rml:parentLogicalView :jsonView ;
+    rml:joinCondition [
+      rml:parent "name" ;
+      rml:child "name" ;
+    ] ;
+    rml:field [
+      a rml:ExpressionField ;
+      rml:fieldName "json_item" ;
+      rml:reference "item" ;
+    ] ;
+  ] .
+
+
+:triplesMapPerson a rml:TriplesMap ;
+  rml:logicalSource :csvView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{#}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasBirthYear ;
+    rml:objectMap [
+      rml:reference "birthyear" ;
+      rml:datatype xsd:gYear ;
+    ] ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasItem ;
+    rml:objectMap [
+      rml:template "http://example.org/person/{#}/item/{json_item.#}/{json_item}" ;
+    ] ;
+  ] .
+
+

Output

+
<http://example.org/person/0> <http://example.org/hasBirthYear> "1995"^^<http://www.w3.org/2001/XMLSchema#gYear> .
+<http://example.org/person/0> <http://example.org/hasItem> <http://example.org/person/0/item/0/sword> .
+<http://example.org/person/0> <http://example.org/hasItem> <http://example.org/person/0/item/1/shield> .
+<http://example.org/person/2> <http://example.org/hasBirthYear> "1999"^^<http://www.w3.org/2001/XMLSchema#gYear> .
+<http://example.org/person/2> <http://example.org/hasItem> <http://example.org/person/2/item/0/flower> .
+
+
+
+

30. RMLLVTC0007a

+

Title: Change Reference Formulations: CSV including JSON array

+

Description: Test a change of reference formulations: csv source including json array

+

Error expected? No

+

Input

+
name,items
+alice,"[{""type"":""sword"",""weight"":1500},{""type"":""shield"",""weight"":2500}]"
+bob,"[{""type"":""flower"",""weight"":15}]"
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+
+:mixedCSVSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.csv" ;
+  ] ;
+  rml:referenceFormulation rml:CSV .
+
+:mixedCSVView a rml:LogicalView ;
+  rml:viewOn :mixedCSVSource ;
+  rml:field [
+    a rml:ExpressionField;
+    rml:fieldName "name" ;
+    rml:reference "name" ;
+  ] ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "items" ;
+    rml:reference "items" ;
+    rml:field [
+      a rml:IterableField ;
+      rml:referenceFormulation rml:JSONPath ;
+      rml:iterator "$[*]" ;
+      rml:fieldName "item" ;
+      rml:field [
+        a rml:ExpressionField ;
+        rml:fieldName "type" ;
+        rml:reference "$.type" ;
+      ] ;
+      rml:field [
+        a rml:ExpressionField ;
+        rml:fieldName "weight" ;
+        rml:reference "$.weight" ;
+      ] ;
+    ] ;
+  ] .
+
+:triplesMapItem a rml:TriplesMap ;
+  rml:logicalSource :mixedCSVView ;
+  rml:subjectMap [
+    rml:template "http://example.org/item_{#}_{items.item.#}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasType ;
+    rml:objectMap [
+      rml:reference "items.item.type" ;
+    ] ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasWeight ;
+    rml:objectMap [
+      rml:reference "items.item.weight" ;
+      rml:datatype xsd:integer ;
+    ] ;
+  ] .
+
+

Output

+
<http://example.org/item_0_0> <http://example.org/hasType> "sword" .
+<http://example.org/item_0_0> <http://example.org/hasWeight> "1500"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.org/item_0_1> <http://example.org/hasType> "shield" .
+<http://example.org/item_0_1> <http://example.org/hasWeight> "2500"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.org/item_1_0> <http://example.org/hasType> "flower" .
+<http://example.org/item_1_0> <http://example.org/hasWeight> "15"^^<http://www.w3.org/2001/XMLSchema#integer> .
+
+
+

31. RMLLVTC0007b

+

Title: Change Reference Formulations: CSV including JSON object

+

Description: Test a change of reference formulations: csv source including json object

+

Error expected? No

+

Input

+
name,item
+alice,"{""type"":""sword"",""weight"":1500}"
+alice,"{""type"":""shield"",""weight"":2500}"
+bob,"{""type"":""flower"",""weight"":15}"
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+
+:mixedCSVSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.csv" ;
+  ] ;
+  rml:referenceFormulation rml:CSV .
+
+:mixedCSVView a rml:LogicalView ;
+  rml:viewOn :mixedCSVSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "name" ;
+  ] ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "item" ;
+    rml:reference "item" ;
+    rml:field [
+      a rml:IterableField ;
+      rml:referenceFormulation rml:JSONPath ;
+      rml:iterator "$" ;
+      rml:fieldName "itemJson" ;
+      rml:field [
+        a rml:ExpressionField;
+        rml:fieldName "type" ;
+        rml:reference "$.type" ; ] ;
+      rml:field [
+        a rml:ExpressionField;
+        rml:fieldName "weight" ;
+        rml:reference "$.weight" ;
+      ] ;
+    ] ;
+  ] .
+
+:triplesMapItem a rml:TriplesMap ;
+  rml:logicalSource :mixedCSVView ;
+  rml:subjectMap [
+    rml:template "http://example.org/item_{#}_{item.#}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasType ;
+    rml:objectMap [
+      rml:reference "item.itemJson.type" ;
+    ] ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasWeight ;
+    rml:objectMap [
+      rml:reference "item.itemJson.weight" ;
+      rml:datatype xsd:integer ;
+    ] ;
+  ] .
+
+

Output

+
<http://example.org/item_0_0> <http://example.org/hasType> "sword" .
+<http://example.org/item_0_0> <http://example.org/hasWeight> "1500"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.org/item_1_0> <http://example.org/hasType> "shield" .
+<http://example.org/item_1_0> <http://example.org/hasWeight> "2500"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.org/item_2_0> <http://example.org/hasType> "flower" .
+<http://example.org/item_2_0> <http://example.org/hasWeight> "15"^^<http://www.w3.org/2001/XMLSchema#integer> .
+
+
+

32. RMLLVTC0007c

+

Title: Change Reference Formulations: JSON including CSV

+

Description: Test a change of reference formulations: json source including csv data

+

Error expected? No

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "items": "type,weight\nsword,1500\nshield,2500"
+    },
+    {
+      "name": "bob",
+      "items": "type,weight\nflower,15"
+    }
+  ]
+}
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+
+:mixedJSONSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:mixedJSONView a rml:LogicalView ;
+  rml:viewOn :mixedJSONSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+    ] ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "items" ;
+    rml:reference "$.items" ;
+    rml:field [
+      a rml:IterableField ;
+      rml:referenceFormulation rml:CSV ;
+      rml:fieldName "item";
+      rml:field [
+        a rml:ExpressionField ;
+        rml:fieldName "type" ;
+        rml:reference "type" ;
+      ] ;
+      rml:field [
+        a rml:expressionField ;
+        rml:fieldName "weight" ;
+        rml:reference "weight" ;
+      ] ;
+    ] ;
+  ].
+
+:triplesMapItem a rml:TriplesMap ;
+  rml:logicalSource :mixedJSONView ;
+  rml:subjectMap [
+    rml:template "http://example.org/item_{#}_{items.item.#}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasType ;
+    rml:objectMap [
+      rml:reference "items.item.type" ;
+    ] ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasWeight ;
+    rml:objectMap [
+      rml:reference "items.item.weight" ;
+      rml:datatype xsd:integer ;
+    ] ;
+  ] .
+
+

Output

+
<http://example.org/item_0_0> <http://example.org/hasType> "sword" .
+<http://example.org/item_0_0> <http://example.org/hasWeight> "1500"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.org/item_0_1> <http://example.org/hasType> "shield" .
+<http://example.org/item_0_1> <http://example.org/hasWeight> "2500"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.org/item_1_0> <http://example.org/hasType> "flower" .
+<http://example.org/item_1_0> <http://example.org/hasWeight> "15"^^<http://www.w3.org/2001/XMLSchema#integer> .
+
+
+

33. RMLLVTC0008a

+

Title: Cycle: Abstract Logical Source

+

Description: Test a cycle in the abstract logical source of a logical view

+

Error expected? Yes

+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix : <http://example.org/> .
+
+:view1 a rml:LogicalView ;
+  rml:viewOn :view2 ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name1" ;
+    rml:reference "name2" ;
+  ] .
+
+:view2 a rml:LogicalView ;
+  rml:viewOn :view1 ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name2" ;
+    rml:reference "name1" ;
+  ] .
+
+:triplesMapPerson a rml:TriplesMap ;
+  rml:logicalSource :view2 ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{name2}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasName ;
+    rml:objectMap [
+      rml:reference "name2" ;
+    ] ;
+  ] .
+
+
+

34. RMLLVTC0008b

+

Title: Cycle: Joins

+

Description: Test a cycle in two joins of two logical views

+

Error expected? Yes

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "items": [
+        "sword",
+        "shield"
+      ]
+    },
+    {
+      "name": "bob",
+      "items": [
+        "flower"
+      ]
+    }
+  ]
+}
+
+

Input 1

+
name,birthyear
+alice,1995
+bob,1999
+tobias,2005
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+  rml:viewOn :jsonSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+  ] ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "item" ;
+    rml:reference "$.items[*]" ;
+  ] ;
+  rml:leftJoin [
+    rml:parentLogicalView :csvView ;
+    rml:joinCondition [
+      rml:parent "name" ;
+      rml:child "name" ;
+    ] ;
+    rml:field [
+      a rml:ExpressionField ;
+      rml:fieldName "csv_birthyear" ;
+      rml:reference "birthyear" ;
+    ] ;
+  ] .
+
+:csvSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.csv" ;
+  ] ;
+  rml:referenceFormulation rml:CSV .
+
+:csvView a rml:LogicalView ;
+  rml:viewOn :csvSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "name" ;
+  ] ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "birthyear" ;
+    rml:reference "birthyear" ;
+  ] ;
+  rml:leftJoin [
+    rml:parentLogicalView :jsonView ;
+    rml:joinCondition [
+      rml:parent "name" ;
+      rml:child "name" ;
+    ] ;
+    rml:field [
+      a rml:ExpressionField ;
+      rml:fieldName "json_item" ;
+      rml:reference "item" ;
+    ] ;
+  ] .
+
+
+:triplesMapPerson a rml:TriplesMap ;
+  rml:logicalSource :csvView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{name}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasBirthYear ;
+    rml:objectMap [
+      rml:reference "birthyear" ;
+      rml:datatype xsd:gYear ;
+    ] ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasItem ;
+    rml:objectMap [
+      rml:template "http://example.org/person/{name}/item/{json_item}" ;
+    ] ;
+  ] .
+
+
+

35. RMLLVTC0008c

+

Title: Cycle: Self-Join

+

Description: Test a cycle in a join of a logical view: self-join

+

Error expected? Yes

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "items": [
+        {
+          "type": "sword",
+          "weight": 1500
+        },
+        {
+          "type": "shield",
+          "weight": 2500
+        }
+      ]
+    },
+    {
+      "name": "bob",
+      "items": [
+        {
+          "type": "flower",
+          "weight": 15
+        }
+      ]
+    }
+  ]
+}
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+  rml:viewOn :jsonSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+  ] ;
+  rml:leftJoin [
+    rml:parentLogicalView :jsonView ;
+    rml:joinCondition [
+      rml:parent "name" ;
+      rml:child "name" ;
+    ] ;
+    rml:field [
+      a rml:ExpressionField ;
+      rml:fieldName "newName" ;
+      rml:reference "name" ;
+    ] ;
+  ] .
+
+:triplesMapPerson a rml:TriplesMap ;
+  rml:logicalSource :jsonView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{newName}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasName ;
+    rml:objectMap [
+      rml:reference "newName" ;
+    ] ;
+  ] .
+
+
+

36. RMLLVTC0008d

+

Title: Cycle: Fields

+

Description: Test a cycle in nested fields

+

Error expected? Yes

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "items": [
+        {
+          "type": "sword",
+          "weight": 1500
+        },
+        {
+          "type": "shield",
+          "weight": 2500
+        }
+      ]
+    },
+    {
+      "name": "bob",
+      "items": [
+        {
+          "type": "flower",
+          "weight": 15
+        }
+      ]
+    }
+  ]
+}
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+  rml:viewOn :jsonSource ;
+  rml:field :field1 .
+
+:field1 a rml:IterableField ;
+  rml:fieldName "item" ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.items[*]" ;
+  rml:field :field2.
+
+:field2 a rml:ExpressionField ;
+  rml:fieldName "type" ;
+  rml:reference "$.type" ;
+  rml:field :field1.
+
+
+

37. RMLLVTC0009a

+

Title: Name collision: between Fields with the same Parent

+

Description: Test a name collision between fields with the same parent

+

Error expected? Yes

+

Input

+
{
+  "people": [
+    {
+      "givenName": "Alice",
+      "familyName": "Smith"
+    },
+    {
+      "givenName": "Bob",
+      "familyName": "Johnson"
+    }
+  ]
+}
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+  rml:viewOn :jsonSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.givenName" ;
+  ], [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.familyName" ;
+  ]  .
+
+:triplesMapPerson a rml:TriplesMap ;
+  rml:logicalSource :jsonView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{name}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasName ;
+    rml:objectMap [
+      rml:reference "name" ;
+    ] ;
+  ] .
+
+
+

38. RMLLVTC0009b

+

Title: Name collision: caused by Field from a Join

+

Description: Test a name collision caused by a field from a join

+

Error expected? Yes

+

Input

+
{
+  "people": [
+    {
+      "givenName": "alice",
+      "familyName": "smith",
+      "items": [
+        "sword",
+        "shield"
+      ]
+    },
+    {
+      "givenName": "bob",
+      "familyName": "johnson",
+      "items": [
+        "flower"
+      ]
+    }
+  ]
+}
+
+

Input 1

+
name,birthyear
+alice,1995
+bob,1999
+tobias,2005
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+  rml:viewOn :jsonSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "givenName" ;
+    rml:reference "$.givenName" ;
+  ] ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "familyName" ;
+    rml:reference "$.familyName" ;
+  ] .
+
+:csvSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.csv" ;
+  ] ;
+  rml:referenceFormulation rml:CSV .
+
+:csvView a rml:LogicalView ;
+  rml:viewOn :csvSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "name" ;
+  ] ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "birthyear" ;
+    rml:reference "birthyear" ;
+  ] ;
+  rml:leftJoin [
+    rml:parentLogicalView :jsonView ;
+    rml:joinCondition [
+      rml:parent "givenName" ;
+      rml:child "name" ;
+    ] ;
+    rml:field [
+      a rml:ExpressionField ;
+      rml:fieldName "name" ;
+      rml:reference "familyName" ;
+    ] ; 
+  ] .
+
+
+:triplesMapPerson a rml:TriplesMap ;
+  rml:logicalSource :csvView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{name}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasBirthYear ;
+    rml:objectMap [
+      rml:reference "birthyear" ;
+      rml:datatype xsd:gYear ;
+    ] ;
+  ] .
+
+
+

39. RMLLVTC0009c

+

Title: Name collision: between Fields from different Joins

+

Description: Test a name collision between fields from different joins

+

Error expected? Yes

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "items": [
+        "sword",
+        "shield"
+      ]
+    },
+    {
+      "name": "bob",
+      "items": [
+        "flower"
+      ]
+    }
+  ]
+}
+
+

Input 1

+
name,id
+alice,123
+bob,456
+tobias,789
+
+

Input 2

+
name,item
+alice,lantern
+bob,leaf
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+  rml:viewOn :jsonSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+  ] ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "jsonitem" ;
+    rml:reference "$.items[*]" ;
+  ] .
+
+:additionalCsvSource a rml:LogicalSource ;
+  rml:source [
+   a rml:RelativePathSource , rml:Source ;
+   rml:root rml:MappingDirectory ;
+   rml:path "people2.csv" ;
+  ] ;
+  rml:referenceFormulation rml:CSV .
+
+:additionalCsvView a rml:LogicalView ;
+  rml:viewOn :additionalCsvSource ;
+    rml:field [
+     a rml:ExpressionField ;
+     rml:fieldName "name" ;
+     rml:reference "name" ;
+    ] ;
+    rml:field [
+     a rml:ExpressionField ;
+     rml:fieldName "csvitem" ;
+     rml:reference "item" ;
+    ] ;
+.
+
+:csvSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.csv" ;
+  ] ;
+  rml:referenceFormulation rml:CSV .
+
+:csvView a rml:LogicalView ;
+  rml:viewOn :csvSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "name" ;
+  ] ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "id" ;
+    rml:reference "id" ;
+  ] ;
+  rml:leftJoin [
+    rml:parentLogicalView :jsonView ;
+    rml:joinCondition [
+      rml:parent "name" ;
+      rml:child "name" ;
+    ] ;
+    rml:field [
+      a rml:ExpressionField ;
+      rml:fieldName "item" ;
+      rml:reference "jsonitem" ;
+    ] ;
+  ] ;
+  rml:leftJoin [
+    rml:parentLogicalView :additionalCsvView ;
+    rml:joinCondition [
+      rml:parent "name" ;
+      rml:child "name" ;
+    ] ;
+    rml:field [
+      a rml:ExpressionField ;
+      rml:fieldName "item" ;
+      rml:reference "csvitem" ;
+    ] ;
+  ] .
+
+
+:triplesMapPerson a rml:TriplesMap ;
+  rml:logicalSource :csvView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{id}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasItem ;
+    rml:objectMap [
+      rml:template "http://example.org/person/{id}/item/{item}" ;
+    ] ;
+  ] .
+
+
+ + + + + \ No newline at end of file diff --git a/src/test/resources/rml-lv/docs/index.html b/src/test/resources/rml-lv/docs/index.html new file mode 100644 index 00000000..c74314d0 --- /dev/null +++ b/src/test/resources/rml-lv/docs/index.html @@ -0,0 +1,3524 @@ + + + + + + +RML-LV: Test Cases + + + + + + + + + + + + + + + +
+ +

RML-LV: Test Cases

+

+ Draft Community Group Report + +

+
+ +
Latest published version:
+ https://www.w3.org/RML-LV-Testcases/ +
+
Latest editor's draft:
https://w3id.org/rml/lv/test-cases/
+ + + + +
Editors:
+ (Skemu) +
+ (Ghent University – imec – IDLab) +
+ +
Authors:
+ (Skemu) +
+ (Ghent University – imec – IDLab) +
+
Feedback:
+ GitHub kg-construct/rml-lv + (pull requests, + new issue, + open issues) +
+ +
+ + +
+
+ + + +

Abstract

This document defines the RML-LV test cases to the determine the RML-LV specification conformance of tools.

+
+ +

Status of This Document

+ This specification was published by the + Knowledge Graph Construction Community Group. It is not a W3C Standard nor is it + on the W3C Standards Track. + + Please note that under the + W3C Community Contributor License Agreement (CLA) + there is a limited opt-out and other conditions apply. + + Learn more about + W3C Community and Business Groups. +

+ GitHub Issues are preferred for + discussion of this specification. + + +

+ +

1. Introduction

+

This document defines the RML-LV test cases, consisting of a collection of test case documents (input and expected output). +The purpose of the test cases is to determine the conformance of tools that execute RML rules to the RML-LV specification.

+
+ +

2. Data model

+

The test cases are semantically described for re-usability and shareability following the W3C Test case description. +Each test:Testcase as the following properties:

+
    +
  • dcterms:identifier: unique ID of the test case.
  • +
  • rmltest:hasError: if an error of the RML Processor is expected or not.
  • +
  • rmltest:input: One or more input data of the test case.
  • +
  • rmltest:output: One or more output data of the test case.
  • +
  • rmltest:inputFormat: the input data format.
  • +
  • rmltest:outputFormat: the output data format.
  • +
  • rmltest:mappingDocument: the RML mapping rules in Turtle.
  • +
+
+ +

3. Test cases

+

This section describes the RML-LV test cases. These descriptions are also available as RDF. +The files are available on GitHub in the folder test-cases. +Each test case is contained in a single folder, containing three types of files:

+
    +
  • Zero or more files containing the data sources, in the case of JSON, XML, CSV, or containing the SQL statements to create the necessary tables, in the case of MySQL, PostgreSQL, and SQL Server.
  • +
  • One file with the RML rules, called mapping.ttl, in the Turtle format.
  • +
  • Zero or more files with the expected RDF. No file is provided if an error is expected that must halt the generation of the RDF because of an error.
  • +
+
+ + +

4. RMLLVTC0000a

+

Title: Logical view on JSON source

+

Description: Test a view on a hierarchical source

+

Error expected? No

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "items": [
+        {
+          "type": "sword",
+          "weight": 1500
+        },
+        {
+          "type": "shield",
+          "weight": 2500
+        }
+      ]
+    },
+    {
+      "name": "bob",
+      "items": [
+        {
+          "type": "flower",
+          "weight": 15
+        }
+      ]
+    }
+  ]
+}
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+  rml:viewOn :jsonSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+  ] .
+
+:triplesMapPerson a rml:TriplesMap ;
+  rml:logicalSource :jsonView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{name}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasName ;
+    rml:objectMap [
+      rml:reference "name" ;
+    ] ;
+  ] .
+
+

Output

+
<http://example.org/person/alice> <http://example.org/hasName> "alice" .
+<http://example.org/person/bob> <http://example.org/hasName> "bob" .
+
+
+

5. RMLLVTC0000b

+

Title: Logical view on CSV source

+

Description: Test a view on a tabular source

+

Error expected? No

+

Input

+
name,birthyear
+alice,1995
+bob,1999
+tobias,2005
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix : <http://example.org/> .
+
+:csvSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.csv" ;
+  ] ;
+  rml:referenceFormulation rml:CSV .
+
+:csvView a rml:LogicalView ;
+  rml:viewOn :csvSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "name" ;
+  ] .
+
+:triplesMapPerson a rml:TriplesMap ;
+  rml:logicalSource :csvView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{name}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasName ;
+    rml:objectMap [
+      rml:reference "name" ;
+    ] ;
+  ] .
+
+

Output

+
<http://example.org/person/alice> <http://example.org/hasName> "alice" .
+<http://example.org/person/bob> <http://example.org/hasName> "bob" .
+<http://example.org/person/tobias> <http://example.org/hasName> "tobias" .
+
+
+

6. RMLLVTC0000c

+

Title: Logical View on Logical View

+

Description: Test a view on a logical view

+

Error expected? No

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "items": [
+        {
+          "type": "sword",
+          "weight": 1500
+        },
+        {
+          "type": "shield",
+          "weight": 2500
+        }
+      ]
+    },
+    {
+      "name": "bob",
+      "items": [
+        {
+          "type": "flower",
+          "weight": 15
+        }
+      ]
+    }
+  ]
+}
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+  rml:viewOn :jsonSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+  ] .
+
+:jsonViewOnJsonView a rml:LogicalView ;
+  rml:viewOn :jsonView ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "newName" ;
+    rml:reference "name" ;
+  ] .
+
+:triplesMapPerson a rml:TriplesMap ;
+  rml:logicalSource :jsonViewOnJsonView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{newName}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasName ;
+    rml:objectMap [
+      rml:reference "newName" ;
+    ] ;
+  ] .
+
+

Output

+
<http://example.org/person/alice> <http://example.org/hasName> "alice" .
+<http://example.org/person/bob> <http://example.org/hasName> "bob" .
+
+
+

7. RMLLVTC0001a

+

Title: Expression Field: Reference

+

Description: Test a reference in an expression field

+

Error expected? No

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "items": [
+        {
+          "type": "sword",
+          "weight": 1500
+        },
+        {
+          "type": "shield",
+          "weight": 2500
+        }
+      ]
+    },
+    {
+      "name": "bob",
+      "items": [
+        {
+          "type": "flower",
+          "weight": 15
+        }
+      ]
+    }
+  ]
+}
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+  rml:viewOn :jsonSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+  ] .
+
+:triplesMapPerson a rml:TriplesMap ;
+  rml:logicalSource :jsonView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{name}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasName ;
+    rml:objectMap [
+      rml:reference "name" ;
+    ] ;
+  ] .
+
+

Output

+
<http://example.org/person/alice> <http://example.org/hasName> "alice" .
+<http://example.org/person/bob> <http://example.org/hasName> "bob" .
+
+
+

8. RMLLVTC0001b

+

Title: Expression Field: Template

+

Description: Test a template in an expression field

+

Error expected? No

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "items": [
+        {
+          "type": "sword",
+          "weight": 1500
+        },
+        {
+          "type": "shield",
+          "weight": 2500
+        }
+      ]
+    },
+    {
+      "name": "bob",
+      "items": [
+        {
+          "type": "flower",
+          "weight": 15
+        }
+      ]
+    }
+  ]
+}
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+  rml:viewOn :jsonSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+  ] ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "race" ;
+    rml:constant "human" ;
+  ] .
+
+:triplesMapPerson a rml:TriplesMap ;
+  rml:logicalSource :jsonView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{name}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasRace ;
+    rml:objectMap [
+      rml:reference "race" ;
+    ] ;
+  ] .
+
+

Output

+
<http://example.org/person/alice> <http://example.org/hasRace> "human" .
+<http://example.org/person/bob> <http://example.org/hasRace> "human" .
+
+
+

9. RMLLVTC0001c

+

Title: Expression Field: Constant

+

Description: Test a constant expression in an expression field

+

Error expected? No

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "lastName": "smith",
+      "items": [
+        {
+          "type": "sword",
+          "weight": 1500
+        },
+        {
+          "type": "shield",
+          "weight": 2500
+        }
+      ]
+    },
+    {
+      "name": "bob",
+      "lastName": "jones",
+      "items": [
+        {
+          "type": "flower",
+          "weight": 15
+        }
+      ]
+    }
+  ]
+}
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+  rml:viewOn :jsonSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+  ] ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "fullName" ;
+    rml:template "{name} {lastName}" ;
+  ] .
+
+:triplesMapPerson a rml:TriplesMap ;
+  rml:logicalSource :jsonView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{name}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasFullName ;
+    rml:objectMap [
+      rml:reference "fullName" ;
+    ] ;
+  ] .
+
+

Output

+
<http://example.org/person/alice> <http://example.org/hasFullName> "alice smith" .
+<http://example.org/person/bob> <http://example.org/hasFullName> "bob jones" .
+
+
+

10. RMLLVTC0001d

+

Title: Expression Field Siblings

+

Description: Test multiple expression fields with the same parent

+

Error expected? No

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "lastName": "smith",
+      "items": [
+        {
+          "type": "sword",
+          "weight": 1500
+        },
+        {
+          "type": "shield",
+          "weight": 2500
+        }
+      ]
+    },
+    {
+      "name": "bob",
+      "lastName": "jones",
+      "items": [
+        {
+          "type": "flower",
+          "weight": 15
+        }
+      ]
+    }
+  ]
+}
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+  rml:viewOn :jsonSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+  ] ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "lastName" ;
+    rml:reference "$.lastName" ;
+  ] .
+
+:triplesMapPerson a rml:TriplesMap ;
+  rml:logicalSource :jsonView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{name}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasFullName ;
+    rml:objectMap [
+      rml:template "{name} {lastName}" ;
+      rml:termType rml:Literal ;
+    ] ;
+  ] .
+
+

Output

+
<http://example.org/person/alice> <http://example.org/hasFullName> "alice smith" .
+<http://example.org/person/bob> <http://example.org/hasFullName> "bob jones" .
+
+
+

11. RMLLVTC0002a

+

Title: Iterable Field

+

Description: Test a nested field construction: iterable field with expression field as child

+

Error expected? No

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "items": [
+        {
+          "type": "sword",
+          "weight": 1500
+        },
+        {
+          "type": "shield",
+          "weight": 2500
+        }
+      ]
+    },
+    {
+      "name": "bob",
+      "items": [
+        {
+          "type": "flower",
+          "weight": 15
+        }
+      ]
+    }
+  ]
+}
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+  rml:viewOn :jsonSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+  ] ;
+  rml:field [
+    a rml:IterableField ;
+    rml:fieldName "item" ;
+    rml:iterator "$.items[*]" ;
+    rml:field [
+      a rml:ExpressionField ;
+      rml:fieldName "type" ;
+      rml:reference "$.type" ;
+    ] ;
+  ] .
+
+:triplesMapPerson a rml:TriplesMap ;
+  rml:logicalSource :jsonView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{name}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasItem ;
+    rml:objectMap [
+      rml:template "http://example.org/person/{name}/item/{item.type}" ;
+    ] ;
+  ] .
+
+

Output

+
<http://example.org/person/alice> <http://example.org/hasItem> <http://example.org/person/alice/item/sword> .
+<http://example.org/person/alice> <http://example.org/hasItem> <http://example.org/person/alice/item/shield> .
+<http://example.org/person/bob> <http://example.org/hasItem> <http://example.org/person/bob/item/flower> .
+
+
+

12. RMLLVTC0002b

+

Title: Iterable Field with Multiple Children

+

Description: Test a nested field construction: iterable field with mulitple expression fields as children

+

Error expected? No

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "items": [
+        {
+          "type": "sword",
+          "weight": 1500
+        },
+        {
+          "type": "shield",
+          "weight": 2500
+        }
+      ]
+    },
+    {
+      "name": "bob",
+      "items": [
+        {
+          "type": "flower",
+          "weight": 15
+        }
+      ]
+    }
+  ]
+}
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+  rml:viewOn :jsonSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+  ] ;
+  rml:field [
+    a rml:IterableField ;
+    rml:fieldName "item" ;
+    rml:iterator "$.items[*]" ;
+    rml:field [
+      a rml:ExpressionField ;
+      rml:fieldName "type" ;
+      rml:reference "$.type" ;
+    ] ;
+    rml:field [
+      a rml:ExpressionField ;
+      rml:fieldName "weight" ;
+      rml:reference "$.weight" ;
+    ] ;
+  ] .
+
+:triplesMapItem a rml:TriplesMap ;
+  rml:logicalSource :jsonView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{name}/item/{item.type}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasName ;
+    rml:objectMap [
+      rml:reference "item.type" ;
+    ] ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasWeight ;
+    rml:objectMap [
+      rml:reference "item.weight" ;
+      rml:datatype xsd:integer ;
+    ] ;
+  ] .
+
+

Output

+
<http://example.org/person/alice/item/sword> <http://example.org/hasName> "sword" .
+<http://example.org/person/alice/item/sword> <http://example.org/hasWeight> "1500"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.org/person/alice/item/shield> <http://example.org/hasName> "shield" .
+<http://example.org/person/alice/item/shield> <http://example.org/hasWeight> "2500"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.org/person/bob/item/flower> <http://example.org/hasName> "flower" .
+<http://example.org/person/bob/item/flower> <http://example.org/hasWeight> "15"^^<http://www.w3.org/2001/XMLSchema#integer> .
+
+
+

13. RMLLVTC0002c

+

Title: Nested Iterable Fields

+

Description: Test a nested field construction: iterable field with an iterable field as child

+

Error expected? No

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "items": [
+        {
+          "type": "sword",
+          "measures": {
+            "weight": 1500,
+            "length": 30
+          }
+        },
+        {
+          "type": "shield",
+          "measures": {
+            "weight": 2500
+          }
+        }
+      ]
+    },
+    {
+      "name": "bob",
+      "items": [
+        {
+          "type": "flower",
+          "measures" : {
+            "weight": 15,
+            "length" : 15
+          }
+        }
+      ]
+    }
+  ]
+}
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+  rml:viewOn :jsonSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+  ] ;
+  rml:field [
+    a rml:IterableField ;
+    rml:fieldName "item" ;
+    rml:iterator "$.items[*]" ;
+    rml:field [
+      rml:fieldName "type" ;
+      rml:reference "$.type" ;
+    ] ;
+    rml:field [
+      a rml:IterableField ;
+      rml:fieldName "measures";
+      rml:iterator "$.measures";
+      rml:field [
+        a rml:ExpressionField ;
+        rml:fieldName "weight" ;
+        rml:reference "$.weight" ;
+        ];
+    ] ;
+  ] .
+
+:triplesMapItem a rml:TriplesMap ;
+  rml:logicalSource :jsonView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{name}/item/{item.type}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasWeight ;
+    rml:objectMap [
+      rml:reference "item.measures.weight" ;
+      rml:datatype xsd:integer ;
+    ] ;
+  ] .
+
+

Output

+
<http://example.org/person/alice/item/sword> <http://example.org/hasWeight> "1500"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.org/person/alice/item/shield> <http://example.org/hasWeight> "2500"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.org/person/bob/item/flower> <http://example.org/hasWeight> "15"^^<http://www.w3.org/2001/XMLSchema#integer> .
+
+
+

14. RMLLVTC0003a

+

Title: Index Key: #

+

Description: Test a reference to the index key #

+

Error expected? No

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "items": [
+        {
+          "type": "sword",
+          "weight": 1500
+        },
+        {
+          "type": "shield",
+          "weight": 2500
+        }
+      ]
+    },
+    {
+      "name": "bob",
+      "items": [
+        {
+          "type": "flower",
+          "weight": 15
+        }
+      ]
+    }
+  ]
+}
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+  rml:viewOn :jsonSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+  ] .
+
+:triplesMapPerson a rml:TriplesMap ;
+  rml:logicalSource :jsonView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{name}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasSequenceNumber ;
+    rml:objectMap [
+      rml:reference "#" ;
+      rml:datatype xsd:integer ;
+    ] ;
+  ] .
+
+

Output

+
<http://example.org/person/alice> <http://example.org/hasSequenceNumber> "0"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.org/person/bob> <http://example.org/hasSequenceNumber> "1"^^<http://www.w3.org/2001/XMLSchema#integer> .
+
+
+

15. RMLLVTC0003b

+

Title: Index Key: Iterable Field

+

Description: Test a reference to the index key of an iterable field

+

Error expected? No

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "items": [
+        {
+          "type": "sword",
+          "weight": 1500
+        },
+        {
+          "type": "shield",
+          "weight": 2500
+        }
+      ]
+    },
+    {
+      "name": "bob",
+      "items": [
+        {
+          "type": "flower",
+          "weight": 15
+        }
+      ]
+    }
+  ]
+}
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+  rml:viewOn :jsonSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+  ] ;
+  rml:field [
+    a rml:IterableField ;
+    rml:fieldName "item" ;
+    rml:iterator "$.items[*]" ;
+    rml:field [
+      a rml:ExpressionField ;
+      rml:fieldName "type" ;
+      rml:reference "$.type" ;
+    ] ;
+  ] .
+
+:triplesMapPerson a rml:TriplesMap ;
+  rml:logicalSource :jsonView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{name}/item/{item.#}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasType ;
+    rml:objectMap [
+      rml:reference "item.type" ;
+    ] ;
+  ] .
+
+

Output

+
<http://example.org/person/alice/item/0> <http://example.org/hasType> "sword" .
+<http://example.org/person/alice/item/1> <http://example.org/hasType> "shield" .
+<http://example.org/person/bob/item/0> <http://example.org/hasType> "flower" .
+
+
+
+

16. RMLLVTC0003c

+

Title: Index Key: Expression field

+

Description: Test a reference to the index key of an expression field

+

Error expected? No

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "items": [
+        "sword",
+        "shield"
+      ]
+    },
+    {
+      "name": "bob",
+      "items": [
+        "flower"
+      ]
+    }
+  ]
+}
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+  rml:viewOn :jsonSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+  ] ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "item" ;
+    rml:reference "$.items[*]" ;
+  ] .
+
+:triplesMapItem a rml:TriplesMap ;
+  rml:logicalSource :jsonView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{name}/item/{item.#}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasType ;
+    rml:objectMap [
+      rml:reference "item" ;
+    ] ;
+  ] .
+
+

Output

+
<http://example.org/person/alice/item/0> <http://example.org/hasType> "sword" .
+<http://example.org/person/alice/item/1> <http://example.org/hasType> "shield" .
+<http://example.org/person/bob/item/0> <http://example.org/hasType> "flower" .
+
+
+

17. RMLLVTC0004a

+

Title: Natural Datatype: Index #

+

Description: Test the natural datatype mapping for the index #

+

Error expected? No

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "items": [
+        {
+          "type": "sword",
+          "weight": 1500
+        },
+        {
+          "type": "shield",
+          "weight": 2500
+        }
+      ]
+    },
+    {
+      "name": "bob",
+      "items": [
+        {
+          "type": "flower",
+          "weight": 15
+        }
+      ]
+    }
+  ]
+}
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+  rml:viewOn :jsonSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+  ] .
+
+:triplesMapPerson a rml:TriplesMap ;
+  rml:logicalSource :jsonView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{name}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasSequenceNumber ;
+    rml:objectMap [
+      rml:reference "#" ;
+    ] ;
+  ] .
+
+

Output

+
<http://example.org/person/alice> <http://example.org/hasSequenceNumber> "0"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.org/person/bob> <http://example.org/hasSequenceNumber> "1"^^<http://www.w3.org/2001/XMLSchema#integer> .
+
+
+

18. RMLLVTC0004b

+

Title: Natural Datatype: Index Expression Field

+

Description: Test the natural datatype mapping for the index of an expression field

+

Error expected? No

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "items": [
+        {
+          "type": "sword",
+          "weight": 1500
+        },
+        {
+          "type": "shield",
+          "weight": 2500
+        }
+      ]
+    },
+    {
+      "name": "bob",
+      "items": [
+        {
+          "type": "flower",
+          "weight": 15
+        }
+      ]
+    }
+  ]
+}
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+  rml:viewOn :jsonSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+  ] ;
+  rml:field [
+    a rml:IterableField ;
+    rml:fieldName "item" ;
+    rml:iterator "$.items[*]" ;
+    rml:field [
+      a rml:ExpressionField ;
+      rml:fieldName "type" ;
+      rml:reference "$.type" ;
+    ] ;
+  ] .
+
+:triplesMapPerson a rml:TriplesMap ;
+  rml:logicalSource :jsonView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{name}/item/{item.type}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasSequenceNumber ;
+    rml:objectMap [
+      rml:reference "item.#" ;
+    ] ;
+  ] .
+
+

Output

+
<http://example.org/person/alice/item/sword> <http://example.org/hasSequenceNumber> "0"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.org/person/alice/item/shield> <http://example.org/hasSequenceNumber> "1"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.org/person/bob/item/flower> <http://example.org/hasSequenceNumber> "0"^^<http://www.w3.org/2001/XMLSchema#integer> .
+
+
+

19. RMLLVTC0004c

+

Title: Natural Datatype: Index Iterable Field

+

Description: Test the natural datatype mapping for the index of an iterable field

+

Error expected? No

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "items": [
+        "sword",
+        "shield"
+      ]
+    },
+    {
+      "name": "bob",
+      "items": [
+        "flower"
+      ]
+    }
+  ]
+}
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+  rml:viewOn :jsonSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+  ] ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "item" ;
+    rml:reference "$.items[*]" ;
+  ] .
+
+:triplesMapItem a rml:TriplesMap ;
+  rml:logicalSource :jsonView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{name}/item/{item}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasSequenceNumber ;
+    rml:objectMap [
+      rml:reference "item.#" ;
+    ] ;
+  ] .
+
+

Output

+
<http://example.org/person/alice/item/sword> <http://example.org/hasSequenceNumber> "0"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.org/person/alice/item/shield> <http://example.org/hasSequenceNumber> "1"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.org/person/bob/item/flower> <http://example.org/hasSequenceNumber> "0"^^<http://www.w3.org/2001/XMLSchema#integer> .
+
+
+

20. RMLLVTC0004d

+

Title: Natural Datatype: Record Expression Field

+

Description: Test the natural datatype mapping for a record of an expression field

+

Error expected? No

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "birth_year": 1995
+    },
+    {
+      "name": "bob",
+      "birth_year": 1999
+    }
+  ]
+}
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+  rml:viewOn :jsonSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+  ] ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "birthyear" ;
+    rml:reference "$.birth_year" ;
+  ] .
+
+:triplesMapItem a rml:TriplesMap ;
+  rml:logicalSource :jsonView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{name}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasBirthYear ;
+    rml:objectMap [
+      rml:reference "birthyear" ;
+    ] ;
+  ] .
+
+

Output

+
<http://example.org/person/alice> <http://example.org/hasBirthYear> "1995"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.org/person/bob> <http://example.org/hasBirthYear> "1999"^^<http://www.w3.org/2001/XMLSchema#integer> .
+
+
+

21. RMLLVTC0005a

+

Title: Referencing a Non-Existing Key

+

Description: Test a reference to a non-existing key

+

Error expected? Yes

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "items": [
+        {
+          "type": "sword",
+          "weight": 1500
+        },
+        {
+          "type": "shield",
+          "weight": 2500
+        }
+      ]
+    },
+    {
+      "name": "bob",
+      "items": [
+        {
+          "type": "flower",
+          "weight": 15
+        }
+      ]
+    }
+  ]
+}
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+  rml:viewOn :jsonSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+  ] .
+
+:triplesMapPerson a rml:TriplesMap ;
+  rml:logicalSource :jsonView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{Name}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasName ;
+    rml:objectMap [
+      rml:reference "Name" ;
+    ] ;
+  ] .
+
+
+

22. RMLLVTC0005b

+

Title: Referencing the Record Key

+

Description: Test a reference to the record key

+

Error expected? Yes

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "items": [
+        {
+          "type": "sword",
+          "weight": 1500
+        },
+        {
+          "type": "shield",
+          "weight": 2500
+        }
+      ]
+    },
+    {
+      "name": "bob",
+      "items": [
+        {
+          "type": "flower",
+          "weight": 15
+        }
+      ]
+    }
+  ]
+}
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+  rml:viewOn :jsonSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+  ] .
+
+:triplesMapPerson a rml:TriplesMap ;
+  rml:logicalSource :jsonView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{name}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :isDerivedFrom ;
+    rml:objectMap [
+      rml:reference "<it>" ;
+    ] ;
+  ] .
+
+
+

23. RMLLVTC0005c

+

Title: Referencing the Record Key of an Iterable Field

+

Description: Test a reference to the record key of an iterable field

+

Error expected? Yes

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "items": [
+        {
+          "type": "sword",
+          "weight": 1500
+        },
+        {
+          "type": "shield",
+          "weight": 2500
+        }
+      ]
+    },
+    {
+      "name": "bob",
+      "items": [
+        {
+          "type": "flower",
+          "weight": 15
+        }
+      ]
+    }
+  ]
+}
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+  rml:viewOn :jsonSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+  ] ;
+  rml:field [
+    a rml:IterableField ;
+    rml:fieldName "item" ;
+    rml:iterator "$.items[*]" ;
+    rml:field [
+      a rml:ExpressionField ;
+      rml:fieldName "type" ;
+      rml:reference "$.type" ;
+    ] ;
+  ] .
+
+:triplesMapPerson a rml:TriplesMap ;
+  rml:logicalSource :jsonView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{name}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasItem ;
+    rml:objectMap [
+      rml:template "http://example.org/person/{name}/{item}" ;
+    ] ;
+  ] .
+
+
+

24. RMLLVTC0006a

+

Title: Left Join

+

Description: Test a left join

+

Error expected? No

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "items": [
+        "sword",
+        "shield"
+      ]
+    },
+    {
+      "name": "bob",
+      "items": [
+        "flower"
+      ]
+    }
+  ]
+}
+
+

Input 1

+
name,birthyear
+alice,1995
+bob,1999
+tobias,2005
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+  rml:viewOn :jsonSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+  ] ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "item" ;
+    rml:reference "$.items[*]" ;
+  ] .
+
+:csvSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.csv" ;
+  ] ;
+  rml:referenceFormulation rml:CSV .
+
+:csvView a rml:LogicalView ;
+  rml:viewOn :csvSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "name" ;
+  ] ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "birthyear" ;
+    rml:reference "birthyear" ;
+  ] ;
+  rml:leftJoin [
+    rml:parentLogicalView :jsonView ;
+    rml:joinCondition [
+      rml:parent "name" ;
+      rml:child "name" ;
+    ] ;
+    rml:field [
+      a rml:ExpressionField ;
+      rml:fieldName "json_item" ;
+      rml:reference "item" ;
+    ] ;
+  ] .
+
+
+:triplesMapPerson a rml:TriplesMap ;
+  rml:logicalSource :csvView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{name}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasBirthYear ;
+    rml:objectMap [
+      rml:reference "birthyear" ;
+      rml:datatype xsd:gYear ;
+    ] ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasItem ;
+    rml:objectMap [
+      rml:template "http://example.org/person/{name}/item/{json_item}" ;
+    ] ;
+  ] .
+
+

Output

+
<http://example.org/person/alice> <http://example.org/hasBirthYear> "1995"^^<http://www.w3.org/2001/XMLSchema#gYear> .
+<http://example.org/person/alice> <http://example.org/hasItem> <http://example.org/person/alice/item/sword> .
+<http://example.org/person/alice> <http://example.org/hasItem> <http://example.org/person/alice/item/shield> .
+<http://example.org/person/bob> <http://example.org/hasBirthYear> "1999"^^<http://www.w3.org/2001/XMLSchema#gYear> .
+<http://example.org/person/bob> <http://example.org/hasItem> <http://example.org/person/bob/item/flower> .
+<http://example.org/person/tobias> <http://example.org/hasBirthYear> "2005"^^<http://www.w3.org/2001/XMLSchema#gYear> .
+
+
+

25. RMLLVTC0006b

+

Title: Inner Join

+

Description: Test an inner join

+

Error expected? No

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "items": [
+        "sword",
+        "shield"
+      ]
+    },
+    {
+      "name": "bob",
+      "items": [
+        "flower"
+      ]
+    }
+  ]
+}
+
+

Input 1

+
name,birthyear
+alice,1995
+bob,1999
+tobias,2005
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+  rml:viewOn :jsonSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+  ] ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "item" ;
+    rml:reference "$.items[*]" ;
+  ] .
+
+:csvSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.csv" ;
+  ] ;
+  rml:referenceFormulation rml:CSV .
+
+:csvView a rml:LogicalView ;
+  rml:viewOn :csvSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "name" ;
+  ] ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "birthyear" ;
+    rml:reference "birthyear" ;
+  ] ;
+  rml:innerJoin [
+    rml:parentLogicalView :jsonView ;
+    rml:joinCondition [
+      rml:parent "name" ;
+      rml:child "name" ;
+    ] ;
+    rml:field [
+      a rml:ExpressionField ;
+      rml:fieldName "json_item" ;
+      rml:reference "item" ;
+    ] ;
+  ] .
+
+
+:triplesMapPerson a rml:TriplesMap ;
+  rml:logicalSource :csvView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{name}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasBirthYear ;
+    rml:objectMap [
+      rml:reference "birthyear" ;
+      rml:datatype xsd:gYear ;
+    ] ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasItem ;
+    rml:objectMap [
+      rml:template "http://example.org/person/{name}/item/{json_item}" ;
+    ] ;
+  ] .
+
+

Output

+
<http://example.org/person/alice> <http://example.org/hasBirthYear> "1995"^^<http://www.w3.org/2001/XMLSchema#gYear> .
+<http://example.org/person/alice> <http://example.org/hasItem> <http://example.org/person/alice/item/sword> .
+<http://example.org/person/alice> <http://example.org/hasItem> <http://example.org/person/alice/item/shield> .
+<http://example.org/person/bob> <http://example.org/hasBirthYear> "1999"^^<http://www.w3.org/2001/XMLSchema#gYear> .
+<http://example.org/person/bob> <http://example.org/hasItem> <http://example.org/person/bob/item/flower> .
+
+
+

26. RMLLVTC0006c

+

Title: Two Left Joins

+

Description: Test two left joins in one logical view

+

Error expected? No

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "items": [
+        "sword",
+        "shield"
+      ]
+    },
+    {
+      "name": "bob",
+      "items": [
+        "flower"
+      ]
+    }
+  ]
+}
+
+

Input 1

+
name,birthyear
+alice,1995
+bob,1999
+tobias,2005
+
+

Input 2

+
name,id
+alice,123
+bob,456
+tobias,789
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+  rml:viewOn :jsonSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+  ] ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "item" ;
+    rml:reference "$.items[*]" ;
+  ] .
+
+:additionalCsvSource a rml:LogicalSource ;
+  rml:source [
+   a rml:RelativePathSource , rml:Source ;
+   rml:root rml:MappingDirectory ;
+   rml:path "people2.csv" ;
+  ] ;
+  rml:referenceFormulation rml:CSV .
+
+:additionalCsvView a rml:LogicalView ;
+  rml:viewOn :additionalCsvSource ;
+    rml:field [
+     a rml:ExpressionField ;
+     rml:fieldName "name" ;
+     rml:reference "name" ;
+    ] ;
+    rml:field [
+     a rml:ExpressionField ;
+     rml:fieldName "id" ;
+     rml:reference "id" ;
+    ] ;
+.
+
+:csvSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.csv" ;
+  ] ;
+  rml:referenceFormulation rml:CSV .
+
+:csvView a rml:LogicalView ;
+  rml:viewOn :csvSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "name" ;
+  ] ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "birthyear" ;
+    rml:reference "birthyear" ;
+  ] ;
+  rml:leftJoin [
+    rml:parentLogicalView :jsonView ;
+    rml:joinCondition [
+      rml:parent "name" ;
+      rml:child "name" ;
+    ] ;
+    rml:field [
+      a rml:ExpressionField ;
+      rml:fieldName "json_item" ;
+      rml:reference "item" ;
+    ] ;
+  ] ;
+  rml:leftJoin [
+    rml:parentLogicalView :additionalCsvView ;
+    rml:joinCondition [
+      rml:parent "name" ;
+      rml:child "name" ;
+    ] ;
+    rml:field [
+      a rml:ExpressionField ;
+      rml:fieldName "csv2_id" ;
+      rml:reference "id" ;
+    ] ;
+  ] .
+
+
+:triplesMapPerson a rml:TriplesMap ;
+  rml:logicalSource :csvView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{csv2_id}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasBirthYear ;
+    rml:objectMap [
+      rml:reference "birthyear" ;
+      rml:datatype xsd:gYear ;
+    ] ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasItem ;
+    rml:objectMap [
+      rml:template "http://example.org/person/{csv2_id}/item/{json_item}" ;
+    ] ;
+  ] .
+
+

Output

+
<http://example.org/person/123> <http://example.org/hasBirthYear> "1995"^^<http://www.w3.org/2001/XMLSchema#gYear> .
+<http://example.org/person/123> <http://example.org/hasItem> <http://example.org/person/123/item/sword> .
+<http://example.org/person/123> <http://example.org/hasItem> <http://example.org/person/123/item/shield> .
+<http://example.org/person/456> <http://example.org/hasBirthYear> "1999"^^<http://www.w3.org/2001/XMLSchema#gYear> .
+<http://example.org/person/456> <http://example.org/hasItem> <http://example.org/person/456/item/flower> .
+<http://example.org/person/789> <http://example.org/hasBirthYear> "2005"^^<http://www.w3.org/2001/XMLSchema#gYear> .
+
+
+

27. RMLLVTC0006d

+

Title: Inner Join and Left Join

+

Description: Test an inner join and a left join in one logical view

+

Error expected? No

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "items": [
+        "sword",
+        "shield"
+      ]
+    },
+    {
+      "name": "bob",
+      "items": [
+        "flower"
+      ]
+    }
+  ]
+}
+
+

Input 1

+
name,birthyear
+alice,1995
+bob,1999
+tobias,2005
+
+

Input 2

+
name,id
+alice,123
+bob,456
+tobias,789
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+  rml:viewOn :jsonSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+  ] ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "item" ;
+    rml:reference "$.items[*]" ;
+  ] .
+
+:additionalCsvSource a rml:LogicalSource ;
+  rml:source [
+   a rml:RelativePathSource , rml:Source ;
+   rml:root rml:MappingDirectory ;
+   rml:path "people2.csv" ;
+  ] ;
+  rml:referenceFormulation rml:CSV .
+
+:additionalCsvView a rml:LogicalView ;
+  rml:viewOn :additionalCsvSource ;
+    rml:field [
+     a rml:ExpressionField ;
+     rml:fieldName "name" ;
+     rml:reference "name" ;
+    ] ;
+    rml:field [
+     a rml:ExpressionField ;
+     rml:fieldName "id" ;
+     rml:reference "id" ;
+    ] ;
+.
+
+:csvSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.csv" ;
+  ] ;
+  rml:referenceFormulation rml:CSV .
+
+:csvView a rml:LogicalView ;
+  rml:viewOn :csvSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "name" ;
+  ] ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "birthyear" ;
+    rml:reference "birthyear" ;
+  ] ;
+  rml:innerJoin [
+    rml:parentLogicalView :jsonView ;
+    rml:joinCondition [
+      rml:parent "name" ;
+      rml:child "name" ;
+    ] ;
+    rml:field [
+      a rml:ExpressionField ;
+      rml:fieldName "json_item" ;
+      rml:reference "item" ;
+    ] ;
+  ] ;
+  rml:leftJoin [
+    rml:parentLogicalView :additionalCsvView ;
+    rml:joinCondition [
+      rml:parent "name" ;
+      rml:child "name" ;
+    ] ;
+    rml:field [
+      a rml:ExpressionField ;
+      rml:fieldName "csv2_id" ;
+      rml:reference "id" ;
+    ] ;
+  ] .
+
+
+:triplesMapPerson a rml:TriplesMap ;
+  rml:logicalSource :csvView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{csv2_id}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasBirthYear ;
+    rml:objectMap [
+      rml:reference "birthyear" ;
+      rml:datatype xsd:gYear ;
+    ] ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasItem ;
+    rml:objectMap [
+      rml:template "http://example.org/person/{csv2_id}/item/{json_item}" ;
+    ] ;
+  ] .
+
+

Output

+
<http://example.org/person/123> <http://example.org/hasBirthYear> "1995"^^<http://www.w3.org/2001/XMLSchema#gYear> .
+<http://example.org/person/123> <http://example.org/hasItem> <http://example.org/person/123/item/sword> .
+<http://example.org/person/123> <http://example.org/hasItem> <http://example.org/person/123/item/shield> .
+<http://example.org/person/456> <http://example.org/hasBirthYear> "1999"^^<http://www.w3.org/2001/XMLSchema#gYear> .
+<http://example.org/person/456> <http://example.org/hasItem> <http://example.org/person/456/item/flower> .
+
+
+

28. RMLLVTC0006e

+

Title: Two Inner Joins

+

Description: Test two left joins in one logical view

+

Error expected? No

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "items": [
+        "sword",
+        "shield"
+      ]
+    },
+    {
+      "name": "bob",
+      "items": [
+        "flower"
+      ]
+    }
+  ]
+}
+
+

Input 1

+
name,birthyear
+alice,1995
+bob,1999
+tobias,2005
+
+

Input 2

+
name,id
+alice,123
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+  rml:viewOn :jsonSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+  ] ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "item" ;
+    rml:reference "$.items[*]" ;
+  ] .
+
+:additionalCsvSource a rml:LogicalSource ;
+  rml:source [
+   a rml:RelativePathSource , rml:Source ;
+   rml:root rml:MappingDirectory ;
+   rml:path "people2.csv" ;
+  ] ;
+  rml:referenceFormulation rml:CSV .
+
+:additionalCsvView a rml:LogicalView ;
+  rml:viewOn :additionalCsvSource ;
+    rml:field [
+     a rml:ExpressionField ;
+     rml:fieldName "name" ;
+     rml:reference "name" ;
+    ] ;
+    rml:field [
+     a rml:ExpressionField ;
+     rml:fieldName "id" ;
+     rml:reference "id" ;
+    ] ;
+.
+
+:csvSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.csv" ;
+  ] ;
+  rml:referenceFormulation rml:CSV .
+
+:csvView a rml:LogicalView ;
+  rml:viewOn :csvSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "name" ;
+  ] ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "birthyear" ;
+    rml:reference "birthyear" ;
+  ] ;
+  rml:innerJoin [
+    rml:parentLogicalView :jsonView ;
+    rml:joinCondition [
+      rml:parent "name" ;
+      rml:child "name" ;
+    ] ;
+    rml:field [
+      a rml:ExpressionField ;
+      rml:fieldName "json_item" ;
+      rml:reference "item" ;
+    ] ;
+  ] ;
+  rml:innerJoin [
+    rml:parentLogicalView :additionalCsvView ;
+    rml:joinCondition [
+      rml:parent "name" ;
+      rml:child "name" ;
+    ] ;
+    rml:field [
+      a rml:ExpressionField ;
+      rml:fieldName "csv2_id" ;
+      rml:reference "id" ;
+    ] ;
+  ] .
+
+
+:triplesMapPerson a rml:TriplesMap ;
+  rml:logicalSource :csvView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{csv2_id}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasBirthYear ;
+    rml:objectMap [
+      rml:reference "birthyear" ;
+      rml:datatype xsd:gYear ;
+    ] ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasItem ;
+    rml:objectMap [
+      rml:template "http://example.org/person/{csv2_id}/item/{json_item}" ;
+    ] ;
+  ] .
+
+

Output

+
<http://example.org/person/123> <http://example.org/hasBirthYear> "1995"^^<http://www.w3.org/2001/XMLSchema#gYear> .
+<http://example.org/person/123> <http://example.org/hasItem> <http://example.org/person/123/item/sword> .
+<http://example.org/person/123> <http://example.org/hasItem> <http://example.org/person/123/item/shield> .
+
+
+

29. RMLLVTC0006f

+

Title: Index Key of Field in Join

+

Description: Test references to indexes of fields from a join

+

Error expected? No

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "items": [
+        "sword",
+        "shield"
+      ]
+    },
+    {
+      "name": "bob",
+      "items": [
+        "flower"
+      ]
+    }
+  ]
+}
+
+

Input 1

+
name,birthyear
+alice,1995
+tobias,2005
+bob,1999
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+  rml:viewOn :jsonSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+  ] ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "item" ;
+    rml:reference "$.items[*]" ;
+  ] .
+
+:csvSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.csv" ;
+  ] ;
+  rml:referenceFormulation rml:CSV .
+
+:csvView a rml:LogicalView ;
+  rml:viewOn :csvSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "name" ;
+  ] ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "birthyear" ;
+    rml:reference "birthyear" ;
+  ] ;
+  rml:innerJoin [
+    rml:parentLogicalView :jsonView ;
+    rml:joinCondition [
+      rml:parent "name" ;
+      rml:child "name" ;
+    ] ;
+    rml:field [
+      a rml:ExpressionField ;
+      rml:fieldName "json_item" ;
+      rml:reference "item" ;
+    ] ;
+  ] .
+
+
+:triplesMapPerson a rml:TriplesMap ;
+  rml:logicalSource :csvView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{#}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasBirthYear ;
+    rml:objectMap [
+      rml:reference "birthyear" ;
+      rml:datatype xsd:gYear ;
+    ] ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasItem ;
+    rml:objectMap [
+      rml:template "http://example.org/person/{#}/item/{json_item.#}/{json_item}" ;
+    ] ;
+  ] .
+
+

Output

+
<http://example.org/person/0> <http://example.org/hasBirthYear> "1995"^^<http://www.w3.org/2001/XMLSchema#gYear> .
+<http://example.org/person/0> <http://example.org/hasItem> <http://example.org/person/0/item/0/sword> .
+<http://example.org/person/0> <http://example.org/hasItem> <http://example.org/person/0/item/1/shield> .
+<http://example.org/person/2> <http://example.org/hasBirthYear> "1999"^^<http://www.w3.org/2001/XMLSchema#gYear> .
+<http://example.org/person/2> <http://example.org/hasItem> <http://example.org/person/2/item/0/flower> .
+
+
+
+

30. RMLLVTC0007a

+

Title: Change Reference Formulations: CSV including JSON array

+

Description: Test a change of reference formulations: csv source including json array

+

Error expected? No

+

Input

+
name,items
+alice,"[{""type"":""sword"",""weight"":1500},{""type"":""shield"",""weight"":2500}]"
+bob,"[{""type"":""flower"",""weight"":15}]"
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+
+:mixedCSVSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.csv" ;
+  ] ;
+  rml:referenceFormulation rml:CSV .
+
+:mixedCSVView a rml:LogicalView ;
+  rml:viewOn :mixedCSVSource ;
+  rml:field [
+    a rml:ExpressionField;
+    rml:fieldName "name" ;
+    rml:reference "name" ;
+  ] ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "items" ;
+    rml:reference "items" ;
+    rml:field [
+      a rml:IterableField ;
+      rml:referenceFormulation rml:JSONPath ;
+      rml:iterator "$[*]" ;
+      rml:fieldName "item" ;
+      rml:field [
+        a rml:ExpressionField ;
+        rml:fieldName "type" ;
+        rml:reference "$.type" ;
+      ] ;
+      rml:field [
+        a rml:ExpressionField ;
+        rml:fieldName "weight" ;
+        rml:reference "$.weight" ;
+      ] ;
+    ] ;
+  ] .
+
+:triplesMapItem a rml:TriplesMap ;
+  rml:logicalSource :mixedCSVView ;
+  rml:subjectMap [
+    rml:template "http://example.org/item_{#}_{items.item.#}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasType ;
+    rml:objectMap [
+      rml:reference "items.item.type" ;
+    ] ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasWeight ;
+    rml:objectMap [
+      rml:reference "items.item.weight" ;
+      rml:datatype xsd:integer ;
+    ] ;
+  ] .
+
+

Output

+
<http://example.org/item_0_0> <http://example.org/hasType> "sword" .
+<http://example.org/item_0_0> <http://example.org/hasWeight> "1500"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.org/item_0_1> <http://example.org/hasType> "shield" .
+<http://example.org/item_0_1> <http://example.org/hasWeight> "2500"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.org/item_1_0> <http://example.org/hasType> "flower" .
+<http://example.org/item_1_0> <http://example.org/hasWeight> "15"^^<http://www.w3.org/2001/XMLSchema#integer> .
+
+
+

31. RMLLVTC0007b

+

Title: Change Reference Formulations: CSV including JSON object

+

Description: Test a change of reference formulations: csv source including json object

+

Error expected? No

+

Input

+
name,item
+alice,"{""type"":""sword"",""weight"":1500}"
+alice,"{""type"":""shield"",""weight"":2500}"
+bob,"{""type"":""flower"",""weight"":15}"
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+
+:mixedCSVSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.csv" ;
+  ] ;
+  rml:referenceFormulation rml:CSV .
+
+:mixedCSVView a rml:LogicalView ;
+  rml:viewOn :mixedCSVSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "name" ;
+  ] ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "item" ;
+    rml:reference "item" ;
+    rml:field [
+      a rml:IterableField ;
+      rml:referenceFormulation rml:JSONPath ;
+      rml:iterator "$" ;
+      rml:fieldName "itemJson" ;
+      rml:field [
+        a rml:ExpressionField;
+        rml:fieldName "type" ;
+        rml:reference "$.type" ; ] ;
+      rml:field [
+        a rml:ExpressionField;
+        rml:fieldName "weight" ;
+        rml:reference "$.weight" ;
+      ] ;
+    ] ;
+  ] .
+
+:triplesMapItem a rml:TriplesMap ;
+  rml:logicalSource :mixedCSVView ;
+  rml:subjectMap [
+    rml:template "http://example.org/item_{#}_{item.#}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasType ;
+    rml:objectMap [
+      rml:reference "item.itemJson.type" ;
+    ] ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasWeight ;
+    rml:objectMap [
+      rml:reference "item.itemJson.weight" ;
+      rml:datatype xsd:integer ;
+    ] ;
+  ] .
+
+

Output

+
<http://example.org/item_0_0> <http://example.org/hasType> "sword" .
+<http://example.org/item_0_0> <http://example.org/hasWeight> "1500"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.org/item_1_0> <http://example.org/hasType> "shield" .
+<http://example.org/item_1_0> <http://example.org/hasWeight> "2500"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.org/item_2_0> <http://example.org/hasType> "flower" .
+<http://example.org/item_2_0> <http://example.org/hasWeight> "15"^^<http://www.w3.org/2001/XMLSchema#integer> .
+
+
+

32. RMLLVTC0007c

+

Title: Change Reference Formulations: JSON including CSV

+

Description: Test a change of reference formulations: json source including csv data

+

Error expected? No

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "items": "type,weight\nsword,1500\nshield,2500"
+    },
+    {
+      "name": "bob",
+      "items": "type,weight\nflower,15"
+    }
+  ]
+}
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+
+:mixedJSONSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:mixedJSONView a rml:LogicalView ;
+  rml:viewOn :mixedJSONSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+    ] ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "items" ;
+    rml:reference "$.items" ;
+    rml:field [
+      a rml:IterableField ;
+      rml:referenceFormulation rml:CSV ;
+      rml:fieldName "item";
+      rml:field [
+        a rml:ExpressionField ;
+        rml:fieldName "type" ;
+        rml:reference "type" ;
+      ] ;
+      rml:field [
+        a rml:expressionField ;
+        rml:fieldName "weight" ;
+        rml:reference "weight" ;
+      ] ;
+    ] ;
+  ].
+
+:triplesMapItem a rml:TriplesMap ;
+  rml:logicalSource :mixedJSONView ;
+  rml:subjectMap [
+    rml:template "http://example.org/item_{#}_{items.item.#}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasType ;
+    rml:objectMap [
+      rml:reference "items.item.type" ;
+    ] ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasWeight ;
+    rml:objectMap [
+      rml:reference "items.item.weight" ;
+      rml:datatype xsd:integer ;
+    ] ;
+  ] .
+
+

Output

+
<http://example.org/item_0_0> <http://example.org/hasType> "sword" .
+<http://example.org/item_0_0> <http://example.org/hasWeight> "1500"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.org/item_0_1> <http://example.org/hasType> "shield" .
+<http://example.org/item_0_1> <http://example.org/hasWeight> "2500"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.org/item_1_0> <http://example.org/hasType> "flower" .
+<http://example.org/item_1_0> <http://example.org/hasWeight> "15"^^<http://www.w3.org/2001/XMLSchema#integer> .
+
+
+

33. RMLLVTC0008a

+

Title: Cycle: Abstract Logical Source

+

Description: Test a cycle in the abstract logical source of a logical view

+

Error expected? Yes

+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix : <http://example.org/> .
+
+:view1 a rml:LogicalView ;
+  rml:viewOn :view2 ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name1" ;
+    rml:reference "name2" ;
+  ] .
+
+:view2 a rml:LogicalView ;
+  rml:viewOn :view1 ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name2" ;
+    rml:reference "name1" ;
+  ] .
+
+:triplesMapPerson a rml:TriplesMap ;
+  rml:logicalSource :view2 ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{name2}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasName ;
+    rml:objectMap [
+      rml:reference "name2" ;
+    ] ;
+  ] .
+
+
+

34. RMLLVTC0008b

+

Title: Cycle: Joins

+

Description: Test a cycle in two joins of two logical views

+

Error expected? Yes

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "items": [
+        "sword",
+        "shield"
+      ]
+    },
+    {
+      "name": "bob",
+      "items": [
+        "flower"
+      ]
+    }
+  ]
+}
+
+

Input 1

+
name,birthyear
+alice,1995
+bob,1999
+tobias,2005
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+  rml:viewOn :jsonSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+  ] ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "item" ;
+    rml:reference "$.items[*]" ;
+  ] ;
+  rml:leftJoin [
+    rml:parentLogicalView :csvView ;
+    rml:joinCondition [
+      rml:parent "name" ;
+      rml:child "name" ;
+    ] ;
+    rml:field [
+      a rml:ExpressionField ;
+      rml:fieldName "csv_birthyear" ;
+      rml:reference "birthyear" ;
+    ] ;
+  ] .
+
+:csvSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.csv" ;
+  ] ;
+  rml:referenceFormulation rml:CSV .
+
+:csvView a rml:LogicalView ;
+  rml:viewOn :csvSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "name" ;
+  ] ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "birthyear" ;
+    rml:reference "birthyear" ;
+  ] ;
+  rml:leftJoin [
+    rml:parentLogicalView :jsonView ;
+    rml:joinCondition [
+      rml:parent "name" ;
+      rml:child "name" ;
+    ] ;
+    rml:field [
+      a rml:ExpressionField ;
+      rml:fieldName "json_item" ;
+      rml:reference "item" ;
+    ] ;
+  ] .
+
+
+:triplesMapPerson a rml:TriplesMap ;
+  rml:logicalSource :csvView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{name}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasBirthYear ;
+    rml:objectMap [
+      rml:reference "birthyear" ;
+      rml:datatype xsd:gYear ;
+    ] ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasItem ;
+    rml:objectMap [
+      rml:template "http://example.org/person/{name}/item/{json_item}" ;
+    ] ;
+  ] .
+
+
+

35. RMLLVTC0008c

+

Title: Cycle: Self-Join

+

Description: Test a cycle in a join of a logical view: self-join

+

Error expected? Yes

+

Input

+
{
+  "people": [
+    {
+      "name": "alice",
+      "items": [
+        {
+          "type": "sword",
+          "weight": 1500
+        },
+        {
+          "type": "shield",
+          "weight": 2500
+        }
+      ]
+    },
+    {
+      "name": "bob",
+      "items": [
+        {
+          "type": "flower",
+          "weight": 15
+        }
+      ]
+    }
+  ]
+}
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix : <http://example.org/> .
+
+:jsonSource a rml:LogicalSource ;
+  rml:source [
+    a rml:RelativePathSource , rml:Source ;
+    rml:root rml:MappingDirectory ;
+    rml:path "people.json" ;
+  ] ;
+  rml:referenceFormulation rml:JSONPath ;
+  rml:iterator "$.people[*]" .
+
+:jsonView a rml:LogicalView ;
+  rml:viewOn :jsonSource ;
+  rml:field [
+    a rml:ExpressionField ;
+    rml:fieldName "name" ;
+    rml:reference "$.name" ;
+  ] ;
+  rml:leftJoin [
+    rml:parentLogicalView :jsonView ;
+    rml:joinCondition [
+      rml:parent "name" ;
+      rml:child "name" ;
+    ] ;
+    rml:field [
+      a rml:ExpressionField ;
+      rml:fieldName "newName" ;
+      rml:reference "name" ;
+    ] ;
+  ] .
+
+:triplesMapPerson a rml:TriplesMap ;
+  rml:logicalSource :jsonView ;
+  rml:subjectMap [
+    rml:template "http://example.org/person/{newName}" ;
+  ] ;
+  rml:predicateObjectMap [
+    rml:predicate :hasName ;
+    rml:objectMap [
+      rml:reference "newName" ;
+    ] ;
+  ] .
+
+
+ + + + + + \ No newline at end of file diff --git a/src/test/resources/rml-lv/list.sh b/src/test/resources/rml-lv/list.sh new file mode 100755 index 00000000..12c32031 --- /dev/null +++ b/src/test/resources/rml-lv/list.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +for i in RML*; do + echo "
" +done diff --git a/src/test/resources/rml-lv/make-metadata.py b/src/test/resources/rml-lv/make-metadata.py new file mode 100755 index 00000000..2be2cb80 --- /dev/null +++ b/src/test/resources/rml-lv/make-metadata.py @@ -0,0 +1,148 @@ +#!/usr/bin/env python3 + +import os +import sys +import glob +import csv + +def get_title_description(testcase: str): + with open ('descriptions.csv') as csvfile: + reader = csv.reader(csvfile) + for row in reader: + if row[0] == testcase: + return row[1], row[2] + +def main(spec: str): + with open ('metadata.csv', 'w', newline='') as csvfile: + writer = csv.writer(csvfile) + writer.writerow(['ID', 'title', 'description', 'specification', + 'mapping', 'input_format1', 'input_format2', + 'input_format3', 'output_format1', 'output_format2', + 'output_format3', 'input1', 'input2', 'input3', + 'output1', 'output2', 'output3', 'error']) + for testcase in glob.glob('RML*'): + print(testcase) + title, description = get_title_description(testcase) + error = 'false' + input1 = '' + input2 = '' + input3 = '' + input_format1 = '' + input_format2 = '' + input_format3 = '' + output1 = '' + output2 = '' + output3 = '' + output_format1 = '' + output_format2 = '' + output_format3 = '' + + # Input file + if os.path.exists(os.path.join(testcase, 'people.json')): + input1 = 'people.json' + input_format1 = 'application/json' + + if os.path.exists(os.path.join(testcase, 'people.csv')): + if input1 == '': + input1 = 'people.csv' + input_format1 = 'text/csv' + else: + input2 = 'people.csv' + input_format2 = 'text/csv' + + if os.path.exists(os.path.join(testcase, 'people2.csv')): + input3 = 'people2.csv' + input_format3 = 'text/csv' + + # Mapping file + if os.path.exists(os.path.join(testcase, 'mapping.ttl')): + mapping_file = 'mapping.ttl' + else: + raise ValueError('Mapping file missing!') + + # Output files + if os.path.exists(os.path.join(testcase, 'output.nq')): + output1 = 'output.nq' + output_format1 = 'application/n-quads' + else: + error = 'true' + + writer.writerow([testcase, title, description, spec, mapping_file, + input_format1, input_format2, input_format3, + output_format1, output_format2, output_format3, + input1, input2, input3, output1, output2, + output3, error]) + lines = [] + # Title and description + lines.append(f'## {testcase}\n\n') + lines.append(f'**Title**: {title}\n\n') + lines.append(f'**Description**: {description}\n\n') + if error == 'true': + error_html = 'Yes' + else: + error_html = 'No' + lines.append(f'**Error expected?** {error_html}\n\n') + + # Input + inputCount = '' + + for index, i in enumerate([input1, input2, input3]): + if not i: + break + + if 'http://w3id.org/rml/resources' in i: + input_html = f'**Input{inputCount}**\n [{i}]({i})\n\n' + else: + try: + with open(os.path.join(testcase, i)) as f: + input_html = f'**Input{inputCount}**\n```\n{f.read()}\n```\n\n' + except UnicodeDecodeError: + try: + with open(os.path.join(testcase, i), encoding='utf-16') as f: + input_html = f'**Input{inputCount}**\n```\n{f.read()}\n```\n\n' + except UnicodeDecodeError: + input_html = f'**Input{inputCount}**\n `{i}`\n\n' + + lines.append(input_html) + inputCount = f' {index + 1}' + + # Mapping + with open(os.path.join(testcase, mapping_file)) as f: + mapping_html = f'**Mapping**\n```\n{f.read()}\n```\n\n' + lines.append(mapping_html) + + # Output + outputCount = '' + if output2 or output3: + outputCount = ' 1' + + for index, i in enumerate([output1, output2, output3]): + if not i: + break + + if 'http://w3id.org/rml/resources' in i: + output_html = f'**Output{outputCount}**\n [{i}]({i})\n\n' + else: + try: + with open(os.path.join(testcase, i)) as f: + output_html = f'**Output{outputCount}**\n```\n{f.read()}\n```\n\n' + except UnicodeDecodeError: + try: + with open(os.path.join(testcase, i), encoding='utf-16') as f: + output_html = f'**Output{outputCount}**\n```\n{f.read()}\n```\n\n' + except UnicodeDecodeError: + output_html = f'**Output{outputCount}**\n `{i}`\n\n' + + lines.append(output_html) + outputCount = f' {index + 2}' + + + with open(os.path.join(testcase, 'README.md'), 'w') as f: + f.writelines(lines) + + +if __name__ == '__main__': + if len(sys.argv) != 2: + print('Usage: ./make-metadata.py ') + sys.exit(1) + main(sys.argv[1]) diff --git a/src/test/resources/rml-lv/manifest.rml.ttl b/src/test/resources/rml-lv/manifest.rml.ttl new file mode 100644 index 00000000..7e92bc26 --- /dev/null +++ b/src/test/resources/rml-lv/manifest.rml.ttl @@ -0,0 +1,267 @@ +@prefix xsd: . +@prefix dcterms: . +@prefix rml: . +@prefix rmltest: . +@prefix test: . +@base . + +# java -jar .\burp.jar -m manifest.rml.ttl -o manifest.ttl -b http://w3id.org/rml/lv/test/ + +_:source + rml:source [ + a rml:RelativePathSource ; + rml:path "metadata.csv" ; + rml:null ""; + ]; + rml:referenceFormulation rml:CSV; +. + +<#TriplesMapTestcase> + a rml:TriplesMap; + + rml:logicalSource _:source; + + rml:subjectMap [ + rml:reference "ID"; + rml:class test:TestCase; + ]; + + rml:predicateObjectMap [ + rml:predicate dcterms:identifier; + rml:objectMap [ + rml:reference "ID"; + ]; + ]; + + rml:predicateObjectMap [ + rml:predicate rmltest:hasError; + rml:objectMap [ + rml:reference "error"; + rml:datatype xsd:boolean; + ]; + ]; + + rml:predicateObjectMap [ + rml:predicate rmltest:mappingDocument; + rml:objectMap [ + rml:reference "mapping"; + ]; + ]; + + rml:predicateObjectMap [ + rml:predicate rmltest:input; + rml:objectMap [ a rml:RefObjectMap; + rml:parentTriplesMap <#TriplesMapInput1>; + rml:joinCondition [ + rml:child "ID"; + rml:parent "ID"; + ]; + ]; + ]; + + rml:predicateObjectMap [ + rml:predicate rmltest:input; + rml:objectMap [ a rml:RefObjectMap; + rml:parentTriplesMap <#TriplesMapInput2>; + rml:joinCondition [ + rml:child "ID"; + rml:parent "ID"; + ]; + ]; + ]; + + rml:predicateObjectMap [ + rml:predicate rmltest:input; + rml:objectMap [ a rml:RefObjectMap; + rml:parentTriplesMap <#TriplesMapInput3>; + rml:joinCondition [ + rml:child "ID"; + rml:parent "ID"; + ]; + ]; + ]; + + rml:predicateObjectMap [ + rml:predicate rmltest:output; + rml:objectMap [ a rml:RefObjectMap; + rml:parentTriplesMap <#TriplesMapOutput1>; + rml:joinCondition [ + rml:child "ID"; + rml:parent "ID"; + ]; + ]; + ]; + + rml:predicateObjectMap [ + rml:predicate rmltest:output; + rml:objectMap [ a rml:RefObjectMap; + rml:parentTriplesMap <#TriplesMapOutput2>; + rml:joinCondition [ + rml:child "ID"; + rml:parent "ID"; + ]; + ]; + ]; + + rml:predicateObjectMap [ + rml:predicate rmltest:output; + rml:objectMap [ a rml:RefObjectMap; + rml:parentTriplesMap <#TriplesMapOutput3>; + rml:joinCondition [ + rml:child "ID"; + rml:parent "ID"; + ]; + ]; + ]; +. + +<#TriplesMapInput1> + a rml:TriplesMap; + + rml:logicalSource _:source ; + + rml:subjectMap [ + rml:template "{ID}/input/{input1}"; + rml:class rmltest:Input; + ]; + + rml:predicateObjectMap [ + rml:predicate rmltest:input; + rml:objectMap [ + rml:reference "input1"; + ]; + ]; + + rml:predicateObjectMap [ + rml:predicate rmltest:inputFormat; + rml:objectMap [ + rml:reference "input_format1"; + ]; + ]; +. + +<#TriplesMapInput2> + a rml:TriplesMap; + + rml:logicalSource _:source; + + rml:subjectMap [ + rml:template "{ID}/input/{input2}"; + rml:class rmltest:Input; + ]; + + rml:predicateObjectMap [ + rml:predicate rmltest:input; + rml:objectMap [ + rml:reference "input2"; + ]; + ]; + + rml:predicateObjectMap [ + rml:predicate rmltest:inputFormat; + rml:objectMap [ + rml:reference "input_format2"; + ]; + ]; +. + +<#TriplesMapInput3> + a rml:TriplesMap; + + rml:logicalSource _:source; + + rml:subjectMap [ + rml:template "{ID}/input/{input3}"; + rml:class rmltest:Input; + ]; + + rml:predicateObjectMap [ + rml:predicate rmltest:input; + rml:objectMap [ + rml:reference "input3"; + ]; + ]; + + rml:predicateObjectMap [ + rml:predicate rmltest:inputFormat; + rml:objectMap [ + rml:reference "input_format3"; + ]; + ]; +. + +<#TriplesMapOutput1> + a rml:TriplesMap; + + rml:logicalSource _:source; + + rml:subjectMap [ + rml:template "{ID}/output/{output1}"; + rml:class rmltest:Output; + ]; + + rml:predicateObjectMap [ + rml:predicate rmltest:output; + rml:objectMap [ + rml:reference "output1"; + ]; + ]; + + rml:predicateObjectMap [ + rml:predicate rmltest:outputFormat; + rml:objectMap [ + rml:reference "output_format1"; + ]; + ]; +. + +<#TriplesMapOutput2> + a rml:TriplesMap; + + rml:logicalSource _:source; + + rml:subjectMap [ + rml:template "{ID}/output/{output2}"; + rml:class rmltest:Output; + ]; + + rml:predicateObjectMap [ + rml:predicate rmltest:output; + rml:objectMap [ + rml:reference "output2"; + ]; + ]; + + rml:predicateObjectMap [ + rml:predicate rmltest:outputFormat; + rml:objectMap [ + rml:reference "output_format2"; + ]; + ]; +. + +<#TriplesMapOutput3> + a rml:TriplesMap; + + rml:logicalSource _:source; + + rml:subjectMap [ + rml:template "{ID}/output/{output3}"; + rml:class rmltest:Output; + ]; + + rml:predicateObjectMap [ + rml:predicate rmltest:output; + rml:objectMap [ + rml:reference "output3"; + ]; + ]; + + rml:predicateObjectMap [ + rml:predicate rmltest:outputFormat; + rml:objectMap [ + rml:reference "output_format3"; + ]; + ]; +. + diff --git a/src/test/resources/rml-lv/manifest.ttl b/src/test/resources/rml-lv/manifest.ttl new file mode 100644 index 00000000..3d36a935 --- /dev/null +++ b/src/test/resources/rml-lv/manifest.ttl @@ -0,0 +1,396 @@ + "people.csv" . + "text/csv" . + . + "people.json" . + "application/json" . + . + "people.json" . + "application/json" . + . + "true"^^ . + "RMLLVTC0008c" . + "mapping.ttl" . + . + . + "false"^^ . + "RMLLVTC0001d" . + . + "mapping.ttl" . + . + . + "false"^^ . + "RMLLVTC0004b" . + . + "mapping.ttl" . + . + . + "false"^^ . + "RMLLVTC0000a" . + . + "mapping.ttl" . + . + . + "output.nq" . + "application/n-quads" . + . + "output.nq" . + "application/n-quads" . + . + "people.json" . + "application/json" . + . + "people.json" . + "application/json" . + . + "people.json" . + "application/json" . + . + "output.nq" . + "application/n-quads" . + . + "false"^^ . + "RMLLVTC0006c" . + . + . + "mapping.ttl" . + . + . + . + "people.csv" . + "text/csv" . + . + "output.nq" . + "application/n-quads" . + . + "false"^^ . + "RMLLVTC0002b" . + . + "mapping.ttl" . + . + . + "people.json" . + "application/json" . + . + "people.json" . + "application/json" . + . + "output.nq" . + "application/n-quads" . + . + "false"^^ . + "RMLLVTC0004c" . + . + "mapping.ttl" . + . + . + "people.csv" . + "text/csv" . + . + "false"^^ . + "RMLLVTC0007a" . + . + "mapping.ttl" . + . + . + "false"^^ . + "RMLLVTC0000b" . + . + "mapping.ttl" . + . + . + "people.json" . + "application/json" . + . + "people2.csv" . + "text/csv" . + . + "output.nq" . + "application/n-quads" . + . + "people.json" . + "application/json" . + . + "people.json" . + "application/json" . + . + "output.nq" . + "application/n-quads" . + . + "false"^^ . + "RMLLVTC0006d" . + . + . + "mapping.ttl" . + . + . + . + "output.nq" . + "application/n-quads" . + . + "false"^^ . + "RMLLVTC0002c" . + . + "mapping.ttl" . + . + . + "true"^^ . + "RMLLVTC0005a" . + "mapping.ttl" . + . + . + "people.json" . + "application/json" . + . + "output.nq" . + "application/n-quads" . + . + "output.nq" . + "application/n-quads" . + . + "people.json" . + "application/json" . + . + "false"^^ . + "RMLLVTC0004d" . + . + "mapping.ttl" . + . + . + "false"^^ . + "RMLLVTC0007b" . + . + "mapping.ttl" . + . + . + "output.nq" . + "application/n-quads" . + . + "false"^^ . + "RMLLVTC0000c" . + . + "mapping.ttl" . + . + . + "false"^^ . + "RMLLVTC0003a" . + . + "mapping.ttl" . + . + . + "output.nq" . + "application/n-quads" . + . + "people.json" . + "application/json" . + . + "people.json" . + "application/json" . + . + "people.json" . + "application/json" . + . + "false"^^ . + "RMLLVTC0006e" . + . + . + "mapping.ttl" . + . + . + . + "output.nq" . + "application/n-quads" . + . + "people.csv" . + "text/csv" . + . + "true"^^ . + "RMLLVTC0005b" . + "mapping.ttl" . + . + . + "people.json" . + "application/json" . + . + "false"^^ . + "RMLLVTC0001a" . + . + "mapping.ttl" . + . + . + "false"^^ . + "RMLLVTC0007c" . + . + "mapping.ttl" . + . + . + "output.nq" . + "application/n-quads" . + . + "people.json" . + "application/json" . + . + "people.json" . + "application/json" . + . + "people.csv" . + "text/csv" . + . + "false"^^ . + "RMLLVTC0003b" . + . + "mapping.ttl" . + . + . + "output.nq" . + "application/n-quads" . + . + "output.nq" . + "application/n-quads" . + . + "people2.csv" . + "text/csv" . + . + "people.json" . + "application/json" . + . + "false"^^ . + "RMLLVTC0006f" . + . + "mapping.ttl" . + . + . + . + "people.csv" . + "text/csv" . + . + "people.json" . + "application/json" . + . + "people.json" . + "application/json" . + . + "true"^^ . + "RMLLVTC0005c" . + "mapping.ttl" . + . + . + "true"^^ . + "RMLLVTC0008a" . + "mapping.ttl" . + . + "false"^^ . + "RMLLVTC0001b" . + . + "mapping.ttl" . + . + . + "output.nq" . + "application/n-quads" . + . + "people.json" . + "application/json" . + . + "output.nq" . + "application/n-quads" . + . + "output.nq" . + "application/n-quads" . + . + "people.json" . + "application/json" . + . + "people.csv" . + "text/csv" . + . + "people.json" . + "application/json" . + . + "false"^^ . + "RMLLVTC0003c" . + . + "mapping.ttl" . + . + . + "false"^^ . + "RMLLVTC0006a" . + . + "mapping.ttl" . + . + . + . + "output.nq" . + "application/n-quads" . + . + "people2.csv" . + "text/csv" . + . + "people.csv" . + "text/csv" . + . + "people.json" . + "application/json" . + . + "people.json" . + "application/json" . + . + "true"^^ . + "RMLLVTC0008b" . + "mapping.ttl" . + . + . + . + "people.csv" . + "text/csv" . + . + "false"^^ . + "RMLLVTC0001c" . + . + "mapping.ttl" . + . + . + "false"^^ . + "RMLLVTC0004a" . + . + "mapping.ttl" . + . + . + "output.nq" . + "application/n-quads" . + . + "people.csv" . + "text/csv" . + . + "output.nq" . + "application/n-quads" . + . + "output.nq" . + "application/n-quads" . + . + "people.json" . + "application/json" . + . + "people.json" . + "application/json" . + . + "output.nq" . + "application/n-quads" . + . + "false"^^ . + "RMLLVTC0006b" . + . + "mapping.ttl" . + . + . + . + "false"^^ . + "RMLLVTC0002a" . + . + "mapping.ttl" . + . + . + "output.nq" . + "application/n-quads" . + . + "output.nq" . + "application/n-quads" . + . diff --git a/src/test/resources/rml-lv/metadata.csv b/src/test/resources/rml-lv/metadata.csv new file mode 100644 index 00000000..bff25c5c --- /dev/null +++ b/src/test/resources/rml-lv/metadata.csv @@ -0,0 +1,33 @@ +ID,title,description,specification,mapping,input_format1,input_format2,input_format3,output_format1,output_format2,output_format3,input1,input2,input3,output1,output2,output3,error +RMLLVTC0000a,Logical view on JSON source,Test a view on a hierarchical source,http://w3id.org/rml/lv/,mapping.ttl,application/json,,,application/n-quads,,,people.json,,,output.nq,,,false +RMLLVTC0000b,Logical view on CSV source,Test a view on a tabular source,http://w3id.org/rml/lv/,mapping.ttl,text/csv,,,application/n-quads,,,people.csv,,,output.nq,,,false +RMLLVTC0000c,Logical View on Logical View,Test a view on a logical view,http://w3id.org/rml/lv/,mapping.ttl,application/json,,,application/n-quads,,,people.json,,,output.nq,,,false +RMLLVTC0001a,Expression Field: Reference,Test a reference in an expression field,http://w3id.org/rml/lv/,mapping.ttl,application/json,,,application/n-quads,,,people.json,,,output.nq,,,false +RMLLVTC0001b,Expression Field: Template,Test a template in an expression field,http://w3id.org/rml/lv/,mapping.ttl,application/json,,,application/n-quads,,,people.json,,,output.nq,,,false +RMLLVTC0001c,Expression Field: Constant,Test a constant expression in an expression field,http://w3id.org/rml/lv/,mapping.ttl,application/json,,,application/n-quads,,,people.json,,,output.nq,,,false +RMLLVTC0001d,Expression Field Siblings,Test multiple expression fields with the same parent,http://w3id.org/rml/lv/,mapping.ttl,application/json,,,application/n-quads,,,people.json,,,output.nq,,,false +RMLLVTC0002a,Iterable Field,Test a nested field construction: iterable field with expression field as child,http://w3id.org/rml/lv/,mapping.ttl,application/json,,,application/n-quads,,,people.json,,,output.nq,,,false +RMLLVTC0002b,Iterable Field with Multiple Children,Test a nested field construction: iterable field with mulitple expression fields as children,http://w3id.org/rml/lv/,mapping.ttl,application/json,,,application/n-quads,,,people.json,,,output.nq,,,false +RMLLVTC0002c,Nested Iterable Fields,Test a nested field construction: iterable field with an iterable field as child,http://w3id.org/rml/lv/,mapping.ttl,application/json,,,application/n-quads,,,people.json,,,output.nq,,,false +RMLLVTC0003a,Index Key: #,Test a reference to the index key #,http://w3id.org/rml/lv/,mapping.ttl,application/json,,,application/n-quads,,,people.json,,,output.nq,,,false +RMLLVTC0003b,Index Key: Iterable Field,Test a reference to the index key of an iterable field,http://w3id.org/rml/lv/,mapping.ttl,application/json,,,application/n-quads,,,people.json,,,output.nq,,,false +RMLLVTC0003c,Index Key: Expression field,Test a reference to the index key of an expression field,http://w3id.org/rml/lv/,mapping.ttl,application/json,,,application/n-quads,,,people.json,,,output.nq,,,false +RMLLVTC0004a,Natural Datatype: Index #,Test the natural datatype mapping for the index #,http://w3id.org/rml/lv/,mapping.ttl,application/json,,,application/n-quads,,,people.json,,,output.nq,,,false +RMLLVTC0004b,Natural Datatype: Index Expression Field,Test the natural datatype mapping for the index of an expression field,http://w3id.org/rml/lv/,mapping.ttl,application/json,,,application/n-quads,,,people.json,,,output.nq,,,false +RMLLVTC0004c,Natural Datatype: Index Iterable Field,Test the natural datatype mapping for the index of an iterable field,http://w3id.org/rml/lv/,mapping.ttl,application/json,,,application/n-quads,,,people.json,,,output.nq,,,false +RMLLVTC0004d,Natural Datatype: Record Expression Field,Test the natural datatype mapping for a record of an expression field,http://w3id.org/rml/lv/,mapping.ttl,application/json,,,application/n-quads,,,people.json,,,output.nq,,,false +RMLLVTC0005a,Referencing a Non-Existing Key,Test a reference to a non-existing key,http://w3id.org/rml/lv/,mapping.ttl,application/json,,,,,,people.json,,,,,,true +RMLLVTC0005b,Referencing the Record Key ,Test a reference to the record key ,http://w3id.org/rml/lv/,mapping.ttl,application/json,,,,,,people.json,,,,,,true +RMLLVTC0005c,Referencing the Record Key of an Iterable Field,Test a reference to the record key of an iterable field,http://w3id.org/rml/lv/,mapping.ttl,application/json,,,,,,people.json,,,,,,true +RMLLVTC0006a,Left Join,Test a left join,http://w3id.org/rml/lv/,mapping.ttl,application/json,text/csv,,application/n-quads,,,people.json,people.csv,,output.nq,,,false +RMLLVTC0006b,Inner Join,Test an inner join,http://w3id.org/rml/lv/,mapping.ttl,application/json,text/csv,,application/n-quads,,,people.json,people.csv,,output.nq,,,false +RMLLVTC0006c,Two Left Joins,Test two left joins in one logical view,http://w3id.org/rml/lv/,mapping.ttl,application/json,text/csv,text/csv,application/n-quads,,,people.json,people.csv,people2.csv,output.nq,,,false +RMLLVTC0006d,Inner Join and Left Join,Test an inner join and a left join in one logical view,http://w3id.org/rml/lv/,mapping.ttl,application/json,text/csv,text/csv,application/n-quads,,,people.json,people.csv,people2.csv,output.nq,,,false +RMLLVTC0006e,Two Inner Joins,Test two left joins in one logical view,http://w3id.org/rml/lv/,mapping.ttl,application/json,text/csv,text/csv,application/n-quads,,,people.json,people.csv,people2.csv,output.nq,,,false +RMLLVTC0006f,Index Key of Field in Join,Test references to indexes of fields from a join,http://w3id.org/rml/lv/,mapping.ttl,application/json,text/csv,,application/n-quads,,,people.json,people.csv,,output.nq,,,false +RMLLVTC0007a,Change Reference Formulations: CSV including JSON array,Test a change of reference formulations: csv source including json array,http://w3id.org/rml/lv/,mapping.ttl,text/csv,,,application/n-quads,,,people.csv,,,output.nq,,,false +RMLLVTC0007b,Change Reference Formulations: CSV including JSON object,Test a change of reference formulations: csv source including json object,http://w3id.org/rml/lv/,mapping.ttl,text/csv,,,application/n-quads,,,people.csv,,,output.nq,,,false +RMLLVTC0007c,Change Reference Formulations: JSON including CSV,Test a change of reference formulations: json source including csv data,http://w3id.org/rml/lv/,mapping.ttl,application/json,,,application/n-quads,,,people.json,,,output.nq,,,false +RMLLVTC0008a,Cycle: Abstract Logical Source,Test a cycle in the abstract logical source of a logical view,http://w3id.org/rml/lv/,mapping.ttl,,,,,,,,,,,,,true +RMLLVTC0008b,Cycle: Joins,Test a cycle in two joins of two logical views,http://w3id.org/rml/lv/,mapping.ttl,application/json,text/csv,,,,,people.json,people.csv,,,,,true +RMLLVTC0008c,Cycle: Self-Join,Test a cycle in a join of a logical view: self-join,http://w3id.org/rml/lv/,mapping.ttl,application/json,,,,,,people.json,,,,,,true diff --git a/src/test/resources/rml-lv/section/abstract.md b/src/test/resources/rml-lv/section/abstract.md new file mode 100644 index 00000000..97a2cd6c --- /dev/null +++ b/src/test/resources/rml-lv/section/abstract.md @@ -0,0 +1 @@ +This document defines the RML-LV test cases to the determine the RML-LV specification conformance of tools. diff --git a/src/test/resources/rml-lv/section/data-model.md b/src/test/resources/rml-lv/section/data-model.md new file mode 100644 index 00000000..f4c3ad6a --- /dev/null +++ b/src/test/resources/rml-lv/section/data-model.md @@ -0,0 +1,12 @@ +# Data model + +The test cases are semantically described for re-usability and shareability following the [W3C Test case description](https://www.w3.org/2006/03/test-description). +Each `test:Testcase` as the following properties: + +- `dcterms:identifier`: unique ID of the test case. +- `rmltest:hasError`: if an error of the RML Processor is expected or not. +- `rmltest:input`: One or more input data of the test case. +- `rmltest:output`: One or more output data of the test case. +- `rmltest:inputFormat`: the input data format. +- `rmltest:outputFormat`: the output data format. +- `rmltest:mappingDocument`: the RML mapping rules in Turtle. diff --git a/src/test/resources/rml-lv/section/introduction.md b/src/test/resources/rml-lv/section/introduction.md new file mode 100644 index 00000000..f19d17bd --- /dev/null +++ b/src/test/resources/rml-lv/section/introduction.md @@ -0,0 +1,4 @@ +# Introduction + +This document defines the RML-LV test cases, consisting of a collection of test case documents (input and expected output). +The purpose of the test cases is to determine the conformance of tools that execute RML rules to the RML-LV specification. diff --git a/src/test/resources/rml-lv/section/test-cases.md b/src/test/resources/rml-lv/section/test-cases.md new file mode 100644 index 00000000..4efe6d74 --- /dev/null +++ b/src/test/resources/rml-lv/section/test-cases.md @@ -0,0 +1,10 @@ +# Test cases + +This section describes the RML-LV test cases. These descriptions are also available as RDF. +The files are available on [GitHub](https://github.com/kg-construct/rml-lv/tree/main/test-cases) in the folder `test-cases`. +Each test case is contained in a single folder, containing three types of files: + + - Zero or more files containing the data sources, in the case of JSON, XML, CSV, or containing the SQL statements to create the necessary tables, in the case of MySQL, PostgreSQL, and SQL Server. + - One file with the RML rules, called `mapping.ttl`, in the Turtle format. + - Zero or more files with the expected RDF. No file is provided if an error is expected that must halt the generation of the RDF because of an error. + diff --git a/src/test/resources/rml-star/RMLSTARTC001a/README.md b/src/test/resources/rml-star/RMLSTARTC001a/README.md new file mode 100644 index 00000000..29c5d463 --- /dev/null +++ b/src/test/resources/rml-star/RMLSTARTC001a/README.md @@ -0,0 +1,67 @@ +## RMLSTARTC001a + +**Title**: quoted triple in subject, one source, blank node in quoted subject + +**Description**: Tests the creation of a asserted quoted triple (with a blank node as subject) in the position of subject with data from one file + +**Error expected?** No + +**Input** +``` +c1,c2,c3 +b0,o,ABC + +``` + +**Mapping** +``` +@prefix rdf: . +@prefix rml: . +@prefix ex: . +@prefix : . +@base . + +:firstTM a rml:AssertedTriplesMap ; + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:reference "c1" ; + rml:termType rml:BlankNode + ]; + rml:predicateObjectMap [ + rml:predicate ex:p ; + rml:objectMap [ + rml:template "http://example/{c2}" + ] + ] . + +:secondTM a rml:AssertedTriplesMap ; + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:quotedTriplesMap :firstTM + ]; + rml:predicateObjectMap [ + rml:predicate ex:q ; + rml:objectMap [ + rml:reference "c3" + ] + ] . + +``` + +**Output** +``` +_:b0 . +<< _:b0 >> "ABC" . + +``` + diff --git a/src/test/resources/rml-star/RMLSTARTC001a/data.csv b/src/test/resources/rml-star/RMLSTARTC001a/data.csv new file mode 100644 index 00000000..53b4c429 --- /dev/null +++ b/src/test/resources/rml-star/RMLSTARTC001a/data.csv @@ -0,0 +1,2 @@ +c1,c2,c3 +b0,o,ABC diff --git a/src/test/resources/rml-star/RMLSTARTC001a/mapping.ttl b/src/test/resources/rml-star/RMLSTARTC001a/mapping.ttl new file mode 100644 index 00000000..63ec2335 --- /dev/null +++ b/src/test/resources/rml-star/RMLSTARTC001a/mapping.ttl @@ -0,0 +1,40 @@ +@prefix rdf: . +@prefix rml: . +@prefix ex: . +@prefix : . +@base . + +:firstTM a rml:AssertedTriplesMap ; + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:reference "c1" ; + rml:termType rml:BlankNode + ]; + rml:predicateObjectMap [ + rml:predicate ex:p ; + rml:objectMap [ + rml:template "http://example/{c2}" + ] + ] . + +:secondTM a rml:AssertedTriplesMap ; + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:quotedTriplesMap :firstTM + ]; + rml:predicateObjectMap [ + rml:predicate ex:q ; + rml:objectMap [ + rml:reference "c3" + ] + ] . diff --git a/src/test/resources/rml-star/RMLSTARTC001a/output.nt b/src/test/resources/rml-star/RMLSTARTC001a/output.nt new file mode 100644 index 00000000..2d94448c --- /dev/null +++ b/src/test/resources/rml-star/RMLSTARTC001a/output.nt @@ -0,0 +1,2 @@ +_:b0 . +<< _:b0 >> "ABC" . diff --git a/src/test/resources/rml-star/RMLSTARTC001b/README.md b/src/test/resources/rml-star/RMLSTARTC001b/README.md new file mode 100644 index 00000000..2741ea39 --- /dev/null +++ b/src/test/resources/rml-star/RMLSTARTC001b/README.md @@ -0,0 +1,79 @@ +## RMLSTARTC001b + +**Title**: quoted triple in subject, two sources, blank node in quoted subject + +**Description**: Tests the creation of a asserted quoted triple (with a blank node as subject) in the position of subject with data from two files + +**Error expected?** No + +**Input** +``` +c1-1,c1-2,c1-3 +b0,o,1 + +``` + +**Input 1** +``` +**Input 1** +c2-1,c2-2 +ABC,1 + +``` + +**Mapping** +``` +@prefix rdf: . +@prefix rml: . +@prefix ex: . +@prefix : . +@base . + +:firstTM a rml:AssertedTriplesMap ; + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data1.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:reference "c1-1" ; + rml:termType rml:BlankNode + ]; + rml:predicateObjectMap [ + rml:predicate ex:p ; + rml:objectMap [ + rml:template "http://example/{c1-2}" + ] + ] . + +:secondTM a rml:AssertedTriplesMap ; + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data2.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:quotedTriplesMap :firstTM ; + rml:joinCondition [ + rml:child "c2-2" ; + rml:parent "c1-3" ; + ]; + ]; + rml:predicateObjectMap [ + rml:predicate ex:q ; + rml:objectMap [ + rml:reference "c2-1" + ] + ] . + +``` + +**Output** +``` +_:b0 . +<< _:b0 >> "ABC" . + +``` + diff --git a/src/test/resources/rml-star/RMLSTARTC001b/data1.csv b/src/test/resources/rml-star/RMLSTARTC001b/data1.csv new file mode 100644 index 00000000..f6cfd6e0 --- /dev/null +++ b/src/test/resources/rml-star/RMLSTARTC001b/data1.csv @@ -0,0 +1,2 @@ +c1-1,c1-2,c1-3 +b0,o,1 diff --git a/src/test/resources/rml-star/RMLSTARTC001b/data2.csv b/src/test/resources/rml-star/RMLSTARTC001b/data2.csv new file mode 100644 index 00000000..7de02b72 --- /dev/null +++ b/src/test/resources/rml-star/RMLSTARTC001b/data2.csv @@ -0,0 +1,3 @@ +**Input 1** +c2-1,c2-2 +ABC,1 diff --git a/src/test/resources/rml-star/RMLSTARTC001b/mapping.ttl b/src/test/resources/rml-star/RMLSTARTC001b/mapping.ttl new file mode 100644 index 00000000..e9826ef3 --- /dev/null +++ b/src/test/resources/rml-star/RMLSTARTC001b/mapping.ttl @@ -0,0 +1,44 @@ +@prefix rdf: . +@prefix rml: . +@prefix ex: . +@prefix : . +@base . + +:firstTM a rml:AssertedTriplesMap ; + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data1.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:reference "c1-1" ; + rml:termType rml:BlankNode + ]; + rml:predicateObjectMap [ + rml:predicate ex:p ; + rml:objectMap [ + rml:template "http://example/{c1-2}" + ] + ] . + +:secondTM a rml:AssertedTriplesMap ; + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data2.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:quotedTriplesMap :firstTM ; + rml:joinCondition [ + rml:child "c2-2" ; + rml:parent "c1-3" ; + ]; + ]; + rml:predicateObjectMap [ + rml:predicate ex:q ; + rml:objectMap [ + rml:reference "c2-1" + ] + ] . diff --git a/src/test/resources/rml-star/RMLSTARTC001b/output.nt b/src/test/resources/rml-star/RMLSTARTC001b/output.nt new file mode 100644 index 00000000..2d94448c --- /dev/null +++ b/src/test/resources/rml-star/RMLSTARTC001b/output.nt @@ -0,0 +1,2 @@ +_:b0 . +<< _:b0 >> "ABC" . diff --git a/src/test/resources/rml-star/RMLSTARTC002a/README.md b/src/test/resources/rml-star/RMLSTARTC002a/README.md new file mode 100644 index 00000000..34a26c8f --- /dev/null +++ b/src/test/resources/rml-star/RMLSTARTC002a/README.md @@ -0,0 +1,69 @@ +## RMLSTARTC002a + +**Title**: quoted triple in subject, one source, blank node in quoted object + +**Description**: Tests the creation of a asserted quoted triple (with a blank node as object) in the position of subject with data from one file + +**Error expected?** No + +**Input** +``` +c1,c2,c3 +s,b1,456 + +``` + +**Mapping** +``` +@prefix rdf: . +@prefix rml: . +@prefix xsd: . +@prefix ex: . +@prefix : . +@base . + +:firstTM a rml:AssertedTriplesMap ; + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:template "http://example/{c1}" + ]; + rml:predicateObjectMap [ + rml:predicate ex:p ; + rml:objectMap [ + rml:reference "c2" ; + rml:termType rml:BlankNode + ] + ] . + +:secondTM a rml:AssertedTriplesMap ; + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:quotedTriplesMap :firstTM + ]; + rml:predicateObjectMap [ + rml:predicate ex:q ; + rml:objectMap [ + rml:reference "c3"; + rml:datatype xsd:integer + ] + ] . + +``` + +**Output** +``` + _:b1 . +<< _:b1 >> "456"^^ . + +``` + diff --git a/src/test/resources/rml-star/RMLSTARTC002a/data.csv b/src/test/resources/rml-star/RMLSTARTC002a/data.csv new file mode 100644 index 00000000..9ddd32a2 --- /dev/null +++ b/src/test/resources/rml-star/RMLSTARTC002a/data.csv @@ -0,0 +1,2 @@ +c1,c2,c3 +s,b1,456 diff --git a/src/test/resources/rml-star/RMLSTARTC002a/mapping.ttl b/src/test/resources/rml-star/RMLSTARTC002a/mapping.ttl new file mode 100644 index 00000000..c301bf7e --- /dev/null +++ b/src/test/resources/rml-star/RMLSTARTC002a/mapping.ttl @@ -0,0 +1,42 @@ +@prefix rdf: . +@prefix rml: . +@prefix xsd: . +@prefix ex: . +@prefix : . +@base . + +:firstTM a rml:AssertedTriplesMap ; + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:template "http://example/{c1}" + ]; + rml:predicateObjectMap [ + rml:predicate ex:p ; + rml:objectMap [ + rml:reference "c2" ; + rml:termType rml:BlankNode + ] + ] . + +:secondTM a rml:AssertedTriplesMap ; + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:quotedTriplesMap :firstTM + ]; + rml:predicateObjectMap [ + rml:predicate ex:q ; + rml:objectMap [ + rml:reference "c3"; + rml:datatype xsd:integer + ] + ] . diff --git a/src/test/resources/rml-star/RMLSTARTC002a/output.nt b/src/test/resources/rml-star/RMLSTARTC002a/output.nt new file mode 100644 index 00000000..2dc337a9 --- /dev/null +++ b/src/test/resources/rml-star/RMLSTARTC002a/output.nt @@ -0,0 +1,2 @@ + _:b1 . +<< _:b1 >> "456"^^ . diff --git a/src/test/resources/rml-star/RMLSTARTC002b/README.md b/src/test/resources/rml-star/RMLSTARTC002b/README.md new file mode 100644 index 00000000..6493c891 --- /dev/null +++ b/src/test/resources/rml-star/RMLSTARTC002b/README.md @@ -0,0 +1,81 @@ +## RMLSTARTC002b + +**Title**: quoted triple in subject, two sources, blank node in quoted object + +**Description**: Tests the creation of a asserted quoted triple (with a blank node as object) in the position of subject with data from two files + +**Error expected?** No + +**Input** +``` +c1-1,c1-2,c1-3 +s,b1,1 + +``` + +**Input 1** +``` +**Input 1** +c2-1,c2-2 +456,1 + +``` + +**Mapping** +``` +@prefix rdf: . +@prefix rml: . +@prefix xsd: . +@prefix ex: . +@prefix : . +@base . + +:firstTM a rml:AssertedTriplesMap ; + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data1.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:template "http://example/{c1-1}" + ]; + rml:predicateObjectMap [ + rml:predicate ex:p ; + rml:objectMap [ + rml:reference "c1-2" ; + rml:termType rml:BlankNode + ] + ] . + +:secondTM a rml:AssertedTriplesMap ; + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data2.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:quotedTriplesMap :firstTM ; + rml:joinCondition [ + rml:child "c2-2" ; + rml:parent "c1-3" ; + ]; + ]; + rml:predicateObjectMap [ + rml:predicate ex:q ; + rml:objectMap [ + rml:reference "c2-1"; + rml:datatype xsd:integer + ] + ] . + +``` + +**Output** +``` + _:b1 . +<< _:b1 >> "456"^^ . + +``` + diff --git a/src/test/resources/rml-star/RMLSTARTC002b/data1.csv b/src/test/resources/rml-star/RMLSTARTC002b/data1.csv new file mode 100644 index 00000000..bd188285 --- /dev/null +++ b/src/test/resources/rml-star/RMLSTARTC002b/data1.csv @@ -0,0 +1,2 @@ +c1-1,c1-2,c1-3 +s,b1,1 diff --git a/src/test/resources/rml-star/RMLSTARTC002b/data2.csv b/src/test/resources/rml-star/RMLSTARTC002b/data2.csv new file mode 100644 index 00000000..0335530d --- /dev/null +++ b/src/test/resources/rml-star/RMLSTARTC002b/data2.csv @@ -0,0 +1,3 @@ +**Input 1** +c2-1,c2-2 +456,1 diff --git a/src/test/resources/rml-star/RMLSTARTC002b/mapping.ttl b/src/test/resources/rml-star/RMLSTARTC002b/mapping.ttl new file mode 100644 index 00000000..372d0f92 --- /dev/null +++ b/src/test/resources/rml-star/RMLSTARTC002b/mapping.ttl @@ -0,0 +1,46 @@ +@prefix rdf: . +@prefix rml: . +@prefix xsd: . +@prefix ex: . +@prefix : . +@base . + +:firstTM a rml:AssertedTriplesMap ; + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data1.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:template "http://example/{c1-1}" + ]; + rml:predicateObjectMap [ + rml:predicate ex:p ; + rml:objectMap [ + rml:reference "c1-2" ; + rml:termType rml:BlankNode + ] + ] . + +:secondTM a rml:AssertedTriplesMap ; + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data2.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:quotedTriplesMap :firstTM ; + rml:joinCondition [ + rml:child "c2-2" ; + rml:parent "c1-3" ; + ]; + ]; + rml:predicateObjectMap [ + rml:predicate ex:q ; + rml:objectMap [ + rml:reference "c2-1"; + rml:datatype xsd:integer + ] + ] . diff --git a/src/test/resources/rml-star/RMLSTARTC002b/output.nt b/src/test/resources/rml-star/RMLSTARTC002b/output.nt new file mode 100644 index 00000000..2dc337a9 --- /dev/null +++ b/src/test/resources/rml-star/RMLSTARTC002b/output.nt @@ -0,0 +1,2 @@ + _:b1 . +<< _:b1 >> "456"^^ . diff --git a/src/test/resources/rml-star/RMLSTARTC003a/README.md b/src/test/resources/rml-star/RMLSTARTC003a/README.md new file mode 100644 index 00000000..f45d6bea --- /dev/null +++ b/src/test/resources/rml-star/RMLSTARTC003a/README.md @@ -0,0 +1,86 @@ +## RMLSTARTC003a + +**Title**: two-level quoted triple in subject, one source + +**Description**: Tests the creation of two-level recursiveness of asserted quoted triples as subjects with data from one file + +**Error expected?** No + +**Input** +``` +c1,c2,c3,c4 +s,o,z,1 + +``` + +**Mapping** +``` +@prefix rdf: . +@prefix rml: . +@prefix ex: . +@prefix xsd: . +@prefix : . +@base . + +:firstTM a rml:AssertedTriplesMap ; + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:template "http://example/{c1}" + ]; + rml:predicateObjectMap [ + rml:predicate ex:p ; + rml:objectMap [ + rml:template "http://example/{c2}" + ] + ] . + +:secondTM a rml:AssertedTriplesMap ; + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:quotedTriplesMap :firstTM + ]; + rml:predicateObjectMap [ + rml:predicate ex:r ; + rml:objectMap [ + rml:template "http://example/{c3}" + ] + ] . + +:thirdTM a rml:AssertedTriplesMap ; + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:quotedTriplesMap :secondTM + ]; + rml:predicateObjectMap [ + rml:predicate ex:q ; + rml:objectMap [ + rml:reference "c4" ; + rml:datatype xsd:integer + ] + ] . + +``` + +**Output** +``` + . +<< >> . +<< << >> >> "1"^^ . + +``` + diff --git a/src/test/resources/rml-star/RMLSTARTC003a/data.csv b/src/test/resources/rml-star/RMLSTARTC003a/data.csv new file mode 100644 index 00000000..3d2bf5e1 --- /dev/null +++ b/src/test/resources/rml-star/RMLSTARTC003a/data.csv @@ -0,0 +1,2 @@ +c1,c2,c3,c4 +s,o,z,1 diff --git a/src/test/resources/rml-star/RMLSTARTC003a/mapping.ttl b/src/test/resources/rml-star/RMLSTARTC003a/mapping.ttl new file mode 100644 index 00000000..4d461697 --- /dev/null +++ b/src/test/resources/rml-star/RMLSTARTC003a/mapping.ttl @@ -0,0 +1,58 @@ +@prefix rdf: . +@prefix rml: . +@prefix ex: . +@prefix xsd: . +@prefix : . +@base . + +:firstTM a rml:AssertedTriplesMap ; + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:template "http://example/{c1}" + ]; + rml:predicateObjectMap [ + rml:predicate ex:p ; + rml:objectMap [ + rml:template "http://example/{c2}" + ] + ] . + +:secondTM a rml:AssertedTriplesMap ; + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:quotedTriplesMap :firstTM + ]; + rml:predicateObjectMap [ + rml:predicate ex:r ; + rml:objectMap [ + rml:template "http://example/{c3}" + ] + ] . + +:thirdTM a rml:AssertedTriplesMap ; + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:quotedTriplesMap :secondTM + ]; + rml:predicateObjectMap [ + rml:predicate ex:q ; + rml:objectMap [ + rml:reference "c4" ; + rml:datatype xsd:integer + ] + ] . diff --git a/src/test/resources/rml-star/RMLSTARTC003a/output.nt b/src/test/resources/rml-star/RMLSTARTC003a/output.nt new file mode 100644 index 00000000..d6a50cbe --- /dev/null +++ b/src/test/resources/rml-star/RMLSTARTC003a/output.nt @@ -0,0 +1,3 @@ + . +<< >> . +<< << >> >> "1"^^ . diff --git a/src/test/resources/rml-star/RMLSTARTC003b/README.md b/src/test/resources/rml-star/RMLSTARTC003b/README.md new file mode 100644 index 00000000..4b162d6c --- /dev/null +++ b/src/test/resources/rml-star/RMLSTARTC003b/README.md @@ -0,0 +1,98 @@ +## RMLSTARTC003b + +**Title**: two-level quoted triple in subject, two sources + +**Description**: Tests the creation of two-level recursiveness of asserted quoted triples as subjects with data from two files + +**Error expected?** No + +**Input** +``` +c1-1,c1-2,c1-3,c1-4 +s,o,z,1 + +``` + +**Input 1** +``` +**Input 1** +c2-1,c2-2 +1,1 + +``` + +**Mapping** +``` +@prefix rdf: . +@prefix rml: . +@prefix ex: . +@prefix xsd: . +@prefix : . +@base . + +:firstTM a rml:AssertedTriplesMap ; + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data1.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:template "http://example/{c1-1}" + ]; + rml:predicateObjectMap [ + rml:predicate ex:p ; + rml:objectMap [ + rml:template "http://example/{c1-2}" + ] + ] . + +:secondTM a rml:AssertedTriplesMap ; + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data1.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:quotedTriplesMap :firstTM + ]; + rml:predicateObjectMap [ + rml:predicate ex:r ; + rml:objectMap [ + rml:template "http://example/{c1-3}" + ] + ] . + +:thirdTM a rml:AssertedTriplesMap ; + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data2.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:quotedTriplesMap :secondTM; + rml:joinCondition [ + rml:child "c2-2" ; + rml:parent "c1-4" ; + ]; + ]; + rml:predicateObjectMap [ + rml:predicate ex:q ; + rml:objectMap [ + rml:reference "c2-1" ; + rml:datatype xsd:integer + ] + ] . + +``` + +**Output** +``` + . +<< >> . +<< << >> >> "1"^^ . + +``` + diff --git a/src/test/resources/rml-star/RMLSTARTC003b/data1.csv b/src/test/resources/rml-star/RMLSTARTC003b/data1.csv new file mode 100644 index 00000000..3999e70c --- /dev/null +++ b/src/test/resources/rml-star/RMLSTARTC003b/data1.csv @@ -0,0 +1,2 @@ +c1-1,c1-2,c1-3,c1-4 +s,o,z,1 diff --git a/src/test/resources/rml-star/RMLSTARTC003b/data2.csv b/src/test/resources/rml-star/RMLSTARTC003b/data2.csv new file mode 100644 index 00000000..16d66b2d --- /dev/null +++ b/src/test/resources/rml-star/RMLSTARTC003b/data2.csv @@ -0,0 +1,3 @@ +**Input 1** +c2-1,c2-2 +1,1 diff --git a/src/test/resources/rml-star/RMLSTARTC003b/mapping.ttl b/src/test/resources/rml-star/RMLSTARTC003b/mapping.ttl new file mode 100644 index 00000000..edab9cc6 --- /dev/null +++ b/src/test/resources/rml-star/RMLSTARTC003b/mapping.ttl @@ -0,0 +1,62 @@ +@prefix rdf: . +@prefix rml: . +@prefix ex: . +@prefix xsd: . +@prefix : . +@base . + +:firstTM a rml:AssertedTriplesMap ; + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data1.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:template "http://example/{c1-1}" + ]; + rml:predicateObjectMap [ + rml:predicate ex:p ; + rml:objectMap [ + rml:template "http://example/{c1-2}" + ] + ] . + +:secondTM a rml:AssertedTriplesMap ; + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data1.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:quotedTriplesMap :firstTM + ]; + rml:predicateObjectMap [ + rml:predicate ex:r ; + rml:objectMap [ + rml:template "http://example/{c1-3}" + ] + ] . + +:thirdTM a rml:AssertedTriplesMap ; + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data2.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:quotedTriplesMap :secondTM; + rml:joinCondition [ + rml:child "c2-2" ; + rml:parent "c1-4" ; + ]; + ]; + rml:predicateObjectMap [ + rml:predicate ex:q ; + rml:objectMap [ + rml:reference "c2-1" ; + rml:datatype xsd:integer + ] + ] . diff --git a/src/test/resources/rml-star/RMLSTARTC003b/output.nt b/src/test/resources/rml-star/RMLSTARTC003b/output.nt new file mode 100644 index 00000000..d6a50cbe --- /dev/null +++ b/src/test/resources/rml-star/RMLSTARTC003b/output.nt @@ -0,0 +1,3 @@ + . +<< >> . +<< << >> >> "1"^^ . diff --git a/src/test/resources/rml-star/RMLSTARTC004a/README.md b/src/test/resources/rml-star/RMLSTARTC004a/README.md new file mode 100644 index 00000000..267673c0 --- /dev/null +++ b/src/test/resources/rml-star/RMLSTARTC004a/README.md @@ -0,0 +1,85 @@ +## RMLSTARTC004a + +**Title**: two-level quoted triple in subject and object, one source + +**Description**: Tests the creation of two-level recursiveness of asserted quoted triples as first as object, second as subject with data from one file + +**Error expected?** No + +**Input** +``` +c1,c2,c3,c4 +s,o,a,z + +``` + +**Mapping** +``` +@prefix rdf: . +@prefix rml: . +@prefix ex: . +@prefix xsd: . +@prefix : . +@base . + +:firstTM a rml:AssertedTriplesMap ; + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:template "http://example/{c1}" + ]; + rml:predicateObjectMap [ + rml:predicate ex:p ; + rml:objectMap [ + rml:template "http://example/{c2}" + ] + ] . + +:secondTM a rml:AssertedTriplesMap ; + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:template "http://example/{c3}" + ]; + rml:predicateObjectMap [ + rml:predicate ex:q ; + rml:objectMap [ + rml:quotedTriplesMap :firstTM + ] + ] . + +:thirdTM a rml:AssertedTriplesMap ; + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:quotedTriplesMap :secondTM + ]; + rml:predicateObjectMap [ + rml:predicate ex:r ; + rml:objectMap [ + rml:template "http://example/{c4}" + ] + ] . + +``` + +**Output** +``` + . + << >> . +<< << >> >> . + +``` + diff --git a/src/test/resources/rml-star/RMLSTARTC004a/data.csv b/src/test/resources/rml-star/RMLSTARTC004a/data.csv new file mode 100644 index 00000000..2cfbe0fa --- /dev/null +++ b/src/test/resources/rml-star/RMLSTARTC004a/data.csv @@ -0,0 +1,2 @@ +c1,c2,c3,c4 +s,o,a,z diff --git a/src/test/resources/rml-star/RMLSTARTC004a/mapping.ttl b/src/test/resources/rml-star/RMLSTARTC004a/mapping.ttl new file mode 100644 index 00000000..06b3511b --- /dev/null +++ b/src/test/resources/rml-star/RMLSTARTC004a/mapping.ttl @@ -0,0 +1,57 @@ +@prefix rdf: . +@prefix rml: . +@prefix ex: . +@prefix xsd: . +@prefix : . +@base . + +:firstTM a rml:AssertedTriplesMap ; + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:template "http://example/{c1}" + ]; + rml:predicateObjectMap [ + rml:predicate ex:p ; + rml:objectMap [ + rml:template "http://example/{c2}" + ] + ] . + +:secondTM a rml:AssertedTriplesMap ; + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:template "http://example/{c3}" + ]; + rml:predicateObjectMap [ + rml:predicate ex:q ; + rml:objectMap [ + rml:quotedTriplesMap :firstTM + ] + ] . + +:thirdTM a rml:AssertedTriplesMap ; + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:quotedTriplesMap :secondTM + ]; + rml:predicateObjectMap [ + rml:predicate ex:r ; + rml:objectMap [ + rml:template "http://example/{c4}" + ] + ] . diff --git a/src/test/resources/rml-star/RMLSTARTC004a/output.nt b/src/test/resources/rml-star/RMLSTARTC004a/output.nt new file mode 100644 index 00000000..7a8d3131 --- /dev/null +++ b/src/test/resources/rml-star/RMLSTARTC004a/output.nt @@ -0,0 +1,3 @@ + . + << >> . +<< << >> >> . diff --git a/src/test/resources/rml-star/RMLSTARTC004b/README.md b/src/test/resources/rml-star/RMLSTARTC004b/README.md new file mode 100644 index 00000000..0e2b6c57 --- /dev/null +++ b/src/test/resources/rml-star/RMLSTARTC004b/README.md @@ -0,0 +1,97 @@ +## RMLSTARTC004b + +**Title**: two-level quoted triple in subject and object, two sources + +**Description**: Tests the creation of two-level recursiveness of asserted quoted triples as first as object, second as subject with data from two sources + +**Error expected?** No + +**Input** +``` +c1-1,c1-2,c1-3,c1-4 +s,o,a,1 + +``` + +**Input 1** +``` +**Input 1** +c2-1,c2-2 +z,1 + +``` + +**Mapping** +``` +@prefix rdf: . +@prefix rml: . +@prefix ex: . +@prefix xsd: . +@prefix : . +@base . + +:firstTM a rml:AssertedTriplesMap ; + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data1.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:template "http://example/{c1-1}" + ]; + rml:predicateObjectMap [ + rml:predicate ex:p ; + rml:objectMap [ + rml:template "http://example/{c1-2}" + ] + ] . + +:secondTM a rml:AssertedTriplesMap ; + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data1.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:template "http://example/{c1-3}" + ]; + rml:predicateObjectMap [ + rml:predicate ex:q ; + rml:objectMap [ + rml:quotedTriplesMap :firstTM + ] + ] . + +:thirdTM a rml:AssertedTriplesMap ; + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data2.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:quotedTriplesMap :secondTM; + rml:joinCondition [ + rml:child "c2-2" ; + rml:parent "c1-4" ; + ]; + ]; + rml:predicateObjectMap [ + rml:predicate ex:r ; + rml:objectMap [ + rml:template "http://example/{c2-1}" + ] + ] . + +``` + +**Output** +``` + . + << >> . +<< << >> >> . + +``` + diff --git a/src/test/resources/rml-star/RMLSTARTC004b/data1.csv b/src/test/resources/rml-star/RMLSTARTC004b/data1.csv new file mode 100644 index 00000000..97346277 --- /dev/null +++ b/src/test/resources/rml-star/RMLSTARTC004b/data1.csv @@ -0,0 +1,2 @@ +c1-1,c1-2,c1-3,c1-4 +s,o,a,1 diff --git a/src/test/resources/rml-star/RMLSTARTC004b/data2.csv b/src/test/resources/rml-star/RMLSTARTC004b/data2.csv new file mode 100644 index 00000000..0e26a38d --- /dev/null +++ b/src/test/resources/rml-star/RMLSTARTC004b/data2.csv @@ -0,0 +1,3 @@ +**Input 1** +c2-1,c2-2 +z,1 diff --git a/src/test/resources/rml-star/RMLSTARTC004b/mapping.ttl b/src/test/resources/rml-star/RMLSTARTC004b/mapping.ttl new file mode 100644 index 00000000..6ea45025 --- /dev/null +++ b/src/test/resources/rml-star/RMLSTARTC004b/mapping.ttl @@ -0,0 +1,61 @@ +@prefix rdf: . +@prefix rml: . +@prefix ex: . +@prefix xsd: . +@prefix : . +@base . + +:firstTM a rml:AssertedTriplesMap ; + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data1.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:template "http://example/{c1-1}" + ]; + rml:predicateObjectMap [ + rml:predicate ex:p ; + rml:objectMap [ + rml:template "http://example/{c1-2}" + ] + ] . + +:secondTM a rml:AssertedTriplesMap ; + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data1.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:template "http://example/{c1-3}" + ]; + rml:predicateObjectMap [ + rml:predicate ex:q ; + rml:objectMap [ + rml:quotedTriplesMap :firstTM + ] + ] . + +:thirdTM a rml:AssertedTriplesMap ; + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data2.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:quotedTriplesMap :secondTM; + rml:joinCondition [ + rml:child "c2-2" ; + rml:parent "c1-4" ; + ]; + ]; + rml:predicateObjectMap [ + rml:predicate ex:r ; + rml:objectMap [ + rml:template "http://example/{c2-1}" + ] + ] . diff --git a/src/test/resources/rml-star/RMLSTARTC004b/output.nt b/src/test/resources/rml-star/RMLSTARTC004b/output.nt new file mode 100644 index 00000000..7a8d3131 --- /dev/null +++ b/src/test/resources/rml-star/RMLSTARTC004b/output.nt @@ -0,0 +1,3 @@ + . + << >> . +<< << >> >> . diff --git a/src/test/resources/rml-star/RMLSTARTC005a/README.md b/src/test/resources/rml-star/RMLSTARTC005a/README.md new file mode 100644 index 00000000..36136480 --- /dev/null +++ b/src/test/resources/rml-star/RMLSTARTC005a/README.md @@ -0,0 +1,66 @@ +## RMLSTARTC005a + +**Title**: non-asserted quoted triple in subject, one source + +**Description**: Tests the creation of a non-asserted quoted triple in the position of subject with data from one file + +**Error expected?** No + +**Input** +``` +c1,c2,c3 +s,o,z + +``` + +**Mapping** +``` +@prefix rdf: . +@prefix rml: . +@prefix ex: . +@prefix xsd: . +@prefix : . +@base . + +:firstTM a rml:NonAssertedTriplesMap ; + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:template "http://example/{c1}" + ]; + rml:predicateObjectMap [ + rml:predicate ex:p ; + rml:objectMap [ + rml:template "http://example/{c2}" + ] + ] . + +:secondTM a rml:AssertedTriplesMap ; + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:quotedTriplesMap :firstTM + ]; + rml:predicateObjectMap [ + rml:predicate ex:q ; + rml:objectMap [ + rml:template "http://example/{c3}" + ] + ] . + +``` + +**Output** +``` +<< >> . + +``` + diff --git a/src/test/resources/rml-star/RMLSTARTC005a/data.csv b/src/test/resources/rml-star/RMLSTARTC005a/data.csv new file mode 100644 index 00000000..a4c3707d --- /dev/null +++ b/src/test/resources/rml-star/RMLSTARTC005a/data.csv @@ -0,0 +1,2 @@ +c1,c2,c3 +s,o,z diff --git a/src/test/resources/rml-star/RMLSTARTC005a/mapping.ttl b/src/test/resources/rml-star/RMLSTARTC005a/mapping.ttl new file mode 100644 index 00000000..9cfe1409 --- /dev/null +++ b/src/test/resources/rml-star/RMLSTARTC005a/mapping.ttl @@ -0,0 +1,40 @@ +@prefix rdf: . +@prefix rml: . +@prefix ex: . +@prefix xsd: . +@prefix : . +@base . + +:firstTM a rml:NonAssertedTriplesMap ; + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:template "http://example/{c1}" + ]; + rml:predicateObjectMap [ + rml:predicate ex:p ; + rml:objectMap [ + rml:template "http://example/{c2}" + ] + ] . + +:secondTM a rml:AssertedTriplesMap ; + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:quotedTriplesMap :firstTM + ]; + rml:predicateObjectMap [ + rml:predicate ex:q ; + rml:objectMap [ + rml:template "http://example/{c3}" + ] + ] . diff --git a/src/test/resources/rml-star/RMLSTARTC005a/output.nt b/src/test/resources/rml-star/RMLSTARTC005a/output.nt new file mode 100644 index 00000000..7f2be99c --- /dev/null +++ b/src/test/resources/rml-star/RMLSTARTC005a/output.nt @@ -0,0 +1 @@ +<< >> . diff --git a/src/test/resources/rml-star/RMLSTARTC005b/README.md b/src/test/resources/rml-star/RMLSTARTC005b/README.md new file mode 100644 index 00000000..4cd0c9e9 --- /dev/null +++ b/src/test/resources/rml-star/RMLSTARTC005b/README.md @@ -0,0 +1,78 @@ +## RMLSTARTC005b + +**Title**: non-asserted quoted triple in subject, two sources + +**Description**: Tests the creation of a non-asserted quoted triple in the position of subject with data from two files + +**Error expected?** No + +**Input** +``` +c1-1,c1-2,c1-3 +s,o,1 + +``` + +**Input 1** +``` +**Input 1** +c2-1,c2-2 +z,1 + +``` + +**Mapping** +``` +@prefix rdf: . +@prefix rml: . +@prefix ex: . +@prefix xsd: . +@prefix : . +@base . + +:firstTM a rml:NonAssertedTriplesMap ; + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data1.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:template "http://example/{c1-1}" + ]; + rml:predicateObjectMap [ + rml:predicate ex:p ; + rml:objectMap [ + rml:template "http://example/{c1-2}" + ] + ] . + +:secondTM a rml:AssertedTriplesMap ; + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data2.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:quotedTriplesMap :firstTM ; + rml:joinCondition [ + rml:child "c2-2" ; + rml:parent "c1-3" ; + ]; + ]; + rml:predicateObjectMap [ + rml:predicate ex:q ; + rml:objectMap [ + rml:template "http://example/{c2-1}" + ] + ] . + +``` + +**Output** +``` +<< >> . + +``` + diff --git a/src/test/resources/rml-star/RMLSTARTC005b/data1.csv b/src/test/resources/rml-star/RMLSTARTC005b/data1.csv new file mode 100644 index 00000000..9fe2369b --- /dev/null +++ b/src/test/resources/rml-star/RMLSTARTC005b/data1.csv @@ -0,0 +1,2 @@ +c1-1,c1-2,c1-3 +s,o,1 diff --git a/src/test/resources/rml-star/RMLSTARTC005b/data2.csv b/src/test/resources/rml-star/RMLSTARTC005b/data2.csv new file mode 100644 index 00000000..0e26a38d --- /dev/null +++ b/src/test/resources/rml-star/RMLSTARTC005b/data2.csv @@ -0,0 +1,3 @@ +**Input 1** +c2-1,c2-2 +z,1 diff --git a/src/test/resources/rml-star/RMLSTARTC005b/mapping.ttl b/src/test/resources/rml-star/RMLSTARTC005b/mapping.ttl new file mode 100644 index 00000000..1b885da3 --- /dev/null +++ b/src/test/resources/rml-star/RMLSTARTC005b/mapping.ttl @@ -0,0 +1,44 @@ +@prefix rdf: . +@prefix rml: . +@prefix ex: . +@prefix xsd: . +@prefix : . +@base . + +:firstTM a rml:NonAssertedTriplesMap ; + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data1.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:template "http://example/{c1-1}" + ]; + rml:predicateObjectMap [ + rml:predicate ex:p ; + rml:objectMap [ + rml:template "http://example/{c1-2}" + ] + ] . + +:secondTM a rml:AssertedTriplesMap ; + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data2.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:quotedTriplesMap :firstTM ; + rml:joinCondition [ + rml:child "c2-2" ; + rml:parent "c1-3" ; + ]; + ]; + rml:predicateObjectMap [ + rml:predicate ex:q ; + rml:objectMap [ + rml:template "http://example/{c2-1}" + ] + ] . diff --git a/src/test/resources/rml-star/RMLSTARTC005b/output.nt b/src/test/resources/rml-star/RMLSTARTC005b/output.nt new file mode 100644 index 00000000..7f2be99c --- /dev/null +++ b/src/test/resources/rml-star/RMLSTARTC005b/output.nt @@ -0,0 +1 @@ +<< >> . diff --git a/src/test/resources/rml-star/RMLSTARTC006a/README.md b/src/test/resources/rml-star/RMLSTARTC006a/README.md new file mode 100644 index 00000000..e8680bc0 --- /dev/null +++ b/src/test/resources/rml-star/RMLSTARTC006a/README.md @@ -0,0 +1,66 @@ +## RMLSTARTC006a + +**Title**: non-asserted quoted triple in object, one source + +**Description**: Tests the creation of a non-asserted quoted triple in the position of object with data from one file + +**Error expected?** No + +**Input** +``` +c1,c2,c3 +s,o,x + +``` + +**Mapping** +``` +@prefix rdf: . +@prefix rml: . +@prefix ex: . +@prefix xsd: . +@prefix : . +@base . + +:firstTM a rml:NonAssertedTriplesMap ; # This refers to the y statement in the rdf-star + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:template "http://example/{c1}" + ]; + rml:predicateObjectMap [ + rml:predicate ex:p ; + rml:objectMap [ + rml:template "http://example/{c2}" + ] + ] . + +:secondTM a rml:AssertedTriplesMap ; # This refers to the x statement in the rdf-star + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:template "http://example/{c3}" + ]; + rml:predicateObjectMap [ + rml:predicate ex:p; ; + rml:objectMap [ + rml:quotedTriplesMap :firstTM + ] + ] . + +``` + +**Output** +``` + << >> . + +``` + diff --git a/src/test/resources/rml-star/RMLSTARTC006a/data.csv b/src/test/resources/rml-star/RMLSTARTC006a/data.csv new file mode 100644 index 00000000..3ca6ac76 --- /dev/null +++ b/src/test/resources/rml-star/RMLSTARTC006a/data.csv @@ -0,0 +1,2 @@ +c1,c2,c3 +s,o,x diff --git a/src/test/resources/rml-star/RMLSTARTC006a/mapping.ttl b/src/test/resources/rml-star/RMLSTARTC006a/mapping.ttl new file mode 100644 index 00000000..5de699b9 --- /dev/null +++ b/src/test/resources/rml-star/RMLSTARTC006a/mapping.ttl @@ -0,0 +1,40 @@ +@prefix rdf: . +@prefix rml: . +@prefix ex: . +@prefix xsd: . +@prefix : . +@base . + +:firstTM a rml:NonAssertedTriplesMap ; # This refers to the y statement in the rdf-star + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:template "http://example/{c1}" + ]; + rml:predicateObjectMap [ + rml:predicate ex:p ; + rml:objectMap [ + rml:template "http://example/{c2}" + ] + ] . + +:secondTM a rml:AssertedTriplesMap ; # This refers to the x statement in the rdf-star + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:template "http://example/{c3}" + ]; + rml:predicateObjectMap [ + rml:predicate ex:p; ; + rml:objectMap [ + rml:quotedTriplesMap :firstTM + ] + ] . diff --git a/src/test/resources/rml-star/RMLSTARTC006a/output.nt b/src/test/resources/rml-star/RMLSTARTC006a/output.nt new file mode 100644 index 00000000..5aa2cb20 --- /dev/null +++ b/src/test/resources/rml-star/RMLSTARTC006a/output.nt @@ -0,0 +1 @@ + << >> . diff --git a/src/test/resources/rml-star/RMLSTARTC006b/README.md b/src/test/resources/rml-star/RMLSTARTC006b/README.md new file mode 100644 index 00000000..46aaa776 --- /dev/null +++ b/src/test/resources/rml-star/RMLSTARTC006b/README.md @@ -0,0 +1,78 @@ +## RMLSTARTC006b + +**Title**: non-asserted quoted triple in object, two sources + +**Description**: Tests the creation of a non-asserted quoted triple in the position of object with data from two files + +**Error expected?** No + +**Input** +``` +c1-1,c1-2,c1-3 +s,o,1 + +``` + +**Input 1** +``` +**Input 1** +c2-1,c2-2 +x,1 + +``` + +**Mapping** +``` +@prefix rdf: . +@prefix rml: . +@prefix ex: . +@prefix xsd: . +@prefix : . +@base . + +:firstTM a rml:NonAssertedTriplesMap ; # This refers to the y statement in the rdf-star + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data1.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:template "http://example/{c1-1}" + ]; + rml:predicateObjectMap [ + rml:predicate ex:p ; + rml:objectMap [ + rml:template "http://example/{c1-2}" + ] + ] . + +:secondTM a rml:AssertedTriplesMap ; # This refers to the x statement in the rdf-star + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data2.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:template "http://example/{c2-1}" + ]; + rml:predicateObjectMap [ + rml:predicate ex:p; ; + rml:objectMap [ + rml:quotedTriplesMap :firstTM ; + rml:joinCondition [ + rml:child "c2-2" ; + rml:parent "c1-3" ; + ]; + ] + ] . + +``` + +**Output** +``` + << >> . + +``` + diff --git a/src/test/resources/rml-star/RMLSTARTC006b/data1.csv b/src/test/resources/rml-star/RMLSTARTC006b/data1.csv new file mode 100644 index 00000000..9fe2369b --- /dev/null +++ b/src/test/resources/rml-star/RMLSTARTC006b/data1.csv @@ -0,0 +1,2 @@ +c1-1,c1-2,c1-3 +s,o,1 diff --git a/src/test/resources/rml-star/RMLSTARTC006b/data2.csv b/src/test/resources/rml-star/RMLSTARTC006b/data2.csv new file mode 100644 index 00000000..a08b98a4 --- /dev/null +++ b/src/test/resources/rml-star/RMLSTARTC006b/data2.csv @@ -0,0 +1,3 @@ +**Input 1** +c2-1,c2-2 +x,1 diff --git a/src/test/resources/rml-star/RMLSTARTC006b/mapping.ttl b/src/test/resources/rml-star/RMLSTARTC006b/mapping.ttl new file mode 100644 index 00000000..c1baf80d --- /dev/null +++ b/src/test/resources/rml-star/RMLSTARTC006b/mapping.ttl @@ -0,0 +1,44 @@ +@prefix rdf: . +@prefix rml: . +@prefix ex: . +@prefix xsd: . +@prefix : . +@base . + +:firstTM a rml:NonAssertedTriplesMap ; # This refers to the y statement in the rdf-star + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data1.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:template "http://example/{c1-1}" + ]; + rml:predicateObjectMap [ + rml:predicate ex:p ; + rml:objectMap [ + rml:template "http://example/{c1-2}" + ] + ] . + +:secondTM a rml:AssertedTriplesMap ; # This refers to the x statement in the rdf-star + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data2.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:template "http://example/{c2-1}" + ]; + rml:predicateObjectMap [ + rml:predicate ex:p; ; + rml:objectMap [ + rml:quotedTriplesMap :firstTM ; + rml:joinCondition [ + rml:child "c2-2" ; + rml:parent "c1-3" ; + ]; + ] + ] . diff --git a/src/test/resources/rml-star/RMLSTARTC006b/output.nt b/src/test/resources/rml-star/RMLSTARTC006b/output.nt new file mode 100644 index 00000000..5aa2cb20 --- /dev/null +++ b/src/test/resources/rml-star/RMLSTARTC006b/output.nt @@ -0,0 +1 @@ + << >> . diff --git a/src/test/resources/rml-star/RMLSTARTC007a/README.md b/src/test/resources/rml-star/RMLSTARTC007a/README.md new file mode 100644 index 00000000..6857003c --- /dev/null +++ b/src/test/resources/rml-star/RMLSTARTC007a/README.md @@ -0,0 +1,83 @@ +## RMLSTARTC007a + +**Title**: non-asserted quoted triples in subject and object, one source + +**Description**: Tests the creation of a two non-asserted quoted triples, one in the position of subject and other in object with data from one file + +**Error expected?** No + +**Input** +``` +c1,c2,c3,c4 +s1,o1,s2,o2 + +``` + +**Mapping** +``` +@prefix rdf: . +@prefix rml: . +@prefix ex: . +@prefix xsd: . +@prefix : . +@base . + +:firstTM a rml:NonAssertedTriplesMap ; + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:template "http://example/{c1}" + ]; + rml:predicateObjectMap [ + rml:predicate ex:p1 ; + rml:objectMap [ + rml:template "http://example/{c2}" + ] + ] . + +:secondTM a rml:AssertedTriplesMap ; + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:quotedTriplesMap :firstTM + ]; + rml:predicateObjectMap [ + rml:predicate ex:q; ; + rml:objectMap [ + rml:quotedTriplesMap :thirdTM + ] + ] . + +:thirdTM a rml:NonAssertedTriplesMap ; + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:template "http://example/{c3}" + ]; + rml:predicateObjectMap [ + rml:predicate ex:p2 ; + rml:objectMap [ + rml:template "http://example/{c4}" + ] + ] . + +``` + +**Output** +``` +<< >> << >> . + +``` + diff --git a/src/test/resources/rml-star/RMLSTARTC007a/data.csv b/src/test/resources/rml-star/RMLSTARTC007a/data.csv new file mode 100644 index 00000000..b0543404 --- /dev/null +++ b/src/test/resources/rml-star/RMLSTARTC007a/data.csv @@ -0,0 +1,2 @@ +c1,c2,c3,c4 +s1,o1,s2,o2 diff --git a/src/test/resources/rml-star/RMLSTARTC007a/mapping.ttl b/src/test/resources/rml-star/RMLSTARTC007a/mapping.ttl new file mode 100644 index 00000000..16a4cece --- /dev/null +++ b/src/test/resources/rml-star/RMLSTARTC007a/mapping.ttl @@ -0,0 +1,57 @@ +@prefix rdf: . +@prefix rml: . +@prefix ex: . +@prefix xsd: . +@prefix : . +@base . + +:firstTM a rml:NonAssertedTriplesMap ; + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:template "http://example/{c1}" + ]; + rml:predicateObjectMap [ + rml:predicate ex:p1 ; + rml:objectMap [ + rml:template "http://example/{c2}" + ] + ] . + +:secondTM a rml:AssertedTriplesMap ; + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:quotedTriplesMap :firstTM + ]; + rml:predicateObjectMap [ + rml:predicate ex:q; ; + rml:objectMap [ + rml:quotedTriplesMap :thirdTM + ] + ] . + +:thirdTM a rml:NonAssertedTriplesMap ; + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:template "http://example/{c3}" + ]; + rml:predicateObjectMap [ + rml:predicate ex:p2 ; + rml:objectMap [ + rml:template "http://example/{c4}" + ] + ] . diff --git a/src/test/resources/rml-star/RMLSTARTC007a/output.nt b/src/test/resources/rml-star/RMLSTARTC007a/output.nt new file mode 100644 index 00000000..16b9420a --- /dev/null +++ b/src/test/resources/rml-star/RMLSTARTC007a/output.nt @@ -0,0 +1 @@ +<< >> << >> . diff --git a/src/test/resources/rml-star/RMLSTARTC007b/README.md b/src/test/resources/rml-star/RMLSTARTC007b/README.md new file mode 100644 index 00000000..bfec08ac --- /dev/null +++ b/src/test/resources/rml-star/RMLSTARTC007b/README.md @@ -0,0 +1,95 @@ +## RMLSTARTC007b + +**Title**: non-asserted quoted triples in subject and object, two sources + +**Description**: Tests the creation of a two non-asserted quoted triples, one in the position of subject and other in object with data from two sources + +**Error expected?** No + +**Input** +``` +c1-1,c1-2,c1-3 +s1,o1,1 + +``` + +**Input 1** +``` +**Input 1** +c2-1,c2-2,c2-3 +s2,o2,1 + +``` + +**Mapping** +``` +@prefix rdf: . +@prefix rml: . +@prefix ex: . +@prefix xsd: . +@prefix : . +@base . + +:firstTM a rml:NonAssertedTriplesMap ; + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data1.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:template "http://example/{c1-1}" + ]; + rml:predicateObjectMap [ + rml:predicate ex:p1 ; + rml:objectMap [ + rml:template "http://example/{c1-2}" + ] + ] . + +:secondTM a rml:AssertedTriplesMap ; + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data2.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:quotedTriplesMap :firstTM ; + rml:joinCondition [ + rml:child "c2-3" ; + rml:parent "c1-3" ; + ]; + ]; + rml:predicateObjectMap [ + rml:predicate ex:q; ; + rml:objectMap [ + rml:quotedTriplesMap :thirdTM + ] + ] . + +:thirdTM a rml:NonAssertedTriplesMap ; + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data2.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:template "http://example/{c2-1}" + ]; + rml:predicateObjectMap [ + rml:predicate ex:p2 ; + rml:objectMap [ + rml:template "http://example/{c2-2}" + ] + ] . + +``` + +**Output** +``` +<< >> << >> . + +``` + diff --git a/src/test/resources/rml-star/RMLSTARTC007b/data1.csv b/src/test/resources/rml-star/RMLSTARTC007b/data1.csv new file mode 100644 index 00000000..57395e8f --- /dev/null +++ b/src/test/resources/rml-star/RMLSTARTC007b/data1.csv @@ -0,0 +1,2 @@ +c1-1,c1-2,c1-3 +s1,o1,1 diff --git a/src/test/resources/rml-star/RMLSTARTC007b/data2.csv b/src/test/resources/rml-star/RMLSTARTC007b/data2.csv new file mode 100644 index 00000000..f65494b9 --- /dev/null +++ b/src/test/resources/rml-star/RMLSTARTC007b/data2.csv @@ -0,0 +1,3 @@ +**Input 1** +c2-1,c2-2,c2-3 +s2,o2,1 diff --git a/src/test/resources/rml-star/RMLSTARTC007b/mapping.ttl b/src/test/resources/rml-star/RMLSTARTC007b/mapping.ttl new file mode 100644 index 00000000..89ea0073 --- /dev/null +++ b/src/test/resources/rml-star/RMLSTARTC007b/mapping.ttl @@ -0,0 +1,61 @@ +@prefix rdf: . +@prefix rml: . +@prefix ex: . +@prefix xsd: . +@prefix : . +@base . + +:firstTM a rml:NonAssertedTriplesMap ; + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data1.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:template "http://example/{c1-1}" + ]; + rml:predicateObjectMap [ + rml:predicate ex:p1 ; + rml:objectMap [ + rml:template "http://example/{c1-2}" + ] + ] . + +:secondTM a rml:AssertedTriplesMap ; + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data2.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:quotedTriplesMap :firstTM ; + rml:joinCondition [ + rml:child "c2-3" ; + rml:parent "c1-3" ; + ]; + ]; + rml:predicateObjectMap [ + rml:predicate ex:q; ; + rml:objectMap [ + rml:quotedTriplesMap :thirdTM + ] + ] . + +:thirdTM a rml:NonAssertedTriplesMap ; + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data2.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:template "http://example/{c2-1}" + ]; + rml:predicateObjectMap [ + rml:predicate ex:p2 ; + rml:objectMap [ + rml:template "http://example/{c2-2}" + ] + ] . diff --git a/src/test/resources/rml-star/RMLSTARTC007b/output.nt b/src/test/resources/rml-star/RMLSTARTC007b/output.nt new file mode 100644 index 00000000..16b9420a --- /dev/null +++ b/src/test/resources/rml-star/RMLSTARTC007b/output.nt @@ -0,0 +1 @@ +<< >> << >> . diff --git a/src/test/resources/rml-star/RMLSTARTC008a/README.md b/src/test/resources/rml-star/RMLSTARTC008a/README.md new file mode 100644 index 00000000..3b477451 --- /dev/null +++ b/src/test/resources/rml-star/RMLSTARTC008a/README.md @@ -0,0 +1,151 @@ +## RMLSTARTC008a + +**Title**: two-level non-asserted quoted triple in subject and object two-fold, one source + +**Description**: Tests the creation of a triple with non-asserted quoted triples as subject and object, both triples have in turn non-asserted quoted triples in subject and object with data form one source + +**Error expected?** No + +**Input** +``` +c1,c2,c3,c4,c5,c6,c7,c8 +s1,o1,s2,o2,s3,o3,s4,o4 + +``` + +**Mapping** +``` +@prefix rdf: . +@prefix rml: . +@prefix ex: . +@prefix xsd: . +@prefix : . +@base . + +:elementaryTM1 a rml:NonAssertedTriplesMap ; + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:template "http://example/{c1}" + ]; + rml:predicateObjectMap [ + rml:predicate ex:p1 ; + rml:objectMap [ + rml:template "http://example/{c2}" + ] + ] . + +:firstJoinTM a rml:NonAssertedTriplesMap ; + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:quotedTriplesMap :elementaryTM1 + ]; + rml:predicateObjectMap [ + rml:predicate ex:q1; ; + rml:objectMap [ + rml:quotedTriplesMap :elementaryTM2 + ] + ] . + +:elementaryTM2 a rml:NonAssertedTriplesMap ; + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:template "http://example/{c3}" + ]; + rml:predicateObjectMap [ + rml:predicate ex:p2 ; + rml:objectMap [ + rml:template "http://example/{c4}" + ] + ] . + +:centralJoinTM a rml:AssertedTriplesMap ; + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:quotedTriplesMap :firstJoinTM + ]; + rml:predicateObjectMap [ + rml:predicate ex:q2; + rml:objectMap [ + rml:quotedTriplesMap :secondJoinTM + ] + ] . + +:elementaryTM3 a rml:NonAssertedTriplesMap ; + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:template "http://example/{c5}" + ]; + rml:predicateObjectMap [ + rml:predicate ex:p3 ; + rml:objectMap [ + rml:template "http://example/{c6}" + ] + ] . + +:secondJoinTM a rml:NonAssertedTriplesMap ; + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:quotedTriplesMap :elementaryTM3 + ]; + rml:predicateObjectMap [ + rml:predicate ex:q3; ; + rml:objectMap [ + rml:quotedTriplesMap :elementaryTM4 + ] + ] . + +:elementaryTM4 a rml:NonAssertedTriplesMap ; + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:template "http://example/{c7}" + ]; + rml:predicateObjectMap [ + rml:predicate ex:p4 ; + rml:objectMap [ + rml:template "http://example/{c8}" + ] + ] . + +``` + +**Output** +``` +<<<<>><<>>>><<<<>><<>>>>. + +``` + diff --git a/src/test/resources/rml-star/RMLSTARTC008a/data.csv b/src/test/resources/rml-star/RMLSTARTC008a/data.csv new file mode 100644 index 00000000..48f51863 --- /dev/null +++ b/src/test/resources/rml-star/RMLSTARTC008a/data.csv @@ -0,0 +1,2 @@ +c1,c2,c3,c4,c5,c6,c7,c8 +s1,o1,s2,o2,s3,o3,s4,o4 diff --git a/src/test/resources/rml-star/RMLSTARTC008a/mapping.ttl b/src/test/resources/rml-star/RMLSTARTC008a/mapping.ttl new file mode 100644 index 00000000..9144682f --- /dev/null +++ b/src/test/resources/rml-star/RMLSTARTC008a/mapping.ttl @@ -0,0 +1,125 @@ +@prefix rdf: . +@prefix rml: . +@prefix ex: . +@prefix xsd: . +@prefix : . +@base . + +:elementaryTM1 a rml:NonAssertedTriplesMap ; + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:template "http://example/{c1}" + ]; + rml:predicateObjectMap [ + rml:predicate ex:p1 ; + rml:objectMap [ + rml:template "http://example/{c2}" + ] + ] . + +:firstJoinTM a rml:NonAssertedTriplesMap ; + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:quotedTriplesMap :elementaryTM1 + ]; + rml:predicateObjectMap [ + rml:predicate ex:q1; ; + rml:objectMap [ + rml:quotedTriplesMap :elementaryTM2 + ] + ] . + +:elementaryTM2 a rml:NonAssertedTriplesMap ; + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:template "http://example/{c3}" + ]; + rml:predicateObjectMap [ + rml:predicate ex:p2 ; + rml:objectMap [ + rml:template "http://example/{c4}" + ] + ] . + +:centralJoinTM a rml:AssertedTriplesMap ; + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:quotedTriplesMap :firstJoinTM + ]; + rml:predicateObjectMap [ + rml:predicate ex:q2; + rml:objectMap [ + rml:quotedTriplesMap :secondJoinTM + ] + ] . + +:elementaryTM3 a rml:NonAssertedTriplesMap ; + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:template "http://example/{c5}" + ]; + rml:predicateObjectMap [ + rml:predicate ex:p3 ; + rml:objectMap [ + rml:template "http://example/{c6}" + ] + ] . + +:secondJoinTM a rml:NonAssertedTriplesMap ; + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:quotedTriplesMap :elementaryTM3 + ]; + rml:predicateObjectMap [ + rml:predicate ex:q3; ; + rml:objectMap [ + rml:quotedTriplesMap :elementaryTM4 + ] + ] . + +:elementaryTM4 a rml:NonAssertedTriplesMap ; + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:template "http://example/{c7}" + ]; + rml:predicateObjectMap [ + rml:predicate ex:p4 ; + rml:objectMap [ + rml:template "http://example/{c8}" + ] + ] . diff --git a/src/test/resources/rml-star/RMLSTARTC008a/output.nt b/src/test/resources/rml-star/RMLSTARTC008a/output.nt new file mode 100644 index 00000000..fe36da8e --- /dev/null +++ b/src/test/resources/rml-star/RMLSTARTC008a/output.nt @@ -0,0 +1 @@ +<<<<>><<>>>><<<<>><<>>>>. diff --git a/src/test/resources/rml-star/RMLSTARTC008b/README.md b/src/test/resources/rml-star/RMLSTARTC008b/README.md new file mode 100644 index 00000000..fa79a530 --- /dev/null +++ b/src/test/resources/rml-star/RMLSTARTC008b/README.md @@ -0,0 +1,163 @@ +## RMLSTARTC008b + +**Title**: two-level non-asserted quoted triple in subject and object two-fold, two sources + +**Description**: Tests the creation of a triple with non-asserted quoted triples as subject and object, both triples have in turn non-asserted quoted triples in subject and object with data form two sources + +**Error expected?** No + +**Input** +``` +c1-1,c1-2,c1-3,c1-4,c1-5 +s1,o1,s2,o2,1 + +``` + +**Input 1** +``` +**Input 1** +c2-1,c2-2,c2-3,c2-4,c2-5 +s3,o3,s4,o4,1 + +``` + +**Mapping** +``` +@prefix rdf: . +@prefix rml: . +@prefix ex: . +@prefix xsd: . +@prefix : . +@base . + +:elementaryTM1 a rml:NonAssertedTriplesMap ; + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data1.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:template "http://example/{c1-1}" + ]; + rml:predicateObjectMap [ + rml:predicate ex:p1 ; + rml:objectMap [ + rml:template "http://example/{c1-2}" + ] + ] . + +:firstJoinTM a rml:NonAssertedTriplesMap ; + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data1.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:quotedTriplesMap :elementaryTM1 + ]; + rml:predicateObjectMap [ + rml:predicate ex:q1; ; + rml:objectMap [ + rml:quotedTriplesMap :elementaryTM2 + ] + ] . + +:elementaryTM2 a rml:NonAssertedTriplesMap ; + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data1.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:template "http://example/{c1-3}" + ]; + rml:predicateObjectMap [ + rml:predicate ex:p2 ; + rml:objectMap [ + rml:template "http://example/{c1-4}" + ] + ] . + +:centralJoinTM a rml:AssertedTriplesMap ; + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data2.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:quotedTriplesMap :firstJoinTM ; + rml:joinCondition [ + rml:child "c2-5" ; + rml:parent "c1-5" ; + ]; + ]; + rml:predicateObjectMap [ + rml:predicate ex:q2; + rml:objectMap [ + rml:quotedTriplesMap :secondJoinTM + ] + ] . + +:elementaryTM3 a rml:NonAssertedTriplesMap ; + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data2.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:template "http://example/{c2-1}" + ]; + rml:predicateObjectMap [ + rml:predicate ex:p3 ; + rml:objectMap [ + rml:template "http://example/{c2-2}" + ] + ] . + +:secondJoinTM a rml:NonAssertedTriplesMap ; + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data2.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:quotedTriplesMap :elementaryTM3 + ]; + rml:predicateObjectMap [ + rml:predicate ex:q3; ; + rml:objectMap [ + rml:quotedTriplesMap :elementaryTM4 + ] + ] . + +:elementaryTM4 a rml:NonAssertedTriplesMap ; + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data2.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:template "http://example/{c2-3}" + ]; + rml:predicateObjectMap [ + rml:predicate ex:p4 ; + rml:objectMap [ + rml:template "http://example/{c2-4}" + ] + ] . + +``` + +**Output** +``` +<<<<>><<>>>><<<<>><<>>>>. + +``` + diff --git a/src/test/resources/rml-star/RMLSTARTC008b/data1.csv b/src/test/resources/rml-star/RMLSTARTC008b/data1.csv new file mode 100644 index 00000000..1f57ab59 --- /dev/null +++ b/src/test/resources/rml-star/RMLSTARTC008b/data1.csv @@ -0,0 +1,2 @@ +c1-1,c1-2,c1-3,c1-4,c1-5 +s1,o1,s2,o2,1 diff --git a/src/test/resources/rml-star/RMLSTARTC008b/data2.csv b/src/test/resources/rml-star/RMLSTARTC008b/data2.csv new file mode 100644 index 00000000..ffa3f9ca --- /dev/null +++ b/src/test/resources/rml-star/RMLSTARTC008b/data2.csv @@ -0,0 +1,3 @@ +**Input 1** +c2-1,c2-2,c2-3,c2-4,c2-5 +s3,o3,s4,o4,1 diff --git a/src/test/resources/rml-star/RMLSTARTC008b/mapping.ttl b/src/test/resources/rml-star/RMLSTARTC008b/mapping.ttl new file mode 100644 index 00000000..ee753626 --- /dev/null +++ b/src/test/resources/rml-star/RMLSTARTC008b/mapping.ttl @@ -0,0 +1,129 @@ +@prefix rdf: . +@prefix rml: . +@prefix ex: . +@prefix xsd: . +@prefix : . +@base . + +:elementaryTM1 a rml:NonAssertedTriplesMap ; + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data1.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:template "http://example/{c1-1}" + ]; + rml:predicateObjectMap [ + rml:predicate ex:p1 ; + rml:objectMap [ + rml:template "http://example/{c1-2}" + ] + ] . + +:firstJoinTM a rml:NonAssertedTriplesMap ; + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data1.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:quotedTriplesMap :elementaryTM1 + ]; + rml:predicateObjectMap [ + rml:predicate ex:q1; ; + rml:objectMap [ + rml:quotedTriplesMap :elementaryTM2 + ] + ] . + +:elementaryTM2 a rml:NonAssertedTriplesMap ; + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data1.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:template "http://example/{c1-3}" + ]; + rml:predicateObjectMap [ + rml:predicate ex:p2 ; + rml:objectMap [ + rml:template "http://example/{c1-4}" + ] + ] . + +:centralJoinTM a rml:AssertedTriplesMap ; + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data2.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:quotedTriplesMap :firstJoinTM ; + rml:joinCondition [ + rml:child "c2-5" ; + rml:parent "c1-5" ; + ]; + ]; + rml:predicateObjectMap [ + rml:predicate ex:q2; + rml:objectMap [ + rml:quotedTriplesMap :secondJoinTM + ] + ] . + +:elementaryTM3 a rml:NonAssertedTriplesMap ; + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data2.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:template "http://example/{c2-1}" + ]; + rml:predicateObjectMap [ + rml:predicate ex:p3 ; + rml:objectMap [ + rml:template "http://example/{c2-2}" + ] + ] . + +:secondJoinTM a rml:NonAssertedTriplesMap ; + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data2.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:quotedTriplesMap :elementaryTM3 + ]; + rml:predicateObjectMap [ + rml:predicate ex:q3; ; + rml:objectMap [ + rml:quotedTriplesMap :elementaryTM4 + ] + ] . + +:elementaryTM4 a rml:NonAssertedTriplesMap ; + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data2.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:template "http://example/{c2-3}" + ]; + rml:predicateObjectMap [ + rml:predicate ex:p4 ; + rml:objectMap [ + rml:template "http://example/{c2-4}" + ] + ] . diff --git a/src/test/resources/rml-star/RMLSTARTC008b/output.nt b/src/test/resources/rml-star/RMLSTARTC008b/output.nt new file mode 100644 index 00000000..fe36da8e --- /dev/null +++ b/src/test/resources/rml-star/RMLSTARTC008b/output.nt @@ -0,0 +1 @@ +<<<<>><<>>>><<<<>><<>>>>. diff --git a/src/test/resources/rml-star/RMLSTARTC009/README.md b/src/test/resources/rml-star/RMLSTARTC009/README.md new file mode 100644 index 00000000..b6c8fb65 --- /dev/null +++ b/src/test/resources/rml-star/RMLSTARTC009/README.md @@ -0,0 +1,59 @@ +## RMLSTARTC009 + +**Title**: Quoted triples as predicate map + +**Description**: Test the use quoted triples for generating the predicates, which is not possible + +**Error expected?** Yes + +**Input** +``` +c1,c2,c3,c4 +a,s,o,z + +``` + +**Mapping** +``` +@prefix rdf: . +@prefix rml: . +@prefix ex: . +@prefix : . +@base . + +:firstTM a rml:AssertedTriplesMap ; + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:template "http://example/{c1}" + ]; + rml:predicateObjectMap [ + rml:quotedTriplesMap :secondTM ; + rml:objectMap [ + rml:template "http://example/{c4}" + ] + ] . + +:secondTM a rml:NonAssertedTriplesMap ; + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:template "http://example/{c2}" + ]; + rml:predicateObjectMap [ + rml:predicate ex:p ; + rml:objectMap [ + rml:template "http://example/{c3}" + ] + ] . + +``` + diff --git a/src/test/resources/rml-star/RMLSTARTC009/data.csv b/src/test/resources/rml-star/RMLSTARTC009/data.csv new file mode 100644 index 00000000..9e93cb60 --- /dev/null +++ b/src/test/resources/rml-star/RMLSTARTC009/data.csv @@ -0,0 +1,2 @@ +c1,c2,c3,c4 +a,s,o,z diff --git a/src/test/resources/rml-star/RMLSTARTC009/mapping.ttl b/src/test/resources/rml-star/RMLSTARTC009/mapping.ttl new file mode 100644 index 00000000..311477dc --- /dev/null +++ b/src/test/resources/rml-star/RMLSTARTC009/mapping.ttl @@ -0,0 +1,39 @@ +@prefix rdf: . +@prefix rml: . +@prefix ex: . +@prefix : . +@base . + +:firstTM a rml:AssertedTriplesMap ; + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:template "http://example/{c1}" + ]; + rml:predicateObjectMap [ + rml:quotedTriplesMap :secondTM ; + rml:objectMap [ + rml:template "http://example/{c4}" + ] + ] . + +:secondTM a rml:NonAssertedTriplesMap ; + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:template "http://example/{c2}" + ]; + rml:predicateObjectMap [ + rml:predicate ex:p ; + rml:objectMap [ + rml:template "http://example/{c3}" + ] + ] . diff --git a/src/test/resources/rml-star/RMLSTARTC010/README.md b/src/test/resources/rml-star/RMLSTARTC010/README.md new file mode 100644 index 00000000..5c7fe8e7 --- /dev/null +++ b/src/test/resources/rml-star/RMLSTARTC010/README.md @@ -0,0 +1,57 @@ +## RMLSTARTC010 + +**Title**: Quoted triples as object without object map + +**Description**: Test the use quoted triples for generating the object maps but without defining the object map, which is not possible + +**Error expected?** Yes + +**Input** +``` +c1,c2,c3,c4 +a,s,o,z + +``` + +**Mapping** +``` +@prefix rml: . +@prefix rdf: . +@prefix ex: . +@prefix : . +@base . + +:firstTM a rml:AssertedTriplesMap, rml:NonAssertedTriplesMap ; + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:template "http://example/{c1}" + ]; + rml:predicateObjectMap [ + rml:predicate ex:p; + rml:quotedTriplesMap :secondTM ; + ] . + +:secondTM a rml:NonAssertedTriplesMap ; + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:template "http://example/{c2}" + ]; + rml:predicateObjectMap [ + rml:predicate ex:p ; + rml:objectMap [ + rml:template "http://example/{c3}" + ] + ] . + +``` + diff --git a/src/test/resources/rml-star/RMLSTARTC010/data.csv b/src/test/resources/rml-star/RMLSTARTC010/data.csv new file mode 100644 index 00000000..9e93cb60 --- /dev/null +++ b/src/test/resources/rml-star/RMLSTARTC010/data.csv @@ -0,0 +1,2 @@ +c1,c2,c3,c4 +a,s,o,z diff --git a/src/test/resources/rml-star/RMLSTARTC010/mapping.ttl b/src/test/resources/rml-star/RMLSTARTC010/mapping.ttl new file mode 100644 index 00000000..48960292 --- /dev/null +++ b/src/test/resources/rml-star/RMLSTARTC010/mapping.ttl @@ -0,0 +1,37 @@ +@prefix rml: . +@prefix rdf: . +@prefix ex: . +@prefix : . +@base . + +:firstTM a rml:AssertedTriplesMap, rml:NonAssertedTriplesMap ; + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:template "http://example/{c1}" + ]; + rml:predicateObjectMap [ + rml:predicate ex:p; + rml:quotedTriplesMap :secondTM ; + ] . + +:secondTM a rml:NonAssertedTriplesMap ; + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:template "http://example/{c2}" + ]; + rml:predicateObjectMap [ + rml:predicate ex:p ; + rml:objectMap [ + rml:template "http://example/{c3}" + ] + ] . diff --git a/src/test/resources/rml-star/config.js b/src/test/resources/rml-star/config.js new file mode 100644 index 00000000..a967e7c7 --- /dev/null +++ b/src/test/resources/rml-star/config.js @@ -0,0 +1,72 @@ +async function loadTurtle() { + //this is the function you call in 'preProcess', to load the highlighter + const worker = await new Promise(resolve => { + require(["core/worker"], ({ worker }) => resolve(worker)); + }); + const action = "highlight-load-lang"; + const langURL = + "https://cdn.jsdelivr.net/gh/redmer/highlightjs-turtle/src/languages/turtle.js"; + const propName = "hljsDefineTurtle"; // This funtion is defined in the highlighter being loaded + const lang = "turtle"; // this is the class you use to identify the language + worker.postMessage({ action, langURL, propName, lang }); + return new Promise(resolve => { + worker.addEventListener("message", function listener({ data }) { + const { action: responseAction, lang: responseLang } = data; + if (responseAction === action && responseLang === lang) { + worker.removeEventListener("message", listener); + resolve(); + } + }); + }); +} + +var respecConfig = { + // check https://respec.org/docs/ for the meaning of these keys + preProcess: [loadTurtle], + authors: [ + { + name: "Dylan Van Assche", + url: "https://dylanvanassche.be", + company: "IDLab – Ghent University – imec", + orcid: "0000-0002-7195-9935", + companyURL: "https://knows.idlab.ugent.be/" + } + ], + edDraftURI: "https://w3id.org/rml/star/test-cases/", + editors: [ + { + name: "Dylan Van Assche", + url: "https://dylanvanassche.be", + company: "IDLab – Ghent University – imec", + orcid: "0000-0002-7195-9935", + companyURL: "https://knows.idlab.ugent.be/" + } + ], + formerEditors: [ + ], + github: "https://github.com/kg-construct/rml-io", + license: "w3c-software-doc", + localBiblio: { + "RML-Core": { + title: "RML-Core", + href: "https://w3id.org/rml/core/spec", + status: "Draft Community Group Report", + publisher: "W3C", + date: "07 August 2024", + }, + "RML-IO": { + title: "RML-IO", + href: "https://w3id.org/rml/io/spec", + status: "Draft Community Group Report", + publisher: "W3C", + date: "12 March 2024", + }, + }, + otherLinks: [], + shortName: "RML-Star-Testcases", + specStatus: "CG-DRAFT", + // W3C config + copyrightStart: "2024", + doJsonLd: true, + group: "kg-construct", +}; diff --git a/src/test/resources/rml-star/descriptions.csv b/src/test/resources/rml-star/descriptions.csv new file mode 100644 index 00000000..69063261 --- /dev/null +++ b/src/test/resources/rml-star/descriptions.csv @@ -0,0 +1,19 @@ +RML id,title,purpose,part of spec,data format,ref. formulation,error expected?,input file 1,input file 2,input file 3,comment +RMLSTARTC001a,"quoted triple in subject, one source, blank node in quoted subject",Tests the creation of a asserted quoted triple (with a blank node as subject) in the position of subject with data from one file,,CSV,CSV,no,data.csv,,, +RMLSTARTC001b,"quoted triple in subject, two sources, blank node in quoted subject",Tests the creation of a asserted quoted triple (with a blank node as subject) in the position of subject with data from two files,,CSV,CSV,no,data1.csv,data2.csv,, +RMLSTARTC002a,"quoted triple in subject, one source, blank node in quoted object",Tests the creation of a asserted quoted triple (with a blank node as object) in the position of subject with data from one file,,CSV,CSV,no,data.csv,,, +RMLSTARTC002b,"quoted triple in subject, two sources, blank node in quoted object",Tests the creation of a asserted quoted triple (with a blank node as object) in the position of subject with data from two files,,CSV,CSV,no,data1.csv,data2.csv,, +RMLSTARTC003a,"two-level quoted triple in subject, one source",Tests the creation of two-level recursiveness of asserted quoted triples as subjects with data from one file,,CSV,CSV,no,data.csv,,, +RMLSTARTC003b,"two-level quoted triple in subject, two sources",Tests the creation of two-level recursiveness of asserted quoted triples as subjects with data from two files,,CSV,CSV,no,data1.csv,data2.csv,, +RMLSTARTC004a,"two-level quoted triple in subject and object, one source","Tests the creation of two-level recursiveness of asserted quoted triples as first as object, second as subject with data from one file",,CSV,CSV,no,data.csv,,, +RMLSTARTC004b,"two-level quoted triple in subject and object, two sources","Tests the creation of two-level recursiveness of asserted quoted triples as first as object, second as subject with data from two sources",,CSV,CSV,no,data1.csv,data2.csv,, +RMLSTARTC005a,"non-asserted quoted triple in subject, one source",Tests the creation of a non-asserted quoted triple in the position of subject with data from one file,,CSV,CSV,no,data.csv,,, +RMLSTARTC005b,"non-asserted quoted triple in subject, two sources",Tests the creation of a non-asserted quoted triple in the position of subject with data from two files,,CSV,CSV,no,data1.csv,data2.csv,, +RMLSTARTC006a,"non-asserted quoted triple in object, one source",Tests the creation of a non-asserted quoted triple in the position of object with data from one file,,CSV,CSV,no,data.csv,,, +RMLSTARTC006b,"non-asserted quoted triple in object, two sources",Tests the creation of a non-asserted quoted triple in the position of object with data from two files,,CSV,CSV,no,data1.csv,data2.csv,, +RMLSTARTC007a,"non-asserted quoted triples in subject and object, one source","Tests the creation of a two non-asserted quoted triples, one in the position of subject and other in object with data from one file",,CSV,CSV,no,data.csv,,, +RMLSTARTC007b,"non-asserted quoted triples in subject and object, two sources","Tests the creation of a two non-asserted quoted triples, one in the position of subject and other in object with data from two sources",,CSV,CSV,no,data1.csv,data2.csv,, +RMLSTARTC008a,"two-level non-asserted quoted triple in subject and object two-fold, one source","Tests the creation of a triple with non-asserted quoted triples as subject and object, both triples have in turn non-asserted quoted triples in subject and object with data form one source",,CSV,CSV,no,data.csv,,, +RMLSTARTC008b,"two-level non-asserted quoted triple in subject and object two-fold, two sources","Tests the creation of a triple with non-asserted quoted triples as subject and object, both triples have in turn non-asserted quoted triples in subject and object with data form two sources",,CSV,CSV,no,data1.csv,data2.csv,, +RMLSTARTC009,"Quoted triples as predicate map","Test the use quoted triples for generating the predicates, which is not possible",,CSV,CSV,yes,data.csv,,, +RMLSTARTC010,"Quoted triples as object without object map","Test the use quoted triples for generating the object maps but without defining the object map, which is not possible",,CSV,CSV,yes,data.csv,,, \ No newline at end of file diff --git a/src/test/resources/rml-star/dev.html b/src/test/resources/rml-star/dev.html new file mode 100644 index 00000000..1a97616f --- /dev/null +++ b/src/test/resources/rml-star/dev.html @@ -0,0 +1,118 @@ + + + + + RML-Star: Test Cases + + + + + + + + + + +
+ +
+ +
+ +
+ +
+ + +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ + + + diff --git a/src/test/resources/rml-star/docs/20250130/index.html b/src/test/resources/rml-star/docs/20250130/index.html new file mode 100644 index 00000000..d764af76 --- /dev/null +++ b/src/test/resources/rml-star/docs/20250130/index.html @@ -0,0 +1,1895 @@ + + + + + + +RML-Star: Test Cases + + + + + + + + + + + + + + +
+ +

RML-Star: Test Cases

+

+ Draft Community Group Report + +

+
+ +
Latest published version:
+ https://www.w3.org/RML-Star-Testcases/ +
+
Latest editor's draft:
https://w3id.org/rml/star/test-cases/
+ + + + +
Editor:
+ Dylan Van Assche + + + + (IDLab – Ghent University – imec) +
+ +
Author:
+ Dylan Van Assche + + + + (IDLab – Ghent University – imec) +
+
Feedback:
+ GitHub kg-construct/rml-io + (pull requests, + new issue, + open issues) +
+ +
+ + +
+
+ + + +

Abstract

This document defines the RML-Star test cases to the determine the RML-Star specification conformance of tools.

+
+ +

Status of This Document

+ This specification was published by the + Knowledge Graph Construction Community Group. It is not a W3C Standard nor is it + on the W3C Standards Track. + + Please note that under the + W3C Community Contributor License Agreement (CLA) + there is a limited opt-out and other conditions apply. + + Learn more about + W3C Community and Business Groups. +

+ GitHub Issues are preferred for + discussion of this specification. + + +

+ +

1. Introduction

+

This document defines the RML-Star test cases, consisting of a collection of test case documents (input and expected output). +The purpose of the test cases is to determine the conformance of tools that execute RML rules to the RML-Star specification.

+
+ +

2. Data model

+

The test cases are semantically described for re-usability and shareability following the W3C Test case description. +Each test:Testcase as the following properties:

+
    +
  • dcterms:identifier: unique ID of the test case.
  • +
  • rmltest:hasError: if an error of the RML Processor is expected or not.
  • +
  • rmltest:input: One or more input data of the test case.
  • +
  • rmltest:output: One or more output data of the test case.
  • +
  • rmltest:inputFormat: the input data format.
  • +
  • rmltest:outputFormat: the output data format.
  • +
  • rmltest:mappingDocument: the RML mapping rules in Turtle.
  • +
+
+ +

3. Test cases

+

This section describes the RML-Star test cases. These descriptions are also available as RDF. +The files are available on GitHub in the folder test-cases. +Each test case is contained in a single folder, containing three types of files:

+
    +
  • Zero or more files containing the data sources, in the case of JSON, XML, CSV, or containing the SQL statements to create the necessary tables, in the case of MySQL, PostgreSQL, and SQL Server.
  • +
  • One file with the RML rules, called mapping.ttl, in the Turtle format.
  • +
  • Zero or more files with the expected RDF. No file is provided if an error is expected that must halt the generation of the RDF because of an error.
  • +
+
+ + +

4. RMLSTARTC001a

+

Title: quoted triple in subject, one source, blank node in quoted subject

+

Description: Tests the creation of a asserted quoted triple (with a blank node as subject) in the position of subject with data from one file

+

Error expected? No

+

Input

+
c1,c2,c3
+b0,o,ABC
+
+

Mapping

+
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix ex: <http://example/> .
+@prefix : <http://example.org/> .
+@base <http://example.org/> .
+
+:firstTM a rml:AssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:reference "c1" ;
+        rml:termType rml:BlankNode
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:p ;
+        rml:objectMap [
+            rml:template "http://example/{c2}"
+        ]
+    ] .
+
+:secondTM a rml:AssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:quotedTriplesMap :firstTM
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:q ;
+        rml:objectMap [
+            rml:reference "c3"
+        ]
+    ] .
+
+

Output

+
_:b0 <http://example/p> <http://example/o> .
+<< _:b0 <http://example/p> <http://example/o> >> <http://example/q> "ABC" .
+
+
+

5. RMLSTARTC001b

+

Title: quoted triple in subject, two sources, blank node in quoted subject

+

Description: Tests the creation of a asserted quoted triple (with a blank node as subject) in the position of subject with data from two files

+

Error expected? No

+

Input

+
c1-1,c1-2,c1-3
+b0,o,1
+
+

Input 1

+
c2-1,c2-2
+ABC,1
+
+

Mapping

+
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix ex: <http://example/> .
+@prefix : <http://example.org/> .
+@base <http://example.org/> .
+
+:firstTM a rml:AssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data1.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:reference "c1-1" ;
+        rml:termType rml:BlankNode
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:p ;
+        rml:objectMap [
+            rml:template "http://example/{c1-2}"
+        ]
+    ] .
+
+:secondTM a rml:AssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data2.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:quotedTriplesMap :firstTM ;
+        rml:joinCondition [
+          rml:child "c2-2" ;
+          rml:parent "c1-3" ;
+        ];
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:q ;
+        rml:objectMap [
+            rml:reference "c2-1"
+        ]
+    ] .
+
+

Output

+
_:b0 <http://example/p> <http://example/o> .
+<< _:b0 <http://example/p> <http://example/o> >> <http://example/q> "ABC" .
+
+
+

6. RMLSTARTC002a

+

Title: quoted triple in subject, one source, blank node in quoted object

+

Description: Tests the creation of a asserted quoted triple (with a blank node as object) in the position of subject with data from one file

+

Error expected? No

+

Input

+
c1,c2,c3
+s,b1,456
+
+

Mapping

+
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix ex: <http://example/> .
+@prefix : <http://example.org/> .
+@base <http://example.org/> .
+
+:firstTM a rml:AssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example/{c1}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:p ;
+        rml:objectMap [
+            rml:reference "c2" ;
+            rml:termType rml:BlankNode
+        ]
+    ] .
+
+:secondTM a rml:AssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:quotedTriplesMap :firstTM
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:q ;
+        rml:objectMap [
+            rml:reference "c3";
+            rml:datatype xsd:integer
+        ]
+    ] .
+
+

Output

+
<http://example/s> <http://example/p> _:b1 .
+<< <http://example/s> <http://example/p> _:b1 >> <http://example/q> "456"^^<http://www.w3.org/2001/XMLSchema#integer> .
+
+
+

7. RMLSTARTC002b

+

Title: quoted triple in subject, two sources, blank node in quoted object

+

Description: Tests the creation of a asserted quoted triple (with a blank node as object) in the position of subject with data from two files

+

Error expected? No

+

Input

+
c1-1,c1-2,c1-3
+s,b1,1
+
+

Input 1

+
c2-1,c2-2
+456,1
+
+

Mapping

+
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix ex: <http://example/> .
+@prefix : <http://example.org/> .
+@base <http://example.org/> .
+
+:firstTM a rml:AssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data1.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example/{c1-1}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:p ;
+        rml:objectMap [
+            rml:reference "c1-2" ;
+            rml:termType rml:BlankNode
+        ]
+    ] .
+
+:secondTM a rml:AssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data2.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:quotedTriplesMap :firstTM ;
+        rml:joinCondition [
+          rml:child "c2-2" ;
+          rml:parent "c1-3" ;
+        ];
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:q ;
+        rml:objectMap [
+            rml:reference "c2-1";
+            rml:datatype xsd:integer
+        ]
+    ] .
+
+

Output

+
<http://example/s> <http://example/p> _:b1 .
+<< <http://example/s> <http://example/p> _:b1 >> <http://example/q> "456"^^<http://www.w3.org/2001/XMLSchema#integer> .
+
+
+

8. RMLSTARTC003a

+

Title: two-level quoted triple in subject, one source

+

Description: Tests the creation of two-level recursiveness of asserted quoted triples as subjects with data from one file

+

Error expected? No

+

Input

+
c1,c2,c3,c4
+s,o,z,1
+
+

Mapping

+
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix ex: <http://example/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+@base <http://example.org/> .
+
+:firstTM a rml:AssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example/{c1}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:p ;
+        rml:objectMap [
+            rml:template "http://example/{c2}"
+        ]
+    ] .
+
+:secondTM a rml:AssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:quotedTriplesMap :firstTM
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:r ;
+        rml:objectMap [
+            rml:template "http://example/{c3}"
+        ]
+    ] .
+
+:thirdTM a rml:AssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:quotedTriplesMap :secondTM
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:q ;
+        rml:objectMap [
+            rml:reference "c4" ;
+            rml:datatype xsd:integer
+        ]
+    ] .
+
+

Output

+
<http://example/s> <http://example/p> <http://example/o> .
+<< <http://example/s> <http://example/p> <http://example/o> >> <http://example/r> <http://example/z> .
+<< << <http://example/s> <http://example/p> <http://example/o> >> <http://example/r> <http://example/z> >> <http://example/q> "1"^^<http://www.w3.org/2001/XMLSchema#integer> .
+
+
+

9. RMLSTARTC003b

+

Title: two-level quoted triple in subject, two sources

+

Description: Tests the creation of two-level recursiveness of asserted quoted triples as subjects with data from two files

+

Error expected? No

+

Input

+
c1-1,c1-2,c1-3,c1-4
+s,o,z,1
+
+

Input 1

+
c2-1,c2-2
+1,1
+
+

Mapping

+
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix ex: <http://example/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+@base <http://example.org/> .
+
+:firstTM a rml:AssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data1.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example/{c1-1}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:p ;
+        rml:objectMap [
+            rml:template "http://example/{c1-2}"
+        ]
+    ] .
+
+:secondTM a rml:AssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data1.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:quotedTriplesMap :firstTM
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:r ;
+        rml:objectMap [
+            rml:template "http://example/{c1-3}"
+        ]
+    ] .
+
+:thirdTM a rml:AssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data2.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:quotedTriplesMap :secondTM;
+        rml:joinCondition [
+          rml:child "c2-2" ;
+          rml:parent "c1-4" ;
+        ];
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:q ;
+        rml:objectMap [
+            rml:reference "c2-1" ;
+            rml:datatype xsd:integer
+        ]
+    ] .
+
+

Output

+
<http://example/s> <http://example/p> <http://example/o> .
+<< <http://example/s> <http://example/p> <http://example/o> >> <http://example/r> <http://example/z> .
+<< << <http://example/s> <http://example/p> <http://example/o> >> <http://example/r> <http://example/z> >> <http://example/q> "1"^^<http://www.w3.org/2001/XMLSchema#integer> .
+
+
+

10. RMLSTARTC004a

+

Title: two-level quoted triple in subject and object, one source

+

Description: Tests the creation of two-level recursiveness of asserted quoted triples as first as object, second as subject with data from one file

+

Error expected? No

+

Input

+
c1,c2,c3,c4
+s,o,a,z
+
+

Mapping

+
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix ex: <http://example/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+@base <http://example.org/> .
+
+:firstTM a rml:AssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example/{c1}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:p ;
+        rml:objectMap [
+            rml:template "http://example/{c2}"
+        ]
+    ] .
+
+:secondTM a rml:AssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example/{c3}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:q ;
+        rml:objectMap [
+            rml:quotedTriplesMap :firstTM
+        ]
+    ] .
+
+:thirdTM a rml:AssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:quotedTriplesMap :secondTM
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:r ;
+        rml:objectMap [
+            rml:template "http://example/{c4}"
+        ]
+    ] .
+
+

Output

+
<http://example/s> <http://example/p> <http://example/o> .
+<http://example/a> <http://example/q> << <http://example/s> <http://example/p> <http://example/o> >> .
+<< <http://example/a> <http://example/q> << <http://example/s> <http://example/p> <http://example/o> >> >> <http://example/r> <http://example/z> .
+
+
+

11. RMLSTARTC004b

+

Title: two-level quoted triple in subject and object, two sources

+

Description: Tests the creation of two-level recursiveness of asserted quoted triples as first as object, second as subject with data from two sources

+

Error expected? No

+

Input

+
c1-1,c1-2,c1-3,c1-4
+s,o,a,1
+
+

Input 1

+
c2-1,c2-2
+z,1
+
+

Mapping

+
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix ex: <http://example/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+@base <http://example.org/> .
+
+:firstTM a rml:AssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data1.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example/{c1-1}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:p ;
+        rml:objectMap [
+            rml:template "http://example/{c1-2}"
+        ]
+    ] .
+
+:secondTM a rml:AssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data1.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example/{c1-3}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:q ;
+        rml:objectMap [
+            rml:quotedTriplesMap :firstTM
+        ]
+    ] .
+
+:thirdTM a rml:AssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data2.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:quotedTriplesMap :secondTM;
+        rml:joinCondition [
+          rml:child "c2-2" ;
+          rml:parent "c1-4" ;
+        ];
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:r ;
+        rml:objectMap [
+            rml:template "http://example/{c2-1}"
+        ]
+    ] .
+
+

Output

+
<http://example/s> <http://example/p> <http://example/o> .
+<http://example/a> <http://example/q> << <http://example/s> <http://example/p> <http://example/o> >> .
+<< <http://example/a> <http://example/q> << <http://example/s> <http://example/p> <http://example/o> >> >> <http://example/r> <http://example/z> .
+
+
+

12. RMLSTARTC005a

+

Title: non-asserted quoted triple in subject, one source

+

Description: Tests the creation of a non-asserted quoted triple in the position of subject with data from one file

+

Error expected? No

+

Input

+
c1,c2,c3
+s,o,z
+
+

Mapping

+
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix ex: <http://example/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+@base <http://example.org/> .
+
+:firstTM a rml:NonAssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example/{c1}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:p ;
+        rml:objectMap [
+            rml:template "http://example/{c2}"
+        ]
+    ] .
+
+:secondTM a rml:AssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+            rml:quotedTriplesMap :firstTM
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:q ;
+        rml:objectMap [
+            rml:template "http://example/{c3}"
+        ]
+    ] .
+
+

Output

+
<< <http://example/s> <http://example/p> <http://example/o> >> <http://example/q> <http://example/z> .
+
+
+

13. RMLSTARTC005b

+

Title: non-asserted quoted triple in subject, two sources

+

Description: Tests the creation of a non-asserted quoted triple in the position of subject with data from two files

+

Error expected? No

+

Input

+
c1-1,c1-2,c1-3
+s,o,1
+
+

Input 1

+
c2-1,c2-2
+z,1
+
+

Mapping

+
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix ex: <http://example/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+@base <http://example.org/> .
+
+:firstTM a rml:NonAssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data1.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example/{c1-1}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:p ;
+        rml:objectMap [
+            rml:template "http://example/{c1-2}"
+        ]
+    ] .
+
+:secondTM a rml:AssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data2.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+            rml:quotedTriplesMap :firstTM ;
+            rml:joinCondition [
+              rml:child "c2-2" ;
+              rml:parent "c1-3" ;
+            ];
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:q ;
+        rml:objectMap [
+            rml:template "http://example/{c2-1}"
+        ]
+    ] .
+
+

Output

+
<< <http://example/s> <http://example/p> <http://example/o> >> <http://example/q> <http://example/z> .
+
+
+

14. RMLSTARTC006a

+

Title: non-asserted quoted triple in object, one source

+

Description: Tests the creation of a non-asserted quoted triple in the position of object with data from one file

+

Error expected? No

+

Input

+
c1,c2,c3
+s,o,x
+
+

Mapping

+
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix ex: <http://example/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+@base <http://example.org/> .
+
+:firstTM a rml:NonAssertedTriplesMap ; # This refers to the y statement in the rdf-star
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example/{c1}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:p ;
+        rml:objectMap [
+            rml:template "http://example/{c2}"
+        ]
+    ] .
+
+:secondTM a rml:AssertedTriplesMap ;  # This refers to the x statement in the rdf-star
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+            rml:template "http://example/{c3}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:p; ;
+        rml:objectMap [
+            rml:quotedTriplesMap :firstTM
+        ]
+    ] .
+
+

Output

+
<http://example/x> <http://example/p> << <http://example/s> <http://example/p> <http://example/o> >> .
+
+
+

15. RMLSTARTC006b

+

Title: non-asserted quoted triple in object, two sources

+

Description: Tests the creation of a non-asserted quoted triple in the position of object with data from two files

+

Error expected? No

+

Input

+
c1-1,c1-2,c1-3
+s,o,1
+
+

Input 1

+
c2-1,c2-2
+x,1
+
+

Mapping

+
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix ex: <http://example/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+@base <http://example.org/> .
+
+:firstTM a rml:NonAssertedTriplesMap ; # This refers to the y statement in the rdf-star
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data1.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example/{c1-1}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:p ;
+        rml:objectMap [
+            rml:template "http://example/{c1-2}"
+        ]
+    ] .
+
+:secondTM a rml:AssertedTriplesMap ; # This refers to the x statement in the rdf-star
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data2.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+            rml:template "http://example/{c2-1}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:p; ;
+        rml:objectMap [
+            rml:quotedTriplesMap :firstTM ;
+            rml:joinCondition [
+              rml:child "c2-2" ;
+              rml:parent "c1-3" ;
+            ];
+        ]
+    ] .
+
+

Output

+
<http://example/x> <http://example/p> << <http://example/s> <http://example/p> <http://example/o> >> .
+
+
+

16. RMLSTARTC007a

+

Title: non-asserted quoted triples in subject and object, one source

+

Description: Tests the creation of a two non-asserted quoted triples, one in the position of subject and other in object with data from one file

+

Error expected? No

+

Input

+
c1,c2,c3,c4
+s1,o1,s2,o2
+
+

Mapping

+
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix ex: <http://example/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+@base <http://example.org/> .
+
+:firstTM a rml:NonAssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example/{c1}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:p1 ;
+        rml:objectMap [
+            rml:template "http://example/{c2}"
+        ]
+    ] .
+
+:secondTM a rml:AssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+            rml:quotedTriplesMap :firstTM
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:q; ;
+        rml:objectMap [
+            rml:quotedTriplesMap :thirdTM
+        ]
+    ] .
+
+:thirdTM a rml:NonAssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example/{c3}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:p2 ;
+        rml:objectMap [
+            rml:template "http://example/{c4}"
+        ]
+    ] .
+
+

Output

+
<< <http://example/s1> <http://example/p1> <http://example/o1> >> <http://example/q> << <http://example/s2> <http://example/p2> <http://example/o2> >> .
+
+
+

17. RMLSTARTC007b

+

Title: non-asserted quoted triples in subject and object, two sources

+

Description: Tests the creation of a two non-asserted quoted triples, one in the position of subject and other in object with data from two sources

+

Error expected? No

+

Input

+
c1-1,c1-2,c1-3
+s1,o1,1
+
+

Input 1

+
c2-1,c2-2,c2-3
+s2,o2,1
+
+

Mapping

+
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix ex: <http://example/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+@base <http://example.org/> .
+
+:firstTM a rml:NonAssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data1.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example/{c1-1}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:p1 ;
+        rml:objectMap [
+            rml:template "http://example/{c1-2}"
+        ]
+    ] .
+
+:secondTM a rml:AssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data2.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+            rml:quotedTriplesMap :firstTM ;
+            rml:joinCondition [
+              rml:child "c2-3" ;
+              rml:parent "c1-3" ;
+            ];
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:q; ;
+        rml:objectMap [
+            rml:quotedTriplesMap :thirdTM
+        ]
+    ] .
+
+:thirdTM a rml:NonAssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data2.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example/{c2-1}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:p2 ;
+        rml:objectMap [
+            rml:template "http://example/{c2-2}"
+        ]
+    ] .
+
+

Output

+
<< <http://example/s1> <http://example/p1> <http://example/o1> >> <http://example/q> << <http://example/s2> <http://example/p2> <http://example/o2> >> .
+
+
+

18. RMLSTARTC008a

+

Title: two-level non-asserted quoted triple in subject and object two-fold, one source

+

Description: Tests the creation of a triple with non-asserted quoted triples as subject and object, both triples have in turn non-asserted quoted triples in subject and object with data form one source

+

Error expected? No

+

Input

+
c1,c2,c3,c4,c5,c6,c7,c8
+s1,o1,s2,o2,s3,o3,s4,o4
+
+

Mapping

+
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix ex: <http://example/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+@base <http://example.org/> .
+
+:elementaryTM1 a rml:NonAssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example/{c1}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:p1 ;
+        rml:objectMap [
+            rml:template "http://example/{c2}"
+        ]
+    ] .
+
+:firstJoinTM a rml:NonAssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+            rml:quotedTriplesMap :elementaryTM1
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:q1; ;
+        rml:objectMap [
+            rml:quotedTriplesMap :elementaryTM2
+        ]
+    ] .
+
+:elementaryTM2 a rml:NonAssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example/{c3}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:p2 ;
+        rml:objectMap [
+            rml:template "http://example/{c4}"
+        ]
+    ] .
+
+:centralJoinTM a rml:AssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+            rml:quotedTriplesMap :firstJoinTM
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:q2;
+        rml:objectMap [
+            rml:quotedTriplesMap :secondJoinTM
+        ]
+    ] .
+
+:elementaryTM3 a rml:NonAssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example/{c5}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:p3 ;
+        rml:objectMap [
+            rml:template "http://example/{c6}"
+        ]
+    ] .
+
+:secondJoinTM a rml:NonAssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+            rml:quotedTriplesMap :elementaryTM3
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:q3; ;
+        rml:objectMap [
+            rml:quotedTriplesMap :elementaryTM4
+        ]
+    ] .
+
+:elementaryTM4 a rml:NonAssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example/{c7}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:p4 ;
+        rml:objectMap [
+            rml:template "http://example/{c8}"
+        ]
+    ] .
+
+

Output

+
<<<<<http://example/s1><http://example/p1><http://example/o1>>><http://example/q1><<<http://example/s2><http://example/p2><http://example/o2>>>>><http://example/q2><<<<<http://example/s3><http://example/p3><http://example/o3>>><http://example/q3><<<http://example/s4><http://example/p4><http://example/o4>>>>>.
+
+
+

19. RMLSTARTC008b

+

Title: two-level non-asserted quoted triple in subject and object two-fold, two sources

+

Description: Tests the creation of a triple with non-asserted quoted triples as subject and object, both triples have in turn non-asserted quoted triples in subject and object with data form two sources

+

Error expected? No

+

Input

+
c1-1,c1-2,c1-3,c1-4,c1-5
+s1,o1,s2,o2,1
+
+

Input 1

+
c2-1,c2-2,c2-3,c2-4,c2-5
+s3,o3,s4,o4,1
+
+

Mapping

+
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix ex: <http://example/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+@base <http://example.org/> .
+
+:elementaryTM1 a rml:NonAssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data1.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example/{c1-1}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:p1 ;
+        rml:objectMap [
+            rml:template "http://example/{c1-2}"
+        ]
+    ] .
+
+:firstJoinTM a rml:NonAssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data1.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+            rml:quotedTriplesMap :elementaryTM1
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:q1; ;
+        rml:objectMap [
+            rml:quotedTriplesMap :elementaryTM2
+        ]
+    ] .
+
+:elementaryTM2 a rml:NonAssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data1.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example/{c1-3}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:p2 ;
+        rml:objectMap [
+            rml:template "http://example/{c1-4}"
+        ]
+    ] .
+
+:centralJoinTM a rml:AssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data2.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+            rml:quotedTriplesMap :firstJoinTM ;
+            rml:joinCondition [
+              rml:child "c2-5" ;
+              rml:parent "c1-5" ;
+            ];
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:q2;
+        rml:objectMap [
+            rml:quotedTriplesMap :secondJoinTM
+        ]
+    ] .
+
+:elementaryTM3 a rml:NonAssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data2.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example/{c2-1}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:p3 ;
+        rml:objectMap [
+            rml:template "http://example/{c2-2}"
+        ]
+    ] .
+
+:secondJoinTM a rml:NonAssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data2.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+            rml:quotedTriplesMap :elementaryTM3
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:q3; ;
+        rml:objectMap [
+            rml:quotedTriplesMap :elementaryTM4
+        ]
+    ] .
+
+:elementaryTM4 a rml:NonAssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data2.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example/{c2-3}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:p4 ;
+        rml:objectMap [
+            rml:template "http://example/{c2-4}"
+        ]
+    ] .
+
+

Output

+
<<<<<http://example/s1><http://example/p1><http://example/o1>>><http://example/q1><<<http://example/s2><http://example/p2><http://example/o2>>>>><http://example/q2><<<<<http://example/s3><http://example/p3><http://example/o3>>><http://example/q3><<<http://example/s4><http://example/p4><http://example/o4>>>>>.
+
+
+

20. RMLSTARTC009

+

Title:

+

Description:

+

Error expected? Yes

+

Input

+
c1,c2,c3,c4
+a,s,o,z
+
+

Mapping

+
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix ex: <http://example/> .
+@prefix : <http://example.org/> .
+@base <http://example.org/> .
+
+:firstTM a rml:AssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example/{c1}" 
+    ];
+    rml:predicateObjectMap [
+        rml:quotedTriplesMap :secondTM ;
+        rml:objectMap [
+            rml:template "http://example/{c4}"
+        ]
+    ] .
+
+:secondTM a rml:NonAssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example/{c2}" 
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:p ;
+        rml:objectMap [
+            rml:template "http://example/{c3}" 
+        ]
+    ] .
+
+
+

21. RMLSTARTC010

+

Title:

+

Description:

+

Error expected? Yes

+

Input

+
c1,c2,c3,c4
+a,s,o,z
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix ex: <http://example/> .
+@prefix : <http://example.org/> .
+@base <http://example.org/> .
+
+:firstTM a rml:AssertedTriplesMap, rml:NonAssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example/{c1}" 
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:p;
+        rml:quotedTriplesMap :secondTM ;
+    ] .
+
+:secondTM a rml:NonAssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example/{c2}" 
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:p ;
+        rml:objectMap [
+            rml:template "http://example/{c3}" 
+        ]
+    ] .
+
+
+ + + + + \ No newline at end of file diff --git a/src/test/resources/rml-star/docs/20251029/index.html b/src/test/resources/rml-star/docs/20251029/index.html new file mode 100644 index 00000000..189b11a8 --- /dev/null +++ b/src/test/resources/rml-star/docs/20251029/index.html @@ -0,0 +1,2017 @@ + + + + + + +RML-Star: Test Cases + + + + + + + + + + + + + + + +
+ +

RML-Star: Test Cases

+

+ Draft Community Group Report + +

+
+ +
Latest published version:
+ https://www.w3.org/RML-Star-Testcases/ +
+
Latest editor's draft:
https://w3id.org/rml/star/test-cases/
+ + + + +
Editor:
+ Dylan Van Assche + + + + (IDLab – Ghent University – imec) +
+ +
Author:
+ Dylan Van Assche + + + + (IDLab – Ghent University – imec) +
+
Feedback:
+ GitHub kg-construct/rml-io + (pull requests, + new issue, + open issues) +
+ +
+ + +
+
+ + + +

Abstract

This document defines the RML-Star test cases to the determine the RML-Star specification conformance of tools.

+
+ +

Status of This Document

+ This specification was published by the + Knowledge Graph Construction Community Group. It is not a W3C Standard nor is it + on the W3C Standards Track. + + Please note that under the + W3C Community Contributor License Agreement (CLA) + there is a limited opt-out and other conditions apply. + + Learn more about + W3C Community and Business Groups. +

+ GitHub Issues are preferred for + discussion of this specification. + + +

+ +

1. Introduction

+

This document defines the RML-Star test cases, consisting of a collection of test case documents (input and expected output). +The purpose of the test cases is to determine the conformance of tools that execute RML rules to the RML-Star specification.

+
+ +

2. Data model

+

The test cases are semantically described for re-usability and shareability following the W3C Test case description. +Each test:Testcase as the following properties:

+
    +
  • dcterms:identifier: unique ID of the test case.
  • +
  • rmltest:hasError: if an error of the RML Processor is expected or not.
  • +
  • rmltest:input: One or more input data of the test case.
  • +
  • rmltest:output: One or more output data of the test case.
  • +
  • rmltest:inputFormat: the input data format.
  • +
  • rmltest:outputFormat: the output data format.
  • +
  • rmltest:mappingDocument: the RML mapping rules in Turtle.
  • +
+
+ +

3. Test cases

+

This section describes the RML-Star test cases. These descriptions are also available as RDF. +The files are available on GitHub in the folder test-cases. +Each test case is contained in a single folder, containing three types of files:

+
    +
  • Zero or more files containing the data sources, in the case of JSON, XML, CSV, or containing the SQL statements to create the necessary tables, in the case of MySQL, PostgreSQL, and SQL Server.
  • +
  • One file with the RML rules, called mapping.ttl, in the Turtle format.
  • +
  • Zero or more files with the expected RDF. No file is provided if an error is expected that must halt the generation of the RDF because of an error.
  • +
+
+ + +

4. RMLSTARTC001a

+

Title: quoted triple in subject, one source, blank node in quoted subject

+

Description: Tests the creation of a asserted quoted triple (with a blank node as subject) in the position of subject with data from one file

+

Error expected? No

+

Input

+
c1,c2,c3
+b0,o,ABC
+
+

Mapping

+
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix ex: <http://example/> .
+@prefix : <http://example.org/> .
+@base <http://example.org/> .
+
+:firstTM a rml:AssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:reference "c1" ;
+        rml:termType rml:BlankNode
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:p ;
+        rml:objectMap [
+            rml:template "http://example/{c2}"
+        ]
+    ] .
+
+:secondTM a rml:AssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:quotedTriplesMap :firstTM
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:q ;
+        rml:objectMap [
+            rml:reference "c3"
+        ]
+    ] .
+
+

Output

+
_:b0 <http://example/p> <http://example/o> .
+<< _:b0 <http://example/p> <http://example/o> >> <http://example/q> "ABC" .
+
+
+

5. RMLSTARTC001b

+

Title: quoted triple in subject, two sources, blank node in quoted subject

+

Description: Tests the creation of a asserted quoted triple (with a blank node as subject) in the position of subject with data from two files

+

Error expected? No

+

Input

+
c1-1,c1-2,c1-3
+b0,o,1
+
+

Input 1

+
**Input 1**
+c2-1,c2-2
+ABC,1
+
+

Mapping

+
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix ex: <http://example/> .
+@prefix : <http://example.org/> .
+@base <http://example.org/> .
+
+:firstTM a rml:AssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data1.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:reference "c1-1" ;
+        rml:termType rml:BlankNode
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:p ;
+        rml:objectMap [
+            rml:template "http://example/{c1-2}"
+        ]
+    ] .
+
+:secondTM a rml:AssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data2.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:quotedTriplesMap :firstTM ;
+        rml:joinCondition [
+          rml:child "c2-2" ;
+          rml:parent "c1-3" ;
+        ];
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:q ;
+        rml:objectMap [
+            rml:reference "c2-1"
+        ]
+    ] .
+
+

Output

+
_:b0 <http://example/p> <http://example/o> .
+<< _:b0 <http://example/p> <http://example/o> >> <http://example/q> "ABC" .
+
+
+

6. RMLSTARTC002a

+

Title: quoted triple in subject, one source, blank node in quoted object

+

Description: Tests the creation of a asserted quoted triple (with a blank node as object) in the position of subject with data from one file

+

Error expected? No

+

Input

+
c1,c2,c3
+s,b1,456
+
+

Mapping

+
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix ex: <http://example/> .
+@prefix : <http://example.org/> .
+@base <http://example.org/> .
+
+:firstTM a rml:AssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example/{c1}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:p ;
+        rml:objectMap [
+            rml:reference "c2" ;
+            rml:termType rml:BlankNode
+        ]
+    ] .
+
+:secondTM a rml:AssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:quotedTriplesMap :firstTM
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:q ;
+        rml:objectMap [
+            rml:reference "c3";
+            rml:datatype xsd:integer
+        ]
+    ] .
+
+

Output

+
<http://example/s> <http://example/p> _:b1 .
+<< <http://example/s> <http://example/p> _:b1 >> <http://example/q> "456"^^<http://www.w3.org/2001/XMLSchema#integer> .
+
+
+

7. RMLSTARTC002b

+

Title: quoted triple in subject, two sources, blank node in quoted object

+

Description: Tests the creation of a asserted quoted triple (with a blank node as object) in the position of subject with data from two files

+

Error expected? No

+

Input

+
c1-1,c1-2,c1-3
+s,b1,1
+
+

Input 1

+
**Input 1**
+c2-1,c2-2
+456,1
+
+

Mapping

+
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix ex: <http://example/> .
+@prefix : <http://example.org/> .
+@base <http://example.org/> .
+
+:firstTM a rml:AssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data1.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example/{c1-1}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:p ;
+        rml:objectMap [
+            rml:reference "c1-2" ;
+            rml:termType rml:BlankNode
+        ]
+    ] .
+
+:secondTM a rml:AssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data2.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:quotedTriplesMap :firstTM ;
+        rml:joinCondition [
+          rml:child "c2-2" ;
+          rml:parent "c1-3" ;
+        ];
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:q ;
+        rml:objectMap [
+            rml:reference "c2-1";
+            rml:datatype xsd:integer
+        ]
+    ] .
+
+

Output

+
<http://example/s> <http://example/p> _:b1 .
+<< <http://example/s> <http://example/p> _:b1 >> <http://example/q> "456"^^<http://www.w3.org/2001/XMLSchema#integer> .
+
+
+

8. RMLSTARTC003a

+

Title: two-level quoted triple in subject, one source

+

Description: Tests the creation of two-level recursiveness of asserted quoted triples as subjects with data from one file

+

Error expected? No

+

Input

+
c1,c2,c3,c4
+s,o,z,1
+
+

Mapping

+
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix ex: <http://example/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+@base <http://example.org/> .
+
+:firstTM a rml:AssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example/{c1}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:p ;
+        rml:objectMap [
+            rml:template "http://example/{c2}"
+        ]
+    ] .
+
+:secondTM a rml:AssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:quotedTriplesMap :firstTM
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:r ;
+        rml:objectMap [
+            rml:template "http://example/{c3}"
+        ]
+    ] .
+
+:thirdTM a rml:AssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:quotedTriplesMap :secondTM
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:q ;
+        rml:objectMap [
+            rml:reference "c4" ;
+            rml:datatype xsd:integer
+        ]
+    ] .
+
+

Output

+
<http://example/s> <http://example/p> <http://example/o> .
+<< <http://example/s> <http://example/p> <http://example/o> >> <http://example/r> <http://example/z> .
+<< << <http://example/s> <http://example/p> <http://example/o> >> <http://example/r> <http://example/z> >> <http://example/q> "1"^^<http://www.w3.org/2001/XMLSchema#integer> .
+
+
+

9. RMLSTARTC003b

+

Title: two-level quoted triple in subject, two sources

+

Description: Tests the creation of two-level recursiveness of asserted quoted triples as subjects with data from two files

+

Error expected? No

+

Input

+
c1-1,c1-2,c1-3,c1-4
+s,o,z,1
+
+

Input 1

+
**Input 1**
+c2-1,c2-2
+1,1
+
+

Mapping

+
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix ex: <http://example/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+@base <http://example.org/> .
+
+:firstTM a rml:AssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data1.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example/{c1-1}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:p ;
+        rml:objectMap [
+            rml:template "http://example/{c1-2}"
+        ]
+    ] .
+
+:secondTM a rml:AssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data1.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:quotedTriplesMap :firstTM
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:r ;
+        rml:objectMap [
+            rml:template "http://example/{c1-3}"
+        ]
+    ] .
+
+:thirdTM a rml:AssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data2.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:quotedTriplesMap :secondTM;
+        rml:joinCondition [
+          rml:child "c2-2" ;
+          rml:parent "c1-4" ;
+        ];
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:q ;
+        rml:objectMap [
+            rml:reference "c2-1" ;
+            rml:datatype xsd:integer
+        ]
+    ] .
+
+

Output

+
<http://example/s> <http://example/p> <http://example/o> .
+<< <http://example/s> <http://example/p> <http://example/o> >> <http://example/r> <http://example/z> .
+<< << <http://example/s> <http://example/p> <http://example/o> >> <http://example/r> <http://example/z> >> <http://example/q> "1"^^<http://www.w3.org/2001/XMLSchema#integer> .
+
+
+

10. RMLSTARTC004a

+

Title: two-level quoted triple in subject and object, one source

+

Description: Tests the creation of two-level recursiveness of asserted quoted triples as first as object, second as subject with data from one file

+

Error expected? No

+

Input

+
c1,c2,c3,c4
+s,o,a,z
+
+

Mapping

+
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix ex: <http://example/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+@base <http://example.org/> .
+
+:firstTM a rml:AssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example/{c1}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:p ;
+        rml:objectMap [
+            rml:template "http://example/{c2}"
+        ]
+    ] .
+
+:secondTM a rml:AssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example/{c3}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:q ;
+        rml:objectMap [
+            rml:quotedTriplesMap :firstTM
+        ]
+    ] .
+
+:thirdTM a rml:AssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:quotedTriplesMap :secondTM
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:r ;
+        rml:objectMap [
+            rml:template "http://example/{c4}"
+        ]
+    ] .
+
+

Output

+
<http://example/s> <http://example/p> <http://example/o> .
+<http://example/a> <http://example/q> << <http://example/s> <http://example/p> <http://example/o> >> .
+<< <http://example/a> <http://example/q> << <http://example/s> <http://example/p> <http://example/o> >> >> <http://example/r> <http://example/z> .
+
+
+

11. RMLSTARTC004b

+

Title: two-level quoted triple in subject and object, two sources

+

Description: Tests the creation of two-level recursiveness of asserted quoted triples as first as object, second as subject with data from two sources

+

Error expected? No

+

Input

+
c1-1,c1-2,c1-3,c1-4
+s,o,a,1
+
+

Input 1

+
**Input 1**
+c2-1,c2-2
+z,1
+
+

Mapping

+
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix ex: <http://example/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+@base <http://example.org/> .
+
+:firstTM a rml:AssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data1.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example/{c1-1}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:p ;
+        rml:objectMap [
+            rml:template "http://example/{c1-2}"
+        ]
+    ] .
+
+:secondTM a rml:AssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data1.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example/{c1-3}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:q ;
+        rml:objectMap [
+            rml:quotedTriplesMap :firstTM
+        ]
+    ] .
+
+:thirdTM a rml:AssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data2.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:quotedTriplesMap :secondTM;
+        rml:joinCondition [
+          rml:child "c2-2" ;
+          rml:parent "c1-4" ;
+        ];
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:r ;
+        rml:objectMap [
+            rml:template "http://example/{c2-1}"
+        ]
+    ] .
+
+

Output

+
<http://example/s> <http://example/p> <http://example/o> .
+<http://example/a> <http://example/q> << <http://example/s> <http://example/p> <http://example/o> >> .
+<< <http://example/a> <http://example/q> << <http://example/s> <http://example/p> <http://example/o> >> >> <http://example/r> <http://example/z> .
+
+
+

12. RMLSTARTC005a

+

Title: non-asserted quoted triple in subject, one source

+

Description: Tests the creation of a non-asserted quoted triple in the position of subject with data from one file

+

Error expected? No

+

Input

+
c1,c2,c3
+s,o,z
+
+

Mapping

+
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix ex: <http://example/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+@base <http://example.org/> .
+
+:firstTM a rml:NonAssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example/{c1}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:p ;
+        rml:objectMap [
+            rml:template "http://example/{c2}"
+        ]
+    ] .
+
+:secondTM a rml:AssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+            rml:quotedTriplesMap :firstTM
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:q ;
+        rml:objectMap [
+            rml:template "http://example/{c3}"
+        ]
+    ] .
+
+

Output

+
<< <http://example/s> <http://example/p> <http://example/o> >> <http://example/q> <http://example/z> .
+
+
+

13. RMLSTARTC005b

+

Title: non-asserted quoted triple in subject, two sources

+

Description: Tests the creation of a non-asserted quoted triple in the position of subject with data from two files

+

Error expected? No

+

Input

+
c1-1,c1-2,c1-3
+s,o,1
+
+

Input 1

+
**Input 1**
+c2-1,c2-2
+z,1
+
+

Mapping

+
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix ex: <http://example/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+@base <http://example.org/> .
+
+:firstTM a rml:NonAssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data1.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example/{c1-1}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:p ;
+        rml:objectMap [
+            rml:template "http://example/{c1-2}"
+        ]
+    ] .
+
+:secondTM a rml:AssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data2.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+            rml:quotedTriplesMap :firstTM ;
+            rml:joinCondition [
+              rml:child "c2-2" ;
+              rml:parent "c1-3" ;
+            ];
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:q ;
+        rml:objectMap [
+            rml:template "http://example/{c2-1}"
+        ]
+    ] .
+
+

Output

+
<< <http://example/s> <http://example/p> <http://example/o> >> <http://example/q> <http://example/z> .
+
+
+

14. RMLSTARTC006a

+

Title: non-asserted quoted triple in object, one source

+

Description: Tests the creation of a non-asserted quoted triple in the position of object with data from one file

+

Error expected? No

+

Input

+
c1,c2,c3
+s,o,x
+
+

Mapping

+
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix ex: <http://example/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+@base <http://example.org/> .
+
+:firstTM a rml:NonAssertedTriplesMap ; # This refers to the y statement in the rdf-star
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example/{c1}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:p ;
+        rml:objectMap [
+            rml:template "http://example/{c2}"
+        ]
+    ] .
+
+:secondTM a rml:AssertedTriplesMap ;  # This refers to the x statement in the rdf-star
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+            rml:template "http://example/{c3}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:p; ;
+        rml:objectMap [
+            rml:quotedTriplesMap :firstTM
+        ]
+    ] .
+
+

Output

+
<http://example/x> <http://example/p> << <http://example/s> <http://example/p> <http://example/o> >> .
+
+
+

15. RMLSTARTC006b

+

Title: non-asserted quoted triple in object, two sources

+

Description: Tests the creation of a non-asserted quoted triple in the position of object with data from two files

+

Error expected? No

+

Input

+
c1-1,c1-2,c1-3
+s,o,1
+
+

Input 1

+
**Input 1**
+c2-1,c2-2
+x,1
+
+

Mapping

+
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix ex: <http://example/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+@base <http://example.org/> .
+
+:firstTM a rml:NonAssertedTriplesMap ; # This refers to the y statement in the rdf-star
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data1.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example/{c1-1}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:p ;
+        rml:objectMap [
+            rml:template "http://example/{c1-2}"
+        ]
+    ] .
+
+:secondTM a rml:AssertedTriplesMap ; # This refers to the x statement in the rdf-star
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data2.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+            rml:template "http://example/{c2-1}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:p; ;
+        rml:objectMap [
+            rml:quotedTriplesMap :firstTM ;
+            rml:joinCondition [
+              rml:child "c2-2" ;
+              rml:parent "c1-3" ;
+            ];
+        ]
+    ] .
+
+

Output

+
<http://example/x> <http://example/p> << <http://example/s> <http://example/p> <http://example/o> >> .
+
+
+

16. RMLSTARTC007a

+

Title: non-asserted quoted triples in subject and object, one source

+

Description: Tests the creation of a two non-asserted quoted triples, one in the position of subject and other in object with data from one file

+

Error expected? No

+

Input

+
c1,c2,c3,c4
+s1,o1,s2,o2
+
+

Mapping

+
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix ex: <http://example/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+@base <http://example.org/> .
+
+:firstTM a rml:NonAssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example/{c1}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:p1 ;
+        rml:objectMap [
+            rml:template "http://example/{c2}"
+        ]
+    ] .
+
+:secondTM a rml:AssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+            rml:quotedTriplesMap :firstTM
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:q; ;
+        rml:objectMap [
+            rml:quotedTriplesMap :thirdTM
+        ]
+    ] .
+
+:thirdTM a rml:NonAssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example/{c3}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:p2 ;
+        rml:objectMap [
+            rml:template "http://example/{c4}"
+        ]
+    ] .
+
+

Output

+
<< <http://example/s1> <http://example/p1> <http://example/o1> >> <http://example/q> << <http://example/s2> <http://example/p2> <http://example/o2> >> .
+
+
+

17. RMLSTARTC007b

+

Title: non-asserted quoted triples in subject and object, two sources

+

Description: Tests the creation of a two non-asserted quoted triples, one in the position of subject and other in object with data from two sources

+

Error expected? No

+

Input

+
c1-1,c1-2,c1-3
+s1,o1,1
+
+

Input 1

+
**Input 1**
+c2-1,c2-2,c2-3
+s2,o2,1
+
+

Mapping

+
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix ex: <http://example/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+@base <http://example.org/> .
+
+:firstTM a rml:NonAssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data1.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example/{c1-1}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:p1 ;
+        rml:objectMap [
+            rml:template "http://example/{c1-2}"
+        ]
+    ] .
+
+:secondTM a rml:AssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data2.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+            rml:quotedTriplesMap :firstTM ;
+            rml:joinCondition [
+              rml:child "c2-3" ;
+              rml:parent "c1-3" ;
+            ];
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:q; ;
+        rml:objectMap [
+            rml:quotedTriplesMap :thirdTM
+        ]
+    ] .
+
+:thirdTM a rml:NonAssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data2.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example/{c2-1}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:p2 ;
+        rml:objectMap [
+            rml:template "http://example/{c2-2}"
+        ]
+    ] .
+
+

Output

+
<< <http://example/s1> <http://example/p1> <http://example/o1> >> <http://example/q> << <http://example/s2> <http://example/p2> <http://example/o2> >> .
+
+
+

18. RMLSTARTC008a

+

Title: two-level non-asserted quoted triple in subject and object two-fold, one source

+

Description: Tests the creation of a triple with non-asserted quoted triples as subject and object, both triples have in turn non-asserted quoted triples in subject and object with data form one source

+

Error expected? No

+

Input

+
c1,c2,c3,c4,c5,c6,c7,c8
+s1,o1,s2,o2,s3,o3,s4,o4
+
+

Mapping

+
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix ex: <http://example/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+@base <http://example.org/> .
+
+:elementaryTM1 a rml:NonAssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example/{c1}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:p1 ;
+        rml:objectMap [
+            rml:template "http://example/{c2}"
+        ]
+    ] .
+
+:firstJoinTM a rml:NonAssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+            rml:quotedTriplesMap :elementaryTM1
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:q1; ;
+        rml:objectMap [
+            rml:quotedTriplesMap :elementaryTM2
+        ]
+    ] .
+
+:elementaryTM2 a rml:NonAssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example/{c3}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:p2 ;
+        rml:objectMap [
+            rml:template "http://example/{c4}"
+        ]
+    ] .
+
+:centralJoinTM a rml:AssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+            rml:quotedTriplesMap :firstJoinTM
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:q2;
+        rml:objectMap [
+            rml:quotedTriplesMap :secondJoinTM
+        ]
+    ] .
+
+:elementaryTM3 a rml:NonAssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example/{c5}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:p3 ;
+        rml:objectMap [
+            rml:template "http://example/{c6}"
+        ]
+    ] .
+
+:secondJoinTM a rml:NonAssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+            rml:quotedTriplesMap :elementaryTM3
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:q3; ;
+        rml:objectMap [
+            rml:quotedTriplesMap :elementaryTM4
+        ]
+    ] .
+
+:elementaryTM4 a rml:NonAssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example/{c7}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:p4 ;
+        rml:objectMap [
+            rml:template "http://example/{c8}"
+        ]
+    ] .
+
+

Output

+
<<<<<http://example/s1><http://example/p1><http://example/o1>>><http://example/q1><<<http://example/s2><http://example/p2><http://example/o2>>>>><http://example/q2><<<<<http://example/s3><http://example/p3><http://example/o3>>><http://example/q3><<<http://example/s4><http://example/p4><http://example/o4>>>>>.
+
+
+

19. RMLSTARTC008b

+

Title: two-level non-asserted quoted triple in subject and object two-fold, two sources

+

Description: Tests the creation of a triple with non-asserted quoted triples as subject and object, both triples have in turn non-asserted quoted triples in subject and object with data form two sources

+

Error expected? No

+

Input

+
c1-1,c1-2,c1-3,c1-4,c1-5
+s1,o1,s2,o2,1
+
+

Input 1

+
**Input 1**
+c2-1,c2-2,c2-3,c2-4,c2-5
+s3,o3,s4,o4,1
+
+

Mapping

+
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix ex: <http://example/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+@base <http://example.org/> .
+
+:elementaryTM1 a rml:NonAssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data1.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example/{c1-1}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:p1 ;
+        rml:objectMap [
+            rml:template "http://example/{c1-2}"
+        ]
+    ] .
+
+:firstJoinTM a rml:NonAssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data1.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+            rml:quotedTriplesMap :elementaryTM1
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:q1; ;
+        rml:objectMap [
+            rml:quotedTriplesMap :elementaryTM2
+        ]
+    ] .
+
+:elementaryTM2 a rml:NonAssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data1.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example/{c1-3}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:p2 ;
+        rml:objectMap [
+            rml:template "http://example/{c1-4}"
+        ]
+    ] .
+
+:centralJoinTM a rml:AssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data2.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+            rml:quotedTriplesMap :firstJoinTM ;
+            rml:joinCondition [
+              rml:child "c2-5" ;
+              rml:parent "c1-5" ;
+            ];
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:q2;
+        rml:objectMap [
+            rml:quotedTriplesMap :secondJoinTM
+        ]
+    ] .
+
+:elementaryTM3 a rml:NonAssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data2.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example/{c2-1}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:p3 ;
+        rml:objectMap [
+            rml:template "http://example/{c2-2}"
+        ]
+    ] .
+
+:secondJoinTM a rml:NonAssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data2.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+            rml:quotedTriplesMap :elementaryTM3
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:q3; ;
+        rml:objectMap [
+            rml:quotedTriplesMap :elementaryTM4
+        ]
+    ] .
+
+:elementaryTM4 a rml:NonAssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data2.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example/{c2-3}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:p4 ;
+        rml:objectMap [
+            rml:template "http://example/{c2-4}"
+        ]
+    ] .
+
+

Output

+
<<<<<http://example/s1><http://example/p1><http://example/o1>>><http://example/q1><<<http://example/s2><http://example/p2><http://example/o2>>>>><http://example/q2><<<<<http://example/s3><http://example/p3><http://example/o3>>><http://example/q3><<<http://example/s4><http://example/p4><http://example/o4>>>>>.
+
+
+

20. RMLSTARTC009

+

Title: Quoted triples as predicate map

+

Description: Test the use quoted triples for generating the predicates, which is not possible

+

Error expected? Yes

+

Input

+
c1,c2,c3,c4
+a,s,o,z
+
+

Mapping

+
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix ex: <http://example/> .
+@prefix : <http://example.org/> .
+@base <http://example.org/> .
+
+:firstTM a rml:AssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example/{c1}" 
+    ];
+    rml:predicateObjectMap [
+        rml:quotedTriplesMap :secondTM ;
+        rml:objectMap [
+            rml:template "http://example/{c4}"
+        ]
+    ] .
+
+:secondTM a rml:NonAssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example/{c2}" 
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:p ;
+        rml:objectMap [
+            rml:template "http://example/{c3}" 
+        ]
+    ] .
+
+
+

21. RMLSTARTC010

+

Title: Quoted triples as object without object map

+

Description: Test the use quoted triples for generating the object maps but without defining the object map, which is not possible

+

Error expected? Yes

+

Input

+
c1,c2,c3,c4
+a,s,o,z
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix ex: <http://example/> .
+@prefix : <http://example.org/> .
+@base <http://example.org/> .
+
+:firstTM a rml:AssertedTriplesMap, rml:NonAssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example/{c1}" 
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:p;
+        rml:quotedTriplesMap :secondTM ;
+    ] .
+
+:secondTM a rml:NonAssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example/{c2}" 
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:p ;
+        rml:objectMap [
+            rml:template "http://example/{c3}" 
+        ]
+    ] .
+
+
+ + + + + \ No newline at end of file diff --git a/src/test/resources/rml-star/docs/index.html b/src/test/resources/rml-star/docs/index.html new file mode 100644 index 00000000..189b11a8 --- /dev/null +++ b/src/test/resources/rml-star/docs/index.html @@ -0,0 +1,2017 @@ + + + + + + +RML-Star: Test Cases + + + + + + + + + + + + + + + +
+ +

RML-Star: Test Cases

+

+ Draft Community Group Report + +

+
+ +
Latest published version:
+ https://www.w3.org/RML-Star-Testcases/ +
+
Latest editor's draft:
https://w3id.org/rml/star/test-cases/
+ + + + +
Editor:
+ Dylan Van Assche + + + + (IDLab – Ghent University – imec) +
+ +
Author:
+ Dylan Van Assche + + + + (IDLab – Ghent University – imec) +
+
Feedback:
+ GitHub kg-construct/rml-io + (pull requests, + new issue, + open issues) +
+ +
+ + +
+
+ + + +

Abstract

This document defines the RML-Star test cases to the determine the RML-Star specification conformance of tools.

+
+ +

Status of This Document

+ This specification was published by the + Knowledge Graph Construction Community Group. It is not a W3C Standard nor is it + on the W3C Standards Track. + + Please note that under the + W3C Community Contributor License Agreement (CLA) + there is a limited opt-out and other conditions apply. + + Learn more about + W3C Community and Business Groups. +

+ GitHub Issues are preferred for + discussion of this specification. + + +

+ +

1. Introduction

+

This document defines the RML-Star test cases, consisting of a collection of test case documents (input and expected output). +The purpose of the test cases is to determine the conformance of tools that execute RML rules to the RML-Star specification.

+
+ +

2. Data model

+

The test cases are semantically described for re-usability and shareability following the W3C Test case description. +Each test:Testcase as the following properties:

+
    +
  • dcterms:identifier: unique ID of the test case.
  • +
  • rmltest:hasError: if an error of the RML Processor is expected or not.
  • +
  • rmltest:input: One or more input data of the test case.
  • +
  • rmltest:output: One or more output data of the test case.
  • +
  • rmltest:inputFormat: the input data format.
  • +
  • rmltest:outputFormat: the output data format.
  • +
  • rmltest:mappingDocument: the RML mapping rules in Turtle.
  • +
+
+ +

3. Test cases

+

This section describes the RML-Star test cases. These descriptions are also available as RDF. +The files are available on GitHub in the folder test-cases. +Each test case is contained in a single folder, containing three types of files:

+
    +
  • Zero or more files containing the data sources, in the case of JSON, XML, CSV, or containing the SQL statements to create the necessary tables, in the case of MySQL, PostgreSQL, and SQL Server.
  • +
  • One file with the RML rules, called mapping.ttl, in the Turtle format.
  • +
  • Zero or more files with the expected RDF. No file is provided if an error is expected that must halt the generation of the RDF because of an error.
  • +
+
+ + +

4. RMLSTARTC001a

+

Title: quoted triple in subject, one source, blank node in quoted subject

+

Description: Tests the creation of a asserted quoted triple (with a blank node as subject) in the position of subject with data from one file

+

Error expected? No

+

Input

+
c1,c2,c3
+b0,o,ABC
+
+

Mapping

+
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix ex: <http://example/> .
+@prefix : <http://example.org/> .
+@base <http://example.org/> .
+
+:firstTM a rml:AssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:reference "c1" ;
+        rml:termType rml:BlankNode
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:p ;
+        rml:objectMap [
+            rml:template "http://example/{c2}"
+        ]
+    ] .
+
+:secondTM a rml:AssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:quotedTriplesMap :firstTM
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:q ;
+        rml:objectMap [
+            rml:reference "c3"
+        ]
+    ] .
+
+

Output

+
_:b0 <http://example/p> <http://example/o> .
+<< _:b0 <http://example/p> <http://example/o> >> <http://example/q> "ABC" .
+
+
+

5. RMLSTARTC001b

+

Title: quoted triple in subject, two sources, blank node in quoted subject

+

Description: Tests the creation of a asserted quoted triple (with a blank node as subject) in the position of subject with data from two files

+

Error expected? No

+

Input

+
c1-1,c1-2,c1-3
+b0,o,1
+
+

Input 1

+
**Input 1**
+c2-1,c2-2
+ABC,1
+
+

Mapping

+
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix ex: <http://example/> .
+@prefix : <http://example.org/> .
+@base <http://example.org/> .
+
+:firstTM a rml:AssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data1.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:reference "c1-1" ;
+        rml:termType rml:BlankNode
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:p ;
+        rml:objectMap [
+            rml:template "http://example/{c1-2}"
+        ]
+    ] .
+
+:secondTM a rml:AssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data2.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:quotedTriplesMap :firstTM ;
+        rml:joinCondition [
+          rml:child "c2-2" ;
+          rml:parent "c1-3" ;
+        ];
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:q ;
+        rml:objectMap [
+            rml:reference "c2-1"
+        ]
+    ] .
+
+

Output

+
_:b0 <http://example/p> <http://example/o> .
+<< _:b0 <http://example/p> <http://example/o> >> <http://example/q> "ABC" .
+
+
+

6. RMLSTARTC002a

+

Title: quoted triple in subject, one source, blank node in quoted object

+

Description: Tests the creation of a asserted quoted triple (with a blank node as object) in the position of subject with data from one file

+

Error expected? No

+

Input

+
c1,c2,c3
+s,b1,456
+
+

Mapping

+
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix ex: <http://example/> .
+@prefix : <http://example.org/> .
+@base <http://example.org/> .
+
+:firstTM a rml:AssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example/{c1}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:p ;
+        rml:objectMap [
+            rml:reference "c2" ;
+            rml:termType rml:BlankNode
+        ]
+    ] .
+
+:secondTM a rml:AssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:quotedTriplesMap :firstTM
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:q ;
+        rml:objectMap [
+            rml:reference "c3";
+            rml:datatype xsd:integer
+        ]
+    ] .
+
+

Output

+
<http://example/s> <http://example/p> _:b1 .
+<< <http://example/s> <http://example/p> _:b1 >> <http://example/q> "456"^^<http://www.w3.org/2001/XMLSchema#integer> .
+
+
+

7. RMLSTARTC002b

+

Title: quoted triple in subject, two sources, blank node in quoted object

+

Description: Tests the creation of a asserted quoted triple (with a blank node as object) in the position of subject with data from two files

+

Error expected? No

+

Input

+
c1-1,c1-2,c1-3
+s,b1,1
+
+

Input 1

+
**Input 1**
+c2-1,c2-2
+456,1
+
+

Mapping

+
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix ex: <http://example/> .
+@prefix : <http://example.org/> .
+@base <http://example.org/> .
+
+:firstTM a rml:AssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data1.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example/{c1-1}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:p ;
+        rml:objectMap [
+            rml:reference "c1-2" ;
+            rml:termType rml:BlankNode
+        ]
+    ] .
+
+:secondTM a rml:AssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data2.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:quotedTriplesMap :firstTM ;
+        rml:joinCondition [
+          rml:child "c2-2" ;
+          rml:parent "c1-3" ;
+        ];
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:q ;
+        rml:objectMap [
+            rml:reference "c2-1";
+            rml:datatype xsd:integer
+        ]
+    ] .
+
+

Output

+
<http://example/s> <http://example/p> _:b1 .
+<< <http://example/s> <http://example/p> _:b1 >> <http://example/q> "456"^^<http://www.w3.org/2001/XMLSchema#integer> .
+
+
+

8. RMLSTARTC003a

+

Title: two-level quoted triple in subject, one source

+

Description: Tests the creation of two-level recursiveness of asserted quoted triples as subjects with data from one file

+

Error expected? No

+

Input

+
c1,c2,c3,c4
+s,o,z,1
+
+

Mapping

+
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix ex: <http://example/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+@base <http://example.org/> .
+
+:firstTM a rml:AssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example/{c1}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:p ;
+        rml:objectMap [
+            rml:template "http://example/{c2}"
+        ]
+    ] .
+
+:secondTM a rml:AssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:quotedTriplesMap :firstTM
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:r ;
+        rml:objectMap [
+            rml:template "http://example/{c3}"
+        ]
+    ] .
+
+:thirdTM a rml:AssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:quotedTriplesMap :secondTM
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:q ;
+        rml:objectMap [
+            rml:reference "c4" ;
+            rml:datatype xsd:integer
+        ]
+    ] .
+
+

Output

+
<http://example/s> <http://example/p> <http://example/o> .
+<< <http://example/s> <http://example/p> <http://example/o> >> <http://example/r> <http://example/z> .
+<< << <http://example/s> <http://example/p> <http://example/o> >> <http://example/r> <http://example/z> >> <http://example/q> "1"^^<http://www.w3.org/2001/XMLSchema#integer> .
+
+
+

9. RMLSTARTC003b

+

Title: two-level quoted triple in subject, two sources

+

Description: Tests the creation of two-level recursiveness of asserted quoted triples as subjects with data from two files

+

Error expected? No

+

Input

+
c1-1,c1-2,c1-3,c1-4
+s,o,z,1
+
+

Input 1

+
**Input 1**
+c2-1,c2-2
+1,1
+
+

Mapping

+
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix ex: <http://example/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+@base <http://example.org/> .
+
+:firstTM a rml:AssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data1.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example/{c1-1}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:p ;
+        rml:objectMap [
+            rml:template "http://example/{c1-2}"
+        ]
+    ] .
+
+:secondTM a rml:AssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data1.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:quotedTriplesMap :firstTM
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:r ;
+        rml:objectMap [
+            rml:template "http://example/{c1-3}"
+        ]
+    ] .
+
+:thirdTM a rml:AssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data2.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:quotedTriplesMap :secondTM;
+        rml:joinCondition [
+          rml:child "c2-2" ;
+          rml:parent "c1-4" ;
+        ];
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:q ;
+        rml:objectMap [
+            rml:reference "c2-1" ;
+            rml:datatype xsd:integer
+        ]
+    ] .
+
+

Output

+
<http://example/s> <http://example/p> <http://example/o> .
+<< <http://example/s> <http://example/p> <http://example/o> >> <http://example/r> <http://example/z> .
+<< << <http://example/s> <http://example/p> <http://example/o> >> <http://example/r> <http://example/z> >> <http://example/q> "1"^^<http://www.w3.org/2001/XMLSchema#integer> .
+
+
+

10. RMLSTARTC004a

+

Title: two-level quoted triple in subject and object, one source

+

Description: Tests the creation of two-level recursiveness of asserted quoted triples as first as object, second as subject with data from one file

+

Error expected? No

+

Input

+
c1,c2,c3,c4
+s,o,a,z
+
+

Mapping

+
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix ex: <http://example/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+@base <http://example.org/> .
+
+:firstTM a rml:AssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example/{c1}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:p ;
+        rml:objectMap [
+            rml:template "http://example/{c2}"
+        ]
+    ] .
+
+:secondTM a rml:AssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example/{c3}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:q ;
+        rml:objectMap [
+            rml:quotedTriplesMap :firstTM
+        ]
+    ] .
+
+:thirdTM a rml:AssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:quotedTriplesMap :secondTM
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:r ;
+        rml:objectMap [
+            rml:template "http://example/{c4}"
+        ]
+    ] .
+
+

Output

+
<http://example/s> <http://example/p> <http://example/o> .
+<http://example/a> <http://example/q> << <http://example/s> <http://example/p> <http://example/o> >> .
+<< <http://example/a> <http://example/q> << <http://example/s> <http://example/p> <http://example/o> >> >> <http://example/r> <http://example/z> .
+
+
+

11. RMLSTARTC004b

+

Title: two-level quoted triple in subject and object, two sources

+

Description: Tests the creation of two-level recursiveness of asserted quoted triples as first as object, second as subject with data from two sources

+

Error expected? No

+

Input

+
c1-1,c1-2,c1-3,c1-4
+s,o,a,1
+
+

Input 1

+
**Input 1**
+c2-1,c2-2
+z,1
+
+

Mapping

+
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix ex: <http://example/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+@base <http://example.org/> .
+
+:firstTM a rml:AssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data1.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example/{c1-1}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:p ;
+        rml:objectMap [
+            rml:template "http://example/{c1-2}"
+        ]
+    ] .
+
+:secondTM a rml:AssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data1.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example/{c1-3}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:q ;
+        rml:objectMap [
+            rml:quotedTriplesMap :firstTM
+        ]
+    ] .
+
+:thirdTM a rml:AssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data2.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:quotedTriplesMap :secondTM;
+        rml:joinCondition [
+          rml:child "c2-2" ;
+          rml:parent "c1-4" ;
+        ];
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:r ;
+        rml:objectMap [
+            rml:template "http://example/{c2-1}"
+        ]
+    ] .
+
+

Output

+
<http://example/s> <http://example/p> <http://example/o> .
+<http://example/a> <http://example/q> << <http://example/s> <http://example/p> <http://example/o> >> .
+<< <http://example/a> <http://example/q> << <http://example/s> <http://example/p> <http://example/o> >> >> <http://example/r> <http://example/z> .
+
+
+

12. RMLSTARTC005a

+

Title: non-asserted quoted triple in subject, one source

+

Description: Tests the creation of a non-asserted quoted triple in the position of subject with data from one file

+

Error expected? No

+

Input

+
c1,c2,c3
+s,o,z
+
+

Mapping

+
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix ex: <http://example/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+@base <http://example.org/> .
+
+:firstTM a rml:NonAssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example/{c1}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:p ;
+        rml:objectMap [
+            rml:template "http://example/{c2}"
+        ]
+    ] .
+
+:secondTM a rml:AssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+            rml:quotedTriplesMap :firstTM
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:q ;
+        rml:objectMap [
+            rml:template "http://example/{c3}"
+        ]
+    ] .
+
+

Output

+
<< <http://example/s> <http://example/p> <http://example/o> >> <http://example/q> <http://example/z> .
+
+
+

13. RMLSTARTC005b

+

Title: non-asserted quoted triple in subject, two sources

+

Description: Tests the creation of a non-asserted quoted triple in the position of subject with data from two files

+

Error expected? No

+

Input

+
c1-1,c1-2,c1-3
+s,o,1
+
+

Input 1

+
**Input 1**
+c2-1,c2-2
+z,1
+
+

Mapping

+
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix ex: <http://example/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+@base <http://example.org/> .
+
+:firstTM a rml:NonAssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data1.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example/{c1-1}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:p ;
+        rml:objectMap [
+            rml:template "http://example/{c1-2}"
+        ]
+    ] .
+
+:secondTM a rml:AssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data2.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+            rml:quotedTriplesMap :firstTM ;
+            rml:joinCondition [
+              rml:child "c2-2" ;
+              rml:parent "c1-3" ;
+            ];
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:q ;
+        rml:objectMap [
+            rml:template "http://example/{c2-1}"
+        ]
+    ] .
+
+

Output

+
<< <http://example/s> <http://example/p> <http://example/o> >> <http://example/q> <http://example/z> .
+
+
+

14. RMLSTARTC006a

+

Title: non-asserted quoted triple in object, one source

+

Description: Tests the creation of a non-asserted quoted triple in the position of object with data from one file

+

Error expected? No

+

Input

+
c1,c2,c3
+s,o,x
+
+

Mapping

+
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix ex: <http://example/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+@base <http://example.org/> .
+
+:firstTM a rml:NonAssertedTriplesMap ; # This refers to the y statement in the rdf-star
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example/{c1}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:p ;
+        rml:objectMap [
+            rml:template "http://example/{c2}"
+        ]
+    ] .
+
+:secondTM a rml:AssertedTriplesMap ;  # This refers to the x statement in the rdf-star
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+            rml:template "http://example/{c3}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:p; ;
+        rml:objectMap [
+            rml:quotedTriplesMap :firstTM
+        ]
+    ] .
+
+

Output

+
<http://example/x> <http://example/p> << <http://example/s> <http://example/p> <http://example/o> >> .
+
+
+

15. RMLSTARTC006b

+

Title: non-asserted quoted triple in object, two sources

+

Description: Tests the creation of a non-asserted quoted triple in the position of object with data from two files

+

Error expected? No

+

Input

+
c1-1,c1-2,c1-3
+s,o,1
+
+

Input 1

+
**Input 1**
+c2-1,c2-2
+x,1
+
+

Mapping

+
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix ex: <http://example/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+@base <http://example.org/> .
+
+:firstTM a rml:NonAssertedTriplesMap ; # This refers to the y statement in the rdf-star
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data1.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example/{c1-1}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:p ;
+        rml:objectMap [
+            rml:template "http://example/{c1-2}"
+        ]
+    ] .
+
+:secondTM a rml:AssertedTriplesMap ; # This refers to the x statement in the rdf-star
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data2.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+            rml:template "http://example/{c2-1}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:p; ;
+        rml:objectMap [
+            rml:quotedTriplesMap :firstTM ;
+            rml:joinCondition [
+              rml:child "c2-2" ;
+              rml:parent "c1-3" ;
+            ];
+        ]
+    ] .
+
+

Output

+
<http://example/x> <http://example/p> << <http://example/s> <http://example/p> <http://example/o> >> .
+
+
+

16. RMLSTARTC007a

+

Title: non-asserted quoted triples in subject and object, one source

+

Description: Tests the creation of a two non-asserted quoted triples, one in the position of subject and other in object with data from one file

+

Error expected? No

+

Input

+
c1,c2,c3,c4
+s1,o1,s2,o2
+
+

Mapping

+
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix ex: <http://example/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+@base <http://example.org/> .
+
+:firstTM a rml:NonAssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example/{c1}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:p1 ;
+        rml:objectMap [
+            rml:template "http://example/{c2}"
+        ]
+    ] .
+
+:secondTM a rml:AssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+            rml:quotedTriplesMap :firstTM
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:q; ;
+        rml:objectMap [
+            rml:quotedTriplesMap :thirdTM
+        ]
+    ] .
+
+:thirdTM a rml:NonAssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example/{c3}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:p2 ;
+        rml:objectMap [
+            rml:template "http://example/{c4}"
+        ]
+    ] .
+
+

Output

+
<< <http://example/s1> <http://example/p1> <http://example/o1> >> <http://example/q> << <http://example/s2> <http://example/p2> <http://example/o2> >> .
+
+
+

17. RMLSTARTC007b

+

Title: non-asserted quoted triples in subject and object, two sources

+

Description: Tests the creation of a two non-asserted quoted triples, one in the position of subject and other in object with data from two sources

+

Error expected? No

+

Input

+
c1-1,c1-2,c1-3
+s1,o1,1
+
+

Input 1

+
**Input 1**
+c2-1,c2-2,c2-3
+s2,o2,1
+
+

Mapping

+
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix ex: <http://example/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+@base <http://example.org/> .
+
+:firstTM a rml:NonAssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data1.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example/{c1-1}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:p1 ;
+        rml:objectMap [
+            rml:template "http://example/{c1-2}"
+        ]
+    ] .
+
+:secondTM a rml:AssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data2.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+            rml:quotedTriplesMap :firstTM ;
+            rml:joinCondition [
+              rml:child "c2-3" ;
+              rml:parent "c1-3" ;
+            ];
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:q; ;
+        rml:objectMap [
+            rml:quotedTriplesMap :thirdTM
+        ]
+    ] .
+
+:thirdTM a rml:NonAssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data2.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example/{c2-1}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:p2 ;
+        rml:objectMap [
+            rml:template "http://example/{c2-2}"
+        ]
+    ] .
+
+

Output

+
<< <http://example/s1> <http://example/p1> <http://example/o1> >> <http://example/q> << <http://example/s2> <http://example/p2> <http://example/o2> >> .
+
+
+

18. RMLSTARTC008a

+

Title: two-level non-asserted quoted triple in subject and object two-fold, one source

+

Description: Tests the creation of a triple with non-asserted quoted triples as subject and object, both triples have in turn non-asserted quoted triples in subject and object with data form one source

+

Error expected? No

+

Input

+
c1,c2,c3,c4,c5,c6,c7,c8
+s1,o1,s2,o2,s3,o3,s4,o4
+
+

Mapping

+
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix ex: <http://example/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+@base <http://example.org/> .
+
+:elementaryTM1 a rml:NonAssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example/{c1}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:p1 ;
+        rml:objectMap [
+            rml:template "http://example/{c2}"
+        ]
+    ] .
+
+:firstJoinTM a rml:NonAssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+            rml:quotedTriplesMap :elementaryTM1
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:q1; ;
+        rml:objectMap [
+            rml:quotedTriplesMap :elementaryTM2
+        ]
+    ] .
+
+:elementaryTM2 a rml:NonAssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example/{c3}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:p2 ;
+        rml:objectMap [
+            rml:template "http://example/{c4}"
+        ]
+    ] .
+
+:centralJoinTM a rml:AssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+            rml:quotedTriplesMap :firstJoinTM
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:q2;
+        rml:objectMap [
+            rml:quotedTriplesMap :secondJoinTM
+        ]
+    ] .
+
+:elementaryTM3 a rml:NonAssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example/{c5}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:p3 ;
+        rml:objectMap [
+            rml:template "http://example/{c6}"
+        ]
+    ] .
+
+:secondJoinTM a rml:NonAssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+            rml:quotedTriplesMap :elementaryTM3
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:q3; ;
+        rml:objectMap [
+            rml:quotedTriplesMap :elementaryTM4
+        ]
+    ] .
+
+:elementaryTM4 a rml:NonAssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example/{c7}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:p4 ;
+        rml:objectMap [
+            rml:template "http://example/{c8}"
+        ]
+    ] .
+
+

Output

+
<<<<<http://example/s1><http://example/p1><http://example/o1>>><http://example/q1><<<http://example/s2><http://example/p2><http://example/o2>>>>><http://example/q2><<<<<http://example/s3><http://example/p3><http://example/o3>>><http://example/q3><<<http://example/s4><http://example/p4><http://example/o4>>>>>.
+
+
+

19. RMLSTARTC008b

+

Title: two-level non-asserted quoted triple in subject and object two-fold, two sources

+

Description: Tests the creation of a triple with non-asserted quoted triples as subject and object, both triples have in turn non-asserted quoted triples in subject and object with data form two sources

+

Error expected? No

+

Input

+
c1-1,c1-2,c1-3,c1-4,c1-5
+s1,o1,s2,o2,1
+
+

Input 1

+
**Input 1**
+c2-1,c2-2,c2-3,c2-4,c2-5
+s3,o3,s4,o4,1
+
+

Mapping

+
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix ex: <http://example/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix : <http://example.org/> .
+@base <http://example.org/> .
+
+:elementaryTM1 a rml:NonAssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data1.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example/{c1-1}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:p1 ;
+        rml:objectMap [
+            rml:template "http://example/{c1-2}"
+        ]
+    ] .
+
+:firstJoinTM a rml:NonAssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data1.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+            rml:quotedTriplesMap :elementaryTM1
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:q1; ;
+        rml:objectMap [
+            rml:quotedTriplesMap :elementaryTM2
+        ]
+    ] .
+
+:elementaryTM2 a rml:NonAssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data1.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example/{c1-3}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:p2 ;
+        rml:objectMap [
+            rml:template "http://example/{c1-4}"
+        ]
+    ] .
+
+:centralJoinTM a rml:AssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data2.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+            rml:quotedTriplesMap :firstJoinTM ;
+            rml:joinCondition [
+              rml:child "c2-5" ;
+              rml:parent "c1-5" ;
+            ];
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:q2;
+        rml:objectMap [
+            rml:quotedTriplesMap :secondJoinTM
+        ]
+    ] .
+
+:elementaryTM3 a rml:NonAssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data2.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example/{c2-1}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:p3 ;
+        rml:objectMap [
+            rml:template "http://example/{c2-2}"
+        ]
+    ] .
+
+:secondJoinTM a rml:NonAssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data2.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+            rml:quotedTriplesMap :elementaryTM3
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:q3; ;
+        rml:objectMap [
+            rml:quotedTriplesMap :elementaryTM4
+        ]
+    ] .
+
+:elementaryTM4 a rml:NonAssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data2.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example/{c2-3}"
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:p4 ;
+        rml:objectMap [
+            rml:template "http://example/{c2-4}"
+        ]
+    ] .
+
+

Output

+
<<<<<http://example/s1><http://example/p1><http://example/o1>>><http://example/q1><<<http://example/s2><http://example/p2><http://example/o2>>>>><http://example/q2><<<<<http://example/s3><http://example/p3><http://example/o3>>><http://example/q3><<<http://example/s4><http://example/p4><http://example/o4>>>>>.
+
+
+

20. RMLSTARTC009

+

Title: Quoted triples as predicate map

+

Description: Test the use quoted triples for generating the predicates, which is not possible

+

Error expected? Yes

+

Input

+
c1,c2,c3,c4
+a,s,o,z
+
+

Mapping

+
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rml: <http://w3id.org/rml/> .
+@prefix ex: <http://example/> .
+@prefix : <http://example.org/> .
+@base <http://example.org/> .
+
+:firstTM a rml:AssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example/{c1}" 
+    ];
+    rml:predicateObjectMap [
+        rml:quotedTriplesMap :secondTM ;
+        rml:objectMap [
+            rml:template "http://example/{c4}"
+        ]
+    ] .
+
+:secondTM a rml:NonAssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example/{c2}" 
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:p ;
+        rml:objectMap [
+            rml:template "http://example/{c3}" 
+        ]
+    ] .
+
+
+

21. RMLSTARTC010

+

Title: Quoted triples as object without object map

+

Description: Test the use quoted triples for generating the object maps but without defining the object map, which is not possible

+

Error expected? Yes

+

Input

+
c1,c2,c3,c4
+a,s,o,z
+
+

Mapping

+
@prefix rml: <http://w3id.org/rml/> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix ex: <http://example/> .
+@prefix : <http://example.org/> .
+@base <http://example.org/> .
+
+:firstTM a rml:AssertedTriplesMap, rml:NonAssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example/{c1}" 
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:p;
+        rml:quotedTriplesMap :secondTM ;
+    ] .
+
+:secondTM a rml:NonAssertedTriplesMap ;
+    rml:logicalSource [
+        rml:source [ a rml:Source, rml:RelativePathSource;
+            rml:path "data.csv";
+        ];
+        rml:referenceFormulation rml:CSV
+    ];
+    rml:subjectMap [
+        rml:template "http://example/{c2}" 
+    ];
+    rml:predicateObjectMap [
+        rml:predicate ex:p ;
+        rml:objectMap [
+            rml:template "http://example/{c3}" 
+        ]
+    ] .
+
+
+ + + + + \ No newline at end of file diff --git a/src/test/resources/rml-star/invalid/RMLSTARTC009/data.csv b/src/test/resources/rml-star/invalid/RMLSTARTC009/data.csv new file mode 100644 index 00000000..d9a0567b --- /dev/null +++ b/src/test/resources/rml-star/invalid/RMLSTARTC009/data.csv @@ -0,0 +1,2 @@ +c1,c2,c3,c4 +a,s,o,z \ No newline at end of file diff --git a/src/test/resources/rml-star/invalid/RMLSTARTC009/mapping.ttl b/src/test/resources/rml-star/invalid/RMLSTARTC009/mapping.ttl new file mode 100644 index 00000000..311477dc --- /dev/null +++ b/src/test/resources/rml-star/invalid/RMLSTARTC009/mapping.ttl @@ -0,0 +1,39 @@ +@prefix rdf: . +@prefix rml: . +@prefix ex: . +@prefix : . +@base . + +:firstTM a rml:AssertedTriplesMap ; + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:template "http://example/{c1}" + ]; + rml:predicateObjectMap [ + rml:quotedTriplesMap :secondTM ; + rml:objectMap [ + rml:template "http://example/{c4}" + ] + ] . + +:secondTM a rml:NonAssertedTriplesMap ; + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:template "http://example/{c2}" + ]; + rml:predicateObjectMap [ + rml:predicate ex:p ; + rml:objectMap [ + rml:template "http://example/{c3}" + ] + ] . diff --git a/src/test/resources/rml-star/invalid/RMLSTARTC010/data.csv b/src/test/resources/rml-star/invalid/RMLSTARTC010/data.csv new file mode 100644 index 00000000..d9a0567b --- /dev/null +++ b/src/test/resources/rml-star/invalid/RMLSTARTC010/data.csv @@ -0,0 +1,2 @@ +c1,c2,c3,c4 +a,s,o,z \ No newline at end of file diff --git a/src/test/resources/rml-star/invalid/RMLSTARTC010/mapping.ttl b/src/test/resources/rml-star/invalid/RMLSTARTC010/mapping.ttl new file mode 100644 index 00000000..48960292 --- /dev/null +++ b/src/test/resources/rml-star/invalid/RMLSTARTC010/mapping.ttl @@ -0,0 +1,37 @@ +@prefix rml: . +@prefix rdf: . +@prefix ex: . +@prefix : . +@base . + +:firstTM a rml:AssertedTriplesMap, rml:NonAssertedTriplesMap ; + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:template "http://example/{c1}" + ]; + rml:predicateObjectMap [ + rml:predicate ex:p; + rml:quotedTriplesMap :secondTM ; + ] . + +:secondTM a rml:NonAssertedTriplesMap ; + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:template "http://example/{c2}" + ]; + rml:predicateObjectMap [ + rml:predicate ex:p ; + rml:objectMap [ + rml:template "http://example/{c3}" + ] + ] . diff --git a/src/test/resources/rml-star/list.sh b/src/test/resources/rml-star/list.sh new file mode 100755 index 00000000..12c32031 --- /dev/null +++ b/src/test/resources/rml-star/list.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +for i in RML*; do + echo "
" +done diff --git a/src/test/resources/rml-star/make-metadata.py b/src/test/resources/rml-star/make-metadata.py new file mode 100755 index 00000000..f3501f45 --- /dev/null +++ b/src/test/resources/rml-star/make-metadata.py @@ -0,0 +1,143 @@ +#!/usr/bin/env python3 + +import os +import sys +import glob +import csv + +def get_title_description(testcase: str): + with open ('descriptions.csv') as csvfile: + reader = csv.reader(csvfile) + for row in reader: + if row[0] == testcase: + return row[1], row[2] + +def main(spec: str): + with open ('metadata.csv', 'w') as csvfile: + writer = csv.writer(csvfile) + writer.writerow(['ID', 'title', 'description', 'specification', + 'mapping', 'input_format1', 'input_format2', + 'input_format3', 'output_format1', 'output_format2', + 'output_format3', 'input1', 'input2', 'input3', + 'output1', 'output2', 'output3', 'error']) + for testcase in glob.glob('RML*'): + print(testcase) + title, description = get_title_description(testcase) + error = 'false' + input1 = '' + input2 = '' + input3 = '' + input_format1 = '' + input_format2 = '' + input_format3 = '' + output1 = '' + output2 = '' + output3 = '' + output_format1 = '' + output_format2 = '' + output_format3 = '' + + # Input file + if os.path.exists(os.path.join(testcase, 'data.csv')): + input1 = 'data.csv' + input_format1 = 'text/csv' + elif os.path.exists(os.path.join(testcase, 'data1.csv')): + input1 = 'data1.csv' + input_format1 = 'text/csv' + + if os.path.exists(os.path.join(testcase, 'data2.csv')): + input2 = 'data2.csv' + input_format2 = 'text/csv' + + # Mapping file + if os.path.exists(os.path.join(testcase, 'mapping.ttl')): + mapping_file = 'mapping.ttl' + else: + raise ValueError('Mapping file missing!') + + # Output files + if os.path.exists(os.path.join(testcase, 'output.nt')): + output1 = 'output.nt' + output_format1 = 'application/n-triples' + else: + error = 'true' + + writer.writerow([testcase, title, description, spec, mapping_file, + input_format1, input_format2, input_format3, + output_format1, output_format2, output_format3, + input1, input2, input3, output1, output2, + output3, error]) + lines = [] + # Title and description + lines.append(f'## {testcase}\n\n') + lines.append(f'**Title**: {title}\n\n') + lines.append(f'**Description**: {description}\n\n') + if error == 'true': + error_html = 'Yes' + else: + error_html = 'No' + lines.append(f'**Error expected?** {error_html}\n\n') + + # Input + inputCount = '' + + for index, i in enumerate([input1, input2, input3]): + if not i: + break + + if 'http://w3id.org/rml/resources' in i: + input_html = f'**Input{inputCount}**\n [{i}]({i})\n\n' + else: + try: + with open(os.path.join(testcase, i)) as f: + input_html = f'**Input{inputCount}**\n```\n{f.read()}\n```\n\n' + except UnicodeDecodeError: + try: + with open(os.path.join(testcase, i), encoding='utf-16') as f: + input_html = f'**Input{inputCount}**\n```\n{f.read()}\n```\n\n' + except UnicodeDecodeError: + input_html = f'**Input{inputCount}**\n `{i}`\n\n' + + lines.append(input_html) + inputCount = f' {index + 1}' + + # Mapping + with open(os.path.join(testcase, mapping_file)) as f: + mapping_html = f'**Mapping**\n```\n{f.read()}\n```\n\n' + lines.append(mapping_html) + + # Output + outputCount = '' + if output2 or output3: + outputCount = ' 1' + + for index, i in enumerate([output1, output2, output3]): + if not i: + break + + if 'http://w3id.org/rml/resources' in i: + output_html = f'**Output{outputCount}**\n [{i}]({i})\n\n' + else: + try: + with open(os.path.join(testcase, i)) as f: + output_html = f'**Output{outputCount}**\n```\n{f.read()}\n```\n\n' + except UnicodeDecodeError: + try: + with open(os.path.join(testcase, i), encoding='utf-16') as f: + output_html = f'**Output{outputCount}**\n```\n{f.read()}\n```\n\n' + except UnicodeDecodeError: + output_html = f'**Output{outputCount}**\n `{i}`\n\n' + + lines.append(output_html) + outputCount = f' {index + 2}' + + + with open(os.path.join(testcase, 'README.md'), 'w') as f: + f.writelines(lines) + + +if __name__ == '__main__': + if len(sys.argv) != 2: + print('Usage: ./make-metadata.py ') + sys.exit(1) + main(sys.argv[1]) diff --git a/src/test/resources/rml-star/manifest.rml.ttl b/src/test/resources/rml-star/manifest.rml.ttl new file mode 100644 index 00000000..e57c05c4 --- /dev/null +++ b/src/test/resources/rml-star/manifest.rml.ttl @@ -0,0 +1,267 @@ +@prefix xsd: . +@prefix dcterms: . +@prefix rml: . +@prefix rmltest: . +@prefix test: . +@base . + +# java -jar .\burp.jar -m manifest.rml.ttl -o manifest.ttl -b http://w3id.org/rml/star/test/ + +_:source + rml:source [ + a rml:RelativePathSource ; + rml:path "metadata.csv" ; + rml:null ""; + ]; + rml:referenceFormulation rml:CSV; +. + +<#TriplesMapTestcase> + a rml:TriplesMap; + + rml:logicalSource _:source; + + rml:subjectMap [ + rml:reference "ID"; + rml:class test:TestCase; + ]; + + rml:predicateObjectMap [ + rml:predicate dcterms:identifier; + rml:objectMap [ + rml:reference "ID"; + ]; + ]; + + rml:predicateObjectMap [ + rml:predicate rmltest:hasError; + rml:objectMap [ + rml:reference "error"; + rml:datatype xsd:boolean; + ]; + ]; + + rml:predicateObjectMap [ + rml:predicate rmltest:mappingDocument; + rml:objectMap [ + rml:reference "mapping"; + ]; + ]; + + rml:predicateObjectMap [ + rml:predicate rmltest:input; + rml:objectMap [ a rml:RefObjectMap; + rml:parentTriplesMap <#TriplesMapInput1>; + rml:joinCondition [ + rml:child "ID"; + rml:parent "ID"; + ]; + ]; + ]; + + rml:predicateObjectMap [ + rml:predicate rmltest:input; + rml:objectMap [ a rml:RefObjectMap; + rml:parentTriplesMap <#TriplesMapInput2>; + rml:joinCondition [ + rml:child "ID"; + rml:parent "ID"; + ]; + ]; + ]; + + rml:predicateObjectMap [ + rml:predicate rmltest:input; + rml:objectMap [ a rml:RefObjectMap; + rml:parentTriplesMap <#TriplesMapInput3>; + rml:joinCondition [ + rml:child "ID"; + rml:parent "ID"; + ]; + ]; + ]; + + rml:predicateObjectMap [ + rml:predicate rmltest:output; + rml:objectMap [ a rml:RefObjectMap; + rml:parentTriplesMap <#TriplesMapOutput1>; + rml:joinCondition [ + rml:child "ID"; + rml:parent "ID"; + ]; + ]; + ]; + + rml:predicateObjectMap [ + rml:predicate rmltest:output; + rml:objectMap [ a rml:RefObjectMap; + rml:parentTriplesMap <#TriplesMapOutput2>; + rml:joinCondition [ + rml:child "ID"; + rml:parent "ID"; + ]; + ]; + ]; + + rml:predicateObjectMap [ + rml:predicate rmltest:output; + rml:objectMap [ a rml:RefObjectMap; + rml:parentTriplesMap <#TriplesMapOutput3>; + rml:joinCondition [ + rml:child "ID"; + rml:parent "ID"; + ]; + ]; + ]; +. + +<#TriplesMapInput1> + a rml:TriplesMap; + + rml:logicalSource _:source ; + + rml:subjectMap [ + rml:template "{ID}/input/{input1}"; + rml:class rmltest:Input; + ]; + + rml:predicateObjectMap [ + rml:predicate rmltest:input; + rml:objectMap [ + rml:reference "input1"; + ]; + ]; + + rml:predicateObjectMap [ + rml:predicate rmltest:inputFormat; + rml:objectMap [ + rml:reference "input_format1"; + ]; + ]; +. + +<#TriplesMapInput2> + a rml:TriplesMap; + + rml:logicalSource _:source; + + rml:subjectMap [ + rml:template "{ID}/input/{input2}"; + rml:class rmltest:Input; + ]; + + rml:predicateObjectMap [ + rml:predicate rmltest:input; + rml:objectMap [ + rml:reference "input2"; + ]; + ]; + + rml:predicateObjectMap [ + rml:predicate rmltest:inputFormat; + rml:objectMap [ + rml:reference "input_format2"; + ]; + ]; +. + +<#TriplesMapInput3> + a rml:TriplesMap; + + rml:logicalSource _:source; + + rml:subjectMap [ + rml:template "{ID}/input/{input3}"; + rml:class rmltest:Input; + ]; + + rml:predicateObjectMap [ + rml:predicate rmltest:input; + rml:objectMap [ + rml:reference "input3"; + ]; + ]; + + rml:predicateObjectMap [ + rml:predicate rmltest:inputFormat; + rml:objectMap [ + rml:reference "input_format3"; + ]; + ]; +. + +<#TriplesMapOutput1> + a rml:TriplesMap; + + rml:logicalSource _:source; + + rml:subjectMap [ + rml:template "{ID}/output/{output1}"; + rml:class rmltest:Output; + ]; + + rml:predicateObjectMap [ + rml:predicate rmltest:output; + rml:objectMap [ + rml:reference "output1"; + ]; + ]; + + rml:predicateObjectMap [ + rml:predicate rmltest:outputFormat; + rml:objectMap [ + rml:reference "output_format1"; + ]; + ]; +. + +<#TriplesMapOutput2> + a rml:TriplesMap; + + rml:logicalSource _:source; + + rml:subjectMap [ + rml:template "{ID}/output/{output2}"; + rml:class rmltest:Output; + ]; + + rml:predicateObjectMap [ + rml:predicate rmltest:output; + rml:objectMap [ + rml:reference "output2"; + ]; + ]; + + rml:predicateObjectMap [ + rml:predicate rmltest:outputFormat; + rml:objectMap [ + rml:reference "output_format2"; + ]; + ]; +. + +<#TriplesMapOutput3> + a rml:TriplesMap; + + rml:logicalSource _:source; + + rml:subjectMap [ + rml:template "{ID}/output/{output3}"; + rml:class rmltest:Output; + ]; + + rml:predicateObjectMap [ + rml:predicate rmltest:output; + rml:objectMap [ + rml:reference "output3"; + ]; + ]; + + rml:predicateObjectMap [ + rml:predicate rmltest:outputFormat; + rml:objectMap [ + rml:reference "output_format3"; + ]; + ]; +. + diff --git a/src/test/resources/rml-star/manifest.ttl b/src/test/resources/rml-star/manifest.ttl new file mode 100644 index 00000000..95f2f27c --- /dev/null +++ b/src/test/resources/rml-star/manifest.ttl @@ -0,0 +1,240 @@ + "data2.csv" . + "text/csv" . + . + "RMLSTARTC006a" . + "mapping.ttl" . + . + "false"^^ . + . + . + "output.nt" . + "application/n-triples" . + . + "output.nt" . + "application/n-triples" . + . + "data1.csv" . + "text/csv" . + . + "output.nt" . + "application/n-triples" . + . + "data.csv" . + "text/csv" . + . + "RMLSTARTC010" . + "mapping.ttl" . + . + "true"^^ . + . + . + "RMLSTARTC008b" . + "mapping.ttl" . + . + "false"^^ . + . + . + "RMLSTARTC004a" . + "mapping.ttl" . + . + "false"^^ . + . + . + "data2.csv" . + "text/csv" . + . + "data.csv" . + "text/csv" . + . + . + "RMLSTARTC006b" . + "mapping.ttl" . + . + "false"^^ . + . + . + "output.nt" . + "application/n-triples" . + . + "RMLSTARTC002a" . + "mapping.ttl" . + . + "false"^^ . + . + . + "data.csv" . + "text/csv" . + . + "output.nt" . + "application/n-triples" . + . + "RMLSTARTC009" . + "mapping.ttl" . + . + "true"^^ . + . + "data1.csv" . + "text/csv" . + . + "data2.csv" . + "text/csv" . + . + "output.nt" . + "application/n-triples" . + . + . + "RMLSTARTC004b" . + "mapping.ttl" . + . + "false"^^ . + . + . + "data1.csv" . + "text/csv" . + . + "output.nt" . + "application/n-triples" . + . + "data2.csv" . + "text/csv" . + . + "data.csv" . + "text/csv" . + . + . + "RMLSTARTC002b" . + "mapping.ttl" . + . + "false"^^ . + . + . + "output.nt" . + "application/n-triples" . + . + "data1.csv" . + "text/csv" . + . + "data.csv" . + "text/csv" . + . + "RMLSTARTC007a" . + "mapping.ttl" . + . + "false"^^ . + . + . + "output.nt" . + "application/n-triples" . + . + "data2.csv" . + "text/csv" . + . + "data.csv" . + "text/csv" . + . + "data.csv" . + "text/csv" . + . + "RMLSTARTC005a" . + "mapping.ttl" . + . + "false"^^ . + . + . + "data1.csv" . + "text/csv" . + . + "data2.csv" . + "text/csv" . + . + . + "RMLSTARTC007b" . + "mapping.ttl" . + . + "false"^^ . + . + . + "RMLSTARTC003a" . + "mapping.ttl" . + . + "false"^^ . + . + . + "output.nt" . + "application/n-triples" . + . + "data1.csv" . + "text/csv" . + . + "output.nt" . + "application/n-triples" . + . + "output.nt" . + "application/n-triples" . + . + "data.csv" . + "text/csv" . + . + . + "RMLSTARTC005b" . + "mapping.ttl" . + . + "false"^^ . + . + . + "RMLSTARTC001a" . + "mapping.ttl" . + . + "false"^^ . + . + . + "data2.csv" . + "text/csv" . + . + "data.csv" . + "text/csv" . + . + "output.nt" . + "application/n-triples" . + . + . + "RMLSTARTC003b" . + "mapping.ttl" . + . + "false"^^ . + . + . + "output.nt" . + "application/n-triples" . + . + "data1.csv" . + "text/csv" . + . + "output.nt" . + "application/n-triples" . + . + "data2.csv" . + "text/csv" . + . + "data.csv" . + "text/csv" . + . + "output.nt" . + "application/n-triples" . + . + "RMLSTARTC008a" . + "mapping.ttl" . + . + "false"^^ . + . + . + . + "RMLSTARTC001b" . + "mapping.ttl" . + . + "false"^^ . + . + . + "data1.csv" . + "text/csv" . + . diff --git a/src/test/resources/rml-star/metadata.csv b/src/test/resources/rml-star/metadata.csv new file mode 100644 index 00000000..e9c0960c --- /dev/null +++ b/src/test/resources/rml-star/metadata.csv @@ -0,0 +1,19 @@ +ID,title,description,specification,mapping,input_format1,input_format2,input_format3,output_format1,output_format2,output_format3,input1,input2,input3,output1,output2,output3,error +RMLSTARTC003a,"two-level quoted triple in subject, one source",Tests the creation of two-level recursiveness of asserted quoted triples as subjects with data from one file,http://w3id.org/rml/star/,mapping.ttl,text/csv,,,application/n-triples,,,data.csv,,,output.nt,,,false +RMLSTARTC006b,"non-asserted quoted triple in object, two sources",Tests the creation of a non-asserted quoted triple in the position of object with data from two files,http://w3id.org/rml/star/,mapping.ttl,text/csv,text/csv,,application/n-triples,,,data1.csv,data2.csv,,output.nt,,,false +RMLSTARTC005b,"non-asserted quoted triple in subject, two sources",Tests the creation of a non-asserted quoted triple in the position of subject with data from two files,http://w3id.org/rml/star/,mapping.ttl,text/csv,text/csv,,application/n-triples,,,data1.csv,data2.csv,,output.nt,,,false +RMLSTARTC009,Quoted triples as predicate map,"Test the use quoted triples for generating the predicates, which is not possible",http://w3id.org/rml/star/,mapping.ttl,text/csv,,,,,,data.csv,,,,,,true +RMLSTARTC004a,"two-level quoted triple in subject and object, one source","Tests the creation of two-level recursiveness of asserted quoted triples as first as object, second as subject with data from one file",http://w3id.org/rml/star/,mapping.ttl,text/csv,,,application/n-triples,,,data.csv,,,output.nt,,,false +RMLSTARTC001b,"quoted triple in subject, two sources, blank node in quoted subject",Tests the creation of a asserted quoted triple (with a blank node as subject) in the position of subject with data from two files,http://w3id.org/rml/star/,mapping.ttl,text/csv,text/csv,,application/n-triples,,,data1.csv,data2.csv,,output.nt,,,false +RMLSTARTC007a,"non-asserted quoted triples in subject and object, one source","Tests the creation of a two non-asserted quoted triples, one in the position of subject and other in object with data from one file",http://w3id.org/rml/star/,mapping.ttl,text/csv,,,application/n-triples,,,data.csv,,,output.nt,,,false +RMLSTARTC008b,"two-level non-asserted quoted triple in subject and object two-fold, two sources","Tests the creation of a triple with non-asserted quoted triples as subject and object, both triples have in turn non-asserted quoted triples in subject and object with data form two sources",http://w3id.org/rml/star/,mapping.ttl,text/csv,text/csv,,application/n-triples,,,data1.csv,data2.csv,,output.nt,,,false +RMLSTARTC002b,"quoted triple in subject, two sources, blank node in quoted object",Tests the creation of a asserted quoted triple (with a blank node as object) in the position of subject with data from two files,http://w3id.org/rml/star/,mapping.ttl,text/csv,text/csv,,application/n-triples,,,data1.csv,data2.csv,,output.nt,,,false +RMLSTARTC006a,"non-asserted quoted triple in object, one source",Tests the creation of a non-asserted quoted triple in the position of object with data from one file,http://w3id.org/rml/star/,mapping.ttl,text/csv,,,application/n-triples,,,data.csv,,,output.nt,,,false +RMLSTARTC003b,"two-level quoted triple in subject, two sources",Tests the creation of two-level recursiveness of asserted quoted triples as subjects with data from two files,http://w3id.org/rml/star/,mapping.ttl,text/csv,text/csv,,application/n-triples,,,data1.csv,data2.csv,,output.nt,,,false +RMLSTARTC005a,"non-asserted quoted triple in subject, one source",Tests the creation of a non-asserted quoted triple in the position of subject with data from one file,http://w3id.org/rml/star/,mapping.ttl,text/csv,,,application/n-triples,,,data.csv,,,output.nt,,,false +RMLSTARTC010,Quoted triples as object without object map,"Test the use quoted triples for generating the object maps but without defining the object map, which is not possible",http://w3id.org/rml/star/,mapping.ttl,text/csv,,,,,,data.csv,,,,,,true +RMLSTARTC001a,"quoted triple in subject, one source, blank node in quoted subject",Tests the creation of a asserted quoted triple (with a blank node as subject) in the position of subject with data from one file,http://w3id.org/rml/star/,mapping.ttl,text/csv,,,application/n-triples,,,data.csv,,,output.nt,,,false +RMLSTARTC004b,"two-level quoted triple in subject and object, two sources","Tests the creation of two-level recursiveness of asserted quoted triples as first as object, second as subject with data from two sources",http://w3id.org/rml/star/,mapping.ttl,text/csv,text/csv,,application/n-triples,,,data1.csv,data2.csv,,output.nt,,,false +RMLSTARTC002a,"quoted triple in subject, one source, blank node in quoted object",Tests the creation of a asserted quoted triple (with a blank node as object) in the position of subject with data from one file,http://w3id.org/rml/star/,mapping.ttl,text/csv,,,application/n-triples,,,data.csv,,,output.nt,,,false +RMLSTARTC008a,"two-level non-asserted quoted triple in subject and object two-fold, one source","Tests the creation of a triple with non-asserted quoted triples as subject and object, both triples have in turn non-asserted quoted triples in subject and object with data form one source",http://w3id.org/rml/star/,mapping.ttl,text/csv,,,application/n-triples,,,data.csv,,,output.nt,,,false +RMLSTARTC007b,"non-asserted quoted triples in subject and object, two sources","Tests the creation of a two non-asserted quoted triples, one in the position of subject and other in object with data from two sources",http://w3id.org/rml/star/,mapping.ttl,text/csv,text/csv,,application/n-triples,,,data1.csv,data2.csv,,output.nt,,,false diff --git a/src/test/resources/rml-star/section/abstract.md b/src/test/resources/rml-star/section/abstract.md new file mode 100644 index 00000000..177fb7a7 --- /dev/null +++ b/src/test/resources/rml-star/section/abstract.md @@ -0,0 +1 @@ +This document defines the RML-Star test cases to the determine the RML-Star specification conformance of tools. diff --git a/src/test/resources/rml-star/section/data-model.md b/src/test/resources/rml-star/section/data-model.md new file mode 100644 index 00000000..f4c3ad6a --- /dev/null +++ b/src/test/resources/rml-star/section/data-model.md @@ -0,0 +1,12 @@ +# Data model + +The test cases are semantically described for re-usability and shareability following the [W3C Test case description](https://www.w3.org/2006/03/test-description). +Each `test:Testcase` as the following properties: + +- `dcterms:identifier`: unique ID of the test case. +- `rmltest:hasError`: if an error of the RML Processor is expected or not. +- `rmltest:input`: One or more input data of the test case. +- `rmltest:output`: One or more output data of the test case. +- `rmltest:inputFormat`: the input data format. +- `rmltest:outputFormat`: the output data format. +- `rmltest:mappingDocument`: the RML mapping rules in Turtle. diff --git a/src/test/resources/rml-star/section/introduction.md b/src/test/resources/rml-star/section/introduction.md new file mode 100644 index 00000000..3a3f1e99 --- /dev/null +++ b/src/test/resources/rml-star/section/introduction.md @@ -0,0 +1,4 @@ +# Introduction + +This document defines the RML-Star test cases, consisting of a collection of test case documents (input and expected output). +The purpose of the test cases is to determine the conformance of tools that execute RML rules to the RML-Star specification. diff --git a/src/test/resources/rml-star/section/test-cases.md b/src/test/resources/rml-star/section/test-cases.md new file mode 100644 index 00000000..228143d4 --- /dev/null +++ b/src/test/resources/rml-star/section/test-cases.md @@ -0,0 +1,10 @@ +# Test cases + +This section describes the RML-Star test cases. These descriptions are also available as RDF. +The files are available on [GitHub](https://github.com/kg-construct/rml-star/tree/main/test-cases) in the folder `test-cases`. +Each test case is contained in a single folder, containing three types of files: + + - Zero or more files containing the data sources, in the case of JSON, XML, CSV, or containing the SQL statements to create the necessary tables, in the case of MySQL, PostgreSQL, and SQL Server. + - One file with the RML rules, called `mapping.ttl`, in the Turtle format. + - Zero or more files with the expected RDF. No file is provided if an error is expected that must halt the generation of the RDF because of an error. + diff --git a/src/test/resources/rml-star/valid/RMLSTARTC001a/data.csv b/src/test/resources/rml-star/valid/RMLSTARTC001a/data.csv new file mode 100644 index 00000000..5de825f9 --- /dev/null +++ b/src/test/resources/rml-star/valid/RMLSTARTC001a/data.csv @@ -0,0 +1,2 @@ +c1,c2,c3 +b0,o,ABC \ No newline at end of file diff --git a/src/test/resources/rml-star/valid/RMLSTARTC001a/mapping.ttl b/src/test/resources/rml-star/valid/RMLSTARTC001a/mapping.ttl new file mode 100644 index 00000000..63ec2335 --- /dev/null +++ b/src/test/resources/rml-star/valid/RMLSTARTC001a/mapping.ttl @@ -0,0 +1,40 @@ +@prefix rdf: . +@prefix rml: . +@prefix ex: . +@prefix : . +@base . + +:firstTM a rml:AssertedTriplesMap ; + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:reference "c1" ; + rml:termType rml:BlankNode + ]; + rml:predicateObjectMap [ + rml:predicate ex:p ; + rml:objectMap [ + rml:template "http://example/{c2}" + ] + ] . + +:secondTM a rml:AssertedTriplesMap ; + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:quotedTriplesMap :firstTM + ]; + rml:predicateObjectMap [ + rml:predicate ex:q ; + rml:objectMap [ + rml:reference "c3" + ] + ] . diff --git a/src/test/resources/rml-star/valid/RMLSTARTC001a/output.nt b/src/test/resources/rml-star/valid/RMLSTARTC001a/output.nt new file mode 100644 index 00000000..2d94448c --- /dev/null +++ b/src/test/resources/rml-star/valid/RMLSTARTC001a/output.nt @@ -0,0 +1,2 @@ +_:b0 . +<< _:b0 >> "ABC" . diff --git a/src/test/resources/rml-star/valid/RMLSTARTC001b/data1.csv b/src/test/resources/rml-star/valid/RMLSTARTC001b/data1.csv new file mode 100644 index 00000000..f6cfd6e0 --- /dev/null +++ b/src/test/resources/rml-star/valid/RMLSTARTC001b/data1.csv @@ -0,0 +1,2 @@ +c1-1,c1-2,c1-3 +b0,o,1 diff --git a/src/test/resources/rml-star/valid/RMLSTARTC001b/data2.csv b/src/test/resources/rml-star/valid/RMLSTARTC001b/data2.csv new file mode 100644 index 00000000..15677400 --- /dev/null +++ b/src/test/resources/rml-star/valid/RMLSTARTC001b/data2.csv @@ -0,0 +1,2 @@ +c2-1,c2-2 +ABC,1 diff --git a/src/test/resources/rml-star/valid/RMLSTARTC001b/mapping.ttl b/src/test/resources/rml-star/valid/RMLSTARTC001b/mapping.ttl new file mode 100644 index 00000000..e9826ef3 --- /dev/null +++ b/src/test/resources/rml-star/valid/RMLSTARTC001b/mapping.ttl @@ -0,0 +1,44 @@ +@prefix rdf: . +@prefix rml: . +@prefix ex: . +@prefix : . +@base . + +:firstTM a rml:AssertedTriplesMap ; + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data1.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:reference "c1-1" ; + rml:termType rml:BlankNode + ]; + rml:predicateObjectMap [ + rml:predicate ex:p ; + rml:objectMap [ + rml:template "http://example/{c1-2}" + ] + ] . + +:secondTM a rml:AssertedTriplesMap ; + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data2.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:quotedTriplesMap :firstTM ; + rml:joinCondition [ + rml:child "c2-2" ; + rml:parent "c1-3" ; + ]; + ]; + rml:predicateObjectMap [ + rml:predicate ex:q ; + rml:objectMap [ + rml:reference "c2-1" + ] + ] . diff --git a/src/test/resources/rml-star/valid/RMLSTARTC001b/output.nt b/src/test/resources/rml-star/valid/RMLSTARTC001b/output.nt new file mode 100644 index 00000000..2d94448c --- /dev/null +++ b/src/test/resources/rml-star/valid/RMLSTARTC001b/output.nt @@ -0,0 +1,2 @@ +_:b0 . +<< _:b0 >> "ABC" . diff --git a/src/test/resources/rml-star/valid/RMLSTARTC002a/data.csv b/src/test/resources/rml-star/valid/RMLSTARTC002a/data.csv new file mode 100644 index 00000000..c44682d4 --- /dev/null +++ b/src/test/resources/rml-star/valid/RMLSTARTC002a/data.csv @@ -0,0 +1,2 @@ +c1,c2,c3 +s,b1,456 \ No newline at end of file diff --git a/src/test/resources/rml-star/valid/RMLSTARTC002a/mapping.ttl b/src/test/resources/rml-star/valid/RMLSTARTC002a/mapping.ttl new file mode 100644 index 00000000..c301bf7e --- /dev/null +++ b/src/test/resources/rml-star/valid/RMLSTARTC002a/mapping.ttl @@ -0,0 +1,42 @@ +@prefix rdf: . +@prefix rml: . +@prefix xsd: . +@prefix ex: . +@prefix : . +@base . + +:firstTM a rml:AssertedTriplesMap ; + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:template "http://example/{c1}" + ]; + rml:predicateObjectMap [ + rml:predicate ex:p ; + rml:objectMap [ + rml:reference "c2" ; + rml:termType rml:BlankNode + ] + ] . + +:secondTM a rml:AssertedTriplesMap ; + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:quotedTriplesMap :firstTM + ]; + rml:predicateObjectMap [ + rml:predicate ex:q ; + rml:objectMap [ + rml:reference "c3"; + rml:datatype xsd:integer + ] + ] . diff --git a/src/test/resources/rml-star/valid/RMLSTARTC002a/output.nt b/src/test/resources/rml-star/valid/RMLSTARTC002a/output.nt new file mode 100644 index 00000000..2dc337a9 --- /dev/null +++ b/src/test/resources/rml-star/valid/RMLSTARTC002a/output.nt @@ -0,0 +1,2 @@ + _:b1 . +<< _:b1 >> "456"^^ . diff --git a/src/test/resources/rml-star/valid/RMLSTARTC002b/data1.csv b/src/test/resources/rml-star/valid/RMLSTARTC002b/data1.csv new file mode 100644 index 00000000..bd188285 --- /dev/null +++ b/src/test/resources/rml-star/valid/RMLSTARTC002b/data1.csv @@ -0,0 +1,2 @@ +c1-1,c1-2,c1-3 +s,b1,1 diff --git a/src/test/resources/rml-star/valid/RMLSTARTC002b/data2.csv b/src/test/resources/rml-star/valid/RMLSTARTC002b/data2.csv new file mode 100644 index 00000000..6c461cb5 --- /dev/null +++ b/src/test/resources/rml-star/valid/RMLSTARTC002b/data2.csv @@ -0,0 +1,2 @@ +c2-1,c2-2 +456,1 diff --git a/src/test/resources/rml-star/valid/RMLSTARTC002b/mapping.ttl b/src/test/resources/rml-star/valid/RMLSTARTC002b/mapping.ttl new file mode 100644 index 00000000..372d0f92 --- /dev/null +++ b/src/test/resources/rml-star/valid/RMLSTARTC002b/mapping.ttl @@ -0,0 +1,46 @@ +@prefix rdf: . +@prefix rml: . +@prefix xsd: . +@prefix ex: . +@prefix : . +@base . + +:firstTM a rml:AssertedTriplesMap ; + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data1.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:template "http://example/{c1-1}" + ]; + rml:predicateObjectMap [ + rml:predicate ex:p ; + rml:objectMap [ + rml:reference "c1-2" ; + rml:termType rml:BlankNode + ] + ] . + +:secondTM a rml:AssertedTriplesMap ; + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data2.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:quotedTriplesMap :firstTM ; + rml:joinCondition [ + rml:child "c2-2" ; + rml:parent "c1-3" ; + ]; + ]; + rml:predicateObjectMap [ + rml:predicate ex:q ; + rml:objectMap [ + rml:reference "c2-1"; + rml:datatype xsd:integer + ] + ] . diff --git a/src/test/resources/rml-star/valid/RMLSTARTC002b/output.nt b/src/test/resources/rml-star/valid/RMLSTARTC002b/output.nt new file mode 100644 index 00000000..2dc337a9 --- /dev/null +++ b/src/test/resources/rml-star/valid/RMLSTARTC002b/output.nt @@ -0,0 +1,2 @@ + _:b1 . +<< _:b1 >> "456"^^ . diff --git a/src/test/resources/rml-star/valid/RMLSTARTC003a/data.csv b/src/test/resources/rml-star/valid/RMLSTARTC003a/data.csv new file mode 100644 index 00000000..98b64639 --- /dev/null +++ b/src/test/resources/rml-star/valid/RMLSTARTC003a/data.csv @@ -0,0 +1,2 @@ +c1,c2,c3,c4 +s,o,z,1 \ No newline at end of file diff --git a/src/test/resources/rml-star/valid/RMLSTARTC003a/mapping.ttl b/src/test/resources/rml-star/valid/RMLSTARTC003a/mapping.ttl new file mode 100644 index 00000000..4d461697 --- /dev/null +++ b/src/test/resources/rml-star/valid/RMLSTARTC003a/mapping.ttl @@ -0,0 +1,58 @@ +@prefix rdf: . +@prefix rml: . +@prefix ex: . +@prefix xsd: . +@prefix : . +@base . + +:firstTM a rml:AssertedTriplesMap ; + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:template "http://example/{c1}" + ]; + rml:predicateObjectMap [ + rml:predicate ex:p ; + rml:objectMap [ + rml:template "http://example/{c2}" + ] + ] . + +:secondTM a rml:AssertedTriplesMap ; + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:quotedTriplesMap :firstTM + ]; + rml:predicateObjectMap [ + rml:predicate ex:r ; + rml:objectMap [ + rml:template "http://example/{c3}" + ] + ] . + +:thirdTM a rml:AssertedTriplesMap ; + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:quotedTriplesMap :secondTM + ]; + rml:predicateObjectMap [ + rml:predicate ex:q ; + rml:objectMap [ + rml:reference "c4" ; + rml:datatype xsd:integer + ] + ] . diff --git a/src/test/resources/rml-star/valid/RMLSTARTC003a/output.nt b/src/test/resources/rml-star/valid/RMLSTARTC003a/output.nt new file mode 100644 index 00000000..d6a50cbe --- /dev/null +++ b/src/test/resources/rml-star/valid/RMLSTARTC003a/output.nt @@ -0,0 +1,3 @@ + . +<< >> . +<< << >> >> "1"^^ . diff --git a/src/test/resources/rml-star/valid/RMLSTARTC003b/data1.csv b/src/test/resources/rml-star/valid/RMLSTARTC003b/data1.csv new file mode 100644 index 00000000..3999e70c --- /dev/null +++ b/src/test/resources/rml-star/valid/RMLSTARTC003b/data1.csv @@ -0,0 +1,2 @@ +c1-1,c1-2,c1-3,c1-4 +s,o,z,1 diff --git a/src/test/resources/rml-star/valid/RMLSTARTC003b/data2.csv b/src/test/resources/rml-star/valid/RMLSTARTC003b/data2.csv new file mode 100644 index 00000000..76b3614a --- /dev/null +++ b/src/test/resources/rml-star/valid/RMLSTARTC003b/data2.csv @@ -0,0 +1,2 @@ +c2-1,c2-2 +1,1 diff --git a/src/test/resources/rml-star/valid/RMLSTARTC003b/mapping.ttl b/src/test/resources/rml-star/valid/RMLSTARTC003b/mapping.ttl new file mode 100644 index 00000000..edab9cc6 --- /dev/null +++ b/src/test/resources/rml-star/valid/RMLSTARTC003b/mapping.ttl @@ -0,0 +1,62 @@ +@prefix rdf: . +@prefix rml: . +@prefix ex: . +@prefix xsd: . +@prefix : . +@base . + +:firstTM a rml:AssertedTriplesMap ; + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data1.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:template "http://example/{c1-1}" + ]; + rml:predicateObjectMap [ + rml:predicate ex:p ; + rml:objectMap [ + rml:template "http://example/{c1-2}" + ] + ] . + +:secondTM a rml:AssertedTriplesMap ; + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data1.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:quotedTriplesMap :firstTM + ]; + rml:predicateObjectMap [ + rml:predicate ex:r ; + rml:objectMap [ + rml:template "http://example/{c1-3}" + ] + ] . + +:thirdTM a rml:AssertedTriplesMap ; + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data2.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:quotedTriplesMap :secondTM; + rml:joinCondition [ + rml:child "c2-2" ; + rml:parent "c1-4" ; + ]; + ]; + rml:predicateObjectMap [ + rml:predicate ex:q ; + rml:objectMap [ + rml:reference "c2-1" ; + rml:datatype xsd:integer + ] + ] . diff --git a/src/test/resources/rml-star/valid/RMLSTARTC003b/output.nt b/src/test/resources/rml-star/valid/RMLSTARTC003b/output.nt new file mode 100644 index 00000000..d6a50cbe --- /dev/null +++ b/src/test/resources/rml-star/valid/RMLSTARTC003b/output.nt @@ -0,0 +1,3 @@ + . +<< >> . +<< << >> >> "1"^^ . diff --git a/src/test/resources/rml-star/valid/RMLSTARTC004a/data.csv b/src/test/resources/rml-star/valid/RMLSTARTC004a/data.csv new file mode 100644 index 00000000..6b3d2345 --- /dev/null +++ b/src/test/resources/rml-star/valid/RMLSTARTC004a/data.csv @@ -0,0 +1,2 @@ +c1,c2,c3,c4 +s,o,a,z \ No newline at end of file diff --git a/src/test/resources/rml-star/valid/RMLSTARTC004a/mapping.ttl b/src/test/resources/rml-star/valid/RMLSTARTC004a/mapping.ttl new file mode 100644 index 00000000..06b3511b --- /dev/null +++ b/src/test/resources/rml-star/valid/RMLSTARTC004a/mapping.ttl @@ -0,0 +1,57 @@ +@prefix rdf: . +@prefix rml: . +@prefix ex: . +@prefix xsd: . +@prefix : . +@base . + +:firstTM a rml:AssertedTriplesMap ; + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:template "http://example/{c1}" + ]; + rml:predicateObjectMap [ + rml:predicate ex:p ; + rml:objectMap [ + rml:template "http://example/{c2}" + ] + ] . + +:secondTM a rml:AssertedTriplesMap ; + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:template "http://example/{c3}" + ]; + rml:predicateObjectMap [ + rml:predicate ex:q ; + rml:objectMap [ + rml:quotedTriplesMap :firstTM + ] + ] . + +:thirdTM a rml:AssertedTriplesMap ; + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:quotedTriplesMap :secondTM + ]; + rml:predicateObjectMap [ + rml:predicate ex:r ; + rml:objectMap [ + rml:template "http://example/{c4}" + ] + ] . diff --git a/src/test/resources/rml-star/valid/RMLSTARTC004a/output.nt b/src/test/resources/rml-star/valid/RMLSTARTC004a/output.nt new file mode 100644 index 00000000..7a8d3131 --- /dev/null +++ b/src/test/resources/rml-star/valid/RMLSTARTC004a/output.nt @@ -0,0 +1,3 @@ + . + << >> . +<< << >> >> . diff --git a/src/test/resources/rml-star/valid/RMLSTARTC004b/data1.csv b/src/test/resources/rml-star/valid/RMLSTARTC004b/data1.csv new file mode 100644 index 00000000..97346277 --- /dev/null +++ b/src/test/resources/rml-star/valid/RMLSTARTC004b/data1.csv @@ -0,0 +1,2 @@ +c1-1,c1-2,c1-3,c1-4 +s,o,a,1 diff --git a/src/test/resources/rml-star/valid/RMLSTARTC004b/data2.csv b/src/test/resources/rml-star/valid/RMLSTARTC004b/data2.csv new file mode 100644 index 00000000..d07b44ae --- /dev/null +++ b/src/test/resources/rml-star/valid/RMLSTARTC004b/data2.csv @@ -0,0 +1,2 @@ +c2-1,c2-2 +z,1 diff --git a/src/test/resources/rml-star/valid/RMLSTARTC004b/mapping.ttl b/src/test/resources/rml-star/valid/RMLSTARTC004b/mapping.ttl new file mode 100644 index 00000000..6ea45025 --- /dev/null +++ b/src/test/resources/rml-star/valid/RMLSTARTC004b/mapping.ttl @@ -0,0 +1,61 @@ +@prefix rdf: . +@prefix rml: . +@prefix ex: . +@prefix xsd: . +@prefix : . +@base . + +:firstTM a rml:AssertedTriplesMap ; + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data1.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:template "http://example/{c1-1}" + ]; + rml:predicateObjectMap [ + rml:predicate ex:p ; + rml:objectMap [ + rml:template "http://example/{c1-2}" + ] + ] . + +:secondTM a rml:AssertedTriplesMap ; + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data1.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:template "http://example/{c1-3}" + ]; + rml:predicateObjectMap [ + rml:predicate ex:q ; + rml:objectMap [ + rml:quotedTriplesMap :firstTM + ] + ] . + +:thirdTM a rml:AssertedTriplesMap ; + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data2.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:quotedTriplesMap :secondTM; + rml:joinCondition [ + rml:child "c2-2" ; + rml:parent "c1-4" ; + ]; + ]; + rml:predicateObjectMap [ + rml:predicate ex:r ; + rml:objectMap [ + rml:template "http://example/{c2-1}" + ] + ] . diff --git a/src/test/resources/rml-star/valid/RMLSTARTC004b/output.nt b/src/test/resources/rml-star/valid/RMLSTARTC004b/output.nt new file mode 100644 index 00000000..7a8d3131 --- /dev/null +++ b/src/test/resources/rml-star/valid/RMLSTARTC004b/output.nt @@ -0,0 +1,3 @@ + . + << >> . +<< << >> >> . diff --git a/src/test/resources/rml-star/valid/RMLSTARTC005a/data.csv b/src/test/resources/rml-star/valid/RMLSTARTC005a/data.csv new file mode 100644 index 00000000..fc181e5f --- /dev/null +++ b/src/test/resources/rml-star/valid/RMLSTARTC005a/data.csv @@ -0,0 +1,2 @@ +c1,c2,c3 +s,o,z \ No newline at end of file diff --git a/src/test/resources/rml-star/valid/RMLSTARTC005a/mapping.ttl b/src/test/resources/rml-star/valid/RMLSTARTC005a/mapping.ttl new file mode 100644 index 00000000..9cfe1409 --- /dev/null +++ b/src/test/resources/rml-star/valid/RMLSTARTC005a/mapping.ttl @@ -0,0 +1,40 @@ +@prefix rdf: . +@prefix rml: . +@prefix ex: . +@prefix xsd: . +@prefix : . +@base . + +:firstTM a rml:NonAssertedTriplesMap ; + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:template "http://example/{c1}" + ]; + rml:predicateObjectMap [ + rml:predicate ex:p ; + rml:objectMap [ + rml:template "http://example/{c2}" + ] + ] . + +:secondTM a rml:AssertedTriplesMap ; + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:quotedTriplesMap :firstTM + ]; + rml:predicateObjectMap [ + rml:predicate ex:q ; + rml:objectMap [ + rml:template "http://example/{c3}" + ] + ] . diff --git a/src/test/resources/rml-star/valid/RMLSTARTC005a/output.nt b/src/test/resources/rml-star/valid/RMLSTARTC005a/output.nt new file mode 100644 index 00000000..7f2be99c --- /dev/null +++ b/src/test/resources/rml-star/valid/RMLSTARTC005a/output.nt @@ -0,0 +1 @@ +<< >> . diff --git a/src/test/resources/rml-star/valid/RMLSTARTC005b/data1.csv b/src/test/resources/rml-star/valid/RMLSTARTC005b/data1.csv new file mode 100644 index 00000000..9fe2369b --- /dev/null +++ b/src/test/resources/rml-star/valid/RMLSTARTC005b/data1.csv @@ -0,0 +1,2 @@ +c1-1,c1-2,c1-3 +s,o,1 diff --git a/src/test/resources/rml-star/valid/RMLSTARTC005b/data2.csv b/src/test/resources/rml-star/valid/RMLSTARTC005b/data2.csv new file mode 100644 index 00000000..d07b44ae --- /dev/null +++ b/src/test/resources/rml-star/valid/RMLSTARTC005b/data2.csv @@ -0,0 +1,2 @@ +c2-1,c2-2 +z,1 diff --git a/src/test/resources/rml-star/valid/RMLSTARTC005b/mapping.ttl b/src/test/resources/rml-star/valid/RMLSTARTC005b/mapping.ttl new file mode 100644 index 00000000..1b885da3 --- /dev/null +++ b/src/test/resources/rml-star/valid/RMLSTARTC005b/mapping.ttl @@ -0,0 +1,44 @@ +@prefix rdf: . +@prefix rml: . +@prefix ex: . +@prefix xsd: . +@prefix : . +@base . + +:firstTM a rml:NonAssertedTriplesMap ; + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data1.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:template "http://example/{c1-1}" + ]; + rml:predicateObjectMap [ + rml:predicate ex:p ; + rml:objectMap [ + rml:template "http://example/{c1-2}" + ] + ] . + +:secondTM a rml:AssertedTriplesMap ; + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data2.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:quotedTriplesMap :firstTM ; + rml:joinCondition [ + rml:child "c2-2" ; + rml:parent "c1-3" ; + ]; + ]; + rml:predicateObjectMap [ + rml:predicate ex:q ; + rml:objectMap [ + rml:template "http://example/{c2-1}" + ] + ] . diff --git a/src/test/resources/rml-star/valid/RMLSTARTC005b/output.nt b/src/test/resources/rml-star/valid/RMLSTARTC005b/output.nt new file mode 100644 index 00000000..7f2be99c --- /dev/null +++ b/src/test/resources/rml-star/valid/RMLSTARTC005b/output.nt @@ -0,0 +1 @@ +<< >> . diff --git a/src/test/resources/rml-star/valid/RMLSTARTC006a/data.csv b/src/test/resources/rml-star/valid/RMLSTARTC006a/data.csv new file mode 100644 index 00000000..8ffc2012 --- /dev/null +++ b/src/test/resources/rml-star/valid/RMLSTARTC006a/data.csv @@ -0,0 +1,2 @@ +c1,c2,c3 +s,o,x \ No newline at end of file diff --git a/src/test/resources/rml-star/valid/RMLSTARTC006a/mapping.ttl b/src/test/resources/rml-star/valid/RMLSTARTC006a/mapping.ttl new file mode 100644 index 00000000..5de699b9 --- /dev/null +++ b/src/test/resources/rml-star/valid/RMLSTARTC006a/mapping.ttl @@ -0,0 +1,40 @@ +@prefix rdf: . +@prefix rml: . +@prefix ex: . +@prefix xsd: . +@prefix : . +@base . + +:firstTM a rml:NonAssertedTriplesMap ; # This refers to the y statement in the rdf-star + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:template "http://example/{c1}" + ]; + rml:predicateObjectMap [ + rml:predicate ex:p ; + rml:objectMap [ + rml:template "http://example/{c2}" + ] + ] . + +:secondTM a rml:AssertedTriplesMap ; # This refers to the x statement in the rdf-star + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:template "http://example/{c3}" + ]; + rml:predicateObjectMap [ + rml:predicate ex:p; ; + rml:objectMap [ + rml:quotedTriplesMap :firstTM + ] + ] . diff --git a/src/test/resources/rml-star/valid/RMLSTARTC006a/output.nt b/src/test/resources/rml-star/valid/RMLSTARTC006a/output.nt new file mode 100644 index 00000000..5aa2cb20 --- /dev/null +++ b/src/test/resources/rml-star/valid/RMLSTARTC006a/output.nt @@ -0,0 +1 @@ + << >> . diff --git a/src/test/resources/rml-star/valid/RMLSTARTC006b/data1.csv b/src/test/resources/rml-star/valid/RMLSTARTC006b/data1.csv new file mode 100644 index 00000000..9fe2369b --- /dev/null +++ b/src/test/resources/rml-star/valid/RMLSTARTC006b/data1.csv @@ -0,0 +1,2 @@ +c1-1,c1-2,c1-3 +s,o,1 diff --git a/src/test/resources/rml-star/valid/RMLSTARTC006b/data2.csv b/src/test/resources/rml-star/valid/RMLSTARTC006b/data2.csv new file mode 100644 index 00000000..80e83100 --- /dev/null +++ b/src/test/resources/rml-star/valid/RMLSTARTC006b/data2.csv @@ -0,0 +1,2 @@ +c2-1,c2-2 +x,1 diff --git a/src/test/resources/rml-star/valid/RMLSTARTC006b/mapping.ttl b/src/test/resources/rml-star/valid/RMLSTARTC006b/mapping.ttl new file mode 100644 index 00000000..c1baf80d --- /dev/null +++ b/src/test/resources/rml-star/valid/RMLSTARTC006b/mapping.ttl @@ -0,0 +1,44 @@ +@prefix rdf: . +@prefix rml: . +@prefix ex: . +@prefix xsd: . +@prefix : . +@base . + +:firstTM a rml:NonAssertedTriplesMap ; # This refers to the y statement in the rdf-star + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data1.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:template "http://example/{c1-1}" + ]; + rml:predicateObjectMap [ + rml:predicate ex:p ; + rml:objectMap [ + rml:template "http://example/{c1-2}" + ] + ] . + +:secondTM a rml:AssertedTriplesMap ; # This refers to the x statement in the rdf-star + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data2.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:template "http://example/{c2-1}" + ]; + rml:predicateObjectMap [ + rml:predicate ex:p; ; + rml:objectMap [ + rml:quotedTriplesMap :firstTM ; + rml:joinCondition [ + rml:child "c2-2" ; + rml:parent "c1-3" ; + ]; + ] + ] . diff --git a/src/test/resources/rml-star/valid/RMLSTARTC006b/output.nt b/src/test/resources/rml-star/valid/RMLSTARTC006b/output.nt new file mode 100644 index 00000000..5aa2cb20 --- /dev/null +++ b/src/test/resources/rml-star/valid/RMLSTARTC006b/output.nt @@ -0,0 +1 @@ + << >> . diff --git a/src/test/resources/rml-star/valid/RMLSTARTC007a/data.csv b/src/test/resources/rml-star/valid/RMLSTARTC007a/data.csv new file mode 100644 index 00000000..d20882cf --- /dev/null +++ b/src/test/resources/rml-star/valid/RMLSTARTC007a/data.csv @@ -0,0 +1,2 @@ +c1,c2,c3,c4 +s1,o1,s2,o2 \ No newline at end of file diff --git a/src/test/resources/rml-star/valid/RMLSTARTC007a/mapping.ttl b/src/test/resources/rml-star/valid/RMLSTARTC007a/mapping.ttl new file mode 100644 index 00000000..16a4cece --- /dev/null +++ b/src/test/resources/rml-star/valid/RMLSTARTC007a/mapping.ttl @@ -0,0 +1,57 @@ +@prefix rdf: . +@prefix rml: . +@prefix ex: . +@prefix xsd: . +@prefix : . +@base . + +:firstTM a rml:NonAssertedTriplesMap ; + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:template "http://example/{c1}" + ]; + rml:predicateObjectMap [ + rml:predicate ex:p1 ; + rml:objectMap [ + rml:template "http://example/{c2}" + ] + ] . + +:secondTM a rml:AssertedTriplesMap ; + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:quotedTriplesMap :firstTM + ]; + rml:predicateObjectMap [ + rml:predicate ex:q; ; + rml:objectMap [ + rml:quotedTriplesMap :thirdTM + ] + ] . + +:thirdTM a rml:NonAssertedTriplesMap ; + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:template "http://example/{c3}" + ]; + rml:predicateObjectMap [ + rml:predicate ex:p2 ; + rml:objectMap [ + rml:template "http://example/{c4}" + ] + ] . diff --git a/src/test/resources/rml-star/valid/RMLSTARTC007a/output.nt b/src/test/resources/rml-star/valid/RMLSTARTC007a/output.nt new file mode 100644 index 00000000..16b9420a --- /dev/null +++ b/src/test/resources/rml-star/valid/RMLSTARTC007a/output.nt @@ -0,0 +1 @@ +<< >> << >> . diff --git a/src/test/resources/rml-star/valid/RMLSTARTC007b/data1.csv b/src/test/resources/rml-star/valid/RMLSTARTC007b/data1.csv new file mode 100644 index 00000000..57395e8f --- /dev/null +++ b/src/test/resources/rml-star/valid/RMLSTARTC007b/data1.csv @@ -0,0 +1,2 @@ +c1-1,c1-2,c1-3 +s1,o1,1 diff --git a/src/test/resources/rml-star/valid/RMLSTARTC007b/data2.csv b/src/test/resources/rml-star/valid/RMLSTARTC007b/data2.csv new file mode 100644 index 00000000..8e56adc6 --- /dev/null +++ b/src/test/resources/rml-star/valid/RMLSTARTC007b/data2.csv @@ -0,0 +1,2 @@ +c2-1,c2-2,c2-3 +s2,o2,1 diff --git a/src/test/resources/rml-star/valid/RMLSTARTC007b/mapping.ttl b/src/test/resources/rml-star/valid/RMLSTARTC007b/mapping.ttl new file mode 100644 index 00000000..89ea0073 --- /dev/null +++ b/src/test/resources/rml-star/valid/RMLSTARTC007b/mapping.ttl @@ -0,0 +1,61 @@ +@prefix rdf: . +@prefix rml: . +@prefix ex: . +@prefix xsd: . +@prefix : . +@base . + +:firstTM a rml:NonAssertedTriplesMap ; + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data1.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:template "http://example/{c1-1}" + ]; + rml:predicateObjectMap [ + rml:predicate ex:p1 ; + rml:objectMap [ + rml:template "http://example/{c1-2}" + ] + ] . + +:secondTM a rml:AssertedTriplesMap ; + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data2.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:quotedTriplesMap :firstTM ; + rml:joinCondition [ + rml:child "c2-3" ; + rml:parent "c1-3" ; + ]; + ]; + rml:predicateObjectMap [ + rml:predicate ex:q; ; + rml:objectMap [ + rml:quotedTriplesMap :thirdTM + ] + ] . + +:thirdTM a rml:NonAssertedTriplesMap ; + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data2.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:template "http://example/{c2-1}" + ]; + rml:predicateObjectMap [ + rml:predicate ex:p2 ; + rml:objectMap [ + rml:template "http://example/{c2-2}" + ] + ] . diff --git a/src/test/resources/rml-star/valid/RMLSTARTC007b/output.nt b/src/test/resources/rml-star/valid/RMLSTARTC007b/output.nt new file mode 100644 index 00000000..16b9420a --- /dev/null +++ b/src/test/resources/rml-star/valid/RMLSTARTC007b/output.nt @@ -0,0 +1 @@ +<< >> << >> . diff --git a/src/test/resources/rml-star/valid/RMLSTARTC008a/data.csv b/src/test/resources/rml-star/valid/RMLSTARTC008a/data.csv new file mode 100644 index 00000000..e495323f --- /dev/null +++ b/src/test/resources/rml-star/valid/RMLSTARTC008a/data.csv @@ -0,0 +1,2 @@ +c1,c2,c3,c4,c5,c6,c7,c8 +s1,o1,s2,o2,s3,o3,s4,o4 \ No newline at end of file diff --git a/src/test/resources/rml-star/valid/RMLSTARTC008a/mapping.ttl b/src/test/resources/rml-star/valid/RMLSTARTC008a/mapping.ttl new file mode 100644 index 00000000..9144682f --- /dev/null +++ b/src/test/resources/rml-star/valid/RMLSTARTC008a/mapping.ttl @@ -0,0 +1,125 @@ +@prefix rdf: . +@prefix rml: . +@prefix ex: . +@prefix xsd: . +@prefix : . +@base . + +:elementaryTM1 a rml:NonAssertedTriplesMap ; + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:template "http://example/{c1}" + ]; + rml:predicateObjectMap [ + rml:predicate ex:p1 ; + rml:objectMap [ + rml:template "http://example/{c2}" + ] + ] . + +:firstJoinTM a rml:NonAssertedTriplesMap ; + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:quotedTriplesMap :elementaryTM1 + ]; + rml:predicateObjectMap [ + rml:predicate ex:q1; ; + rml:objectMap [ + rml:quotedTriplesMap :elementaryTM2 + ] + ] . + +:elementaryTM2 a rml:NonAssertedTriplesMap ; + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:template "http://example/{c3}" + ]; + rml:predicateObjectMap [ + rml:predicate ex:p2 ; + rml:objectMap [ + rml:template "http://example/{c4}" + ] + ] . + +:centralJoinTM a rml:AssertedTriplesMap ; + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:quotedTriplesMap :firstJoinTM + ]; + rml:predicateObjectMap [ + rml:predicate ex:q2; + rml:objectMap [ + rml:quotedTriplesMap :secondJoinTM + ] + ] . + +:elementaryTM3 a rml:NonAssertedTriplesMap ; + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:template "http://example/{c5}" + ]; + rml:predicateObjectMap [ + rml:predicate ex:p3 ; + rml:objectMap [ + rml:template "http://example/{c6}" + ] + ] . + +:secondJoinTM a rml:NonAssertedTriplesMap ; + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:quotedTriplesMap :elementaryTM3 + ]; + rml:predicateObjectMap [ + rml:predicate ex:q3; ; + rml:objectMap [ + rml:quotedTriplesMap :elementaryTM4 + ] + ] . + +:elementaryTM4 a rml:NonAssertedTriplesMap ; + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:template "http://example/{c7}" + ]; + rml:predicateObjectMap [ + rml:predicate ex:p4 ; + rml:objectMap [ + rml:template "http://example/{c8}" + ] + ] . diff --git a/src/test/resources/rml-star/valid/RMLSTARTC008a/output.nt b/src/test/resources/rml-star/valid/RMLSTARTC008a/output.nt new file mode 100644 index 00000000..041b8573 --- /dev/null +++ b/src/test/resources/rml-star/valid/RMLSTARTC008a/output.nt @@ -0,0 +1 @@ +<<<<>><<>>>><<<<>><<>>>>. \ No newline at end of file diff --git a/src/test/resources/rml-star/valid/RMLSTARTC008b/data1.csv b/src/test/resources/rml-star/valid/RMLSTARTC008b/data1.csv new file mode 100644 index 00000000..1f57ab59 --- /dev/null +++ b/src/test/resources/rml-star/valid/RMLSTARTC008b/data1.csv @@ -0,0 +1,2 @@ +c1-1,c1-2,c1-3,c1-4,c1-5 +s1,o1,s2,o2,1 diff --git a/src/test/resources/rml-star/valid/RMLSTARTC008b/data2.csv b/src/test/resources/rml-star/valid/RMLSTARTC008b/data2.csv new file mode 100644 index 00000000..edee9b83 --- /dev/null +++ b/src/test/resources/rml-star/valid/RMLSTARTC008b/data2.csv @@ -0,0 +1,2 @@ +c2-1,c2-2,c2-3,c2-4,c2-5 +s3,o3,s4,o4,1 diff --git a/src/test/resources/rml-star/valid/RMLSTARTC008b/mapping.ttl b/src/test/resources/rml-star/valid/RMLSTARTC008b/mapping.ttl new file mode 100644 index 00000000..ee753626 --- /dev/null +++ b/src/test/resources/rml-star/valid/RMLSTARTC008b/mapping.ttl @@ -0,0 +1,129 @@ +@prefix rdf: . +@prefix rml: . +@prefix ex: . +@prefix xsd: . +@prefix : . +@base . + +:elementaryTM1 a rml:NonAssertedTriplesMap ; + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data1.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:template "http://example/{c1-1}" + ]; + rml:predicateObjectMap [ + rml:predicate ex:p1 ; + rml:objectMap [ + rml:template "http://example/{c1-2}" + ] + ] . + +:firstJoinTM a rml:NonAssertedTriplesMap ; + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data1.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:quotedTriplesMap :elementaryTM1 + ]; + rml:predicateObjectMap [ + rml:predicate ex:q1; ; + rml:objectMap [ + rml:quotedTriplesMap :elementaryTM2 + ] + ] . + +:elementaryTM2 a rml:NonAssertedTriplesMap ; + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data1.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:template "http://example/{c1-3}" + ]; + rml:predicateObjectMap [ + rml:predicate ex:p2 ; + rml:objectMap [ + rml:template "http://example/{c1-4}" + ] + ] . + +:centralJoinTM a rml:AssertedTriplesMap ; + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data2.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:quotedTriplesMap :firstJoinTM ; + rml:joinCondition [ + rml:child "c2-5" ; + rml:parent "c1-5" ; + ]; + ]; + rml:predicateObjectMap [ + rml:predicate ex:q2; + rml:objectMap [ + rml:quotedTriplesMap :secondJoinTM + ] + ] . + +:elementaryTM3 a rml:NonAssertedTriplesMap ; + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data2.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:template "http://example/{c2-1}" + ]; + rml:predicateObjectMap [ + rml:predicate ex:p3 ; + rml:objectMap [ + rml:template "http://example/{c2-2}" + ] + ] . + +:secondJoinTM a rml:NonAssertedTriplesMap ; + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data2.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:quotedTriplesMap :elementaryTM3 + ]; + rml:predicateObjectMap [ + rml:predicate ex:q3; ; + rml:objectMap [ + rml:quotedTriplesMap :elementaryTM4 + ] + ] . + +:elementaryTM4 a rml:NonAssertedTriplesMap ; + rml:logicalSource [ + rml:source [ a rml:Source, rml:RelativePathSource; + rml:path "data2.csv"; + ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ + rml:template "http://example/{c2-3}" + ]; + rml:predicateObjectMap [ + rml:predicate ex:p4 ; + rml:objectMap [ + rml:template "http://example/{c2-4}" + ] + ] . diff --git a/src/test/resources/rml-star/valid/RMLSTARTC008b/output.nt b/src/test/resources/rml-star/valid/RMLSTARTC008b/output.nt new file mode 100644 index 00000000..fe36da8e --- /dev/null +++ b/src/test/resources/rml-star/valid/RMLSTARTC008b/output.nt @@ -0,0 +1 @@ +<<<<>><<>>>><<<<>><<>>>>.