Interface IRI
- All Superinterfaces:
Resource, Serializable, Value
- All Known Implementing Classes:
AbstractIRI, CorruptIRI, CorruptIRIOrBNode, InternedIRI, LmdbIRI, MemIRI, NativeIRI, SimpleIRI
An Internationalized Resource Identifier (IRI). IRIs may contain characters from the Universal Character Set
(Unicode/ISO 10646), including Chinese or Japanese kanji, Korean, Cyrillic characters, and so forth. It is defined by
RFC 3987.
An IRI can be split into a namespace part and a local name part, which are derived from an IRI string by splitting it in two using the following algorithm:
- Split after the first occurrence of the '#' character,
- If this fails, split after the last occurrence of the '/' character,
- If this fails, split after the last occurrence of the ':' character.
- Author:
- Jeen Broekstra
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface Value
Value.Type -
Method Summary
Modifier and TypeMethodDescriptionbooleanCompares this IRI to another object.Gets the local name part of this IRI.Gets the namespace part of this IRI.default Value.TypegetType()inthashCode()Computes the hash code of this IRI.default booleanisIRI()Check if the object is an instance of the given type.Methods inherited from interface Resource
isResourceMethods inherited from interface Value
isBNode, isLiteral, isTriple, stringValue
-
Method Details
-
isIRI
default boolean isIRI()Description copied from interface:ValueCheck if the object is an instance of the given type. Typically 2x than using instanceof.For implementers: This default implementation is overridden in the repsective sub-interface.
-
getType
-
getNamespace
String getNamespace()Gets the namespace part of this IRI.The namespace is defined as per the algorithm described in the class documentation.
- Returns:
- the namespace of this IRI
-
getLocalName
String getLocalName()Gets the local name part of this IRI.The local name is defined as per the algorithm described in the class documentation.
- Returns:
- the local name of this IRI
-
equals
Compares this IRI to another object.- Overrides:
equalsin classObject- Parameters:
o- the object to compare this IRI to- Returns:
true, if the other object is an instance ofIRIand their string values are equal;false, otherwise
-
hashCode
int hashCode()Computes the hash code of this IRI.- Overrides:
hashCodein classObject- Returns:
- a hash code for this IRI computed as
Value.stringValue().hashCode()
-