VMH SPARQL Endpoint

The VMH SPARQL endpoint exposes metabolites, reactions, diseases, genes, microbes, HPO terms, food items, nutrients, and diets as RDF triples queryable with standard SPARQL 1.1.

Endpoint: https://delta.vmh.life/api/public/sparql
Methods: GET (?query=…) · POST (application/sparql-query)
Output formats: json (default) · csv · tsv · N-Triples (CONSTRUCT/DESCRIBE)
Auth: None required (subject to rate limit: 100 req/hr)

Common prefixes are auto-injected — no need to declare PREFIX vmh:, PREFIX rdfs:, or PREFIX xsd: in your queries.

List human metabolites
Metabolite

Retrieve the first 10 metabolites present in human metabolism.

SPARQL Query
SELECT ?met ?abbr ?name WHERE {
  ?met a vmh:Metabolite ;
       vmh:isHuman "true"^^xsd:boolean ;
       vmh:abbreviation ?abbr ;
       rdfs:label ?name .
} LIMIT 10
Format:
Python Code
import requests

endpoint = "https://delta.vmh.life/api/public/sparql"
query = """
SELECT ?met ?abbr ?name WHERE {
  ?met a vmh:Metabolite ;
       vmh:isHuman "true"^^xsd:boolean ;
       vmh:abbreviation ?abbr ;
       rdfs:label ?name .
} LIMIT 10
"""

params = {"query": query}

response = requests.get(endpoint, params=params, timeout=30)
response.raise_for_status()
data = response.json()

# Print variable names and first binding
print("Variables:", data["head"]["vars"])
for binding in data["results"]["bindings"][:5]:
    print({k: v["value"] for k, v in binding.items()})
Look up a metabolite by abbreviation
Metabolite

Fetch all properties of D-Glucose (abbreviation: glc_D).

SPARQL Query
SELECT ?property ?value WHERE {
  ?met vmh:abbreviation "glc_D" .
  ?met ?property ?value .
}
Format:
Python Code
import requests

endpoint = "https://delta.vmh.life/api/public/sparql"
query = """
SELECT ?property ?value WHERE {
  ?met vmh:abbreviation "glc_D" .
  ?met ?property ?value .
}
"""

params = {"query": query}

response = requests.get(endpoint, params=params, timeout=30)
response.raise_for_status()
data = response.json()

# Print variable names and first binding
print("Variables:", data["head"]["vars"])
for binding in data["results"]["bindings"][:5]:
    print({k: v["value"] for k, v in binding.items()})
Find metabolites with an InChIKey
Metabolite

Return metabolites that have an InChIKey recorded.

SPARQL Query
SELECT ?abbr ?name ?inchiKey WHERE {
  ?met a vmh:Metabolite ;
       vmh:abbreviation ?abbr ;
       rdfs:label ?name ;
       vmh:inchiKey ?inchiKey .
} LIMIT 20
Format:
Python Code
import requests

endpoint = "https://delta.vmh.life/api/public/sparql"
query = """
SELECT ?abbr ?name ?inchiKey WHERE {
  ?met a vmh:Metabolite ;
       vmh:abbreviation ?abbr ;
       rdfs:label ?name ;
       vmh:inchiKey ?inchiKey .
} LIMIT 20
"""

params = {"query": query}

response = requests.get(endpoint, params=params, timeout=30)
response.raise_for_status()
data = response.json()

# Print variable names and first binding
print("Variables:", data["head"]["vars"])
for binding in data["results"]["bindings"][:5]:
    print({k: v["value"] for k, v in binding.items()})
Reactions in glycolysis
Reaction

Find all reactions whose subsystem contains 'glycolysis'.

SPARQL Query
SELECT ?abbr ?description ?formula WHERE {
  ?rxn a vmh:Reaction ;
       vmh:abbreviation ?abbr ;
       rdfs:label ?description ;
       vmh:formula ?formula ;
       vmh:subsystem ?sub .
  FILTER(CONTAINS(LCASE(?sub), "glycolysis"))
} ORDER BY ?abbr
Format:
Python Code
import requests

endpoint = "https://delta.vmh.life/api/public/sparql"
query = """
SELECT ?abbr ?description ?formula WHERE {
  ?rxn a vmh:Reaction ;
       vmh:abbreviation ?abbr ;
       rdfs:label ?description ;
       vmh:formula ?formula ;
       vmh:subsystem ?sub .
  FILTER(CONTAINS(LCASE(?sub), "glycolysis"))
} ORDER BY ?abbr
"""

params = {"query": query}

response = requests.get(endpoint, params=params, timeout=30)
response.raise_for_status()
data = response.json()

# Print variable names and first binding
print("Variables:", data["head"]["vars"])
for binding in data["results"]["bindings"][:5]:
    print({k: v["value"] for k, v in binding.items()})
Reactions shared between human and microbe
Reaction

Find reactions annotated as both human and microbial.

SPARQL Query
SELECT ?abbr ?sub WHERE {
  ?rxn a vmh:Reaction ;
       vmh:abbreviation ?abbr ;
       vmh:subsystem ?sub ;
       vmh:isHuman "true"^^xsd:boolean ;
       vmh:isMicrobe "true"^^xsd:boolean .
} LIMIT 25
Format:
Python Code
import requests

endpoint = "https://delta.vmh.life/api/public/sparql"
query = """
SELECT ?abbr ?sub WHERE {
  ?rxn a vmh:Reaction ;
       vmh:abbreviation ?abbr ;
       vmh:subsystem ?sub ;
       vmh:isHuman "true"^^xsd:boolean ;
       vmh:isMicrobe "true"^^xsd:boolean .
} LIMIT 25
"""

params = {"query": query}

response = requests.get(endpoint, params=params, timeout=30)
response.raise_for_status()
data = response.json()

# Print variable names and first binding
print("Variables:", data["head"]["vars"])
for binding in data["results"]["bindings"][:5]:
    print({k: v["value"] for k, v in binding.items()})
Diseases with an OMIM ID
Disease

List diseases that have an associated OMIM disease identifier.

SPARQL Query
SELECT ?abbr ?name ?omim WHERE {
  ?d a vmh:Disease ;
     vmh:abbreviation ?abbr ;
     rdfs:label ?name ;
     vmh:omimDisease ?omim .
} ORDER BY ?abbr LIMIT 20
Format:
Python Code
import requests

endpoint = "https://delta.vmh.life/api/public/sparql"
query = """
SELECT ?abbr ?name ?omim WHERE {
  ?d a vmh:Disease ;
     vmh:abbreviation ?abbr ;
     rdfs:label ?name ;
     vmh:omimDisease ?omim .
} ORDER BY ?abbr LIMIT 20
"""

params = {"query": query}

response = requests.get(endpoint, params=params, timeout=30)
response.raise_for_status()
data = response.json()

# Print variable names and first binding
print("Variables:", data["head"]["vars"])
for binding in data["results"]["bindings"][:5]:
    print({k: v["value"] for k, v in binding.items()})
Inborn errors of metabolism by IEM code
Disease

Find diseases that have an IEM code assigned.

SPARQL Query
SELECT ?abbr ?name ?iemCode WHERE {
  ?d a vmh:Disease ;
     vmh:abbreviation ?abbr ;
     rdfs:label ?name ;
     vmh:iemCode ?iemCode .
} ORDER BY ?iemCode
Format:
Python Code
import requests

endpoint = "https://delta.vmh.life/api/public/sparql"
query = """
SELECT ?abbr ?name ?iemCode WHERE {
  ?d a vmh:Disease ;
     vmh:abbreviation ?abbr ;
     rdfs:label ?name ;
     vmh:iemCode ?iemCode .
} ORDER BY ?iemCode
"""

params = {"query": query}

response = requests.get(endpoint, params=params, timeout=30)
response.raise_for_status()
data = response.json()

# Print variable names and first binding
print("Variables:", data["head"]["vars"])
for binding in data["results"]["bindings"][:5]:
    print({k: v["value"] for k, v in binding.items()})
List genes
Gene

Retrieve gene symbols and Entrez IDs.

SPARQL Query
SELECT ?symbol ?entrezId ?name WHERE {
  ?g a vmh:Gene ;
     vmh:symbol ?symbol ;
     vmh:entrezId ?entrezId ;
     rdfs:label ?name .
} ORDER BY ?symbol LIMIT 20
Format:
Python Code
import requests

endpoint = "https://delta.vmh.life/api/public/sparql"
query = """
SELECT ?symbol ?entrezId ?name WHERE {
  ?g a vmh:Gene ;
     vmh:symbol ?symbol ;
     vmh:entrezId ?entrezId ;
     rdfs:label ?name .
} ORDER BY ?symbol LIMIT 20
"""

params = {"query": query}

response = requests.get(endpoint, params=params, timeout=30)
response.raise_for_status()
data = response.json()

# Print variable names and first binding
print("Variables:", data["head"]["vars"])
for binding in data["results"]["bindings"][:5]:
    print({k: v["value"] for k, v in binding.items()})
Gram-negative microbes
Microbe

Find microbes with a negative Gram stain.

SPARQL Query
SELECT ?organism ?phylum ?genus WHERE {
  ?m a vmh:Microbe ;
     vmh:organism ?organism ;
     vmh:phylum ?phylum ;
     vmh:genus ?genus ;
     vmh:gramStain ?gram .
  FILTER(LCASE(?gram) = "negative")
} ORDER BY ?organism LIMIT 20
Format:
Python Code
import requests

endpoint = "https://delta.vmh.life/api/public/sparql"
query = """
SELECT ?organism ?phylum ?genus WHERE {
  ?m a vmh:Microbe ;
     vmh:organism ?organism ;
     vmh:phylum ?phylum ;
     vmh:genus ?genus ;
     vmh:gramStain ?gram .
  FILTER(LCASE(?gram) = "negative")
} ORDER BY ?organism LIMIT 20
"""

params = {"query": query}

response = requests.get(endpoint, params=params, timeout=30)
response.raise_for_status()
data = response.json()

# Print variable names and first binding
print("Variables:", data["head"]["vars"])
for binding in data["results"]["bindings"][:5]:
    print({k: v["value"] for k, v in binding.items()})
Count microbes per phylum
Microbe

Aggregate microbes by phylum.

SPARQL Query
SELECT ?phylum (COUNT(?m) AS ?count) WHERE {
  ?m a vmh:Microbe ;
     vmh:phylum ?phylum .
} GROUP BY ?phylum ORDER BY DESC(?count)
Format:
Python Code
import requests

endpoint = "https://delta.vmh.life/api/public/sparql"
query = """
SELECT ?phylum (COUNT(?m) AS ?count) WHERE {
  ?m a vmh:Microbe ;
     vmh:phylum ?phylum .
} GROUP BY ?phylum ORDER BY DESC(?count)
"""

params = {"query": query}

response = requests.get(endpoint, params=params, timeout=30)
response.raise_for_status()
data = response.json()

# Print variable names and first binding
print("Variables:", data["head"]["vars"])
for binding in data["results"]["bindings"][:5]:
    print({k: v["value"] for k, v in binding.items()})
Search HPO terms by keyword
HPO

Find HPO terms whose label contains 'seizure'.

SPARQL Query
SELECT ?hpoId ?name ?definition WHERE {
  ?h a vmh:HPOTerm ;
     vmh:hpoId ?hpoId ;
     rdfs:label ?name .
  OPTIONAL { ?h vmh:definition ?definition }
  FILTER(CONTAINS(LCASE(?name), "seizure"))
}
Format:
Python Code
import requests

endpoint = "https://delta.vmh.life/api/public/sparql"
query = """
SELECT ?hpoId ?name ?definition WHERE {
  ?h a vmh:HPOTerm ;
     vmh:hpoId ?hpoId ;
     rdfs:label ?name .
  OPTIONAL { ?h vmh:definition ?definition }
  FILTER(CONTAINS(LCASE(?name), "seizure"))
}
"""

params = {"query": query}

response = requests.get(endpoint, params=params, timeout=30)
response.raise_for_status()
data = response.json()

# Print variable names and first binding
print("Variables:", data["head"]["vars"])
for binding in data["results"]["bindings"][:5]:
    print({k: v["value"] for k, v in binding.items()})
List food items
Food

Retrieve food names and product types.

SPARQL Query
SELECT ?foodId ?name ?productType WHERE {
  ?f a vmh:Food ;
     vmh:foodId ?foodId ;
     rdfs:label ?name .
  OPTIONAL { ?f vmh:productType ?productType }
} ORDER BY ?name LIMIT 20
Format:
Python Code
import requests

endpoint = "https://delta.vmh.life/api/public/sparql"
query = """
SELECT ?foodId ?name ?productType WHERE {
  ?f a vmh:Food ;
     vmh:foodId ?foodId ;
     rdfs:label ?name .
  OPTIONAL { ?f vmh:productType ?productType }
} ORDER BY ?name LIMIT 20
"""

params = {"query": query}

response = requests.get(endpoint, params=params, timeout=30)
response.raise_for_status()
data = response.json()

# Print variable names and first binding
print("Variables:", data["head"]["vars"])
for binding in data["results"]["bindings"][:5]:
    print({k: v["value"] for k, v in binding.items()})
Nutrients for a specific food
FoodNutrient

Find all nutrient values recorded for apple (food_id: F001). Replace F001 with the actual food_id.

SPARQL Query
SELECT ?nutrientLabel ?value ?unit ?category WHERE {
  ?obs a vmh:NutritionObservation ;
       vmh:food ?food ;
       vmh:nutrient ?nutrient ;
       vmh:value ?value .
  ?food vmh:foodId "F001" .
  ?nutrient rdfs:label ?nutrientLabel ;
            vmh:category ?category .
  OPTIONAL { ?obs vmh:unit ?unit }
} ORDER BY ?category ?nutrientLabel
Format:
Python Code
import requests

endpoint = "https://delta.vmh.life/api/public/sparql"
query = """
SELECT ?nutrientLabel ?value ?unit ?category WHERE {
  ?obs a vmh:NutritionObservation ;
       vmh:food ?food ;
       vmh:nutrient ?nutrient ;
       vmh:value ?value .
  ?food vmh:foodId "F001" .
  ?nutrient rdfs:label ?nutrientLabel ;
            vmh:category ?category .
  OPTIONAL { ?obs vmh:unit ?unit }
} ORDER BY ?category ?nutrientLabel
"""

params = {"query": query}

response = requests.get(endpoint, params=params, timeout=30)
response.raise_for_status()
data = response.json()

# Print variable names and first binding
print("Variables:", data["head"]["vars"])
for binding in data["results"]["bindings"][:5]:
    print({k: v["value"] for k, v in binding.items()})
Count nutrients per category
Nutrient

Summarise how many distinct nutrients exist in each category.

SPARQL Query
SELECT ?category (COUNT(DISTINCT ?n) AS ?count) WHERE {
  ?n a vmh:Nutrient ;
     vmh:category ?category .
} GROUP BY ?category ORDER BY DESC(?count)
Format:
Python Code
import requests

endpoint = "https://delta.vmh.life/api/public/sparql"
query = """
SELECT ?category (COUNT(DISTINCT ?n) AS ?count) WHERE {
  ?n a vmh:Nutrient ;
     vmh:category ?category .
} GROUP BY ?category ORDER BY DESC(?count)
"""

params = {"query": query}

response = requests.get(endpoint, params=params, timeout=30)
response.raise_for_status()
data = response.json()

# Print variable names and first binding
print("Variables:", data["head"]["vars"])
for binding in data["results"]["bindings"][:5]:
    print({k: v["value"] for k, v in binding.items()})
List all diets with energy content
Diet

Show diet names and their total energy in kcal.

SPARQL Query
SELECT ?name ?kcal WHERE {
  ?d a vmh:Diet ;
     vmh:dietName ?name ;
     vmh:totalEnergyKcal ?kcal .
} ORDER BY DESC(?kcal)
Format:
Python Code
import requests

endpoint = "https://delta.vmh.life/api/public/sparql"
query = """
SELECT ?name ?kcal WHERE {
  ?d a vmh:Diet ;
     vmh:dietName ?name ;
     vmh:totalEnergyKcal ?kcal .
} ORDER BY DESC(?kcal)
"""

params = {"query": query}

response = requests.get(endpoint, params=params, timeout=30)
response.raise_for_status()
data = response.json()

# Print variable names and first binding
print("Variables:", data["head"]["vars"])
for binding in data["results"]["bindings"][:5]:
    print({k: v["value"] for k, v in binding.items()})
Diet macronutrient breakdown
Diet

Compare percentage energy from carbs, proteins and lipids across all diets.

SPARQL Query
SELECT ?name ?carbPerc ?proteinPerc ?lipidPerc WHERE {
  ?d a vmh:Diet ;
     vmh:dietName ?name ;
     vmh:carbohydratesPercEnergy ?carbPerc ;
     vmh:proteinsPercEnergy ?proteinPerc ;
     vmh:lipidsPercEnergy ?lipidPerc .
} ORDER BY DESC(?carbPerc)
Format:
Python Code
import requests

endpoint = "https://delta.vmh.life/api/public/sparql"
query = """
SELECT ?name ?carbPerc ?proteinPerc ?lipidPerc WHERE {
  ?d a vmh:Diet ;
     vmh:dietName ?name ;
     vmh:carbohydratesPercEnergy ?carbPerc ;
     vmh:proteinsPercEnergy ?proteinPerc ;
     vmh:lipidsPercEnergy ?lipidPerc .
} ORDER BY DESC(?carbPerc)
"""

params = {"query": query}

response = requests.get(endpoint, params=params, timeout=30)
response.raise_for_status()
data = response.json()

# Print variable names and first binding
print("Variables:", data["head"]["vars"])
for binding in data["results"]["bindings"][:5]:
    print({k: v["value"] for k, v in binding.items()})
ASK — does a metabolite exist?
ASK

Boolean check: is 'atp' a known VMH metabolite?

SPARQL Query
ASK {
  ?m vmh:abbreviation "atp" .
}
Format:
Python Code
import requests

endpoint = "https://delta.vmh.life/api/public/sparql"
query = """
ASK {
  ?m vmh:abbreviation "atp" .
}
"""

params = {"query": query}

response = requests.get(endpoint, params=params, timeout=30)
response.raise_for_status()
data = response.json()

# Print variable names and first binding
print("Variables:", data["head"]["vars"])
for binding in data["results"]["bindings"][:5]:
    print({k: v["value"] for k, v in binding.items()})
CONSTRUCT — disease subgraph
CONSTRUCT

Build an RDF subgraph of all diseases with their OMIM IDs (returns N-Triples).

SPARQL Query
CONSTRUCT {
  ?d a vmh:Disease ;
     rdfs:label ?name ;
     vmh:omimDisease ?omim .
} WHERE {
  ?d a vmh:Disease ;
     rdfs:label ?name ;
     vmh:omimDisease ?omim .
} LIMIT 50
Python Code
import requests

endpoint = "https://delta.vmh.life/api/public/sparql"
query = """
CONSTRUCT {
  ?d a vmh:Disease ;
     rdfs:label ?name ;
     vmh:omimDisease ?omim .
} WHERE {
  ?d a vmh:Disease ;
     rdfs:label ?name ;
     vmh:omimDisease ?omim .
} LIMIT 50
"""

params = {"query": query}
    params["format"] = "ntriples"

response = requests.get(endpoint, params=params, timeout=30)
response.raise_for_status()
data = response.json()

print(response.text[:500])
Feedback