Module Simantics/LiteralDatatypes

This module is undocumented. This is a list of its definitions.

brokenLiteralReport :: Resource -> <ReadGraph> String

brokenLiteralReport root scans root like brokenLiterals and describes everything it finds, one literal per line. Writes nothing.

brokenLiterals :: Resource -> <ReadGraph> [Resource]

brokenLiterals root returns the literals under root whose value cannot be read with the datatype they declare. The composition and the properties of every visited resource are followed, so the datatype literals themselves are checked as well. root is usually a model or a library. Resources belonging to an ontology are skipped, since only the graph compiler writes those.

describeBrokenLiteral :: Resource -> <ReadGraph> String

describeBrokenLiteral literal tells on one line how the value of literal and the datatype it declares disagree, and returns an empty string when they agree.

repairBrokenLiteral :: Resource -> <WriteGraph> String

repairBrokenLiteral literal makes literal declare the datatype its value actually has and returns a description of what was done. The value itself is never written, so a literal whose value matches none of the datatypes its context allows is left alone and the result is a Java null.

repairBrokenLiterals :: Resource -> <WriteGraph> [String]

repairBrokenLiterals root repairs every broken literal under root and returns a description of each repair that was made.