3.2.1 • Published 4 years ago
@ldf/datasource-composite v3.2.1
Linked Data Fragments Server - Composite Datasource
This module contains a composite datasource for the Linked Data Fragments server. It delegates queries to an sequence of other datasources.
This package is a Linked Data Fragments Server module.
Usage in @ldf/server
This package exposes the following config entries:
CompositeDatasource
: A composite datasource that requires at least onecompose
field. Should be used as@type
value.compose
: Refers to an array of datasource id's that should be composed. Should be used as key in aCompositeDatasource
.
Example:
{
"@context": "https://linkedsoftwaredependencies.org/bundles/npm/@ldf/server/^3.0.0/components/context.jsonld",
"@id": "urn:ldf-server:my",
"import": "preset-qpf:config-defaults.json",
"datasources": [
{
"@id": "urn:ldf-server:myCompositeDatasource",
"@type": "CompositeDatasource",
"datasourceTitle": "Composite",
"description": "An example composite datasource",
"datasourcePath": "composite",
"compose": [ "urn:ldf-server:myHdtDatasource", "urn:ldf-server:mySparqlDatasource" ]
},
{
"@id": "urn:ldf-server:myHdtDatasource",
"@type": "HdtDatasource",
"datasourceTitle": "DBpedia 2014",
"description": "DBpedia 2014 with an HDT back-end",
"datasourcePath": "dbpedia",
"hdtFile": "data/dbpedia2014.hdt"
},
{
"@id": "urn:ldf-server:mySparqlDatasource",
"@type": "SparqlDatasource",
"datasourceTitle": "DBpedia (Virtuoso)",
"description": "DBpedia with a Virtuoso back-end",
"datasourcePath": "dbpedia-sparql",
"sparqlEndpoint": "https://dbpedia.org/sparql"
}
]
}
Usage in other packages
When this module is used in a package other than @ldf/server
,
then the JSON-LD context https://linkedsoftwaredependencies.org/contexts/@ldf/datasource-composite.jsonld
must be imported.
For example:
{
"@context": [
"https://linkedsoftwaredependencies.org/bundles/npm/@ldf/core/^3.0.0/components/context.jsonld",
"https://linkedsoftwaredependencies.org/bundles/npm/@ldf/preset-qpf/^3.0.0/components/context.jsonld",
"https://linkedsoftwaredependencies.org/bundles/npm/@ldf/datasource-hdt/^3.0.0/components/context.jsonld",
"https://linkedsoftwaredependencies.org/bundles/npm/@ldf/datasource-sparql/^3.0.0/components/context.jsonld",
"https://linkedsoftwaredependencies.org/bundles/npm/@ldf/datasource-composite/^3.0.0/components/context.jsonld",
],
// Same as above...
}
License
The Linked Data Fragments server is written by Ruben Verborgh, Miel Vander Sande, Ruben Taelman and colleagues.
This code is copyrighted by Ghent University – imec and released under the MIT license.