No description
  • JavaScript 99.5%
  • HTML 0.5%
Find a file
2025-03-16 12:23:25 +01:00
.github/workflows add github action workflow that runs tests on merge to main and PRs 2025-03-11 00:19:47 +01:00
public/tests v0.0.1 of source code and tests for shacl-tulip 2025-03-10 23:32:43 +01:00
src introduce 'data' field as the main property on which to get/set other properties 2025-03-16 12:19:59 +01:00
tests introduce 'data' field as the main property on which to get/set other properties 2025-03-16 12:19:59 +01:00
.gitignore v0.0.1 of source code and tests for shacl-tulip 2025-03-10 23:32:43 +01:00
index.html v0.0.1 of source code and tests for shacl-tulip 2025-03-10 23:32:43 +01:00
LICENSE adds license and elementary readme 2025-03-11 00:11:52 +01:00
package-lock.json v0.0.1 of source code and tests for shacl-tulip 2025-03-10 23:32:43 +01:00
package.json v0.0.1 of source code and tests for shacl-tulip 2025-03-10 23:32:43 +01:00
README.md Update readme usage example to reflect change in API 2025-03-16 12:23:25 +01:00
vite.config.mjs config cleanup 2025-03-11 00:42:02 +01:00

shacl-tulip

Like "shacl-vue-lib".

This is the main library behind shacl-vue.

Usage

Clone the source code:

git clone https://github.com/psychoinformatics-de/shacl-tulip.git

Install the library into your virtual environment and project:

npm install --save <path>

Import and use shacl-tulip in your JavaScript code, for example:

import { ShapesDataset} from 'shacl-tulip'

let shapesDS = new ShapesDataset();
const fileUrl = 'https://concepts.datalad.org/s/things/v1.shacl.ttl';
// Listen for and act on the 'graphLoaded' event
shapesDS.addEventListener('graphLoaded', (event) => {
    console.log('Shapes graph fully loaded:', event.detail)
    console.log(shapesDS.data.propertyGroups)
    console.log(shapesDS.data.nodeShapes)
    console.log(shapesDS.data.nodeShapeNames)
    console.log(shapesDS.data.nodeShapeNamesArray)
    console.log(shapesDS.data.nodeShapeIRIs)
    console.log(shapesDS.data.prefixes)
    console.log(shapesDS.data.serializedGraph)
    console.log(shapesDS.data.graphLoaded)
    console.log(shapesDS.data.prefixesLoaded)
    console.log(shapesDS.data.graph)
    console.log(shapesDS.data.graph.size)
});
// Load the RDF
shapesDS.loadRDF(fileUrl);

See here for all shacl-tulip exports, and inspect the class code for class-specific functionality.