Skip to content

Commit

Permalink
README: add section on base templates and Vocab.js
Browse files Browse the repository at this point in the history
  • Loading branch information
ndushay committed Nov 5, 2021
1 parent 6d3e9b7 commit 8e9d0b5
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,24 @@ To proxy to development:

Note that proxying to other environments may require additional Cognito configuration.

### Base Templates and https://sinopia.io/vocabulary

#### Base Templates

Conceptually, the Sinopia Editor uses JSON "resource templates" to inform the editor code which widgets (React "components") need to be displayed in order to create resource RDF according to said "resource template."

A "resource template" is comprised of one or more "property templates." But the Sinopia Editor is _also used to create those JSON "property templates."_ Thus, there must be some initial JSON **base templates** to inform the editor code which widgets (React "components") need to be displayed in order to create the JSON corresponding to a valid property template. A set of "start the world," "bootup templates", if you will.

#### Where do Base Template JSON Files Live?

**base templates** are in the `static/templates/` folder, and may themselves refer to files up a level in the `static/` folder. The loading of the base templates is baked into the sinopia_editor code.

Reiterating: the UI widgets displayed for a property template are driven by what is in the `static/` folder and its subfolders. There is no additional deployment necessary.

#### Updates to https://sinopia.io/vocabulary

The sinopia_editor code displays the properties and classes prefixed "http://sinopia.io/vocabulary/" from a javascript object in `src/components/vocabulary/Vocab.js`. If a new property is added to the Sinopia specific vocabulary (e.g. by adding to a base template), then that property should also be added to `src/components/vocabulary/Vocab.js`. Changes to the documentation for these properties can be done as a pull request.

## State model

![Redux State ER Diagram](redux-state.svg)
Expand Down

0 comments on commit 8e9d0b5

Please sign in to comment.