Skip to content

Commit

Permalink
UniProt: examples extracted from the tutorials
Browse files Browse the repository at this point in the history
  • Loading branch information
JervenBolleman committed Jun 18, 2024
1 parent 2ab0070 commit 806df41
Show file tree
Hide file tree
Showing 18 changed files with 402 additions and 0 deletions.
22 changes: 22 additions & 0 deletions examples/uniprot/obsolete_mnemonic_also_known_as_id.ttl
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
prefix ex: <https://sparql.uniprot.org/.well-known/sparql-examples/>
prefix up: <http://purl.uniprot.org/core/>
prefix sh: <http://www.w3.org/ns/shacl#>
prefix schema:<https://schema.org/>
prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
prefix faldo:<http://biohackathon.org/resource/faldo#>
prefix rdfs:<http://www.w3.org/2000/01/rdf-schema#>

ex:obsolete_mnemonic_also_known_as_id
a sh:SPARQLSelectExecutable, sh:SPARQLExecutable ;
sh:prefixes _:sparql_examples_prefixes ;
schema:target <https://sparql.uniprot.org/sparql/> ;
rdfs:comment """List all UniProt protein ID (mnemonic) that where used in the past for current UniProt entries.""" ;
sh:select """SELECT
?uniprot ?obsoleteMnemonic
WHERE
{
GRAPH <http://sparql.uniprot.org/uniprot> {
?uniprot a up:Protein ;
up:oldMnemonic ?obsoleteMnemonic .
}
}""" .
24 changes: 24 additions & 0 deletions examples/uniprot/taxonomy_hierarchy.ttl
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
prefix ex: <https://sparql.uniprot.org/.well-known/sparql-examples/>
prefix up: <http://purl.uniprot.org/core/>
prefix sh: <http://www.w3.org/ns/shacl#>
prefix schema:<https://schema.org/>
prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
prefix faldo:<http://biohackathon.org/resource/faldo#>
prefix rdfs:<http://www.w3.org/2000/01/rdf-schema#>

ex:taxonomy_hierarchy
a sh:SPARQLSelectExecutable, sh:SPARQLExecutable ;
sh:prefixes _:sparql_examples_prefixes ;
schema:target <https://sparql.uniprot.org/sparql/> ;
rdfs:comment """Find all taxonomic records that describe species of the genus <a href="http://purl.uniprot.org/taxonomy/9605">Homo<a>."""^^rdf:HTML ;
sh:select """SELECT
?species
?genus
WHERE {
BIND(taxon:9605 AS ?genus)
?species a up:Taxon ;
up:rank up:Species ;
rdfs:subClassOf ?genus .
?genus a up:Taxon ;
up:rank up:Genus .
}""" .
19 changes: 19 additions & 0 deletions examples/uniprot/taxonomy_host.ttl
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
prefix ex: <https://sparql.uniprot.org/.well-known/sparql-examples/>
prefix up: <http://purl.uniprot.org/core/>
prefix sh: <http://www.w3.org/ns/shacl#>
prefix schema:<https://schema.org/>
prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
prefix faldo:<http://biohackathon.org/resource/faldo#>
prefix rdfs:<http://www.w3.org/2000/01/rdf-schema#>

ex:taxonomy_host
a sh:SPARQLSelectExecutable, sh:SPARQLExecutable ;
sh:prefixes _:sparql_examples_prefixes ;
schema:target <https://sparql.uniprot.org/sparql/> ;
rdfs:comment """Find taxon records that are known to have part of their life cycle in other organisms (e.g. parasite, symbiont, infection)"""^^rdf:HTML ;
sh:select """SELECT
?virus
?host
WHERE {
?virus up:host ?host .
}""" .
24 changes: 24 additions & 0 deletions examples/uniprot/taxonomy_rank_and_scientific_name.ttl
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
prefix ex: <https://sparql.uniprot.org/.well-known/sparql-examples/>
prefix up: <http://purl.uniprot.org/core/>
prefix sh: <http://www.w3.org/ns/shacl#>
prefix schema:<https://schema.org/>
prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
prefix faldo:<http://biohackathon.org/resource/faldo#>
prefix rdfs:<http://www.w3.org/2000/01/rdf-schema#>

ex:taxonomy_rank_and_scientific_name
a sh:SPARQLSelectExecutable, sh:SPARQLExecutable ;
sh:prefixes _:sparql_examples_prefixes ;
schema:target <https://sparql.uniprot.org/sparql/> ;
rdfs:comment """Retrieve the rank and the scientific name of an taxonomic record. Not all taxonomic records have a <a href="http://purl.uniprot.org/core/rank">rank</a> associated with them."""^^rdf:HTML ;
sh:select """SELECT
?taxon
?scientificName
?rank
WHERE {
?taxon a up:Taxon ;
up:scientificName ?scientificName .
OPTIONAL {
?taxon up:rank ?rank
}
}""" .
34 changes: 34 additions & 0 deletions examples/uniprot/taxonomy_with_at_least_one_swissprot.ttl
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
prefix ex: <https://sparql.uniprot.org/.well-known/sparql-examples/>
prefix up: <http://purl.uniprot.org/core/>
prefix sh: <http://www.w3.org/ns/shacl#>
prefix schema:<https://schema.org/>
prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
prefix faldo:<http://biohackathon.org/resource/faldo#>
prefix rdfs:<http://www.w3.org/2000/01/rdf-schema#>

ex:taxonomy_with_at_least_one_swissprot
a sh:SPARQLSelectExecutable, sh:SPARQLExecutable ;
sh:prefixes _:sparql_examples_prefixes ;
schema:target <https://sparql.uniprot.org/sparql/> ;
rdfs:comment """Find taxon records for which one reviewed UniProtKB (Swiss-Prot) entry exists"""^^rdf:HTML ;
sh:select """
SELECT
DISTINCT
?taxid
?scientificName
?domain
?domainName
WHERE {
?uniprot a up:Protein .
# reviewed entries
?uniprot up:reviewed true .
?uniprot up:organism ?taxid .
?taxid up:scientificName ?scientificName .
VALUES ?domain { taxon:2 # bacteria
taxon:2157 # archaea
taxon:2759 # eukaryota
taxon:10239 #viruses
} .
?taxid rdfs:subClassOf ?domain .
}""" .
20 changes: 20 additions & 0 deletions examples/uniprot/uniprot_alternative_protein_full_name.ttl
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
prefix ex: <https://sparql.uniprot.org/.well-known/sparql-examples/>
prefix up: <http://purl.uniprot.org/core/>
prefix sh: <http://www.w3.org/ns/shacl#>
prefix schema:<https://schema.org/>
prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
prefix faldo:<http://biohackathon.org/resource/faldo#>
prefix rdfs:<http://www.w3.org/2000/01/rdf-schema#>

ex:uniprot_alternative_protein_full_name
a sh:SPARQLSelectExecutable, sh:SPARQLExecutable ;
sh:prefixes _:sparql_examples_prefixes ;
schema:target <https://sparql.uniprot.org/sparql/> ;
rdfs:comment """Alternative protein full names for UniProtKB entries""" ;
sh:select """SELECT ?protein
?fullName
WHERE {
?protein a up:Protein ;
up:alternativeName ?recommendedName .
?recommendedName up:fullName ?fullName .
}""" .
24 changes: 24 additions & 0 deletions examples/uniprot/uniprot_created_modified_updated.ttl
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
prefix ex: <https://sparql.uniprot.org/.well-known/sparql-examples/>
prefix up: <http://purl.uniprot.org/core/>
prefix sh: <http://www.w3.org/ns/shacl#>
prefix schema:<https://schema.org/>
prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
prefix faldo:<http://biohackathon.org/resource/faldo#>
prefix rdfs:<http://www.w3.org/2000/01/rdf-schema#>

ex:uniprot_created_modified_updated
a sh:SPARQLSelectExecutable, sh:SPARQLExecutable ;
sh:prefixes _:sparql_examples_prefixes ;
schema:target <https://sparql.uniprot.org/sparql/> ;
rdfs:comment """List the created, last modified, and last sequence update dates for UniProtKB proteins.""" ;
sh:select """SELECT
?protein
?created
?modified
?version
WHERE {
?protein a up:Protein ;
up:created ?created ;
up:modified ?modified ;
up:version ?version .
}""" .
19 changes: 19 additions & 0 deletions examples/uniprot/uniprot_encoding_gene.ttl
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
prefix ex: <https://sparql.uniprot.org/.well-known/sparql-examples/>
prefix up: <http://purl.uniprot.org/core/>
prefix sh: <http://www.w3.org/ns/shacl#>
prefix schema:<https://schema.org/>
prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
prefix faldo:<http://biohackathon.org/resource/faldo#>
prefix rdfs:<http://www.w3.org/2000/01/rdf-schema#>

ex:uniprot_encoding_gene
a sh:SPARQLSelectExecutable, sh:SPARQLExecutable ;
sh:prefixes _:sparql_examples_prefixes ;
schema:target <https://sparql.uniprot.org/sparql/> ;
rdfs:comment """List UniProt proteins with their associated named gene""" ;
sh:select """SELECT ?protein
?gene
WHERE {
?protein a up:Protein ;
up:encodedBy ?gene .
}""" .
20 changes: 20 additions & 0 deletions examples/uniprot/uniprot_encoding_gene_alternative_names.ttl
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
prefix ex: <https://sparql.uniprot.org/.well-known/sparql-examples/>
prefix up: <http://purl.uniprot.org/core/>
prefix sh: <http://www.w3.org/ns/shacl#>
prefix schema:<https://schema.org/>
prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
prefix faldo:<http://biohackathon.org/resource/faldo#>
prefix rdfs:<http://www.w3.org/2000/01/rdf-schema#>

ex:uniprot_encoding_gene_name_alternative_name
a sh:SPARQLSelectExecutable, sh:SPARQLExecutable ;
sh:prefixes _:sparql_examples_prefixes ;
schema:target <https://sparql.uniprot.org/sparql/> ;
rdfs:comment """List UniProt proteins with their associated gene and the gene's names that are used in the field, but not recommeded for use by UniProt""" ;
sh:select """SELECT ?protein
?gene ?altGeneName
WHERE {
?protein a up:Protein ;
up:encodedBy ?gene .
?gene skos:altLabel ?altGeneName .
}""" .
20 changes: 20 additions & 0 deletions examples/uniprot/uniprot_encoding_gene_name.ttl
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
prefix ex: <https://sparql.uniprot.org/.well-known/sparql-examples/>
prefix up: <http://purl.uniprot.org/core/>
prefix sh: <http://www.w3.org/ns/shacl#>
prefix schema:<https://schema.org/>
prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
prefix faldo:<http://biohackathon.org/resource/faldo#>
prefix rdfs:<http://www.w3.org/2000/01/rdf-schema#>

ex:uniprot_encoding_gene_name
a sh:SPARQLSelectExecutable, sh:SPARQLExecutable ;
sh:prefixes _:sparql_examples_prefixes ;
schema:target <https://sparql.uniprot.org/sparql/> ;
rdfs:comment """List UniProt proteins with their associated gene and the gene's preffered name""" ;
sh:select """SELECT ?protein
?gene
WHERE {
?protein a up:Protein ;
up:encodedBy ?gene .
?gene skos:prefLabel ?recommendedGeneName .
}""" .
21 changes: 21 additions & 0 deletions examples/uniprot/uniprot_encoding_gene_org_name.ttl
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
prefix ex: <https://sparql.uniprot.org/.well-known/sparql-examples/>
prefix up: <http://purl.uniprot.org/core/>
prefix sh: <http://www.w3.org/ns/shacl#>
prefix schema:<https://schema.org/>
prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
prefix faldo:<http://biohackathon.org/resource/faldo#>
prefix rdfs:<http://www.w3.org/2000/01/rdf-schema#>

ex:uniprot_encoding_gene_org_name
a sh:SPARQLSelectExecutable, sh:SPARQLExecutable ;
sh:prefixes _:sparql_examples_prefixes ;
schema:target <https://sparql.uniprot.org/sparql/> ;
rdfs:comment """List UniProt proteins with their associated gene and the gene's ORF label""" ;
sh:select """SELECT
?gene
?orfName
WHERE {
?protein a up:Protein ;
up:encodedBy ?gene .
?gene up:orfName ?orfName .
}""" .
24 changes: 24 additions & 0 deletions examples/uniprot/uniprot_organelles_or_plasmids.ttl
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
prefix ex: <https://sparql.uniprot.org/.well-known/sparql-examples/>
prefix up: <http://purl.uniprot.org/core/>
prefix sh: <http://www.w3.org/ns/shacl#>
prefix schema:<https://schema.org/>
prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
prefix faldo:<http://biohackathon.org/resource/faldo#>
prefix rdfs:<http://www.w3.org/2000/01/rdf-schema#>

ex:uniprot_organelles_or_plasmids
a sh:SPARQLSelectExecutable, sh:SPARQLExecutable ;
sh:prefixes _:sparql_examples_prefixes ;
schema:target <https://sparql.uniprot.org/sparql/> ;
rdfs:comment """If a gene is located in an organelle other than the nucleus, or/and on a plasmid rather than a chromosome, the gene location is stored in encodedIn properties. Note that if a plasmid has several names, they are listed as multiple <em>rdfs:label</em> properties."""^^rdf:HTML ;
sh:select """SELECT
?protein
?plasmidOrOrganelle
?label
WHERE {
?protein a up:Protein ;
up:encodedIn ?plasmidOrOrganelle .
OPTIONAL {
?plasmidOrOrganelle rdfs:label ?label .
}
}""" .
20 changes: 20 additions & 0 deletions examples/uniprot/uniprot_primary_accession.ttl
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
prefix ex: <https://sparql.uniprot.org/.well-known/sparql-examples/>
prefix up: <http://purl.uniprot.org/core/>
prefix sh: <http://www.w3.org/ns/shacl#>
prefix schema:<https://schema.org/>
prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
prefix faldo:<http://biohackathon.org/resource/faldo#>
prefix rdfs:<http://www.w3.org/2000/01/rdf-schema#>

ex:uniprot_primary_accession
a sh:SPARQLSelectExecutable, sh:SPARQLExecutable ;
sh:prefixes _:sparql_examples_prefixes ;
schema:target <https://sparql.uniprot.org/sparql/> ;
rdfs:comment """Extracting an UniProtKB primary accession from our IRIs. Is done with a bit of string manipulation. While UniProt primary accession are unique within UniProtKB they may be reused by accident or itentionally by other data sources. If we provided them as strings (not IRI) and if you used them in a query that way, you might accidentaly retrieve completly wrong records.""";
sh:select """SELECT
?primaryAccession
?protein
WHERE {
?protein a up:Protein .
BIND(substr(str(?protein), strlen(str(uniprotkb:))+1) AS ?primaryAccession)
}""" .
27 changes: 27 additions & 0 deletions examples/uniprot/uniprot_proteome_location_of_gene.ttl
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
prefix ex: <https://sparql.uniprot.org/.well-known/sparql-examples/>
prefix up: <http://purl.uniprot.org/core/>
prefix sh: <http://www.w3.org/ns/shacl#>
prefix schema:<https://schema.org/>
prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
prefix faldo:<http://biohackathon.org/resource/faldo#>
prefix rdfs:<http://www.w3.org/2000/01/rdf-schema#>

ex:uniprot_proteome_location_of_gene
a sh:SPARQLSelectExecutable, sh:SPARQLExecutable ;
sh:prefixes _:sparql_examples_prefixes ;
schema:target <https://sparql.uniprot.org/sparql/> ;
rdfs:comment """List UniProt proteins with genetic replicon that they are encoded on using the Proteome data.""" ;
sh:select """SELECT
DISTINCT
?proteomeData
?replicon
?proteome
WHERE {
# reviewed entries (UniProtKB/Swiss-Prot)
?protein up:reviewed true .
# restricted to Human taxid
?uniprot up:organism taxon:9606 .
?uniprot up:proteome ?proteomeData .
BIND( strbefore( str(?proteomeData), "#" ) as ?proteome )
BIND( strafter( str(?proteomeData), "#" ) as ?replicon )
}""" .
20 changes: 20 additions & 0 deletions examples/uniprot/uniprot_recomended_protein_full_name.ttl
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
prefix ex: <https://sparql.uniprot.org/.well-known/sparql-examples/>
prefix up: <http://purl.uniprot.org/core/>
prefix sh: <http://www.w3.org/ns/shacl#>
prefix schema:<https://schema.org/>
prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
prefix faldo:<http://biohackathon.org/resource/faldo#>
prefix rdfs:<http://www.w3.org/2000/01/rdf-schema#>

ex:uniprot_recomended_protein_full_name
a sh:SPARQLSelectExecutable, sh:SPARQLExecutable ;
sh:prefixes _:sparql_examples_prefixes ;
schema:target <https://sparql.uniprot.org/sparql/> ;
rdfs:comment """The recommended protein full names for UniProtKB entries""" ;
sh:select """SELECT ?protein
?fullName
WHERE {
?protein a up:Protein ;
up:recommendedName ?recommendedName .
?recommendedName up:fullName ?fullName .
}""" .
20 changes: 20 additions & 0 deletions examples/uniprot/uniprot_recomended_protein_short_name.ttl
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
prefix ex: <https://sparql.uniprot.org/.well-known/sparql-examples/>
prefix up: <http://purl.uniprot.org/core/>
prefix sh: <http://www.w3.org/ns/shacl#>
prefix schema:<https://schema.org/>
prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
prefix faldo:<http://biohackathon.org/resource/faldo#>
prefix rdfs:<http://www.w3.org/2000/01/rdf-schema#>

ex:uniprot_recomended_protein_short_name
a sh:SPARQLSelectExecutable, sh:SPARQLExecutable ;
sh:prefixes _:sparql_examples_prefixes ;
schema:target <https://sparql.uniprot.org/sparql/> ;
rdfs:comment """The recommended protein short names for UniProtKB entries""" ;
sh:select """SELECT ?protein
?fullName
WHERE {
?protein a up:Protein ;
up:recommendedName ?recommendedName .
?recommendedName up:shortName ?fullName .
}""" .
20 changes: 20 additions & 0 deletions examples/uniprot/uniprot_reviewed_or_not.ttl
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
prefix ex: <https://sparql.uniprot.org/.well-known/sparql-examples/>
prefix up: <http://purl.uniprot.org/core/>
prefix sh: <http://www.w3.org/ns/shacl#>
prefix schema:<https://schema.org/>
prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
prefix faldo:<http://biohackathon.org/resource/faldo#>
prefix rdfs:<http://www.w3.org/2000/01/rdf-schema#>

ex:uniprot_reviewed_or_not
a sh:SPARQLSelectExecutable, sh:SPARQLExecutable ;
sh:prefixes _:sparql_examples_prefixes ;
schema:target <https://sparql.uniprot.org/sparql/> ;
rdfs:comment """List all UniProt protein and if they are reviewed (Swiss-Prot) or unreviewed (TrEMBL)""" ;
sh:select """SELECT
?protein
?reviewed
WHERE {
?protein a up:Protein .
?protein up:reviewed ?reviewed .
}""" .
Loading

0 comments on commit 806df41

Please sign in to comment.