Interface RdfTripleConsumer
-
- All Known Implementing Classes:
RdfQuadAdapter,RdfQuadEmitter
interface RdfTripleConsumerAn RDF triple consumer interface designed for high-speed processing and seamless integration with third-party libraries. Intended to be used in cases where triples are emitted in bulk as a set belonging to the same graph, and where a producer keeps triple sets associated with graphs. This interface minimizes unnecessary object instantiation, enhancing efficiency in RDF data processing.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description RdfTripleConsumerdefaultGraph()Sets the default graph as the active scope.RdfTripleConsumernamedGraph(java.lang.String graph)Sets a named graph as the active scope.RdfTripleConsumertriple(java.lang.String subject, java.lang.String predicate, java.lang.String object)Accepts an RDF triple where the object is an IRI or a blank node.RdfTripleConsumertriple(java.lang.String subject, java.lang.String predicate, java.lang.String literal, java.lang.String datatype)Accepts an RDF triple where the object is a literal with a datatype.RdfTripleConsumertriple(java.lang.String subject, java.lang.String predicate, java.lang.String literal, java.lang.String language, java.lang.String direction)Accepts an RDF triple where the object is a localized string value.
-
-
-
Method Detail
-
defaultGraph
RdfTripleConsumer defaultGraph() throws com.apicatalog.rdf.api.RdfConsumerException
Sets the default graph as the active scope. This method is invoked when triples belong to the unnamed default graph.- Returns:
- An instance enabling fluent programming; never
null. - Throws:
com.apicatalog.rdf.api.RdfConsumerException- if an error occurs while processing the N-Quad statement
-
namedGraph
RdfTripleConsumer namedGraph(java.lang.String graph) throws com.apicatalog.rdf.api.RdfConsumerException
Sets a named graph as the active scope. Ensures that subsequent triples are associated with the specified graph.- Parameters:
graph- The name of the graph (IRI or blank node identifier prefixed with "_:"); nevernull.- Returns:
- An instance enabling fluent programming; never
null. - Throws:
com.apicatalog.rdf.api.RdfConsumerException- if an error occurs while processing the N-Quad statement
-
triple
RdfTripleConsumer triple(java.lang.String subject, java.lang.String predicate, java.lang.String object) throws com.apicatalog.rdf.api.RdfConsumerException
Accepts an RDF triple where the object is an IRI or a blank node. The triple is processed within the currently active graph scope.- Parameters:
subject- The subject of the triple (IRI or blank node identifier prefixed with "_:"); nevernull.predicate- The predicate of the triple (IRI); nevernull.object- The object of the triple (IRI or blank node identifier prefixed with "_:"); nevernull.- Returns:
- An instance enabling fluent programming; never
null. - Throws:
com.apicatalog.rdf.api.RdfConsumerException- if an error occurs while processing the N-Quad statement
-
triple
RdfTripleConsumer triple(java.lang.String subject, java.lang.String predicate, java.lang.String literal, java.lang.String datatype) throws com.apicatalog.rdf.api.RdfConsumerException
Accepts an RDF triple where the object is a literal with a datatype. Optimized for efficient handling of typed literals. The triple is processed within the currently active graph scope.- Parameters:
subject- The subject of the triple (IRI or blank node identifier prefixed with "_:"); nevernull.predicate- The predicate of the triple (IRI); nevernull.literal- The literal value of the object; nevernull.datatype- The datatype IRI of the literal; nevernull.- Returns:
- An instance enabling fluent programming; never
null. - Throws:
com.apicatalog.rdf.api.RdfConsumerException- if an error occurs while processing the N-Quad statement
-
triple
RdfTripleConsumer triple(java.lang.String subject, java.lang.String predicate, java.lang.String literal, java.lang.String language, java.lang.String direction) throws com.apicatalog.rdf.api.RdfConsumerException
Accepts an RDF triple where the object is a localized string value. Optimized for efficient handling of language-tagged literals. The triple is processed within the currently active graph scope.- Parameters:
subject- The subject of the triple (IRI or blank node identifier prefixed with "_:"); nevernull.predicate- The predicate of the triple (IRI); nevernull.literal- The literal value of the object; nevernull.language- The language tag of the literal; nevernull.direction- The text direction of the literal (optional, may benull).- Returns:
- An instance enabling fluent programming; never
null. - Throws:
com.apicatalog.rdf.api.RdfConsumerException- if an error occurs while processing the N-Quad statement
-
-