Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@activitypods/ldo-shapes

activitypods81Apache-2.00.2.0

Types generated from the ActivityPods shape repository

rdf, schema, shapes, ldo

readme

activitypods-small

ActivityPods shapes Monorepo

A monorepo with RDF shapes, shape trees, and LDO objects used by ActivityPods applications.

Serving shapes

When developing a new application, you can serve your new shapes locally. The default port is 30916. We will make shape development easier soon. Stay tuned!.

yarn install
yarn start

Packages

This monorepo has the following structure:

  • packages/shape-definitions: Contains the shape definitions and exports to js/ts.
  • packages/shape-definitions/source/: Contains the actual (SHACL) shape and shape-tree definitions serialized in turtle (.shacl.ttl). Also contains SHEX shape files: For the moment, they are generated manually and only contain ActivityStreams translations that are derived from the SHACL definitions. We need the SHEX files to generate ldo objects from them.
  • packages/shape-definitions/generated/ contains js-importable json-ld and ttl-string exports generated from the source .shacl.ttl files.
  • packages/ldo-types: Contains ldo typescript ShapeTypes derived from the (shex) shapes.

For the moment, the shex definitions need to be manually "translated" from the shacl definitions. Please note that the ldo builder does not support "ShapeOr, ShapeAnd, ShapeNot, ShapeExternal, or NodeConstraint" currently (see issue). See the existing shacl and shex files as a reference. The npm package @jeswr/shacl2shex (does not translate all features) or an LLM might help you with the translation.

For the future, there are several approaches to improve the way we write shapes and shape trees. Link-ML provides a way to write shapes in a uniform format that converts to various various other formats, including SHEX and SHACL. However, the SHACL translation does not handle shape inheritance well so that files get very long. Feel free to improve @jeswr/shacl2shex, the Link-ML to SHACL converter, or ldo to support SHACL.

Submitting shapes

Feel free to open a PR, to submit new shapes and shapetrees!

Please run yarn build, to generate the typescript ldo objects before publishing.

Note that shapes must not change, they are immutable. Create a new shape, if you need it.

Funding

This project is funded through NGI0 Commons Fund, a fund established by NLnet with financial support from the European Commission's Next Generation Internet program. Learn more at the NLnet project page.

NLnet foundation logo NGI Zero Logo