Automatic generation of user interfaces from SHACL https://shacl-vue.psychoinformatics.de/
  • Vue 74.7%
  • JavaScript 24%
  • Python 0.9%
  • Shell 0.3%
Find a file
Stephan Heunis 2a6e0efcca
Some checks failed
Deploy on webserver / Build docs and deploy (push) Has been cancelled
use commit date as 'app version' and allow build environment info display
Instead of using the previous branch name and short commit hash as the displayed version
of shacl-vue that is running for a given deployment, use commit date instead. Specifically
ISO8601 format, but cutting off the timezone part to make the string shorter. A tooltip is
now shown when hovering over the version in the application footer, which shows the branch
and commit hash. The link still takes the user to the shacl-vue source code at the specific
commit.

In addition two new info sets are supported. Firstly, the build date is introduced. This is
just logged by the vite build process, and can be seen in the info tab of the settings dialog
under 'shacl-vue', beneath the newly formatted version (same as in the footer). Secondly, if
specific environment variables are passed to the npm build step, vite will pick this up and
provide it to the AppHeader component, which feeds it to the settings dialog. These variables
are equivalents of the shacl-vue git repo version identifiers, but for the git repo that
manages the deployment of which shacl-vue is a submodule. They can e.g. be provided by the
deployment repo makefile when building the shacl-vue application, as follows:

	BUILD_GIT_COMMIT= 	BUILD_GIT_COMMIT_SHORT= 	BUILD_GIT_BRANCH= 	BUILD_GIT_DATE= 	npm run build:app

If the BUILD_GIT_DATE variable is not supplied, these variables are ignored by shacl-vue.
If BUILD_GIT_DATE is supplied, it is assumed that all others are supplied, and then the same
formatting will be used to render this version information about the deployment repo in the
shacl-vue settings dialog, in the info tab under 'source code repository'
2026-07-09 23:28:08 +02:00
.forgejo/workflows correct directory paths for cp command 2026-01-15 21:39:56 +01:00
.github/workflows Add github action to codespell main on push and PRs 2025-02-24 14:30:02 -05:00
docs add more content+updates to 'useful features' section 2026-06-11 08:23:22 +02:00
public Add update_shapes option to config template 2026-01-23 16:17:42 +01:00
src use commit date as 'app version' and allow build environment info display 2026-07-09 23:28:08 +02:00
tests Reformat all files with prettier 2025-06-08 23:57:26 +02:00
tools Helpers for getting default schemas and data 2025-04-22 18:35:36 +02:00
.browserslistrc Basic scaffolding of vite-powered vuejs+vuetify project for rendering/viewing shacl shapes 2024-03-26 15:07:32 +01:00
.codespellrc Add rudimentary codespell config 2025-02-24 14:30:02 -05:00
.editorconfig Basic scaffolding of vite-powered vuejs+vuetify project for rendering/viewing shacl shapes 2024-03-26 15:07:32 +01:00
.gitignore ignore 'src/runtime-plugins' directory 2026-03-30 21:13:18 +02:00
.npmignore update npmignore to deal with recent updates to build process 2025-02-28 23:30:09 +01:00
.prettierignore Add prettier, indentation set at 4 spaces, add npm script 2025-06-08 23:56:38 +02:00
.prettierrc Add prettier, indentation set at 4 spaces, add npm script 2025-06-08 23:56:38 +02:00
index.html Reformat all files with prettier 2025-06-08 23:57:26 +02:00
index.js Reformat all files with prettier 2025-06-08 23:57:26 +02:00
jsconfig.json Reformat all files with prettier 2025-06-08 23:57:26 +02:00
LICENSE Initial commit 2024-03-21 11:11:07 +01:00
package-lock.json Support nunjucks templating for wizardeditor feature 2026-03-18 21:26:20 +01:00
package.json Support nunjucks templating for wizardeditor feature 2026-03-18 21:26:20 +01:00
README.md Refer to new docs and dev repo links 2026-01-15 21:32:45 +01:00
vite.config.app.mjs use commit date as 'app version' and allow build environment info display 2026-07-09 23:28:08 +02:00
vite.config.lib.mjs Reformat all files with prettier 2025-06-08 23:57:26 +02:00

shacl-vue

THIS REPOSITORY IS UNDER CONTINUOUS DEVELOPMENT

Overview

shacl-vue is a web-based user interface for entering, editing, and viewing linked (meta)data using a VueJS application driven by the Shapes Constraint Language (SHACL).

Think of it as an automatic builder that you just have to feed with a model of your data. If you have a SHACL schema, or a schema in a format that can be exported to SHACL, then you're good to go. No need to build custom forms for data entry, no need to struggle with post-entry data validation, no need to create a catalog application that renders all the entered data. shacl-vue does all of this automatically.

shacl-vue is built with VueJS 3, Vuetify frontend components, and Vite build tools, and was heavily inspired by the WC3 Draft: Form Generation using SHACL and DASH. For reading, manipulating, and writing RDF data (including SHACL), the package uses libraries compatible with the RDF/JS specifications (see also: https://github.com/rdfjs-base)

Installation and usage

shacl-vue can be installed from npm:

npm install shacl-vue

Use as a library

The npm package currently provides the named export ShaclVue:

import { ShaclVue } from 'shacl-vue'

This is the main configurable VueJS component that is used to render all functionality of shacl-vue. It can be instantiated inside a VueJS application as follows:

<template>
    <ShaclVue :configUrl="myconfig"></ShaclVue>
</template>
<script setup>
const myconfig = 'config.json';
</script>

Here, config.json is used to configure the properties of the specific shacl-vue deployment. See examples here, and here.

For the above to work, the VueJS application will have to install Vuetify and the ShaclVue might need to be registered explicitly.

Use as a standalone site

The build steps of shacl-vue produce both the library as well as a set of static files that can be served as a standalone site. The abovementioned metadata annotation tool of the TRR379 Research Consortium deploys shacl-vue in this manner, and its source code can be viewed here.

To use shacl-vue to deploy a standalone site, follow the build steps below. In addition, a deployment-specific confi file should be provided.

Local development and building

The shacl-vue source code can be cloned for local development, testing, or building. First clone the repository:

git clone https://hub.psychoinformatics.de/datalink/shacl-vue.git
cd shacl-vue

Then create a local NodeJS virtual environment, e.g with micromamba:

micromamba create -n <my-env-name> nodejs
micromamba activate <my-env-name>

Then install the application:

npm install .

Local rendering during development

To serve the application locally in order to test it in the browser, run:

npm run dev

Build steps

To build the library (output at /dist/lib):

npm run build:lib

To build the standalone site, i.e. VueJS application (output at /dist/app):

npm run build:app

To build both the library and the standalone site:

npm run build

Testing

Testing remains a primary TODO for this package, although a minimal test is in place to check whether the named exports can be imported into a new project. Testing is done with Vitest.

npm run test

Dependency on shacl-tulip

In an effort to generalize shacl-vue for improved use by and interoperability with other applications, the underlying functionality was factored out and packaged as the shacl-tulip library (like "shacl-vue-lib"). shacl-tulip provides the main (derived) classes for handling RDF data and related form data. It is completely independent of VueJS, yet class constructors allow passing reactive objects as arguments, which shacl-tulip handles seamlessly. It also focuses purely on library-level functionality (including utilities that were previously part of shacl-vue), and contains no frontend code. shacl-vue imports shacl-tulip classes and uses them mainly in its composable code.

Access to external webservices

Unless configured to connect to specific API endpoints (see Service API integration docs), a client accessing a bundled shacl-vue deployment does not load any external resources. All required resources are loaded from the server where the bundled application is hosted.

Acknowledgements

This work was funded, in part, by

  • Deutsche Forschungsgemeinschaft (DFG, German Research Foundation) under grant TRR 379 (546006540, Q02 project)
  • Deutsche Forschungsgemeinschaft (DFG, German Research Foundation) under grant SFB 1451 (431549029, INF project)
  • MKW-NRW: Ministerium für Kultur und Wissenschaft des Landes Nordrhein-Westfalen under the Kooperationsplattformen 2022 program, grant number: KP22-106A