11# Auto generated from validation.yaml by pythongen.py version: 0.9.0
2- # Generation date: 2022-05-19T21:54:12
2+ # Generation date: 2023-06-29T10:29:33
33# Schema: reporting
44#
55# id: https://w3id.org/linkml/reporting
6- # description: A datamodel for reports on data
6+ # description: A datamodel for reports on data, based on SHACL
77# license: https://creativecommons.org/publicdomain/zero/1.0/
88
99import dataclasses
10- import sys
1110import re
1211from jsonasobj2 import JsonObj , as_dict
1312from typing import Optional , List , Union , Dict , ClassVar , Any
1413from dataclasses import dataclass
14+ from linkml_runtime .linkml_model .meta import EnumDefinition , PermissibleValue , PvFormulaOptions
1515
1616from linkml_runtime .utils .slot import Slot
1717from linkml_runtime .utils .metamodelcore import empty_list , empty_dict , bnode
2121from linkml_runtime .utils .enumerations import EnumDefinitionImpl
2222from rdflib import Namespace , URIRef
2323from linkml_runtime .utils .curienamespace import CurieNamespace
24- from .types import Nodeidentifier , String
24+ from linkml_runtime . linkml_model .types import Nodeidentifier , String
2525from linkml_runtime .utils .metamodelcore import NodeIdentifier
2626
2727metamodel_version = "1.7.0"
@@ -91,7 +91,7 @@ class ValidationResult(YAMLRoot):
9191 predicate : Optional [Union [str , NodeIdentifier ]] = None
9292 object : Optional [Union [str , NodeIdentifier ]] = None
9393 object_str : Optional [str ] = None
94- source : Optional [Union [str , NodeIdentifier ]] = None
94+ node_source : Optional [Union [str , NodeIdentifier ]] = None
9595 info : Optional [str ] = None
9696
9797 def __post_init__ (self , * _ : List [str ], ** kwargs : Dict [str , Any ]):
@@ -116,8 +116,8 @@ def __post_init__(self, *_: List[str], **kwargs: Dict[str, Any]):
116116 if self .object_str is not None and not isinstance (self .object_str , str ):
117117 self .object_str = str (self .object_str )
118118
119- if self .source is not None and not isinstance (self .source , NodeIdentifier ):
120- self .source = NodeIdentifier (self .source )
119+ if self .node_source is not None and not isinstance (self .node_source , NodeIdentifier ):
120+ self .node_source = NodeIdentifier (self .node_source )
121121
122122 if self .info is not None and not isinstance (self .info , str ):
123123 self .info = str (self .info )
@@ -128,18 +128,24 @@ def __post_init__(self, *_: List[str], **kwargs: Dict[str, Any]):
128128# Enumerations
129129class ProblemType (EnumDefinitionImpl ):
130130
131- undeclared_slot = PermissibleValue (text = "undeclared_slot" ,
132- description = "Applies when a slot is used in data but the slot is undeclared in the datamodel" )
133- inapplicable_slot = PermissibleValue (text = "inapplicable_slot" ,
134- description = "Applies when a slot is used in an instance of a class where the slot is not applicable for that class" )
135- missing_slot_value = PermissibleValue (text = "missing_slot_value" ,
136- description = "Applies when an instance of a class has a required slot which is not filled in" )
137- slot_range_violation = PermissibleValue (text = "slot_range_violation" ,
138- description = "Applies when the value of a slot is inconsistent with the declared range" )
139- max_count_violation = PermissibleValue (text = "max_count_violation" ,
140- meaning = SH .MaxCountConstraintComponent )
141- parsing_error = PermissibleValue (text = "parsing_error" ,
142- description = "The data could not be parsed" )
131+ undeclared_slot = PermissibleValue (
132+ text = "undeclared_slot" ,
133+ description = "Applies when a slot is used in data but the slot is undeclared in the datamodel" )
134+ inapplicable_slot = PermissibleValue (
135+ text = "inapplicable_slot" ,
136+ description = """Applies when a slot is used in an instance of a class where the slot is not applicable for that class""" )
137+ missing_slot_value = PermissibleValue (
138+ text = "missing_slot_value" ,
139+ description = "Applies when an instance of a class has a required slot which is not filled in" )
140+ slot_range_violation = PermissibleValue (
141+ text = "slot_range_violation" ,
142+ description = "Applies when the value of a slot is inconsistent with the declared range" )
143+ max_count_violation = PermissibleValue (
144+ text = "max_count_violation" ,
145+ meaning = SH .MaxCountConstraintComponent )
146+ parsing_error = PermissibleValue (
147+ text = "parsing_error" ,
148+ description = "The data could not be parsed" )
143149
144150 _defn = EnumDefinition (
145151 name = "ProblemType" ,
@@ -148,16 +154,50 @@ class ProblemType(EnumDefinitionImpl):
148154class SeverityOptions (EnumDefinitionImpl ):
149155
150156 FATAL = PermissibleValue (text = "FATAL" )
151- ERROR = PermissibleValue (text = "ERROR" ,
152- meaning = SH .Violation )
153- WARNING = PermissibleValue (text = "WARNING" ,
154- meaning = SH .Warning )
155- INFO = PermissibleValue (text = "INFO" ,
156- meaning = SH .Info )
157+ ERROR = PermissibleValue (
158+ text = "ERROR" ,
159+ meaning = SH .Violation )
160+ WARNING = PermissibleValue (
161+ text = "WARNING" ,
162+ meaning = SH .Warning )
163+ INFO = PermissibleValue (
164+ text = "INFO" ,
165+ meaning = SH .Info )
157166
158167 _defn = EnumDefinition (
159168 name = "SeverityOptions" ,
160169 )
161170
162171# Slots
172+ class slots :
173+ pass
163174
175+ slots .type = Slot (uri = SH .sourceConstraintComponent , name = "type" , curie = SH .curie ('sourceConstraintComponent' ),
176+ model_uri = REPORTING .type , domain = None , range = Optional [Union [str , NodeIdentifier ]])
177+
178+ slots .subject = Slot (uri = SH .focusNode , name = "subject" , curie = SH .curie ('focusNode' ),
179+ model_uri = REPORTING .subject , domain = None , range = Optional [Union [str , NodeIdentifier ]])
180+
181+ slots .instantiates = Slot (uri = REPORTING .instantiates , name = "instantiates" , curie = REPORTING .curie ('instantiates' ),
182+ model_uri = REPORTING .instantiates , domain = None , range = Optional [Union [str , NodeIdentifier ]])
183+
184+ slots .predicate = Slot (uri = REPORTING .predicate , name = "predicate" , curie = REPORTING .curie ('predicate' ),
185+ model_uri = REPORTING .predicate , domain = None , range = Optional [Union [str , NodeIdentifier ]])
186+
187+ slots .object = Slot (uri = SH .value , name = "object" , curie = SH .curie ('value' ),
188+ model_uri = REPORTING .object , domain = None , range = Optional [Union [str , NodeIdentifier ]])
189+
190+ slots .object_str = Slot (uri = REPORTING .object_str , name = "object_str" , curie = REPORTING .curie ('object_str' ),
191+ model_uri = REPORTING .object_str , domain = None , range = Optional [str ])
192+
193+ slots .node_source = Slot (uri = REPORTING .node_source , name = "node_source" , curie = REPORTING .curie ('node_source' ),
194+ model_uri = REPORTING .node_source , domain = None , range = Optional [Union [str , NodeIdentifier ]])
195+
196+ slots .severity = Slot (uri = REPORTING .severity , name = "severity" , curie = REPORTING .curie ('severity' ),
197+ model_uri = REPORTING .severity , domain = None , range = Optional [Union [str , "SeverityOptions" ]])
198+
199+ slots .info = Slot (uri = REPORTING .info , name = "info" , curie = REPORTING .curie ('info' ),
200+ model_uri = REPORTING .info , domain = None , range = Optional [str ])
201+
202+ slots .validationReport__results = Slot (uri = REPORTING .results , name = "validationReport__results" , curie = REPORTING .curie ('results' ),
203+ model_uri = REPORTING .validationReport__results , domain = None , range = Optional [Union [Union [dict , ValidationResult ], List [Union [dict , ValidationResult ]]]])
0 commit comments