You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/explore-and-author/graph-exploration/building-a-customized-user-interface/sparql-constraints/index.md
+15-11Lines changed: 15 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,5 @@
1
1
---
2
+
status: new
2
3
icon: eccenca/application-queries
3
4
tags:
4
5
- SPARQL
@@ -24,27 +25,27 @@ SPARQL Constraints are resources which need to be managed in a Shape Catalog.
24
25
This catalog graph needs to be imported (virtually, with `owl:imports`) into the main CMEM Shapes Catalog.
25
26
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.
26
27
27
-
## Example
28
+
## Step-by-Step Example
28
29
29
30
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`.
31
32
32
-
### Install needed Vocabularies
33
+
### Install Vocabularies
33
34
34
35
Go to the **:eccenca-application-vocabularies: [Vocabulary catalog](../../../vocabulary-catalog/index.md)** and install the RDF Schema and FOAF Vocabulary.
35
36
Your vocabulary catalog should look like this after installation
36
37
37
38
{ class="bordered" }
38
39
39
-
### Create a Shape Catalog
40
+
### Create Shape Catalog
40
41
41
42
Go to **:eccenca-application-explore: [Knowledge graphs](../../../graph-exploration/index.md)** and create a **New Shape Catalog**.
42
43
Name the graph e.g. *My Shapes*.
43
44
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.
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.
50
51
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.
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.
77
76
78
77
Enter the following values:
79
78
@@ -90,19 +89,24 @@ Before you create your new Node Shape (and new Property Shape) your screen shoul
90
89
91
90
{ class="bordered" }
92
91
93
-
### Validate the Shape
92
+
### Validate Data
94
93
95
94
Now we can validate the shape by creating a Person with a label which contains the term `eccenca`.
96
95
97
96
- 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`
99
98
- Imports: `foaf: Friend of a Friend vocabulary`
100
99
- Select **Person** in the Navigation component, then use the **Create a new "Person"** button in the top right corner to create a new resource.
101
100
- Name: `The term eccenca is not allowed`
102
101
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.
When you open the validation report, you will see a error message such as: **The value does not conform to SPARQL constraint**.
108
108
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