sparql-examples

A set of SPARQL examples that are used in different SIB resources

View the Project on GitHub sib-swiss/sparql-examples

15-rat-TP53-biosodafrontend

rq turtle/ttl

Rattus norvegicus' proteins encoded by genes that are paralogous to its TP53 gene and their Uniprot function annotations.

Use at

PREFIX up: <http://purl.uniprot.org/core/>
PREFIX orth: <http://purl.org/net/orth#>
PREFIX obo: <http://purl.obolibrary.org/obo/>
PREFIX lscr: <http://purl.org/lscr#>
PREFIX rdfs:<http://www.w3.org/2000/01/rdf-schema#>
SELECT DISTINCT ?PROTEIN ?IS_PARALOGOUS_TO_PROTEIN ?UNIPROT_XREF ?PARALOG_UNIPROT_XREF ?annotation_text WHERE {
	{
		?cluster a orth:ParalogsCluster .
		?cluster orth:hasHomologousMember ?node1 .
		?cluster orth:hasHomologousMember ?node2 .
		?node2 orth:hasHomologousMember* ?PROTEIN .
		?node1 orth:hasHomologousMember* ?IS_PARALOGOUS_TO_PROTEIN .
		?PROTEIN a orth:Protein .
		?PROTEIN orth:organism/obo:RO_0002162/up:scientificName 'Rattus norvegicus' ;
			rdfs:label 'TP53' ;
			lscr:xrefUniprot ?UNIPROT_XREF .
		?IS_PARALOGOUS_TO_PROTEIN a orth:Protein .
		?IS_PARALOGOUS_TO_PROTEIN orth:organism/obo:RO_0002162/up:scientificName 'Rattus norvegicus' .
		?IS_PARALOGOUS_TO_PROTEIN lscr:xrefUniprot ?PARALOG_UNIPROT_XREF .
	}
	SERVICE <https://sparql.uniprot.org/sparql> {
		?PARALOG_UNIPROT_XREF up:annotation ?annotation .
		?annotation a up:Function_Annotation .
		?annotation rdfs:comment ?annotation_text .
	}
}
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
  v5("?IS_PARALOGOUS_TO_PROTEIN"):::projected 
  v7("?PARALOG_UNIPROT_XREF"):::projected 
  v4("?PROTEIN"):::projected 
  v6("?UNIPROT_XREF"):::projected 
  v8("?annotation")
  v9("?annotation_text"):::projected 
  v1("?cluster")
  v2("?node1")
  v3("?node2")
  a1((" "))
  a2((" "))
  a3((" "))
  a4((" "))
  c2(["orth:ParalogsCluster"]):::iri 
  c8(["Rattus norvegicus"]):::literal 
  c14(["up:Function_Annotation"]):::iri 
  c4(["orth:Protein"]):::iri 
  c10(["TP53"]):::literal 
  v1 --"a"-->  c2
  v1 --"orth:hasHomologousMember"-->  v2
  v1 --"orth:hasHomologousMember"-->  v3
  v3 --"orth:hasHomologousMember"-->  v4
  v2 --"orth:hasHomologousMember"-->  v5
  v4 --"a"-->  c4
  v4 --"orth:organism"-->  a1
  a1 --"obo:RO_0002162"-->  a2
  a2 --"up:scientificName"-->  c8
  v4 --"rdfs:label"-->  c10
  v4 --"lscr:xrefUniprot"-->  v6
  v5 --"a"-->  c4
  v5 --"orth:organism"-->  a3
  a3 --"obo:RO_0002162"-->  a4
  a4 --"up:scientificName"-->  c8
  v5 --"lscr:xrefUniprot"-->  v7
  subgraph s1["https://sparql.uniprot.org/sparql"]
    style s1 stroke-width:4px;
    v7 --"up:annotation"-->  v8
    v8 --"a"-->  c14
    v8 --"rdfs:comment"-->  v9
  end