ProtoEncoder

eu.ostrzyciel.jelly.core.ProtoEncoder
abstract class ProtoEncoder[TNode, TTriple, TQuad, TQuoted](val options: RdfStreamOptions)

Stateful encoder of a protobuf RDF stream.

This class supports all stream types and options, but usually does not check if the user is conforming to them. It will, for example, allow the user to send generalized triples in a stream that should not have them. Take care to ensure the correctness of the transmitted data, or use the specialized wrappers from the stream package.

Attributes

options

options for this stream

Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Concise view

Value members

Abstract methods

protected def getQstG(quad: TQuad): TNode
protected def getQstO(quad: TQuad): TNode
protected def getQstP(quad: TQuad): TNode
protected def getQstS(quad: TQuad): TNode
protected def getQuotedO(triple: TQuoted): TNode
protected def getQuotedP(triple: TQuoted): TNode
protected def getQuotedS(triple: TQuoted): TNode
protected def getTstO(triple: TTriple): TNode
protected def getTstP(triple: TTriple): TNode
protected def getTstS(triple: TTriple): TNode
protected def graphNodeToProto(node: TNode): RdfGraph

Turn an RDF graph node into its protobuf representation.

Turn an RDF graph node into its protobuf representation.

Use the protected final inline make*Graph methods in this class to create the nodes.

Attributes

node

RDF graph node

Returns:

RdfTerm

Throws:
RdfProtoSerializationError

if node cannot be encoded

protected def nodeToProto(node: TNode): RdfTerm

Turn an RDF node (S, P, or O) into its protobuf representation.

Turn an RDF node (S, P, or O) into its protobuf representation.

Use the protected final inline make* methods in this class to create the nodes.

Attributes

node

RDF node

Returns:

RdfTerm

Throws:
RdfProtoSerializationError

if node cannot be encoded

Concrete methods

final def addQuadStatement(quad: TQuad): Iterable[RdfStreamRow]

Add an RDF quad statement to the stream.

Add an RDF quad statement to the stream.

Attributes

quad

quad to add

Returns:

iterable of stream rows

final def addTripleStatement(triple: TTriple): Iterable[RdfStreamRow]

Add an RDF triple statement to the stream.

Add an RDF triple statement to the stream.

Attributes

triple

triple to add

Returns:

iterable of stream rows

final def endGraph(): Iterable[RdfStreamRow]

Signal the end of a delimited graph in a GRAPHS stream.

Signal the end of a delimited graph in a GRAPHS stream.

Attributes

Returns:

iterable of stream rows (always of length 1)

final inline protected def makeBlankNode(label: String): RdfTerm
final inline protected def makeBlankNodeGraph(label: String): RdfGraph
final inline protected def makeDtLiteral(lex: String, dt: String): RdfTerm
final inline protected def makeDtLiteralGraph(lex: String, dt: String): RdfGraph
final inline protected def makeIriNode(iri: String): RdfTerm
final inline protected def makeIriNodeGraph(iri: String): RdfGraph
final inline protected def makeLangLiteral(lex: String, lang: String): RdfTerm
final inline protected def makeLangLiteralGraph(lex: String, lang: String): RdfGraph
final inline protected def makeSimpleLiteral(lex: String): RdfTerm
final inline protected def makeSimpleLiteralGraph(lex: String): RdfGraph
final inline protected def makeTripleNode(triple: TQuoted): RdfTerm
final def startDefaultGraph(): Iterable[RdfStreamRow]

Signal the start of the default delimited graph in a GRAPHS stream.

Signal the start of the default delimited graph in a GRAPHS stream.

Attributes

Returns:

iterable of stream rows

final def startGraph(graph: TNode): Iterable[RdfStreamRow]

Signal the start of a new (named) delimited graph in a GRAPHS stream.

Signal the start of a new (named) delimited graph in a GRAPHS stream.

Attributes

graph

graph node

Returns:

iterable of stream rows

Concrete fields

final protected val makeDefaultGraph: RdfGraph