Skip to content

Instantly share code, notes, and snippets.

@jaw111
Last active November 2, 2021 09:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jaw111/885c8615dfe642342c3ad5d8b015df85 to your computer and use it in GitHub Desktop.
Save jaw111/885c8615dfe642342c3ad5d8b015df85 to your computer and use it in GitHub Desktop.
Example rule to infer skos:member for skos:OrderedCollection
@base <https://example.com/> .
@prefix skos: <http://www.w3.org/2004/02/skos/core#>.
<collection1> a skos:OrderedCollection ;
skos:memberList ( <member1> <member2> <member3> ) .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
@prefix sh: <http://www.w3.org/ns/shacl#>.
@prefix skos: <http://www.w3.org/2004/02/skos/core#>.
[] a sh:NodeShape ;
sh:targetClass skos:OrderedCollection ;
sh:rule [
a sh:TripleRule ;
sh:subject sh:this ;
sh:predicate skos:member ;
sh:object [
# SPARQL Property path: skos:memberList/rdf:rest*/rdf:first
sh:path ( skos:memberList [ sh:zeroOrMorePath rdf:rest ] rdf:first )
]
] .
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment