@ldf/datasource-composite

3.2.1 • Public • Published

Linked Data Fragments Server - Composite Datasource

npm version

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 one compose 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 a CompositeDatasource.

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.

Readme

Keywords

none

Package Sidebar

Install

npm i @ldf/datasource-composite

Weekly Downloads

10

Version

3.2.1

License

MIT

Unpacked Size

16.3 kB

Total Files

8

Last publish

Collaborators

  • rubenverborgh
  • rubensworks