1.9.3 โ€ข Published 11 months ago

@innotrade/enapso-graphdb-client v1.9.3

Weekly downloads
52
License
Apache-2.0
Repository
github
Last release
11 months ago

ENAPSO

ENAPSO Graph Database client is an easy-to-use tool to perform SPARQL query and update statements against your knowledge graphs or ontologies stored in your graph database. It can be used with any Node.js application.

As of now, ENAPSO Graph Database Client supports the following graph databases:

More graph databases will be supported added in the future.

In addition to authentication (Basic and JWT), the client handles prefixes, handles errors, and transforms SPARQL result bindings into CSV and TSV files as well as JSON result sets that can be easily processed in JavaScript.

The following tools you also might find useful:

  • ENAPSO Graph Database Admin: Enables you to perform administrative and monitoring operations against your graph databases, such as importing and exporting ontologies or knowledge graphs and utilizing the graph database's special features.
  • ENAPSO Command Line Interface for Graph Databases: Enables you to perform numerous scriptable operations on graph databases, e.g. for monitoring and testing, CI/CD pipelines or backup and restore.

๐Ÿ› ๏ธย Installation

npm i @innotrade/enapso-graphdb-client --save

Create the connection with graph database

const { EnapsoGraphDBClient } = require('@innotrade/enapso-graphdb-client');

let graphDBEndpoint = new EnapsoGraphDBClient.Endpoint({
    baseURL: 'http://localhost:7200',
    repository: 'Test',
    triplestore: 'graphdb', // 'graphdb' or 'fuseki' or 'stardog'
    prefixes: [
        {
            prefix: 'entest',
            iri: 'http://ont.enapso.com/test#'
        }
    ],
    transform: 'toCSV'
});

Parameters

ParameterTypeDescriptionValues
baseURL(required)StringPass the URL in which graph database is running.
repository(required)StringPass the name of the repository or database of the graph databases with which you want to create a connection.
prefixes(required)Array of objectsPass the prefix and its IRI as an object which will be used in the SPARQL query to perform crud operations.
triplestore(optional)StringPass the name of the graph database with which you want to create a connection by default it creates a connection with Ontotext GraphDB.('graphdb' , 'stardog' , 'fuseki')
transform(optional)StringPass the type in which you want to show the result of SPARQL query by default it shows the result in JSON format.('toJSON', 'toCSV' , 'toTSV')

๐Ÿ“‹ย Features

FeatureDescriptionOntotext GraphDBApache Jena FusekiStardog
LoginAuthenticate user against the graph databaseโœ”โœ˜โœ”
QueryTo retrieve the information from graph database using SPARQL queryโœ”โœ”โœ”
UpdateTo update the triples in the graph databaseโœ”โœ”โœ”

Query the graph database:

graphDBEndpoint
    .query(
        'select *
where {
    ?class rdf:type owl:Class
    filter(regex(str(?class), "http://ont.enapso.com/test#TestClass", "i")) .
}',
        { transform: 'toJSON' }
    )
    .then((result) => {
        console.log(
            'Read the classes name:\n' + JSON.stringify(result, null, 2)
        );
    })
    .catch((err) => {
        console.log(err);
    });

Update the graph database:

graphDBEndpoint
    .update(
        `insert data {
	   graph <http://ont.enapso.com/test> {
             entest:TestClass rdf:type owl:Class}
           }`
    )
    .then((result) => {
        console.log('inserted a class :\n' + JSON.stringify(result, null, 2));
    })
    .catch((err) => {
        `console.log(err);
    });

๐Ÿ“–ย Documentation

View the documentation for further usage examples.

๐Ÿงชย Testing

Tutorial to run the Test suite against the graph database.

๐Ÿ˜Žย Contributing

Contributing is more than just coding. You can support the project in many ways. We will be happy to collaborate with you and we are looking forward to commonly making semantics and knowledge graph technologies available for your projects.

Details of how you can help the project are described in the CONTRIBUTING.md document.

๐Ÿง‘โ€๐Ÿซย Contributors

๐Ÿ’ฌย Bugs and Feature Requests

Do you have a bug report or a feature request?

Please feel free to add a new issue or write to us in discussion: Any questions and suggestions are welcome.

๐Ÿงพย License

This project is licensed under the Apache 2.0 License. See the LICENSE file for more details.

1.9.3

11 months ago

1.9.1

1 year ago

1.9.2

1 year ago

1.9.0

1 year ago

1.8.25

1 year ago

1.8.20

2 years ago

1.8.21

2 years ago

1.8.22

2 years ago

1.8.23

2 years ago

1.8.24

2 years ago

1.8.19

2 years ago

1.8.11

2 years ago

1.8.12

2 years ago

1.8.13

2 years ago

1.8.14

2 years ago

1.8.15

2 years ago

1.8.16

2 years ago

1.8.17

2 years ago

1.8.18

2 years ago

1.8.9

2 years ago

1.8.10

2 years ago

1.8.8

2 years ago

1.8.7

2 years ago

1.8.6

3 years ago

1.8.5

3 years ago

1.8.4

3 years ago

1.8.3

3 years ago

1.8.2

4 years ago

1.8.1

4 years ago

1.8.0

4 years ago

1.7.3

5 years ago

1.7.1

5 years ago

1.7.0

5 years ago

1.6.3

5 years ago

1.6.2

5 years ago

1.6.1

5 years ago

1.6.0

5 years ago