# vue-shacl-form

> A Vue.js component for HTML5 form generation based on SHACL

Latest version **0.3.1** (published 2020-10-04) · MIT license · 0 weekly downloads

## Install

```sh
npm install vue-shacl-form
pnpm add vue-shacl-form
yarn add vue-shacl-form
bun add vue-shacl-form
```

## Health

**Score 5/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: insecure dependencies; abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.3.1 |
| Published | 2020-10-04 |
| First published | 2018-12-11 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 4 |
| Unpacked size | 250.4 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 8 |
| Author | Shohei Toyota |
| Maintainers | babibubebon |

## Links

- npm: https://www.npmjs.com/package/vue-shacl-form
- Repository: https://github.com/Babibubebon/vue-shacl-form
- Homepage: https://github.com/Babibubebon/vue-shacl-form#readme
- Issues: https://github.com/Babibubebon/vue-shacl-form/issues
- npm.io page: https://npm.io/package/vue-shacl-form

## Dependencies (4)

- [merge](https://npm.io/package/merge.md) ^1.2.1
- [shacl](https://npm.io/package/shacl.md) github:Babibubebon/shacl-js#develop
- [rdflib](https://npm.io/package/rdflib.md) ^1.3.1
- [core-js](https://npm.io/package/core-js.md) ^3.6.5

## Recent versions

- 0.3.1 (latest) — 2020-10-04
- 0.3.0 — 2020-10-04
- 0.2.3 — 2018-12-19
- 0.2.2 — 2018-12-17
- 0.2.1 — 2018-12-17
- 0.2.0 — 2018-12-17
- 0.1.1 — 2018-12-11

## README

# vue-shacl-form
A Vue.js component for HTML5 form generation based on [SHACL](https://www.w3.org/TR/shacl/)

## Installation
```
npm i -S vue-shacl-form
```

## Usage
[**Demo**](https://jsfiddle.net/Babibubebon/eywraw8t/512093/)

basic example
```html
<template>
  <div id="app">
    <h1>vue-shacl-form</h1>
    <shacl-form :shapesGraphText="shapes" targetClass="http://example.com/Book" @update="onUpdate"></shacl-form>
    <pre v-text="data"></pre>
  </div>
</template>

<script>
import "bootstrap/dist/css/bootstrap.min.css";
import VueShaclForm from "vue-shacl-form";

const shapes = `
@prefix rdf:  <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix sh:   <http://www.w3.org/ns/shacl#> .
@prefix xsd:  <http://www.w3.org/2001/XMLSchema#> .
@prefix ex: <http://example.com/> .

ex:Book
    a rdfs:Class, sh:NodeShape ;
    sh:property [
        sh:path ex:title ;
    ] ;
    sh:property [
        sh:path ex:author ;
    ] ;
    sh:property [
        sh:path ex:datePublished ;
        sh:datatype xsd:date ;
    ] ;
    .
`;

export default {
  name: "app",
  data() {
    return {
      shapes: shapes,
      data: ""
    };
  },
  methods: {
    onUpdate(dataGraph) {
      this.data = dataGraph.toNT();
    }
  },
  components: {
    "shacl-form": VueShaclForm
  }
};
</script>
```

## Development
start dev server
```
npm run serve
```

build bundle files
```
npm run build
```

---
_Source: https://npm.io/package/vue-shacl-form · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
