Project:SPARQL/examples: Difference between revisions

Jump to navigation Jump to search
Line 25: Line 25:
}
}
</sparql>
</sparql>
===Draw taxonomy tree for Eukaryota (9-rank PR2 v5.0.0 taxonomy)===
<sparql tryit="1">
#defaultView:Tree
PREFIX pp: <https://ppsdb.wikibase.cloud/entity/>
PREFIX ppt: <https://ppsdb.wikibase.cloud/prop/direct/>
SELECT ?root ?rootLabel ?item ?itemLabel ?item2 ?item2Label ?item3 ?item3Label ?item4 ?item4Label ?item5 ?item5Label ?item6 ?item6Label ?item7 ?item7Label ?item8 ?item8Label ?item9 ?item9Label WHERE {
  BIND(pp:Q609 AS ?root)
  BIND(ppt:P29 AS ?property)
  ?item ?property ?root.
  OPTIONAL {
    ?item2 ?property ?item.
    OPTIONAL {
      ?item3 ?property ?item2.
      OPTIONAL {
        ?item4 ?property ?item3.
        OPTIONAL {
          ?item5 ?property ?item4.
          OPTIONAL {
            ?item6 ?property ?item5.
            OPTIONAL {
              ?item7 ?property ?item6.
              OPTIONAL {
                ?item8 ?property ?item7.
                OPTIONAL {
                  ?item9 ?property ?item8.
                }
              }
            }
          }
        }
      }
    }
  }
  SERVICE wikibase:label {
    bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en".
  }
}
ORDER BY (?itemLabel) (?item2Label) (?item3Label) (?item4Label) (?item5Label) (?item6Label) (?item7Label) (?item8Label) (?item9Label)
</sparql>


===Bubble chart of numbers of interactions by symbiont localization===
===Bubble chart of numbers of interactions by symbiont localization===

Navigation menu