[Pellet-users] restriction query problem

Lisa G. H. lisa_gh81 at yahoo.com.sg
Fri Oct 26 07:57:49 UTC 2007


Hi

I have a small ontology (please find it attached at end of this
post). I have a question about formulating the proper query and
extremely appreciate your help.

Class "ClassType2B1" has someValues restriction on property
includes: "includes some ClassType1A1"

Class "ClassType2B11" has someValues restriction on property
includes "includes some ClassType1A2".

ClassType2B11 is the subclass of ClassType2B1.


Now , If I run the query below :
PREFIX kb:<http://www.partTests.test#>

SELECT DISTINCT ?class ?x
WHERE {
?class rdfs:subClassOf ?restriction.
?class rdfs:subClassOf kb:ClassType2.
?restriction owl:onProperty kb:includes.
?restriction owl:someValuesFrom ?x.}

I get :
?class ?x
ClassType2B1 ClassType1A1
ClassType2B11 ClassType1A2

I don't get the following , but I need to return it as well:
ClassType2B11 ClassType1A1





Could you please explain how to get the the desired result ? I am
using Jena 2.5.4 and Pellet 1.5.


Thank you
Lisa




Note -----------------------------

If I run the same query, but look for an instance of ClassType2B11,
I get the both restrictions - query:

SELECT Distinct ?j ?class ?x
WHERE { ?j rdf:type ?class.
?class rdfs:subClassOf ?restriction.
?class rdfs:subClassOf kb:ClassType2.
?restriction owl:onProperty kb:includes.
?restriction owl:someValuesFrom ?x.}








=================== ONTOLOGY ===================

<?xml version="1.0"?>
<rdf:RDF
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:owl="http://www.w3.org/2002/07/owl#"
xmlns:xsd="http://www.w3.org/2001/XMLSchema#"
xmlns="http://www.partTests.test#"
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
xml:base="http://www.partTests.test">
<owl:Ontology rdf:about="">
<rdfs:comment
rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
>This is a test ontology in OWL DL.</rdfs:comment>
</owl:Ontology>
<owl:Class rdf:ID="ClassType1"/>
<owl:Class rdf:ID="ClassType2B11">
<rdfs:subClassOf>
<owl:Class rdf:ID="ClassType2B1"/>
</rdfs:subClassOf>
<rdfs:subClassOf>
<owl:Restriction>
<owl:someValuesFrom>
<owl:Class rdf:ID="ClassType1A2"/>
</owl:someValuesFrom>
<owl:onProperty>
<owl:ObjectProperty rdf:ID="includes"/>
</owl:onProperty>
</owl:Restriction>
</rdfs:subClassOf>
</owl:Class>
<owl:Class rdf:ID="ClassType1A3">
<rdfs:subClassOf rdf:resource="#ClassType1"/>
</owl:Class>
<owl:Class rdf:about="#ClassType1A2">
<rdfs:subClassOf rdf:resource="#ClassType1"/>
</owl:Class>
<owl:Class rdf:ID="ClassType2"/>
<owl:Class rdf:about="#ClassType2B1">
<rdfs:subClassOf rdf:resource="#ClassType2"/>
<rdfs:subClassOf>
<owl:Restriction>
<owl:onProperty rdf:resource="#includes"/>
<owl:someValuesFrom>
<owl:Class rdf:ID="ClassType1A1"/>
</owl:someValuesFrom>
</owl:Restriction>
</rdfs:subClassOf>
</owl:Class>
<owl:Class rdf:about="#ClassType1A1">
<rdfs:subClassOf rdf:resource="#ClassType1"/>
</owl:Class>
<owl:Class rdf:ID="ClassType2B2">
<rdfs:subClassOf rdf:resource="#ClassType2"/>
</owl:Class>
<ClassType2B11 rdf:ID="ClassType2B11_0"/>
</rdf:RDF>



       
---------------------------------
 Yahoo! Movies - Search movie info and celeb profiles and photos.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.owldl.com/pipermail/pellet-users/attachments/20071026/2043f2ef/attachment-0001.htm 


More information about the Pellet-users mailing list