mapper

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2022 License: MIT Imports: 5 Imported by: 17

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotHierarchy = errors.New("provided types are not a consistent hierarchy")

Functions

func APIURL

func APIURL(uuid string, labels []string, env string) string

APIURL - Establishes the ApiURL given a whether the Label is a Person, Organisation or Company (Public or Private)

func FullTypeHierarchy

func FullTypeHierarchy(highestLevelType string) []string

Full type hierarchy is returned when provided either the concept type or full uri of the most specific concept type

func IDURL

func IDURL(uuid string) string

IDURL - Adds the appropriate prefix e.g http://api.ft.com/things/

func MostSpecificType

func MostSpecificType(types []string) (string, error)

MostSpecific returns the most specific from a list of types in an hierarchy behaviour is undefined if any of the types are siblings.

func ParentType

func ParentType(t string) string

ParentType returns the immediate parent type for a given Type

func SortTypes

func SortTypes(types []string) ([]string, error)

SortTypes sorts the given types from least specific to most specific

func TypeURIs

func TypeURIs(labels []string) []string

TypeURIs - Builds up the type URI based on type e.g http://www.ft.com/ontology/Person

func TypesFromURIs added in v1.1.0

func TypesFromURIs(types []string) ([]string, error)

TypesFromURIs converts list of typeURIs to types based on the "typeURIs" mapping. The returned concept type list is sorted based on the "parentTypes" hierarchy. If a typeURI is not part of the "typeURIs" mapping, or if the type list is un-sortable it returns an error.

Types

This section is empty.

Jump to

Keyboard shortcuts

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