Example SPANG commands compared with the corresponding plain SPARQL queries
1. Retrieve information about UniProt P02649.
2. Confine the results of query 1 to organism information.
3. Modify the query 2 to output the scientific name of the organism.
4. Retrieve annotation for UniProt P02649.
5. Search for classes matching a regular expression '^apolipoprotein'
6. Search MBGD for orthologs of UniProt K9Z723.
7. Search MBGD for orthologs of K9Z723, and then search UniProt for their annotations.
8. Search MBGD for orthologs of K9Z723, and then search UniProt for cross-references to PDB entries.
9. Search for classes matching a regular expression '^alzheimer'
10. Retrieve information about EFO_0000249 (Alzheimer's disease).
11. Retrieve differentially expressed genes in Alzheimer's disease, and then pick out proteins related to GO_0045202 (synapse).
SPANG commands
1 spang uniprot -S uniprot:P02649

2 spang uniprot -S uniprot:P02649 -P up:organism

3 spang uniprot -S uniprot:P02649 -P up:organism/up:scientificName

4 spang uniprot uniprot_annot P02649

5 spang uniprot regex_class ’^apolipoprotein’

6 spang mbgd mbgdl:get_ortholog K9Z723

Corresponding plain SPARQL queries
Endpoint http://sparql.uniprot.org/sparql
Query
PREFIX uniprot: <http://purl.uniprot.org/uniprot/>
SELECT ?p ?o
WHERE {
uniprot:P02649 ?p ?o}Endpoint http://sparql.uniprot.org/sparql
Query
PREFIX uniprot: <http://purl.uniprot.org/uniprot/>
PREFIX up: <http://purl.uniprot.org/core/>
SELECT ?o
WHERE {
uniprot:P02649 up:organism ?o}Endpoint http://sparql.uniprot.org/sparql
Query
PREFIX uniprot: <http://purl.uniprot.org/uniprot/>
PREFIX up: <http://purl.uniprot.org/core/>
SELECT ?oWHERE {uniprot:P02649 up:organism/up:scientificName ?o}Endpoint http://sparql.uniprot.org/sparql
Query
PREFIX uniprot: <http://purl.uniprot.org/uniprot/>
PREFIX up: <http://purl.uniprot.org/core/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
SELECT ?gene ?organism ?function
WHERE {
uniprot:P02649 up:encodedBy/skos:prefLabel ?gene ;up:organism/up:scientificName ?organism ;up:annotation ?annot .
?annot a up:Function_Annotation ;rdfs:comment ?function .
}Endpoint http://sparql.uniprot.org/sparql
Query
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
SELECT DISTINCT ?class ?label
WHERE {
?class a owl:Class ;rdfs:label ?label .
FILTER regex(?label, "^apolipoprotein", "i")}Endpoint http://sparql.nibb.ac.jp/sparql
Query
PREFIX uniprot: <http://purl.uniprot.org/uniprot/>
PREFIX void: <http://rdfs.org/ns/void#>
PREFIX orthology: <http://purl.org/net/orth#>
PREFIX mbgd: <http://purl.jp/bio/11/mbgd#>
PREFIX mbgdr: <http://mbgd.genome.ad.jp/rdf/resource/>
SELECT ?uniprot
WHERE {
?group a orthology:OrthologsCluster ;orthology:hasHomologous/mbgd:gene/mbgd:uniprot uniprot:K9Z723 ;orthology:hasHomologous/mbgd:gene/mbgd:uniprot ?uniprot ;void:inDataset mbgdr:default .
}7 spang mbgd mbgdl:get_ortholog K9Z723 | spang uniprot -S 1 -P rdfs:label Endpoint http://sparql.nibb.ac.jp/sparql
Query

8 spang mbgd mbgdl:get_ortholog K9Z723 | spang uniprot uniprot_xref PDB

9 spang atlas regex_class ’^alzheimer’10 spang atlas -S efo:EFO_0000249

11 spang atlas diff_expr EFO_0000249 > result
cut –f1 result | spang uniprot filter_by_go GO_0045202

PREFIX uniprot: <http://purl.uniprot.org/uniprot/>
PREFIX void: <http://rdfs.org/ns/void#>
PREFIX orthology: <http://purl.org/net/orth#>
PREFIX mbgd: <http://purl.jp/bio/11/mbgd#>
PREFIX mbgdr: <http://mbgd.genome.ad.jp/rdf/resource/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>

SELECT ?uniprot ?label
WHERE {
?group a orthology:OrthologsCluster ;orthology:hasHomologous/mbgd:gene/mbgd:uniprot uniprot:K9Z723 ;orthology:hasHomologous/mbgd:gene/mbgd:uniprot ?uniprot ;void:inDataset mbgdr:default .
SERVICE <http://sparql.uniprot.org/sparql>{?uniprot rdfs:label ?label .
}}Endpoint http://sparql.nibb.ac.jp/sparql
Query
PREFIX uniprot: <http://purl.uniprot.org/uniprot/>
PREFIX void: <http://rdfs.org/ns/void#>
PREFIX orthology: <http://purl.org/net/orth#>PREFIX mbgd: <http://purl.jp/bio/11/mbgd#>
PREFIX mbgdr: <http://mbgd.genome.ad.jp/rdf/resource/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX up: <http://purl.uniprot.org/core/>
SELECT ?uniprot ?xref
WHERE {
?group a orthology:OrthologsCluster ;orthology:hasHomologous/mbgd:gene/mbgd:uniprot uniprot:K9Z723 ;orthology:hasHomologous/mbgd:gene/mbgd:uniprot ?uniprot ;void:inDataset mbgdr:default .
SERVICE <http://sparql.uniprot.org/sparql>{?uniprot rdfs:seeAlso ?xref .
?xref up:database <http://purl.uniprot.org/database/PDB> .
}}Endpoint https://www.ebi.ac.uk/rdf/services/atlas/sparql
Query
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
SELECT DISTINCT ?class ?label
WHERE {
?class a owl:Class ;rdfs:label ?label .
FILTER regex(?label, "^alzheimer", "i")}Endpoint https://www.ebi.ac.uk/rdf/services/atlas/sparql
Query
PREFIX efo: <http://www.ebi.ac.uk/efo/>
SELECT ?p ?o
WHERE {
efo:EFO_0000249 ?p ?o}Endpoint https://www.ebi.ac.uk/rdf/services/atlas/sparql
Query
PREFIX efo: <http://www.ebi.ac.uk/efo/>
PREFIX atlas: <http://rdf.ebi.ac.uk/terms/atlas/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX up: <http://purl.uniprot.org/core/>
PREFIX obo: <http://purl.obolibrary.org/obo/>
SELECT ?uniprot ?probe ?experiment ?pubmed ?expr_label
WHERE {
?experiment atlas:pubmedid ?pubmed ;atlas:hasAnalysis/atlas:hasExpressionValue ?diff_expr .
?diff_expr rdfs:label ?expr_label ;atlas:hasFactorValue/a efo:EFO_0000249 ;atlas:isMeasurementOf ?probe .
?probe atlas:dbXref ?uniprot .
?uniprot a atlas:UniprotDatabaseReference .
SERVICE <http://sparql.uniprot.org/sparql>{?uniprot up:classifiedWith obo:GO_0045202}}