Search Mailing List Archives
[protege-discussion] SPARQL querying in Protege
Csongor Nyulas
csongor.nyulas at stanford.edu
Sun Dec 11 00:32:29 PST 2011
Hi Marian,
You have to explicitly define the prefix for the rdf namespace?
Such as:
PREFIX rdf:<http://www.w3.org/1999/02/22-rdf-syntax-ns#>
and here are some other useful prefix declarations...
PREFIX owl:<http://www.w3.org/2002/07/owl#>
PREFIX rdfs:<http://www.w3.org/2000/01/rdf-schema#>
(this is mentioned even in the WikiPedia entry about SPARQL)
Also, please note that you will need to specifie the full URI (or
prefixed name if you specify a prefix for the Pizza ontology namespace)
of the PizzaToping class. Not to mention that you have a typo in the
Piz*z*aToping name itself.
So I think you are want to write simething like this:
PREFIX rdf:http://www.w3.org/1999/02/22-rdf-syntax-ns#
PREFIX pizza:http://www.co-ode.org/ontologies/pizza/pizza.owl#
SELECT * WHERE { ?p rdf:type pizza:PizzaTopping}
Cheers,
Csongor
On 12/10/2011 12:11 PM, Mariana Damova wrote:
>
> HI thank you for this answer.
>
> Actually, my question was more specific, not about SPARQL, but about
> SPARQL in Protégé.
>
> How do I specify a prefix for an entry that says:
>
> rdf:ID="PizaToping"
>
> where rdf: refers to the standard namespace for rdf
>
> This is an example form Protégé's exempalry ontologies.
>
> I would like to query the countries with SPARQL, using Protégé, but I
> cannot.
>
> Best,
>
> Mariana
>
> *From:*protege-discussion-bounces at mailman.stanford.edu
> [mailto:protege-discussion-bounces at mailman.stanford.edu] *On Behalf Of
> *Csongor Nyulas
> *Sent:* 10 ???????? 2011 ?. 18:50
> *To:* protege-discussion at mailman.stanford.edu
> *Subject:* Re: [protege-discussion] SPARQL querying in Protege
>
> I would recommend you to look at one of these tutorials:
> http://jena.sourceforge.net/ARQ/Tutorial/
> http://www.cambridgesemantics.com/2008/09/sparql-by-example (move
> forward with space or right arrow)
>
> Even the Wikipedia page about SPARQL could be a good starting point:
> http://en.wikipedia.org/wiki/SPARQL
>
> Csongor
>
> On 12/10/2011 4:28 AM, Mariana Damova wrote:
>
> Hi:
>
> Can you give me an example of how do I specify Prefixes from
> rdf:ID="xxxx",
>
> So that I can formulate an executable SPARQL query in Protégé.
>
> My question is overall, how do I get ot an executable SPARQL query
> using predicates other than rdf:subClassOf and Classes from a given
> ontology.
>
> Thanks.
>
> Best regards,
>
> Mariana Damova
>
>
>
>
> _______________________________________________
> protege-discussion mailing list
> protege-discussion at lists.stanford.edu <mailto:protege-discussion at lists.stanford.edu>
> https://mailman.stanford.edu/mailman/listinfo/protege-discussion
>
> Instructions for unsubscribing:http://protege.stanford.edu/doc/faq.html#01a.03
>
>
>
> _______________________________________________
> protege-discussion mailing list
> protege-discussion at lists.stanford.edu
> https://mailman.stanford.edu/mailman/listinfo/protege-discussion
>
> Instructions for unsubscribing: http://protege.stanford.edu/doc/faq.html#01a.03
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.stanford.edu/pipermail/protege-discussion/attachments/20111211/497cb843/attachment-0001.html>
More information about the protege-discussion
mailing list