vocab

package
v0.0.0-...-0d6871a Latest Latest
Warning

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

Go to latest
Published: May 13, 2022 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrDeprecated = errors.New("vocab: deprecated")
	ErrUnknown    = errors.New("vocab: unknown")
)

Functions

func AudienceOptions

func AudienceOptions(lang language.Tag) (res [][2]string)

func BindingOptions

func BindingOptions(lang language.Tag) (res [][2]string)

Types

type Audience

type Audience string
const (
	TG1000 Audience = "TG1000"
	TG1001 Audience = "TG1001"
	TG1002 Audience = "TG1002"
	TG1003 Audience = "TG1003"
	TG1004 Audience = "TG1004"
	TG1005 Audience = "TG1005"
	TG1006 Audience = "TG1006"
	TG1007 Audience = "TG1007"
	TG1008 Audience = "TG1008"
	TG1009 Audience = "TG1009"
	TG1010 Audience = "TG1010"
	TG1011 Audience = "TG1011"
	TG1012 Audience = "TG1012"
	TG1013 Audience = "TG1013"
	TG1014 Audience = "TG1014"
	TG1015 Audience = "TG1015"
	TG1016 Audience = "TG1016"
	TG1017 Audience = "TG1017"
)

func ParseAudience

func ParseAudience(s string) (Audience, error)

func ParseAudienceCode

func ParseAudienceCode(s string) (Audience, error)

func ParseAudienceURL

func ParseAudienceURL(s string) (Audience, error)

func (Audience) Alias

func (a Audience) Alias(tag language.Tag) []string

func (Audience) Code

func (a Audience) Code() string

func (Audience) Label

func (a Audience) Label(tag language.Tag) string

func (Audience) URL

func (a Audience) URL() string

type Binding

type Binding string
const (
	BindingUnknown   Binding = "?"
	BindingHardback  Binding = "hardback"
	BindingPaperback Binding = "paperback"
	BindingSpiral    Binding = "spiral"
	BindingBoard     Binding = "board"
)

func ParseBinding

func ParseBinding(s string) Binding

func (Binding) Label

func (b Binding) Label(tag language.Tag) string

type Gender

type Gender string
const (
	GenderUnknown Gender = "?"
	GenderMale    Gender = "m"
	GenderFemale  Gender = "f"
	GenderOther   Gender = "o"
)

func ParseGender

func ParseGender(s string) Gender

func (Gender) Label

func (g Gender) Label(tag language.Tag) string

type Identifier

type Identifier struct {
	Code  string
	Value string
	Label string
	URL   string // Optional
}

Identifier is an external, known Identifier.

func ParseIdentifier

func ParseIdentifier(code, value string) Identifier

ParseIdentifier creates an Identifier from the give code and value. If the code is not known, the Identifier Label will be set as the code, and the URL will be empty.

type Relation

type Relation string
const (
	RelationInvalid           Relation = "invalid"
	RelationHasContributor    Relation = "has_contributor"
	RelationHasSubject        Relation = "has_subject"
	RelationPublishedBy       Relation = "published_by"
	RelationInSeries          Relation = "in_series"
	RelationHasParent         Relation = "has_parent"
	RelationHasPart           Relation = "has_part"
	RelationHasClassification Relation = "has_classification" // has_dewey?
	RelationSubsidiaryOf      Relation = "subsidiary_of"      // TODO has_parent is enough?
	RelationImprintOf         Relation = "imprint_of"
)

func ParseRelation

func ParseRelation(s string) Relation

func (Relation) InverseLabel

func (r Relation) InverseLabel(tag language.Tag) string

func (Relation) Label

func (r Relation) Label(tag language.Tag) string

func (Relation) String

func (r Relation) String() string

type Term

type Term interface {
	// Code is the coded value of a Term.
	Code() string

	// URI is the canonical representation of the Term.
	// The URI does not need to resolve.
	URI() string

	// Label should return a localized string representation of a Term.
	Label(language.Tag) string

	// Alias or synonyms for the term. Only aliases matching the language.Tag
	// should be returned.
	Alias(language.Tag) []string
}

Term is a vocabulary term.

Directories

Path Synopsis
bs
Code generated by go generate; DO NOT EDIT.
Code generated by go generate; DO NOT EDIT.
Code generated by go generate; DO NOT EDIT.
Code generated by go generate; DO NOT EDIT.
Code generated by go generate; DO NOT EDIT.
Code generated by go generate; DO NOT EDIT.

Jump to

Keyboard shortcuts

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