- Enclosing class:
- IRIProviderJenaIRI
IRIx implementation for the jena-iri provider.-
Method Summary
Modifier and TypeMethodDescriptionbooleanorg.apache.jena.iri.IRIgetImpl()Return the implementation object of the provider.voidhandleViolations(BiConsumer<Boolean, String> handler) Handle violations by sending a boolean, indicating whether this is an error (true) or a warning (false), and string message to a handler.inthashCode()booleanTest whether the IRI has the given scheme name.booleanDoes this IRIx have any warnings and errors that are not syntax errors, for example, from URI scheme checks.booleanAn absolute URI is one with a URI scheme and without a fragment.booleanAn RDF Reference is an URI which has scheme.booleanA relative URI is one without a scheme, and maybe without some of the other parts.Syntax-based Normalization Normalize anIRIx.relativize(IRIx other) Return (if possible), an IRI that is relative to the base argument.Try to resolve a string against this IRI as base.Try to resolve a string against this IRI as base.scheme()Return the IRI scheme, if known.
-
Method Details
-
isAbsolute
public boolean isAbsolute()Description copied from class:IRIxAn absolute URI is one with a URI scheme and without a fragment. The other components, host (authority), path, and query, are optional.absolute-URI = scheme ":" hier-part [ "?" query ]
Beware of the meaning :
http:abcis an absolute URI - it has only a schema and a path without a root.Note that a URI can be both "not absolute" and "not relative", e.g.
http://example/path#fragment.Beware that RFC 2396 section 3.1 has a different definition, where the scheme is required but a fragment may be present.
See IRIx.isReference() for testing whether a URI is suitable for use in RDF.
- Specified by:
isAbsolutein classIRIx
-
isRelative
public boolean isRelative()Description copied from class:IRIxA relative URI is one without a scheme, and maybe without some of the other parts.Often it is just the path part.
See IRIx.isReference() for testing whether a URI is suitable for use in RDF.
Note that a URI can be both "not absolute" and "not relative", e.g.
http://example/path#fragment.- Specified by:
isRelativein classIRIx
-
isReference
public boolean isReference()Description copied from class:IRIxAn RDF Reference is an URI which has scheme. If it is hierarchical, it should have a non-empty host authority. It may have a query component and may have a fragment component. This not a term in RFC 3986 and it is not the same as "absolute URI". This is a change from RFC 2396 where an absolute URI means "has scheme".In RDF data, it is a useful concept. It is either an absolute URI, but if it is hierarchical, it must have a host.
Examples:
- http://www.w3.org/
- http://www.w3.org/1999/02/22-rdf-syntax-ns#type
- urn:abc:def
- urn:abc:def#frag
- http:abc -- no host authority; HTTP is a hierarchical URI scheme
- http:// -- the http(s) URI scheme requires the host to be not empty if there is an authority component.
In practical terms:
- It has a scheme name.
- It does not have user info ("user:password@")
- It can have a fragment.
- If it is an HTTP URI:
- It has a host authority, that is, a "//" section
- It should have a path (starting "/" after the host authority) but this is not required.
- If it is a URN (RFC8141), which is a "rootless URI" with no "//" part:
- Optionally, it can have a r-component (though this is not advised), a q-component, and a f-component (which is a URI fragment).
- Specified by:
isReferencein classIRIx
-
hasScheme
Description copied from class:IRIxTest whether the IRI has the given scheme name.The scheme name should be lowercase.
-
scheme
Description copied from class:IRIxReturn the IRI scheme, if known.Returns null for "no scheme" (relative IRI).
-
resolve
Description copied from class:IRIxTry to resolve a string against this IRI as base. This call is "base.resolver(possibleRelativeIRI)". ThrowIRIExceptionif the string does not conform to the IRI grammar. -
resolve
Description copied from class:IRIxTry to resolve a string against this IRI as base. ThrowIRIExceptionif the string does not conform to the IRI grammar. Return the original IRIx if there is no change. -
normalize
Description copied from class:IRIxSyntax-based Normalization Normalize anIRIx. -
relativize
Description copied from class:IRIxReturn (if possible), an IRI that is relative to the base argument. If this IRI is a relative path, this is returned unchanged.The base ("this" object) must have a scheme, have no fragment and no query string. Only the path name is made relative.
If no relative IRI can be found, return null.
- Specified by:
relativizein classIRIx
-
getImpl
public org.apache.jena.iri.IRI getImpl()Description copied from class:IRIxReturn the implementation object of the provider. The class of the object depends on the provider. -
hasViolations
public boolean hasViolations()Description copied from class:IRIxDoes this IRIx have any warnings and errors that are not syntax errors, for example, from URI scheme checks.- Specified by:
hasViolationsin classIRIx
-
handleViolations
Description copied from class:IRIxHandle violations by sending a boolean, indicating whether this is an error (true) or a warning (false), and string message to a handler.- Specified by:
handleViolationsin classIRIx
-
hashCode
public int hashCode() -
equals
-