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

Re: Restrictions on Bags and Seqs content

From: Matthew Pocock <matthew.pocock@ncl.ac.uk>
Date: Tue, 10 Apr 2007 22:01:18 +0100
To: Michael Schneider <m_schnei@gmx.de>
Cc: rogargon@gmail.com, semantic-web@w3.org, alanruttenberg@gmail.com, public-owl-dev@w3.org
Message-Id: <200704102201.18951.matthew.pocock@ncl.ac.uk>

Hi,

Not sure if this kind of modelling will throw OWL reasoners for a loop, 
although I'm sure someone on this list will know. Is there a reason you can't 
explicitly have a collection individual and a member_of_collection style 
property that binds an instance to the collection?

For the case of a list, you can introduce a qua on the instance that stands 
for the membership of the list. So,

array <-member_of- member -refers_to-> someIndividual

Where member has a property index, and index is set to be unique with respect 
to the array instance, and the presence of a member with index x imples the 
existance of a member with every index >=0 and < x. Alternatively, use a 
linked list with e.g. a head/cons pair of relations and cardinality 
restrictions to prevent unintended branching.

Using collection instances like this you can restrict someIndividual to a 
specific class by placing a universal restriction on the inverse of member_of 
that places a universal restriction to revers_to on that class. So:

PersonArray == Array &
  all inverse(member_of) all refers_to Person

The member qua instances tend to be useful places to hang other things than 
the index from, if the individual at that index in the list needs treating 
differently to the individual at other indexes or independent of the list.

Sorry if you've been up and down this kind of solution already.

Matthew

On Tuesday 10 April 2007, Michael Schneider wrote:
> [cc'd to owl-dev: perhaps some experts there seeing any flaws in my
> discussion below?]
>
> Hi, Roberto!
>
> IMO, what Alan proposed, the creation of a custom 'OWLList' class, is
> probably the best one can do in order to build some kind of collection
> which is restricted to containing instances of some 'Person' class,
> only. For completeness, I will try to discuss what is possible if one
> really insists on applying 'rdf:Bag' for this purpose.
>
> The first problem is that one cannot build axioms with 'rdfs:member' in
> OWL/DL, because it is "disallowed vocabulary", see
>
>     http://www.w3.org/TR/owl-semantics/mapping.html#4.2
>
> (BTW, for the same reason, it is not possible to create axioms with
> 'rdf:List'.)
>
> Luckily, when working with rdf:Bag, one does not have to use rdfs:member
> directly, but instead one uses its subproperties 'rdf:_n', with integers
> n >= 1. Those properties are /not/ disallowed vocabulary.
>
> Next problem: An OWL parser does not necessarily know about the RDF(S)
> vocabulary, so one has to explicitly introduce classes like rdf:Bag and
> properties like rdf:_n. Further, rdf:Bag is not an owl:Class, and rdf:_n
> is an rdf:Property, so in order to get some OWL/DL conform ontology, one
> has to "correct" this (this is a hack!):
>
>     Class(rdf:Bag partial)
>     ObjectProperty(rdf:_1)
>     ObjectProperty(rdf:_2)
>
> There are two further problems with this:
>
> First, making rdfs:_n into an ObjectProperty might become a problem,
> because one will not longer be able to build an instance of rdf:Bag
> containing datavalues! But declaring the rdf:_n properties to be
> ObjectPropertyS is AFAIK a necessary task in order to later build
> 'allValuesFrom' Restrictions on them.
>
> A second problem is: One has to know /in advance/ how large the largest
> bag will become in one's application, and one has to create that many
> ObjectProperty declarations for all those rdf:_n properties. :-(
>
> Accepting all those drawbacks, it now really seems to be possible to
> build a PersonBag:
>
>     Class(PersonBag partial rdf:Bag
>       restriction(rdf:_1 allValuesFrom(Person))
>       restriction(rdf:_2 allValuesFrom(Person))
>     )
>
> Again, one has to estimate the largest possible PersonBag: That's the
> number of allValuesFrom restriction one has to declare in the above
> class axiom.
>
> Below is an example ontology (RDF/XML) containing the above axioms,
> which turns out to be in OWL/Lite (checked with Wonderweb validator).
>
> Best regards,
> Michael
>
> ============ START: EXAMPLE ONTOLOGY ================
>
> <?xml version="1.0"?>
> <rdf:RDF
>       xmlns="http://www.example.org/rdfbag.owl#"
>       xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
>       xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
>       xmlns:owl="http://www.w3.org/2002/07/owl#"
>     xml:base="http://www.example.org/rdfbag.owl">
>
>     <owl:Ontology rdf:about="" />
>
>     <!-- introducing container vocabulary into OWL/DL -->
>
>     <owl:Class rdf:about="http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag"
> />
>
>     <owl:ObjectProperty
> rdf:about="http://www.w3.org/1999/02/22-rdf-syntax-ns#_1" />
>     <owl:ObjectProperty
> rdf:about="http://www.w3.org/1999/02/22-rdf-syntax-ns#_2" />
>
>     <!-- special rdf:Bag, which can only contain instances of class
>
> :Person -->
>
>     <owl:Class rdf:about="#Person" />
>
>     <owl:Class rdf:about="#PersonBag">
>       <rdfs:subClassOf
> rdf:resource="http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag" />
>       <rdfs:subClassOf>
>         <owl:Restriction>
>           <owl:onProperty
> rdf:resource="http://www.w3.org/1999/02/22-rdf-syntax-ns#_1"/>
>           <owl:allValuesFrom rdf:resource="#Person"/>
>         </owl:Restriction>
>       </rdfs:subClassOf>
>       <rdfs:subClassOf>
>         <owl:Restriction>
>           <owl:onProperty
> rdf:resource="http://www.w3.org/1999/02/22-rdf-syntax-ns#_2"/>
>           <owl:allValuesFrom rdf:resource="#Person"/>
>         </owl:Restriction>
>       </rdfs:subClassOf>
>     </owl:Class>
>
>     <!-- example person bag -->
>
>     <Person rdf:about="#person1" />
>     <Person rdf:about="#person2" />
>
>     <PersonBag rdf:about="#aPersonBag">
>       <rdf:_1 rdf:resource="#person1" />
>       <rdf:_2 rdf:resource="#person2" />
>     </PersonBag>
>
> </rdf:RDF>
>
> ========= END: EXAMPLE ONTOLOGY =============
>
> On Apr 8, 2007, at 9:51 AM, Roberto García wrote:
> > Thank you Alan for the pointers.
> >
> > If I have understood them well, they are about Lists in OWL. What
> > about the use of custom Bags and Seqs? Is it possible to define a
> > BagOfPerson whose members are restricted to instances of the class
> > Person?
> >
> > Best,
> >
> >
> > Roberto García
> > http://rhizomik.net/~roberto
> >
> > On 01/04/07, Alan Ruttenberg <alanruttenberg@gmail.com> wrote:
> >> It is possible, in OWL Full, but I don't think using OWL Full should
> >> be considered to be a good practice (yes, go ahead, flame me if you
> >> must).
> >> If you want to do this sort of thing in OWL DL, you might have a look
> >> at:
> >>
> >> http://protege.stanford.edu/conference/2006/submissions/slides/
> >> 7.1_Drummond.pdf
> >> or http://owl-workshop.man.ac.uk/acceptedLong/submission_12.pdf
> >>
> >> Best,
> >> Alan
> >>
> >> On Apr 1, 2007, at 10:33 AM, Roberto García wrote:
> >> > Dear all,
> >> >
> >> > Does anyone know if it is possible, and considered a good
> >>
> >> practice, to
> >>
> >> > define subclasses of Bag and Seq using OWL in order to get
> >>
> >> containers
> >>
> >> > that contain a specific class of resources?
> >> >
> >> > For instance, is it possible to model this using a restriction
> >>
> >> on the
> >>
> >> > rdfs:member property when applied to a custom subclass of Bag?
> >> >
> >> > Best,
> >> >
> >> > --
> >> > Roberto García
> >> > http://rhizomik.net/~roberto
Received on Tuesday, 10 April 2007 21:01:31 GMT

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