io

package
v0.9.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 3, 2017 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package io provides basic tools to read and write graphs from and to files.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ReadIntoGraph

func ReadIntoGraph(ctx context.Context, g storage.Graph, r io.Reader, b literal.Builder) (int, error)

ReadIntoGraph reads a graph out of the provided reader. The data on the reader is interpret as text. Each line represents one triple using the standard serialized format. ReadIntoGraph will stop if fails to Parse a triple on the stream. The triples read till then would have also been added to the graph. The int value returns the number of triples added.

func WriteGraph

func WriteGraph(ctx context.Context, w io.Writer, g storage.Graph) (int, error)

WriteGraph serializes the graph into the writer where each triple is marshaled into a separate line. If there is an error writing the serialization will stop. It returns the number of triples serialized regardless if it succeeded or failed partially.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL