Skip to content

Commit

Permalink
Merge pull request #38 from kg-construct/fix/test-0000
Browse files Browse the repository at this point in the history
added alternative to 0000
  • Loading branch information
bjdmeest authored Mar 26, 2024
2 parents 6248273 + fffb387 commit bfb6dae
Show file tree
Hide file tree
Showing 5 changed files with 53 additions and 1 deletion.
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 .

0 comments on commit bfb6dae

Please sign in to comment.