Search code examples
sparqldbpedia

Finding linked topics in DBPedia using SPARQL


Consider we have these two topics:

http://dbpedia.org/page/Jason_Furman and http://dbpedia.org/page/London

For the first topic, Jason Furman, we can see on the property almaMater that he went to:

http://dbpedia.org/page/London_School_of_Economics

And looking at London School of Economics we see that it has London as value of the city property.

So my question is: If we have two topics, A and B, how can we find property values of A that has topic B in any of it's properties?


Solution

  • select distinct ?a ?p ?y ?q ?b where {
      values ?a { dbpedia:Jason_Furman }
      values ?b { dbpedia:London }
    
      ?a ?p ?y .
      ?y ?q ?b .
    }
    

    SPARQL results

    (Note that there are two results because there are two such properties: dbpprop:almaMater and dbpedia-owl:almaMater.)