- From: Holger Knublauch <holger@topquadrant.com>
- Date: Fri, 21 Feb 2020 09:16:29 +1000
- To: public-shacl@w3.org
- Message-ID: <b66b317c-268b-8d99-84b5-91fda9d4656b@topquadrant.com>
One option to express this is SHACL-SPARQL. Holger On 21/02/2020 07:55, Christophe D. wrote: > Dear all, > > I’m currently working with a fairly complex graph. Long story short, > the standard adopted in this project has classes for tons of > attributes (birthdates, names, etc.). The following works swell: > > <#foo:DOB> > a sh:NodeShape ; > sh:targetClass foo:Person ; > sh:property [ > sh:path ( foo:start foo:with ) ; > sh:lessThan foo:end ; > ] ; > . > > <#x> > a foo:Person ; > foo:start [ foo:with "2002-05-29"^^xsd:date ] ; > foo:end "2002-05-30"^^xsd:date ; > . > > <#y> > a foo:Person ; > foo:start [ foo:with "2002-05-30"^^xsd:date ] ; > foo:end "2002-05-30"^^xsd:date ; > . > > The problem is that the data is more complex and rather looks as follows: > > <#x> > a foo:Person ; > foo:start [ foo:with "2002-05-29"^^xsd:date ] ; > *foo:end **[ foo:with "2002-05-30"^^xsd:date ] ;* > . > > <#y> > a foo:Person ; > foo:start [ foo:with "2002-05-30"^^xsd:date ] ; > *foo:end **[ foo:with "2002-05-30"^^xsd:date ] ;* > . > > This cannot be solved by providing a property path ( foo:end foo:with > ) for sh:lessThan. > > <#foo:DOB> > a sh:NodeShape ; > sh:targetClass foo:Person ; > sh:property [ > sh:path ( foo:start foo:with ) ; > *sh:lessThan ( foo:end foo:with ) ;* > ] ; > . > > The specification limits the values of property pair constraints to > IRIs. Yes, I could probably achieve the desired result by creating > property shapes from the date of birth (for instance), but that does > not seem as intuitive as approaching it from the perspective of people. > > Was there a particular reason property paths are not allowed for > sh:lessThan? Or am I overlooking something and is it feasible? > I currently solve this problem with a SPARQLConstraint, which I am not > entirely happy with. > > With my best regards, > > Christophe
Received on Thursday, 20 February 2020 23:16:47 UTC