query-3b67c4d9e826278038fcad3670e22003

rq turtle/ttl

title:This is how P155/P156 are used for video game items SELECT DISTINCT ?item ?itemLabel ?follows ?followsLabel ?followed_by ?followed_byLabel ?statement WHERE { ?item wdt:P31/wdt:P279* wd:Q7889. ?item p:P179 ?statement. OPTIONAL { ?statement pq:P155 ?follows. } OPTIONAL { ?statement pq:P156 ?followed_by. } SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". } } ORDER BY (UCASE(STR(?itemLabel)))

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX pq: <http://www.wikidata.org/prop/qualifier/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
#title:This is how P155/P156 are used for video game items
SELECT DISTINCT ?item ?itemLabel ?follows ?followsLabel ?followed_by ?followed_byLabel ?statement WHERE {
  ?item wdt:P31/wdt:P279* wd:Q7889.
  ?item p:P179 ?statement.
  OPTIONAL { ?statement pq:P155 ?follows. }
  OPTIONAL { ?statement pq:P156 ?followed_by. }
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
} ORDER BY (UCASE(STR(?itemLabel)))

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v5("?followed_by"):::projected v4("?follows"):::projected v2("?item"):::projected v1("?itemLabel"):::projected v3("?statement"):::projected a1((" ")) c8(["bd:serviceParam"]):::iri c3(["wd:Q7889"]):::iri c10(["#91;AUTO_LANGUAGE#93;,en"]):::literal v2 --"p:direct/P31"--> a1 a1 --"p:direct/P279"--> c3 v2 --"p:P179"--> v3 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v3 -."p:qualifier/P155".-> v4 end subgraph optional1["(optional)"] style optional1 fill:#bbf,stroke-dasharray: 5 5; v3 -."p:qualifier/P156".-> v5 end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c8 --"wikibase:language"--> c10 end