Page MenuHomePhabricator

Bug in graph view of wikidata query service
Open, Needs TriagePublicBUG REPORT

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

The edge label needs to be at the end of the variable list. This looks correct:

#defaultView:Graph
SELECT ?item ?itemLabel ?linkTo ?linkToLabel ?edgeLabel
WHERE
{
  ?item ?pDirect ?linkTo .
  VALUES ?item { wd:Q458 }
  
  ?p wikibase:directClaim ?pDirect .
  ?p rdfs:label ?edgeLabel .
  FILTER (lang(?edgeLabel)="en")
  OPTIONAL {?linkTo rdfs:label ?linkToLabel .
  FILTER (lang(?linkToLabel)="en")}
  ?item rdfs:label ?itemLabel .
  FILTER (lang(?itemLabel)="en")
  
  #OPTIONAL { ?item ?p ?linkTo }
  FILTER (?pDirect=wdt:P36 || ?pDirect=wdt:P85 || ?pDirect=wdt:P832)
  #OPTIONAL { ?item wdt:P21 ?pic }
  #SERVICE wikibase:label {bd:serviceParam wikibase:language "en" }
} limit 1000

Try it!

I’m not sure if this should be considered a bug or not, leaving the task open for now.

Ah, good to know ..... thank you! But it is still a bit weird. I would have expected that the variable name matters. I leave it to you to decide to handle it as a bug or not ...