7

I've a dbpedia resource and I'd like to obtain all the dbpedia categories associated. For this purpose I wrote this SPARQL query

SELECT ?p ?o WHERE
{
  <http://dbpedia.org/resource/Rihanna> ?p ?o .
}

focusing only on http://purl.org/dc/terms/subject property.

The results I've is a set of categories. Which could be a good manner to select the most relevant category which describes Rihanna singer?

user3653803
  • 117
  • 9
  • 1
    How do you define "most relevant"? SPARQL is a "stupid" query language for RDF data, thus, there is no concept of relevancy in the semantics of SPARQL – UninformedUser Aug 19 '16 at 13:39
  • 1
    There are attempts to create summation and ranking of RDF properties with algorithms like [Page Rank](https://en.wikipedia.org/wiki/PageRank). You could have a look at [LinkSUM](http://km.aifb.kit.edu/services/link/) and maybe get in touch with the authors – Tomasz Pluskiewicz Aug 19 '16 at 17:19
  • @TomaszPluskiewicz +1 for the LinkSUM reference. Its quite useful. – AndyFaizan Mar 27 '17 at 00:19

1 Answers1

8

This query orders Rihanna's categories by the total number of members in each category:

SELECT ?category (COUNT(?member) as ?memberCount) WHERE {
    ?member dct:subject ?category.
    { SELECT ?category WHERE { dbr:Rihanna dct:subject ?category. } }
}
ORDER BY ?memberCount

The assumption here is that, the fewer members a category has, the higher the relevance of that category for any particular member.

The results for this query list the following categories as most relevant to Rihanna:

  • Barbadian fashion designers
  • Barbadian people of Irish descent
  • Barbadian Christians
  • Barbadian people of Guyanese descent
  • Barbadian female singers
Ruben Verborgh
  • 3,545
  • 2
  • 31
  • 43