Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hypermedia-app/shaperone-examples
Created with WebComponents.dev
https://github.com/hypermedia-app/shaperone-examples
Last synced: 5 days ago
JSON representation
Created with WebComponents.dev
- Host: GitHub
- URL: https://github.com/hypermedia-app/shaperone-examples
- Owner: hypermedia-app
- Created: 2021-11-17T18:09:33.000Z (almost 3 years ago)
- Default Branch: baseline
- Last Pushed: 2022-08-01T10:47:06.000Z (over 2 years ago)
- Last Synced: 2023-03-02T14:46:07.305Z (over 1 year ago)
- Language: JavaScript
- Homepage: https://webcomponents.dev/view/O8SwE2klRV1wMB87Rkh2
- Size: 53.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Examples of shaperone-form
Try also the playground at [forms.hypermedia.app](https://forms.hypermedia.app/playground)
This repo hosts examples of Shaperone. You can use it directly on the documentation pages of shaperone or on webcomponents.dev to experiment with different features.
There are multiple focused branches. The `master` branch is the baseline of plain. Each "feature branch" presents a specific use case for shaperone.
## Load shapes
Shapes are loaded directly from the web. This repository contains some samples in the `src/shapes` dir. They can be loaded in two ways
```javascript
import fetchShapes from './fetchShapes'// 1. load from samples
// for example <> from `src/shapes/person.ttl`
const graph = await fetchShapes('person')
const person = graph.namedNode('')// 2. load from the web
// defaults to node equal dereferenced URI
const projectShape = await fetchShapes('http://example.com/project-shape')// but a different node can be selected
const baseShape = projectShape.node('http://example.com/project-shape#base-shape')
```## Configuration
Any per-branch configuration will happen in `src/config.js`.