package
1.0.0
Repository: https://github.com/cloudprivacylabs/lsa.git
Documentation: pkg.go.dev

# Functions

No description provided by the author
No description provided by the author
CloneNode clones the sourcenode in targetgraph.
CloneProperties can be used to clone edge and node properties.
ClonePropertyFunc can be used in graph copy functions.
CombineNodeTypes returns a combination of the types of all the given nodes.
CompileGraphNodeTerms compiles all node terms of the graph.
CompileTerms compiles all node and edge terms of the layer.
ComposeProperties will combine the properties in source to target.
ComposeProperty composes targetValue and sourceValue for key.
ConsolidateDuplicateEntities finds all nodes that have identical nonempty entityId with the given label, and merges those that share labels.
CopyGraph source to target using the optional node/edge selectors.
CopyGraphWithCloneFunc source to target using the optional node/edge cloners.
CopyPropertyMap returns a copy of the property map.
CopySchemaNodeIntoGraph copies a schema node and the subtree under it that does not belong the schema into the target graph.
DeepEqual test equivalence between two JSON trees.
No description provided by the author
DocumentNodesUnder returns all document nodes under the given node(s).
EnsurePath finds or instantiates a path in the graph.
FilterAttributeTypes returns all recognized attribute types from the given types array.
FilterNonLayerTypes returns the types that are not attribute or layer related.
FindChildInstanceOf returns the childnodes of the parent that are instance of the given attribute id.
FindFirstChildIf returns the first child node for which the predicate returns true.
No description provided by the author
FollowEdgesInEntity follows only the document edges that do not cross entity boundaries.
FollowEdgesToNodeWithType returns a function that only follows edges that go to a node with the given type.
ForEachAttributeNode calls f with each attribute node, depth first.
ForEachAttributeNodeOrdered calls f with each attribute node, depth first, preserving order.
FormatNodeValue formats the node value as string.
GetArrayElementNode returns the array element node from an array node.
GetAttributeID returns the attributeID.
GetAttributePath returns the path from root to node.
GetAttributeReferenceBySchemaNode returns the attribute reference whose instance is under docContextNode.
No description provided by the author
GetAttributeValidator returns a validator implementation for the given validation term.
GetComposerForProperty returns the composer for the given property.
GetComposerForTerm returns a term composer.
GetEdgeCompiler return a compiler that will compile the term when the term is an edge label.
GetEntityIDFields returns the value of the entity ID fields from a document node.
GetEntityInfo returns all the nodes that are entity roots, i.e.
GetEntityInfoIndex returns a fast-access entity info.
GetEntityRoot tries to find the entity containing this node by going backwards until a node with EntitySchemaTerm.
GetEntityRootNode returns the entity root node containing this node.
GetEntityRootsByID returns all nodes that have entity id.
GetIngestAs returns "node", "edge", "property", or "none" based on IngestAsTerm.
No description provided by the author
GetLayerEntityRoot returns the layer entity root node containing the given schema node.
GetLinkSpec returns a link spec from the node if there is one.
GetNodeCompiler return a compiler that will compile the term when the term is a node label.
GetNodeID returns the nodeid.
GetNodeIndex returns the value of attribute index term as int.
GetNodeOrSchemaProperty gets the node property with the key from the node, or from the schema nodes it is attached to.
GetNodeSchemaNodeID returns the schema node ID of a document node.
GetNodesInstanceOf returns document nodes that are instance of the given attribute id.
GetNodesWithValidators returns all nodes under root that has validators.
GetNodeValue returns the field value processed by the schema type information.
GetNodeValueAccessor returns the value accessor for the node based on the node value type.
GetNSMap parses the namespace map and returns the mapping.
GetObjectAttributeNodes returns the schema attribute nodes under a schema object.
GetObjectAttributeNodesBy returns the schema attribute nodes under a schema object.
GetOutputEdgeLabel returns the label that should be used to connect child nodes.
GetParentAttribute returns the parent attribute of the given node.
GetParentDocumentNodes returns the document nodes that have incoming edges to this node.
GetPathFromEntityRoot returns the path from the entity root node of the schema.
GetPolymorphicOptions returns the polymorphic options of a schema node.
GetRawNodeValue returns the unprocessed node value.
GetSchemaNodeIDMap returns a map of schema node IDs to slices of nodes that are instances of those schema nodes.
GetSliceByTermsFunc is used in the Slice function to select nodes by the properties it contains.
GetTermCompiler return a compiler that will compile the term when the term is a node/edge property.
No description provided by the author
GetTermMarshaler returns the custom marshaler for the term.
GetTermMetadata returns metadata about a term.
GetValueAccessor returns the value accessor for the term.
IndexEntityInfo returns a fast-access version of entity info.
InstanceOf returns the nodes that are connect to this node via instanceOf term,.
InstantiateSchemaNode creates a new node in targetGraph that is an instance of the given schemaNode.
InternSlice interns all elements of a slice.
IntPropertyValue converts the int value to string, and returns a string value.
IsAttributeNode returns true if the node has Attribute type.
IsAttributeTreeEdge returns true if the edge is an edge between two attribute nodes.
IsAttributeType returns true if the term is one of the attribute types.
IsCompilationArtifact returns true if the edge is a compilation artifact.
IsDocumentEdge returns true if the edge is not an attribute link term.
IsDocumentNode returns if the node has the DocumentNodeTerm as one of its labels.
IsEntityRoot returns true if the node is an entity root.
IsInstanceOf returns true if g is an instance of the schema node.
IsNodeEntityRoot checks if node is an entity root.
IsPropertiesEqual compares two property maps and returns true if they are equal.
No description provided by the author
IterateAncestors iterates the ancestors of the node, calling nodeFunc for each node, and edgeFunc for each edge.
IterateDescendants iterates the descendants of the node based on the results of nodeFunc and edgeFunc.
No description provided by the author
LayersFromGraph returns the layers from an existing graph.
If in is a @list, returns its elements.
LDGetKeyValue returns the value of the key in the node.
LDGetListElements returns the elements of a @list node.
LDGetNodeID returns the node @id.
LDGetNodeTypes returns the node @type.
LDGetNodeValue returns the node @value.
LDGetStringValue returns a string value from the node with the key.
LDGetValueArr returns the result of a "@value" as an array regardless of the number of items it contains.
ListAppend appends v2 and v1.
MakeErrInvalidInput creates an ErrInvalidInput error.
Marshals the layer into an expanded jsonld document.
No description provided by the author
No description provided by the author
NewDocumentGraph creates a new graph with the correct indexes for document ingestion.
No description provided by the author
NewGraphBuilder returns a new builder with an optional graph.
NewInterner returns a new interner.
No description provided by the author
NewLayer returns a new empty layer.
No description provided by the author
NewLayerGraph creates a new graph indexes to store layers.
NewLayerInGraph creates a new layer in the given graph by creating a layerinfo root node for the layer.
NewTerm create a new term.
No description provided by the author
ParseNSMap parses a string pair of the form string1 -> string2 This is used in nsMap expression to specify namespace (prefix) mapping for node ids.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
SameTerm returns true if term1 is an alias of term2 or vice versa.
SetAttrributeID sets the attribute ID.
SetEntityIDVectorElement sets the entity Id component of the entity root node if the schema node is part of an entity id.
SetEntityIDVectorElementFromNode sets the entity Id component of the entity root node if the schema node is part of an entity id.
SetNodeID sets the node ID.
No description provided by the author
SetNodeValue sets the node value using the given native Go value.
SetRawNodeValue sets the unprocessed node value.
SetUnion computes the set union of properties v1 and v2.
SkipEdgesToNodeWithType returns a function that skips edges that go to a node with the given type.
SortEdges sorts edges by their target node index.
SortEdgesItr sorts the edges by index.
SortNodes sorts nodes by their node index.
StringPropertyValue creates a string value.
StringSetIntersection returns the common elements of s1 and s2.
StringSetSubtract returns all elements that are in s1 but not in s2.
StringSetToSlice converts a string set to slice.
StringSetUnion returns s1 setunion s2.
StringSlicePropertyValue creates a []string value.
ToMap converts the input to a map.
UnmarshalJSONLDGraph Unmarshals a graph in JSON-LD format.
UnmarshalLayer unmarshals a schema ar overlay.
No description provided by the author
ValidateDocumentNode runs the validators for the document node.
ValidateDocumentNodeBySchema runs the validators for the document node.
ValidateValueBySchema runs the validators for the value.
ValueSetInfoFromNode parses the valueset information from a node.
WalkNodesInEntity walks through all the nodes without crossing entity boundaries.

# Constants

ErrorComposition means if two terms are composed and they are different, composition fails.
No description provided by the author
Encoding indexes.
IngestAs constants.
IngestAs constants.
IngestAs constants.
ListComposition means when two terms are composed, their values are appended.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Encoding indexes.
Encoding indexes.
NoComposition means when two terms are composed, the original remains.
OverrideComposition means when two terms are composed, the new one replaces the old one.
ProvenanceTag means that the term is provenance related.
SchemaElementTag means that the term is used for schema definitions only.
SetComposition means when two terms are composed, set-union of the values are taken.
No description provided by the author
No description provided by the author
Encoding indexes.
ValidationTag means that the tag is about validation.

# Variables

All components of a composite attribute.
ArrayItems contains the definition for the items of the array.
AsPropertyOfTerm is optional.
AttributeIndexTerm represents the index of an array element.
AttributeNameTerm represents the name of an attribute.
Attribute types defines the terms describing attribute types.
AttributeOverlaysTerm lists the overlays for schema attributes that are matched by ID, as opposed to matching by ID and their place in the layer.
Attribute types defines the terms describing attribute types.
Attribute types defines the terms describing attribute types.
Attribute types defines the terms describing attribute types.
Attribute types defines the terms describing attribute types.
Attribute types defines the terms describing attribute types.
Attribute types defines the terms describing attribute types.
CharacterEncodingTerm is used to specify a character encoding for the data processed with the layer.
ComposeTerm is used for overlays to redefine term compositions.
ConditionalTerm specifies conditions for ingestion.
No description provided by the author
No description provided by the author
DefaultValueTerm is the default value for an attribute if attribute is not present.
DescriptionTerm is used for comments/descriptions.
DocumentNodeTerm is the type of document nodes.
EdgeLabelTerm represents the value used as an edge label, when ingesting an edge.
EntityIDFieldsTerm is a string or []string that lists the attribute IDs for entity ID.
EntityIDTerm is a string or []string that gives the unique ID of an entity.
EntitySchemaTerm is inserted by the schema compilation to mark entity roots.
Error declarations for marshaling and composition.
Error declarations for marshaling and composition.
Error declarations for marshaling and composition.
Error declarations for marshaling and composition.
ErrInvalidEncodingIndex is used to return error about an invalid or unrecognized character encoding.
Error declarations for marshaling and composition.
Error declarations for marshaling and composition.
Error declarations for marshaling and composition.
Error declarations for marshaling and composition.
Format specifies a type-specific formatting directive, such as a date format.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
HasTerm is an edge term for linking document elements.
IncludeAllNodesInSliceFunc includes all the nodes in the slice.
IncludeSchemaTerm represents another schema to replace and copy its contents.
IngestAsTerm ingests value as an edge, node, or property.
InstanceOfTerm is an edge term that is used to connect values with their schema specifications.
LabeledAsTerm adds labels to JSON schemas.
LayerRootTerm is an edge term that connects layer node to the root node of the schema.
Namespace defines the namespace prefix.
NodeIDTerm keeps the node ID or the attribute ID.
NodeValueTerm is the property key used to keep node value.
NSMapTerm specifies a namespace map for an overlay.
Ordered named attributes (json object, xml elements).
Unordered named attributes (json object).
All options of a polymorphic attribute.
OnlyAttributeNodes can be used in IterateDescendants edge func to follow edges that reach to Attribute nodes.
OnlyDocumentNodes can be used in IterateDescendants edge func to follow edges that reach to document nodes.
OutputEdgeLabelTerm determines the labels of the output edges.
OverlayTerm is the layer type for overlays.
PropertyNameTerm represents the value used as a property name when ingesting a property.
ReferenceDirectionTerm specifies the direction of the edge.
ReferenceFK specifies the foreign key value.
ReferenceFKFor is used for value nodes that are foreign keys.
ReferenceFKTerm specifies the foreign key attribute ID.
ReferenceLabelTerm specifies the edge label between the referenced nodes.
ReferenceLinkNodeTerm specifies the node in the current entity that will be linked to the other entity.
ReferenceMultiTerm specifies if there can be more than one link targets.
Reference to another schema.
SchemaNodeIDTerm denotes the schema node ID for ingested nodes.
SchemaTerm is the layer type for schemas.
SchemaVariantTerm is the schema variant type.
No description provided by the author
SkipDocumentNodes can be used in IterateDescendants edge func to skip all edges that go to a document node.
SkipSchemaNodes can be used in IterateDescendants edge func to skip all edges that go to a schema node.
SourceTerm gives the source information for the data element.
TypeDiscriminatorTerm represents a set of schema field hints for defining polymorphic objects.
No description provided by the author
ValuesetContextExprTerm is an opencyper expression that gives the context node using "this" as the current node.
ValuesetContextTerm specifies the context under which valueset related values are to be looked up.
ValuesetRequestKeysTerm specifies the keys that will be used in the valueset request.
ValuesetRequestTerm specifies one or more openCypher expressions that builds up a valuest lookup request.
ValuesetRequestValuesTerm contains entries matching ValuesetRequestKeysTerm.
ValuesetResultContext determines the node under which the results will be added.
ValuesetResultKeys term contains the keys that will be returned from the valueset lookup.
ValuesetResultValuesTerm specifies the schema node IDs for the nodes that will receive the matching key values.
ValuesetTablesTerm specifies the list of table IDs to lookup.
ValueTypeTerm defines the type of a value.

# Structs

AttributeReference points to an attribute in a document.
BasicParsedDocNode is the default implementation of a parsed doc node.
An instance of CompileContext is passed to all compile functions.
CompiledProperties is a lazy-initialized map.
CompileOCSemantics is a compilation implementation for terms containing a slice of opencypher expressions.
No description provided by the author
No description provided by the author
DefaultCompiledGraph keeps compiled graphs in a map.
No description provided by the author
No description provided by the author
DialectValueSemantics is a compilation implementation for terms containing an expression, or value.
EntityInfo contains the entity information in the doc graph.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
ErrInconsistentTypes is returned if a node has multiple types that can interpret the value.
No description provided by the author
No description provided by the author
ErrInvalidInput is used for errors due to incorrect values, unexpected syntax, etc.
No description provided by the author
ErrInvalidValidator is used to return validator compilation errors.
No description provided by the author
No description provided by the author
ErrMultipleParentNodes is used to denote multiple parentnodes detected during data ingestion.
No description provided by the author
ErrNoParentNode is used to denote no parent nodes for an ingested node.
No description provided by the author
No description provided by the author
ErrTerm is used to denote a term operation error.
ErrValidation is used to return validator errors.
ErrValidatorCompile is returned for validator compilation errors.
No description provided by the author
No description provided by the author
GraphBuilder contains the methods to ingest a graph.
No description provided by the author
No description provided by the author
JSONMarshaler marshals/unmarshals a graph.
A Layer is either a schema or an overlay.
LDMarshaler renders a graph in JSON-LD flattened format.
No description provided by the author
LinkSpec contains the link field information.
PropertyValue can be a string or []string.
StringInterner is used to intern strings so multiple identical copies of strings are minimized.
TermSemantics is used to describe how a term operates within the layered schemas framework.
ValuesetInfo describes value set information for a schema node.
ValuesetLookupRequest specifies an optional list of lookup tables and key-value pairs to lookup.
ValuesetLookupResponse returns the key-value pairs that should be inserted into the graph.
No description provided by the author

# Interfaces

CompilablePropertyContainer contains properties and a compiled data map.
A CompiledGraph is a graph of compiled schemas.
Composer interface represents term composition algorithm.
EdgeCompiler interface represents term compilation algorithm when the term is an edge During schema compilation, if the term metadata for the edge label implements EdgeCompiler, this method is called.
No description provided by the author
HasNativeValue is implemented by parsed doc nodes if the node knows its native value.
Interner interface is used to keep a string table to reduce memory footprint by eliminated repeated keys.
No description provided by the author
NodeCompiler interface represents term compilation algorithm when the term is a node.
A NodeValidator is used to validate document nodes based on their schema.
NodeValueAccessor can optionally be implemented by ValueAccessors to get/set node values directly.
No description provided by the author
PostIngest is called after the ingestion of a document.
PostNodeIngest is called after the ingestion of a node.
PropertyContainer is an object that contains properties.
SchemaLoader interface defines the LoadSchema method that loads schemas by reference.
TermCompiler interface represents term compilation algorithm.
TermMarshaler interface defines JSON and JSONLD unmarshalers for a custom schema extension.
No description provided by the author
A ValueAccessor gets node values in native type, and sets node values.
A ValueValidator is used to validate a value based on a schema.

# Type aliases

CompositionType determines the composition semantics for the term.
No description provided by the author
EncodingIndex determines the encoding name index.
No description provided by the author
ErrDuplicate is used for duplicate errors.
ErrDuplicateAttributeID is used to denote a duplicate attribute in a schema.
No description provided by the author
No description provided by the author
ErrMultipleTypes denotes multiple incompatible types declared for an attribute.
ErrNotFound is used for all not-found errors.
No description provided by the author
NodePath contains the name components identifying a node.
SchemaLoaderFunc is the function type that load schemas.