Documentation ¶
Index ¶
- type Neo4j
- func (n *Neo4j) AddDimensions(ctx context.Context, i *model.Instance) error
- func (n *Neo4j) AddVersionDetailsToInstance(ctx context.Context, instanceID string, datasetID string, edition string, ...) error
- func (n *Neo4j) CloneNodes(ctx context.Context, attempt int, instanceID, codeListID, dimensionName string) error
- func (n *Neo4j) CloneRelationships(ctx context.Context, attempt int, instanceID, codeListID, dimensionName string) error
- func (n *Neo4j) CountInsertedObservations(ctx context.Context, instanceID string) (count int64, err error)
- func (n *Neo4j) CountNodes(ctx context.Context, instanceID, dimensionName string) (count int64, err error)
- func (n *Neo4j) CreateCodeRelationship(ctx context.Context, i *model.Instance, codeListID, code string) error
- func (n *Neo4j) CreateInstance(ctx context.Context, i *model.Instance) error
- func (n *Neo4j) CreateInstanceConstraint(ctx context.Context, i *model.Instance) error
- func (n *Neo4j) CreateInstanceHierarchyConstraints(ctx context.Context, attempt int, instanceID, dimensionName string) error
- func (n *Neo4j) GetCode(ctx context.Context, codeListID, editionID string, codeID string) (*models.Code, error)
- func (n *Neo4j) GetCodeDatasets(ctx context.Context, codeListID, edition string, code string) (*models.Datasets, error)
- func (n *Neo4j) GetCodeList(ctx context.Context, code string) (*models.CodeList, error)
- func (n *Neo4j) GetCodeLists(ctx context.Context, filterBy string) (*models.CodeListResults, error)
- func (n *Neo4j) GetCodes(ctx context.Context, codeListID, editionID string) (*models.CodeResults, error)
- func (n *Neo4j) GetEdition(ctx context.Context, codeListID, editionID string) (*models.Edition, error)
- func (n *Neo4j) GetEditions(ctx context.Context, codeListID string) (*models.Editions, error)
- func (n *Neo4j) GetHierarchyCodelist(ctx context.Context, instanceID, dimension string) (string, error)
- func (n *Neo4j) GetHierarchyElement(ctx context.Context, instanceID, dimension, code string) (res *models.Response, err error)
- func (n *Neo4j) GetHierarchyRoot(ctx context.Context, instanceID, dimension string) (*models.Response, error)
- func (n *Neo4j) InsertDimension(ctx context.Context, cache map[string]string, i *model.Instance, ...) (*model.Dimension, error)
- func (n *Neo4j) InsertObservationBatch(ctx context.Context, attempt int, instanceID string, ...) error
- func (n *Neo4j) InstanceExists(ctx context.Context, i *model.Instance) (bool, error)
- func (n *Neo4j) MarkNodesToRemain(ctx context.Context, attempt int, instanceID, dimensionName string) error
- func (n *Neo4j) RemoveNodesNotMarkedToRemain(ctx context.Context, attempt int, instanceID, dimensionName string) error
- func (n *Neo4j) RemoveRemainMarker(ctx context.Context, attempt int, instanceID, dimensionName string) error
- func (n *Neo4j) SetHasData(ctx context.Context, attempt int, instanceID, dimensionName string) error
- func (n *Neo4j) SetInstanceIsPublished(ctx context.Context, instanceID string) error
- func (n *Neo4j) SetNumberOfChildren(ctx context.Context, attempt int, instanceID, dimensionName string) error
- func (n *Neo4j) StreamCSVRows(ctx context.Context, filter *observation.Filter, limit *int) (observation.StreamRowReader, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Neo4j ¶
type Neo4j struct { driver.Neo4jDriver // contains filtered or unexported fields }
Neo4j is a database driver allowing connection to Neo4j and providing implementations of the functions defined by the graph/driver.go interfaces
func (*Neo4j) AddDimensions ¶
AddDimensions list to the specified instance node.
func (*Neo4j) AddVersionDetailsToInstance ¶
func (n *Neo4j) AddVersionDetailsToInstance(ctx context.Context, instanceID string, datasetID string, edition string, version int) error
AddVersionDetailsToInstance updated an instance node to contain details of which dataset, edition and version the instance will also be known by
func (*Neo4j) CloneNodes ¶
func (n *Neo4j) CloneNodes(ctx context.Context, attempt int, instanceID, codeListID, dimensionName string) error
CloneNodes copies nodes from a generic hierarchy and identifies them as instance specific hierarchy nodes
func (*Neo4j) CloneRelationships ¶
func (n *Neo4j) CloneRelationships(ctx context.Context, attempt int, instanceID, codeListID, dimensionName string) error
CloneRelationships copies relationships from a generic hierarchy and uses them to join instance specific hierarchy nodes
func (*Neo4j) CountInsertedObservations ¶
func (n *Neo4j) CountInsertedObservations(ctx context.Context, instanceID string) (count int64, err error)
CountInsertedObservations returns the current number of observations relating to a given instance
func (*Neo4j) CountNodes ¶
func (n *Neo4j) CountNodes(ctx context.Context, instanceID, dimensionName string) (count int64, err error)
CountNodes returns the number of nodes existing in the specified instance hierarchy
func (*Neo4j) CreateCodeRelationship ¶
func (n *Neo4j) CreateCodeRelationship(ctx context.Context, i *model.Instance, codeListID, code string) error
CreateCodeRelationship links an instance to a code for the given dimension option
func (*Neo4j) CreateInstance ¶
CreateInstance node in a neo4j graph database
func (*Neo4j) CreateInstanceConstraint ¶
CreateInstanceConstraint creates a constraint on observations inserted for this instance.
func (*Neo4j) CreateInstanceHierarchyConstraints ¶
func (n *Neo4j) CreateInstanceHierarchyConstraints(ctx context.Context, attempt int, instanceID, dimensionName string) error
CreateInstanceHierarchyConstraints ensures constraints are in place so duplicate instance hierarchies are not created
func (*Neo4j) GetCode ¶
func (n *Neo4j) GetCode(ctx context.Context, codeListID, editionID string, codeID string) (*models.Code, error)
GetCode returns the specified code for an edition of a code list
func (*Neo4j) GetCodeDatasets ¶
func (n *Neo4j) GetCodeDatasets(ctx context.Context, codeListID, edition string, code string) (*models.Datasets, error)
GetCodeDatasets returns a list of datasets where the code is used
func (*Neo4j) GetCodeList ¶
GetCodeList returns the specified codelist
func (*Neo4j) GetCodeLists ¶
GetCodeLists returns a list of code lists
func (*Neo4j) GetCodes ¶
func (n *Neo4j) GetCodes(ctx context.Context, codeListID, editionID string) (*models.CodeResults, error)
GetCodes returns a list of codes for a specified edition of a code list
func (*Neo4j) GetEdition ¶
func (n *Neo4j) GetEdition(ctx context.Context, codeListID, editionID string) (*models.Edition, error)
GetEdition returns the specified edition for a code list
func (*Neo4j) GetEditions ¶
GetEditions returns a list of editions for a specified code list
func (*Neo4j) GetHierarchyCodelist ¶
func (n *Neo4j) GetHierarchyCodelist(ctx context.Context, instanceID, dimension string) (string, error)
GetHierarchyCodelist obtains the codelist id for this hierarchy (also, check that it exists)
func (*Neo4j) GetHierarchyElement ¶
func (n *Neo4j) GetHierarchyElement(ctx context.Context, instanceID, dimension, code string) (res *models.Response, err error)
GetHierarchyElement gets a node in a given hierarchy for a given code
func (*Neo4j) GetHierarchyRoot ¶
func (n *Neo4j) GetHierarchyRoot(ctx context.Context, instanceID, dimension string) (*models.Response, error)
GetHierarchyRoot returns the upper-most node for a given hierarchy
func (*Neo4j) InsertDimension ¶
func (n *Neo4j) InsertDimension(ctx context.Context, cache map[string]string, i *model.Instance, d *model.Dimension) (*model.Dimension, error)
InsertDimension node to neo4j and create a unique constraint on the dimension label & value if one does not already exist.
func (*Neo4j) InsertObservationBatch ¶
func (n *Neo4j) InsertObservationBatch(ctx context.Context, attempt int, instanceID string, observations []*models.Observation, dimensionIDs map[string]string) error
InsertObservationBatch creates a batch query based on a provided list of observations and attempts to insert them by bulk to the database
func (*Neo4j) InstanceExists ¶
InstanceExists returns true if an instance already exists with the provided id.
func (*Neo4j) MarkNodesToRemain ¶
func (n *Neo4j) MarkNodesToRemain(ctx context.Context, attempt int, instanceID, dimensionName string) error
MarkNodesToRemain traverses the instance hierarchy to identify nodes which contain data or have children which contain data
func (*Neo4j) RemoveNodesNotMarkedToRemain ¶
func (n *Neo4j) RemoveNodesNotMarkedToRemain(ctx context.Context, attempt int, instanceID, dimensionName string) error
RemoveNodesNotMarkedToRemain removes all nodes which were not marked as having data or having children which have data
func (*Neo4j) RemoveRemainMarker ¶
func (n *Neo4j) RemoveRemainMarker(ctx context.Context, attempt int, instanceID, dimensionName string) error
RemoveRemainMarker unsets the remain marker from all remaining nodes in the instance hierarchy
func (*Neo4j) SetHasData ¶
func (n *Neo4j) SetHasData(ctx context.Context, attempt int, instanceID, dimensionName string) error
SetHasData checks whether there are observations relating to that node in the specified instance and set a flag if true
func (*Neo4j) SetInstanceIsPublished ¶
SetInstanceIsPublished sets a flag on an instance node to indicate the published state
func (*Neo4j) SetNumberOfChildren ¶
func (n *Neo4j) SetNumberOfChildren(ctx context.Context, attempt int, instanceID, dimensionName string) error
SetNumberOfChildren traverses the instance hierarchy, counts the number of nodes with incoming hasParent relationships and sets that number on the node as a property
func (*Neo4j) StreamCSVRows ¶
func (n *Neo4j) StreamCSVRows(ctx context.Context, filter *observation.Filter, limit *int) (observation.StreamRowReader, error)
StreamCSVRows returns a reader allowing individual CSV rows to be read. Rows returned can be limited, to stop this pass in nil. If filter.DimensionFilters is nil, empty or contains only empty values then a StreamRowReader for the entire dataset will be returned.