Package org.eclipse.rdf4j.model
Interface IRI
-
- All Superinterfaces:
Resource
,Serializable
,Value
- All Known Implementing Classes:
AbstractIRI
,InternedIRI
,LmdbIRI
,MemIRI
,NativeIRI
,SimpleIRI
public interface IRI extends Resource
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:
- RFC 3987
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description boolean
equals(Object o)
Compares this IRI to another object.String
getLocalName()
Gets the local name part of this IRI.String
getNamespace()
Gets the namespace part of this IRI.int
hashCode()
Computes the hash code of this IRI.default boolean
isIRI()
Check if the object is an instance of the given type.-
Methods inherited from interface org.eclipse.rdf4j.model.Resource
isResource
-
Methods inherited from interface org.eclipse.rdf4j.model.Value
isBNode, isLiteral, isTriple, stringValue
-
-
-
-
Method Detail
-
isIRI
default boolean isIRI()
Description copied from interface:Value
Check 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.
-
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
boolean equals(Object o)
Compares this IRI to another object.- Overrides:
equals
in classObject
- Parameters:
o
- the object to compare this IRI to- Returns:
true
, if the other object is an instance ofIRI
and their string values are equal;false
, otherwise
-
hashCode
int hashCode()
Computes the hash code of this IRI.- Overrides:
hashCode
in classObject
- Returns:
- a hash code for this IRI computed as
Value.stringValue()
.hashCode()
-
-