annotator

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2020 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const ContentTypeJSONLD = "application/ld+json; profile=\"http://www.w3.org/ns/anno.jsonld\""

ContentTypeJSONLD ...

Variables

This section is empty.

Functions

This section is empty.

Types

type Annotation

type Annotation struct {
	Context    string      `json:"@context"`
	Type       string      `json:"type"`
	Creator    string      `json:"creator"`
	Created    time.Time   `json:"created"`
	Generator  string      `json:"generator"`
	Generated  time.Time   `json:"generated"`
	Body       interface{} `json:"body"`
	Target     interface{} `json:"target"`
	Motivation string      `json:"motivation"`
	// contains filtered or unexported fields
}

Annotation W3C Annotation Model representation

func NewAnnotation

func NewAnnotation(client ClientInterface) *Annotation

NewAnnotation ...

func (*Annotation) Post

func (a *Annotation) Post(collection string) (string, error)

Post annotation to a WAP server.

type AnnotationContainer

type AnnotationContainer struct {
	Context []string `json:"@context"`
	Type    []string `json:"type"`
	Label   string   `json:"label"`
	Total   int      `json:"total,omitempty"`
}

AnnotationContainer ...

type AnnotationContent

type AnnotationContent struct {
	ID         string             `json:"id,omitempty"`
	Type       []string           `json:"type,omitempty"`
	ConformsTo string             `json:"conformsTo,omitempty"`
	Format     string             `json:"format,omitempty"`
	Value      string             `json:"value,omitempty"`
	Selector   *AnnotationContent `json:"selector,omitempty"`
	Generator  string             `json:"generator,omitempty"`
}

AnnotationContent ...

type AnnotationContentArray

type AnnotationContentArray []AnnotationContent

AnnotationContentArray ...

type Annotator

type Annotator interface {
	CreateAnnotations(url string) ([]string, error)
}

Annotator base interface

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client ...

func (*Client) CreateCollection

func (c *Client) CreateCollection(collection string) error

CreateCollection ...

func (*Client) Post

func (c *Client) Post(anno *Annotation, collection string) (string, error)

Post ...

func (*Client) SearchByTargetID

func (c *Client) SearchByTargetID(id string, generator string) (*SingleTypeAnnotationContainer, error)

SearchByTargetID ...

type ClientInterface

type ClientInterface interface {
	Post(anno *Annotation, collection string) (string, error)
	CreateCollection(collection string) error
	SearchByTargetID(id string, generator string) (*SingleTypeAnnotationContainer, error)
}

ClientInterface ...

func NewClient

func NewClient(endpoint string) ClientInterface

NewClient ...

type DefaultAnnotator

type DefaultAnnotator struct{}

DefaultAnnotator ...

func (*DefaultAnnotator) CreateAnnotations

func (a *DefaultAnnotator) CreateAnnotations(url string) ([]string, error)

CreateAnnotations ...

type SingleTypeAnnotationContainer

type SingleTypeAnnotationContainer struct {
	Context []string `json:"@context"`
	Type    string   `json:"type"`
	Label   string   `json:"label"`
	Total   int      `json:"total,omitempty"`
}

SingleTypeAnnotationContainer ...

Jump to

Keyboard shortcuts

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