Re:Extracting data from Wikipedia using curl, grep, cut and ...
by crypto5 on Monday August 15, 2016 @08:06PM
(#12294541)
dbpedia provides very low coverage of wikipedia information.
Re:Extracting data from Wikipedia using curl, grep, cut and ...
by lacksconfidence on Monday August 15, 2016 @08:49PM
(#12294736)
I looked at dbpedia, but it was non-obvious to me what statements to use. We can also use SPARQL with wikidata, although the coverage isn't particularly great.I threw together an example query for medalists and michael phelps doesn't make the list, because he doesn't have the appropriate participant of/award received statements:
https://query.wikidata.org/#SELECT%20%3Fhuman%20%3FhumanLabe...
SELECT ?human ?humanLabel ?count WHERE {
{
SELECT ?human (COUNT(*) as ?count) WHERE {
?event wdt:P31 wd:Q18536594 . # All items that are instance of Olympic sporting event
?medal wdt:P279 wd:Q636830 . # All items that are subclass of Olympic medal
?human p:P1344 ?participantStat . # Humans with a participant of statement
?participantStat ps:P1344 ?event . # .. that has any of the values of ?event
?participantStat pq:P166 ?medal . # .. with the award received qualifier of any of the values of ?medal
}
GROUP BY ?human
}
SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
}
ORDER BY DESC(?count)
LIMIT 100
EDIT: The dbpedia search should be something like: http://dbpedia.org/sparql?default-graph-uri=http%3A%2F%2Fdbp... SELECT ?human ?count WHERE
{
{
SELECT ?human (count(*) as ?count) WHERE {
?event rdf:type dbo:OlympicEvent
{
?event dbo:bronzeMedalist ?human .
} UNION {
?event dbo:silverMedalist ?human
} UNION {
?event dbo:goldMedalist ?human
}
}
GROUP BY ?human
}
}
ORDER BY DESC(?count)
LIMIT 100
Re:Extracting data from Wikipedia using curl, grep, cut and ...
by betolink on Monday August 15, 2016 @11:35PM
(#12295372)
It's not surprising that Phelps is not on the list, you're grouping by ?human and he is not... jk, maybe there is an ontology issue i.e. new triples are using a different class or that triple-store is not up to date.
dbpedia is a triple-store that allows us to perform simple queries against wikipedia data like listing music bands based on a particular city:
or queries that involve multiple subjects, categories etc.