I'm not in any rush on this, but what do you think of pulling this up into semantikon @samwaseda?
https://github.com/pyiron/pyiron_workflow/blob/ca9e53ab6538dc6f4b9ff30cad7dbe08b6ea78ca/pyiron_workflow/_wfms/validation.py#L175-L182
(Ok, that doesn't render because it's from another repo, here it is for readability, renamed while I'm at it:)
@dataclasses.dataclass(frozen=True)
class ValidationReport:
valid: bool
graph: rdflib.ConjunctiveGraph | rdflib.Graph
text: str
def __repr__(self):
return self.text
It just wraps the current tuple. I.e. we'd switch this
|
return validate(g, shacl_graph=shacl) |
To something like
validation_tuple = pyshacl.validate(g, shacl_graph=shacl)
return ValidationReport(valid=validation_tuple[0], ...)
I made it because I was tired of writing things like if report[0] and print(report[2]) and wanted to read/write if report.valid and print(report).
I'm not in any rush on this, but what do you think of pulling this up into
semantikon@samwaseda?https://github.com/pyiron/pyiron_workflow/blob/ca9e53ab6538dc6f4b9ff30cad7dbe08b6ea78ca/pyiron_workflow/_wfms/validation.py#L175-L182
(Ok, that doesn't render because it's from another repo, here it is for readability, renamed while I'm at it:)
It just wraps the current tuple. I.e. we'd switch this
semantikon/semantikon/ontology.py
Line 283 in 3cf8faf
To something like
I made it because I was tired of writing things like
if report[0]andprint(report[2])and wanted to read/writeif report.validandprint(report).