Skip to content

Commit

Permalink
Merge pull request #36 from kg-construct/fix/function-descriptions
Browse files Browse the repository at this point in the history
added grel descriptions and cleaned up old grel descriptions
  • Loading branch information
bjdmeest authored Mar 26, 2024
2 parents 5bdcf1c + c9defc7 commit e9204d6
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 35 deletions.
17 changes: 0 additions & 17 deletions spec/diagrams/fnml.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,31 +5,14 @@ graph LR
T3M([triples map])
T3M-->|predicateObjectMap| POM([predicate-object map])
POM -->|objectMap| FM
%% FM([Function term map]):::fnml
FM([function-valued expression map]):::fnml
%% FM -->|function value| Ex([triples map])
FM -->|execution| Ex([Function Execution]):::fnml
%% FM -->|execution| Ex([Function triples map]):::fnml
%% FM -->|function value| Ex([Function triples map]):::fnml
FM -->|return| J(grel:stringOut):::fno
Ex -->|function| Fn(grel:toUpperCase):::fno
%% Ex -->|predicateObjectMap| ExPOM([predicate-object map])
%% ExPOM -->|predicate| ExP(fno:executes):::fno
%% ExPOM -->|object map| ExO([Object map])
%% ExO -->|constant| ExO1(grel:toUpperCase):::fno
Ex -->|input| ParamPOM([Input]):::fnml
%% Ex -->|predicateObjectMap| ParamPOM([predicate-object map])
ParamPOM -->|parameter| P2(grel:valueParam):::fno
ParamPOM -->|valueMap| O1(term map)
%% ParamPOM -->|predicate| P2(grel:str_value):::fno
%% ParamPOM -->|object map| O1([Object map])
O1 --> |template| Ot1("{lastname}"):::kfno
%% ParamPOM -->|objectMap| ROM([ReferencingObjectMap])
%% ROM -->|parentTriplesMap| PT3M([TriplesMap]):::ls2
%% ROM -->|joinCondition| JC([JoinCondition])
%% ROM -->|joinResultTerm| JTM("{parentsource_value}"):::ls2
%% JC -->|childTerm| ChTM([TermMap]):::ls2
%% JC -->|parentTerm| PaTM([TermMap]):::ls2
classDef fnml fill:#8F9
classDef fno fill:#F89
classDef rml fill:#89F
Expand Down
19 changes: 1 addition & 18 deletions spec/docs/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ The FnO description of the function [toUppercase](https://github.com/OpenRefine/
@prefix dcterms: <http://purl.org/dc/terms/> .
@prefix fno: <https://w3id.org/function/ontology#> .
@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#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
Expand All @@ -40,7 +41,6 @@ grel:toUpperCase
fno:name "to Uppercase" ;
rdfs:label "to Uppercase" ;
dcterms:description "Returns the input with all letters in upper case." ;
fno:solves grel:prob_ucase ;
fno:expects ( grel:valueParam ) ;
fno:returns ( grel:stringOut ) .
Expand Down Expand Up @@ -88,31 +88,14 @@ graph LR
T3M-->|subjectMap| FM
POM -->|predicate| FM
POM -->|objectMap| FM
%% FM([Function term map]):::fnml
FM([function-valued expression map]):::fnml
%% FM -->|function value| Ex([triples map])
FM -->|execution| Ex([Function Execution]):::fnml
%% FM -->|execution| Ex([Function triples map]):::fnml
%% FM -->|function value| Ex([Function triples map]):::fnml
FM -->|return| J(grel:stringOut):::fno
Ex -->|function| Fn(grel:toUpperCase):::fno
%% Ex -->|predicateObjectMap| ExPOM([predicate-object map])
%% ExPOM -->|predicate| ExP(fno:executes):::fno
%% ExPOM -->|object map| ExO([Object map])
%% ExO -->|constant| ExO1(grel:toUpperCase):::fno
Ex -->|input| ParamPOM([Input]):::fnml
%% Ex -->|predicateObjectMap| ParamPOM([predicate-object map])
ParamPOM -->|parameter| P2(grel:valueParam):::fno
ParamPOM -->|valueMap| O1(term map)
%% ParamPOM -->|predicate| P2(grel:str_value):::fno
%% ParamPOM -->|object map| O1([Object map])
O1 --> |template| Ot1("{lastname}"):::kfno
%% ParamPOM -->|objectMap| ROM([ReferencingObjectMap])
%% ROM -->|parentTriplesMap| PT3M([TriplesMap]):::ls2
%% ROM -->|joinCondition| JC([JoinCondition])
%% ROM -->|joinResultTerm| JTM("{parentsource_value}"):::ls2
%% JC -->|childTerm| ChTM([TermMap]):::ls2
%% JC -->|parentTerm| PaTM([TermMap]):::ls2
classDef fnml fill:#8F9
classDef fno fill:#F89
classDef rml fill:#89F
Expand Down
2 changes: 2 additions & 0 deletions test-cases/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ 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)

## Open issues for which there are no test cases

| title | purpose |
Expand Down
52 changes: 52 additions & 0 deletions test-cases/functions.ttl
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
@prefix dcterms: <http://purl.org/dc/terms/> .
@prefix fno: <https://w3id.org/function/ontology#> .
@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#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .

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 .

0 comments on commit e9204d6

Please sign in to comment.