Skip to content

Commit 231be16

Browse files
committed
draft
1 parent 97d9c90 commit 231be16

6 files changed

Lines changed: 373 additions & 0 deletions

File tree

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
@prefix : <https://ns.eccenca.com/data/config/> .
2+
@prefix di: <https://vocab.eccenca.com/di/> .
3+
@prefix void: <http://rdfs.org/ns/void#> .
4+
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
5+
@prefix shui: <https://vocab.eccenca.com/shui/> .
6+
7+
<https://ns.eccenca.com/data/linkruletemplates/> a void:Dataset ;
8+
rdfs:comment """This is an internal Corporate Memory dataset, not visible to non-admin users.
9+
It contains a catalog of link rule templates.
10+
You can use the LINK RULES tab in order to create and manage your link rules based on these templates."""@en ;
11+
rdfs:label "CMEM Regeltemplates Katalog"@de , "CMEM Link Rule Template Catalog"@en ;
12+
<http://purl.org/dc/terms/creator> <https://ns.eccenca.com/junbehauen> ;
13+
<http://purl.org/dc/terms/publisher> <https://ns.eccenca.com/eccenca-GmbH> ;
14+
<http://purl.org/dc/terms/rights> "Copyright © 2025 eccenca GmbH" ;
15+
shui:isSystemResource true ;
16+
shui:managedClasses di:Theme ;
17+
.
18+
19+
di:Theme a rdfs:Class ;
20+
rdfs:label "Link Rule Template"@en , "Regeltemplate"@de ;
21+
.
168 KB
Loading
166 KB
Loading
Lines changed: 193 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,193 @@
1+
---
2+
icon: eccenca/application-queries
3+
tags:
4+
- LinkRules
5+
- KnowledgeGraph
6+
---
7+
# Link Rules Module
8+
9+
## Introduction
10+
11+
The Link Rules module provides mechanisms to simplify creating data linking and to imposes role specific workflows over the whole process.
12+
13+
Linking tasks allow the creation of links between resources based on rules in the Corporate Memory Build component. Such a linking task demands the configuration of source and target input resource selections (dataset, resource type or additional restrictions), the link type and an output dataset. These configurations demand a thorough understanding of your knowlege graph internals and may become a repetitive task. The Link rules module allows to streamline this process in a way that also users with limited understanding of the knowledge graph can create link rules based on pre-defined templates.
14+
15+
## Usage
16+
17+
This guide explains how to navigate, search, create, and manage Link Rules in the interface.
18+
19+
![](linkrules-ui.png){ class="borderer"}
20+
21+
### Open the Link Rules Section
22+
23+
In the main navigation menu, under *BUILD* section, click *Link rules* (①).
24+
This opens the list of existing link rules.
25+
26+
### Manage Templates (Optional)
27+
28+
If you want to work with predefined templates for link rules, click *Manage Templates* in the top right corner (②).
29+
30+
### Search for Link Rules
31+
32+
Use the Search field (③) to quickly locate an existing link rule by name or keyword in the description.
33+
34+
### Expand or Collapse Rule Details
35+
36+
Click the arrow icon (④) next to a rule to expand or collapse its details.
37+
38+
In the Details tab (⑦), you’ll find:
39+
- General Information (operators, paths)
40+
- Result Statistics
41+
- Rule Status
42+
- Publication Information
43+
- Activities
44+
- The Custom tab contains any additional user-defined properties.
45+
46+
In the rule execution panel (⑥), you can *Execute* the rule (▶ icon), *Delete* the rule (🗑 icon) and *Clone* (⿻ icon) it or modify its configuration (✏ icon).
47+
48+
### Open the Link Rule editor
49+
50+
Click on the rule name in the *Linking* column (⑤) to open the link rule editor.
51+
52+
### Create a New Link Rule
53+
54+
To create a new rule, click the blue plus button (⑧) in the bottom-right corner.
55+
Follow the prompts to define the template, connecting predicate, etc.
56+
57+
58+
## Setup
59+
60+
### Template Catalog
61+
62+
Create a new graph that holds templates for Link Rules. The graph IRI will be needed for configuration later on.
63+
64+
!!! info
65+
66+
Suggestion for Template Catalog Graph IRI: ´https://ns.eccenca.com/data/linkruletemplates/´. You may use [this file](./CMEM_Link_Rule_Template_Catalog.ttl) as the graphs content.
67+
68+
!!! info
69+
70+
This graph could be prepared even it is not used in many setups.
71+
72+
!!! info
73+
74+
If there is no Shape for Link Rule Template load this file as a `New Shape Catalog` (Graph label: Link Rules Shape Catalog, Graph IRI: ´https://vocab.eccenca.com/shacl/link_rules/´).
75+
76+
77+
### Link Rules Build project
78+
79+
Create a new project in Build that holds all linking tasks created in the Link Rules module.
80+
81+
![](create_project.png){ class="bordered" }
82+
83+
In the *Advanced Options* section set a *Project Identifier* as this needs to be configured in the next steps.
84+
85+
Inside this project create a new workflow that will be used to register all published rules, so that all these rules can be executed at once. Again it is recommended to set a *Item Identifier* as this needs to be configured in the next steps.
86+
87+
![](create_wf.png){ class="bordered" }
88+
89+
Inside this project create *Knowledge Graph datasets* for these graphs you want to use for linking.
90+
91+
!!! info
92+
93+
This project is managed by the *Link Rules module*. You should not alter elements inside the project unless you know what you are doing.
94+
95+
### Access condition
96+
97+
Create a dedicated access condition that allows users to execute link rules and write results to the output graphs of created link rules.
98+
99+
This access conditions is used by the Link Rules module to grant write access to the output graph whenever a new rule is created.
100+
101+
!!! info
102+
103+
It is currently not possible to set a *Access Condition Identifier* nor to simply retrieve the IRI of an existing access condition. Hence the admin needs to retrieve the IRI of this access condition from the CMEM Access Conditions graph.
104+
105+
### Workspace configuration
106+
107+
Enable the *Link Rules* module.
108+
109+
In the following let us walk through the configuration options.
110+
111+
- **Order**: The position of the Link Rules module in the menu.
112+
- **Template Catalog IRI**: The IRI of the template catalog we just created. As the name implies, the Template Catalog holds all templates for usage in the Link Rules module. Templates allow preselecting patterns for easier rule creation.
113+
- **Project ID**: The *Project Identifier* of the Link Rules Build project we just created. Link Rules will be managing this project and add the rules to it. To get the id of a project, open the project in the build component, select the project and choose 'Show identifier' in the context menu, in the top right. The project needs to have a workflow, which is used to execute the rules and has to be configured in this section. Furthermore, the projects needs one or more Datasets, which can be selected in the templates.
114+
115+
116+
- **Published Rules Workflow ID**: The *Item Identifier* of the workflow in the Link Rules Build project we just created.
117+
- **Access Condition IRI**: The IRI of the Access Condition we just created.
118+
- **Output Graph Template**: A template for graph IRIs which will hold the results of a linking rule. It needs to include the placeholder `{name}`, for example `http://eccenca.com/user_rules/result_{name}`.
119+
- **Publication Graph Template**: A template for graph IRIs which will import the result graph once the results are published. This can be a simple graph IRI, for example `http://eccenca.com/user_rules/results_published`.
120+
- **Result Download Query**: A query that will be used to download the results of a linking rule. By default all resource IRIs will be listed as `resource1` and `resource2`. Whenever you want to provide other data via the *Download results* function, such as a specific identifier or a label instead of the IRI, this query can be adopted here.
121+
- **Annotation Class IRI** (optional): Rule results can be enriched with annotations. Instances of this class can be selected in the link rules interface. Instances have both a connection to the rule and the result. The connection is defined by the *Annotation Link Property IRI*. The values of the annotation are defined by the *Annotation Value Property IRI*. This relation is materialized as `rdf:value` in the output graph upon execution.
122+
- **Annotation Value Property IRI** (optional): Values of sub-properties of this property are actually connected as `rdf:values` to the generated links of a rule.
123+
- **Annotation Link Property IRI** (optional): The connection between a rule and an annotation resource (i.e. instance of *Annotation Class IRI*) is defined by this property.
124+
- **Annotation Graph IRI** (optional): The IRI of the graph, from which instances of the *Annotation Class IRI* are selected.
125+
126+
When the configuration is saved the *Link Rules module* should appear in the *Build* section of the menu.
127+
128+
129+
### Create a Link Rule Template
130+
131+
Templates can be managed at *Link Rules module* -> *Manage Templates*.
132+
133+
Create a new Link Rule Template. Such a template describes an abstract link rule with pre-defined settings.
134+
135+
- **Label**: A mandatory label for the template.
136+
- **Target Property**: The (default) connecting property for the derived link rules. The property can be individually set for each link rule later on.
137+
- **Input** group: The datasets which hold the subjects (source) and objects (target) to link.
138+
- **Source/Target Dataset**: The dataset holding the resources to link.
139+
- **Source/Target Resource Pattern**: A filter description template for the resources to link. This is a JSON object as described in [Graph Resource Pattern](#graph-resource-pattern). When creating a Link Rule based on this template these resource patterns can be altered. So this template may remain simple, but should provide sufficient help for the end user to define a proper resource selection.
140+
- **Output** group: The dataset which will hold the Link Rule results.
141+
- **Output Graph**: The graph IRI where to write the Link Rule results. Available placeholders: `{name}` for the Link Rules name.
142+
143+
##### <a name="graph-resource-pattern"></a> Graph Resource Pattern
144+
145+
This section specifies the JSON object used to provide a search filter configuration for source and target resources used for the Link Rule.
146+
147+
The source / target resources are always referred as variable `a`.
148+
149+
In the example below, resources are selected which are of type variable `class` and are referenced another resource named `subResource` by the property `http://example.com/vocab/hasParent`. The `class` variable is restricted to be one of `http://example.com/vocab/Company` or `http://example.com/vocab/Department`.
150+
151+
```json
152+
{
153+
"paths": [
154+
{
155+
"subjectVarName": "a",
156+
"predicate": "http://www.w3.org/1999/02/22-rdf-syntax-ns#type",
157+
"objectVarName": "class"
158+
},
159+
{
160+
"subjectVarName": "subResource",
161+
"predicate": "http://example.com/vocab/hasParent",
162+
"objectVarName": "a"
163+
}
164+
],
165+
"pathFilters": [
166+
{
167+
"varname": "class",
168+
"varIsAnyOneOfResource": [
169+
"http://example.com/vocab/Company",
170+
"http://example.com/vocab/Department"
171+
]
172+
}
173+
]
174+
}
175+
```
176+
177+
In the `paths` section triple patterns are defined using `subjectVarName`, `predicate`, `objectVarName`.
178+
179+
The `pathFilters` section defines restrictions on the variables defined above.
180+
The following path filter properties can be used:
181+
182+
- `isNoneOfLiteral`
183+
- `isNoneOfResource`
184+
- `varIsAnyOneOfLiteral`
185+
- `varIsAnyOneOfResource`
186+
- `literalFilters`
187+
- `GreaterThan`
188+
- `LessThan`
189+
- `GreaterEqualsThan`
190+
- `LessEqualThan`
191+
- `NotEquals`
192+
- `Contains`
193+
- `Regex`
300 KB
Loading
Lines changed: 159 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,159 @@
1+
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
2+
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
3+
@prefix shui: <https://vocab.eccenca.com/shui/> .
4+
@prefix owl: <http://www.w3.org/2002/07/owl#> .
5+
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
6+
@prefix sh: <http://www.w3.org/ns/shacl#> .
7+
@prefix shapes: <https://vocab.eccenca.com/shacl/> .
8+
@prefix dct: <http://purl.org/dc/terms/> .
9+
10+
# {{{ Link Rule Theme
11+
# {{{ Node Shape
12+
shapes:LinkRuleThemeNodeShape
13+
a sh:NodeShape ;
14+
shui:isSystemResource true ;
15+
sh:property
16+
shapes:defaultShapeLabel ,
17+
shapes:ThemeTargetProperty ,
18+
shapes:linkRuleTemplateSourceInput ,
19+
shapes:linkRuleTemplateSourceGraphResourcePattern ,
20+
shapes:linkRuleTemplateTargetInput ,
21+
shapes:linkRuleTemplateTargetGraphResourcePattern ,
22+
shapes:linkRuleTemplateOutputGraph ,
23+
shapes:linkRuleTemplateIntegrationGraph ;
24+
sh:targetClass <https://vocab.eccenca.com/di/Theme> ;
25+
sh:name "Link Rule Theme"@en , "Regeltemplate"@de ;
26+
rdfs:label "Link Rule Theme"@en , "Regeltemplate"@de ;
27+
.
28+
# }}}
29+
30+
# {{{ Group: Input
31+
shapes:linkRuleTemplateGroupInput
32+
a sh:PropertyGroup ;
33+
shui:isSystemResource true ;
34+
rdfs:label "Input"@en ;
35+
sh:order 20 ;
36+
.
37+
38+
shapes:ThemeTargetProperty
39+
a sh:PropertyShape ;
40+
rdfs:label "Target Property" ;
41+
shui:isSystemResource true ;
42+
sh:description "The (default) connecting property."@en ;
43+
sh:nodeKind sh:IRI ;
44+
sh:class rdfs:Property ;
45+
sh:minCount 1 ;
46+
sh:maxCount 1 ;
47+
sh:name "Target Property"@en ;
48+
sh:order 9 ;
49+
sh:path <https://vocab.eccenca.com/di/targetProperty> ;
50+
shui:denyNewResources true ;
51+
shui:showAlways true .
52+
53+
shapes:linkRuleTemplateSourceInput
54+
a sh:PropertyShape ;
55+
shui:isSystemResource true ;
56+
sh:description "The DataIntegration Dataset to be used for the link subjects."@en ;
57+
sh:nodeKind sh:IRI ;
58+
sh:class <https://vocab.eccenca.com/di/Dataset> ;
59+
sh:minCount 1 ;
60+
sh:maxCount 1 ;
61+
rdfs:label "Source Dataset" ;
62+
sh:name "Source Dataset"@en ;
63+
sh:order 10 ;
64+
sh:path <https://vocab.eccenca.com/di/sourceInput> ;
65+
shui:showAlways true ;
66+
shui:denyNewResources true ;
67+
sh:group shapes:linkRuleTemplateGroupInput ;
68+
.
69+
70+
shapes:linkRuleTemplateSourceGraphResourcePattern
71+
a sh:PropertyShape ;
72+
shui:isSystemResource true ;
73+
sh:description "A filter description template for resources used as the link subjects."@en ;
74+
sh:nodeKind sh:Literal ;
75+
sh:minCount 1 ;
76+
sh:maxCount 1 ;
77+
rdfs:label "Source Resource Pattern" ;
78+
sh:name "Source Resource Pattern"@en ;
79+
sh:order 20 ;
80+
sh:path <https://vocab.eccenca.com/di/sourceGraphResourcePattern> ;
81+
shui:showAlways true ;
82+
shui:textarea true ;
83+
shui:denyLanguageTag true ;
84+
sh:group shapes:linkRuleTemplateGroupInput ;
85+
.
86+
87+
shapes:linkRuleTemplateTargetInput
88+
a sh:PropertyShape ;
89+
shui:isSystemResource true ;
90+
sh:description "The DataIntegration Dataset to be used for the link objects."@en ;
91+
sh:nodeKind sh:IRI ;
92+
sh:class <https://vocab.eccenca.com/di/Dataset> ;
93+
sh:minCount 1 ;
94+
sh:maxCount 1 ;
95+
rdfs:label "Target Dataset" ;
96+
sh:name "Target Dataset"@en ;
97+
sh:order 30 ;
98+
sh:path <https://vocab.eccenca.com/di/targetInput> ;
99+
shui:showAlways true ;
100+
shui:denyNewResources true ;
101+
sh:group shapes:linkRuleTemplateGroupInput ;
102+
.
103+
104+
shapes:linkRuleTemplateTargetGraphResourcePattern
105+
a sh:PropertyShape ;
106+
shui:isSystemResource true ;
107+
sh:description "A filter description template for resources used as the link objects."@en ;
108+
sh:nodeKind sh:Literal ;
109+
sh:minCount 1 ;
110+
sh:maxCount 1 ;
111+
rdfs:label "Target Resource Pattern" ;
112+
sh:name "Target Resource Pattern"@en ;
113+
sh:order 40 ;
114+
sh:path <https://vocab.eccenca.com/di/targetGraphResourcePattern> ;
115+
shui:showAlways true ;
116+
shui:textarea true ;
117+
shui:denyLanguageTag true ;
118+
sh:group shapes:linkRuleTemplateGroupInput ;
119+
.
120+
# }}}
121+
122+
# {{{ Group: Output
123+
shapes:linkRuleTemplateGroupOutput
124+
a sh:PropertyGroup ;
125+
shui:isSystemResource true ;
126+
rdfs:label "Output"@en ;
127+
sh:order 30 ;
128+
.
129+
130+
shapes:linkRuleTemplateOutputGraph
131+
a sh:PropertyShape ;
132+
shui:isSystemResource true ;
133+
sh:description "The graph where to write the Link Rule results. Available placeholders: `{name}` for the Link Rules name."@en ;
134+
sh:nodeKind sh:Literal ;
135+
sh:minCount 1 ;
136+
sh:maxCount 1 ;
137+
rdfs:label "Output Graph" ;
138+
sh:name "Output Graph"@en ;
139+
sh:order 10 ;
140+
sh:path <https://vocab.eccenca.com/di/outputgraph> ;
141+
shui:showAlways true ;
142+
shui:denyLanguageTag true ;
143+
sh:group shapes:linkRuleTemplateGroupOutput ;
144+
.
145+
146+
shapes:linkRuleTemplateIntegrationGraph
147+
a sh:PropertyShape ;
148+
shui:isSystemResource true ;
149+
sh:description "The graph where to import the Output Graph on Publication."@en ;
150+
sh:nodeKind sh:IRI ;
151+
sh:maxCount 1 ;
152+
rdfs:label "Integration Graph" ;
153+
sh:name "Integration Graph"@en ;
154+
sh:order 20 ;
155+
sh:path <https://vocab.eccenca.com/di/integrationGraph> ;
156+
sh:group shapes:linkRuleTemplateGroupOutput ;
157+
.
158+
# }}}
159+

0 commit comments

Comments
 (0)