sparql-examples

A set of SPARQL examples that are used in different SIB resources

View the Project on GitHub sib-swiss/sparql-examples

11

Find shortest rapidly evolving Caudovirales genes

Use at

PREFIX : <http://purl.orthodb.org/>
PREFIX up: <http://purl.uniprot.org/core/>

SELECT *
WHERE {
?gene a :Gene; :description ?description.
?gene :geneTranslatedLength ?aa_length.
?gene :memberOf ?og.
?og :ogBuiltAt [up:scientificName "Caudovirales"].
?og a :OrthoGroup; :ogEvolRate ?evolrate.
FILTER(?evolrate > 1)
bind (?evolrate/?aa_length as ?x)
}
ORDER BY desc(?x) limit 99

graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
  v5("?aa_length"):::projected 
  v4("?description"):::projected 
  v2("?evolrate"):::projected 
  v3("?gene"):::projected 
  v6("?og"):::projected 
  v7("?x"):::projected 
  a1((" "))
  c8(["Caudovirales"]):::literal 
  c3([":Gene"]):::iri 
  c10([":OrthoGroup"]):::iri 
  f0[["?evolrate > '1^^xsd:integer'"]]
  f0 --> v2
  v3 --"a"-->  c3
  v3 --":description"-->  v4
  v3 --":geneTranslatedLength"-->  v5
  v3 --":memberOf"-->  v6
  a1 --"up:scientificName"-->  c8
  v6 --":ogBuiltAt"-->  a1
  v6 --"a"-->  c10
  v6 --":ogEvolRate"-->  v2
  bind1[/"?evolrate / ?aa_length"/]
  v2 --o bind1
  v5 --o bind1
  bind1 --as--o v7