Skip to content

Instantly share code, notes, and snippets.

@balhoff
Created June 30, 2016 14:35
Show Gist options
  • Save balhoff/6bb8edc4e6cca38f800fe21f14a08f8f to your computer and use it in GitHub Desktop.
Save balhoff/6bb8edc4e6cca38f800fe21f14a08f8f to your computer and use it in GitHub Desktop.
Test whether sh:qualifiedValueShape works with sh:inverseProperty
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>
@prefix sh: <http://www.w3.org/ns/shacl#>
@prefix xsd: <http://www.w3.org/2001/XMLSchema#>
@prefix owl: <http://www.w3.org/2002/07/owl#>
@prefix oboInOwl: <http://www.geneontology.org/formats/oboInOwl#>
@prefix obo: <http://purl.obolibrary.org/obo/>
@prefix ex: <http://example.org/>
ex:OneBiologicalFather
a sh:Shape ;
sh:scope [
a sh:AllSubjectsScope ;
] ;
sh:property [
sh:predicate ex:hasBiologicalFather ;
sh:qualifiedMaxCount 1 ;
sh:qualifiedValueShape [
sh:property [
sh:predicate ex:gender ;
sh:hasValue ex:Male
]
]
] .
ex:OneBiologicalFatherInverse
a sh:Shape ;
sh:scope [
a sh:AllObjectsScope ;
] ;
sh:inverseProperty [
sh:predicate ex:biologicalFatherOf ;
sh:qualifiedMaxCount 1 ;
sh:qualifiedValueShape [
sh:property [
sh:predicate ex:gender ;
sh:hasValue ex:Male
]
]
] .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>
@prefix sh: <http://www.w3.org/ns/shacl#>
@prefix xsd: <http://www.w3.org/2001/XMLSchema#>
@prefix owl: <http://www.w3.org/2002/07/owl#>
@prefix oboInOwl: <http://www.geneontology.org/formats/oboInOwl#>
@prefix obo: <http://purl.obolibrary.org/obo/>
@prefix ex: <http://example.org/>
ex:Don ex:biologicalFatherOf ex:Jim .
ex:Don ex:gender ex:Male .
ex:Jim ex:hasBiologicalFather ex:Don .
ex:Jack ex:gender ex:Male .
# These triples should produce violations:
# ex:Jack ex:biologicalFatherOf ex:Jim .
# ex:Jim ex:hasBiologicalFather ex:Jack .
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment