facts

package
v0.0.0-...-6719cd2 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2019 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package facts defines the well known base set of facts that are needed to bootstrap the graph

Index

Constants

View Source
const (
	// Predicate defines the well known subject KID for the subject predicate,
	// all predicates should have an InstanceOf path to this to be a Predicate
	Predicate uint64 = 1

	// InstanceOf defines the well known subject KID for the InstanceOf
	// predicate, this predicate is used to declare that a subject is an
	// instance of another subject At a minimum this is used to define the
	// relationship between Predicate types
	InstanceOf uint64 = 2

	// CanonicalLabel defines the well known subject KID for the CanonicalLabel
	// predicate, this predicate is used to delcare a label for a subject It is
	// expected that most (all?) Subjects have a Canonical Label
	CanonicalLabel uint64 = 3

	// HasExternalID defines the well know subject KID for the <HasExternalId>
	// predicate, this predicate is used to delcare an external identifier for a
	// subject. It is expected that most (all?) Subjects have an ExternalID.
	HasExternalID uint64 = 4

	// InLanguage defines the well known subject KID for the <InLanguage>
	// predicate used to define the language of a subject.
	InLanguage uint64 = 5

	// InUnits defines the well known subject KID for the <InUnits> predicate,
	// used to declare a unit of measure for a subject.  It is expected that
	// most subjects with literals will specify units.
	InUnits uint64 = 6

	// CompareOperator defines the predicate for the
	// predicate used to define comparisons for a subject+object.
	CompareOperator uint64 = 7

	// EqualTo compare operator sid.
	EqualTo uint64 = 8

	// LessThan compare operator sid.
	LessThan uint64 = 9

	// LessThanOrEqualTo compare operator sid.
	LessThanOrEqualTo uint64 = 10

	// GreaterThan compare operator sid.
	GreaterThan uint64 = 11

	// GreaterThanOrEqualTo compare operator sid.
	GreaterThanOrEqualTo uint64 = 12
)

Variables

View Source
var (
	// PredicateKGO is a KGObject instance for the Predicate KID
	PredicateKGO = rpc.AKID(Predicate)

	// InstanceOfKGO is a KGOBject instance for the InstanceOf KID
	InstanceOfKGO = rpc.AKID(InstanceOf)

	// CanonicalLabelKGO is a KGObject instance for the CanonicalLabel KID
	CanonicalLabelKGO = rpc.AKID(CanonicalLabel)

	// HasExternalIDKGO is a KGObject instance for the HasExternalID KID
	HasExternalIDKGO = rpc.AKID(HasExternalID)

	// InLanguageKGO is the KGObject instance for the InLanguage KID.
	InLanguageKGO = rpc.AKID(InLanguage)

	// InUnitsKGO is a KObject instance for the InUnits KID
	InUnitsKGO = rpc.AKID(InUnits)

	// CompareOperatorKGO is the object instance for the operator KID.
	CompareOperatorKGO = rpc.AKID(CompareOperator)
)

Functions

func BaseFacts

func BaseFacts() []rpc.Fact

BaseFacts returns the set of well-known facts. The caller may modify the returned slice.

func ResolveExternalID

func ResolveExternalID(externalID string) uint64

ResolveExternalID returns a non-zero KID if there exists a well-known fact with that KID as the subject, <HasExternalID> as the predicate, and the given externalID as the object. Otherwise, it returns 0.

Types

This section is empty.

Jump to

Keyboard shortcuts

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