-
Notifications
You must be signed in to change notification settings - Fork 30
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
Add something similar to dash:hasValueWithClass
#178
Comments
dash:hasValueWithClass
More general might be sh:hasValueWithShape [ sh:class X ] for QCR with qualified min count of 1. But I'd be happy to withdraw this issue if there is not enough interest. We want to keep SHACL Core focused. |
This is one of the points where I think SHACL and OWL do not overlap philosophically, and I don't think SHACL can provide a good mechanism. Fundamentally, it's a matter of OWL's "Open world" vs. SHACL's "Closed world."
The OWL spelling is still useful, say, for generating "fill-in-the-blank" data without raises validation issues for users who opt to leave something blank. Take this OWL Class that expresses every person has some mother: ex:Person
a owl:Class ;
rdfs:subClassOf [
a owl:Restriction ;
owl:onProperty ex:hasMother ;
owl:someValuesFrom ex:Person ;
] ;
. The equivalent SHACL spelling in SHACL 1.0 is: ex:Person
a owl:Class , sh:NodeShape ;
sh:property [
sh:path ex:hasMother ;
sh:qualifiedMinCount 1 ;
sh:qualifiedValueShape [
sh:class ex:Person ;
] ;
] ;
. With that SHACL, data is flagged invalid if I don't have a node linked with The same happens if instead we use a qualified cardinality & qualified min count, reducing the specification to "Something could be linked with ex:Person
a owl:Class ;
rdfs:subClassOf [
a owl:Restriction ;
owl:onProperty ex:hasMother ;
owl:minCardinality "1"^^xsd:nonNegativeInteger ;
] ;
.
ex:Person
a owl:Class , sh:NodeShape ;
sh:property [
sh:path ex:hasMother ;
sh:minCount 1 ;
] ;
. ex:Person
a owl:Class , sh:NodeShape ;
sh:property [
sh:path ex:hasMother ;
sh:qualifiedMinCount 1 ;
sh:qualifiedValueShape [
rdfs:comment "This shape intentionally left blank."@en ;
] ;
] ;
. BUT, the same problem comes that I need to have a node specified. This fails validation under both SHACL spellings:
But this passes:
The OWL spelling doesn't care. If the The problem is, for the data to validate with SHACL, some node needs to be put in place, which can cause a later data cleaning issue. I work with a community that disallows blank nodes in the data/individuals graph. SHACL's minimum-count constraints can cause workflow issues where a node could need to be invented, given a name, and then possibly replaced later, depending on the timing of when the "final" object node is expected to be defined vs. the subject node. Would |
I see dash:hasValueWithClass and variations like sh:hasValueWithShape as syntactic sugar. The problem with QCRs is that they are very verbose, esp they need a separate shape for each statement. So to say a Person has one father and one mother requires two property shapes just for syntactic reasons, while in OWL this would be just two triples. This was particularly obvious to me when I wrote an OWL to SHACL converter. Many OWL ontologies heavily use classes because that's the main thing that OWL has to offer. Back in the old days, working on the NCI thesaurus, there were thousands of someValuesFrom restrictions, but they were just a syntactic trick to express simple relationships between entities. So instead of
which would be OWL full and not support inferencing, the OWL DL solution is more like
The examples that I have seen don't really care about actual instances (of Class1 or Class2) but are purely axiomatic. Therefore whether it's used on closed or open world semantics doesn't really matter that much. |
OWL has this
owl:someValuesFrom
construct that is quite popular to declare relationships between classes. To express this in SHACL, one would need to create a verbosequalifiedValueShape
withminCount 1
and ash:class
in an inner node shape.I suggest to add something like
dash:hasValueWithClass
to SHACL Core.The text was updated successfully, but these errors were encountered: