arango

package
v0.0.0-...-c50d277 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2019 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateActivity

func CreateActivity(ctx context.Context, db driver.Database, activity prov.NewActivity, traceID string, now time.Time) (prov.Activity, error)

CreateActivity can create an activity in an arango database.

func CreateAgent

func CreateAgent(ctx context.Context, db driver.Database, agent prov.NewAgent, traceID string, now time.Time) (prov.Agent, error)

CreateAgent can create an agent in an arango database.

func CreateEntity

func CreateEntity(ctx context.Context, db driver.Database, entity prov.NewEntity, traceID string, now time.Time) (prov.Entity, error)

CreateEntity can create an entity in an arango database.

func FetchActivity

func FetchActivity(ctx context.Context, db driver.Database, id string) (prov.Activity, error)

FetchActivity can fetch a single activity from an arango database.

func FetchAgent

func FetchAgent(ctx context.Context, db driver.Database, id string) (prov.Agent, error)

FetchAgent can fetch a single agent from an arango database.

func FetchEntity

func FetchEntity(ctx context.Context, db driver.Database, id string) (prov.Entity, error)

FetchEntity can fetch a single entity from an arango database.

func ListActivities

func ListActivities(ctx context.Context, db driver.Database) ([]prov.Activity, error)

ListActivities can fetch a list of activities from an arango database.

func ListAgents

func ListAgents(ctx context.Context, db driver.Database) ([]prov.Agent, error)

ListAgents can fetch a list of agents from an arango database.

func ListEntities

func ListEntities(ctx context.Context, db driver.Database) ([]prov.Entity, error)

ListEntities can fetch a list of entities from an arango database.

Types

type Activity

type Activity struct {
	ID                string            `json:"_key"`                  // Unique identifier.
	CanonicalID       string            `json:"canonicalId,omitempty"` // Id for agent that exists outside of provly.
	Name              string            `json:"name"`                  // Human redable name of the agent.
	Kind              string            `json:"kind,omitempty"`        // A reference to the kind of agent this is.
	Annotations       map[string]string `json:"annotations"`           // Machine readable annotations
	CreatedAt         time.Time         `json:"createdAt"`             // When the agent was added.
	StartTime         time.Time         `json:"startTime"`             // The time that the experiment started.
	Duration          time.Duration     `json:"duration"`              // How long the experiment took.
	Used              []Entity          `json:"used"`                  // A list of entities that the activity used.
	WasAssociatedWith []Agent           `json:"wasAssociatedWith"`     // A list of agents the activity was associated with.
	WasInformedBy     []Activity        `json:"wasInformedBy"`         // A separate activity that informed this activity
}

Activity is an provenance activity that can be stored in an arango database.

type Agent

type Agent struct {
	ID              string            `json:"_key"`                      // Unique identifier.
	CanonicalID     string            `json:"canonicalId,omitempty"`     // Id for agent that exists outside of provly.
	Name            string            `json:"name"`                      // Human redable name of the agent.
	Kind            string            `json:"kind,omitempty"`            // A reference to the kind of agent this is.
	Annotations     map[string]string `json:"annotations"`               // Machine readable annotations
	CreatedAt       time.Time         `json:"createdAt"`                 // When the agent was added.
	Hash            string            `json:"hash,omitempty"`            // Hash of the asset to ensure integrity, this is probably only realistic for software.
	ActedOnBehalfOf *Agent            `json:"actedOnBehalfOf,omitempty"` // An agent on which this agent was acting on behalf of.
}

Agent is an person, organization or software.

type Entity

type Entity struct {
	ID              string            `json:"_key"`                  // Unique identifier.
	CanonicalID     string            `json:"canonicalId,omitempty"` // Id for agent that exists outside of provly.
	Name            string            `json:"name"`                  // Human redable name of the agent.
	Kind            string            `json:"kind,omitempty"`        // A reference to the kind of agent this is.
	Annotations     map[string]string `json:"annotations"`           // Machine readable annotations
	CreatedAt       time.Time         `json:"createdAt"`             // When the agent was added.
	Hash            string            `json:"hash"`                  // A hash of the entity.
	WasDerivedFrom  *Entity           `json:"wasDerivedFrom"`        // An entity this entity was derived from.
	WasGeneratedBy  *Activity         `json:"wasGeneratedBy"`        // The activity that generated this entity.
	WasAttributedTo []Agent           `json:"wasAttributedTo"`       // The agents this entity was attributed to.
}

Entity is a core provenance type.

type Relationships

type Relationships struct {
	From        string            `json:"_from"`       // The source entity.
	To          string            `json:"_to"`         // The destination entity.
	Annotations map[string]string `json:"annotations"` // Machine readable annotations.
	CreatedAt   time.Time         `json:"createdAt"`   // When the agent was added.
}

Relationships is an abstraction on all provenance relationships. The from, to, annotations, and createdAt fields are part of the application while the RelationType field defines what relationship it is.

Jump to

Keyboard shortcuts

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