Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

0004 suggestion #39

Merged
merged 2 commits into from
Mar 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions test-cases/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ Some test cases are under discussion, proposed alternatives are noted via a suff
| 0002 | Function on object, 1 false reference parameter | Tests if a false reference parameters is caught | CSV | TRUE | student.csv |
| 0003 | Function on object, 1 reference parameter, 1 constant parameter | Tests if a function with multiple parameters can be used | CSV | FALSE | student.csv |
| 0004 | Function on predicate, 1 parameter | Tests if a function can be used on a predicate | CSV | FALSE | student.csv |
| 0004b | Function on predicate, 1 parameter (replaces 0004) | Tests if a function can be used on a predicate | CSV | FALSE | student.csv |
| 0005 | Function on subject, 1 parameter | Tests if a function can be used on a subject | CSV | FALSE | student.csv |
| 0005 | Function on subject, default termType | Tests if the default termType assigned to the output of the function to be correct | | | |
| 0006 | Function on object, the output termType is IRI | Tests if the output of the function is assigned the correct termType | | | |
Expand Down
39 changes: 39 additions & 0 deletions test-cases/RMLFNOTC0004b-CSV/mapping.ttl
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
@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"
];
] .
1 change: 1 addition & 0 deletions test-cases/RMLFNOTC0004b-CSV/output.nq
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<http://example.com/Venus> <https://schema.org/Venus> <http://xmlns.com/foaf/0.1/name> .
2 changes: 2 additions & 0 deletions test-cases/RMLFNOTC0004b-CSV/student.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Id,Name,Comment,Class
1,Venus,A&B,A
14 changes: 14 additions & 0 deletions test-cases/functions.ttl
Original file line number Diff line number Diff line change
Expand Up @@ -65,3 +65,17 @@ fns:stringOutput
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 .
Loading