query-3b032adbae0ecf45dd39633427e219dc
QueryBeginner
Use at
- https://query.wikidata.org/sparql
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX schema: <http://schema.org/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT ?person ?personLabel ?fame ?birthPlace ?residence ?educatedAt ?workedAt ?playedFor
WHERE
{
{
SELECT ?person ?fame ?birthPlace ?residence ?educatedAt ?workedAt (GROUP_CONCAT(DISTINCT ?teamLabel; SEPARATOR=", ") AS ?playedFor)
WHERE
{
{
SELECT ?person ?fame ?birthPlace ?residence ?educatedAt (GROUP_CONCAT(DISTINCT ?placeLabel; SEPARATOR=", ") AS ?workedAt)
WHERE
{
INCLUDE %get_educatedAt
OPTIONAL
{
?person wdt:P937 ?place.
?place wdt:P131* wd:Q812.
hint:Prior hint:gearing "forward".
}
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". ?place rdfs:label ?placeLabel. }
}
GROUP BY ?person ?fame ?birthPlace ?residence ?educatedAt
} OPTIONAL
{
{
SELECT DISTINCT ?team
WHERE
{
?team wdt:P115 ?venue.
?venue wdt:P131* wd:Q812.
}
} ?person wdt:P54 ?team.
}
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". ?team rdfs:label ?teamLabel. }
}
GROUP BY ?person ?fame ?birthPlace ?residence ?educatedAt ?workedAt
} SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
ORDER BY DESC(?fame)