Documentation
¶
Index ¶
- func Execute() error
- func LoadBundle(ctx *ls.Context, file string) (ls.SchemaLoader, error)
- func LoadSchemaFromFileOrRepo(ctx *ls.Context, ...) (*ls.Layer, error)
- func LoadValuesetFiles(vs *Valuesets, files []string) error
- func OutputIngestedGraph(outFormat string, target graph.Graph, wr io.Writer, includeSchema bool) error
- func ReadLayers(input []byte, interner ls.Interner) ([]*ls.Layer, error)
- type Attribute
- type Bundle
- type BundleSchemaRef
- type BundleVariant
- type ImportJSONSchemaRequest
- type JSONSchemaReference
- type LS
- type Layer
- type SliceByTermsSpec
- type Valueset
- type ValuesetValue
- type Valuesets
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LoadBundle ¶
func LoadValuesetFiles ¶
func OutputIngestedGraph ¶
Types ¶
type Attribute ¶
type Attribute struct {
ID string `json:"@id"`
AttributeName string `json:"attributeName"`
Types string `json:"@type"`
}
Following structs are used to define a Layered Schema
type Bundle ¶
type Bundle struct {
TypeNames map[string]BundleVariant `json:"typeNames" yaml:"typeNames"`
}
Bundle defines type names for variants so references can be resolved
func ParseBundle ¶
ParseBundle parses a bundle from JSON
type BundleSchemaRef ¶
type BundleSchemaRef struct {
Schema string `json:"schema,omitempty" yaml:"schema,omitempty"`
JSONSchema *JSONSchemaReference `json:"jsonSchema" yaml:"jsonSchema"`
}
func (BundleSchemaRef) GetLayerID ¶
func (ref BundleSchemaRef) GetLayerID() string
GetLayerID returns the layer id for the schema reference
type BundleVariant ¶
type BundleVariant struct {
BundleSchemaRef
Overlays []BundleSchemaRef `json:"overlays" yaml:"overlays"`
}
BundleVariant combines a schema and overlays
type ImportJSONSchemaRequest ¶
type ImportJSONSchemaRequest struct {
Entities []jsonsch.Entity `json:"entities"`
SchemaID string `json:"schemaId"`
Schema string `json:"schemaVariant"`
Layers []SliceByTermsSpec `json:"layers"`
}
func (*ImportJSONSchemaRequest) CompileAndImport ¶
func (req *ImportJSONSchemaRequest) CompileAndImport() (graph.Graph, []jsonsch.EntityLayer, error)
func (*ImportJSONSchemaRequest) Slice ¶
func (req *ImportJSONSchemaRequest) Slice(index int, item jsonsch.EntityLayer) ([]*ls.Layer, *ls.SchemaVariant, error)
type JSONSchemaReference ¶
type SliceByTermsSpec ¶
type Valueset ¶
type Valueset struct {
ID string `json:"id" yaml:"id"`
Values []ValuesetValue `json:"values" yaml:"values"`
}
func (Valueset) Lookup ¶
func (vs Valueset) Lookup(req ls.ValuesetLookupRequest) (ls.ValuesetLookupResponse, error)
type ValuesetValue ¶
type ValuesetValue struct {
// Possible input values
Values []string `json:"values" yaml:"values"`
// Possible input value as key-value pairs
KeyValues map[string]string `json:"keyValues" yaml:"keyValues"`
CaseSensitive bool `json:"caseSensitive" yaml:"caseSensitive"`
// Result output value
Result string `json:"result" yaml:"result"`
// Result output values as key-value pairs
ResultValues map[string]string `json:"results" yaml:"results"`
}
func (ValuesetValue) IsDefault ¶
func (v ValuesetValue) IsDefault() bool
func (ValuesetValue) Match ¶
func (v ValuesetValue) Match(req ls.ValuesetLookupRequest) (*ls.ValuesetLookupResponse, error)
Source Files
¶
- compact.go
- compile.go
- compose.go
- dot.go
- expand.go
- export.go
- export_json.go
- flatten.go
- frame.go
- getschema.go
- getschema_csv.go
- getschema_json.go
- import.go
- import_csv.go
- import_json.go
- ingest.go
- ingest_csv.go
- ingest_json.go
- ingest_xml.go
- map.go
- oc.go
- reshape.go
- root.go
- schema.go
- slice.go
- template.go
- validate.go
- validate_json.go
- valueset.go
Click to show internal directories.
Click to hide internal directories.