query-ab861e94eec03b171d9664fd3e37e4d6

rq turtle/ttl

Labling both axes on 'all against all' comparison using dimensions view 09:33, 3 February 2019 (UTC)) talk (Evolution and evolvabilityHello all, I'm trying to make a dimensions diagram of drug interactions. Any idea on how to label both axes?

Use at

PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
#defaultView:Dimensions
SELECT DISTINCT ?drug_A ?drug_B
WHERE
{
  VALUES ?toggle { true false }
  ?interaction wdt:P31+ wd:Q12140;
           wdt:P769 ?dr.
  ?dr rdfs:label ?drLabel.
    FILTER(LANG(?drLabel) = "en").
  ?interaction rdfs:label ?interactionLabel.
    FILTER(LANG(?interactionLabel) = "en").
  BIND(IF(?toggle,?interactionLabel,?drLabel) AS ?drug_A).
  BIND(IF(?toggle,?interaction,?dr) AS ?drug_B).
  BIND(IF(?toggle,"",?interaction) AS ?link).
}

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v5("?dr") v2("?drLabel") v6("?drug_A"):::projected v7("?drug_B"):::projected v4("?interaction") v1("?interactionLabel") v8("?link") v3("?toggle") c3(["wd:Q12140"]):::iri f0[["?interactionLabel = 'en'"]] f0 --> v1 f1[["?drLabel = 'en'"]] f1 --> v2 bind2[/VALUES ?toggle/] bind2-->v3 bind20(["true^^xsd:boolean"]) bind20 --> bind2 bind21(["false^^xsd:boolean"]) bind21 --> bind2 v4 --"wdt:P31"--> c3 v4 --"wdt:P769"--> v5 v5 --"rdfs:label"--> v2 v4 --"rdfs:label"--> v1 bind3[/"if(?toggle,?interactionLabel,?drLabel)"/] v3 --o bind3 v1 --o bind3 v2 --o bind3 bind3 --as--o v6 bind4[/"if(?toggle,?interaction,?dr)"/] v3 --o bind4 v4 --o bind4 v5 --o bind4 bind4 --as--o v7 bind5[/"if(?toggle,'',?interaction)"/] v3 --o bind5 v4 --o bind5 bind5 --as--o v8