ogdat

package module
v0.0.0-...-d667415 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2015 License: MIT Imports: 19 Imported by: 0

README

Dieses Repository enthält

  • ogdat.go: eine Bibliothek der Spezifikation von Open Government Data Österreich
  • ogdatwatcher: ein Service, dass in regelmäßigen Abständen http://data.gv.at nach Datensätzen untersucht
  • analyser: Eine Anwendung, die die Postgres-Datenbank analysiert und Ergebnisse in eine Redis-Datenbank schreibt

Lizenz

MIT-Lizenz, auch in der Datei LICENSE

Documentation

Index

Constants

View Source
const (
	Info    = 1 << iota
	Warning = 1 << iota
	Error   = 1 << iota
)
View Source
const (
	FetchSuccess = 0x1000
	FetchableUrl = 0x2000

	NoDataatUrlError = 0x4000
	StructuralError  = 0x8000

	EmptyData = 0x16000
)
View Source
const CustomTimeSpecifier1 = "2006-01-02T15:04:05" // RFC 3339 = ISO 8601 ohne Zeitzone
View Source
const CustomTimeSpecifier2 = "2006-01-02" // RFC 3339 = ISO 8601 ohne Zeitzone

Variables

View Source
var (
	Arbeit           = Kategorie{NumID: 1, ID: "arbeit", PrettyName: "Arbeit", RDFProperty: ""}
	Bevoelkerung     = Kategorie{NumID: 2, ID: "bevölkerung", PrettyName: "Bevölkerung", RDFProperty: ""}
	BildungForschung = Kategorie{NumID: 3, ID: "bildung-und-forschung", PrettyName: "Bildung und Forschung", RDFProperty: ""}
	FinanzRW         = Kategorie{NumID: 4, ID: "finanzen-und-rechnungswesen", PrettyName: "Finanzen und Rechnungswesen", RDFProperty: ""}
	GeographPlanung  = Kategorie{NumID: 5, ID: "geographie-und-planung", PrettyName: "Geographie und Planung", RDFProperty: ""}
	GesellSoziales   = Kategorie{NumID: 6, ID: "gesellschaft-und-soziales", PrettyName: "Gesellschaft und Soziales", RDFProperty: ""}
	Gesundheit       = Kategorie{NumID: 7, ID: "gesundheit", PrettyName: "Gesundheit", RDFProperty: ""}
	KunstKultur      = Kategorie{NumID: 8, ID: "kunst-und-kultur", PrettyName: "Kunst und Kultur", RDFProperty: ""}
	LandFW           = Kategorie{NumID: 9, ID: "land-und-forstwirtschaft", PrettyName: "Land und Forstwirtschaft", RDFProperty: ""}
	SportFZ          = Kategorie{NumID: 10, ID: "sport-und-freizeit", PrettyName: "Sport und Freizeit", RDFProperty: ""}
	Umwelt           = Kategorie{NumID: 11, ID: "umwelt", PrettyName: "Umwelt", RDFProperty: ""}
	VerkehrTechnik   = Kategorie{NumID: 12, ID: "verkehr-und-technik", PrettyName: "Verkehr und Technik", RDFProperty: ""}
	VerwaltPol       = Kategorie{NumID: 13, ID: "verwaltung-und-politik", PrettyName: "Verwaltung und Politik", RDFProperty: ""}
	WirtTourism      = Kategorie{NumID: 14, ID: "wirtschaft-und-tourismus", PrettyName: "Wirtschaft und Tourismus", RDFProperty: ""}
)
View Source
var (
	CycCont     = Cycle{NumID: 1, DomainCode: "001", MD_MaintenanceFrequencyCode: "continual", Name_DE: "kontinuierlich"}
	CycDaily    = Cycle{NumID: 2, DomainCode: "002", MD_MaintenanceFrequencyCode: "daily", Name_DE: "täglich"}
	CycWeekly   = Cycle{NumID: 3, DomainCode: "003", MD_MaintenanceFrequencyCode: "weekly", Name_DE: "wöchentlich"}
	CycFortNly  = Cycle{NumID: 4, DomainCode: "004", MD_MaintenanceFrequencyCode: "fortnightly", Name_DE: "14-tägig"}
	CycMonthly  = Cycle{NumID: 5, DomainCode: "005", MD_MaintenanceFrequencyCode: "monthly", Name_DE: "monatlich"}
	CycQuart    = Cycle{NumID: 6, DomainCode: "006", MD_MaintenanceFrequencyCode: "quarterly", Name_DE: "quartalsweise"}
	CycBiAnn    = Cycle{NumID: 7, DomainCode: "007", MD_MaintenanceFrequencyCode: "biannually", Name_DE: "halbjährlich"}
	CycAnnually = Cycle{NumID: 8, DomainCode: "008", MD_MaintenanceFrequencyCode: "annually", Name_DE: "jährlich"}
	CycNeeded   = Cycle{NumID: 9, DomainCode: "009", MD_MaintenanceFrequencyCode: "asNeeded", Name_DE: "nach Bedarf"}
	CycIrreg    = Cycle{NumID: 10, DomainCode: "010", MD_MaintenanceFrequencyCode: "irregular", Name_DE: "unregelmäßig"}
	CycNP       = Cycle{NumID: 11, DomainCode: "011", MD_MaintenanceFrequencyCode: "notPlanned", Name_DE: "nicht geplant"}
	CycUnknown  = Cycle{NumID: 12, DomainCode: "012", MD_MaintenanceFrequencyCode: "unknown", Name_DE: "unbekannt"}
)
View Source
var Categorymap = make(map[string]Kategorie)

Functions

func CheckEncodingString

func CheckEncodingString(input string, check []string) bool

copmpare input against a slice of check strings. input will first be converted to lower-case, and any occurence of "-" is removed. The slice of checks will be iterated over, individual elements of check will not be converted or have their "-" removed.

func CheckIANAEncoding

func CheckIANAEncoding(enc string) bool

CheckIANAEncoding will try to match and input of enc against the specified encodings found at http://www.iana.org/assignments/character-sets/character-sets.xml The file at http://www.iana.org/assignments/character-sets/character-sets.xml is retrieved by a shell scripte, converted to all-lower case and sorted for unique entries. Thus the encoding enc against which will be checked, is converted to lower case and then compared to the IANA-encodings

func CheckISOLanguage

func CheckISOLanguage(lang string) bool

func CheckOGDTextStringForSaneCharacters

func CheckOGDTextStringForSaneCharacters(str string) (ok bool, _ error)

return values are: ok = false indicates sthg. was wrong in which case error will not be nil

error: if is of type CheckError: Status: 1 = Info, 2 = Warning, 3 = Error Position: beginning position of offending input message: An error message describing the problem

func GetIDFromMetaDataStructField

func GetIDFromMetaDataStructField(val reflect.StructField) int

func OGDVersionfromString

func OGDVersionfromString(match string) (version string)

Types

type Beschreibung

type Beschreibung struct {
	ID            int
	Bezeichner    string
	OGD_Kurzname  string
	CKAN_Feld     string
	Anzahl        string
	Definition_DE string
	Erlauterung   string
	Beispiel      string
	ONA2270       string
	ISO19115      string
	RDFProperty   string
	Definition_EN string
	// contains filtered or unexported fields
}

func NewBeschreibung

func NewBeschreibung(ID int, occur Occurrence, ver string) *Beschreibung

func (*Beschreibung) IsRequired

func (desc *Beschreibung) IsRequired() bool

func (*Beschreibung) Occurrence

func (desc *Beschreibung) Occurrence() Occurrence

func (*Beschreibung) Version

func (desc *Beschreibung) Version() string

type CheckInfo

type CheckInfo struct {
	Status, Position int
	Context          string
}

func CheckDataPortalUrl

func CheckDataPortalUrl(url string, followhttplink bool) (bool, []CheckInfo)

func CheckUrl

func CheckUrl(url string, followhttplink bool) (bool, []CheckInfo)

func FetchHead

func FetchHead(url string) (bool, CheckInfo)

func (*CheckInfo) Error

func (c *CheckInfo) Error() string

type CheckMessage

type CheckMessage struct {
	Type    int // 1 = Info, 2 = Warning, 4 = Error, ...
	Text    string
	OGDID   int
	Context string
}

func AppendcheckerrorTocheckmessage

func AppendcheckerrorTocheckmessage(msgs []CheckMessage, checkresults []CheckInfo, ID int, prepend string) []CheckMessage

type Cycle

type Cycle struct {
	NumID                       int
	DomainCode                  string
	MD_MaintenanceFrequencyCode string
	Name_DE                     string
	Raw                         string
}

func (*Cycle) String

func (cyc *Cycle) String() string

func (*Cycle) UnmarshalJSON

func (cyc *Cycle) UnmarshalJSON(data []byte) error

type Extras

type Extras struct {
	Metadata_Identifier *string            `json:"metadata_identifier"`
	Schema_Name         *string            `json:"schema_name"`
	Maintainer_Link     *string            `json:"maintainer_link"`
	Publisher           *string            `json:"publisher"`
	Geographic_BBox     *string            `json:"geographic_bbox"`
	Geographich_Toponym *string            `json:"geographic_toponym"`
	Categorization      *MetaDataKategorie `json:"categorization"`
}

type ISO6392Lang

type ISO6392Lang struct {
	Code, Identifier string
}

type Identifier

type Identifier struct {
	*uuid.UUID
	Raw string
}

func (*Identifier) String

func (id *Identifier) String() string

func (*Identifier) UnmarshalJSON

func (id *Identifier) UnmarshalJSON(data []byte) error

type Kategorie

type Kategorie struct {
	NumID       int `json:"-"`
	ID          string
	PrettyName  string `json:"-"`
	RDFProperty string `json:"-"`
}

func (*Kategorie) String

func (kat *Kategorie) String() string

func (*Kategorie) UnmarshalJSON

func (kat *Kategorie) UnmarshalJSON(data []byte) error

type MetaDataKategorie

type MetaDataKategorie struct {
	Kategorie []Kategorie
	IsString  bool
}

func (*MetaDataKategorie) UnmarshalJSON

func (kat *MetaDataKategorie) UnmarshalJSON(data []byte) error

type MetaDataLinkage

type MetaDataLinkage struct {
	Url     []Url
	IsArray bool
}

func (*MetaDataLinkage) UnmarshalJSON

func (u *MetaDataLinkage) UnmarshalJSON(data []byte) error

type Metadater

type Metadater interface {
	Check(bool) ([]CheckMessage, error)
	MinimalMetadata() *MinimalMetaData
}

type MinimalMetaData

type MinimalMetaData struct {
	Description *string `json:"notes"`
	Extras      `json:"extras"`
}

func MinimalMetaDataforJSONStream

func MinimalMetaDataforJSONStream(jsondata io.Reader) (*MinimalMetaData, error)

type OGDSet

type OGDSet struct {
	Label        []string
	Beschreibung []*Beschreibung
}

func GetOGDSetForVersion

func GetOGDSetForVersion(version string) *OGDSet

func Loadogdatspec

func Loadogdatspec(version, filename string) (*OGDSet, error)

func Register

func Register(version string, set *OGDSet) *OGDSet

func RegisterFromCSVFile

func RegisterFromCSVFile(version, specfile string) *OGDSet

func (*OGDSet) GetBeschreibungForID

func (set *OGDSet) GetBeschreibungForID(id int) (*Beschreibung, string)

type Occurrence

type Occurrence int
const (
	OccUndef Occurrence = iota
	OccRequired
	OccOptional
)

type ResourceSpecifier

type ResourceSpecifier string

type Tags

type Tags string

type Time

type Time struct {
	time.Time
	Raw    string
	Format string
}

func (*Time) String

func (time *Time) String() string

func (*Time) UnmarshalJSON

func (ogdtime *Time) UnmarshalJSON(data []byte) error

type Url

type Url struct {
	*url.URL
	Raw string
}

func (*Url) UnmarshalJSON

func (u *Url) UnmarshalJSON(data []byte) error

Directories

Path Synopsis
Godeps
_workspace/src/code.google.com/p/go-uuid/uuid
The uuid package generates and inspects UUIDs.
The uuid package generates and inspects UUIDs.
_workspace/src/github.com/emicklei/go-restful
Package restful, a lean package for creating REST-style WebServices without magic.
Package restful, a lean package for creating REST-style WebServices without magic.
_workspace/src/github.com/emicklei/go-restful/swagger
Package swagger implements the structures of the Swagger (https://github.com/wordnik/swagger-core/wiki) specification
Package swagger implements the structures of the Swagger (https://github.com/wordnik/swagger-core/wiki) specification
_workspace/src/github.com/garyburd/redigo/internal/redistest
Package redistest contains utilities for writing Redigo tests.
Package redistest contains utilities for writing Redigo tests.
_workspace/src/github.com/garyburd/redigo/redis
Package redis is a client for the Redis database.
Package redis is a client for the Redis database.
_workspace/src/github.com/lib/pq
Package pq is a pure Go Postgres driver for the database/sql package.
Package pq is a pure Go Postgres driver for the database/sql package.
_workspace/src/github.com/lib/pq/listen_example
Below you will find a self-contained Go program which uses the LISTEN / NOTIFY mechanism to avoid polling the database while waiting for more work to arrive.
Below you will find a self-contained Go program which uses the LISTEN / NOTIFY mechanism to avoid polling the database while waiting for more work to arrive.
_workspace/src/github.com/lib/pq/oid
Package oid contains OID constants as defined by the Postgres server.
Package oid contains OID constants as defined by the Postgres server.

Jump to

Keyboard shortcuts

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