Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var UnsupportedPredicateErr = errors.New("Unsupported predicate")
Functions ¶
func NewCypherAnnotationsService ¶
func NewCypherAnnotationsService(cypherRunner neoutils.NeoConnection) service
NewCypherAnnotationsService instantiate driver
Types ¶
type Annotation ¶
type Annotation struct { Thing Thing `json:"thing,omitempty"` Provenances []Provenance `json:"provenances,omitempty"` }
Annotation is the main struct used to create and return structures
type Annotations ¶
type Annotations []Annotation
Annotations represents a collection of Annotation instances
type Provenance ¶
type Provenance struct { Scores []Score `json:"scores,omitempty"` AgentRole string `json:"agentRole,omitempty"` AtTime string `json:"atTime,omitempty"` }
Provenance indicates the scores and where they came from
type Score ¶
type Score struct { ScoringSystem string `json:"scoringSystem,omitempty"` Value float64 `json:"value,omitempty"` }
Score represents one of our scores for the annotation
type Service ¶
type Service interface { Write(contentUUID string, annotationLifecycle string, platformVersion string, tid string, thing interface{}) (err error) Read(contentUUID string, tid string, annotationLifecycle string) (thing interface{}, found bool, err error) Delete(contentUUID string, tid string, annotationLifecycle string) (found bool, err error) Check() (err error) DecodeJSON(*json.Decoder) (thing interface{}, err error) Count(annotationLifecycle string, platformVersion string) (int, error) Initialise() error }
Service interface. Compatible with the baserwftapp service EXCEPT for 1) the Write function, which has signature Write(thing interface{}) error... 2) the DecodeJson function, which has signature DecodeJSON(*json.Decoder) (thing interface{}, identity string, err error) The problem is that we have a list of things, and the uuid is for a related OTHER thing TODO - move to implement a shared defined Service interface?
type Thing ¶
type Thing struct { ID string `json:"id,omitempty"` PrefLabel string `json:"prefLabel,omitempty"` Types []string `json:"types,omitempty"` Predicate string `json:"predicate,omitempty"` }
Thing represents a concept being linked to
type ValidationError ¶
type ValidationError struct {
Msg string
}
ValidationError is thrown when the annotations are not valid because mandatory information is missing
func (ValidationError) Error ¶
func (v ValidationError) Error() string