@ldo/cli
The @ldo/cli
is a command line interface for initializing LDO and building ShapeTypes.
Setup
Automatic Setup
To setup LDO, cd
into your typescript project and run npx @ldo/cli init
.
Manual Setup
The following is handled by the automatic setup:
Install the LDO dependencies.
Create a folder to store your ShEx shapes:
Create a script to build ShEx shapes and convert them into Linked Data Objects. You can put this script in package.json
Generating a ShapeType
@ldo/cli generates shape types using the *.shex
files in the "input" folder. If you followed the instructions above, run the following command:
This will generate five files:
- ./ldo/foafProfile.shapeTypes.ts
<-- This is the important file
- ./ldo/foafProfile.typings.ts
- ./ldo/foafProfile.schema.ts
- ./ldo/foafProfile.context.ts