-
Notifications
You must be signed in to change notification settings - Fork 64
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Validation of Enumeration Values?? #178
Comments
Long answer for you, because working with enumerants in RDF has been pretty non-trivial in my experience. First, try using SHACL-SHACL validation against your SHACL graph. It's the ex:myClass a owl:Class ;
sh:property [
sh:node ex:MyEnumClassValues ;
sh:path ex:enum ] .
Also, So, that example chunk I quoted should read instead: ex:myClass a owl:Class, sh:NodeShape ;
sh:property [
sh:sparql ex:MyEnumClassValues ;
sh:path ex:enum ] . For an example of this from the spec, see Section 5.1, especially the example with Also, I'm not quite sure if it matters, but your The summary of the above is that the SHACL-SHACL shapes, provided by the SHACL specification to validate your SHACL, should be tried first to see if there are any syntax gotchas. The summary of the below is, you might be better off using From a quirk of OWL 2 DL syntactic requirements, if you are developing an OWL 2 DL ontology, you must duplicate the The shape we defined to validate our OWL usage is here. From reading on another thread (I forget which) in the pySHACL repository, I've come to realize that while correct, it is potentially a grievously slow implementation, and should be spelled with SHACL syntax, eschewing SHACL-SPARQL - I encourage you to try that using If you're not constraining your development to OWL 2 DL, you can use an IRI-identified Within your example, it looks like Last, there is a potential ontological re-design solution: Consider if there is a reason that you are using an enumeration of individuals, rather than an Hopefully some or all of that helps. |
Thank you for your response. Good eye on spotting my owl:equivalentClass omission. In fact, our production ontologies do have the owl:equivalentClass linking. 👍 I found a much simpler way to handle this scenario, btw. I will always have explicit individuals since we manage metadata on them, so this option is available and works nicely (no meta_shacl required from what I see). @Prefix rdf: http://www.w3.org/1999/02/22-rdf-syntax-ns# . ex:myClass a owl:Class ; ex:MyEnumClass a owl:Class ; ex:Value1 a ex:MyEnumClass, owl:NamedIndividual . |
sorry to bug you folks again. I thought I had this working, but now I'm banging my head against the wall since is not.
I'm trying to create validation for an enumeration individual.
I know I'm doing something incorrect, so I thought I would reach out. I've tried
sh:SPARQLConstraint
,sh:ShapeNode
and no luck.I want to create reusable shapes to validate and rather not use
sh:in ( ex:Value1 ex:Value2 ex:Value3 )
, since then I'd have to maintain two lists (so sparql seems the best method).Any help is greatly appreciated!
Here is the onto graph:
Here is the data graph:
same python code as other issue (with no inferencing!):
The text was updated successfully, but these errors were encountered: