SPARQL with Protege

629 views
Skip to first unread message

Neha Yadav

unread,
May 12, 2009, 2:07:53 AM5/12/09
to Ontology Online
Hi everyone,
I am trying to query my ontology using Protege Tool with SPARQL.
But the problem I am facing is that I get a result saying "No match
found" for all of my queries .
If in my query I wish to get subclasses of all the classes then I can
display it, but if I wish to get subclasses of a particular class,
then the output I get Is "No match Found"
My query for the above problem is

Select ?g
WHERE { ?g rdfs:subClassOf "bomb" . }

Please is there anyone who can help me out with this problem of
querying Ontology using SPARQL, or should I switch to any other tool.

Thanks in advance.
Neha

David Decraene

unread,
May 12, 2009, 2:13:38 AM5/12/09
to Ontology Online
Hi Neha,

I'm sorry but I'm not experienced with Protege and it's SPARQL
implementation itself.
Perhaps it is a problem with namespaces, did you try entering the
entire URI for 'bomb'?
Also unsure whether you need the double quotes around the reference..

something like:
Select ?g
WHERE { ?g rdfs:subClassOf http://myreference.test.com/ontology#bomb
. }

On May 12, 8:07 am, Neha Yadav <neha.completely.ro...@gmail.com>
wrote:

Neha Yadav

unread,
May 12, 2009, 2:29:28 AM5/12/09
to Ontology Online
Hi David,

Well thanks for the reply.
The namespaces are correct and the URI for my class, well the
ontology I am using does not have a uri to a class but surely has a
reference Id that is specified for a class say "Bomb" as "#Bomb".

This is a small portion of my ontology code.
<owl:Class rdf:ID="penetration_bomb">
<rdfs:subClassOf>
<owl:Class rdf:about="#bomb"/>
</rdfs:subClassOf>
</owl:Class>

and I wish to get the answer to the query "Subclass of Bomb"
where the answer should be "penetration_bomb."



On May 12, 11:13 am, David Decraene <david.MA.decra...@gmail.com>
wrote:
> Hi Neha,
>
> I'm sorry but I'm not experienced with Protege and it's SPARQL
> implementation itself.
> Perhaps it is a problem with namespaces, did you try entering the
> entire URI for 'bomb'?
> Also unsure whether you need the double quotes around the reference..
>
> something like:
> Select ?g
> WHERE { ?g rdfs:subClassOfhttp://myreference.test.com/ontology#bomb

ontologyonline

unread,
May 12, 2009, 10:57:40 AM5/12/09
to Ontology Online
Hi Neha,

it seems like valid syntax to me.
If I were you I'd try to perhaps post on the Protege mailing lists:
http://protege.stanford.edu/community/lists.html
Perhaps they will be able to assist you further.

On May 12, 8:29 am, Neha Yadav <neha.completely.ro...@gmail.com>

chetan moradiya

unread,
Oct 8, 2013, 5:52:24 AM10/8/13
to ontolog...@googlegroups.com
Hi Neha,

PREFIX: _______________


Select ?g
WHERE { ?g rdfs:subClassOf :bomb }

   
In above space you have to write the your Ontology IRI. You will be getting it by clicking on Entities tab and enclosed it by bracket. And Don't forget to put '#' at the end of IRI.

e.g.
PREFIX: <http://www.owl-ontologies.com/Ontology13591112.owl#>
Reply all
Reply to author
Forward
0 new messages