0

I need to create a SPARQL query that gives me all the TopicItems contained in a Topic, in the following schema, but I don't know how to do that. enter image description here

There is an inverse ObjectProperty named "ContainedIn", I think I must use it, but I don't know exactly how.

LokiNkc
  • 55
  • 1
  • 9

1 Answers1

1

You do not need to use any inverse property, as you can place SPARQL variables in any position in a triple pattern. Just supply a variable for the object in your triple pattern:

SELECT ?topicItem
WHERE {
    <...> slo:consistsOf ?topicItem .
}

where <...> needs to be replaced with the IRI of the topic you want to examine.

EDIT: I have omitted the prefix declaration here; as you were already using the prefix slo, I presumed you had already successfully declared it somehow. Of course, a prefix declaration needs to be added unless the SPARQL endpoint somehow knows slo as a pre-defined prefix.

O. R. Mapper
  • 20,083
  • 9
  • 69
  • 114
  • Something like this? 'PREFIX slo: SELECT ?x WHERE { http://localhost:8080/OntoSakaiWS/SakaiLanguageOnt.owl#DBA_ADMIN_TEST_LLLL slo:consistsOf ?x }' It returns an error – LokiNkc Apr 08 '15 at 15:00