API Reference
classes
Perspective

@coasys/ad4m / Exports / Perspective

Class: Perspective

A Perspective represents subjective meaning, encoded through associations between expressions, a.k.a. Links, that is a graph over the objective Expressions of any subset of Languages.

This type represents the clean onotological concept of a Perspective. An instance of this class can be regarded as an immutable snapshot of a mutable perspective.

The types PerspectiveProxy and PerspectiveHandle are used when dealing with an instantiated mutable perspective as is done through most of the GraphQL mutations.

Table of contents

Constructors

Properties

Methods

Constructors

constructor

new Perspective(links?)

Parameters

NameType
links?LinkExpression[]

Defined in

perspectives/Perspective.ts:24 (opens in a new tab)

Properties

links

links: LinkExpression[]

The content of the perspective, a list/graph of links

Defined in

perspectives/Perspective.ts:22 (opens in a new tab)

Methods

get

get(query): LinkExpression[]

Convenience function for filtering links just like with PerspectiveProxy

Parameters

NameType
queryLinkQuery

Returns

LinkExpression[]

Defined in

perspectives/Perspective.ts:33 (opens in a new tab)


getSingleTarget

getSingleTarget(query): string | void

Convenience function to get the target of the first link that matches the given query This makes sense when the query is expected to return only one link and the target of that link is what you are looking for.

Parameters

NameType
queryLinkQuery

Returns

string | void

Defined in

perspectives/Perspective.ts:81 (opens in a new tab)