How to combine Data Properties in OWL?

114 Views Asked by At

Say I have:

  • Property1 is optional
  • Property2 that is always defined

I want to define TrueProperty that is equal to:

  1. Property1 if Property1 is present
  2. Property2 otherwise

Property2 otherwise

Can I do that? Can I do that in OWL?

Thank you

1

There are 1 best solutions below

0
On

You cannot do that in OWL. OWL is not meant to talk about what's written, it talks about true things of the world. Facts that are not present explicitly in your data set MAY be true. If you send me a CV where you do not mention your street address, can I conclude that you are homeless?

However, there are several ways to do what you want to do, without OWL. A SPARQL CONSTRUCT query with a FILTER, qking a reasoner if you can infer some value for Property1, and if not, adding Property2 programmatically. For instance:

CONSTRUCT { ?s  <TruProperty>  ?o }
WHERE {
    { ?s  <Property1>  ?o }
   UNION
    { ?s  <Property2>  ?o
      FILTER NOT EXISTS { ?s  <Property1>  ?o }
    }
}