wikidata

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: May 23, 2020 License: AGPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetCover

func GetCover(id, language string, connection *sql.DB) (string, error)

func GetWorkDescription

func GetWorkDescription(article, language string, connection *sql.DB) (string, error)

Types

type Book

type Book struct {
	Uri         string
	Source      []Source
	Cover       string
	Authors     []string
	Year        int64
	Title       string
	SerieUri    string
	SerieName   string
	PartInSerie string
	Genres      []string
	Article     string
	Description string
}

func GetBook

func GetBook(id, language string, connection *sql.DB) (*Book, error)

func GetBookByTmdb

func GetBookByTmdb(id, language string) (Book, error)

func (Book) GetArticle

func (b Book) GetArticle() string

func (*Book) SetDescription

func (b *Book) SetDescription(description string)

type BookSerie

type BookSerie struct {
	Title       string
	Cover       string // note maybe first book’s cover?
	Description string
	Authors     []string
	Genres      []string
	Source      []Source
	Article     string
	Parts       map[string]BookSeriePart
	SortedParts []BookSeriePart
}

func GetBookSerie

func GetBookSerie(id, language string, connection *sql.DB) (*BookSerie, error)

func GetBookSerieOrdinals

func GetBookSerieOrdinals(id string, bookSerie *BookSerie, connection *sql.DB) (*BookSerie, error)

func (BookSerie) GetArticle

func (s BookSerie) GetArticle() string

func (*BookSerie) SetDescription

func (s *BookSerie) SetDescription(description string)

type BookSeriePart

type BookSeriePart struct {
	Cover   string
	Ordinal string
	Title   string
	Uri     string
}

type Editions

type Editions struct {
	Entities map[string]struct {
		OriginalLang string
		Image        struct {
			Url string
		}
	}
}

type Ordinals

type Ordinals struct {
	Entities map[string]struct {
		Claims struct {
			P527 []struct {
				Mainsnak struct {
					Datavalue struct {
						Value struct {
							Id string
						}
					}
				}
				Qualifiers struct {
					P1545 []struct {
						Datavalue struct {
							Value string
						}
					}
				}
			}
		}
	}
}

type Result

type Result struct {
	Repo   *sparql.Repo
	Result *sparql.Results
	Work   Work
}

type SearchResults

type SearchResults struct {
	Results []struct {
		Id          string
		Type        string
		Uri         string
		Label       string
		Description string
		Image       []string
		ImagePath   string
	}
}
func Search(query, language string, page int64) (*SearchResults, error)

type Source

type Source struct {
	Url  string
	Name string
}

type WikidataQuery

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

type Work

type Work interface {
	GetArticle() string
	SetDescription(description string)
}

Jump to

Keyboard shortcuts

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