4

I am just a beginner in SPARQL and can write some basic queries. I have a pizza ontology in which there is one pizza whose properties are as follows:

rdf:subClassOf NamedPizza

hasTopping only (MozzarellaTopping
              or PeperoniSausageTopping
              or TomatoTopping)

hasTopping some MozzarellaTopping

hasTopping some PeperoniSausageTopping

hasTopping some TomatoTopping

i have written the following query, but it gives no result.

SELECT * WHERE
{
  ?pizza rdfs:subClassof [
    owl:onProperty :hasTopping;
    owl:someValuesFrom :MozzarellaTopping ] .
  ?pizza rdfs:subClassof [
    owl:onProperty :hasTopping;
    owl:someValuesFrom :PeperonSausageTopping ] .
  ?pizza rdfs:subClassof [
    owl:onProperty :hasTopping;
    owl:someValuesFrom :TomatoTopping ] .
}

What is the SPARQL query to get the name of this pizza?

i am using Protege 4.2 as well as TopBraid to run the SPARQL query

Joshua Taylor
  • 84,998
  • 9
  • 154
  • 353

2 Answers2

4

In your SPARQL query you write rdfs:subClassof instead of rdfs:subClassOf ('o' instead of 'O'). Capitalisation matters, because the prefix notation is just shorthand for URIs and in URIs different characters (like lowercase instead of uppercase) make a different URI.

Ben Companjen
  • 1,417
  • 10
  • 24
2

Cut the query down until it is yielding something, then look to see why the part you have removed is not matching the data.

AndyS
  • 16,345
  • 17
  • 21