Search Mailing List Archives

Limit search to: Subject & Body Subject Author
Sort by: Reverse Sort
Limit to: All This Week Last Week This Month Last Month
Select Date Range     through    

[protege-owl] Sparql and subclasses

Mudunuri, Raj Raj.Mudunuri at
Mon Apr 2 07:45:36 PDT 2007



is there any manual or information about how to formulate (syntax) the queries in the Queries tab of Protégé?






From: protege-owl-bounces at [mailto:protege-owl-bounces at] On Behalf Of Marisa Santos Amaro
Sent: Montag, 2. April 2007 02:03
To: User support for the Protege-OWL editor
Subject: Re: [protege-owl] Sparql and subclasses


Thanks for your suggestion, Chema !! 

The "Queries" tab of Protege returns all the instances (the inferred, too), but Sparql actually doesn´t do it. I´ll  try Jena code and check the results.


Best regards !!



On 4/1/07, Chema . < at> wrote: 

Hi Marisa,
Probably, sparql engine in protege works with the open model of the ontologies (only classes and instances declared by the user, not inferred by the reasoner), therefore the query do not retrieve the expected result. 

A simple solution could be ask, explicitily, for the instances in the query, something as:

1-Obtain all classes we want to retrieve their instances.
2-Union with these classes to  look up their instances 
3-It is a bad solution, not scale and the union operation in sparql has a high cost

select ?in
{ {?cl   rdfs:subClassOf    :B0 } union {?cl rdfs:subClassOf  :B1}  union {?cl rdfs:subClassOf  :Bi}}. 
?in rdf:type ?cl


Another solution ant the good way is close the model, after we can run the query over declared and inferred classes/instances.
I don't know how to close the model in protege, i usually use a simple program created with Java, Jena and Arq to run  this kind of queries. 

Bye, Chema

On 4/1/07, Marisa Santos Amaro < marisa.osantos at <mailto:marisa.osantos at> > wrote:


	Hi, dear friends from OWL list !!


	I have some doubts about SPARQL and RACER running to query a Protege ontology.

	In the ontology below, SPARQL shows me only asserted instances of first level classes (like I3)and instances of subclasses located  at the second level of hierarchical model,  like I1 and  I2. 

	- Class A

	    > Class A1

	    > Class A2  >> I1

	- Class B >>  I3

	    > Class B1

	    > Class B2 >> I2

	        > Class B21    >> I4

	                              >> I5 

	I´d like to get all instances of Class B and of its subclasses, in all levels down, but the following query returns just I2 and I3. The instances I4 and I5 of Class B21 (a second level subclass) are not selected. 

	  SELECT   ?z

	  WHERE  {?x    rdfs:subClasOf    :ClassB  .

	                 {?z    a   ?x}    UNION

	                 {?z    a   :ClassB}  }


	Running this reasoner, why it do not put asserted instances of ClassB21 as inferred ones of classes ClassB1 and ClassB ? 


	Thanks for any help.



	protege-owl mailing list
	protege-owl at 
	Instructions for unsubscribing: 

protege-owl mailing list
protege-owl at

Instructions for unsubscribing:

      Marisa de Oliveira Santos Amaro
             Capitão-de-Fragata ( T )
     Superintendente de Infra-estrutura e
   Serviços de Tecnologia da Informação
Diretoria de Finanças da Marinha - DFM

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the protege-owl mailing list