Skip to content

Commit

Permalink
Correction of misspelling in Tutorial.md
Browse files Browse the repository at this point in the history
  • Loading branch information
symarchand authored and abhijith-hr committed Apr 3, 2024
1 parent 364a8df commit 58e845a
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions semantic-model/datamodel/Tutorial.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Semantic Datamodel Tutorial

## Motivation
A fundamental difference between JSON-LD and JSON is, that JSON describe generic objects and JSON-LD graphs of relationships. A consequence of this is that two JSON-LD object are identical interpreted, if they represent the same graph. For instance, the following object
A fundamental difference between JSON-LD and JSON is, that JSON describe generic objects and JSON-LD graphs of relationships. A consequence of this is that two JSON-LD object are identically interpreted, if they represent the same graph. For instance, the following object

```json
[
Expand Down Expand Up @@ -216,7 +216,7 @@ This is defining to replace in all IRI's, types and key in the JSON-LD object "e
#### Expanded form
To get rid of the @context, everything in the JSON-LD object has to be transformed into an explicit state, so that no @context is needed.

In the following execise the JSON-LD object is expanded:
In the following exercise the JSON-LD object is expanded:

```
node ./jsonldConverter.js -x ../examples/simple_plasmacutter_data.json
Expand Down Expand Up @@ -332,7 +332,7 @@ In this part of the tutorial we will take a look at JSON-Schemas and how they re

### JSON-Schema

More on JSON-Schema can be found [here](https://json-schema.org/). As described in the PDT [specification](./README.md), not all keywoards are allowed and some additinal keywords have been defined.
More on JSON-Schema can be found [here](https://json-schema.org/). As described in the PDT [specification](./README.md), not all keywoards are allowed and some additional keywords have been defined.
The object `urn:iif:cutter1` above, can be validated with the following JSON-schema:
```json
[
Expand Down Expand Up @@ -454,7 +454,7 @@ where option '-s' specifies the shacl file, '-df' the format of the input data f

#### Conversion from JSON-Schema to SHACL
Basic SHACL shapes can be created from JSON-Schema by using the `jsonschema2shacl.js` tool.
For instace, the JSON-Schema for the plasmacutter above, can be converted by providing the schema to convert by option `-s`, the id of the single object by option '-i' and a context by option '-c':
For instance, the JSON-Schema for the plasmacutter above, can be converted by providing the schema to convert by option `-s`, the id of the single object by option '-i' and a context by option '-c':

```
node ./jsonschema2shacl.js -s ../examples/plasmacutter_schema.json -i https://industry-fusion.org/eclass#0173-1#01-AKJ975#017 -c https://industryfusion.github.io/contexts/v0.1/context.jsonld
Expand Down Expand Up @@ -505,7 +505,7 @@ node ./jsonschema2shacl.js -s ../examples/plasmacutter_schema.json -i https://i

## Validate objects

Finally we can describe in detail the steps needed for JSON-LD Data validation with JSON-Schema, lined out in the first section. The relationship between the concpepts described above are summarized in the following figure:
Finally we can describe in detail the steps needed for JSON-LD Data validation with JSON-Schema, lined out in the first section. The relationship between the concepts described above are summarized in the following figure:

```mermaid
---
Expand All @@ -525,10 +525,10 @@ Therefore, the validation steps are as follows:
1. Simplify the problem: Handle with JSON-Schema only single objects, e.g. only a *Cutter* or *Filter* object. For instance the [plasmacutter](./examples/plasmacutter_data.json) or [filter](./examples/filter_data.json) files in the [examples](./examples) directory.
2. Transform the JSON-LD object into a canonical normal form which ensures that same (sub-)graphs are represented by identical objects.

We have introduced two canonical forms which are used for validation. The *concise* form is used for JSON-Schema validation. The *normalized* form is used for SHACL validation. The `jsonldConverter.js` tool can be used to transform on into another form.
We have introduced two canonical forms which are used for validation. The *concise* form is used for JSON-Schema validation. The *normalized* form is used for SHACL validation. The `jsonldConverter.js` tool can be used to transform one into another form.
3. Generate the SHACL constraints from JSON-Schemas

For instance, the SHACL constraints for the plasmacutter and filter above can be generate by:
For instance, the SHACL constraints for the plasmacutter and filter above can be generated by:
```
node ./jsonschema2shacl.js -s ../examples/plasmacutter_and_filter_schema.json -i https://industry-fusion.org/eclass#0173-1#01-AKJ975#017 -c https://industryfusion.github.io/contexts/v0.1/context.jsonld
```
Expand Down Expand Up @@ -584,7 +584,7 @@ Therefore, the validation steps are as follows:
```
</font>

The validation reports one error. The problem is that the link `hasFilter` must be linked to an object with a type `<https://industry-fusion.org/eclass#0173-1#01-ACK991#016>`. This cannot be fullfilled in a single object. But when we apply the same procedure to a JSON-LD list of objects which contain a plasmacutter AND a filter with linked ids, the validation will show that the resulting graph is conform with the Shacl SHAPE. This can be shown as follows:
The validation reports one error. The problem is that the link `hasFilter` must be linked to an object with a type `<https://industry-fusion.org/eclass#0173-1#01-ACK991#016>`. This cannot be fullfilled in a single object. But when we apply the same procedure to a JSON-LD list of objects which contains a plasmacutter AND a filter with linked ids, the validation will show that the resulting graph is conform with the Shacl SHAPE. This can be shown as follows:

First create the **normalized** form of the joint plasmacutter and filter object.
```
Expand Down

0 comments on commit 58e845a

Please sign in to comment.