Package org.eclipse.rdf4j.model
Interface IRI
-
- All Superinterfaces:
Resource,Serializable,URI,Value
- All Known Implementing Classes:
AbstractIRI,MemIRI,NativeIRI,SimpleIRI,URIImpl
public interface IRI extends URI, Resource
An Internationalized Resource Identifier (IRI). IRIs are an extension of the existingURI: while URIs are limited to a subset of the ASCII character set, 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 booleanequals(Object o)Compares this IRI to another object.StringgetLocalName()Gets the local name part of this IRI.StringgetNamespace()Gets the namespace part of this IRI.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 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: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.
-
getNamespace
String getNamespace()
Gets the namespace part of this IRI.The namespace is defined as per the algorithm described in the class documentation.
- Specified by:
getNamespacein interfaceURI- 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.
- Specified by:
getLocalNamein interfaceURI- Returns:
- the local name of this IRI
-
equals
boolean equals(Object o)
Compares this IRI to another object.- Specified by:
equalsin interfaceURI- 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.- Specified by:
hashCodein interfaceURI- Overrides:
hashCodein classObject- Returns:
- a hash code for this IRI computed as
URI.toString().hashCode()
-
-