ldflex-comunica

WebJar for ldflex-comunica

License

License

MIT
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

ldflex-comunica
Last Version

Last Version

3.0.0
Release Date

Release Date

Type

Type

jar
Description

Description

ldflex-comunica
WebJar for ldflex-comunica
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

https://github.com/RubenVerborgh/LDflex-Comunica

Download ldflex-comunica

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.npm/ldflex-comunica/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>ldflex-comunica</artifactId>
    <version>3.0.0</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/ldflex-comunica/
implementation 'org.webjars.npm:ldflex-comunica:3.0.0'
// https://jarcasting.com/artifacts/org.webjars.npm/ldflex-comunica/
implementation ("org.webjars.npm:ldflex-comunica:3.0.0")
'org.webjars.npm:ldflex-comunica:jar:3.0.0'
<dependency org="org.webjars.npm" name="ldflex-comunica" rev="3.0.0">
  <artifact name="ldflex-comunica" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='ldflex-comunica', version='3.0.0')
)
libraryDependencies += "org.webjars.npm" % "ldflex-comunica" % "3.0.0"
[org.webjars.npm/ldflex-comunica "3.0.0"]

Dependencies

compile (3)

Group / Artifact Type Version
org.webjars.npm : comunica__actor-http-solid-auth-fetch jar [1.0.0,2)
org.webjars.npm : comunica__actor-init-sparql jar [1.6.0,2)
org.webjars.npm : comunica__actor-rdf-resolve-quad-pattern-rdfjs-source jar [1.6.0,2)

Project Modules

There are no modules declared in this project.

Comunica for LDflex

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

npm version Build Status Coverage Status Dependency Status

Installation

npm install ldflex @ldflex/comunica

Usage

const { PathFactory } = require('ldflex');
const { default: ComunicaEngine } = require('@ldflex/comunica');
const { namedNode } = require('@rdfjs/data-model');

// 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: namedNode('https://ruben.verborgh.org/profile/#me'),
});
showPerson(ruben);

License

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

Versions

Version
3.0.0