W3C home > Mailing lists > Public > semantic-web@w3.org > December 2010

Re: The Two Dogs Problem

From: Nathan <nathan@webr3.org>
Date: Fri, 17 Dec 2010 10:04:04 +0000
Message-ID: <4D0B3594.2000500@webr3.org>
To: Melvin Carvalho <melvincarvalho@gmail.com>
CC: Semantic Web <semantic-web@w3.org>
Melvin Carvalho wrote:
> Apologies if this has come up before.  I was wondering the best way to
> model the following:
> 
> Alice owns a dog.  We choose to model it as follows.
> 
> :Alice :owns a dbpedia:dog
> 
> All is going well.
> 
> Then Alice gets given a second dog.
> 
> If we write:
> 
> :Alice :owns a dbpedia:dog
> :Alice :owns a dbpedia:dog
> 
> Since RDF is a set, the duplicate triple is disgarded.  So Alice still
> is described as owning one dog.
> 
> Is there a standard way to model Alice owning two dogs?

Yup, you just be more descriptive, the statements you've made above are 
probably better said as:

   :Alice a :DogOwner .

As you can see (and ask) there's no detail involved, you've simply 
asserted that :Alice is in the class of all :DogOwner's - thus you just 
need to be a little more descriptive.

  :Alice :pet :Patch, :Spot .
  :Spot a :Dog .
  :Patch a Dog .

Or more refined:

  :Alice :dog :Patch, :Spot .

  #where the property :dog is like..
  :dog rdfs:domain :Person ;
    rdfs:range :Dog ;
    rdfs:subPropertyOf :pet .

Or the other way around:

  :Spot a :Dog, :owner :Alice .
  :Patch a :Dog, :owner :Alice .

Now, we can't just simply count those values, since :Spot and :Patch 
could be two names for the same dog, so you'd need to say that:

   :Spot owl:differentFrom :Patch .
or
   [ a owl:AllDifferent ; owl:members ( :Spot :Patch ) ] .


Then because we're dealing with open world semantics, we don't know that 
:Alice only has exactly two dogs, so we could say something like:

  :Alice a [
   a owl:Restriction ;
   owl:minCardinality 2 ;
   owl:onProperty :dog .
  ] .

Which would be the class of anybody with 2 or more dogs, or use 
owl:cardinality rather than minCardinality to say exactly 2 dogs.

However, the easiest way, is probably just to do the following, and then 
you can assert that you know Alice has 2 dogs, given the information you 
currently have:

   :Alice :dog :Patch, :Spot .
   :Spot owl:differentFrom :Patch .

Best, and hope that helps,

Nathan
Received on Friday, 17 December 2010 10:05:15 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 21:45:40 GMT