query-7ad3d95ca5b90a974d1fec472bf27631

rq turtle/ttl

Famous people on Mastodon

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX ps: <http://www.wikidata.org/prop/statement/>
PREFIX pq: <http://www.wikidata.org/prop/qualifier/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT ?item ?itemLabel ?handle ?links WHERE {
  ?item wdt:P31 wd:Q5.
  ?item p:P4033 ?handleStatement.
  ?handleStatement ps:P4033 ?handle.
  # But not mirrors or unofficial accounts
  MINUS { ?handleStatement pq:P3831 wd:Q29509080 } .
  MINUS { ?handleStatement pq:P3831 wd:654822 } .
  # And not those which ended already
  MINUS { ?handleStatement pq:P582 ?endtime } .
  ?item wikibase:sitelinks ?links.
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
ORDER BY DESC (?links)

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v5("?endtime") v4("?handle"):::projected v3("?handleStatement") v2("?item"):::projected v1("?links"):::projected c11(["bd:serviceParam"]):::iri c7(["wd:654822"]):::iri c6(["wd:Q29509080"]):::iri c2(["wd:Q5"]):::iri c13(["#91;AUTO_LANGUAGE#93;,en"]):::literal v2 --"p:direct/P31"--> c2 v2 --"p:P4033"--> v3 v3 --"p:statement/P4033"--> v4 subgraph minus0["MINUS"] style minus0 stroke-width:6px,fill:pink,stroke:red; v3 --"p:qualifier/P3831"--> c6 end subgraph minus1["MINUS"] style minus1 stroke-width:6px,fill:pink,stroke:red; v3 --"p:qualifier/P3831"--> c7 end subgraph minus2["MINUS"] style minus2 stroke-width:6px,fill:pink,stroke:red; v3 --"p:qualifier/P582"--> v5 end v2 --"wikibase:sitelinks"--> v1 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c11 --"wikibase:language"--> c13 end