Skip to content

Commit

Permalink
testing with a few initial oma sparql querries
Browse files Browse the repository at this point in the history
  • Loading branch information
alpae committed May 21, 2024
1 parent 93d2632 commit f3631e7
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 2 deletions.
3 changes: 2 additions & 1 deletion check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ prefixes=$(sparql --results=TSV --data=prefixes.ttl "PREFIX sh:<http://www.w3.or
echo "Prefixes found"

project="*"
while getopts nuhrsgmcpb: option; do
while getopts nuhrsgmcbop: option; do
case "$option" in
p) project="$OPTARG";;
u) project="uniprot";;
Expand All @@ -29,6 +29,7 @@ while getopts nuhrsgmcpb: option; do
c) project="covid";;
b) project="bgee";;
n) project="nextprot";;
o) project="oma";;
h) help; exit 0;;
*) help; exit 1;;
esac
Expand Down
3 changes: 2 additions & 1 deletion convertToOneTurtle.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@


project="uniprot"
while getopts nuhrsgmcbp: option; do
while getopts nuhrsgmcbop: option; do
case "$option" in
p) project="$OPTARG";;
u) project="uniprot";;
Expand All @@ -15,6 +15,7 @@ while getopts nuhrsgmcbp: option; do
c) project="covid";;
n) project="nextprot";;
b) project="bgee";;
o) project="oma";;
h) help; exit 0;;
*) help; exit 1;;
esac
Expand Down
20 changes: 20 additions & 0 deletions oma/01-rat-proteins.ttl
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
prefix ex: <https://sparql.omabrowser.org/.well-known/sparql-examples/>
prefix sh: <http://www.w3.org/ns/shacl#>
prefix rdfs:<http://www.w3.org/2000/01/rdf-schema#>
prefix schema:<https://schema.org/>
ex:1
a sh:SPARQLSelectExecutable, sh:SPARQLExecutable ;
sh:prefixes _:sparql_examples_prefixes ;
schema:target <https://sparql.omabrowser.org/sparql/> ;
rdfs:comment """Find all Rattus norvegicus' proteins present in OMA RDF database.""" ;
sh:select """SELECT ?protein ?OMA_link
WHERE
{
?protein a orth:Protein.
?protein orth:organism ?organism.
?inTaxon rdfs:label 'in taxon'@en.
?organism ?inTaxon ?taxon.
?taxon up:scientificName 'Rattus norvegicus'.
?protein rdfs:seeAlso ?OMA_link.
}""" .

16 changes: 16 additions & 0 deletions oma/02-all-species.ttl
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
prefix ex: <https://sparql.omabrowser.org/.well-known/sparql-examples/>
prefix sh: <http://www.w3.org/ns/shacl#>
prefix rdfs:<http://www.w3.org/2000/01/rdf-schema#>
prefix schema:<https://schema.org/>
ex:1
a sh:SPARQLSelectExecutable, sh:SPARQLExecutable ;
sh:prefixes _:sparql_examples_prefixes ;
schema:target <https://sparql.omabrowser.org/sparql/> ;
rdfs:comment """Which species are available on OMA database and their scientific names?""" ;
sh:select """SELECT ?species ?sciname WHERE
{
?species a up:Taxon.
?species up:scientificName ?sciname.
?species up:rank up:Species.
}""" .

0 comments on commit f3631e7

Please sign in to comment.