[Pellet-users] A simple OWL-DL query
Wolfgang May
may at informatik.uni-goettingen.de
Tue Feb 12 19:00:57 UTC 2008
Hi,
On Tue, 12 Feb 2008, João Paulo Sousa wrote:
> Hi,
>
> I have the above ontology, basically it's define a person and a
> location, and the person can have a location.
>
> In this sample steve is in the bar and bill is in theater, and the bar
> isPartOf (Transitive property) theater.
>
> It's possible to make a query to know if steve is in the theater? But
> using the Transitive property, of course ;-) . How to make this
> query? :-)
Not really:
for what you want to do, you would need role-chains (OWL 1.1, but
already supported by Pellet), e.g.
is-in SubpropertyOf (is-in concat is-part-of).
For demonstrating transitivity of is-part-of, you would
at least need e.g.
bar is-part-of theaterFirstFloor.
theater-First-Floor is-part-of theater.
AFAIR, role chains are only allowed with atomic roles, i.e. not with a
transitive one as above. Transitivity alone cannot combine edges
along different roles.
You can probably hack something by defining
is-in subPropertyOf myrole.
is-part-of subPropertyOf myrole.
myrole a transitiveProperty.
[I am even not sure that this is allowed]
and ask for
?X myrole ?B . ?X a person . ?B a partofbuilding
to select those x myrole y that you are interested in.
But that's dirty ;)
Wolfgang
>
> Cheers,
>
> João Paulo.
>
>
> <?xml version="1.0"?>
> <!DOCTYPE rdf:RDF [
> <!ENTITY owl "http://www.w3.org/2002/07/owl#" >
> <!ENTITY xsd "http://www.w3.org/2001/XMLSchema#" >
> <!ENTITY rdfs "http://www.w3.org/2000/01/rdf-schema#" >
> <!ENTITY rdf "http://www.w3.org/1999/02/22-rdf-syntax-ns#" >
> ]>
> <rdf:RDF xmlns="http://example.org#"
> xml:base="http://example.org"
> xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
> xmlns:xsd="http://www.w3.org/2001/XMLSchema#"
> xmlns:owl="http://www.w3.org/2002/07/owl#"
> xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
> <owl:Ontology rdf:about=""/>
> <Room rdf:ID="bar">
> <isPartOf rdf:resource="#theater"/>
> </Room>
> <Person rdf:ID="bill">
> <hasLocation rdf:resource="#theater"/>
> </Person>
> <owl:Class rdf:ID="Building">
> <rdfs:subClassOf rdf:resource="#Spac"/>
> </owl:Class>
> <owl:ObjectProperty rdf:ID="contains">
> <rdf:type rdf:resource="&owl;TransitiveProperty"/>
> <rdfs:domain rdf:resource="#Spac"/>
> <rdfs:range rdf:resource="#Spac"/>
> <owl:inverseOf rdf:resource="#isPartOf"/>
> </owl:ObjectProperty>
> <owl:ObjectProperty rdf:ID="hasLocation">
> <rdfs:domain rdf:resource="#Person"/>
> <rdfs:range rdf:resource="#Spac"/>
> </owl:ObjectProperty>
> <owl:ObjectProperty rdf:ID="isPartOf">
> <rdfs:domain rdf:resource="#Spac"/>
> <rdfs:range rdf:resource="#Spac"/>
> <owl:inverseOf rdf:resource="#contains"/>
> </owl:ObjectProperty>
> <owl:Class rdf:ID="Person"/>
> <owl:Class rdf:ID="Room">
> <rdfs:subClassOf rdf:resource="#Spac"/>
> </owl:Class>
> <owl:Class rdf:ID="Spac"/>
> <Person rdf:ID="steve">
> <hasLocation rdf:resource="#bar"/>
> </Person>
> <Building rdf:ID="theater">
> <contains rdf:resource="#bar"/>
> </Building>
> </rdf:RDF>
>
>
>
>
>
> _______________________________________________
> Pellet-users mailing list
> Pellet-users at lists.owldl.com
> http://lists.owldl.com/mailman/listinfo/pellet-users
> _______________________________________________
>
> Sponsored by Clark & Parsia, LLC http://clarkparsia.com/
>
More information about the Pellet-users
mailing list