OWL2: complex class expressions + comparison of two dates

Viewed 60

Is there a way in OWL2 to define a class that involves a comparison of two literal values? Let's say I have a class Person that has two data properties:

  • dateA: Person -> xsd:date
  • dateB: Person -> xsd:date

I want to define two subclasses of the class Person:

  • PersonWithEarlierDateA = those persons that have dateA < dateB
  • PersonWithEarlierDateB = those persons that have dateB < dateA

The following definition does not seem to work in Protege 5.5.0.: PersonWithEarlierDateA Equivalent To "dateA some xsd:date[ < dateB ]" + PersonWithEarlierDateB Equivalent To "dateB some xsd:date[ < dateA ]" (Protege crashes when I am trying to infer classes of individuals).

Is it even possible in OWL2?

1 Answers

You could use SHACL to define a NodeShape that matches Person where dateA < dateB. Using SHACL's Advanced Features you could make that NodeShape actually build a triple stating that a person with dateA < dateB is actually of type PersonWithEarlierDateA.

This is similar to using SWIRL perhaps but SHACL's more recent and much more widely used (I'm guessing but I think this is true).

Related