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-discussion] Problem with SPARQL query

Brice Sommacal brice.sommacal at gmail.com
Tue Nov 29 02:31:16 PST 2011


Hello Linh,

In your SELECT, you have to refer to a variable which is defined in your
query.
You can't use "*" in SELECT, but only a variable (?x).

You should try:
*"PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> *
*PREFIX pizza: <http://www.co-ode.org/ontologies/pizza/pizza.owl#> *
*SELECT ?p WHERE { ?p rdf:type pizza:Pizza; pizza:hasTopping ?t. ?t
rdf:type pizza:TomatoTopping }"*

Regards,

Brice

2011/11/29 Khánh Linh <linhkid91 at gmail.com>

> Dear all,
>
> I know this maybe a stupid question but I will be very glad if someone
> help me with this. I'm absolutely new with Ontology.
>
> Started with Pizza example. I want to list a Pizza that has Tomato
> Topping. And I tried this in my Protégé 3.4.7 in the SPARQL Query Panel:
>
> *"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:Pizza; pizza:hasTopping ?t. ?t
> rdf:type pizza:TomatoTopping }"*
>
> It returns "No matches found".
>
> I don't know why the result is like that. Can you run this query and find
> out why it returns null ?
>
> Beside, I also attach the Pizza.owl.pprj file if somebody doesn't have it.
>
> I'm looking forward to hearing from you,
>
> Best regrads,
>
> Linh Nguyen
>
> _______________________________________________
> 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/20111129/b8e8f11b/attachment.html>


More information about the protege-discussion mailing list