csv

package
v1.0.0-beta12 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2022 License: Apache-2.0 Imports: 7 Imported by: 1

Documentation

Index

Constants

View Source
const CSV = ls.LS + "csv/"

Variables

This section is empty.

Functions

func Import

func Import(attributeID string, terms []TermSpec, startRow, nRows int, idRows []int, entityID string, required string, input [][]string) (*ls.Layer, error)

Import a CSV schema. The CSV file is organized as columns, one column for base attribute names, and other columns for overlays. CSV does not support nested attributes. Returns an array of Layer objects

Types

type ErrColIndexOutOfBounds

type ErrColIndexOutOfBounds struct {
	For   string
	Index int
}

func (ErrColIndexOutOfBounds) Error

func (e ErrColIndexOutOfBounds) Error() string

type ErrInvalidID

type ErrInvalidID struct {
	Row int
}

func (ErrInvalidID) Error

func (e ErrInvalidID) Error() string

type Parser

type Parser struct {
	OnlySchemaAttributes bool
	IngestNullValues     bool
	SchemaNode           graph.Node
	ColumnNames          []string
}

func (Parser) ParseDoc

func (ing Parser) ParseDoc(context *ls.Context, baseID string, row []string) (ls.ParsedDocNode, error)

type TermSpec

type TermSpec struct {
	// The term
	Term string `json:"term"`
	// If nonempty, this template is used to build the term contents
	// with {{.term}}, and {{.row}} in template context. {{.term}} gives
	// the Term, and {{.row}} gives the cells of the current row
	TermTemplate string `json:"template"`
	// Is property an array
	Array bool `json:"array"`
	// Array separator character
	ArraySeparator string `json:"separator"`
}

Jump to

Keyboard shortcuts

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