Griff
Griff

Reputation: 2124

retrieve list of mathematics categories from dbpedia?

Is there a way using SPARQL to retrieve all topics of in dpbedia?

http://dbpedia.org/snorql/

That is to say is there a way to extract all the subfields of the topics listed here:

http://en.wikipedia.org/wiki/Lists_of_mathematics_topics

The broad topics are lists here: http://dbpedia.org/page/Category:Fields_of_mathematics

I would like a list which shows the parent class and its subfield.

Upvotes: 1

Views: 582

Answers (1)

kr1
kr1

Reputation: 7485

question 1: depends on how you define topic....
you can query for instance for skos:Concept:

SELECT ?con
WHERE {
  ?con a skos:Concept
} 
limit 1000 

see result

question 2: you can query for skos:broader properties, like:

SELECT ?parent (?label as ?sub)
   WHERE {
  {
    ?sub skos:broader <http://dbpedia.org/resource/Category:Fields_of_mathematics> .
    ?sub rdfs:label ?label    .
  } UNION {
  <http://dbpedia.org/resource/Category:Fields_of_mathematics> rdfs:label ?parent
 }
}

see results

retrieve a list of the next level of sub-fields of the above fields with:

SELECT ?parent ?sub ?subsub
WHERE {
  {
    ?sub skos:broader <http://dbpedia.org/resource/Category:Fields_of_mathematics> .
    OPTIONAL {?subsub dcterms:subject ?sub}
  } UNION {
  <http://dbpedia.org/resource/Category:Fields_of_mathematics> rdfs:label ?parent
 }
}

see results

Upvotes: 4

Related Questions