Skip to content

Commit b667b71

Browse files
committed
upgrade SPARQL Constraints tutorial
1 parent bb45aad commit b667b71

File tree

1 file changed

+15
-11
lines changed
  • docs/explore-and-author/graph-exploration/building-a-customized-user-interface/sparql-constraints

1 file changed

+15
-11
lines changed

docs/explore-and-author/graph-exploration/building-a-customized-user-interface/sparql-constraints/index.md

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
---
2+
status: new
23
icon: eccenca/application-queries
34
tags:
45
- SPARQL
@@ -24,27 +25,27 @@ SPARQL Constraints are resources which need to be managed in a Shape Catalog.
2425
This catalog graph needs to be imported (virtually, with `owl:imports`) into the main CMEM Shapes Catalog.
2526
Similar to property shapes, SPARQL Constraints needed to be linked from a Node Shape in order to select the set of shapes which are used for a given selection of resources.
2627

27-
## Example
28+
## Step-by-Step Example
2829

2930
In our running example, we create a Node Shape for `foaf:Person` resources.
30-
Then we add a SPARQL Constrain shape, which ...
31+
Then we add a SPARQL Constrain shape, which checks if the label of these resources contains the term `eccenca`.
3132

32-
### Install needed Vocabularies
33+
### Install Vocabularies
3334

3435
Go to the **:eccenca-application-vocabularies: [Vocabulary catalog](../../../vocabulary-catalog/index.md)** and install the RDF Schema and FOAF Vocabulary.
3536
Your vocabulary catalog should look like this after installation
3637

3738
![Vocabulary Catalog with Installed Vocabularies](vocabulary-catalog.png){ class="bordered" }
3839

39-
### Create a Shape Catalog
40+
### Create Shape Catalog
4041

4142
Go to **:eccenca-application-explore: [Knowledge graphs](../../../graph-exploration/index.md)** and create a **New Shape Catalog**.
4243
Name the graph e.g. *My Shapes*.
4344
After this step, the browser shows you a nearly empty graph which shows SHACL classes such as **SHACL Node Shape** and **SHACL SPARQL Constraint** in the navigation.
4445

4546
![Empty Shapes Graph](empty-shapes-graph.png){ class="bordered" }
4647

47-
### Create a SPARQL Constraint
48+
### Create Shapes
4849

4950
Select **SHACL SPARQL Constraint** in the Navigation component, then use the **Create a new "SHACL SPARQL Constraint"** button in the top right corner to create a new resource.
5051
Fill in a label and a SPARQL SELECT Query.
@@ -71,9 +72,7 @@ After you clicked on **Create** you should see your new resource in a list.
7172

7273
![New SPARQL Constraint](new-sparql-constraint.png){ class="bordered" }
7374

74-
### Create a Node Shape
75-
76-
Select **SHACL Node Shape** in the Navigation component, then use the **Create a new "SHACL Node Shape"** button in the top right corner to create a new resource.
75+
As a next step select **SHACL Node Shape** in the Navigation component, then use the **Create a new "SHACL Node Shape"** button in the top right corner to create a new resource.
7776

7877
Enter the following values:
7978

@@ -90,19 +89,24 @@ Before you create your new Node Shape (and new Property Shape) your screen shoul
9089

9190
![Create New Node Shape](create-node-shape.png){ class="bordered" }
9291

93-
### Validate the Shape
92+
### Validate Data
9493

9594
Now we can validate the shape by creating a Person with a label which contains the term `eccenca`.
9695

9796
- Go to **:eccenca-application-explore: [Knowledge graphs](../../../graph-exploration/index.md)** and create a **New Knowledge Graph**.
98-
- Name: `My Person Data`
97+
- Name: `My Data`
9998
- Imports: `foaf: Friend of a Friend vocabulary`
10099
- Select **Person** in the Navigation component, then use the **Create a new "Person"** button in the top right corner to create a new resource.
101100
- Name: `The term eccenca is not allowed`
102101

103-
The validate the resource with the validation button. You will see a screen like this:
102+
To validate a single resource, click the :material-play: validation button.
103+
You will see a screen like this:
104104

105105
![Invalid Resource](invalid-resource.png){ class="bordered" }
106106

107107
When you open the validation report, you will see a error message such as: **The value does not conform to SPARQL constraint**.
108108

109+
In addition to manual validation of a single resource, you have the following other options:
110+
111+
- use the [Validation Knowledge Graph task](../../../../build/reference/customtask/cmem_plugin_validation-validate-ValidateGraph.md) in a workflow
112+
- use the cmemc command [graph validation execute](../../../../automate/cmemc-command-line-interface/command-reference/graph/validation/index.md#graph-validation-execute)

0 commit comments

Comments
 (0)