paperai / materials-schema-web

0 stars 0 forks source link

materials-schema-web

materials-schema-web is a static html generation tool for creating Type-Property bidirected schema.

Features

Given arbitrary amount of Type s and Property s, this app can:

Install Prerequisites

Installation

  1. Clone this repository.
  2. Run npm ci to install all library dependency.

Usage

To update Type-Property relationship remotely:

  1. Modify the material.json in the root directory according to the rules below.

After the action finished, the generated static pages can now be found in the path public

To use it as an interactive app locally:

:heavy_exclamation_mark: When edit material.json directly, all pages under public folder will be deleted before generation of static pages.
:heavy_exclamation_mark: When run the app locally, please note that any modifications in material.json reuqires to execute npm start again for update in html pages.

material.json

A simplest sample of material.json looks like this:

{
    "dataTypes": [
        {"id": "D1", "name": "Text"},
    ],
    "types": [
        {"id": "T100", "name": "Person", "properties": ["P1"]},
    ],
    "properties": [
        {"id": "P1", "name": "additionalName", "expectedTypes": ["D1"], "description": "xxxx"},
    ]
}

dataTypes: primitive type; no hyperlink will be generated with this type.

types: customized type; holds property no hyperlink will be generated with this type.

properties: primitive type; no hyperlink will be generated with this type.

License

TBD