SPARQLAdapter
Auto-generated from the config schema in the source — see the config guide for concepts. Provided by the rdf plugin. View source.
Fetches features from a SPARQL endpoint, substituting the queried region into a query template.
Example usage
{refName}, {start} and {end} are substituted per request, so the
endpoint is queried for the visible window rather than the whole genome. The
result columns become feature fields, so the query has to select at least
?start, ?end and a ?uniqueID:
{
type: 'FeatureTrack',
trackId: 'my_track',
name: 'My track',
assemblyNames: ['hg38'],
adapter: {
type: 'SPARQLAdapter',
endpoint: { uri: 'https://example.com/sparql' },
queryTemplate: `SELECT ?uniqueID ?start ?end ?strand ?name WHERE {
?f a :Feature ; :ref "{refName}" ; :start ?start ; :end ?end .
FILTER(?start < {end} && ?end > {start})
}`,
refNamesQueryTemplate: 'SELECT DISTINCT ?refName WHERE { ?f :ref ?refName }',
},
}Related links
- Track: FeatureTrack
- Display: LinearBasicDisplay
- Display: LinearManhattanDisplay
- Display: LinearMarkDisplay
- Display: LinearMultiRowFeatureDisplay
- Display: LinearScoreDisplay
- Display: LinearWiggleDisplay
Config slots
Adapter slots go inside the track's adapter: "adapter": { "type": "SPARQLAdapter", ... }. SPARQLAdapter has no uri shorthand — give it the location slots below. Slot types (fileLocation, frozen, ...) are explained in the config slot types reference. Slots a base configuration contributes are listed here too, so this table is the whole surface.
| Slot | Description |
|---|---|
endpointfileLocation = | URL of the SPARQL endpoint |
queryTemplatetext = '' | SPARQL query where {start} {end} and {refName} will get replaced for each call |
refNamesQueryTemplatetext = '' | SPARQL query that returns the possible refNames in a ?refName column |
refNamesstringArray = [] | Possible refNames used by the SPARQL endpoint (ignored if "refNamesQueryTemplate" is provided) |
additionalQueryParamsstringArray = [] | Additional parameters to add to the query, e.g. "format=JSON" |