W3C home > Mailing lists > Public > public-owl-dev@w3.org > April to June 2008

Re: Knowledge modeling question (required vs. optional)

From: Pierre-Antoine Champin <swlists-040405@champin.net>
Date: Wed, 21 May 2008 21:40:02 +0200
Message-ID: <48347A92.8090707@champin.net>
To: Martin Becker <Martin.Becker@living-e.de>
CC: "public-owl-dev@w3.org" <public-owl-dev@w3.org>

Hello Martin,

actually, what you suggest will not work, I'll try to explain why.

First you must understand that, using OWL (but also RDFS), there are 
actually two RDF graphs : the "explicit" graph (i.e. the triples that 
are actually stored in your file/DB/triple store) and the "entailed" 
graph (i.e. all the triples that can be *entailed* from the explicit 
graph according to OWL semantics).

Whenever you state something in OWL, you state it about the entailed 
graph. Lets take an example : assume my ontology states that a person 
has exactly one mother :

:Person a owl:Class ;
   rdfs:subClassOf [
     a owl:Restriction ;
     owl:onProperty :mother ;
     owl:cardinality "1"^^xsd:int
   ] .

Now, the explicit graph below obviously satisfies that constraint :

:pa a Person ;
   :mother :mf .

But the explicit graph below also does :

:pa a Person .

Because *nothing prevents* :pa from having exactly one mother, as every 
person should according to the ontology. This is the so called open 
world assumption.

More tricky, the following explicit graph is ok w.r.t. the ontology

:pa a :Person ;
   :mother :mf ;
   :mother :marie .

How come ? Because *nothing prevents* :mf and :marie to be actually two 
names for the *same* object -- actually, they are *entailed* to be the 
same because of the cardinality constraint.

Ok, it is however possible to violate the ontology, but not in the most 
obvious ways. The following explicitly states that :pa has no mother at 
all :

:pa a :Person ;
     a [ a owl:Restriction ;
         owl:onProperty :mother ;
         owl:cardinality "0"^^xsd:int ]

And the following explicitly states that it has at least two mothers :

:pa a :Person ;
   :mother :mf ;
   :mother :marie .
:mf owl:differentFrom :marie .

Note that, as I understand, you will be dealing with literals (strings, 
integers), which are *known* to be different, so you would not have to 
state that for the inference engine to detect an inconsistency.

However, *not* specifying a value for a property will never violate any 
OWL constraint. The inference engine will only assume that the value 
exists, but is in the entailed graph, although not known/specified in 
the explicit graph.


How can OWL help you, then?

Easy answer : use annotations on your property to tell the system that 
they are mandatory. Annnotations have no semantics for the inference 
engine, but you can use them in the rest of your application, in that 
case, the script handling the HTML form to fill your database.

Less easy answer : Boris Motik, Ian Horrocks, and Ulrike Sattler [1] 
have proposed an extension to OWL semantics to take integrity 
constraints into account. I don't remember if it is implemented yet, 
however...

  regards

   pa

[1] http://www.cs.man.ac.uk/~horrocks/Publications/#2007


Martin Becker a écrit :
> Hello everybody,
> 
> I'm working on a OWL ontology that models the basic features of a well-
> known German community portal. Each member of this portal has a user
> profile, and some information of this profile is required, some
> optional. However, for each field, only one item must be selected. How
> can I represent this in OWL? Suppose a user held a job position, and
> for that Position instance it is required that the company field is
> filled out (while it is optional for this Position instance to have
> the career level field specified).
> 
> My first idea for the required field was to use a combination of
> owl:someValuesFrom and maxCardinality restriction set to 1 to say that
> each Position instance must have at least (and obviously at most) one
> Company instance. I'm not quite sure whether this might be equally
> expressed by using a cardinality restriction (exactly 1). All I want
> to say is that there must be a company selected, but only one, ie. you
> cannot select more than one company.
> 
> le_xing:Position
>       a       owl:Class ;
> rdfs:subClassOf
>               [ a       owl:Restriction ;
>                 owl:onProperty le_xing:hasPositionCompany ;
>                 owl:someValuesFrom <.../companies#Company>
>               ] ;
> rdfs:subClassOf
>               [ a       owl:Restriction ;
>                 owl:onProperty le_xing:hasPositionCompany ;
>                 owl:someValuesFrom <.../companies#Company>
>               ] ;
> 
> For an optional field I would then replace the owl:someValuesFrom
> restriction by owl:allValuesFrom (keeping the maxCardinality =
> 1 restriction).
> 
> Does that make sense or do I need a qualified cardinality restriction
> here?
> 
> Best regards,
> 
> Martin
> 
> 
> 
Received on Wednesday, 21 May 2008 19:40:54 GMT

This archive was generated by hypermail 2.3.1 : Wednesday, 27 March 2013 09:32:56 GMT