reconciler

package
v0.17.0 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2023 License: MIT Imports: 0 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Choice added in v0.16.0

type Choice struct {
	Value string `json:"value"`
	ID    string `json:"id"`
}

type Extend added in v0.16.0

type Extend struct {
	ProposeProperties `json:"propose_properties,omitempty"`
	PropertySettings  []PropertySetting `json:"property_settings"`
}

type Feature

type Feature struct {
	// ID is the name of the feature.
	ID string `json:"id"`

	// Value is a quantitative representation of the feature.
	Value float64 `json:"value"`
}

Feature is a matching feature that can be used to determing the matching score.

type Input

type Input struct {
	// Queries contains all requested queries. Queries are identified
	// by an identification string.
	Queries map[string]Query `form:"queries"`
}

Input contains fields necessary for the reconciliation process. This intput is compatible with W3C Reconciliation API.

type Manifest

type Manifest struct {
	// Versions returns the versions of W3C Reconciliation API descrived at
	// https://www.w3.org/community/reports/reconciliation/CG-FINAL-specs-0.2-20230410 .
	// Versions can have "1.0" and "2.0" elements. For our purposes
	// it should be set to ["2.0"].
	Versions []string `json:"versions"`

	// Name of the reconciliation service. Should be set to "GlobalNames".
	Name string `json:"name"`

	Preview `json:"preview"`
	View    `json:"view"`

	Extend `json:"extend"`

	// IdentifierSpace contans the URI prefix of the reconciliation service.
	// For example "https://verifier.globalnames.org/api/v1/name_strings/"
	IdentifierSpace string `json:"identifierSpace"`

	// SchemaSpace provides the URL pointing to the schema of an entity.
	SchemaSpace string `json:"schemaSpace"`

	// DefaultTypes used for a reconciliation queries.
	DefaultTypes []Type `json:"defaultTypes"`
}

Manifest describes metadata of a W3C Reconciliation Service.

type Output

type Output map[string]ReconciliationResult

Ouput is a map where the key is the provided identifier of a query, and the ReconciliationResult contains all found ReconciliationCandidates.

type Preview

type Preview struct {
	Height int    `json:"height"`
	Width  int    `json:"width"`
	URL    string `json:"url"`
}

type Property

type Property struct {
	// PID is the property name.
	PID string `json:"pid"`

	// Value is used to filter the property.
	Value string `json:"v"`
}

Property can be used to further filter list of candidates, similar to a WHERE cause in SQL. This implementation is less flexible than W3C standard and takes only one value. We will expand it if necessary.

type PropertySetting added in v0.16.0

type PropertySetting struct {
	Name     string   `json:"name"`
	Label    string   `json:"label"`
	Type     string   `json:"type"`
	Default  string   `json:"default"`
	HelpText string   `json:"help_text,omitempty"`
	Choices  []Choice `json:"choices,omitempty"`
}

type ProposeProperties added in v0.16.0

type ProposeProperties struct {
	ServiceURL  string `json:"service_url,omitempty"`
	ServicePath string `json:"service_path"`
}

type Query

type Query struct {
	// Query contains a name-string we try to reconcile.
	Query string `json:"query"`

	// Type allows to constrain reconciliation agains specific type described
	// in the manifest.
	Type string `json:"type"`

	// Limit restricts the number of candidates returned by the query.
	Limit int `json:"limit"`

	// Properties allow to add additional filters to the reconciliation
	// process.
	Properties []Property `json:"properties,omitempty"`

	// TypeStrict is a legacy deprecated field that came from FreeBase.
	TypeStrict string `json:"type_strict,omitempty"`
}

Query is a set of fields used for verification.

type ReconciliationCandidate

type ReconciliationCandidate struct {
	// ID can be used to lookup the entity in a corresponding service.
	ID string `json:"id"`

	// Name contains reconciled name-string.
	Name string `json:"name"`

	// Description provides some metadata about the item.
	Description string `json:"description"`

	// Score is used to estimate chances for a result to be a match.
	// It is calculated from features.
	Score float64 `json:"score"`

	// Features might contain details of reconciliation and be used for
	// the score calculation.
	Features []Feature `json:"features,omitempty"`

	// Types contains types that were assigned to the candidate.
	Types []Type `json:"types"`

	// Match is true if the score is above a threshold and without a
	// reasonable doubt the result is the best match to the query.
	Match bool `json:"match"`
}

ReconciliationCandidate contains the details of a reconciliation item.

type ReconciliationResult

type ReconciliationResult struct {
	// Result contains all candidates for reconciliation.
	Result []ReconciliationCandidate `json:"result"`
}

ReconciliationResult is a slice where results are sorted by their score.

type Type

type Type struct {
	// ID is a unique identifier for the type.
	ID string `json:"id"`

	// Name is a human friendly short description of the type.
	Name string `json:"name"`
}

Type describes types available for the reconciliation service.

type View

type View struct {
	URL string `json:"url"`
}

Jump to

Keyboard shortcuts

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