expasy4j WebNG

Query Language

Constructing queries that can be run directly on the triple store is in most cases too complicated or inconvenient. Instead a specialized query language similar to RDQL is provided. Results are usually returned within seconds to minutes.

Contents

Examples
Missing Features

Examples

Names of proteins with a gene with a specific name or synonym

SELECT 
  ?protein, ?name 
WHERE 
  [?protein rdf:type :Protein] AND 
  [?protein :name ?name] AND 
  [?protein :encodedBy ?gene] AND 
  [?gene :name "CRB"] 
USING 
  "urn:lsid:uniprot.org:ontology:",
  "http://www.w3.org/1999/02/22-rdf-syntax-ns#" AS rdf

Ranges of transmembrane regions

SELECT 
  ?protein, ?begin, ?end 
WHERE 
  [?protein rdf:type :Protein] AND 
  [?protein :annotation ?annotation] AND
  [?annotation rdf:type :Transmembrane_Annotation] AND 
  [?annotation  :range ?range] AND 
  [?range :begin ?begin] AND  -- Note: Should use MAYBE...
  [?range :end ?end] 
USING 
  "urn:lsid:uniprot.org:ontology:",
  "http://www.w3.org/1999/02/22-rdf-syntax-ns#" AS rdf

Proteins with publications by authors with matching names

SELECT 
  ?protein, ?author, ?title
WHERE 
  [?protein rdf:type :Protein] AND 
  [?protein :modified ?modified] AND 
  [?protein :citation ?citation] AND 
  [?citation :author ?author] AND 
  ?author ~ "bairoch %" AND 
  [?citation :title ?title] 
USING 
  "urn:lsid:uniprot.org:ontology:",
  "http://www.w3.org/1999/02/22-rdf-syntax-ns#" AS rdf

Number of times a publication by a specific author is cited

COUNT 
  ?protein
WHERE 
  [?protein rdf:type :Protein] AND 
  [?protein :citation ?citation] AND 
  [?citation :author "Bairoch A."] 
USING 
  "urn:lsid:uniprot.org:ontology:",
  "http://www.w3.org/1999/02/22-rdf-syntax-ns#" AS rdf

Resources that are related to proteins annotated with a specific keyword

SELECT 
  ?related
WHERE 
  [?protein rdf:type :Protein] AND 
  [?protein :classifiedWith <urn:lsid:uniprot.org:keywords:48>] AND 
  [?protein rdfs:seeAlso ?related] 
USING 
  "urn:lsid:uniprot.org:ontology:",
  "http://www.w3.org/1999/02/22-rdf-syntax-ns#" AS rdf, 
  "http://www.w3.org/2000/01/rdf-schema#" AS rdfs

Genes associated with human diseases

SELECT 
  ?gene AS "Gene", ?name AS "Name", ?text AS "Disease"
WHERE 
  [?protein rdf:type :Protein] AND
  [?protein :gene ?gene] AND
  [?gene :name ?name] AND 
  [?protein :organism taxon:9606] AND 
  [?protein :annotation ?annotation] AND 
  [?annotation rdf:type :Disease_Annotation] AND 
  [?annotation rdfs:comment ?text] 
USING 
  "urn:lsid:uniprot.org:ontology:",
  "http://www.w3.org/1999/02/22-rdf-syntax-ns#" AS rdf, 
  "http://www.w3.org/2000/01/rdf-schema#" AS rdfs,
  "urn:lsid:uniprot.org:taxonomy:" AS taxon

Sequences of bacterial proteins

SELECT 
  ?protein, ?aa
WHERE 
  [?protein rdf:type :Protein] AND 
  [?protein :organism taxon:2] AND 
  [?protein :sequence ?s] AND 
  [?s rdf:value ?aa]
USING 
  "urn:lsid:uniprot.org:ontology:",
  "http://www.w3.org/1999/02/22-rdf-syntax-ns#" AS rdf, 
  "http://www.w3.org/2000/01/rdf-schema#" AS rdfs,
  "urn:lsid:uniprot.org:taxonomy:" AS taxon

Recently modified entries

SELECT 
  ?protein, ?date
WHERE 
  [?protein rdf:type :Protein] AND 
  [?protein :modified ?date] AND 
  ?date > "2004-08"
USING 
  "urn:lsid:uniprot.org:ontology:",
  "http://www.w3.org/1999/02/22-rdf-syntax-ns#" AS rdf

Interactions between two specific enzymes

SELECT 
  ?interaction, ?p1, ?p2
WHERE 
  [?p1 rdf:type :Protein] AND 
  [?p1 :enzyme ec:2.7.7.-] AND 
  [?p2 rdf:type :Protein] AND 
  [?p2 :enzyme ec:3.1.3.16] AND 
  [?interaction rdf:type :Interaction] AND 
  [?interaction :participant ?p1] AND 
  [?interaction :participant ?p2] 
USING 
  "urn:lsid:uniprot.org:ontology:",
  "http://www.w3.org/1999/02/22-rdf-syntax-ns#" AS rdf, 
  "http://www.w3.org/2000/01/rdf-schema#" AS rdfs,
  "urn:lsid:uniprot.org:enzymes:" AS ec

Missing Features