WOW ... I used  http://sparql.org/sparql.html and the results are the same
that Jena ... The problem is with protegé, i think ... excuseme everyone
... :D

2012/4/13 Andrés Zules <[email protected]>

> 2012/4/10 Dave Reynolds <[email protected]>
>
>> On 10/04/12 16:09, Andrés Zules wrote:
>>
>>  2012/4/10 Dave 
>> Reynolds<dave.e.reynolds@**gmail.com<[email protected]>
>>> >
>>>
>>
>>  Are you sure that was the query you ran?
>>>> Or alternatively are you sure that was the ontology you ran it over?
>>>>
>>>
>>>
>>>  The only inverse of pizza:isToppingOf is pizza:hasTopping so you are
>>>> effectively asking the query:
>>>>
>>>>     ?pizza pizza:hasTopping pizza:MushroomTopping .
>>>>
>>>> Which should return empty for that ontology.
>>>>
>>>>
>>> Yes, I am sure. But it's strange I run without reasoner:
>>>
>>> SELECT ?NombrePizza
>>> WHERE {
>>>  ?NombrePizza pizza:isToppingOf pizza:MushroomTopping .
>>> }
>>>
>>> And the result is empty, but with (without reasoner):
>>>
>>> SELECT ?NombrePizza
>>> WHERE {
>>>  ?NombrePizza ?Relacion pizza:MushroomTopping .
>>>  ?Relacion owl:inverseOf pizza:isToppingOf .
>>> }
>>>
>>> The result is
>>>
>>>  DefaultOWLNamedClass(
>>> http://www.co-ode.org/**ontologies/pizza/pizza.owl#**FourSeasons<http://www.co-ode.org/ontologies/pizza/pizza.owl#FourSeasons>
>>> )
>>> DefaultOWLNamedClass(
>>> http://www.co-ode.org/**ontologies/pizza/pizza.owl#**Mushroom<http://www.co-ode.org/ontologies/pizza/pizza.owl#Mushroom>
>>> )
>>> DefaultOWLNamedClass(
>>> http://www.co-ode.org/**ontologies/pizza/pizza.owl#**Giardiniera<http://www.co-ode.org/ontologies/pizza/pizza.owl#Giardiniera>
>>> )
>>> DefaultOWLNamedClass(
>>> http://www.co-ode.org/**ontologies/pizza/pizza.owl#**LaReine<http://www.co-ode.org/ontologies/pizza/pizza.owl#LaReine>
>>> )
>>>
>>
>> That sounds like a bug somewhere. As far as I can see the only inverseOf
>> pizza:isToppingOf is pizza:hasTopping and the only mentions of hasTopping
>> are as class restrictions.
>>
>> I can't see how the query should return anything *with* inference, let
>> along without inference!
>>
>>  The Ontology models both pizzas and toppings as classes and there is no
>>>> pizza:hasTopping relationship between the classes. Each of the Pizza
>>>> classes like FourSeasons are defined via:
>>>>
>>>>    <owl:Class rdf:about="#FourSeasons">
>>>>        <rdfs:label xml:lang="pt">QuatroQueijos</****rdfs:label>
>>>>
>>>>        <rdfs:subClassOf>
>>>>            <owl:Restriction>
>>>>                <owl:onProperty rdf:resource="#hasTopping"/>
>>>>                <owl:someValuesFrom rdf:resource="#****
>>>> MushroomTopping"/>
>>>>
>>>>            </owl:Restriction>
>>>>        </rdfs:subClassOf>
>>>>    ...
>>>>
>>>> So an instance of FourSeasons would have an instance of a
>>>> MushroomTopping
>>>> on, which is the not the same as your query and the ontology has no such
>>>> instances anyway.
>>>>
>>>> In any case to do anything useful with that ontology you really need a
>>>> full DL reasoner such as Pellet.
>>>>
>>>> Dave
>>>>
>>>>
>>> Thanks Dave. I dont know why my query's result is 4 classes, i am
>>> beginner
>>> with the SPARQL and execute that statement testing many others, do you
>>> have
>>> a alternative query? I only want pizzas with Mushrooms.
>>>
>>
>> Well that ontology is a bit painful to work with at the SPARQL level but
>> you could query for (untested example):
>>
>> SELECT * WHERE
>> {
>>    ?pizza rdfs:subClassof [
>>        owl:onProperty pizza:hasTopping;
>>        owl:someValuesFrom pizza:MushroomTopping ] .
>> }
>>
>> Dave
>>
>
> Thanks Dave ... I realize on protege and jena this query:
>
> SELECT *
> WHERE {
> ?X ?Y pizza:MushroomTopping  .
> }
>
> See outputs
>
> https://plus.google.com/photos/116190906023059719803/albums/5730984081208355185
>
> I infer that
>
> | _:b2                   | owl:someValuesFrom
>     |
> | _:b5                   | owl:someValuesFrom
>     |
> | _:b6                   | owl:someValuesFrom
>     |
> | _:b7                   | owl:someValuesFrom
>     |
>
> and
>
>  DefaultOWLNamedClass(
> http://www.co-ode.org/ontologies/pizza/pizza.owl#FourSeasons)
> DefaultOWLObjectProperty(
> http://www.co-ode.org/ontologies/pizza/pizza.owl#hasTopping) etc etc etc
>
> are the pizzas with MushroomTopping
>
> Why does Jena return _:b* and no return the names? I dont understan why
> the results have differences
>
> Do you have some idea?
>
> - - -
> Fabricio Andrés Zules Acosta
>



-- 
- - -
Fabricio Andrés Zules Acosta

Reply via email to