wdhelper

package module
v0.0.0-...-82be0b5 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseWikidataID

func ParseWikidataID(str string) (int64, error)

func RunWikidataQuery

func RunWikidataQuery(query string) ([]byte, error)

run a wikidata query and return the json output as []byte code adapted from https://github.com/garyhouston/sparqlcmd

func RunWikidataQuery2Struct

func RunWikidataQuery2Struct[T any](query string) (wJS[T], error)

run a wikidata query and return the output as a wJS struct T should be a struct with fields of type WItem and standard json directives with the variable names

Types

type WItem

type WItem struct {
	Type     string `json:"type"`
	Value    string `json:"value"`
	Xmllang  string `json:"xml:lang,omitempty"`
	Datatype string `json:"datatype,omitempty"`
}

Jump to

Keyboard shortcuts

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