java.lang.Object
org.apache.jena.rdf.model.impl.Util
Some utility functions.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanhasDirection(Node n) Test whether this node has an initial text language (rdf:dirLangString)static booleanTest whether this node has a language (rdf:langString or rdf:dirLangString)static booleanA Node is a well-formed directional language string if it has a language tag and it has an base direction.static booleanisDirLangString(Literal lit) Return true if the literal is well-formed, has a language tag and a base direction.static booleanisLangString(Node n) A Node is a well-formed language string if it has a language tag and it does not have a base direction.static booleanisLangString(Literal lit) Return true if the literal has a language tag.static booleanA Node is a simple string if: (RDF 1.0) No datatype and no language tag.static booleanisSimpleString(Literal lit) Return true if the literal is a simple string.static Stringstatic intsplitNamespaceXML(String uri) Given an absolute URI, determine the split point between the namespace part and the localname part.static StringAnswersmodified to replace <, >, and & by their corresponding entity references.static Stringstatic String
-
Constructor Details
-
Util
public Util()
-
-
Method Details
-
splitNamespaceXML
Given an absolute URI, determine the split point between the namespace part and the localname part. SeeSplitIRI.splitXML(java.lang.String)for details. -
substituteStandardEntities
-
substituteEntitiesInEntityValue
-
substituteEntitiesInElementContent
Answersmodified to replace <, >, and & by their corresponding entity references.Implementation note: as a (possibly misguided) performance hack, the obvious cascade of replaceAll calls is replaced by an explicit loop that looks for all three special characters at once.
-
replace
-
isSimpleString
A Node is a simple string if:- (RDF 1.0) No datatype and no language tag.
- (RDF 1.1) xsd:string
-
isLangString
A Node is a well-formed language string if it has a language tag and it does not have a base direction. This excludes"abc"^^rdf:langStringwhich is not well-formed. -
isDirLangString
A Node is a well-formed directional language string if it has a language tag and it has an base direction. -
hasLang
Test whether this node has a language (rdf:langString or rdf:dirLangString) -
hasDirection
Test whether this node has an initial text language (rdf:dirLangString) -
isSimpleString
Return true if the literal is a simple string.RDF 1.0 => it is a plain literal, with no language tag
RDF 1.1 => it has datatype xsd:string
-
isLangString
Return true if the literal has a language tag. -
isDirLangString
Return true if the literal is well-formed, has a language tag and a base direction.
-