SPARQL
Contents:
SPARQL is a W3C standard query language for RDF data. It allows you to query, filter, transform, and update graph-based datasets using a declarative syntax. SPARQL supports complex graph pattern matching across one or more datasets, making it a foundational technology for working with semantic data.
What role does SPARQL play in EDG?
SPARQL is the underlying query and update language in EDG. It provides the backbone for many higher-level features, enabling direct interaction with RDF data stored in asset collections. While most EDG users interact with data through applications, forms, and visualizations, SPARQL remains a powerful and flexible way to access, analyze, and manipulate the data directly.
Comparison to GraphQL in EDG
EDG supports both SPARQL and GraphQL, but they serve different purposes:
SPARQL is a low-level query language. It can query across multiple graphs, federate across endpoints, and leverage the full expressive power of RDF, OWL and SHACL.
GraphQL is more restricted in scope. It queries only SHACL-defined structures, making it friendlier for JSON-based applications and developers unfamiliar with RDF internals.
In short: use GraphQL when working with SHACL structures and application integrations, use SPARQL when you need maximum flexibility.
How can you use SPARQL in EDG?
SPARQL Query Panel – Each asset collection includes SPARQL Query Panel where you can write and run queries (see Using SPARQL to Query and Modify Data)
SPARQL Library Panel – The SPARQL Library Panel lists saved queries.
SPARQL Endpoint – EDG provides an API endpoint to call SPARQL from external services (see Accessing the SPARQL endpoint).
- Call from ADS – In Active Data Shapes (ADS) SPARQL is accessible via:
graph.select and graph.update for SPARQL SELECT and UPDATE
graph.eval to evaluate SPARQL expressions directly
- SPARQL in SHACL – EDG enables advanced validation and enrichment logic using SPARQL inside SHACL shapes:
Custom constraint functions
Using
sh:valueswith SPARQL queries to dynamically generate candidate values
A note on SWP (SPARQL Web Pages)
SPARQL Web Pages (SWP) was an earlier technology for embedding SPARQL into HTML pages. It has been deprecated in favor of newer approaches and should not be used for new projects. Existing SWP implementations should be migrated to modern alternatives (ADS, GraphQL, or application-specific panels).
See also
Contents: