0.3.1 • Published 4 years ago

vue-shacl-form v0.3.1

Weekly downloads
2
License
MIT
Repository
github
Last release
4 years ago

vue-shacl-form

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

Installation

npm i -S vue-shacl-form

Usage

Demo

basic example

<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
0.3.1

4 years ago

0.3.0

4 years ago

0.2.3

5 years ago

0.2.2

5 years ago

0.2.1

5 years ago

0.2.0

5 years ago

0.1.1

5 years ago

0.1.0

5 years ago