Skip to content

Commit

Permalink
feat: SHACLViz info
Browse files Browse the repository at this point in the history
  • Loading branch information
psiotwo committed Jan 7, 2025
1 parent 7c1cf55 commit 24ecbd6
Show file tree
Hide file tree
Showing 10 changed files with 770 additions and 0 deletions.
4 changes: 4 additions & 0 deletions docs/shaclviz/_category_.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"label": "SHACL Viz",
"position": 2
}
1 change: 1 addition & 0 deletions docs/shaclviz/acqf-exchange-model-full.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions docs/shaclviz/acqf-exchange-model.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
681 changes: 681 additions & 0 deletions docs/shaclviz/acqf-exchange-model.ttl

Large diffs are not rendered by default.

25 changes: 25 additions & 0 deletions docs/shaclviz/acqf-field-query.rq
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX elm: <http://data.europa.eu/snb/model/elm/>
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>

SELECT ?field {}
VALUES ?field {
xsd:string
xsd:int
xsd:integer
xsd:positiveInteger
xsd:dateTime
rdf:langString
xsd:anyURI
xsd:boolean
xsd:duration
xsd:decimal
xsd:double
rdf:HTML
skos:ConceptScheme
skos:Concept
elm:Identifier
elm:WebResource
elm:Note
}
24 changes: 24 additions & 0 deletions docs/shaclviz/example-usage.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
sidebar_position: 2
---

# Example Usage

- Download the SHACL Viz executable JAR:
```bash
curl -o shaclviz.jar https://repo1.maven.org/maven2/zone/cogni/semanticz/semanticz-shaclviz/1.0.1/semanticz-shaclviz-1.0.1-executable.jar
```

- The following command (run using Java 17+) creates the diagram of the [ACQF data model](https://data.acqf-qcp.africa/) (for up-to-date version check the website) preconfiguring [classes to be visualised as fields](./acqf-field-query.rq):
```bash
java -jar shaclviz.jar acqf-exchange-model.ttl acqf-exchange-model.puml --fieldQuery=acqf-field-query.rq
```
![acqf-exchange-model.svg](acqf-exchange-model.svg)

- To see how the diagram looks like with the default field selection, run:
```bash
java -jar shaclviz.jar acqf-exchange-model.ttl acqf-exchange-model-full.puml
```
![acqf-exchange-model-full.svg](acqf-exchange-model-full.svg)

- full syntax can be checked by running `java -jar shaclviz.jar` and more examples can be found [here](https://github.com/cognizone/semanticz-shaclviz).
12 changes: 12 additions & 0 deletions docs/shaclviz/features.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
sidebar_position: 1
---

# Features
- visualizing ontology classes/properties (not their SHACL shapes)
- displaying labels (SHACL label overrides the ontology label) and cardinalities
- visualizing user-defined classes as fields
- support for attribute filtering (e.g. include only required attributes)
- export to
- PlantUML (for easy visualization)
- yEd (for advanced layouts and manual editing)
22 changes: 22 additions & 0 deletions docs/shaclviz/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
title: SHACL Viz
slug: /shaclviz
---

[SHACL Viz](https://github.com/cognizone/semanticz-shaclviz) draws a SHACL diagram for a _SHACL data model_ of the following form:
- each shape is an IRI (not blank node)
- each node shape has a `sh:targetClass` pointing to a single OWL class .
- each property shape has a `sh:path` pointing to a single property.

<table>
<tr style="vertical-align: top "><td>
Instead of SHACL-based diagrams ...

![](shaclviz-example-before.png)
</td><td>
... SHACLViz creates OWL-based diagrams (user-defined classes can be rendered as fields - e.g. skos:Concept)


![](shaclviz-example-after.png)
</td></tr>
</table>
Binary file added docs/shaclviz/shaclviz-example-after.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/shaclviz/shaclviz-example-before.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 24ecbd6

Please sign in to comment.