Search code examples
sparqlrdfdbpedia

SPARQL query for getting DBpedia triples when an entity is subject?


I got the subjects of a resource e.g. Michael Jordan using below query:

SELECT ?subjects 
WHERE { 
   <http://dbpedia.org/resource/Michael_Jordan> dct:subject ?subjects .
}

Now I want to get all resources where the resource 'Michael Jordan' itself is subject. I'm using this query editor. Please help in this regard.


Solution

  • In DBpedia, 'subjects' that you are mentioning are represented with categories which are type of SKOS concepts. So you should first find the categories which might represent Michael Jordan, in this case, probably you should pose this query:

    SELECT ?s WHERE { 
       ?s dct:subject <http://dbpedia.org/resource/Category:Michael_Jordan> .
    }