SPARQLAdapter
Auto-generated config schema for the current JBrowse release — see the
config guide for concepts. Provided by the rdf plugin.
View source.
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 }',
},
}
See the Config slots section below for all available configuration fields.
fetches features from a SPARQL endpoint, substituting the queried region into a query template
Related links
- Track: FeatureTrack
- Display: LinearArcDisplay
- Display: LinearBasicDisplay
- Display: LinearMultiRowFeatureDisplay
- Display: LinearScoreDisplay
Config slots
These slots go inside the track's adapter:
"adapter": { "type": "SPARQLAdapter", ... }. This adapter 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" |