query-5be039b85cd6e32d161217b1f594a7d8
Use p:P17 to get the statement node (as you did) and then ps:P17 to get the Country value: Philippines wdt:P17 plus Philippines p:P17 Philippines wdt:P17 plus US p:P17 US wdt:P17 plus Philippines p:P17 US wdt:P17 plus US p:P17, for instance, two countries are specified in its P17, so you have two possible wdt:P17 values and two possible p:P17 values & so you get four rows: (Q185639)electric chair You're getting some sort of Cartesian product of the wdt:P17 and the p:P17 ... the two were not properly tied together. For 13:30, 5 March 2022 (UTC) 2003:6:6320:8B32:50AF:F464:4185:DThank you, that works fine! 15:35, 5 March 2022 (UTC)) talk (Infrastruktur? Most of the data you are interested in is not registered on the execution method itself, but rather on the victim. I had some problems with the aggregation of minimum and maximum values, maybe someone can help with that? XY problemMaybe this is a case of the
Use at
- https://query.wikidata.org/sparql
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX psv: <http://www.wikidata.org/prop/statement/value/>
PREFIX p: <http://www.wikidata.org/prop/>
SELECT
?what
(SAMPLE(?whatLabel) AS ?execution_method)
(GROUP_CONCAT(DISTINCT ?whateverLabel; SEPARATOR=", ") AS ?given_as)
(GROUP_CONCAT(DISTINCT ?country_Label; SEPARATOR=", ") AS ?country)
(YEAR(MIN(?dod)) AS ?dodMin)
(xsd:integer(AVG(YEAR(?dod))) AS ?dodAvg)
(YEAR(MAX(?dod)) AS ?dodMax)
(COUNT (?whatLabel) AS ?count)
WHERE {
?what wdt:P31 wd:Q15169167 .
?item wdt:P31 wd:Q5;
?whatever ?what;
p:P570 ?dod_st .
?dod_st psv:P570 ?dod_vn;
rdf:type wikibase:BestRank .
?dod_vn wikibase:timeValue ?dod;
wikibase:timePrecision ?dod_prec .
FILTER (?dod_prec >= 9)
OPTIONAL {
?whatever_prop wikibase:claim|wikibase:directClaim|wikibase:directClaimNormalized ?whatever .
?whatever_prop rdfs:label ?whateverLabel . FILTER(LANG(?whateverLabel) = "en") .
}
?what rdfs:label ?whatLabel . FILTER(LANG(?whatLabel) = "en") .
OPTIONAL {
?item wdt:P27 ?country_ .
?country_ rdfs:label ?country_Label . FILTER(LANG(?country_Label) = "en")
}
}
GROUP BY ?what
ORDER BY DESC(?count)