Package org.eclipse.epsilon.rdf.emf
Class IllFormedDateCorrector
java.lang.Object
org.eclipse.epsilon.rdf.emf.IllFormedDateCorrector
Corrects ill-formed xsd:dateTime, xsd:dateTimeStamp and
xsd:date literals into valid ones, by adding or removing components
as needed. For instance, "2026-09-10"^^xsd:dateTime is corrected to
"2026-09-10T00:00:00"^^xsd:dateTime.
Missing time components default to zero, missing timezones are only added
for xsd:dateTimeStamp (as UTC), and month/day/hour/minute/second
values are zero-padded. Literals which cannot be corrected are left as is.
-
Method Summary
Modifier and TypeMethodDescriptionstatic org.apache.jena.rdf.model.Literalcorrect(org.apache.jena.rdf.model.Literal l) Returns a corrected version of the literal if it is an ill-formed date/time literal that can be corrected, ornullotherwise.static intcorrect(org.apache.jena.rdf.model.Model model) Replaces all the ill-formed date/time literals in the model with corrected versions, where possible.static StringcorrectLexicalForm(String lexicalForm, org.apache.jena.datatypes.RDFDatatype dt) Returns a valid lexical form for the given datatype from a possibly ill-formed one, ornullif it cannot be corrected.
-
Method Details
-
correct
public static int correct(org.apache.jena.rdf.model.Model model) Replaces all the ill-formed date/time literals in the model with corrected versions, where possible.- Returns:
- Number of corrected literals.
-
correct
public static org.apache.jena.rdf.model.Literal correct(org.apache.jena.rdf.model.Literal l) Returns a corrected version of the literal if it is an ill-formed date/time literal that can be corrected, ornullotherwise. -
correctLexicalForm
public static String correctLexicalForm(String lexicalForm, org.apache.jena.datatypes.RDFDatatype dt) Returns a valid lexical form for the given datatype from a possibly ill-formed one, ornullif it cannot be corrected.
-