I wrote a python programme to extract the DBpedia links for a given document using DBpedia Spotlight. Now I am interested in getting the skos:broader property and dcterms:subject property for each DBpedia link. Is there any DBpedia API that I can use for this?

I am happy to provide any examples if needed.

1 Answer 1


Here below I'm using examples from comments to your previous question.

Linked Data Fragments

For simple queries, you could use Linked Data Fragments:

Add Accept: application/json header, if you need a JSON response.


For complex queries, you could use SPARQL.

For example, you don't need to know preliminarily, whether a resource is a Wikipedia category or not:

You can perform even more advanced queries with SPARQL 1.1 property paths.

SPARQLWrapper is a Python library for working with SPARQL endpoints.

  • Thanks a lot for the great answer. Can we directly use the DBpedia URL in the SPARQL query. For example given the DBpedia link dbpedia.org/page/Support_vector_machine can we get the broader and subject properties using SPARQL?
    – J Cena
    Apr 15, 2018 at 9:38
  • what I am not sure of is how to get the values for dbr and 'dbc. For example if we consider 'Support Vector Machine' the dbr needs to be Support vector machine - singular, whereas dbc needs to be Support vector machines - plural. Please let me know if we can resolve this by directly using the DBpedia URL given by DBpedia Spotlight?
    – J Cena
    Apr 15, 2018 at 10:47
  • 1
    You can use full URIs directly, like this. I'm not sure that DBpedia Spotlight searches in DBpedia categories. Apr 15, 2018 at 11:13
  • Thanks a lot. As you have mentioned DBpedia Spotlight only provides the URIs for DBpedia resource pages. Is there any other way to recognise the DBpedia category pages?
    – J Cena
    Apr 15, 2018 at 11:41
  • 1
    @JCena, Unfortunately, I'm not familiar with. I suppose there exist respective reqular entities for the majority of categories. Apr 15, 2018 at 11:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.