aggregate

package
v0.0.0-...-8832f83 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2019 License: BSD-3-Clause Imports: 9 Imported by: 0

Documentation

Overview

                         _       _
*__      _____  __ ___   ___  __ _| |_ ___
*\ \ /\ / / _ \/ _` \ \ / / |/ _` | __/ _ \
* \ V  V /  __/ (_| |\ V /| | (_| | ||  __/
*  \_/\_/ \___|\__,_| \_/ |_|\__,_|\__\___|
*
* Copyright © 2016 - 2019 Weaviate. All rights reserved.
* LICENSE: https://github.com/creativesoftwarefdn/weaviate/blob/develop/LICENSE.md
* DESIGN & CONCEPT: Bob van Luijt (@bobvanluijt)
* CONTACT: hello@creativesoftwarefdn.org

                         _       _
*__      _____  __ ___   ___  __ _| |_ ___
*\ \ /\ / / _ \/ _` \ \ / / |/ _` | __/ _ \
* \ V  V /  __/ (_| |\ V /| | (_| | ||  __/
*  \_/\_/ \___|\__,_| \_/ |_|\__,_|\__\___|
*
* Copyright © 2016 - 2019 Weaviate. All rights reserved.
* LICENSE: https://github.com/creativesoftwarefdn/weaviate/blob/develop/LICENSE.md
* DESIGN & CONCEPT: Bob van Luijt (@bobvanluijt)
* CONTACT: hello@creativesoftwarefdn.org

Package aggregate provides the local aggregate graphql endpoint for Weaviate

Index

Constants

View Source
const GroupedByFieldName = "groupedBy"

GroupedByFieldName is a special graphQL field that appears alongside the to-be-aggregated props, but doesn't require any processing by the connectors itself, as it just displays meta info about the overall aggregation.

Variables

This section is empty.

Functions

func Build

func Build(dbSchema *schema.Schema) (*graphql.Field, error)

Build the Aggreate Kinds schema

Types

type Aggregator

type Aggregator string

Aggregator is the desired computation that the database connector should perform on this property

const (
	// Count the occurence of this property
	Count Aggregator = "count"

	// Sum of all the values of the prop (i.e. sum of all Ints or Numbers)
	Sum Aggregator = "sum"

	// Mean calculates the mean of an Int or Number
	Mean Aggregator = "mean"

	// Mode calculates the mode (most occurring value) of an Int or Number
	Mode Aggregator = "mode"

	// Median calculates the median (most occurring value) of an Int or Number
	Median Aggregator = "median"

	// Maximum selects the maximum value of an Int or Number
	Maximum Aggregator = "maximum"

	// Minimum selects the maximum value of an Int or Number
	Minimum Aggregator = "minimum"
)

type Params

type Params struct {
	Kind       kind.Kind
	Filters    *common_filters.LocalFilter
	ClassName  schema.ClassName
	Properties []Property
	GroupBy    *common_filters.Path
}

Params to describe the Local->GetMeta->Kind->Class query. Will be passed to the individual connector methods responsible for resolving the GetMeta query.

type Property

type Property struct {
	Name        schema.PropertyName
	Aggregators []Aggregator
}

Property is any property of a class that we want to retrieve meta information about

type Resolver

type Resolver interface {
	LocalAggregate(info *Params) (interface{}, error)
}

Resolver is a local interface that can be composed with other interfaces to form the overall GraphQL API main interface. All data-base connectors that want to support the GetMeta feature must implement this interface.

Jump to

Keyboard shortcuts

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