Query data¶
A dataset's left-hand sidebar lists the ways to query it under Data queries. SPARQL is there by default; Elasticsearch and GraphQL appear only where the dataset or the instance supports them.
Run a SPARQL query¶
- Open the dataset and click SPARQL under Data queries.
- Write the query in the editor, which autocompletes and reports errors as you type.
- Pick what runs it from the Endpoint menu. Speedy, TriplyDB's built-in engine, is the default and needs no setup. Any SPARQL service the dataset runs is listed beside it; see Manage services for starting one.
- Click Execute query, or press Ctrl+Enter (⌘+Enter on a Mac).
The results appear below the editor, where they can be shown as a table or as one of the other visualizations on offer. To keep the query, click Save query; see Work with saved queries for what a saved query gives you.
New to SPARQL? Start with SPARQL: the basics.
Search the text with Elasticsearch¶
Elasticsearch appears under Data queries only when the dataset runs an Elasticsearch service; see Manage services.
- Open the dataset and click Elasticsearch.
- Type a term in the Search field and press Enter.
This works like a search engine: it returns every node that contains the term, or contains it in one of its properties. For more control, write a query in the Elasticsearch Query DSL instead.
Query with GraphQL¶
GraphQL appears under Data queries on instances where it is enabled. It queries a schema that TriplyDB generates from the SHACL shapes in the dataset, so the dataset needs those shapes first.
- Open the dataset and click GraphQL.
- Write the query and run it.
For the schema, the queries it accepts, filtering and pagination, see GraphQL.
Related¶
- Work with saved queries — saving, versioning and sharing a query
- Paginate SPARQL results — getting every result, not the first page
- SPARQL introspection functions — functions only Speedy supports