smartlogic

package
v1.12.0 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrorConceptDoesNotExist = errors.New("concept does not exist")

Functions

This section is empty.

Types

type ChangedConcept

type ChangedConcept struct {
	URI string `json:"@id"`
}

type Changeset

type Changeset struct {
	Concepts []ChangedConcept `json:"sem:about"`
}

type Client

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

func (*Client) AccessToken

func (c *Client) AccessToken() string

func (*Client) GenerateToken

func (c *Client) GenerateToken() error

Tokens have a limited life, so to be safe we should generate a new one for each notification received.

func (*Client) GetChangedConceptList

func (c *Client) GetChangedConceptList(changeDate time.Time) ([]string, error)

GetChangedConceptList returns a list of uuids of concepts that were changed since specified time.

func (*Client) GetConcept

func (c *Client) GetConcept(uuid string) ([]byte, error)

GetConcept returns the json-ld Smartlogic representation of a concept with the given uuid via calling the Smartlogic API.

type Clienter

type Clienter interface {
	GetConcept(uuid string) ([]byte, error)
	GetChangedConceptList(changeDate time.Time) ([]string, error)
	AccessToken() string
}

func NewSmartlogicClient

func NewSmartlogicClient(httpClient httpClient, baseURL, model, apiKey, conceptURIPrefix string, log *logger.UPPLogger) (Clienter, error)

type Graph

type Graph struct {
	Changesets []Changeset `json:"@graph"`
}

type TokenResponse

type TokenResponse struct {
	AccessToken string `json:"access_token"`
	TokenType   string `json:"token_type"`
	ExpiresIn   int    `json:"expires_in"`
	UserName    string `json:"userName"`
	Issued      string `json:".issued"`
	Expires     string `json:".expires"`
}

Jump to

Keyboard shortcuts

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