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

added alternative to 0000 #38

Merged
merged 1 commit 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
5 changes: 4 additions & 1 deletion test-cases/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ 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)
All function descriptions are locally available under [functions.ttl](./functions.ttl).

Some test cases are under discussion, proposed alternatives are noted via a suffix `b`.

## Open issues for which there are no test cases

Expand Down Expand Up @@ -34,6 +36,7 @@ All function descriptions are locally available under [functions.ttl](./function
| new_id | title | purpose | data format | error expected? | input file 1 |
|:------:|:---------------------------------------------------------------:|:-----------------------------------------------------------------------------------------------------------------------------:|:-----------:|:---------------:|:-----------------:|
| 0000 | 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) | CSV | FALSE | student.csv |
| 0000b | Function on object, 0 parameters (replaces 0000) | Tests (1) if a function without parameters can be used (FnO) (2) if a function on an object map can be used (Term) | CSV | FALSE | student.csv |
| 0000 | Function on object, default termType | Tests if the output of the function is assigned the correct termType by default | | | |
| 0001 | 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 | FALSE | student.csv |
| 0001 | Function using non-constant shortcut property parameter | Tests that a non-constant FNML Parameter map also works | CSV | FALSE | student_param.csv |
Expand Down
31 changes: 31 additions & 0 deletions test-cases/RMLFNOTC0000b-CSV/mapping.ttl
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
@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 .
1 change: 1 addition & 0 deletions test-cases/RMLFNOTC0000b-CSV/output.nq
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "Hello World!" .
2 changes: 2 additions & 0 deletions test-cases/RMLFNOTC0000b-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
15 changes: 15 additions & 0 deletions test-cases/functions.ttl
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
@prefix dcterms: <http://purl.org/dc/terms/> .
@prefix fno: <https://w3id.org/function/ontology#> .
@prefix fns: <http://example.com/functions/> .
@prefix grel: <http://users.ugent.be/~bjdmeest/function/grel.ttl#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
Expand Down Expand Up @@ -50,3 +51,17 @@ grel:param_replace
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 .
Loading