Returns a paginated list of all ancestor terms (transitive superclasses) of a specific term.
Parameters (2)
iri(string, path, required)
URL-encoded IRI of the term
ontologyId(string, path, required)
The ontology ID
Examples (3)
Get ancestors of a GO biological process termcurl
curl 'https://www.ebi.ac.uk/ols4/api/ontologies/go/terms/http%3A%2F%2Fpurl.obolibrary.org%2Fobo%2FGO_0008150/ancestors' \
-H 'Accept: application/json' \
-d '"<!doctype html><html lang=\"en\"><head><title>HTTP Status 400 – Bad Request</title><style type=\"text/css\">body {font-family:Tahoma,Arial,sans-serif;} h1, h2, h3, b {color:white;background-color:#525D76;} h1 {font-size:22px;} h2 {font-size:16px;} h3 {font-size:14px;} p {font-size:12px;} a {color:black;} .line {height:1px;background-color:#525D76;border:none;}</style></head><body><h1>HTTP Status 400 – Bad Request</h1></body></html>"'
import requests
resp = requests.get(
"https://www.ebi.ac.uk/ols4/api/ontologies/go/terms/http%3A%2F%2Fpurl.obolibrary.org%2Fobo%2FGO_0008150/ancestors",
headers={
'Accept': 'application/json',
},
json="<!doctype html><html lang=\"en\"><head><title>HTTP Status 400 – Bad Request</title><style type=\"text/css\">body {font-family:Tahoma,Arial,sans-serif;} h1, h2, h3, b {color:white;background-color:#525D76;} h1 {font-size:22px;} h2 {font-size:16px;} h3 {font-size:14px;} p {font-size:12px;} a {color:black;} .line {height:1px;background-color:#525D76;border:none;}</style></head><body><h1>HTTP Status 400 – Bad Request</h1></body></html>",
)
data = resp.json()
import zingu_apis
api = zingu_apis.api("embl-ebi-ontology-lookup-service-ols")
result = api.fetch("ontologies/{ontologyId}/terms/{iri}/ancestors")
for item in result:
print(item)
const body = "<!doctype html><html lang=\"en\"><head><title>HTTP Status 400 – Bad Request</title><style type=\"text/css\">body {font-family:Tahoma,Arial,sans-serif;} h1, h2, h3, b {color:white;background-color:#525D76;} h1 {font-size:22px;} h2 {font-size:16px;} h3 {font-size:14px;} p {font-size:12px;} a {color:black;} .line {height:1px;background-color:#525D76;border:none;}</style></head><body><h1>HTTP Status 400 – Bad Request</h1></body></html>";
const resp = await fetch("https://www.ebi.ac.uk/ols4/api/ontologies/go/terms/http%3A%2F%2Fpurl.obolibrary.org%2Fobo%2FGO_0008150/ancestors", {
headers: {
"Accept": "application/json",
},
body: JSON.stringify(body),
});
const data = await resp.json();
Get ancestors of a Human Phenotype Ontology termcurl
curl 'https://www.ebi.ac.uk/ols4/api/ontologies/hp/terms/http%3A%2F%2Fpurl.obolibrary.org%2Fobo%2FHP_0000118/ancestors' \
-H 'Accept: application/json' \
-d '"<!doctype html><html lang=\"en\"><head><title>HTTP Status 400 – Bad Request</title><style type=\"text/css\">body {font-family:Tahoma,Arial,sans-serif;} h1, h2, h3, b {color:white;background-color:#525D76;} h1 {font-size:22px;} h2 {font-size:16px;} h3 {font-size:14px;} p {font-size:12px;} a {color:black;} .line {height:1px;background-color:#525D76;border:none;}</style></head><body><h1>HTTP Status 400 – Bad Request</h1></body></html>"'
import requests
resp = requests.get(
"https://www.ebi.ac.uk/ols4/api/ontologies/hp/terms/http%3A%2F%2Fpurl.obolibrary.org%2Fobo%2FHP_0000118/ancestors",
headers={
'Accept': 'application/json',
},
json="<!doctype html><html lang=\"en\"><head><title>HTTP Status 400 – Bad Request</title><style type=\"text/css\">body {font-family:Tahoma,Arial,sans-serif;} h1, h2, h3, b {color:white;background-color:#525D76;} h1 {font-size:22px;} h2 {font-size:16px;} h3 {font-size:14px;} p {font-size:12px;} a {color:black;} .line {height:1px;background-color:#525D76;border:none;}</style></head><body><h1>HTTP Status 400 – Bad Request</h1></body></html>",
)
data = resp.json()
import zingu_apis
api = zingu_apis.api("embl-ebi-ontology-lookup-service-ols")
result = api.fetch("ontologies/{ontologyId}/terms/{iri}/ancestors")
for item in result:
print(item)
const body = "<!doctype html><html lang=\"en\"><head><title>HTTP Status 400 – Bad Request</title><style type=\"text/css\">body {font-family:Tahoma,Arial,sans-serif;} h1, h2, h3, b {color:white;background-color:#525D76;} h1 {font-size:22px;} h2 {font-size:16px;} h3 {font-size:14px;} p {font-size:12px;} a {color:black;} .line {height:1px;background-color:#525D76;border:none;}</style></head><body><h1>HTTP Status 400 – Bad Request</h1></body></html>";
const resp = await fetch("https://www.ebi.ac.uk/ols4/api/ontologies/hp/terms/http%3A%2F%2Fpurl.obolibrary.org%2Fobo%2FHP_0000118/ancestors", {
headers: {
"Accept": "application/json",
},
body: JSON.stringify(body),
});
const data = await resp.json();
Get ancestors of a MONDO disease termcurl
curl 'https://www.ebi.ac.uk/ols4/api/ontologies/mondo/terms/http%3A%2F%2Fpurl.obolibrary.org%2Fobo%2FMONDO_0000001/ancestors' \
-H 'Accept: application/json' \
-d '"<!doctype html><html lang=\"en\"><head><title>HTTP Status 400 – Bad Request</title><style type=\"text/css\">body {font-family:Tahoma,Arial,sans-serif;} h1, h2, h3, b {color:white;background-color:#525D76;} h1 {font-size:22px;} h2 {font-size:16px;} h3 {font-size:14px;} p {font-size:12px;} a {color:black;} .line {height:1px;background-color:#525D76;border:none;}</style></head><body><h1>HTTP Status 400 – Bad Request</h1></body></html>"'
import requests
resp = requests.get(
"https://www.ebi.ac.uk/ols4/api/ontologies/mondo/terms/http%3A%2F%2Fpurl.obolibrary.org%2Fobo%2FMONDO_0000001/ancestors",
headers={
'Accept': 'application/json',
},
json="<!doctype html><html lang=\"en\"><head><title>HTTP Status 400 – Bad Request</title><style type=\"text/css\">body {font-family:Tahoma,Arial,sans-serif;} h1, h2, h3, b {color:white;background-color:#525D76;} h1 {font-size:22px;} h2 {font-size:16px;} h3 {font-size:14px;} p {font-size:12px;} a {color:black;} .line {height:1px;background-color:#525D76;border:none;}</style></head><body><h1>HTTP Status 400 – Bad Request</h1></body></html>",
)
data = resp.json()
import zingu_apis
api = zingu_apis.api("embl-ebi-ontology-lookup-service-ols")
result = api.fetch("ontologies/{ontologyId}/terms/{iri}/ancestors")
for item in result:
print(item)
const body = "<!doctype html><html lang=\"en\"><head><title>HTTP Status 400 – Bad Request</title><style type=\"text/css\">body {font-family:Tahoma,Arial,sans-serif;} h1, h2, h3, b {color:white;background-color:#525D76;} h1 {font-size:22px;} h2 {font-size:16px;} h3 {font-size:14px;} p {font-size:12px;} a {color:black;} .line {height:1px;background-color:#525D76;border:none;}</style></head><body><h1>HTTP Status 400 – Bad Request</h1></body></html>";
const resp = await fetch("https://www.ebi.ac.uk/ols4/api/ontologies/mondo/terms/http%3A%2F%2Fpurl.obolibrary.org%2Fobo%2FMONDO_0000001/ancestors", {
headers: {
"Accept": "application/json",
},
body: JSON.stringify(body),
});
const data = await resp.json();