Querying with SPARQL
SPARQL is to a graph what SQL is to tables. If you can write aSELECT with joins, you can write SPARQL — the shape is SELECT ?vars WHERE { pattern } where the pattern is a set of subject–predicate–object triples that share variables.
Where to Run Queries
Glossary-scoped SPARQL runs against the database-primary glossary model — it works with RDF storage off, and cannot reach other assets, external datasets, or
SERVICE endpoints. Catalog-wide SPARQL runs against the triple store and is admin-only.
Named Graphs
Always scope instance-data queries to the knowledge graph. Ontology and shapes triples live elsewhere, so an unscoped?s ?p ?o returns schema noise.
Prefixes
The console pre-populates these; include them in API calls yourself.The Vocabulary You Will Use Most
Entity IRIs followhttps://open-metadata.org/entity/{entityType}/{uuid}.
Limits
Every read runs behind an admission guard:
Writes (
INSERT, DELETE, DROP, LOAD, CLEAR, CREATE) are rejected on the read endpoints. POST /api/v1/rdf/sparql/update exists for admins, but see the warning below.
Federation (SERVICE clauses to external endpoints) is disabled by default. When enabled, target URIs must appear verbatim in an allowlist — trailing slashes matter.
Cookbook
Discovery
Governance
Lineage
prov:wasDerivedFrom+ is a property path — SPARQL’s transitive traversal operator. It is the single feature that makes graph queries worth the switch, and it has no clean SQL equivalent. If you enable the transitive lineage closure inference rule, the closure is materialized and you can drop the +.The Ontology, Applied
Structure
Calling the API
json (default), xml, csv, tsv for SELECT/ASK; turtle, jsonld, ntriples, rdfxml for CONSTRUCT/DESCRIBE.
Performance Notes
- Always scope to the named graph. Unscoped patterns scan schema and shapes as well.
LIMITearly. The guard truncates you at 1,000 rows by default anyway; be explicit.- Bind the most selective triple first. Start from a specific IRI or an indexed literal like
om:fullyQualifiedName, not from?s a om:Table. - Property paths are powerful and expensive.
+and*over a large lineage graph can hit the 30-second timeout. If you run one regularly, materialize it as an inference rule instead. - Prefer
FILTER NOT EXISTSoverOPTIONAL+!BOUND. Same result, better plan.
Next
Reasoning & Validation
Materialize the closures you keep re-computing.
Graph Insights
Pre-computed importance, communities, and paths.