@FunctionalInterface public interface RdfQuadConsumer
This interface minimizes unnecessary object instantiation, improving efficiency when handling RDF data at scale.
Use the provided static helper methods to analyze and validate consumer parameters.
| Modifier and Type | Method and Description |
|---|---|
static boolean |
isBlank(String resource)
Checks whether the provided resource identifier represents a blank node.
|
static boolean |
isDirLangString(String datatype,
String language,
String direction)
Determines if the provided combination of
datatype, language,
and direction qualifies the object as an RDF directional
language-tagged string literal with a specified direction. |
static boolean |
isLangString(String datatype,
String language,
String direction)
Determines if the provided combination of
datatype, language,
and direction qualifies the object as an RDF language-tagged string
literal with no specified direction. |
static boolean |
isLiteral(String datatype,
String language,
String direction)
Determines if the provided combination of
datatype, language,
and direction qualifies the object as RDF literal. |
static boolean |
isValidObject(String datatype,
String language,
String direction)
Validates whether the object is a valid RDF object based on the presence of
datatype, language, and direction. |
RdfQuadConsumer |
quad(String subject,
String predicate,
String object,
String datatype,
String language,
String direction,
String graph)
Consumes an RDF quad where the
object may be an IRI, blank node,
typed literal, or language-tagged literal. |
RdfQuadConsumer quad(String subject, String predicate, String object, String datatype, String language, String direction, String graph) throws RdfConsumerException
object may be an IRI, blank node,
typed literal, or language-tagged literal.
This method provides fine-grained control over RDF quad data, allowing precise handling of datatypes, language tags, and text direction.
subject - the subject of the quad; must be an IRI or blank node
identifier prefixed with "_:". Must not be
null.predicate - the predicate of the quad; must be an IRI. Must not be
null.object - the object of the quad; must be either:
_:"datatype is not
nullnull.
Use isValidObject(String, String, String),
isLiteral(String, String, String),
isLangString(String, String, String), and
isDirLangString(String, String, String) to validate
and classify the input.
datatype - the datatype IRI of the literal. Must be null if
object is not a literal. Must not be null
when language or direction is provided.language - the language tag of the literal. May be null, but
must not be null if direction is provided.direction - the text direction of the literal. Optional; may be
null.graph - the graph name of the quad; must be an IRI or blank node
identifier prefixed with "_:". May be
null to indicate the default graph.null.RdfConsumerException - if an error occurs while processing the quad
statement.static boolean isLiteral(String datatype, String language, String direction)
datatype, language,
and direction qualifies the object as RDF literal.datatype - the datatype IRIlanguage - the language tagdirection - the text directiontrue indicating a literal, otherwise false.static boolean isLangString(String datatype, String language, String direction)
datatype, language,
and direction qualifies the object as an RDF language-tagged string
literal with no specified direction.datatype - the datatype IRIlanguage - the language tagdirection - the text directiontrue if the provided object is RDF language-tagged literal,
otherwise false.static boolean isDirLangString(String datatype, String language, String direction)
datatype, language,
and direction qualifies the object as an RDF directional
language-tagged string literal with a specified direction.datatype - the datatype IRIlanguage - the language tagdirection - the text directiontrue if the provided object is RDF directional
language-tagged literal, otherwise false.static boolean isValidObject(String datatype, String language, String direction)
datatype, language, and direction.datatype - the datatype IRIlanguage - the language tagdirection - the text directiontrue if the object is valid according to RDF term rules.static boolean isBlank(String resource)
_:".resource - the resource identifier to check; may be null.true if the resource is a non-null blank node identifier;
otherwise false.Copyright © 2025. All rights reserved.