mappings

package
v1.11.0 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2023 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package mappings provides data structures and helpers that describe Wikidata signature resources that we want to work with.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewWikidata added in v1.9.2

func NewWikidata() map[string]Wikidata

NewWikidata creates new map for adding Wikidata records to.

Types

type ByteSequence

type ByteSequence struct {
	Signature  string // Signature byte sequence.
	Offset     int    // Offset used by the signature.
	Encoding   int    // Signature encoding, e.g. Hexadecimal, ASCII, PRONOM.
	Relativity string // Position relative to beginning or end of file, or elsewhere.
}

ByteSequence describes a sequence that goes into a signature, where a signature is made up of 1..* sequences. Usually up to three.

func (ByteSequence) String

func (byteSequence ByteSequence) String() string

Serialize the byte sequence component of our record to a string for debugging purposes.

type Signature

type Signature struct {
	ByteSequences []ByteSequence // A signature is made up of multiple byte sequences that encode a position and a pattern, e.g. BOF and EOF.
	Source        string         // Source (provenance) of the signature in Wikidata.
	Date          string         // Date the signature was submitted.
}

Signature describes a complete signature resource, i.e. a way to identify a file format using Wikidata information.

func (Signature) String

func (signature Signature) String() string

Serialize the signature component of our record to a string for debugging purposes.

type Wikidata

type Wikidata struct {
	ID              string      // Wikidata short name, e.g. Q12345 can be appended to a URI to be dereferenced.
	Name            string      // Name of the format as described in Wikidata.
	URI             string      // URI is the absolute URL in Wikidata terms that can be dereferenced.
	PRONOM          []string    // 1:1 mapping to PRONOM wherever possible.
	Extension       []string    // Extension returned by Wikidata.
	Mimetype        []string    // Mimetype as recorded by Wikidata.
	Signatures      []Signature // Signature associated with a record which we will convert to a new Type.
	Permalink       string      // Permalink associated with a record when the definitions were downloaded.
	RevisionHistory string      // RevisionHistory is a human readable block of JSON for use in roy inspect functions.
	// contains filtered or unexported fields
}

Wikidata stores information about something which constitutes a format resource in Wikidata. I.e. Anything which has a URI and describes a file-format.

func (*Wikidata) DisableSignatures

func (wikidata *Wikidata) DisableSignatures()

DisableSignatures is used when processing Wikidata records when a critical error is discovered with a record that needs to be looked into beyond what Roy can do for us.

func (Wikidata) PUIDs

func (wikidata Wikidata) PUIDs() []string

PUIDs enables the Wikidata format records to be mapped to existing PRONOM records when run in PRONOM mode, i.e. not just with Wikidata signatures.

func (Wikidata) SignaturesDisabled

func (wikidata Wikidata) SignaturesDisabled() bool

SignaturesDisabled tells us whether the signatures are disabled for a given record.

Jump to

Keyboard shortcuts

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