wikidata

package
v4.21.0 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2026 License: GPL-3.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	InstanceUnknown = iota
	InstanceHuman
	InstancePseudonym
	InstancePenName
	InstanceCollectivePseudonym
	InstanceHumanWhoseExistenceIsDisputed
)
View Source
const (
	GenderUnknown = iota
	GenderMale
	GenderFemale
	GenderIntersex
	GenderTrasgenderFemale
	GenderTrasgenderMale
)

Variables

This section is empty.

Functions

func NewMockServer

func NewMockServer(t *testing.T, fixturePath string) *httptest.Server

Types

type Author

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

func (Author) BirthName

func (a Author) BirthName() string

func (Author) DateOfBirth

func (a Author) DateOfBirth() precisiondate.PrecisionDate

func (Author) DateOfDeath

func (a Author) DateOfDeath() precisiondate.PrecisionDate

func (Author) Description

func (a Author) Description(language string) string

func (Author) Gender

func (a Author) Gender() float64

func (Author) Image

func (a Author) Image() string

func (Author) InstanceOf

func (a Author) InstanceOf() float64

func (Author) Pseudonyms

func (a Author) Pseudonyms() []string

func (Author) RetrievedOn

func (a Author) RetrievedOn() time.Time

func (Author) SourceID

func (a Author) SourceID() string

func (Author) Website

func (a Author) Website() string
func (a Author) WikipediaLink(language string) string

type EntitiesRequest

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

func (EntitiesRequest) Get

func (e EntitiesRequest) Get() (*map[string]gowikidata.Entity, error)

func (EntitiesRequest) SetLanguages

func (e EntitiesRequest) SetLanguages(languages []string)

func (EntitiesRequest) SetProps

func (e EntitiesRequest) SetProps(props []string)

type GetEntitiesRequest

type GetEntitiesRequest interface {
	SetProps([]string)
	SetLanguages([]string)
	Get() (*map[string]gowikidata.Entity, error)
}

type Gowikidata

type Gowikidata struct {
}

func (Gowikidata) NewGetEntities

func (w Gowikidata) NewGetEntities(ids []string) (GetEntitiesRequest, error)

func (Gowikidata) NewSearch

func (w Gowikidata) NewSearch(search string, language string) (SearchEntitiesRequest, error)

type SearchEntitiesRequest

type SearchEntitiesRequest interface {
	Get() (*gowikidata.SearchEntitiesResponse, error)
}

type WikidataSource

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

func NewWikidataSource

func NewWikidataSource(w wikidata) WikidataSource

func (WikidataSource) RetrieveAuthor

func (a WikidataSource) RetrieveAuthor(ids []string, languages []string) (model.Author, error)

RetrieveAuthor returns the first match from the list of passed Wikidata entity IDs that represents a human

func (WikidataSource) SearchAuthor

func (a WikidataSource) SearchAuthor(name string, languages []string) (model.Author, error)

Jump to

Keyboard shortcuts

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