Skip to content

Instantly share code, notes, and snippets.

@kozo2
Created September 16, 2015 13:10
Show Gist options
  • Select an option

  • Save kozo2/fda17aba64df21ce2631 to your computer and use it in GitHub Desktop.

Select an option

Save kozo2/fda17aba64df21ce2631 to your computer and use it in GitHub Desktop.
SPARQL
PREFIX up:<http://purl.uniprot.org/core/>
PREFIX taxon:<http://purl.uniprot.org/taxonomy/>
PREFIX rdf:<http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs:<http://www.w3.org/2000/01/rdf-schema#>
SELECT ?protein ?name ?namePred
WHERE
{
?protein a up:Protein .
?protein up:organism ?organism .
{
?protein up:organism taxon:83333 .
} UNION {
?protein up:organism ?organism .
?organism rdfs:subClassOf+ taxon:83333 .
}
?protein ?namePredicate ?s .
?s a up:Structured_Name .
?s ?namePred ?name .
filter(?namePred != rdf:type)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment