5.0.8 • Published 2 years ago

@agentlab/sparql-jsld-client v5.0.8

Weekly downloads
44
License
GPL-3.0
Repository
github
Last release
2 years ago

SPARQL JSON Schema Linked Data Client

It is an intelligent SPARQL Client with SHACL Shapes support. You could use JSON objects and JSON Schemas to query SPARQL Endpoint, semi-similar to GraphQL style.

Some core features requires:

  • RDF4J REST API in addition to standard SPARQL 1.1 Query and SPARQL 1.1 Update.
  • SHACL Shapes for rdfs classes in server RDF repository.

Features

  • Retrieves lazily SPARQL Prefixes (namespaces) from server (requires RDF4J REST API)
  • Retrieves lazily SHACL Shapes from server, converts it into JSON Schems and UI Schems and caches them
  • Uses JS objects and JSON Schemas (converted from shapes) to generate SPARQL Select Queries and SPARQL Update queries
  • Converts SPARQL Results into JS objects for consumption in apps
  • Have API server RDF repository creation and deletion (requires RDF4J REST API)
  • Supports bulk-load data from local files to server RDF repository (requires RDF4J REST API)

Usage

const provider = new ObjectProviderImpl();
provider.setUser('users:guest');
const client = provider.getClient();
client.setServerUrl('<url to ref4j rest api server>');
await client.createRepositoryAndSetCurrent( {'Repository ID': 'myrepo'} );
await uploadFiles(client, files, rootFolder);

//select all objects by schema (by rdfs class)
const artifacts = await provider.selectObjects('rm:Artifact');

//select all objects by schema (by rdfs class) with explisit schema object
const artifactSchema = await provider.getSchemaByUri('rm:Artifact');
const artifacts2 = await provider.selectObjects(artifactSchema);

//select all objects by schema and conditions
const artifact30000 = await provider.selectObjectsWithTypeInfo(artifactSchema, { identifier: 30000 });
const artifactsFromFolder = await provider.selectObjects(artifactSchema, { assetFolder: 'folders:samples_module' });

Local Development

This project was bootstrapped with TSDX.

For single test run

yarn test -- -t "should select namespaces"

For single testsuite run

yarn test SparqlClient.spec.ts

License

5.0.8

2 years ago

5.0.7

2 years ago

5.0.6

2 years ago

5.0.5

2 years ago

5.0.4

2 years ago

5.0.3

2 years ago

5.0.2

2 years ago

5.0.1

2 years ago

5.0.0-rc.21

3 years ago

5.0.0-rc.20

3 years ago

5.0.0-rc.14

3 years ago

5.0.0-rc.15

3 years ago

5.0.0-rc.16

3 years ago

5.0.0-rc.17

3 years ago

5.0.0-rc.18

3 years ago

5.0.0-rc.19

3 years ago

5.0.0-rc.13

3 years ago

5.0.0-rc.12

3 years ago

5.0.0-rc.11

3 years ago

5.0.0-rc.10

3 years ago

5.0.0-rc.9

3 years ago

5.0.0-rc.6

3 years ago

5.0.0-rc.7

3 years ago

5.0.0-rc.8

3 years ago

5.0.0-rc.5

3 years ago

5.0.0-rc.4

3 years ago

5.0.0-rc.3

3 years ago

5.0.0-rc.2

3 years ago

5.0.0-rc.1

3 years ago

4.1.4

4 years ago

4.1.3

4 years ago

4.1.2

4 years ago

4.1.1

4 years ago

4.1.0

4 years ago

4.0.0

4 years ago

3.0.9

4 years ago

3.0.8

4 years ago

3.0.7

4 years ago

3.0.6

4 years ago

3.0.5

4 years ago

3.0.4

4 years ago

3.0.3

4 years ago

3.0.2

4 years ago

3.0.1

4 years ago

3.0.0

4 years ago

2.0.5

4 years ago

2.0.3

4 years ago

2.0.4

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago