query-377c8103581b794721dcd9e6c616e130
Ordering items in dimensions viewI'm trying to order the items in a dimensions graph output so that the lines minimally cross. Propertiesfound in taxon (P703)instance of (P31)encodes (P688)physically interacts with (P129)
Use at
- https://query.wikidata.org/sparql
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX bd: <http://www.bigdata.com/rdf#>
#defaultView:Dimensions
SELECT ?geneLabel ?proteinLabel ?interacts_withLabel WHERE {
?gene wdt:P703 wd:Q82069695 ; wdt:P31 wd:Q7187 .
?gene wdt:P688 ?protein .
OPTIONAL {?protein wdt:P129 ?interacts_with.}
SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
}
LIMIT 10000
Query found at
- https://www.wikidata.org/wiki/Wikidata:Request_a_query/Archive/2020/09
- https://www.wikidata.org/wiki/Wikidata:WikiProject_COVID-19/Queries/SPARQL_Study
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v1("?gene")
v3("?interacts_with")
v2("?protein")
c8(["bd:serviceParam"]):::iri
c2(["wd:Q82069695"]):::iri
c4(["wd:Q7187"]):::iri
c10(["en"]):::literal
v1 --"wdt:P703"--> c2
v1 --"wdt:P31"--> c4
v1 --"wdt:P688"--> v2
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v2 -."wdt:P129".-> v3
end
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c8 --"wikibase:language"--> c10
end