impex

package
v0.0.0-...-fa803d1 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2020 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExportToFile

func ExportToFile(quads []quad.Quad, outFileName string, formatName string)

Export `quads` into a file named `outFileName` in `formatName` representational format. If `outFileName` equals to "" then the results will be written to the `os.Stdout`. The following formats can be identified via several methods:

|-----------|-----------|------------------------|
| name      | extension |   mime-type            |
|-----------|-----------|------------------------|
| nquads    | .nq, .nt  | application/n-quads,   |
|           |           | application/n-triplets |
|-----------|-----------|------------------------|
| jsonld    | .jsonld   | application/ld+json    |
|-----------|-----------|------------------------|
| json      | .json     | application/json       |
|-----------|-----------|------------------------|
| graphml   | .graphml  | application/xml        |
|-----------|-----------|------------------------|
| gml       | .gml      |                        |
|-----------|-----------|------------------------|
| graphviz  | .gv, .dot |                        |
|-----------|-----------|------------------------|

func GetFormatter

func GetFormatter(outFileName string, formatName string) (format *quad.Format)

Get the formatter selected either by the `formatName` or by the file extension.

func ImportFromFile

func ImportFromFile(inFileName string, formatName string) ([]quad.Quad, error)

func NewQuadWriter

func NewQuadWriter(quads *[]quad.Quad) quad.Writer

func ReadFromTurtle

func ReadFromTurtle(ttlPath string, baseURI string, useShortIRI bool) ([]quad.Quad, error)

ReadFromTTL reads a ttl file and return a slice of quads

func ReadFromYaml

func ReadFromYaml(yamlPath string, dst interface{}) error

Read YAML file and unmarshal its content into the `dst` data structure, using the `yaml` annotation of the structs.

func SaveToYaml

func SaveToYaml(yamlPath string, src interface{}) error

Marshal the content from the `dst` data structure, and savel into a YAML file using the `yaml` annotation of the structs.

Types

type QuadWriter

type QuadWriter struct {
	// contains filtered or unexported fields
}

func (QuadWriter) WriteQuad

func (qw QuadWriter) WriteQuad(buf quad.Quad) error

func (QuadWriter) WriteQuads

func (qw QuadWriter) WriteQuads(buf []quad.Quad) (int, error)

Directories

Path Synopsis
Package graphml provides an encoder for GraphML format
Package graphml provides an encoder for GraphML format

Jump to

Keyboard shortcuts

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