cmem-plugin-reason 1.0.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- cmem_plugin_reason/__init__.py +1 -0
- cmem_plugin_reason/doc/__init__.py +9 -0
- cmem_plugin_reason/doc/reason_doc.md +155 -0
- cmem_plugin_reason/doc/validate_doc.md +62 -0
- cmem_plugin_reason/file-icons--owl.svg +3 -0
- cmem_plugin_reason/fluent--brain-circuit-24-regular.svg +3 -0
- cmem_plugin_reason/plugin_reason.py +527 -0
- cmem_plugin_reason/plugin_validate.py +300 -0
- cmem_plugin_reason/robot.jar +0 -0
- cmem_plugin_reason/utils.py +245 -0
- cmem_plugin_reason-1.0.0.dist-info/LICENSE +201 -0
- cmem_plugin_reason-1.0.0.dist-info/METADATA +38 -0
- cmem_plugin_reason-1.0.0.dist-info/RECORD +14 -0
- cmem_plugin_reason-1.0.0.dist-info/WHEEL +4 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"""reason - main package"""
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
A task performing OWL reasoning. With an OWL ontology and a data graph as input the reasoning result is written to a specified graph.
|
|
2
|
+
|
|
3
|
+
## Options
|
|
4
|
+
|
|
5
|
+
### Data graph IRI
|
|
6
|
+
|
|
7
|
+
The IRI of the input data graph. The graph IRI is selected from a list of graphs of types `di:Dataset`, `void:Dataset`
|
|
8
|
+
and `owl:Ontology`.
|
|
9
|
+
|
|
10
|
+
### Ontology graph IRI
|
|
11
|
+
|
|
12
|
+
The IRI of the input ontology graph. The graph IRI is selected from a list of graphs of type`owl:Ontology`.
|
|
13
|
+
|
|
14
|
+
### Output graph IRI
|
|
15
|
+
|
|
16
|
+
The IRI of the output graph for the reasoning result.
|
|
17
|
+
|
|
18
|
+
⚠️ Existing graphs will be overwritten.
|
|
19
|
+
|
|
20
|
+
### Reasoner
|
|
21
|
+
|
|
22
|
+
The following reasoner options are supported:
|
|
23
|
+
- [ELK](https://code.google.com/p/elk-reasoner/) (elk)
|
|
24
|
+
- [Expression Materializing Reasoner](http://static.javadoc.io/org.geneontology/expression-materializing-reasoner/0.1.3/org/geneontology/reasoner/ExpressionMaterializingReasoner.html) (emr)
|
|
25
|
+
- [HermiT](http://www.hermit-reasoner.com/) (hermit)
|
|
26
|
+
- [JFact](http://jfact.sourceforge.net/) (jfact)
|
|
27
|
+
- [Structural Reasoner](http://owlcs.github.io/owlapi/apidocs_4/org/semanticweb/owlapi/reasoner/structural/StructuralReasoner.html) (structural)
|
|
28
|
+
- [Whelk](https://github.com/balhoff/whelk) (whelk)
|
|
29
|
+
|
|
30
|
+
### Generated Axioms
|
|
31
|
+
|
|
32
|
+
The plugin provides the following parameters to include inferred axiom generators:
|
|
33
|
+
|
|
34
|
+
#### Class axiom generators
|
|
35
|
+
- **Class inclusion (rdfs:subClassOf)**
|
|
36
|
+
The reasoner will infer assertions about the hierarchy of classes, i.e.
|
|
37
|
+
`SubClassOf:` statements.
|
|
38
|
+
If there are classes `Person`, `Student` and `Professor`, such that `Person DisjointUnionOf:
|
|
39
|
+
Student, Professor` holds, the reasoner will infer `Student SubClassOf: Person`.
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
- **Class equivalence (owl:equivalentClass)**
|
|
43
|
+
The reasoner will infer assertions about the equivalence of classes, i.e.
|
|
44
|
+
`EquivalentTo:` statements.
|
|
45
|
+
If there are classes `Person`, `Student` and `Professor`, such that `Person DisjointUnionOf:
|
|
46
|
+
Student, Professor` holds, the reasoner will infer `Person EquivalentTo: Student and Professor`.
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
- **Class disjointness (owl:disjointWith)**
|
|
50
|
+
The reasoner will infer assertions about the disjointness of classes, i.e.
|
|
51
|
+
`DisjointClasses:` statements.
|
|
52
|
+
If there are classes `Person`, `Student` and `Professor`, such that `Person DisjointUnionOf:
|
|
53
|
+
Student, Professor` holds, the reasoner will infer `DisjointClasses: Student, Professor`.
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
- **Data property equivalence (owl:equivalentProperty)**
|
|
57
|
+
The reasoner will infer axioms about the equivalence of data properties,
|
|
58
|
+
i.e. `EquivalentProperties` statements.
|
|
59
|
+
If there are data properties `identifier` and `enrollmentNumber`, such that `enrollmentNumber
|
|
60
|
+
SubPropertyOf: identifier` and `identifier SubPropertyOf: enrollmentNumber` holds, the reasoner
|
|
61
|
+
will infer `Student EquivalentProperties: identifier, enrollmentNumber`.
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
- **Data property inclusion (rdfs:subPropertyOf)**
|
|
65
|
+
The reasoner will infer axioms about the hierarchy of data properties,
|
|
66
|
+
i.e. `SubPropertyOf:` statements.
|
|
67
|
+
If there are data properties `identifier`, `studentIdentifier` and `enrollmentNumber`, such that
|
|
68
|
+
`studentIdentifier SubPropertyOf: identifier` and `enrollmentNumber SubPropertyOf:
|
|
69
|
+
studentIdentifier` holds, the reasoner will infer `enrollmentNumber SubPropertyOf: identifier`.
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
#### Individual axiom generators
|
|
73
|
+
- **Individual class assertions (rdf:type)**
|
|
74
|
+
The reasoner will infer assertions about the classes of individuals, i.e.
|
|
75
|
+
`Types:` statements.
|
|
76
|
+
Assume, there are classes `Person`, `Student` and `University` as well as the property
|
|
77
|
+
`enrolledIn`, such that `Student EquivalentTo: Person and enrolledIn some University` holds. For
|
|
78
|
+
the individual `John` with the assertions `John Types: Person; Facts: enrolledIn
|
|
79
|
+
LeipzigUniversity`, the reasoner will infer `John Types: Student`.
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
- **Individual property assertions**
|
|
83
|
+
The reasoner will infer assertions about the properties of individuals,
|
|
84
|
+
i.e. `Facts:` statements.
|
|
85
|
+
Assume, there are properties `enrolledIn` and `offers`, such that `enrolled SubPropertyChain:
|
|
86
|
+
enrolledIn o inverse (offers)` holds. For the individuals `John`and `LeipzigUniversity` with the
|
|
87
|
+
assertions `John Facts: enrolledIn KnowledgeRepresentation` and `LeipzigUniversity Facts: offers
|
|
88
|
+
KnowledgeRepresentation`, the reasoner will infer `John Facts: enrolledIn LeipzigUniversity`.
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
#### Object property axiom generators
|
|
92
|
+
- **Object property equivalence (owl:equivalentProperty)**
|
|
93
|
+
The reasoner will infer assertions about the equivalence of object
|
|
94
|
+
properties, i.e. `EquivalentTo:` statements.
|
|
95
|
+
If there are object properties `hasAlternativeLecture` and `hasSameTopicAs`, such that
|
|
96
|
+
`hasAlternativeLecture Characteristics: Symmetric` and `hasSameTopicAs InverseOf:
|
|
97
|
+
hasAlternativeLecture` holds, the reasoner will infer `EquivalentProperties: hasAlternativeLecture,
|
|
98
|
+
hasSameTopicAs`.
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
- **Object property inversion (owl:inverseOf)**
|
|
102
|
+
The reasoner will infer axioms about the inversion about object
|
|
103
|
+
properties, i.e. `InverseOf:` statements.
|
|
104
|
+
If there is a object property `hasAlternativeLecture`, such that `hasAlternativeLecture
|
|
105
|
+
Characteristics: Symmetric` holds, the reasoner will infer `hasAlternativeLecture InverseOf:
|
|
106
|
+
hasAlternativeLecture`.
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
- **Object property inclusion (rdfs:subPropertyOf)**
|
|
110
|
+
The reasoner will infer axioms about the inclusion of object properties,
|
|
111
|
+
i.e. `SubPropertyOf:` statements.
|
|
112
|
+
If there are object properties `enrolledIn`, `studentOf` and `hasStudent`, such that `enrolledIn
|
|
113
|
+
SubPropertyOf: studentOf` and `enrolledIn InverseOf: hasStudent` holds, the reasoner will infer
|
|
114
|
+
`hasStudent SubPropertyOf: inverse (studentOf)`.
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
- **Object property ranges (rdfs:range)**
|
|
118
|
+
The reasoner will infer axioms about the ranges of object properties,
|
|
119
|
+
i.e. `Range:` statements.
|
|
120
|
+
If there are classes `Student` and `Lecture` as wells as object properties `hasStudent` and
|
|
121
|
+
`enrolledIn`, such that `hasStudent Range: Student and enrolledIn some Lecture` holds, the
|
|
122
|
+
reasoner will infer `hasStudent Range: Student`.
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
- **Object property domains (rdfs:domain)**
|
|
126
|
+
The reasoner will infer axioms about the domains of object
|
|
127
|
+
properties, i.e. `Domain:` statements.
|
|
128
|
+
If there are classes `Person`, `Student` and `Professor` as wells as the object property
|
|
129
|
+
`hasRoleIn`, such that `Professor SubClassOf: Person`, `Student SubClassOf: Person` and
|
|
130
|
+
`hasRoleIn Domain: Professor or Student` holds, the reasoner will infer `hasRoleIn Domain: Person`.
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
### Validate OWL2 profiles
|
|
134
|
+
|
|
135
|
+
Validate the input ontology against OWL profiles (DL, EL, QL, RL, and Full) and annotate the result graph.
|
|
136
|
+
|
|
137
|
+
### Process valid OWL profiles from input
|
|
138
|
+
|
|
139
|
+
If enabled along with the "Validate OWL2 profiles" parameter, the valid profiles, ontology IRI and reasoner option is
|
|
140
|
+
taken from the config port input (parameters "valid_profiles", "ontology_graph_iri" and "reasoner") and the OWL2
|
|
141
|
+
profiles validation is not done in the plugin. The valid profiles input is a comma-separated string (e.g. "Full,DL").
|
|
142
|
+
|
|
143
|
+
### Add ontology graph import to result graph
|
|
144
|
+
|
|
145
|
+
Add the triple `<output_graph_iri> owl:imports <ontology_graph_iri>` to the output graph.
|
|
146
|
+
|
|
147
|
+
### Add result graph import to ontology graph
|
|
148
|
+
|
|
149
|
+
Add the triple `<ontology_graph_iri> owl:imports <output_graph_iri>` to the ontology graph
|
|
150
|
+
|
|
151
|
+
### Maximum RAM Percentage
|
|
152
|
+
|
|
153
|
+
Maximum heap size for the Java virtual machine in the DI container running the reasoning process.
|
|
154
|
+
|
|
155
|
+
⚠️ Setting the percentage too high may result in an out of memory error.
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
A task validating the consistency of an OWL ontology and generating an explanation if inconsistencies are found.
|
|
2
|
+
The plugin outputs the explanation as text in Markdown format on the path "markdown", the ontology IRI on the path
|
|
3
|
+
"ontology_graph_iri", and, if enabled, the valid OWL2 profiles on the path "valid_profiles" as a comma-separated string.
|
|
4
|
+
|
|
5
|
+
## Options
|
|
6
|
+
|
|
7
|
+
### Ontology graph IRI
|
|
8
|
+
|
|
9
|
+
The IRI of the input ontology graph. The graph IRI is selected from a list of graphs of type`owl:Ontology`.
|
|
10
|
+
|
|
11
|
+
### Reasoner
|
|
12
|
+
|
|
13
|
+
The following reasoner options are supported:
|
|
14
|
+
- [ELK](https://code.google.com/p/elk-reasoner/) (elk)
|
|
15
|
+
- [Expression Materializing Reasoner](http://static.javadoc.io/org.geneontology/expression-materializing-reasoner/0.1.3/org/geneontology/reasoner/ExpressionMaterializingReasoner.html) (emr)
|
|
16
|
+
- [HermiT](http://www.hermit-reasoner.com/) (hermit)
|
|
17
|
+
- [JFact](http://jfact.sourceforge.net/) (jfact)
|
|
18
|
+
- [Structural Reasoner](http://owlcs.github.io/owlapi/apidocs_4/org/semanticweb/owlapi/reasoner/structural/StructuralReasoner.html) (structural)
|
|
19
|
+
- [Whelk](https://github.com/balhoff/whelk) (whelk)
|
|
20
|
+
|
|
21
|
+
### Produce output graph
|
|
22
|
+
|
|
23
|
+
If enabled, an explanation graph is created.
|
|
24
|
+
|
|
25
|
+
### Output graph IRI
|
|
26
|
+
|
|
27
|
+
The IRI of the output graph for the reasoning result.
|
|
28
|
+
|
|
29
|
+
⚠️ Existing graphs will be overwritten.
|
|
30
|
+
|
|
31
|
+
### Write markdown explanation file
|
|
32
|
+
|
|
33
|
+
If enabled, an explanation markdown file is written to the project.
|
|
34
|
+
|
|
35
|
+
### Output filename
|
|
36
|
+
|
|
37
|
+
The filename of the Markdown file with the explanation of inconsistencies.
|
|
38
|
+
|
|
39
|
+
⚠️ Existing files will be overwritten.
|
|
40
|
+
|
|
41
|
+
### Stop at inconsistencies
|
|
42
|
+
Raise an error if inconsistencies are found. If enabled, the plugin does not output entities.
|
|
43
|
+
|
|
44
|
+
### Validate OWL2 profiles
|
|
45
|
+
|
|
46
|
+
Validate the input ontology against OWL profiles (DL, EL, QL, RL, and Full) and annotate the result graph.
|
|
47
|
+
|
|
48
|
+
### Mode
|
|
49
|
+
Mode _inconsistency_ generates an explanation for an inconsistent ontology.
|
|
50
|
+
Mode _unsatisfiability_ generates explanations for many unsatisfiable classes at once.
|
|
51
|
+
|
|
52
|
+
### Output entities
|
|
53
|
+
|
|
54
|
+
Output entities. The plugin outputs the explanation as text in Markdown format on the path "markdown", the ontology IRI
|
|
55
|
+
on the path "ontology_graph_iri", the reasoner option on the path "reasoner", and, if enabled, the valid OWL2 profiles
|
|
56
|
+
on the path "valid_profiles".
|
|
57
|
+
|
|
58
|
+
### Maximum RAM Percentage
|
|
59
|
+
|
|
60
|
+
Maximum heap size for the Java virtual machine in the DI container running the reasoning process.
|
|
61
|
+
|
|
62
|
+
⚠️ Setting the percentage too high may result in an out of memory error.
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="192" height="192" viewBox="0 -70 318 660">
|
|
2
|
+
<path fill="currentColor" d="M177.166 98.524c-.478-12.263-15.163-18.38-22.209-23.128c-5.673-3.823-38.6 14.775-51.524 23.176C87.507 108.924 91.17 131.38 91.17 131.38c-4.3 4.618-6.447 7.12-7.803 14.81c-.956 5.415 1.374 10.93 2.548 16.085c.948 4.167.796 7.326.796 7.326c-10.51 3.185-18.155 14.81-18.155 14.81H65.37c-2.07-3.026-3.822-24.525-.319-30.417c25.815-19.33.478-39.336-25.799-50.165c-6.15-2.535-10.715-.843-15.448.159c-21.817 4.618-3.98 56.057-3.98 56.057v6.052s-21.339-45.37-19.74-57.249c1.168-8.671 9.496-16.825 17.82-18.733c2.883-.66.029-8.067 1.599-15.763c2.023-9.916 11.008-22.51 11.008-22.51c5.25 6.29 12.271 33.13 12.271 33.13l18.456.068s78.826-34.362 88.627-36.928L169.023 0c12.994 8.796 20.814 26.243 21.417 48.565c0 0 18.504 2.379 28.958 14.177c21.116 23.83 24.692 58.01 54.297 81.445c12.709 10.06 24.19 18.123 31.842 34.777c17.331 37.724 16.908 99.5-8.206 139.012c0 0-62.748 92.674-58.887 116.808c3.862 24.134 29.926 25.582 66.127 25.582l-27.119 37.623c-52.279 10.376-114.648 35.021-108.514-24.108c0 0-99.528 55.17-137.08 29.926c-13.405-9.01-39.58-88.798-19.79-147.489c4.835-14.337 15.102-33.453 28.96-49.444c31.375-36.2 55.026-52.612 72.383-68.603c13.327-12.28 24.758-16.326 29.463-24.071c9.82-16.167 1.908-28.871 1.908-28.871c18.856-7.63 31.55-19.525 36.147-27.856c5.242-9.504-5.638-8.788-5.638-8.788s10.422-12.447 13.1-22.716c.445-1.711-3.163-4.773-2.82-6.467c1.212-5.98 2.156-14.26.664-16.747c-4.79-7.982-9.07-4.231-9.07-4.231m-78.098 333.7c60.242-6.348 73.571-32.193 73.41-33.319c0 0-26.753-.75-30.347-1.412c-5.009-.923-6.586-3.33-6.586-3.33c67.926 1.776 96.42-39.482 116.414-73.774c28.447-48.786 10.061-104.347-4.7-140.479c-46.602 35.799-137.289 98.357-176.304 154.477c-29.71 42.734-2.358 141.997 6.975 151.455c9.332 9.457 82.707-53.694 82.707-53.694c-27.147 7.352-50.58 10.594-61.569.076M64.738 130.54c.578 8.233-4.915 20.56-20.584 21.865c-15.668 1.306-25.25-13.594-25.35-17.965c-.288-12.711 9.39-18.056 21.09-18.056s24.266 5.923 24.844 14.156m-9.64 6.28c.794-8.942-3.378-12.518-13.908-12.915c-10.53-.398-13.908 7.351-10.73 14.9c3.18 7.55 23.842 6.955 24.637-1.986m48.033-15.205c1.439-7.435 5.764-19.656 29.977-20.625c29.977-1.199 34.184 21.672 29.737 32.376c-6.475 15.588-27.818 26.38-43.407 15.108s-17.746-19.425-16.307-26.86m13.67 7.914s5.515 11.75 18.226 10.552c12.71-1.2 16.307-10.792 16.787-16.068c.215-2.373-1.631-8.686-6.475-11.511c-5.928-3.457-15.537-3.071-21.344-.96c-10.552 3.837-7.195 17.987-7.195 17.987"/>
|
|
3
|
+
</svg>
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="192" height="192" viewBox="-2 0 28 24">
|
|
2
|
+
<path fill="currentColor" d="M7.152 3.012c.832-.648 1.92-1.006 3.001-1.006c.647 0 1.17.222 1.567.575q.16.144.287.304q.127-.16.287-.304c.397-.353.92-.575 1.567-.575c1.081 0 2.17.358 3 1.006c.648.503 1.155 1.198 1.354 2.037c.42.07.793.284 1.095.567c.48.451.823 1.103 1.038 1.774c.219.681.328 1.446.295 2.181c-.017.376-.072.76-.177 1.127l.065.03c.37.174.67.447.895.81c.425.685.575 1.671.575 2.928c0 1.445-.553 2.426-1.263 3.035a3.45 3.45 0 0 1-1.27.69a5.2 5.2 0 0 1-1.018 2.137c-.723.904-1.847 1.668-3.357 1.668c-1.21 0-2.163-.67-2.775-1.31a5 5 0 0 1-.31-.357a5 5 0 0 1-.311.356c-.612.642-1.565 1.311-2.775 1.311c-1.511 0-2.635-.764-3.357-1.668a5.2 5.2 0 0 1-1.02-2.137a3.45 3.45 0 0 1-1.269-.69c-.71-.61-1.262-1.59-1.262-3.035c0-1.257.15-2.243.574-2.928a2.1 2.1 0 0 1 .96-.84a5 5 0 0 1-.177-1.127c-.033-.735.076-1.5.295-2.181c.215-.67.557-1.323 1.038-1.774a2.1 2.1 0 0 1 1.095-.567c.2-.84.706-1.534 1.353-2.037m.922 1.183c-.546.425-.866.991-.866 1.643a.75.75 0 0 1-.987.711c-.137-.046-.282-.035-.49.161c-.232.217-.467.61-.637 1.138a4.8 4.8 0 0 0-.224 1.656c.025.556.157 1.018.365 1.33a.8.8 0 0 1 .083.166H6.4a2.85 2.85 0 0 1 2.843 2.642a2 2 0 1 1-1.507.01A1.35 1.35 0 0 0 6.4 12.5H3.775c-.15.348-.261.949-.261 1.966c0 1.021.371 1.581.739 1.897c.403.345.846.435.974.435a.75.75 0 0 1 .75.75c0 .42.232 1.183.76 1.843c.508.637 1.232 1.105 2.185 1.105c.637 0 1.223-.358 1.69-.846c.226-.238.402-.485.518-.685a2 2 0 0 0 .115-.233l.006-.014V9.25h-.896a2 2 0 1 1 0-1.5h.896V5.212l-.003-.057a3.3 3.3 0 0 0-.18-.903c-.09-.24-.207-.427-.345-.55c-.123-.11-.293-.196-.57-.196c-.766 0-1.525.258-2.08.69M12.764 17v1.718l.005.014q.03.08.116.233c.115.2.291.447.518.685c.466.488 1.053.846 1.69.846c.952 0 1.676-.468 2.185-1.105c.527-.66.76-1.424.76-1.843a.75.75 0 0 1 .75-.75c.128 0 .57-.09.974-.435c.367-.316.738-.876.738-1.897c0-1.208-.158-1.83-.349-2.137a.6.6 0 0 0-.26-.245c-.101-.048-.253-.084-.488-.084a.75.75 0 0 1-.624-1.166c.208-.312.34-.774.366-1.33a4.8 4.8 0 0 0-.225-1.656c-.17-.528-.405-.92-.636-1.138c-.209-.196-.354-.207-.49-.161a.75.75 0 0 1-.988-.711c0-.652-.32-1.218-.866-1.643c-.553-.431-1.313-.69-2.08-.69c-.276 0-.445.087-.569.196a1.4 1.4 0 0 0-.344.55a3 3 0 0 0-.183.961V15.5h.636a1.35 1.35 0 0 0 1.35-1.35v-1.795a2 2 0 1 1 1.5 0v1.795A2.85 2.85 0 0 1 13.4 17zM8.5 8a.5.5 0 1 0 0 1a.5.5 0 0 0 0-1M8 15.5a.5.5 0 1 0 1 0a.5.5 0 0 0-1 0m7-5a.5.5 0 1 0 1 0a.5.5 0 0 0-1 0" />
|
|
3
|
+
</svg>
|