Skip to content

Commit

Permalink
Sample SHACL transform
Browse files Browse the repository at this point in the history
  • Loading branch information
avillar committed Jun 21, 2024
1 parent 6e25017 commit c9a90f5
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
6 changes: 6 additions & 0 deletions _sources/feature/geojsonFeature/examples.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,9 @@
snippets:
- language: json
ref: examples/feature.json

transforms:
- input-language: text/turtle
output-language: text/turtle
type: shacl
ref: transforms/sample.shacl
20 changes: 20 additions & 0 deletions _sources/feature/geojsonFeature/transforms/sample.shacl
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
@prefix mymodel: <http://example.org/myModel/> .
@prefix sh: <http://www.w3.org/ns/shacl#>.

<urn:example:LabelToDCTERMS>
a sh:NodeShape ;
sh:targetSubjectsOf mymodel:myProp;
sh:rule [
a sh:SPARQLRule ;
sh:construct """
prefix dcterms: <http://purl.org/dc/terms/>
prefix mymodel: <http://example.org/myModel/>
CONSTRUCT {
$this dcterms:identifier ?myPropUpper
} WHERE {
$this mymodel:myProp ?myProp
BIND(UCASE(?myProp) as ?myPropUpper)
}
"""
] ;
.

0 comments on commit c9a90f5

Please sign in to comment.