I wrote this query but it does't work. Anyone knows what is the problem.
PREFIX : <http://www.semanticweb.org/ontologies/2009/pizza.owl#>
SELECT ?X ?Y
WHERE {?X :hasCountryOfOrigin "Italy".
?Y :hasCalorificValue "400"}
According to the Pizza ontology tutorial here, there are two main issues with your query:
hasCountryOfOrigin
is an object property, thus, the values can't be literals. Italy is an individual, thus, you have to use the correct URI, probably http://www.semanticweb.org/ontologies/2009/pizza.owl#Italy
hasCalorificValue
has values of type integer, i.e. literals should be used like "400"^^xsd:integer
(or maybe xsd:int
, depends on what you've chosen in Protege) PREFIX : <http://www.semanticweb.org/ontologies/2009/pizza.owl#>
SELECT ?X ?Y
WHERE {?X :hasCountryOfOrigin :Italy.
?Y :hasCalorificValue "400"^^xsd:integer}