query-38c0339605af569cd9c63f5cd391365b
Visualising gene structure 'is part of' relationships as diagram , but I've realised here might be a more sensible location to ask.project chatI originally posted to within Wikidata. I feel like it should be possibly to recapitulate the structure of that diagram with a Wikidata Query network graph. w:Gene_structureHello, I'm trying to encode the relationships and references in the two diagrams in Colour nodes by whether they are part of open reading frame, UTR or regulatory sequence Edges down from Gene, but also across between elements eukaryotes.of (P642) in different colours (showing only those that have qualifier Property:P279, and Property:P31, Property:P361Edges of Starting at Gene 03:42, 31 January 2019 (UTC)) talk (Evolution and evolvability because I cant work out the syntax enough to implement most of the features above. Any ideas on how to fix it? Fnielsen butchered from a previous query written by Here is my first attempt19:30, 31 January 2019 (UTC)) talk (Luitzen. -- here: The Graph view doesn't allow to colour edges, see Evolution and evolvability@01:21, 1 February 2019 (UTC)) talk (Evolution and evolvability: Ah, thank you. Can the edge labels be customised (e.g. 'P' for 'part of', 'i' for 'instance of'). Luitzen@? this, but I suspect there are still redundant parts. Any ideas on how to simplify it, perhaps with some sort of structure like updated versionI've made an
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#>
PREFIX gas: <http://www.bigdata.com/rdf/gas#>
#defaultView:Graph
# parts of a gene and their subclasses
SELECT DISTINCT ?down ?downLabel ?up ?upLabel ("#ff0000" AS ?rgb) WHERE {
{
{
SELECT ?down ?up WHERE { # subclass of untranslated region
SERVICE gas:service {
gas:program gas:gasClass "com.bigdata.rdf.graph.analytics.BFS".
gas:program gas:in wd:Q424345.
gas:program gas:traversalDirection "Reverse".
gas:program gas:out ?down.
gas:program gas:out1 ?depth.
gas:program gas:out2 ?up.
gas:program gas:linkType wdt:P279.
}
}
}
}
UNION
{
{
SELECT ?down ?up WHERE { # subclass of regulatory sequence
SERVICE gas:service {
gas:program gas:gasClass "com.bigdata.rdf.graph.analytics.BFS".
gas:program gas:in wd:Q3238407.
gas:program gas:traversalDirection "Reverse".
gas:program gas:out ?down.
gas:program gas:out1 ?depth.
gas:program gas:out2 ?up.
gas:program gas:linkType wdt:P279.
}
}
}
}
UNION
{
{
SELECT ?down ?up WHERE { # part of coding region
SERVICE gas:service {
gas:program gas:gasClass "com.bigdata.rdf.graph.analytics.BFS".
gas:program gas:in wd:Q3780824.
gas:program gas:traversalDirection "Reverse".
gas:program gas:out ?down.
gas:program gas:out1 ?depth.
gas:program gas:out2 ?up.
gas:program gas:linkType wdt:P361.
}
}
}
}
UNION
{
{
SELECT ?down ?up WHERE { # instance of regulatory sequence
SERVICE gas:service {
gas:program gas:gasClass "com.bigdata.rdf.graph.analytics.BFS".
gas:program gas:in wd:Q424345.
gas:program gas:traversalDirection "Reverse".
gas:program gas:out ?down.
gas:program gas:out1 ?depth.
gas:program gas:out2 ?up.
gas:program gas:linkType wdt:P31.
}
}
}
}
UNION
{
{
SELECT ?down ?up WHERE { # part of gene
SERVICE gas:service {
gas:program gas:gasClass "com.bigdata.rdf.graph.analytics.BFS".
gas:program gas:in wd:Q7187. # gene
gas:program gas:traversalDirection "Reverse".
gas:program gas:out ?down.
gas:program gas:out1 ?depth.
gas:program gas:out2 ?up.
gas:program gas:linkType wdt:P361.
}
}
}
}
SERVICE wikibase:label { bd:serviceParam wikibase:language "en,da,sv,jp,zh,ru,fr,de". }
}