This package has been deprecated

Author message:

Renamed to @ldflex/comunica

ldflex-comunica

3.2.3 • Public • Published

Comunica for LDflex

This library lets you use the Comunica query engine with the LDflex language.

npm version Build Status Dependency Status

Installation

npm install ldflex ldflex-comunica

Usage

const { PathFactory } = require('ldflex');
const { default: ComunicaEngine } = require('ldflex-comunica');

// The JSON-LD context for resolving properties
const context = {
  "@context": {
    "@vocab": "http://xmlns.com/foaf/0.1/",
    "friends": "knows",
  }
};
// The query engine and its source
const queryEngine = new ComunicaEngine('https://ruben.verborgh.org/profile/');
// The object that can create new paths
const paths = new PathFactory({ context, queryEngine });

async function showPerson(person) {
  console.log(`This person is ${await person.name}`);

  console.log(`${await person.givenName} is friends with:`);
  for await (const name of person.friends.givenName)
    console.log(`- ${name}`);
}

const ruben = paths.create({ subject: 'https://ruben.verborgh.org/profile/#me' });
showPerson(ruben);

License

©2018–present Ruben Verborgh, Joachim Van Herwegen. MIT License.

Dependencies (2)

Dev Dependencies (8)

Package Sidebar

Install

npm i ldflex-comunica

Weekly Downloads

4

Version

3.2.3

License

MIT

Unpacked Size

76.9 kB

Total Files

8

Last publish

Collaborators

  • rubenverborgh