1.1.0 • Published 1 month ago

@jeswr/shacl2shex v1.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
1 month ago

shacl2shex

Convert basic SHACL shapes to ShEx

GitHub license npm version build Dependabot semantic-release

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 and sh: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.