Reputation: 2124
Is there a way using SPARQL to retrieve all topics of in dpbedia?
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
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
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
}
}
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
}
}
Upvotes: 4