Reputation: 3164
I am new to RDF
I am trying to get companies and number of its subsidaries through dbpedia
I started with writing below queries in sparql at http://dbpedia.org/sparql or DBpedia SPARQL Explorer
select ?p ?v where {<http://dbpedia.org:8890/ontology/subsidiary ?p ?v}
And This:
SELECT * WHERE {
?P <http://dbpedia.org/ontology/subsidiary> ?C
}
See here
http://dbpedia.org:8890/ontology/subsidiary
Upvotes: 0
Views: 513
Reputation: 7485
you should aggregate the results with group by
and use count, e.g like:
SELECT str(?lab) as ?label ?com count(?subs) as ?count WHERE {
?com <http://dbpedia.org/ontology/subsidiary> ?subs .
?com rdfs:label ?lab .
filter langMatches(lang(?lab), 'en') .
}
group by ?com ?lab
Upvotes: 3