-
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
How to ensure subject is not a sh:BlankNode when validating a owl:Class in an ontology? #210
Comments
Possibly as an aside, possibly helpful, I have a higher-level question for you: Are you trying to write SHACL rules for validating OWL-2 DL conformance? I've been contributing to a similar objective, with current status housed in this repository1. That repository is due for some coverage updates, as its scope somewhat reflects usage of a particular ontology community. But it's possible to take it much farther, covering a good deal of the OWL 2 to RDF mapping. I'm working through some logistics in testing its updates. Back to your question, one shapes development strategy I've been finding is that sometimes you need to focus on classes, and sometimes you need to focus on properties. I've found that sometimes, this particular form is helpful, and I think it'll help you here too. Some OWL predicates are syntactically restricted to only work on anonymous classes. E.g. ex:owl-inverseOf-subjects-shape
a sh:NodeShape ;
sh:description "See Table 1, Row 21 of OWL--RDF document"@en ;
rdfs:seeAlso <https://www.w3.org/TR/2012/REC-owl2-mapping-to-rdf-20121211/> ;
sh:nodeKind sh:BlankNode ;
sh:targetSubjectsOf owl:inverseOf ;
. (This is newer thinking than I was using when I posted #172 . Since 172, I've found ample use cases for I hope that helps. Footnotes
|
Thanks for your reply(ies)! The motivation here is to aid transaction management and Referential Integrity of a Conjunctive Graph where I have multiple named graphs with references both to themselves and each other. Am creating the ability during a transaction to identify if fractures are created when CRUD'ing and rollback if necessary. I'm looking to create one shape to validate normal classes and another for validating enumeration type classes (those that contain owl:equivalentClass) I tried this shape and it does not seem to have desired result. How do i 'filter' in the shape to only look for one condition or the other? e.g., a shape that only validates Classes whose subject is an IRI vs another shape that validates Classes where the subject is a blank node? Thanks! |
should i be using a sh:rule? |
I think I figured it out:
|
I've got a little brain twister here and can't seem to figure it out and I need some help.
I want to validate classes so I'm specifying the following where sh:targetClass is owl:Class and as you can see, I have an owl:equivalentClass [ owl:oneOf ] in class UnitMultiplier, indicating it's an enumeration of individuals.
I would like to put something on the shape to indicate that that shape is only for those classes whose subject is a sh:IRI (and not a blank node). Can someone show me what I'm missing? The commented code in the SHACL Graph is what I tried, but I'm not sure if it ACTUALLY works.
I am also interested in the inverse as well, I want to create another shape where I want the subjects TO be Blank Nodes where the sh:targetClass is owl:Class, so I am hoping for a hint at that as well.
Any help is GREATLY appreciated!
Data Graph:
SHACL Graph:
Results:
The text was updated successfully, but these errors were encountered: