From 5ef63fa38715905ab648550b38a1387ed2800209 Mon Sep 17 00:00:00 2001 From: Jakub Duchateau Date: Mon, 17 Aug 2026 14:31:34 +0200 Subject: [PATCH] test: logical source on a triples map can be omitted if all its term maps are constant --- test-cases/RMLFNMLTC0200/README.md | 41 +++++ test-cases/RMLFNMLTC0200/mapping.ttl | 23 +++ test-cases/RMLFNMLTC0200/output.nq | 1 + test-cases/RMLFNMLTC0201/README.md | 36 +++++ test-cases/RMLFNMLTC0201/mapping.ttl | 23 +++ test-cases/descriptions.csv | 4 +- test-cases/manifest.ttl | 228 ++++++++++++++------------- test-cases/metadata.csv | 2 + 8 files changed, 249 insertions(+), 109 deletions(-) create mode 100644 test-cases/RMLFNMLTC0200/README.md create mode 100644 test-cases/RMLFNMLTC0200/mapping.ttl create mode 100644 test-cases/RMLFNMLTC0200/output.nq create mode 100644 test-cases/RMLFNMLTC0201/README.md create mode 100644 test-cases/RMLFNMLTC0201/mapping.ttl diff --git a/test-cases/RMLFNMLTC0200/README.md b/test-cases/RMLFNMLTC0200/README.md new file mode 100644 index 0000000..328ce19 --- /dev/null +++ b/test-cases/RMLFNMLTC0200/README.md @@ -0,0 +1,41 @@ +## RMLFNMLTC0200 + +**Title**: Constant function execution can omit logical source + +**Description**: Test a Triples Map with only constant expressions in a function execution can omit logical source + +**Error expected?** No + +**Mapping** +``` +@prefix rml: . +@prefix rdfs: . +@prefix grel: . + + a rml:TriplesMap; + rml:subjectMap [ rml:constant ]; + rml:predicateObjectMap [ + rml:predicate rdfs:label; + rml:objectMap [ + rml:functionExecution [ + rml:function grel:toUppercase; + rml:input [ + rml:parameter grel:valueParam; + rml:inputValueMap [ + rml:constant "Gaston Lagaffe" + ]; + ]; + ]; + rml:return grel:stringOut; + rml:language "fr-BE" ; + ]; + ]. + + +``` + +**Output** +``` + "GASTON LAGAFFE"@fr-BE . +``` + diff --git a/test-cases/RMLFNMLTC0200/mapping.ttl b/test-cases/RMLFNMLTC0200/mapping.ttl new file mode 100644 index 0000000..ac22849 --- /dev/null +++ b/test-cases/RMLFNMLTC0200/mapping.ttl @@ -0,0 +1,23 @@ +@prefix rml: . +@prefix rdfs: . +@prefix grel: . + + a rml:TriplesMap; + rml:subjectMap [ rml:constant ]; + rml:predicateObjectMap [ + rml:predicate rdfs:label; + rml:objectMap [ + rml:functionExecution [ + rml:function grel:toUppercase; + rml:input [ + rml:parameter grel:valueParam; + rml:inputValueMap [ + rml:constant "Gaston Lagaffe" + ]; + ]; + ]; + rml:return grel:stringOut; + rml:language "fr-BE" ; + ]; + ]. + diff --git a/test-cases/RMLFNMLTC0200/output.nq b/test-cases/RMLFNMLTC0200/output.nq new file mode 100644 index 0000000..a8a08e4 --- /dev/null +++ b/test-cases/RMLFNMLTC0200/output.nq @@ -0,0 +1 @@ + "GASTON LAGAFFE"@fr-BE . \ No newline at end of file diff --git a/test-cases/RMLFNMLTC0201/README.md b/test-cases/RMLFNMLTC0201/README.md new file mode 100644 index 0000000..e49e808 --- /dev/null +++ b/test-cases/RMLFNMLTC0201/README.md @@ -0,0 +1,36 @@ +## RMLFNMLTC0201 + +**Title**: Non constant mapping, while omitting logical source + +**Description**: Test a Triples Map with reference expressions in a function execution cannot omit logical source + +**Error expected?** Yes + +**Mapping** +``` +@prefix rml: . +@prefix rdfs: . +@prefix grel: . + + a rml:TriplesMap; + rml:subjectMap [ rml:constant ]; + rml:predicateObjectMap [ + rml:predicate rdfs:label; + rml:objectMap [ + rml:functionExecution [ + rml:function grel:toUppercase; + rml:input [ + rml:parameter grel:valueParam; + rml:inputValueMap [ + rml:template "{name}" + ]; + ]; + ]; + rml:return grel:stringOut; + rml:language "fr-BE" ; + ]; + ]. + + +``` + diff --git a/test-cases/RMLFNMLTC0201/mapping.ttl b/test-cases/RMLFNMLTC0201/mapping.ttl new file mode 100644 index 0000000..d8d7b5e --- /dev/null +++ b/test-cases/RMLFNMLTC0201/mapping.ttl @@ -0,0 +1,23 @@ +@prefix rml: . +@prefix rdfs: . +@prefix grel: . + + a rml:TriplesMap; + rml:subjectMap [ rml:constant ]; + rml:predicateObjectMap [ + rml:predicate rdfs:label; + rml:objectMap [ + rml:functionExecution [ + rml:function grel:toUppercase; + rml:input [ + rml:parameter grel:valueParam; + rml:inputValueMap [ + rml:template "{name}" + ]; + ]; + ]; + rml:return grel:stringOut; + rml:language "fr-BE" ; + ]; + ]. + diff --git a/test-cases/descriptions.csv b/test-cases/descriptions.csv index a191582..c0e667c 100644 --- a/test-cases/descriptions.csv +++ b/test-cases/descriptions.csv @@ -25,4 +25,6 @@ RMLFNMLTC0081-CSV,"Function on languageMap, 1 parameter",Tests that function on 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 +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,,, +RMLFNMLTC0200,Constant function execution can omit logical source,Test a Triples Map with only constant expressions in a function execution can omit logical source,,,,FALSE,,,, +RMLFNMLTC0201,"Non constant mapping, while omitting logical source",Test a Triples Map with reference expressions in a function execution cannot omit logical source,,,,TRUE,,,, diff --git a/test-cases/manifest.ttl b/test-cases/manifest.ttl index 127ce2d..706720d 100644 --- a/test-cases/manifest.ttl +++ b/test-cases/manifest.ttl @@ -1,224 +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" . - . + "text/csv" . + "student.csv" . + . + "application/n-quads" . + "output.nq" . + . "RMLFNMLTC0002-CSV" . "false"^^ . . "mapping.ttl" . . . - "student.csv" . - "text/csv" . - . - "output.nq" . - "application/n-quads" . - . + "text/csv" . + "student.csv" . + . + "application/n-quads" . + "output.nq" . + . "RMLFNMLTC0003-CSV" . "false"^^ . . "mapping.ttl" . . . - "student.csv" . - "text/csv" . - . - "output.nq" . - "application/n-quads" . - . + "text/csv" . + "student.csv" . + . + "application/n-quads" . + "output.nq" . + . "RMLFNMLTC0004-CSV" . "false"^^ . . "mapping.ttl" . . . - "student.csv" . - "text/csv" . - . - "output.nq" . - "application/n-quads" . - . + "text/csv" . + "student.csv" . + . + "application/n-quads" . + "output.nq" . + . "RMLFNMLTC0005-CSV" . "false"^^ . . "mapping.ttl" . . . - "student.csv" . - "text/csv" . - . - "output.nq" . - "application/n-quads" . - . + "text/csv" . + "student.csv" . + . + "application/n-quads" . + "output.nq" . + . "RMLFNMLTC0007-CSV" . "false"^^ . . "mapping.ttl" . . . - "student.csv" . - "text/csv" . - . - "output.nq" . - "application/n-quads" . - . + "text/csv" . + "student.csv" . + . + "application/n-quads" . + "output.nq" . + . "RMLFNMLTC0008-CSV" . "false"^^ . . "mapping.ttl" . . . - "student.csv" . - "text/csv" . - . - "output.nq" . - "application/n-quads" . - . + "text/csv" . + "student.csv" . + . + "application/n-quads" . + "output.nq" . + . "RMLFNMLTC0011-CSV" . "false"^^ . . "mapping.ttl" . . . - "student.csv" . - "text/csv" . - . - "output.nq" . - "application/n-quads" . - . + "text/csv" . + "student.csv" . + . + "application/n-quads" . + "output.nq" . + . "RMLFNMLTC0021-CSV" . "false"^^ . . "mapping.ttl" . . . - "student.csv" . - "text/csv" . - . - "output.nq" . - "application/n-quads" . - . + "text/csv" . + "student.csv" . + . + "application/n-quads" . + "output.nq" . + . "RMLFNMLTC0031-CSV" . "false"^^ . . "mapping.ttl" . . . - "student.csv" . - "text/csv" . - . - "output.nq" . - "application/n-quads" . - . + "text/csv" . + "student.csv" . + . + "application/n-quads" . + "output.nq" . + . "RMLFNMLTC0032-CSV" . "false"^^ . . "mapping.ttl" . . . - "student.csv" . - "text/csv" . - . - "output.nq" . - "application/n-quads" . - . + "text/csv" . + "student.csv" . + . + "application/n-quads" . + "output.nq" . + . "RMLFNMLTC0041-CSV" . "false"^^ . . "mapping.ttl" . . . - "student.csv" . - "text/csv" . - . - "output.nq" . - "application/n-quads" . - . + "text/csv" . + "student.csv" . + . + "application/n-quads" . + "output.nq" . + . "RMLFNMLTC0051-CSV" . "false"^^ . . "mapping.ttl" . . . - "student.csv" . - "text/csv" . - . - "output.nq" . - "application/n-quads" . - . + "text/csv" . + "student.csv" . + . + "application/n-quads" . + "output.nq" . + . "RMLFNMLTC0061-CSV" . "false"^^ . . "mapping.ttl" . . . - "student.csv" . - "text/csv" . - . - "output.nq" . - "application/n-quads" . - . + "text/csv" . + "student.csv" . + . + "application/n-quads" . + "output.nq" . + . "RMLFNMLTC0071-CSV" . "false"^^ . . "mapping.ttl" . . . - "student.csv" . - "text/csv" . - . - "output.nq" . - "application/n-quads" . - . + "text/csv" . + "student.csv" . + . + "application/n-quads" . + "output.nq" . + . "RMLFNMLTC0081-CSV" . "false"^^ . . "mapping.ttl" . . . - "student.csv" . - "text/csv" . - . + "text/csv" . + "student.csv" . + . + "application/n-quads" . + "output.nq" . + . "RMLFNMLTC0101-CSV" . "true"^^ . . "mapping.ttl" . . - "student.csv" . - "text/csv" . - . + "text/csv" . + "student.csv" . + . "RMLFNMLTC0102-CSV" . "true"^^ . . "mapping.ttl" . . - "student.csv" . - "text/csv" . - . + "text/csv" . + "student.csv" . + . "RMLFNMLTC0103-CSV" . "true"^^ . . "mapping.ttl" . . - "student.csv" . - "text/csv" . - . + "text/csv" . + "student.csv" . + . "RMLFNMLTC0104-CSV" . "true"^^ . . "mapping.ttl" . . + "text/csv" . + "student.csv" . + . + "RMLFNMLTC0200" . + "false"^^ . + "mapping.ttl" . + . + . + "application/n-quads" . + "output.nq" . + . + "RMLFNMLTC0201" . + "true"^^ . + "mapping.ttl" . + . diff --git a/test-cases/metadata.csv b/test-cases/metadata.csv index 3a69c05..8e13dfc 100644 --- a/test-cases/metadata.csv +++ b/test-cases/metadata.csv @@ -26,3 +26,5 @@ RMLFNMLTC0101-CSV,"Function on object, 1 false reference parameter",Tests if a f 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,,,,,,student.csv,,,,,,true 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,,,,,,student.csv,,,,,,true 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,,,,,,student.csv,,,,,,true +RMLFNMLTC0200,Constant function execution can omit logical source,Test a Triples Map with only constant expressions in a function execution can omit logical source,http://w3id.org/rml/fnml/,mapping.ttl,,,,application/n-quads,,,,,,output.nq,,,false +RMLFNMLTC0201,"Non constant mapping, while omitting logical source",Test a Triples Map with reference expressions in a function execution cannot omit logical source,http://w3id.org/rml/fnml/,mapping.ttl,,,,,,,,,,,,,true