java.lang.Object
org.apache.jena.riot.process.normalize.NormalizeRDFTerms
- All Implemented Interfaces:
NormalizeTerm
Convert literals to normalized forms. Sometimes called canonicalization. There is
one preferred RDFTerm for a given RDFterm "value" ("value" generalized to include
URis and blank nodes). Mostly, this affects literals. Only certain datatypes are
supported but applications can add normalization for other datatypes.
Various policies are provided:
General
(close to Turtle, use the turtle form for long term contract)Turtle
* XSD
- XSD - follows XSD 1.1. Mantissa/exponents are adjusted. xsd:decimal of an integer value does not have a decimal point, and is not suitable for Turtle as a xsd:decimal short form.
- Turtle - produces decimals, floats and double suitable for Turtle short-form syntax.
XSD Schema 1.1 does not define a canonical form for all cases.
-
Method Summary
Modifier and TypeMethodDescriptionstatic NormalizeRDFTerms
get()
General normalization.static NormalizeRDFTerms
getTTL()
Normalization for use in Turtle output syntax.static NormalizeRDFTerms
getXSD()
Normalization by XSD 1.1 xsd:double and xsd:float - the mantissa and exponent are adjusted based on value.static NormalizeRDFTerms
getXSD10()
Normalize based on XSD 1.0 where decimals always have decimal point.static NormalizeRDFTerms
getXSD11()
Normalize based on XSD 1.1.org.apache.jena.graph.Node
normalize
(org.apache.jena.graph.Node node) Canonicalize a literal, both lexical form and language tagstatic org.apache.jena.graph.Node
normalizeValue
(org.apache.jena.graph.Node node) Canonicalize a literal, both lexical form and language tag
-
Method Details
-
get
General normalization. -
getTTL
Normalization for use in Turtle output syntax.- xsd:decimals always have a decimal point.
- xsd:doubles always have an exponent. For ones that are less that 10E7, add "e0", otherwise normalize the mantissa and have an exponent ('E').
- xsd:floats For ones that are less that 10E7, just the decimal, no expoent. Otherwise normalize the mantissa and have an expoent ('E').
-
getXSD
Normalization by XSD 1.1- xsd:double and xsd:float - the mantissa and exponent are adjusted based on value. The Exponent is 'E'.
- xsd;decimal - an integer value does not have a decimal point and may not be suitable for Turtle as a xsd:decimal short form.
-
getXSD11
Normalize based on XSD 1.1. -
getXSD10
Normalize based on XSD 1.0 where decimals always have decimal point. -
normalizeValue
public static org.apache.jena.graph.Node normalizeValue(org.apache.jena.graph.Node node) Canonicalize a literal, both lexical form and language tag -
normalize
public org.apache.jena.graph.Node normalize(org.apache.jena.graph.Node node) Canonicalize a literal, both lexical form and language tag- Specified by:
normalize
in interfaceNormalizeTerm
-