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: doc/tutorial.rst
+8-10Lines changed: 8 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -983,12 +983,14 @@ A cardinality is set via its convenience method:
983
983
>>> # or
984
984
>>> prop.val_cardinality =None
985
985
986
+
Please note that a set cardinality is not enforced. Users can set less or more entities than are specified allowed via a cardinality. Instead whenever a cardinality is not met, a warning message is displayed and any unment cardinality will show up as a Validation warning message whenever a document is saved or loaded.
987
+
986
988
Working with Validations
987
989
------------------------
988
990
989
991
odML Validations are a set of pre-defined checks that are run against an odML document automatically when it is saved or loaded. A document cannot be saved, if a Validation fails a check that is classified as an Error. Most validation checks are Warnings that are supposed to raise the overall data quality of the odml Document.
990
992
991
-
When an odML document is saved or loaded, tha automatic validation will print a short report of encountered Validation Warnings and it is up to the user whether they want to resolve the Warnings. The odML document provides the ``validate`` method to gain easy access to the default validations. A Validation in turn provides not only a specific description of all encountered warnings or errors within an odML document, but it also provides direct access to each and every odML entity i.e. an odml.Section or an odml.Property where am issue has been found. This enables the user to quickly access and fix an encountered issue.
993
+
When an odML document is saved or loaded, tha automatic validation will print a short report of encountered Validation Warnings and it is up to the user whether they want to resolve the Warnings. The odML document provides the ``validate`` method to gain easy access to the default validations. A Validation in turn provides not only a specific description of all encountered warnings or errors within an odML document, but it also provides direct access to each and every odML entity i.e. an ``odml.Section`` or an ``odml.Property`` where an issue has been found. This enables the user to quickly access and fix an encountered issue.
992
994
993
995
A minimal example shows how a workflow using default validations might look like:
994
996
@@ -1013,7 +1015,7 @@ This will show that the validation has encountered two Warnings and also display
1013
1015
>>> ValidationWarning: Section[73f29acd-16ae-47af-afc7-371d57898e28] 'Section type not specified'
1014
1016
>>> ValidationWarning: Section[73f29acd-16ae-47af-afc7-371d57898e28] 'Name not assigned'
1015
1017
1016
-
To fix the "Name not assigned" warning the Section can be accessed via the validation entry and used to directly assign a human readable name to Section in the original document. Re-running the validation will show, that the warning has been removed.
1018
+
To fix the "Name not assigned" warning the Section can be accessed via the validation entry and used to directly assign a human readable name to the Section in the original document. Re-running the validation will show, that the warning has been removed.
>>> # Check that the section name has been changed in the document
@@ -1025,7 +1027,7 @@ To fix the "Name not assigned" warning the Section can be accessed via the valid
1025
1027
1026
1028
Similarly the second validation warning can be resolved before saving the document again.
1027
1029
1028
-
Please note that the automatic validation is run whenever a document is saved or loaded using the ``odml.save`` and ``odml.load`` functions as well as the ``ODMLWriter`` or the ``ODMLReader``. The validation is not run when using any of the lower level ``xmlparser``, ``dict_parser`` or ``rdf_converter`` classes.
1030
+
Please note that the automatic validation is run whenever a document is saved or loaded using the ``odml.save`` and ``odml.load`` functions as well as the ``ODMLWriter`` or the ``ODMLReader`` class. The validation is not run when using any of the lower level ``xmlparser``, ``dict_parser`` or ``rdf_converter`` classes.
1029
1031
1030
1032
List of available default validations
1031
1033
*************************************
@@ -1114,7 +1116,7 @@ Users can write their own validation and register them either with the default v
1114
1116
1115
1117
A custom validation handler needs to ``yield`` a ``ValidationError``. See the ``validation.ValidationError`` class for details.
1116
1118
1117
-
Custom validation handlers can be registered to be applied on ``odML`` (the odml Document), ``section`` or ``property``.
1119
+
Custom validation handlers can be registered to be applied on "odML" (the odml Document), "section" or "property".
1118
1120
1119
1121
>>> import odml
1120
1122
>>> import odml.validation as oval
@@ -1141,8 +1143,8 @@ Custom validation handlers can be registered to be applied on ``odML`` (the odml
1141
1143
>>> # Display the errors reported by the validation
1142
1144
>>> print(custom_validation.errors)
1143
1145
1144
-
Advanced knowledge on Values
1145
-
----------------------------
1146
+
Advanced Value features
1147
+
-----------------------
1146
1148
1147
1149
Data type conversions
1148
1150
*********************
@@ -1178,8 +1180,6 @@ converted to integer and then back to float::
1178
1180
1179
1181
Links & Includes
1180
1182
****************
1181
-
Please note, that this section is outdated but still valid.
1182
-
1183
1183
Sections can be linked to other Sections, so that they include their defined
1184
1184
attributes. A link can be within the document (``link`` property) or to an
1185
1185
external one (``include`` property).
@@ -1211,8 +1211,6 @@ then set merge with the new object.
1211
1211
1212
1212
Terminologies
1213
1213
*************
1214
-
Please note, that this section is outdated but still valid.
1215
-
1216
1214
odML supports terminologies that are data structure templates for typical use cases.
1217
1215
Sections can have a ``repository`` attribute. As repositories can be inherited,
1218
1216
the current applicable one can be obtained using the
0 commit comments