Handling a complex set of constraints #398
Closed
jeff-zucker
started this conversation in
General
Replies: 1 comment 1 reply
-
This should work with your example data: https://s.zazuko.com/6VUEtU @prefix sh: <http://www.w3.org/ns/shacl#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix ex: <http://www.example.org/> .
ex:TopLevelTypeShape a sh:NodeShape ;
sh:targetSubjectsOf rdf:type ;
sh:property [
sh:path rdf:type ;
sh:qualifiedValueShape [
sh:xone (
[ sh:hasValue ex:Product ]
[ sh:hasValue ex:Service ]
);
] ;
sh:qualifiedMinCount 1 ;
] ;
sh:not [
sh:and (
[ sh:property
[
sh:path rdf:type ;
sh:hasValue ex:Product ;
]
]
[ sh:property
[
sh:path rdf:type ;
sh:hasValue ex:Service ;
]
]
)
] . |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I want to be able to say that a NodeShape must have an rdf:type that is one of the top-level types I define - ex:Product, ex:Service, etc.; can not have more than one of those top-level types; may have zero or more additional types. It should handle data like this
ChatGPT suggests this. Is it valid? Does it do what I want? Any better ways?
Beta Was this translation helpful? Give feedback.
All reactions