- From: Irene Polikoff <irene@topquadrant.com>
- Date: Fri, 5 Jun 2020 15:54:42 -0400
- To: Radostin Nanov <radostin.nanov@ontotext.com>
- Cc: public-shacl@w3.org
Radostin, I think Vladimir has been asking similar questions on this mailing list this week. Please check out the archive. The only thing I can add to the e-mail thread on this topic is that a typical pattern I would apply for this use case is to use the class hierarchy e.g. for constraining values of ex:employee property for an organization to the instances of the various Person classes: foaf:Person rdfs:subClassOf ex:Person; dbo:Person rdfs:subClassOf ex:Person; ex:Organization a sh:NodeShape, owl:Class sh:property [sh:path ex:employee; sh:class ex:Person]; . Alternately, if desired to use sh:hasValue, you could do: sh:path ( rdf:type [ sh:zeroOrMorePath rdfs:subClassOf ] ) : sh:hasValue ex:Person ; Regards, Irene Polikoff > On Jun 4, 2020, at 4:00 AM, Radostin Nanov <radostin.nanov@ontotext.com> wrote: > > Hello! > > We are looking at SHACL lists, such as: > > sh:path rdf:type ; > sh:in (foaf:Person, dbo:Person) ; > > The question is what is the best way to make this more inclusive. As specified, this would check the type for a given object is either foaf:Person or dbo:Person (or both/none). However, it is possible that the same object may have other types which we do not want to validate. For example, dbo:Actor. > > At the moment, we use a combination of sh:or and sh:hasValue for this: > > sh:path rdf:type ; > sh:or ( [ sh:hasValue foaf:Person] [ sh:hasValue dbo:Person ] ) ; > > This is significantly more verbose, and repetitive. Is there a better way? One example that has been suggested internally was: > > sh:property [ > sh:path rdf:type ; > sh:in (foaf:Person, dbo:Person) ; > ] > sh:ignoredProperties (rdf:type) > > However, ignoredProperties is used for a completely different thing and I don't believe it is a valid option at all. Is this something better left for DASH, for example by defining dash:valueIn that takes a list and is open? > > Thanks, > Radostin Nanov | Ontotext Software Developer >
Received on Friday, 5 June 2020 19:54:58 UTC