Lucas_Werkmeister_WMDE added a comment.

  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! 
<https://query.wikidata.org/#%23defaultView%3AGraph%0ASELECT%20%3Fitem%20%3FitemLabel%20%3FlinkTo%20%3FlinkToLabel%20%3FedgeLabel%0AWHERE%0A%7B%0A%20%20%3Fitem%20%3FpDirect%20%3FlinkTo%20.%0A%20%20VALUES%20%3Fitem%20%7B%20wd%3AQ458%20%7D%0A%20%20%0A%20%20%3Fp%20wikibase%3AdirectClaim%20%3FpDirect%20.%0A%20%20%3Fp%20rdfs%3Alabel%20%3FedgeLabel%20.%0A%20%20FILTER%20%28lang%28%3FedgeLabel%29%3D%22en%22%29%0A%20%20OPTIONAL%20%7B%3FlinkTo%20rdfs%3Alabel%20%3FlinkToLabel%20.%0A%20%20FILTER%20%28lang%28%3FlinkToLabel%29%3D%22en%22%29%7D%0A%20%20%3Fitem%20rdfs%3Alabel%20%3FitemLabel%20.%0A%20%20FILTER%20%28lang%28%3FitemLabel%29%3D%22en%22%29%0A%20%20%0A%20%20%23OPTIONAL%20%7B%20%3Fitem%20%3Fp%20%3FlinkTo%20%7D%0A%20%20FILTER%20%28%3FpDirect%3Dwdt%3AP36%20%7C%7C%20%3FpDirect%3Dwdt%3AP85%20%7C%7C%20%3FpDirect%3Dwdt%3AP832%29%0A%20%20%23OPTIONAL%20%7B%20%3Fitem%20wdt%3AP21%20%3Fpic%20%7D%0A%20%20%23SERVICE%20wikibase%3Alabel%20%7Bbd%3AserviceParam%20wikibase%3Alanguage%20%22en%22%20%7D%0A%7D%20limit%201000>
  
  I’m not sure if this should be considered a bug or not, leaving the task open 
for now.

TASK DETAIL
  https://phabricator.wikimedia.org/T261116

EMAIL PREFERENCES
  https://phabricator.wikimedia.org/settings/panel/emailpreferences/

To: Lucas_Werkmeister_WMDE
Cc: Lucas_Werkmeister_WMDE, Aklapper, DD063520, CBogen, Akuckartz, 
darthmon_wmde, Nandana, Namenlos314, Lahi, Gq86, GoranSMilovanovic, Mahir256, 
QZanden, EBjune, merbst, LawExplorer, Salgo60, _jensen, rosalieper, Scott_WUaS, 
Jonas, Xmlizer, jkroll, Wikidata-bugs, Jdouglas, aude, Tobias1984, Manybubbles, 
Lydia_Pintscher, Mbch331
_______________________________________________
Wikidata-bugs mailing list
Wikidata-bugs@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikidata-bugs

Reply via email to