store

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2019 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Overview

Package store is a library for querying datacommons backend storage.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Interface

Interface exposes the database access for mixer.

func NewStore

func NewStore(ctx context.Context, bqDb, projectID, schemaPath string,
	subTypeMap map[string]string, containedIn map[util.TypePair][]string,
	opts ...option.ClientOption) (Interface, error)

NewStore returns an implementation of Interface backed by BigQuery and BigTable.

type Node

type Node struct {
	Dcid   string   `json:"dcid,omitempty"`
	Name   string   `json:"name,omitempty"`
	ProvID string   `json:"provenanceId,omitempty"`
	Value  string   `json:"value,omitempty"`
	Types  []string `json:"types,omitempty"`
}

Node represents a information about a node.

type PlacePopInfo

type PlacePopInfo struct {
	PlaceID      string `json:"dcid,omitempty"`
	PopulationID string `json:"population,omitempty"`
}

PlacePopInfo contains basic info for a place and a population.

type PopObs

type PopObs struct {
	PopulationID     string `json:"dcid,omitempty"`
	ObservationValue string `json:"observation,omitempty"`
}

PopObs represents a pair of population and observation node.

type PropLabelCache

type PropLabelCache struct {
	InLabels  []string `json:"inLabels"`
	OutLabels []string `json:"outLabels"`
}

PropLabelCache represents the json structure returned by the BT Prop cache

type PropValueCache

type PropValueCache struct {
	Nodes []Node `json:"entities,omitempty"`
}

PropValueCache represents the json structure returned by the BT PropVal cache

type Triple

type Triple struct {
	SubjectID    string   `json:"subjectId,omitempty"`
	SubjectName  string   `json:"subjectName,omitempty"`
	SubjectTypes []string `json:"subjectTypes,omitempty"`
	Predicate    string   `json:"predicate,omitempty"`
	ObjectID     string   `json:"objectId,omitempty"`
	ObjectName   string   `json:"objectName,omitempty"`
	ObjectValue  string   `json:"objectValue,omitempty"`
	ObjectTypes  string   `json:"objectTypes,omitempty"`
}

Triple represents a triples entry in the BT triples cache.

type TriplesCache

type TriplesCache struct {
	Triples []Triple `json:"triples"`
}

TriplesCache represents the json structure returned by the BT triples cache

Jump to

Keyboard shortcuts

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