Query RDF documents and SPARQL endpoints using triple patterns, inline SPARQL strings, or stored SPARQL queries. Display results as a table, an auto-complete field, a rolodex, or other built-in or custom views. Federated queries (multiple endpoints) and replaceable query parameters are both supported. Queries are executed by Comunica and support Solid authenticated fetch when available and needed.
| Attribute | Description |
|---|---|
| endpoint | One or moe URI(s) of RDF documents or SPARQL endpoints. (required) |
| sparql | A SPARQL string, or URI of a stored query. |
| pattern | A triple pattern. |
| replaceable parameters | See below for using replaceable parameters. |
| view | The name of a built-in view or URI of a custom view. |
The endpoint attribute is one or more URIs which may point to either RDF documents or SPARQL endpoints.
<sol-query endpoint="https://example.org/data.ttl"></sol-query>
<sol-query endpoint="https://example.org/data.ttl#MySubject"></sol-query>
<sol-query
endpoint="https://example.org/endpoint1, https://example.org/endpoint2"
sparql="https://example.org/myQueryLibrary.ttl#MyQuery"
></sol-query>
The sparql attribute is either a literal SPARQL string, or the URI of a stored SPARQL query.
<sol-query
endpoint="https://example.org/myEndpoint"
sparql="SELECT ?s ?p ?o WHERE {?s ?p ?o.}"
></sol-query>
<sol-query
endpoint="https://example.org/myEndpoint"
sparql="https://example.org/myQueryLibrary.ttl#MyQuery"
></sol-query>
rdfs:comment predicate. Consumers may want to use this SHACL Shape for Query Libraries.
pattern attribute is a string triple pattern.
<sol-query
endpoint="https://example.org/myRDFdocument"
pattern="?person schema:name ?name"
></sol-query>
<sol-query
endpoint="https://example.org/myRDFdocument"
pattern="?person <https://example.org/name> ?name"
></sol-query>
<sol-query
endpoint="..."
sparql="../data/myQueryLibrary.ttl#MyReplaceAbleQuery"
var-limit="2"
></sol-query>
<#MyReplaceAbleQuery>
a sparql:query ;
rdfs:comment """
PREFIX schema: <http://schema.org/>
SELECT ?name ?age ?location WHERE {
?person a schema:Person;
schema:name ?name;
schema:age ?age;
schema:location ?location.
} LIMIT {{limit}}
""" .
The view attribute is the name of a built-in view or the URI of a custom view. Regardless of how the model is gathered (triple pattern, SPARQL, etc.) the results are presented in a view. Here are examples of the same SPARQL query presented in a variety of interactive and non-interactive views