1.1.0 • Published 1 month ago
@jeswr/shacl2shex v1.1.0
shacl2shex
Convert basic SHACL shapes to ShEx
Usage
import { DatasetCore } from '@rdfjs/types';
import { shaclStoreToShexSchema, writeShexSchema } from '@jeswr/shacl2shex';
// Creates the ShexJ schema
const schema = await shaclStoreToShexSchema(store);
// Writes the ShexJ schema to .shex
console.log(await writeShexSchema(schema, prefixes));
:warning: This library is hacked together. Unsupported features include:
sh:or
,sh:and
andsh:xone
- Property paths
CLI Usage
npx shacl2shex "input <filePath|directory|url>" "output <filePath|directory>"
e.g.
npx shacl2shex https://www.w3.org/ns/shacl-shacl#ShapeShape Shacl.shex
License
©2024–present Jesse Wright, MIT License.