query-2406c25cc95d748e32f8cc81422e5617
d. median ingoing edges: number of ingoing edges
after the below, calculate median on ?nb_ingoing_edges
SELECT ?item (COUNT(?wdt) as ?nb_ingoing_edges)
WITH
{
SELECT DISTINCT ?item
WHERE
{
?item wdt:P279* wd:Q181388 .
# ?item wdt:P641 wd:Q847 .
}
} as %a
{
INCLUDE %a
?p wikibase:directClaim ?wdt ; wikibase:propertyType wikibase:WikibaseItem .
[] ?wdt ?item
}
GROUP BY ?item
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/>
# d. median ingoing edges: number of ingoing edges
# after the below, calculate median on ?nb_ingoing_edges
SELECT ?item (COUNT(?wdt) as ?nb_ingoing_edges)
{
{
SELECT DISTINCT ?item
WHERE
{
?item wdt:P279* wd:Q181388 .
# ?item wdt:P641 wd:Q847 .
}
}
?p wikibase:directClaim ?wdt ; wikibase:propertyType wikibase:WikibaseItem .
[] ?wdt ?item
}
GROUP BY ?item
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v1("?item"):::projected
v4("?nb_ingoing_edges")
v2("?p")
v3("?wdt"):::projected
a1((" "))
c2(["wd:Q181388"]):::iri
c5(["wikibase:WikibaseItem"]):::iri
v1 --"wdt:P279"--> c2
v2 --"wikibase:directClaim"--> v3
v2 --"wikibase:propertyType"--> c5
a1 -->v3--> v1
bind1[/"count(?wdt)"/]
v3 --o bind1
bind1 --as--o v4