@perspect3vism/ad4m / Exports

AD4M

The Agent-Centric Distributed Application Meta-ontology or just: *Agent-Centric DApp Meta-ontology*

  • A new meta-ontology for interoperable, decentralized application design
  • A spanning-layer to enable seamless integration between Holochain DNAs, blockchains, linked-data structures/ontologies and centralized back-ends
  • The basis for turning distinct, monolithic and siloed apps into a global, open and interoperable sense-making network

Ok, let's go...

To build an app/UI against Ad4m, you need to make sure that an ad4m-executor is running on the user's machine.

The easiest way to get that is to use ad4m-cli:

npm install -g @perspect3vism/ad4m-cli
ad4m executor run &

Then use Ad4mClient to connect to and work with the running ad4m-executor like this:

npm install --save @perspect3vism/ad4m
npm install --save-exact @apollo/client@3.6.9
npm install --save graphql-ws
npm install --save ws

In your code:

import { Ad4mClient } from '@perspect3vism/ad4m'
import { ApolloClient, InMemoryCache } from "@apollo/client/core";
import { GraphQLWsLink } from "@apollo/client/link/subscriptions";
import { createClient } from 'graphql-ws';
import Websocket from "ws";

const wsLink = new GraphQLWsLink(createClient({
    url: `ws://localhost:4000/graphql`,
    webSocketImpl: Websocket
}));

const apolloClient = new ApolloClient({
    link: wsLink,
    cache: new InMemoryCache(),
    defaultOptions: {
        watchQuery: {
            fetchPolicy: 'network-only',
            nextFetchPolicy: 'network-only'
        },
    }
});

ad4mClient = new Ad4mClient(apolloClient)

Unlocking / initializing the agent

You can't do much with the Ad4m runtime as long as the agent is not initialized. So first get the agent status to see if we either need to create new DID or unlock an existing keystore.

const { isInitialized, isUnlocked, did } = await ad4mClient.agent.status()

If isInitialized is false (and then did is empty) we need to create or import a DID and keys. generate() will create a new DID with method key and lock the keystore with the given passphrase.

const { did } = await ad4mClient.agent.generate("passphrase")

In following runs of the exectuor, ad4mClient.agent.status() will return a did and isInitialized true, but if isUnlocked is false, we need to unlock the keystore providing the passphrase:

const { isUnlocked, did } = await ad4mClient.agent.unlock("passphrase")

Languages

For creating an expression we need to select a language that we create an expression in:

const languages = await ad4mClient.languages.all()
const noteIpfsAddress = languages.find(l => l.name === 'note-ipfs').address

Creating an Expression

const exprAddress = await ad4mClient.expression.create("A new text note", noteIpfsAddress)

Creating a Perspective and linking that new Expression

const perspectiveHandle = await ad4mClient.perspective.add("A new perspective on apps...")
await ad4mClient.perspective.addLink(
    perspectiveHandle.uuid,
    new Link({
        source: 'root',
        target: exprAddress
    })
)

Publishing that local Perspective by turning it into a Neighbourhood

The back-bone of a Neighbourhood is a LinkLanguage - a Language that enables the sharing and thus synchronizing of links (see LinksAdapter in Language.ts). While there can and should be many different implementations with different trade-offs and features (like membranes etc.), there currently is one fully implemented and Holochain based LinkLanguage with the name Social Context.

It is deployed on the current test network (Language Language v0.0.5) under the address: QmZ1mkoY8nLvpxY3Mizx8UkUiwUzjxJxsqSTPPdH8sHxCQ.

Creating our unique LinkLanguage clone through templating

But we should not just use this publicly known Language as the back-bone for our new Neighbourhood, since we need a unique clone. So what we want is to use this existing Language as a template and create a new copy with the same code but different UUID and/name in order to create a fresh space for our new Neighbourhood.

What parameters can we adjust when using it as template? Let's have a look at the Language's meta information:

const socialContextMeta = await ad4mClient.languages.meta("QmZ1mkoY8nLvpxY3Mizx8UkUiwUzjxJxsqSTPPdH8sHxCQ") 

console.log(socialContextMeta)

Which should yield something like this:

 {
  name: 'social-context',
  address: 'QmZ1mkoY8nLvpxY3Mizx8UkUiwUzjxJxsqSTPPdH8sHxCQ',
  description: 'Holochain based LinkLanguage. First full implementation of a LinkLanguage, for collaborative Neighbourhoods where every agent can add links. No membrane. Basic template for all custom Neighbourhoods in this first iteration of the Perspect3vism test network.',
  author: 'did:key:zQ3shkkuZLvqeFgHdgZgFMUx8VGkgVWsLA83w2oekhZxoCW2n',
  templated: false,
  templateSourceLanguageAddress: null,
  templateAppliedParams: null,
  possibleTemplateParams: [ 'uuid', 'name', 'description' ],
  sourceCodeLink: 'https://github.com/juntofoundation/Social-Context'
}

The field possibleTemplateParams tells us that we can set a UUID and override name and description. Let's leave description but change the name. The function languages.applyTemplateAndPublish() takes an object as JSON as second parameter like so:

const uniqueLinkLanguage = await ad4mClient.languages.applyTemplateAndPublish("QmZ1mkoY8nLvpxY3Mizx8UkUiwUzjxJxsqSTPPdH8sHxCQ", JSON.stringify({"uuid": "84a329-77384c-1510fb", "name": "Social Context clone for demo Neighbourhood"}));

And then use this new LinkLanguage in our Neighbourhood:

const meta = new Perspective()
const neighbourhoodUrl = await ad4mClient.neighbourhood.publishFromPerspective(
    perspectiveHandle.uuid,
    uniqueLinkLanguage.address,
    meta
)
console.log(neighbourhoodUrl) // => neighbourhood://Qm123456789abcdef

Joining a Neighbourhood (on another node/agent)

Assume everything above happened on Alice's agent. Alice now shares the Neighbourhood's URL with Bob. This is what Bob does to join the Neigbourhood, access it as a (local) Perspective and retrieve the Expression Alice created and linked there:

const joinedNeighbourhood = await ad4mClient.neighbourhood.joinFromUrl(neighbourhoodUrl)
const links = await ad4mClient.perspective.queryLinks(joinedNeighbourhood.uuid, new LinkQuery({source: 'a'}))
links.forEach(async link => {
    const address = link.data.target
    const expression = await ad4mClient.expression.get(address)
    const data = JSON.parse(expression.data)
    console.log(data) //=> "A new text note"
})

Building from source

Run:

npm i && npm run build

Wait, what?!

The central claim of AD4M is that any single- but also specifically multi-user application can be bootstrapped out of a meta-ontology consisting of 3 quintessential ontological units:

  • Agents
  • Languages
  • and Perspectives

This is a meta-ontology since it doesn't make any assumptions about the specific ontologies implemented in those bootstrapped apps. But since apps bootstrapped from it share the same meta-ontology, they are mutualy interoperable.

Agents...

...represent humans with their devices, which is what the internet actually is. Technically represented as Decentralized Identifiers - DIDs.

Languages...

...encapsulate the actual technology used to communicate, like Holochain or IPFS, but what they provide to the high-level layers is this: Languages define Expressions, which are the atoms of what Agents communicate. Expressions are always created, and thus signed, by an agent. Expressions are referenced via a URL of the kind <language>://<language specific expression address>. That URL and the Expression itself is the only objective part in AD4M.

Perspectives...

...belong to a specific agent. They represent context and association between expressions. They consist of a list of RDF/semantic web like triplets (subject-predicate-object) called links because all three items are just URLs pointing to expressions. Perspectives are like Solid's pods, but they are agent-centric. There is no such thing as a Perspective that does not belong to an agent. It is like the canvas on which an agent perceives and onto which they create anything. To the next layer above (either the very general UI built in Perspectivism - or any other special purpose UI), they are like a database scope.


Bootstrapping

Any AD4M implementation will have to include at least 3 reflexive system Languages to enable the dynamic bootstrapping of apps and interconnected sense-making networks:

  • A Language of Agents, i.e. where the expressions represent agents, and which uses DIDs as the expression URLs.
  • A Language of Languages, i.e. a way to talk about Languages so Languages can be created by users and shared.
  • A Language of Perspectives which implies the concept of Shared Perspectives a.k.a. Neighbourhoods, i.e. a way to share an otherwise local and private Perspective with others which constitutes the basic building block of any collaboration context.

Having these Languages means Agents can author expressions that represent Agents, Languages and Perspectives. These expressions get linked from inside Perspectives. That way we can model primitives like friends-lists (Perspective including agent expressions), app-stores (Perspective including Languages) and more.

How do I build an app on/with AD4M?

Building an AD4M app actually means extending the AD4M ecosystem with the

  • Languages
  • and link-ontologies

needed for the app's domain - and then creating expressions from those Languages and linking them inside Perspectives.

The latter means creating RDF/semantic web style triplets that associate expressions in order to represent app specific semantics - not too different to how Solid style linked-data would work.

Classes

@perspect3vism/ad4m / Exports / Ad4mClient / Ad4mClient

Class: Ad4mClient

Ad4mClient.Ad4mClient

Client for the Ad4m interface wrapping GraphQL queryies for convenient use in user facing code.

Aggregates the six sub-clients: AgentClient, ExpressionClient, LanguageClient, NeighbourhoodClient, PerspectiveClient and RuntimeClient for the respective functionality.

Table of contents

Constructors

Properties

Accessors

Constructors

constructor

new Ad4mClient(client, subscribe?)

Parameters
Name Type Default value
client ApolloClient<any> undefined
subscribe boolean true
Defined in

Ad4mClient.ts:29

Properties

#agentClient

Private #agentClient: AgentClient

Defined in

Ad4mClient.ts:21


#apolloClient

Private #apolloClient: ApolloClient<any>

Defined in

Ad4mClient.ts:20


#expressionClient

Private #expressionClient: ExpressionClient

Defined in

Ad4mClient.ts:22


#languageClient

Private #languageClient: LanguageClient

Defined in

Ad4mClient.ts:23


#neighbourhoodClient

Private #neighbourhoodClient: NeighbourhoodClient

Defined in

Ad4mClient.ts:24


#perspectiveClient

Private #perspectiveClient: PerspectiveClient

Defined in

Ad4mClient.ts:25


#runtimeClient

Private #runtimeClient: RuntimeClient

Defined in

Ad4mClient.ts:26

Accessors

agent

get agent(): AgentClient

Returns

AgentClient

Defined in

Ad4mClient.ts:39


expression

get expression(): ExpressionClient

Returns

ExpressionClient

Defined in

Ad4mClient.ts:43


languages

get languages(): LanguageClient

Returns

LanguageClient

Defined in

Ad4mClient.ts:47


neighbourhood

get neighbourhood(): NeighbourhoodClient

Returns

NeighbourhoodClient

Defined in

Ad4mClient.ts:51


perspective

get perspective(): PerspectiveClient

Returns

PerspectiveClient

Defined in

Ad4mClient.ts:55


runtime

get runtime(): RuntimeClient

Returns

RuntimeClient

Defined in

Ad4mClient.ts:59

@perspect3vism/ad4m / Exports / agent/Agent / Agent

Class: Agent

agent/Agent.Agent

AD4M's representation of an Agent

AD4M Agents are build around DIDs, which are used to identify and authenticate the Agent. Conceptually, an Agent is regarded as something that can speak and that can listen.

Agents speak by creating Expressions in AD4M Languages which are signed by the Agent's DID key, And they also speak (broadcast) by putting semantic statements into their public "Agent Perspective". They listen (can receive messages) through their "direct message Language".

These three aspects are represented by the three fields of this class.

This class is used as format for the Expressions in the Agent language. Since AD4M treats DID URIs as addresses for the Agent Language, DIDs are resolved to Expressions that are objects of this class. Thus, this is how agents see (other) agents.

Table of contents

Constructors

Properties

Constructors

constructor

new Agent(did, perspective?)

Parameters
Name Type
did string
perspective? Perspective
Defined in

agent/Agent.ts:42

Properties

did

did: string

The DID of the Agent All epxressions authored by them are signed with the keys mentioned in the DID document behind this DID URI.

Defined in

agent/Agent.ts:28


directMessageLanguage

Optional directMessageLanguage: string

Address of the Language by which the Agent will receive DMs

Defined in

agent/Agent.ts:40


perspective

Optional perspective: Perspective

The Perspective that holds the public-facing semantics/statements of the Agent Holds and shares a Perspective that links all information this agent wants to offer as public-facing semantics. This should be used for any kind of user profile information.

Defined in

agent/Agent.ts:36

@perspect3vism/ad4m / Exports / agent/Agent / AgentExpression

Class: AgentExpression

agent/Agent.AgentExpression

Hierarchy

  • any

    AgentExpression

Table of contents

Constructors

Constructors

constructor

new AgentExpression()

Inherited from

ExpressionGeneric(Agent).constructor

@perspect3vism/ad4m / Exports / agent/Agent / EntanglementProof

Class: EntanglementProof

agent/Agent.EntanglementProof

Table of contents

Constructors

Properties

Constructors

constructor

new EntanglementProof(did, didSigningKeyId, deviceKeyType, deviceKey, deviceKeySignedByDid, didSignedByDeviceKey?)

Parameters
Name Type
did string
didSigningKeyId string
deviceKeyType string
deviceKey string
deviceKeySignedByDid string
didSignedByDeviceKey? string
Defined in

agent/Agent.ts:75

Properties

deviceKey

deviceKey: string

Defined in

agent/Agent.ts:67


deviceKeySignedByDid

deviceKeySignedByDid: string

Defined in

agent/Agent.ts:70


deviceKeyType

deviceKeyType: string

Defined in

agent/Agent.ts:64


did

did: string

Defined in

agent/Agent.ts:58


didSignedByDeviceKey

Optional didSignedByDeviceKey: string

Defined in

agent/Agent.ts:73


didSigningKeyId

didSigningKeyId: string

Defined in

agent/Agent.ts:61

@perspect3vism/ad4m / Exports / agent/Agent / EntanglementProofInput

Class: EntanglementProofInput

agent/Agent.EntanglementProofInput

Table of contents

Constructors

Properties

Constructors

constructor

new EntanglementProofInput(did, didSigningKeyId, deviceKeyType, deviceKey, deviceKeySignedByDid, didSignedByDeviceKey)

Parameters
Name Type
did string
didSigningKeyId string
deviceKeyType string
deviceKey string
deviceKeySignedByDid string
didSignedByDeviceKey string
Defined in

agent/Agent.ts:105

Properties

deviceKey

deviceKey: string

Defined in

agent/Agent.ts:97


deviceKeySignedByDid

deviceKeySignedByDid: string

Defined in

agent/Agent.ts:100


deviceKeyType

deviceKeyType: string

Defined in

agent/Agent.ts:94


did

did: string

Defined in

agent/Agent.ts:88


didSignedByDeviceKey

didSignedByDeviceKey: string

Defined in

agent/Agent.ts:103


didSigningKeyId

didSigningKeyId: string

Defined in

agent/Agent.ts:91

@perspect3vism/ad4m / Exports / agent/AgentClient / AgentClient

Class: AgentClient

agent/AgentClient.AgentClient

Provides access to all functions regarding the local agent, such as generating, locking, unlocking, importing the DID keystore, as well as updating the publicly shared Agent expression.

Table of contents

Constructors

Properties

Methods

Constructors

constructor

new AgentClient(client, subscribe?)

Parameters
Name Type Default value
client ApolloClient<any> undefined
subscribe boolean true
Defined in

agent/AgentClient.ts:61

Properties

#agentStatusChangedCallbacks

Private #agentStatusChangedCallbacks: AgentStatusChangedCallback[]

Defined in

agent/AgentClient.ts:59


#apolloClient

Private #apolloClient: ApolloClient<any>

Defined in

agent/AgentClient.ts:57


#updatedCallbacks

Private #updatedCallbacks: AgentUpdatedCallback[]

Defined in

agent/AgentClient.ts:58

Methods

addAgentStatusChangedListener

addAgentStatusChangedListener(listener): void

Parameters
Name Type
listener any
Returns

void

Defined in

agent/AgentClient.ts:301


addEntanglementProofs

addEntanglementProofs(proofs): Promise<EntanglementProof[]>

Parameters
Name Type
proofs EntanglementProofInput[]
Returns

Promise<EntanglementProof[]>

Defined in

agent/AgentClient.ts:234


addUpdatedListener

addUpdatedListener(listener): void

Parameters
Name Type
listener any
Returns

void

Defined in

agent/AgentClient.ts:281


byDID

byDID(did): Promise<Agent>

Parameters
Name Type
did string
Returns

Promise<Agent>

Defined in

agent/AgentClient.ts:155


deleteEntanglementProofs

deleteEntanglementProofs(proofs): Promise<EntanglementProof[]>

Parameters
Name Type
proofs EntanglementProofInput[]
Returns

Promise<EntanglementProof[]>

Defined in

agent/AgentClient.ts:246


entanglementProofPreFlight

entanglementProofPreFlight(deviceKey, deviceKeyType): Promise<EntanglementProof>

Parameters
Name Type
deviceKey string
deviceKeyType string
Returns

Promise<EntanglementProof>

Defined in

agent/AgentClient.ts:269


generate

generate(passphrase): Promise<AgentStatus>

Parameters
Name Type
passphrase string
Returns

Promise<AgentStatus>

Defined in

agent/AgentClient.ts:98


generateJwt

generateJwt(requestId, rand): Promise<string>

Parameters
Name Type
requestId string
rand string
Returns

Promise<string>

Defined in

agent/AgentClient.ts:341


getEntanglementProofs

getEntanglementProofs(): Promise<string[]>

Returns

Promise<string[]>

Defined in

agent/AgentClient.ts:258


import

import(args): Promise<AgentStatus>

Parameters
Name Type
args InitializeArgs
Returns

Promise<AgentStatus>

Defined in

agent/AgentClient.ts:112


isLocked

isLocked(): Promise<boolean>

Returns

Promise<boolean>

Defined in

agent/AgentClient.ts:351


lock

lock(passphrase): Promise<AgentStatus>

Parameters
Name Type
passphrase string
Returns

Promise<AgentStatus>

Defined in

agent/AgentClient.ts:130


me

me(): Promise<Agent>

Returns the Agent expression of the local agent as it is shared publicly via the AgentLanguage.

I.e. this is the users profile.

Returns

Promise<Agent>

Defined in

agent/AgentClient.ts:78


mutatePublicPerspective

mutatePublicPerspective(mutations): Promise<Agent>

Parameters
Name Type
mutations LinkMutations
Returns

Promise<Agent>

Defined in

agent/AgentClient.ts:190


permitCapability

permitCapability(auth): Promise<string>

Parameters
Name Type
auth string
Returns

Promise<string>

Defined in

agent/AgentClient.ts:331


requestCapability

requestCapability(appName, appDesc, appUrl, capabilities): Promise<string>

Parameters
Name Type
appName string
appDesc string
appUrl string
capabilities string
Returns

Promise<string>

Defined in

agent/AgentClient.ts:321


status

status(): Promise<AgentStatus>

Returns

Promise<AgentStatus>

Defined in

agent/AgentClient.ts:87


subscribeAgentStatusChanged

subscribeAgentStatusChanged(): void

Returns

void

Defined in

agent/AgentClient.ts:305


subscribeAgentUpdated

subscribeAgentUpdated(): void

Returns

void

Defined in

agent/AgentClient.ts:285


unlock

unlock(passphrase): Promise<AgentStatus>

Parameters
Name Type
passphrase string
Returns

Promise<AgentStatus>

Defined in

agent/AgentClient.ts:142


updateDirectMessageLanguage

updateDirectMessageLanguage(directMessageLanguage): Promise<Agent>

Parameters
Name Type
directMessageLanguage string
Returns

Promise<Agent>

Defined in

agent/AgentClient.ts:219


updatePublicPerspective

updatePublicPerspective(perspective): Promise<Agent>

Parameters
Name Type
perspective PerspectiveInput
Returns

Promise<Agent>

Defined in

agent/AgentClient.ts:167

@perspect3vism/ad4m / Exports / agent/AgentResolver / default

Class: default

agent/AgentResolver.default

Table of contents

Constructors

Methods

Constructors

constructor

new default()

Methods

agent

agent(): Agent

Returns

Agent

Defined in

agent/AgentResolver.ts:11


agentAddEntanglementProofs

agentAddEntanglementProofs(proofs): EntanglementProof[]

Parameters
Name Type
proofs EntanglementProofInput[]
Returns

EntanglementProof[]

Defined in

agent/AgentResolver.ts:93


agentByDID

agentByDID(did): Agent

Parameters
Name Type
did string
Returns

Agent

Defined in

agent/AgentResolver.ts:62


agentDeleteEntanglementProofs

agentDeleteEntanglementProofs(proofs): EntanglementProof[]

Parameters
Name Type
proofs EntanglementProofInput[]
Returns

EntanglementProof[]

Defined in

agent/AgentResolver.ts:98


agentEntanglementProofPreFlight

agentEntanglementProofPreFlight(deviceKey, deviceKeyType): EntanglementProof

Parameters
Name Type
deviceKey string
deviceKeyType string
Returns

EntanglementProof

Defined in

agent/AgentResolver.ts:108


agentGenerate

agentGenerate(passphrase, pubSub): AgentStatus

Parameters
Name Type
passphrase string
pubSub any
Returns

AgentStatus

Defined in

agent/AgentResolver.ts:21


agentGenerateJwt

agentGenerateJwt(requestId, rand): String

Parameters
Name Type
requestId string
rand string
Returns

String

Defined in

agent/AgentResolver.ts:128


agentGetEntanglementProofs

agentGetEntanglementProofs(): EntanglementProof[]

Returns

EntanglementProof[]

Defined in

agent/AgentResolver.ts:103


agentImport

agentImport(did, didDocument, keystore, passphrase): AgentStatus

Parameters
Name Type
did string
didDocument string
keystore string
passphrase string
Returns

AgentStatus

Defined in

agent/AgentResolver.ts:31


agentIsLocked

agentIsLocked(): Boolean

Returns

Boolean

Defined in

agent/AgentResolver.ts:133


agentLock

agentLock(passphrase, pubSub): AgentStatus

Parameters
Name Type
passphrase string
pubSub any
Returns

AgentStatus

Defined in

agent/AgentResolver.ts:41


agentPermitCapability

agentPermitCapability(auth): String

Parameters
Name Type
auth string
Returns

String

Defined in

agent/AgentResolver.ts:123


agentRequestCapability

agentRequestCapability(appName, appDesc, appUrl, capabilities): String

Parameters
Name Type
appName string
appDesc string
appUrl string
capabilities string
Returns

String

Defined in

agent/AgentResolver.ts:113


agentStatus

agentStatus(): AgentStatus

Returns

AgentStatus

Defined in

agent/AgentResolver.ts:16


agentStatusChanged

agentStatusChanged(): AgentStatus

Returns

AgentStatus

Defined in

agent/AgentResolver.ts:88


agentUnlock

agentUnlock(passphrase, pubSub): AgentStatus

Parameters
Name Type
passphrase string
pubSub any
Returns

AgentStatus

Defined in

agent/AgentResolver.ts:51


agentUpdateDirectMessageLanguage

agentUpdateDirectMessageLanguage(directMessageLanguage, pubSub): Agent

Parameters
Name Type
directMessageLanguage string
pubSub any
Returns

Agent

Defined in

agent/AgentResolver.ts:75


agentUpdatePublicPerspective

agentUpdatePublicPerspective(perspective, pubSub): Agent

Parameters
Name Type
perspective PerspectiveInput
pubSub any
Returns

Agent

Defined in

agent/AgentResolver.ts:67


agentUpdated

agentUpdated(): Agent

Returns

Agent

Defined in

agent/AgentResolver.ts:83

@perspect3vism/ad4m / Exports / agent/AgentStatus / AgentStatus

Class: AgentStatus

agent/AgentStatus.AgentStatus

Table of contents

Constructors

Properties

Constructors

constructor

new AgentStatus(obj?)

Parameters
Name Type
obj? object
Defined in

agent/AgentStatus.ts:20

Properties

did

Optional did: string

Defined in

agent/AgentStatus.ts:12


didDocument

Optional didDocument: string

Defined in

agent/AgentStatus.ts:15


error

Optional error: string

Defined in

agent/AgentStatus.ts:18


isInitialized

isInitialized: Boolean

Defined in

agent/AgentStatus.ts:6


isUnlocked

isUnlocked: Boolean

Defined in

agent/AgentStatus.ts:9

@perspect3vism/ad4m / Exports / expression/Expression / Expression

Class: Expression

expression/Expression.Expression

Hierarchy

  • any

    Expression

Table of contents

Constructors

Constructors

constructor

new Expression()

Inherited from

ExpressionGeneric(Object).constructor

@perspect3vism/ad4m / Exports / expression/Expression / ExpressionProof

Class: ExpressionProof

expression/Expression.ExpressionProof

Table of contents

Constructors

Properties

Constructors

constructor

new ExpressionProof(sig, k)

Parameters
Name Type
sig string
k string
Defined in

expression/Expression.ts:20

Properties

invalid

Optional invalid: boolean

Defined in

expression/Expression.ts:18


key

key: string

Defined in

expression/Expression.ts:12


signature

signature: string

Defined in

expression/Expression.ts:9


valid

Optional valid: boolean

Defined in

expression/Expression.ts:15

@perspect3vism/ad4m / Exports / expression/Expression / ExpressionProofInput

Class: ExpressionProofInput

expression/Expression.ExpressionProofInput

Table of contents

Constructors

Properties

Constructors

constructor

new ExpressionProofInput()

Properties

invalid

Optional invalid: boolean

Defined in

expression/Expression.ts:38


key

key: string

Defined in

expression/Expression.ts:32


signature

signature: string

Defined in

expression/Expression.ts:29


valid

Optional valid: boolean

Defined in

expression/Expression.ts:35

@perspect3vism/ad4m / Exports / expression/Expression / ExpressionRendered

Class: ExpressionRendered

expression/Expression.ExpressionRendered

Hierarchy

  • any

    ExpressionRendered

Table of contents

Constructors

Properties

Constructors

constructor

new ExpressionRendered()

Inherited from

ExpressionGeneric(String).constructor

Properties

icon

icon: Icon

Defined in

expression/Expression.ts:94


language

language: LanguageRef

Defined in

expression/Expression.ts:91

@perspect3vism/ad4m / Exports / expression/ExpressionClient / ExpressionClient

Class: ExpressionClient

expression/ExpressionClient.ExpressionClient

Table of contents

Constructors

Properties

Methods

Constructors

constructor

new ExpressionClient(client)

Parameters
Name Type
client ApolloClient<any>
Defined in

expression/ExpressionClient.ts:9

Properties

#apolloClient

Private #apolloClient: ApolloClient<any>

Defined in

expression/ExpressionClient.ts:7

Methods

create

create(content, languageAddress): Promise<string>

Parameters
Name Type
content any
languageAddress string
Returns

Promise<string>

Defined in

expression/ExpressionClient.ts:65


get

get(url): Promise<ExpressionRendered>

Parameters
Name Type
url string
Returns

Promise<ExpressionRendered>

Defined in

expression/ExpressionClient.ts:13


getMany

getMany(urls): Promise<ExpressionRendered[]>

Parameters
Name Type
urls string[]
Returns

Promise<ExpressionRendered[]>

Defined in

expression/ExpressionClient.ts:34


getRaw

getRaw(url): Promise<string>

Parameters
Name Type
url string
Returns

Promise<string>

Defined in

expression/ExpressionClient.ts:55


interact

interact(url, interactionCall): Promise<string>

Parameters
Name Type
url string
interactionCall InteractionCall
Returns

Promise<string>

Defined in

expression/ExpressionClient.ts:90


interactions

interactions(url): Promise<InteractionMeta[]>

Parameters
Name Type
url string
Returns

Promise<InteractionMeta[]>

Defined in

expression/ExpressionClient.ts:76

@perspect3vism/ad4m / Exports / expression/ExpressionResolver / default

Class: default

expression/ExpressionResolver.default

Table of contents

Constructors

Methods

Constructors

constructor

new default()

Methods

expression

expression(url): ExpressionRendered

Parameters
Name Type
url string
Returns

ExpressionRendered

Defined in

expression/ExpressionResolver.ts:16


expressionCreate

expressionCreate(content, languageAddress): string

Parameters
Name Type
content string
languageAddress string
Returns

string

Defined in

expression/ExpressionResolver.ts:39


expressionInteract

expressionInteract(url, interactionCall): string

Parameters
Name Type
url string
interactionCall InteractionCall
Returns

string

Defined in

expression/ExpressionResolver.ts:57


expressionInteractions

expressionInteractions(url): InteractionMeta[]

Parameters
Name Type
url string
Returns

InteractionMeta[]

Defined in

expression/ExpressionResolver.ts:47


expressionMany

expressionMany(urls): ExpressionRendered[]

Parameters
Name Type
urls string[]
Returns

ExpressionRendered[]

Defined in

expression/ExpressionResolver.ts:25


expressionRaw

expressionRaw(url): string

Parameters
Name Type
url string
Returns

string

Defined in

expression/ExpressionResolver.ts:30

@perspect3vism/ad4m / Exports / language/Icon / Icon

Class: Icon

language/Icon.Icon

Table of contents

Constructors

Properties

Constructors

constructor

new Icon(code)

Parameters
Name Type
code string
Defined in

language/Icon.ts:8

Properties

code

code: string

Defined in

language/Icon.ts:6

@perspect3vism/ad4m / Exports / language/Language / InteractionCall

Class: InteractionCall

language/Language.InteractionCall

Table of contents

Constructors

Properties

Accessors

Constructors

constructor

new InteractionCall(name, parameters)

Parameters
Name Type
name string
parameters object
Defined in

language/Language.ts:227

Properties

name

name: string

Defined in

language/Language.ts:219


parametersStringified

parametersStringified: string

Defined in

language/Language.ts:221

Accessors

parameters

get parameters(): object

Returns

object

Defined in

language/Language.ts:223

@perspect3vism/ad4m / Exports / language/Language / InteractionMeta

Class: InteractionMeta

language/Language.InteractionMeta

Table of contents

Constructors

Properties

Constructors

constructor

new InteractionMeta()

Properties

label

label: string

Defined in

language/Language.ts:201


name

name: string

Defined in

language/Language.ts:204


parameters

parameters: InteractionParameter[]

Defined in

language/Language.ts:207

@perspect3vism/ad4m / Exports / language/Language / InteractionParameter

Class: InteractionParameter

language/Language.InteractionParameter

Table of contents

Constructors

Properties

Constructors

constructor

new InteractionParameter()

Properties

name

name: string

Defined in

language/Language.ts:192


type

type: string

Defined in

language/Language.ts:195

@perspect3vism/ad4m / Exports / language/Language / OnlineAgent

Class: OnlineAgent

language/Language.OnlineAgent

Table of contents

Constructors

Properties

Constructors

constructor

new OnlineAgent()

Properties

did

did: string

Defined in

language/Language.ts:234


status

status: string

Defined in

language/Language.ts:235

@perspect3vism/ad4m / Exports / language/Language / TelepresenceRpcCall

Class: TelepresenceRpcCall

language/Language.TelepresenceRpcCall

Table of contents

Constructors

Properties

Constructors

constructor

new TelepresenceRpcCall()

Properties

fn_name

fn_name: string

Defined in

language/Language.ts:239


params

params: object

Defined in

language/Language.ts:240

@perspect3vism/ad4m / Exports / language/LanguageClient / LanguageClient

Class: LanguageClient

language/LanguageClient.LanguageClient

Table of contents

Constructors

Properties

Methods

Constructors

constructor

new LanguageClient(apolloClient)

Parameters
Name Type
apolloClient ApolloClient<any>
Defined in

language/LanguageClient.ts:31

Properties

#apolloClient

Private #apolloClient: ApolloClient<any>

Defined in

language/LanguageClient.ts:29

Methods

all

all(): Promise<LanguageHandle[]>

Returns

Promise<LanguageHandle[]>

Defined in

language/LanguageClient.ts:59


applyTemplateAndPublish

applyTemplateAndPublish(sourceLanguageHash, templateData): Promise<LanguageRef>

Parameters
Name Type
sourceLanguageHash string
templateData string
Returns

Promise<LanguageRef>

Defined in

language/LanguageClient.ts:76


byAddress

byAddress(address): Promise<LanguageHandle>

Parameters
Name Type
address string
Returns

Promise<LanguageHandle>

Defined in

language/LanguageClient.ts:35


byFilter

byFilter(filter): Promise<LanguageHandle[]>

Parameters
Name Type
filter string
Returns

Promise<LanguageHandle[]>

Defined in

language/LanguageClient.ts:47


meta

meta(address): Promise<LanguageMeta>

Parameters
Name Type
address string
Returns

Promise<LanguageMeta>

Defined in

language/LanguageClient.ts:114


publish

publish(languagePath, languageMeta): Promise<LanguageMeta>

Parameters
Name Type
languagePath string
languageMeta LanguageMetaInput
Returns

Promise<LanguageMeta>

Defined in

language/LanguageClient.ts:95


remove

remove(address): Promise<Boolean>

Parameters
Name Type
address string
Returns

Promise<Boolean>

Defined in

language/LanguageClient.ts:146


source

source(address): Promise<string>

Parameters
Name Type
address string
Returns

Promise<string>

Defined in

language/LanguageClient.ts:131


writeSettings

writeSettings(languageAddress, settings): Promise<Boolean>

Parameters
Name Type
languageAddress string
settings string
Returns

Promise<Boolean>

Defined in

language/LanguageClient.ts:63

@perspect3vism/ad4m / Exports / language/LanguageHandle / LanguageHandle

Class: LanguageHandle

language/LanguageHandle.LanguageHandle

Table of contents

Constructors

Properties

Constructors

constructor

new LanguageHandle()

Properties

address

address: string

Defined in

language/LanguageHandle.ts:10


constructorIcon

Optional constructorIcon: Icon

Defined in

language/LanguageHandle.ts:19


icon

Optional icon: Icon

Defined in

language/LanguageHandle.ts:16


name

name: string

Defined in

language/LanguageHandle.ts:7


settings

Optional settings: string

Defined in

language/LanguageHandle.ts:13


settingsIcon

Optional settingsIcon: Icon

Defined in

language/LanguageHandle.ts:22

@perspect3vism/ad4m / Exports / language/LanguageMeta / LanguageExpression

Class: LanguageExpression

language/LanguageMeta.LanguageExpression

Hierarchy

  • any

    LanguageExpression

Table of contents

Constructors

Constructors

constructor

new LanguageExpression()

Inherited from

ExpressionGeneric(LanguageMetaInternal).constructor

@perspect3vism/ad4m / Exports / language/LanguageMeta / LanguageLanguageInput

Class: LanguageLanguageInput

language/LanguageMeta.LanguageLanguageInput

Table of contents

Constructors

Properties

Constructors

constructor

new LanguageLanguageInput()

Properties

bundle

bundle: string

Defined in

language/LanguageMeta.ts:68


meta

meta: LanguageMetaInternal

Defined in

language/LanguageMeta.ts:69

@perspect3vism/ad4m / Exports / language/LanguageMeta / LanguageMeta

Class: LanguageMeta

language/LanguageMeta.LanguageMeta

Table of contents

Constructors

Properties

Constructors

constructor

new LanguageMeta()

Properties

address

address: string

Defined in

language/LanguageMeta.ts:10


author

author: string

Defined in

language/LanguageMeta.ts:16


description

description: string

Defined in

language/LanguageMeta.ts:13


name

name: string

Defined in

language/LanguageMeta.ts:7


possibleTemplateParams

Optional possibleTemplateParams: string[]

Defined in

language/LanguageMeta.ts:28


Optional sourceCodeLink: string

Defined in

language/LanguageMeta.ts:31


templateAppliedParams

Optional templateAppliedParams: string

Defined in

language/LanguageMeta.ts:25


templateSourceLanguageAddress

Optional templateSourceLanguageAddress: string

Defined in

language/LanguageMeta.ts:22


templated

templated: boolean

Defined in

language/LanguageMeta.ts:19

@perspect3vism/ad4m / Exports / language/LanguageMeta / LanguageMetaInput

Class: LanguageMetaInput

language/LanguageMeta.LanguageMetaInput

Table of contents

Constructors

Properties

Constructors

constructor

new LanguageMetaInput(name?, description?)

Parameters
Name Type
name? string
description? string
Defined in

language/LanguageMeta.ts:48

Properties

description

description: string

Defined in

language/LanguageMeta.ts:40


name

name: string

Defined in

language/LanguageMeta.ts:37


possibleTemplateParams

Optional possibleTemplateParams: string[]

Defined in

language/LanguageMeta.ts:43


Optional sourceCodeLink: string

Defined in

language/LanguageMeta.ts:46

@perspect3vism/ad4m / Exports / language/LanguageMeta / LanguageMetaInternal

Class: LanguageMetaInternal

language/LanguageMeta.LanguageMetaInternal

Table of contents

Constructors

Properties

Constructors

constructor

new LanguageMetaInternal()

Properties

address

address: string

Defined in

language/LanguageMeta.ts:57


description

description: string

Defined in

language/LanguageMeta.ts:58


name

name: string

Defined in

language/LanguageMeta.ts:56


possibleTemplateParams

Optional possibleTemplateParams: string[]

Defined in

language/LanguageMeta.ts:61


Optional sourceCodeLink: string

Defined in

language/LanguageMeta.ts:62


templateAppliedParams

Optional templateAppliedParams: string

Defined in

language/LanguageMeta.ts:60


templateSourceLanguageAddress

Optional templateSourceLanguageAddress: string

Defined in

language/LanguageMeta.ts:59

@perspect3vism/ad4m / Exports / language/LanguageRef / LanguageRef

Class: LanguageRef

language/LanguageRef.LanguageRef

Table of contents

Constructors

Properties

Constructors

constructor

new LanguageRef(address?, name?)

Parameters
Name Type
address? string
name? string
Defined in

language/LanguageRef.ts:14

Properties

address

address: string

Defined in

language/LanguageRef.ts:9


name

name: string

Defined in

language/LanguageRef.ts:12

@perspect3vism/ad4m / Exports / language/LanguageResolver / default

Class: default

language/LanguageResolver.default

Resolver classes are used here to define the GraphQL schema (through the type-graphql annotations) and are spawned in the client tests in Ad4mClient.test.ts. For the latter, they return test fixtures.

Table of contents

Constructors

Methods

Constructors

constructor

new default()

Methods

language

language(address): LanguageHandle

Parameters
Name Type
address string
Returns

LanguageHandle

Defined in

language/LanguageResolver.ts:16


languageApplyTemplateAndPublish

languageApplyTemplateAndPublish(sourceLanguageHash, templateData): LanguageRef

Parameters
Name Type
sourceLanguageHash string
templateData string
Returns

LanguageRef

Defined in

language/LanguageResolver.ts:49


languageMeta

languageMeta(address): LanguageMeta

Parameters
Name Type
address string
Returns

LanguageMeta

Defined in

language/LanguageResolver.ts:75


languagePublish

languagePublish(languagePath, languageMeta): LanguageMeta

Parameters
Name Type
languagePath string
languageMeta LanguageMetaInput
Returns

LanguageMeta

Defined in

language/LanguageResolver.ts:57


languageRemove

languageRemove(address): Boolean

Parameters
Name Type
address string
Returns

Boolean

Defined in

language/LanguageResolver.ts:95


languageSource

languageSource(address): string

Parameters
Name Type
address string
Returns

string

Defined in

language/LanguageResolver.ts:90


languageWriteSettings

languageWriteSettings(languageAddress, settings): Boolean

Parameters
Name Type
languageAddress string
settings string
Returns

Boolean

Defined in

language/LanguageResolver.ts:41


languages

languages(filter): LanguageHandle[]

Parameters
Name Type
filter string
Returns

LanguageHandle[]

Defined in

language/LanguageResolver.ts:29

@perspect3vism/ad4m / Exports / links/Links / Link

links/Links.Link

Table of contents

Constructors

Properties

Constructors

constructor

new Link(obj)

Parameters
Name Type
obj any
Defined in

links/Links.ts:15

Properties

predicate

Optional predicate: string

Defined in

links/Links.ts:13


source

source: string

Defined in

links/Links.ts:7


target

target: string

Defined in

links/Links.ts:10

@perspect3vism/ad4m / Exports / links/Links / LinkExpression

Class: LinkExpression

links/Links.LinkExpression

Hierarchy

  • any

    LinkExpression

Table of contents

Constructors

Methods

Constructors

constructor

new LinkExpression()

Inherited from

ExpressionGeneric(Link).constructor

Methods

hash

hash(): number

Returns

number

Defined in

links/Links.ts:45

@perspect3vism/ad4m / Exports / links/Links / LinkExpressionInput

Class: LinkExpressionInput

links/Links.LinkExpressionInput

Hierarchy

  • any

    LinkExpressionInput

Table of contents

Constructors

Constructors

constructor

new LinkExpressionInput()

Inherited from

ExpressionGenericInput(LinkInput).constructor

@perspect3vism/ad4m / Exports / links/Links / LinkInput

Class: LinkInput

links/Links.LinkInput

Table of contents

Constructors

Properties

Constructors

constructor

new LinkInput()

Properties

predicate

Optional predicate: string

Defined in

links/Links.ts:40


source

source: string

Defined in

links/Links.ts:34


target

target: string

Defined in

links/Links.ts:37

@perspect3vism/ad4m / Exports / links/Links / LinkMutations

Class: LinkMutations

links/Links.LinkMutations

Table of contents

Constructors

Properties

Constructors

constructor

new LinkMutations()

Properties

additions

additions: LinkInput[]

Defined in

links/Links.ts:25


removals

removals: LinkExpression[]

Defined in

links/Links.ts:28

@perspect3vism/ad4m / Exports / neighbourhood/Neighbourhood / Neighbourhood

Class: Neighbourhood

neighbourhood/Neighbourhood.Neighbourhood

Table of contents

Constructors

Properties

Constructors

constructor

new Neighbourhood(linkLanguage, meta)

Parameters
Name Type
linkLanguage string
meta Perspective
Defined in

neighbourhood/Neighbourhood.ts:15

Properties

linkLanguage

linkLanguage: string

Defined in

neighbourhood/Neighbourhood.ts:10


meta

meta: Perspective

Defined in

neighbourhood/Neighbourhood.ts:13

@perspect3vism/ad4m / Exports / neighbourhood/Neighbourhood / NeighbourhoodExpression

Class: NeighbourhoodExpression

neighbourhood/Neighbourhood.NeighbourhoodExpression

Hierarchy

  • any

    NeighbourhoodExpression

Table of contents

Constructors

Constructors

constructor

new NeighbourhoodExpression()

Inherited from

ExpressionGeneric(Neighbourhood).constructor

@perspect3vism/ad4m / Exports / neighbourhood/NeighbourhoodClient / NeighbourhoodClient

Class: NeighbourhoodClient

neighbourhood/NeighbourhoodClient.NeighbourhoodClient

Table of contents

Constructors

Properties

Methods

Constructors

constructor

new NeighbourhoodClient(client)

Parameters
Name Type
client ApolloClient<any>
Defined in

neighbourhood/NeighbourhoodClient.ts:10

Properties

#apolloClient

Private #apolloClient: ApolloClient<any>

Defined in

neighbourhood/NeighbourhoodClient.ts:8

Methods

joinFromUrl

joinFromUrl(url): Promise<PerspectiveHandle>

Parameters
Name Type
url string
Returns

Promise<PerspectiveHandle>

Defined in

neighbourhood/NeighbourhoodClient.ts:36


publishFromPerspective

publishFromPerspective(perspectiveUUID, linkLanguage, meta): Promise<string>

Parameters
Name Type
perspectiveUUID string
linkLanguage string
meta Perspective
Returns

Promise<string>

Defined in

neighbourhood/NeighbourhoodClient.ts:14

@perspect3vism/ad4m / Exports / neighbourhood/NeighbourhoodResolver / default

Class: default

neighbourhood/NeighbourhoodResolver.default

Resolver classes are used here to define the GraphQL schema (through the type-graphql annotations) and are spawned in the client tests in Ad4mClient.test.ts. For the latter, they return test fixtures.

Table of contents

Constructors

Methods

Constructors

constructor

new default()

Methods

neighbourhoodJoinFromUrl

neighbourhoodJoinFromUrl(url): PerspectiveHandle

Parameters
Name Type
url string
Returns

PerspectiveHandle

Defined in

neighbourhood/NeighbourhoodResolver.ts:24


neighbourhoodPublishFromPerspective

neighbourhoodPublishFromPerspective(perspectiveUUID, linkLanguage, meta): string

Parameters
Name Type
perspectiveUUID string
linkLanguage string
meta PerspectiveInput
Returns

string

Defined in

neighbourhood/NeighbourhoodResolver.ts:15

@perspect3vism/ad4m / Exports / perspectives/LinkQuery / LinkQuery

Class: LinkQuery

perspectives/LinkQuery.LinkQuery

Table of contents

Constructors

Properties

Methods

Constructors

constructor

new LinkQuery(obj)

Parameters
Name Type
obj object
Defined in

perspectives/LinkQuery.ts:25

Properties

fromDate

Optional fromDate: Date

Defined in

perspectives/LinkQuery.ts:17


limit

Optional limit: number

Defined in

perspectives/LinkQuery.ts:23


predicate

Optional predicate: string

Defined in

perspectives/LinkQuery.ts:14


source

Optional source: string

Defined in

perspectives/LinkQuery.ts:8


target

Optional target: string

Defined in

perspectives/LinkQuery.ts:11


untilDate

Optional untilDate: Date

Defined in

perspectives/LinkQuery.ts:20

Methods

isMatch

isMatch(l): boolean

Parameters
Name Type
l Link
Returns

boolean

Defined in

perspectives/LinkQuery.ts:51

@perspect3vism/ad4m / Exports / perspectives/Perspective / Perspective

Class: Perspective

perspectives/Perspective.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
Name Type
links? LinkExpression[]
Defined in

perspectives/Perspective.ts:24

Properties

links: LinkExpression[]

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

Defined in

perspectives/Perspective.ts:22

Methods

get

get(query): LinkExpression[]

Convenience function for filtering links just like with PerspectiveProxy

Parameters
Name Type
query LinkQuery
Returns

LinkExpression[]

Defined in

perspectives/Perspective.ts:33


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
Name Type
query LinkQuery
Returns

string | void

Defined in

perspectives/Perspective.ts:81

@perspect3vism/ad4m / Exports / perspectives/Perspective / PerspectiveExpression

Class: PerspectiveExpression

perspectives/Perspective.PerspectiveExpression

Hierarchy

  • any

    PerspectiveExpression

Table of contents

Constructors

Constructors

constructor

new PerspectiveExpression()

Inherited from

ExpressionGeneric(Perspective).constructor

@perspect3vism/ad4m / Exports / perspectives/Perspective / PerspectiveInput

Class: PerspectiveInput

perspectives/Perspective.PerspectiveInput

Table of contents

Constructors

Properties

Constructors

constructor

new PerspectiveInput()

Properties

links: LinkExpressionInput[]

Defined in

perspectives/Perspective.ts:95

@perspect3vism/ad4m / Exports / perspectives/PerspectiveClient / PerspectiveClient

Class: PerspectiveClient

perspectives/PerspectiveClient.PerspectiveClient

Table of contents

Constructors

Properties

Methods

Constructors

constructor

new PerspectiveClient(client, subscribe?)

Parameters
Name Type Default value
client ApolloClient<any> undefined
subscribe boolean true
Defined in

perspectives/PerspectiveClient.ts:43

Properties

#apolloClient

Private #apolloClient: ApolloClient<any>

Defined in

perspectives/PerspectiveClient.ts:38


#perspectiveAddedCallbacks

Private #perspectiveAddedCallbacks: PerspectiveHandleCallback[]

Defined in

perspectives/PerspectiveClient.ts:39


#perspectiveRemovedCallbacks

Private #perspectiveRemovedCallbacks: UuidCallback[]

Defined in

perspectives/PerspectiveClient.ts:41


#perspectiveUpdatedCallbacks

Private #perspectiveUpdatedCallbacks: PerspectiveHandleCallback[]

Defined in

perspectives/PerspectiveClient.ts:40

Methods

add

add(name): Promise<PerspectiveProxy>

Parameters
Name Type
name string
Returns

Promise<PerspectiveProxy>

Defined in

perspectives/PerspectiveClient.ts:125


addLink(uuid, link): Promise<LinkExpression>

Parameters
Name Type
uuid string
link Link
Returns

Promise<LinkExpression>

Defined in

perspectives/PerspectiveClient.ts:158


addPerspectiveAddedListener

addPerspectiveAddedListener(cb): void

Parameters
Name Type
cb PerspectiveHandleCallback
Returns

void

Defined in

perspectives/PerspectiveClient.ts:206


addPerspectiveLinkAddedListener

addPerspectiveLinkAddedListener(uuid, cb): Promise<void>

Parameters
Name Type
uuid String
cb LinkCallback[]
Returns

Promise<void>

Defined in

perspectives/PerspectiveClient.ts:263


addPerspectiveLinkRemovedListener

addPerspectiveLinkRemovedListener(uuid, cb): Promise<void>

Parameters
Name Type
uuid String
cb LinkCallback[]
Returns

Promise<void>

Defined in

perspectives/PerspectiveClient.ts:280


addPerspectiveRemovedListener

addPerspectiveRemovedListener(cb): void

Parameters
Name Type
cb UuidCallback
Returns

void

Defined in

perspectives/PerspectiveClient.ts:244


addPerspectiveUpdatedListener

addPerspectiveUpdatedListener(cb): void

Parameters
Name Type
cb PerspectiveHandleCallback
Returns

void

Defined in

perspectives/PerspectiveClient.ts:225


all

all(): Promise<PerspectiveProxy[]>

Returns

Promise<PerspectiveProxy[]>

Defined in

perspectives/PerspectiveClient.ts:56


byUUID

byUUID(uuid): Promise<PerspectiveProxy>

Parameters
Name Type
uuid string
Returns

Promise<PerspectiveProxy>

Defined in

perspectives/PerspectiveClient.ts:68


publishSnapshotByUUID

publishSnapshotByUUID(uuid): Promise<string>

Parameters
Name Type
uuid string
Returns

Promise<string>

Defined in

perspectives/PerspectiveClient.ts:92


queryLinks(uuid, query): Promise<LinkExpression[]>

Parameters
Name Type
uuid string
query LinkQuery
Returns

Promise<LinkExpression[]>

Defined in

perspectives/PerspectiveClient.ts:102


queryProlog

queryProlog(uuid, query): Promise<any>

Parameters
Name Type
uuid string
query string
Returns

Promise<any>

Defined in

perspectives/PerspectiveClient.ts:114


remove

remove(uuid): Promise<{ perspectiveRemove: boolean }>

Parameters
Name Type
uuid string
Returns

Promise<{ perspectiveRemove: boolean }>

Defined in

perspectives/PerspectiveClient.ts:149


removeLink(uuid, link): Promise<{ perspectiveRemoveLink: boolean }>

Parameters
Name Type
uuid string
link LinkExpressionInput
Returns

Promise<{ perspectiveRemoveLink: boolean }>

Defined in

perspectives/PerspectiveClient.ts:193


snapshotByUUID

snapshotByUUID(uuid): Promise<Perspective>

Parameters
Name Type
uuid string
Returns

Promise<Perspective>

Defined in

perspectives/PerspectiveClient.ts:81


subscribePerspectiveAdded

subscribePerspectiveAdded(): void

Returns

void

Defined in

perspectives/PerspectiveClient.ts:210


subscribePerspectiveRemoved

subscribePerspectiveRemoved(): void

Returns

void

Defined in

perspectives/PerspectiveClient.ts:248


subscribePerspectiveUpdated

subscribePerspectiveUpdated(): void

Returns

void

Defined in

perspectives/PerspectiveClient.ts:229


update

update(uuid, name): Promise<PerspectiveProxy>

Parameters
Name Type
uuid string
name string
Returns

Promise<PerspectiveProxy>

Defined in

perspectives/PerspectiveClient.ts:137


updateLink(uuid, oldLink, newLink): Promise<LinkExpression>

Parameters
Name Type
uuid string
oldLink LinkExpressionInput
newLink LinkInput
Returns

Promise<LinkExpression>

Defined in

perspectives/PerspectiveClient.ts:170

@perspect3vism/ad4m / Exports / perspectives/PerspectiveDiff / PerspectiveDiff

Class: PerspectiveDiff

perspectives/PerspectiveDiff.PerspectiveDiff

Table of contents

Constructors

Properties

Constructors

constructor

new PerspectiveDiff()

Properties

additions

additions: LinkExpression[]

Defined in

perspectives/PerspectiveDiff.ts:8


removals

removals: LinkExpression[]

Defined in

perspectives/PerspectiveDiff.ts:11

@perspect3vism/ad4m / Exports / perspectives/PerspectiveDiff / PerspectiveDiffExpression

Class: PerspectiveDiffExpression

perspectives/PerspectiveDiff.PerspectiveDiffExpression

Hierarchy

  • any

    PerspectiveDiffExpression

Table of contents

Constructors

Constructors

constructor

new PerspectiveDiffExpression()

Inherited from

ExpressionGeneric(PerspectiveDiff).constructor

@perspect3vism/ad4m / Exports / perspectives/PerspectiveHandle / PerspectiveHandle

Class: PerspectiveHandle

perspectives/PerspectiveHandle.PerspectiveHandle

Table of contents

Constructors

Properties

Constructors

constructor

new PerspectiveHandle(uuid?, name?)

Parameters
Name Type
uuid? string
name? string
Defined in

perspectives/PerspectiveHandle.ts:20

Properties

name

name: string

Defined in

perspectives/PerspectiveHandle.ts:12


neighbourhood

Optional neighbourhood: Neighbourhood

Defined in

perspectives/PerspectiveHandle.ts:18


sharedUrl

Optional sharedUrl: string

Defined in

perspectives/PerspectiveHandle.ts:15


uuid

uuid: string

Defined in

perspectives/PerspectiveHandle.ts:10

@perspect3vism/ad4m / Exports / perspectives/PerspectiveProxy / PerspectiveProxy

Class: PerspectiveProxy

perspectives/PerspectiveProxy.PerspectiveProxy

Perspective UI proxy object

Convenience object for UIs to interact with a perspective. It is created by some of the methods in the PerspectiveClient class and includes a reference to the PerspectiveClient object that created it.

Table of contents

Constructors

Properties

Accessors

Methods

Constructors

constructor

new PerspectiveProxy(handle, ad4m)

Parameters
Name Type
handle PerspectiveHandle
ad4m PerspectiveClient
Defined in

perspectives/PerspectiveProxy.ts:23

Properties

#client

Private #client: PerspectiveClient

Defined in

perspectives/PerspectiveProxy.ts:18


#executeAction

Private #executeAction: any

Defined in

perspectives/PerspectiveProxy.ts:21


#handle

Private #handle: PerspectiveHandle

Defined in

perspectives/PerspectiveProxy.ts:17


#perspectiveLinkAddedCallbacks

Private #perspectiveLinkAddedCallbacks: LinkCallback[]

Defined in

perspectives/PerspectiveProxy.ts:19


#perspectiveLinkRemovedCallbacks

Private #perspectiveLinkRemovedCallbacks: LinkCallback[]

Defined in

perspectives/PerspectiveProxy.ts:20

Accessors

name

get name(): string

Given name of the perspective

Returns

string

Defined in

perspectives/PerspectiveProxy.ts:70


neighbourhood

get neighbourhood(): void | Neighbourhood

If the perspective is shared as a Neighbourhood, this is the Neighbourhood Expression

Returns

void | Neighbourhood

Defined in

perspectives/PerspectiveProxy.ts:80


sharedUrl

get sharedUrl(): string | void

If the perspective is shared as a Neighbourhood, this is the Neighbourhood URL

Returns

string | void

Defined in

perspectives/PerspectiveProxy.ts:75


uuid

get uuid(): string

Unique ID of the perspective

Returns

string

Defined in

perspectives/PerspectiveProxy.ts:65

Methods

add

add(link): Promise<LinkExpression>

Adds a link to this perspective

Parameters
Name Type
link Link
Returns

Promise<LinkExpression>

Defined in

perspectives/PerspectiveProxy.ts:95


addListener

addListener(type, cb): Promise<void>

Adds a link listener

Parameters
Name Type Description
type PerspectiveListenerTypes Can be 'link-added' or 'link-removed'
cb LinkCallback Callback function that is called when a link is added to the perspective
Returns

Promise<void>

Defined in

perspectives/PerspectiveProxy.ts:113


availableFlows

availableFlows(exprAddr): Promise<string[]>

Returns all Social DNA flows that can be started from the given expression

Parameters
Name Type
exprAddr string
Returns

Promise<string[]>

Defined in

perspectives/PerspectiveProxy.ts:201


expressionsInFlowState

expressionsInFlowState(flowName, flowState): Promise<string[]>

Returns all expressions in the given state of given Social DNA flow

Parameters
Name Type
flowName string
flowState number
Returns

Promise<string[]>

Defined in

perspectives/PerspectiveProxy.ts:215


flowActions

flowActions(flowName, exprAddr): Promise<string[]>

Returns available action names, with regard to Social DNA flow and expression's flow state

Parameters
Name Type
flowName string
exprAddr string
Returns

Promise<string[]>

Defined in

perspectives/PerspectiveProxy.ts:227


flowState

flowState(flowName, exprAddr): Promise<number>

Returns the given expression's flow state with regard to given Social DNA flow

Parameters
Name Type
flowName string
exprAddr string
Returns

Promise<number>

Defined in

perspectives/PerspectiveProxy.ts:221


get

get(query): Promise<LinkExpression[]>

Returns all the links of this perspective that matches the LinkQuery

Parameters
Name Type
query LinkQuery
Returns

Promise<LinkExpression[]>

Defined in

perspectives/PerspectiveProxy.ts:85


getSingleTarget

getSingleTarget(query): Promise<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.

Works best together with

Member

setSingelTarget()

Parameters
Name Type
query LinkQuery
Returns

Promise<string | void>

Defined in

perspectives/PerspectiveProxy.ts:165


infer

infer(query): Promise<any>

Runs a Prolog query on the perspective's Prolog engine

Parameters
Name Type
query string
Returns

Promise<any>

Defined in

perspectives/PerspectiveProxy.ts:90


loadSnapshot

loadSnapshot(snapshot): Promise<void>

Take and load all the links from the given snapshot

Parameters
Name Type
snapshot Perspective
Returns

Promise<void>

Defined in

perspectives/PerspectiveProxy.ts:146


remove

remove(link): Promise<{ perspectiveRemoveLink: boolean }>

Removes a link from this perspective

Parameters
Name Type
link LinkExpression
Returns

Promise<{ perspectiveRemoveLink: boolean }>

Defined in

perspectives/PerspectiveProxy.ts:105


removeListener

removeListener(type, cb): Promise<void>

Removes a previously added link listener

Parameters
Name Type Description
type PerspectiveListenerTypes Can be 'link-added' or 'link-removed'
cb LinkCallback Callback function that is called when a link is added to the perspective
Returns

Promise<void>

Defined in

perspectives/PerspectiveProxy.ts:125


runFlowAction

runFlowAction(flowName, exprAddr, actionName): Promise<void>

Runs given Social DNA flow action

Parameters
Name Type
flowName string
exprAddr string
actionName string
Returns

Promise<void>

Defined in

perspectives/PerspectiveProxy.ts:233


sdnaFlows

sdnaFlows(): Promise<string[]>

Returns all the Social DNA flows defined in this perspective

Returns

Promise<string[]>

Defined in

perspectives/PerspectiveProxy.ts:195


setSingleTarget

setSingleTarget(link): Promise<void>

Convenience function to ensure there is only one link with given source and predicate This function will remove all links with the same source and predicate as the given link, and then add the given link. This ensures there is only one target for the given source and predicate.

Works best together with

Member

getSingleTarget()

Parameters
Name Type
link Link
Returns

Promise<void>

Defined in

perspectives/PerspectiveProxy.ts:181


snapshot

snapshot(): Promise<Perspective>

Create and return a snapshot of this perspective A snapshot is a rendered Perspectie object that contains all the links of the perspective.

Returns

Promise<Perspective>

Defined in

perspectives/PerspectiveProxy.ts:141


startFlow

startFlow(flowName, exprAddr): Promise<void>

Starts the Social DNA flow

Parameters
Name Type Description
flowName string on the expression
exprAddr string
Returns

Promise<void>

Defined in

perspectives/PerspectiveProxy.ts:207


update

update(oldLink, newLink): Promise<LinkExpression>

Changes a link in this perspective

Parameters
Name Type
oldLink LinkExpression
newLink Link
Returns

Promise<LinkExpression>

Defined in

perspectives/PerspectiveProxy.ts:100

@perspect3vism/ad4m / Exports / perspectives/PerspectiveResolver / default

Class: default

perspectives/PerspectiveResolver.default

Resolver classes are used here to define the GraphQL schema (through the type-graphql annotations) and are spawned in the client tests in Ad4mClient.test.ts. For the latter, they return test fixtures.

Table of contents

Constructors

Methods

Constructors

constructor

new default()

Methods

perspective

perspective(uuid): PerspectiveHandle

Parameters
Name Type
uuid string
Returns

PerspectiveHandle

Defined in

perspectives/PerspectiveResolver.ts:43


perspectiveAdd

perspectiveAdd(name, pubSub): PerspectiveHandle

Parameters
Name Type
name string
pubSub any
Returns

PerspectiveHandle

Defined in

perspectives/PerspectiveResolver.ts:68


perspectiveAddLink(uuid, link, pubSub): LinkExpression

Parameters
Name Type
uuid string
link LinkInput
pubSub any
Returns

LinkExpression

Defined in

perspectives/PerspectiveResolver.ts:89


perspectiveAdded

perspectiveAdded(): PerspectiveHandle

Returns

PerspectiveHandle

Defined in

perspectives/PerspectiveResolver.ts:120


perspectiveLinkAdded

perspectiveLinkAdded(uuid): LinkExpression

Parameters
Name Type
uuid string
Returns

LinkExpression

Defined in

perspectives/PerspectiveResolver.ts:136


perspectiveLinkRemoved

perspectiveLinkRemoved(uuid): LinkExpression

Parameters
Name Type
uuid string
Returns

LinkExpression

Defined in

perspectives/PerspectiveResolver.ts:141


perspectivePublishSnapshot

perspectivePublishSnapshot(uuid): String

Parameters
Name Type
uuid string
Returns

String

Defined in

perspectives/PerspectiveResolver.ts:53


perspectiveQueryLinks(uuid, query): LinkExpression[]

Parameters
Name Type
uuid string
query LinkQuery
Returns

LinkExpression[]

Defined in

perspectives/PerspectiveResolver.ts:58


perspectiveQueryProlog

perspectiveQueryProlog(uuid, query): string

Parameters
Name Type
uuid string
query String
Returns

string

Defined in

perspectives/PerspectiveResolver.ts:63


perspectiveRemove

perspectiveRemove(uuid, pubSub): boolean

Parameters
Name Type
uuid string
pubSub any
Returns

boolean

Defined in

perspectives/PerspectiveResolver.ts:82


perspectiveRemoveLink(uuid, link, pubSub): Boolean

Parameters
Name Type
uuid string
link LinkExpressionInput
pubSub any
Returns

Boolean

Defined in

perspectives/PerspectiveResolver.ts:114


perspectiveRemoved

perspectiveRemoved(): string

Returns

string

Defined in

perspectives/PerspectiveResolver.ts:131


perspectiveSnapshot

perspectiveSnapshot(uuid): Perspective

Parameters
Name Type
uuid string
Returns

Perspective

Defined in

perspectives/PerspectiveResolver.ts:48


perspectiveUpdate

perspectiveUpdate(uuid, name, pubSub): PerspectiveHandle

Parameters
Name Type
uuid string
name string
pubSub any
Returns

PerspectiveHandle

Defined in

perspectives/PerspectiveResolver.ts:75


perspectiveUpdateLink(uuid, oldlink, newlink, pubSub): LinkExpression

Parameters
Name Type
uuid string
oldlink LinkExpressionInput
newlink LinkInput
pubSub any
Returns

LinkExpression

Defined in

perspectives/PerspectiveResolver.ts:101


perspectiveUpdated

perspectiveUpdated(): PerspectiveHandle

Returns

PerspectiveHandle

Defined in

perspectives/PerspectiveResolver.ts:126


perspectives

perspectives(): PerspectiveHandle[]

Returns

PerspectiveHandle[]

Defined in

perspectives/PerspectiveResolver.ts:30

@perspect3vism/ad4m / Exports / runtime/RuntimeClient / RuntimeClient

Class: RuntimeClient

runtime/RuntimeClient.RuntimeClient

Table of contents

Constructors

Properties

Methods

Constructors

constructor

new RuntimeClient(client, subscribe?)

Parameters
Name Type Default value
client ApolloClient<any> undefined
subscribe boolean true
Defined in

runtime/RuntimeClient.ts:28

Properties

#apolloClient

Private #apolloClient: ApolloClient<any>

Defined in

runtime/RuntimeClient.ts:24


#exceptionOccurredCallbacks

Private #exceptionOccurredCallbacks: ExceptionCallback[]

Defined in

runtime/RuntimeClient.ts:26


#messageReceivedCallbacks

Private #messageReceivedCallbacks: MessageCallback[]

Defined in

runtime/RuntimeClient.ts:25

Methods

addExceptionCallback

addExceptionCallback(cb): void

Parameters
Name Type
cb ExceptionCallback
Returns

void

Defined in

runtime/RuntimeClient.ts:258


addFriends

addFriends(dids): Promise<string[]>

Parameters
Name Type
dids string[]
Returns

Promise<string[]>

Defined in

runtime/RuntimeClient.ts:126


addKnownLinkLanguageTemplates

addKnownLinkLanguageTemplates(addresses): Promise<string[]>

Parameters
Name Type
addresses string[]
Returns

Promise<string[]>

Defined in

runtime/RuntimeClient.ts:97


addMessageCallback

addMessageCallback(cb): void

Parameters
Name Type
cb MessageCallback
Returns

void

Defined in

runtime/RuntimeClient.ts:239


addTrustedAgents

addTrustedAgents(agents): Promise<string[]>

Parameters
Name Type
agents string[]
Returns

Promise<string[]>

Defined in

runtime/RuntimeClient.ts:68


deleteTrustedAgents

deleteTrustedAgents(agents): Promise<string[]>

Parameters
Name Type
agents string[]
Returns

Promise<string[]>

Defined in

runtime/RuntimeClient.ts:78


friendSendMessage

friendSendMessage(did, message): Promise<boolean>

Parameters
Name Type
did string
message Perspective
Returns

Promise<boolean>

Defined in

runtime/RuntimeClient.ts:204


friendStatus

friendStatus(did): Promise<PerspectiveExpression>

Parameters
Name Type
did string
Returns

Promise<PerspectiveExpression>

Defined in

runtime/RuntimeClient.ts:194


friends

friends(): Promise<string[]>

Returns

Promise<string[]>

Defined in

runtime/RuntimeClient.ts:146


getTrustedAgents

getTrustedAgents(): Promise<string[]>

Returns

Promise<string[]>

Defined in

runtime/RuntimeClient.ts:88


hcAddAgentInfos

hcAddAgentInfos(agentInfos): Promise<void>

Parameters
Name Type
agentInfos String
Returns

Promise<void>

Defined in

runtime/RuntimeClient.ts:164


hcAgentInfos

hcAgentInfos(): Promise<String>

Returns

Promise<String>

Defined in

runtime/RuntimeClient.ts:155


info

info(): Promise<RuntimeInfo>

Returns

Promise<RuntimeInfo>

Defined in

runtime/RuntimeClient.ts:39


knownLinkLanguageTemplates

knownLinkLanguageTemplates(): Promise<string[]>

Returns

Promise<string[]>

Defined in

runtime/RuntimeClient.ts:117


messageInbox

messageInbox(filter?): Promise<PerspectiveExpression[]>

Parameters
Name Type
filter? string
Returns

Promise<PerspectiveExpression[]>

Defined in

runtime/RuntimeClient.ts:214


messageOutbox

messageOutbox(filter?): Promise<SentMessage[]>

Parameters
Name Type
filter? string
Returns

Promise<SentMessage[]>

Defined in

runtime/RuntimeClient.ts:224


openLink(url): Promise<Boolean>

Parameters
Name Type
url string
Returns

Promise<Boolean>

Defined in

runtime/RuntimeClient.ts:58


quit

quit(): Promise<Boolean>

Returns

Promise<Boolean>

Defined in

runtime/RuntimeClient.ts:50


removeFriends

removeFriends(dids): Promise<string[]>

Parameters
Name Type
dids string[]
Returns

Promise<string[]>

Defined in

runtime/RuntimeClient.ts:136


removeKnownLinkLanguageTemplates

removeKnownLinkLanguageTemplates(addresses): Promise<string[]>

Parameters
Name Type
addresses string[]
Returns

Promise<string[]>

Defined in

runtime/RuntimeClient.ts:107


setStatus

setStatus(perspective): Promise<boolean>

Parameters
Name Type
perspective Perspective
Returns

Promise<boolean>

Defined in

runtime/RuntimeClient.ts:184


subscribeExceptionOccurred

subscribeExceptionOccurred(): void

Returns

void

Defined in

runtime/RuntimeClient.ts:262


subscribeMessageReceived

subscribeMessageReceived(): void

Returns

void

Defined in

runtime/RuntimeClient.ts:243


verifyStringSignedByDid

verifyStringSignedByDid(did, didSigningKeyId, data, signedData): Promise<boolean>

Parameters
Name Type
did string
didSigningKeyId string
data string
signedData string
Returns

Promise<boolean>

Defined in

runtime/RuntimeClient.ts:174

@perspect3vism/ad4m / Exports / runtime/RuntimeResolver / ExceptionInfo

Class: ExceptionInfo

runtime/RuntimeResolver.ExceptionInfo

Table of contents

Constructors

Properties

Constructors

constructor

new ExceptionInfo()

Properties

addon

Optional addon: string

Defined in

runtime/RuntimeResolver.ts:51


message

message: string

Defined in

runtime/RuntimeResolver.ts:47


title

title: string

Defined in

runtime/RuntimeResolver.ts:45


type

type: ExceptionType

Defined in

runtime/RuntimeResolver.ts:49

@perspect3vism/ad4m / Exports / runtime/RuntimeResolver / RuntimeInfo

Class: RuntimeInfo

runtime/RuntimeResolver.RuntimeInfo

Table of contents

Constructors

Properties

Constructors

constructor

new RuntimeInfo()

Properties

ad4mExecutorVersion

ad4mExecutorVersion: string

Defined in

runtime/RuntimeResolver.ts:39

@perspect3vism/ad4m / Exports / runtime/RuntimeResolver / SentMessage

Class: SentMessage

runtime/RuntimeResolver.SentMessage

Table of contents

Constructors

Properties

Constructors

constructor

new SentMessage()

Properties

message

message: PerspectiveExpression

Defined in

runtime/RuntimeResolver.ts:33


recipient

recipient: string

Defined in

runtime/RuntimeResolver.ts:31

@perspect3vism/ad4m / Exports / runtime/RuntimeResolver / default

Class: default

runtime/RuntimeResolver.default

Resolver classes are used here to define the GraphQL schema (through the type-graphql annotations) and are spawned in the client tests in Ad4mClient.test.ts. For the latter, they return test fixtures.

Table of contents

Constructors

Methods

Constructors

constructor

new default()

Methods

addTrustedAgents

addTrustedAgents(agents): string[]

Parameters
Name Type
agents string[]
Returns

string[]

Defined in

runtime/RuntimeResolver.ts:79


deleteTrustedAgents

deleteTrustedAgents(agents): string[]

Parameters
Name Type
agents string[]
Returns

string[]

Defined in

runtime/RuntimeResolver.ts:84


exceptionOccurred

exceptionOccurred(): ExceptionInfo

Returns

ExceptionInfo

Defined in

runtime/RuntimeResolver.ts:180


getTrustedAgents

getTrustedAgents(): string[]

Returns

string[]

Defined in

runtime/RuntimeResolver.ts:89


runtimeAddFriends

runtimeAddFriends(dids): string[]

Parameters
Name Type
dids string[]
Returns

string[]

Defined in

runtime/RuntimeResolver.ts:114


runtimeAddKnownLinkLanguageTemplates

runtimeAddKnownLinkLanguageTemplates(addresses): string[]

Parameters
Name Type
addresses string[]
Returns

string[]

Defined in

runtime/RuntimeResolver.ts:99


runtimeFriendSendMessage

runtimeFriendSendMessage(did, message): boolean

Parameters
Name Type
did string
message PerspectiveInput
Returns

boolean

Defined in

runtime/RuntimeResolver.ts:153


runtimeFriendStatus

runtimeFriendStatus(did): PerspectiveExpression

Parameters
Name Type
did string
Returns

PerspectiveExpression

Defined in

runtime/RuntimeResolver.ts:148


runtimeFriends

runtimeFriends(): string[]

Returns

string[]

Defined in

runtime/RuntimeResolver.ts:109


runtimeHcAddAgentInfos

runtimeHcAddAgentInfos(agentInfos): boolean

Parameters
Name Type
agentInfos any
Returns

boolean

Defined in

runtime/RuntimeResolver.ts:129


runtimeHcAgentInfos

runtimeHcAgentInfos(): String

Returns

String

Defined in

runtime/RuntimeResolver.ts:124


runtimeInfo

runtimeInfo(): RuntimeInfo

Returns

RuntimeInfo

Defined in

runtime/RuntimeResolver.ts:72


runtimeKnownLinkLanguageTemplates

runtimeKnownLinkLanguageTemplates(): string[]

Returns

string[]

Defined in

runtime/RuntimeResolver.ts:94


runtimeMessageInbox

runtimeMessageInbox(filter?): PerspectiveExpression[]

Parameters
Name Type
filter? string
Returns

PerspectiveExpression[]

Defined in

runtime/RuntimeResolver.ts:161


runtimeMessageOutbox

runtimeMessageOutbox(filter?): SentMessage[]

Parameters
Name Type
filter? string
Returns

SentMessage[]

Defined in

runtime/RuntimeResolver.ts:166


runtimeMessageReceived

runtimeMessageReceived(): PerspectiveExpression

Returns

PerspectiveExpression

Defined in

runtime/RuntimeResolver.ts:175


runtimeOpenLink(url): Boolean

Parameters
Name Type
url string
Returns

Boolean

Defined in

runtime/RuntimeResolver.ts:67


runtimeQuit

runtimeQuit(): Boolean

Returns

Boolean

Defined in

runtime/RuntimeResolver.ts:62


runtimeRemoveFriends

runtimeRemoveFriends(dids): string[]

Parameters
Name Type
dids string[]
Returns

string[]

Defined in

runtime/RuntimeResolver.ts:119


runtimeRemoveKnownLinkLanguageTemplates

runtimeRemoveKnownLinkLanguageTemplates(addresses): string[]

Parameters
Name Type
addresses string[]
Returns

string[]

Defined in

runtime/RuntimeResolver.ts:104


runtimeSetStatus

runtimeSetStatus(status): boolean

Parameters
Name Type
status Perspective
Returns

boolean

Defined in

runtime/RuntimeResolver.ts:143


runtimeVerifyStringSignedByDid

runtimeVerifyStringSignedByDid(did, didSigningKeyId, data, signedData): boolean

Parameters
Name Type
did string
didSigningKeyId string
data string
signedData string
Returns

boolean

Defined in

runtime/RuntimeResolver.ts:134

Enums

@perspect3vism/ad4m / Exports / Exception / ExceptionType

Enumeration: ExceptionType

Exception.ExceptionType

Table of contents

Enumeration Members

Enumeration Members

AgentIsUntrusted

AgentIsUntrusted = 2

Defined in

Exception.ts:4


CapabilityRequested

CapabilityRequested = 3

Defined in

Exception.ts:5


ExpressionIsNotVerified

ExpressionIsNotVerified = 1

Defined in

Exception.ts:3


LanguageIsNotLoaded

LanguageIsNotLoaded = 0

Defined in

Exception.ts:2

Interfaces

@perspect3vism/ad4m / Exports / agent/AgentClient / InitializeArgs

Interface: InitializeArgs

agent/AgentClient.InitializeArgs

Table of contents

Properties

Properties

did

did: string

Defined in

agent/AgentClient.ts:43


didDocument

didDocument: string

Defined in

agent/AgentClient.ts:44


keystore

keystore: string

Defined in

agent/AgentClient.ts:45


passphrase

passphrase: string

Defined in

agent/AgentClient.ts:46

@perspect3vism/ad4m / Exports / language/Language / DirectMessageAdapter

Interface: DirectMessageAdapter

language/Language.DirectMessageAdapter

Table of contents

Methods

Methods

addMessageCallback

addMessageCallback(callback): any

Parameters
Name Type
callback MessageCallback
Returns

any

Defined in

language/Language.ts:186


inbox

inbox(filter?): Promise<PerspectiveExpression[]>

Parameters
Name Type
filter? string
Returns

Promise<PerspectiveExpression[]>

Defined in

language/Language.ts:185


recipient

recipient(): string

Returns

string

Defined in

language/Language.ts:178


sendInbox

sendInbox(message): Promise<void | PerspectiveExpression>

Parameters
Name Type
message Perspective
Returns

Promise<void | PerspectiveExpression>

Defined in

language/Language.ts:182


sendP2P

sendP2P(message): Promise<void | PerspectiveExpression>

Parameters
Name Type
message Perspective
Returns

Promise<void | PerspectiveExpression>

Defined in

language/Language.ts:181


setStatus

setStatus(status): any

Parameters
Name Type
status PerspectiveExpression
Returns

any

Defined in

language/Language.ts:184


status

status(): Promise<void | PerspectiveExpression>

Returns

Promise<void | PerspectiveExpression>

Defined in

language/Language.ts:180

@perspect3vism/ad4m / Exports / language/Language / ExpressionAdapter

Interface: ExpressionAdapter

language/Language.ExpressionAdapter

Interface for the most common Expression Languages

Table of contents

Properties

Methods

Properties

putAdapter

putAdapter: PublicSharing | ReadOnlyLanguage

Strategy for putting an expression with needs to be different for those two cases:

  1. PublicSharing means that this language supports the creation and sharing of Expressions, which is the common use-case
  2. ReadOnlyLanguage means that the Language implements a pre-defined set of expressions (which can be infinite or finite). For example the url-iframe Language which directly maps URLs to addresses - meaning every well formed URL is an address in this Language. Or a potential Language implementing the verbs/predicates of a spec like FOAF.
Defined in

language/Language.ts:93

Methods

get

get(address): Promise<Expression>

Returns an Expression by address, or null if there is no Expression with that given address

Parameters
Name Type
address string
Returns

Promise<Expression>

Defined in

language/Language.ts:80

@perspect3vism/ad4m / Exports / language/Language / ExpressionUI

Interface: ExpressionUI

language/Language.ExpressionUI

UI factories returning web components

Table of contents

Methods

Methods

constructorIcon

constructorIcon(): string

Returns JS code of a web component used to create new expressions

Returns

string

Defined in

language/Language.ts:69


icon

icon(): string

Returns JS code of a web component that renders the given expression

Returns

string

Defined in

language/Language.ts:67

@perspect3vism/ad4m / Exports / language/Language / GetAllAdapter

Interface: GetAllAdapter

language/Language.GetAllAdapter

Table of contents

Methods

Methods

getAll

getAll(filter, count, page): Promise<Expression[]>

Parameters
Name Type
filter any
count number
page number
Returns

Promise<Expression[]>

Defined in

language/Language.ts:135

@perspect3vism/ad4m / Exports / language/Language / GetByAuthorAdapter

Interface: GetByAuthorAdapter

language/Language.GetByAuthorAdapter

Table of contents

Methods

Methods

getByAuthor

getByAuthor(author, count, page): Promise<Expression[]>

Parameters
Name Type
author string
count number
page number
Returns

Promise<Expression[]>

Defined in

language/Language.ts:126

@perspect3vism/ad4m / Exports / language/Language / Interaction

Interface: Interaction

language/Language.Interaction

Table of contents

Properties

Methods

Properties

label

Readonly label: string

Defined in

language/Language.ts:210


name

Readonly name: string

Defined in

language/Language.ts:211


parameters

Readonly parameters: InteractionParameter[]

Defined in

language/Language.ts:212

Methods

execute

execute(parameters): Promise<string>

Parameters
Name Type
parameters object
Returns

Promise<string>

Defined in

language/Language.ts:213

@perspect3vism/ad4m / Exports / language/Language / Language

Interface: Language

language/Language.Language

Interface of AD4M Languages

Any JavaScript module that implements a create() function that returns an object that implements this interface is a valid AD4M language. So the AD4M-internal representation of a language is an object that implements this interface.

Since there are a few different kinds of languages, this interface is split into optional sub-interfaces. The only required property is the name of the language.

The most usual kind of language is the "Expression Language", which is a language that can be used to create and share Expressions. For that, implement the expressionsAdapter and expressionUI interface.

The second most common kind of language is the "Link Language", which is a language that builds the core of AD4M Neighbourhoods. For that, implement the linksAdapter interface.

Table of contents

Properties

Methods

Properties

directMessageAdapter

Optional Readonly directMessageAdapter: DirectMessageAdapter

Optional adapter for direct messaging between agents

Defined in

language/Language.ts:55


expressionAdapter

Optional Readonly expressionAdapter: ExpressionAdapter

ExpressionAdapter implements means of getting an Expression by address and putting an expression

Defined in

language/Language.ts:38


expressionUI

Optional Readonly expressionUI: ExpressionUI

Interface for getting UI/web components for rendering Expressions of this Language

Defined in

language/Language.ts:41


getAllAdapter

Optional Readonly getAllAdapter: GetAllAdapter

Optional adapter for getting all Expressions

Defined in

language/Language.ts:52


getByAuthorAdapter

Optional Readonly getByAuthorAdapter: GetByAuthorAdapter

Optional adapter for getting Expressions by author

Defined in

language/Language.ts:50


languageAdapter

Optional Readonly languageAdapter: LanguageAdapter

Implementation of a Language that defines and stores Languages

Defined in

language/Language.ts:47


linksAdapter

Optional Readonly linksAdapter: LinkSyncAdapter

Interface of LinkLanguages for the core implementation of Neighbourhoods

Defined in

language/Language.ts:44


name

Readonly name: string

Defined in

language/Language.ts:26


settingsUI

Optional Readonly settingsUI: SettingsUI

Interface for providing UI components for the settings of this Language

Defined in

language/Language.ts:58

Methods

interactions

interactions(expression): Interaction[]

All available interactions this agent could execute on given expression

Parameters
Name Type
expression string
Returns

Interaction[]

Defined in

language/Language.ts:61


isImmutableExpression

Optional isImmutableExpression(expression): boolean

Flagging expressions as immutable to enable expression caching in the ad4m-executor

Parameters
Name Type
expression string
Returns

boolean

Defined in

language/Language.ts:31

@perspect3vism/ad4m / Exports / language/Language / LanguageAdapter

Interface: LanguageAdapter

language/Language.LanguageAdapter

Table of contents

Methods

Methods

getLanguageSource

getLanguageSource(address): Promise<string>

Parameters
Name Type
address string
Returns

Promise<string>

Defined in

language/Language.ts:119

@perspect3vism/ad4m / Exports / language/Language / LinkSyncAdapter

Interface: LinkSyncAdapter

language/Language.LinkSyncAdapter

Interface for "Link Languages" that facilitate the synchronization between agents' local Perspectives inside a Neighbourhood. The assumption is that every version of the shared Perspective is labeled with a unique revision string. Changes are committed and retrieved through diffs. Think of a LinkSyncAdapter as a git branch to which agents commit their changes to and pull diffs from their current revision to the latest one.

Table of contents

Methods

Methods

addCallback

addCallback(callback): any

Get push notification when a diff got published

Parameters
Name Type
callback PerspectiveDiffObserver
Returns

any

Defined in

language/Language.ts:172


commit

commit(diff): Promise<string>

Publish changes

Parameters
Name Type
diff PerspectiveDiff
Returns

Promise<string>

Defined in

language/Language.ts:169


currentRevision

currentRevision(): Promise<string>

What revision are we on now -> what changes are included in output of render()

Returns

Promise<string>

Defined in

language/Language.ts:160


latestRevision

latestRevision(): Promise<string>

Call this to check if there are new changes (compare returned revision with last one that was pulled)

Returns

Promise<string>

Defined in

language/Language.ts:157


others

others(): Promise<string[]>

Returns

Promise<string[]>

Defined in

language/Language.ts:152


public

public(): boolean

Returns

boolean

Defined in

language/Language.ts:151


pull

pull(): Promise<PerspectiveDiff>

Check for and get new changes

Returns

Promise<PerspectiveDiff>

Defined in

language/Language.ts:163


render

render(): Promise<Perspective>

Returns the full, rendered Perspective at currentRevision

Returns

Promise<Perspective>

Defined in

language/Language.ts:166


writable

writable(): boolean

Returns

boolean

Defined in

language/Language.ts:150

@perspect3vism/ad4m / Exports / language/Language / PublicSharing

Interface: PublicSharing

language/Language.PublicSharing

Implement this interface if your Language supports creation of sharing of Expressions. See ExpressionAdapter

Table of contents

Methods

Methods

createPublic

createPublic(content): Promise<string>

Create an Expression and shares it. Return the Expression's address.

Parameters
Name Type Description
content object is the object created by the constructorIcon component
Returns

Promise<string>

Defined in

language/Language.ts:105

@perspect3vism/ad4m / Exports / language/Language / ReadOnlyLanguage

Interface: ReadOnlyLanguage

language/Language.ReadOnlyLanguage

Implement this interface if your Language is defined over a static set of pre-defined Expressions.

Table of contents

Methods

Methods

addressOf

addressOf(content): Promise<string>

This just calculates the address of an object

Parameters
Name Type Description
content object is the object created by the constructorIcon component
Returns

Promise<string>

Defined in

language/Language.ts:115

@perspect3vism/ad4m / Exports / language/Language / SettingsUI

Interface: SettingsUI

language/Language.SettingsUI

Table of contents

Methods

Methods

settingsIcon

settingsIcon(): string

Returns

string

Defined in

language/Language.ts:73

@perspect3vism/ad4m / Exports / language/Language / TelepresenceAdapter

Interface: TelepresenceAdapter

language/Language.TelepresenceAdapter

Table of contents

Methods

Methods

getOnlineAgents

getOnlineAgents(): [OnlineAgent]

Returns

[OnlineAgent]

Defined in

language/Language.ts:247


registerRpcCallback

registerRpcCallback(callback): any

Parameters
Name Type
callback TelepresenceRpcCall
Returns

any

Defined in

language/Language.ts:250


rpcCall

rpcCall(remoteAgentDid, call): object

Parameters
Name Type
remoteAgentDid string
call TelepresenceRpcCall
Returns

object

Defined in

language/Language.ts:249


setOnlineStatus

setOnlineStatus(status): any

Parameters
Name Type
status string
Returns

any

Defined in

language/Language.ts:246

@perspect3vism/ad4m / Exports

@perspect3vism/ad4m

Table of contents

Modules

Modules

@perspect3vism/ad4m / Exports / Ad4mClient

Module: Ad4mClient

Table of contents

Classes

@perspect3vism/ad4m / Exports / Address

Module: Address

Table of contents

Type Aliases

Type Aliases

Address

Ƭ Address: string

Defined in

Address.ts:1

@perspect3vism/ad4m / Exports / DID

Module: DID

Table of contents

Type Aliases

Type Aliases

DID

Ƭ DID: string

Defined in

DID.ts:1

@perspect3vism/ad4m / Exports / Exception

Module: Exception

Table of contents

Enumerations

@perspect3vism/ad4m / Exports / PubSub

Module: PubSub

Table of contents

Variables

Variables

AGENT_STATUS_CHANGED

Const AGENT_STATUS_CHANGED: "agent-status-changed-topic"

Defined in

PubSub.ts:2


AGENT_UPDATED

Const AGENT_UPDATED: "agent-updated-topic"

Defined in

PubSub.ts:1


DIRECT_MESSAGE_RECEIVED

Const DIRECT_MESSAGE_RECEIVED: "direct-message-received-topic"

Defined in

PubSub.ts:3


EXCEPTION_OCCURRED_TOPIC

Const EXCEPTION_OCCURRED_TOPIC: "exception-occurred-topic"

Defined in

PubSub.ts:10


LINK_ADDED_TOPIC

Const LINK_ADDED_TOPIC: "link-added-topic"

Defined in

PubSub.ts:7


LINK_REMOVED_TOPIC

Const LINK_REMOVED_TOPIC: "link-removed-topic"

Defined in

PubSub.ts:8


PERSPECTIVE_ADDED_TOPIC

Const PERSPECTIVE_ADDED_TOPIC: "perspective-added-topic"

Defined in

PubSub.ts:4


PERSPECTIVE_REMOVED_TOPIC

Const PERSPECTIVE_REMOVED_TOPIC: "perspective-removed-topic"

Defined in

PubSub.ts:6


PERSPECTIVE_UPDATED_TOPIC

Const PERSPECTIVE_UPDATED_TOPIC: "perspective-updated-topic"

Defined in

PubSub.ts:5


SIGNAL

Const SIGNAL: "signal"

Defined in

PubSub.ts:9

@perspect3vism/ad4m / Exports / agent/Agent

Module: agent/Agent

Table of contents

Classes

@perspect3vism/ad4m / Exports / agent/AgentClient

Module: agent/AgentClient

Table of contents

Classes

Interfaces

Type Aliases

Type Aliases

AgentStatusChangedCallback

Ƭ AgentStatusChangedCallback: (agent: Agent) => null

Type declaration

▸ (agent): null

Parameters
Name Type
agent Agent
Returns

null

Defined in

agent/AgentClient.ts:50


AgentUpdatedCallback

Ƭ AgentUpdatedCallback: (agent: Agent) => null

Type declaration

▸ (agent): null

Parameters
Name Type
agent Agent
Returns

null

Defined in

agent/AgentClient.ts:49

@perspect3vism/ad4m / Exports / agent/AgentResolver

Module: agent/AgentResolver

Table of contents

Classes

@perspect3vism/ad4m / Exports / agent/AgentStatus

Module: agent/AgentStatus

Table of contents

Classes

@perspect3vism/ad4m / Exports / buildSchema

Module: buildSchema

@perspect3vism/ad4m / Exports / expression/Expression

Module: expression/Expression

Table of contents

Classes

Functions

Functions

ExpressionGeneric

ExpressionGeneric<DataType>(DataTypeClass): any

Type parameters
Name
DataType
Parameters
Name Type
DataTypeClass ClassType<DataType>
Returns

any

Defined in

expression/Expression.ts:42


ExpressionGenericInput

ExpressionGenericInput<DataType>(DataTypeClass): any

Type parameters
Name
DataType
Parameters
Name Type
DataTypeClass ClassType<DataType>
Returns

any

Defined in

expression/Expression.ts:67


isExpression

isExpression(e): boolean

Parameters
Name Type
e any
Returns

boolean

Defined in

expression/Expression.ts:97

@perspect3vism/ad4m / Exports / expression/ExpressionClient

Module: expression/ExpressionClient

Table of contents

Classes

@perspect3vism/ad4m / Exports / expression/ExpressionResolver

Module: expression/ExpressionResolver

Table of contents

Classes

@perspect3vism/ad4m / Exports / language/Icon

Module: language/Icon

Table of contents

Classes

@perspect3vism/ad4m / Exports / language/Language

Module: language/Language

Table of contents

Classes

Interfaces

Type Aliases

Type Aliases

MessageCallback

Ƭ MessageCallback: (message: PerspectiveExpression) => void

Type declaration

▸ (message): void

Parameters
Name Type
message PerspectiveExpression
Returns

void

Defined in

language/Language.ts:175


PerspectiveDiffObserver

Ƭ PerspectiveDiffObserver: (diff: PerspectiveDiff) => void

Type declaration

▸ (diff): void

Parameters
Name Type
diff PerspectiveDiff
Returns

void

Defined in

language/Language.ts:138


StatusCallback

Ƭ StatusCallback: (caller: DID) => Perspective

Type declaration

▸ (caller): Perspective

Parameters
Name Type
caller DID
Returns

Perspective

Defined in

language/Language.ts:176


TelepresenceRpcCallback

Ƭ TelepresenceRpcCallback: (call: TelepresenceRpcCall) => object

Type declaration

▸ (call): object

Parameters
Name Type
call TelepresenceRpcCall
Returns

object

Defined in

language/Language.ts:243

@perspect3vism/ad4m / Exports / language/LanguageClient

Module: language/LanguageClient

Table of contents

Classes

@perspect3vism/ad4m / Exports / language/LanguageHandle

Module: language/LanguageHandle

Table of contents

Classes

@perspect3vism/ad4m / Exports / language/LanguageMeta

Module: language/LanguageMeta

Table of contents

Classes

@perspect3vism/ad4m / Exports / language/LanguageRef

Module: language/LanguageRef

Table of contents

Classes

@perspect3vism/ad4m / Exports / language/LanguageResolver

Module: language/LanguageResolver

Table of contents

Classes

@perspect3vism/ad4m / Exports / links/Links

Table of contents

Classes

Functions

Functions

isLink(l): boolean

Parameters
Name Type
l any
Returns

boolean

Defined in

links/Links.ts:69


linkEqual

linkEqual(l1, l2): boolean

Parameters
Name Type
l1 LinkExpression
l2 LinkExpression
Returns

boolean

Defined in

links/Links.ts:61

@perspect3vism/ad4m / Exports / neighbourhood/Neighbourhood

Module: neighbourhood/Neighbourhood

Table of contents

Classes

@perspect3vism/ad4m / Exports / neighbourhood/NeighbourhoodClient

Module: neighbourhood/NeighbourhoodClient

Table of contents

Classes

@perspect3vism/ad4m / Exports / neighbourhood/NeighbourhoodResolver

Module: neighbourhood/NeighbourhoodResolver

Table of contents

Classes

@perspect3vism/ad4m / Exports / perspectives/LinkQuery

Module: perspectives/LinkQuery

Table of contents

Classes

@perspect3vism/ad4m / Exports / perspectives/Perspective

Module: perspectives/Perspective

Table of contents

Classes

@perspect3vism/ad4m / Exports / perspectives/PerspectiveClient

Module: perspectives/PerspectiveClient

Table of contents

Classes

Type Aliases

Type Aliases

LinkCallback

Ƭ LinkCallback: (link: LinkExpression) => null

Type declaration

▸ (link): null

Parameters
Name Type
link LinkExpression
Returns

null

Defined in

perspectives/PerspectiveClient.ts:36


PerspectiveHandleCallback

Ƭ PerspectiveHandleCallback: (perspective: PerspectiveHandle) => null

Type declaration

▸ (perspective): null

Parameters
Name Type
perspective PerspectiveHandle
Returns

null

Defined in

perspectives/PerspectiveClient.ts:34


UuidCallback

Ƭ UuidCallback: (uuid: string) => null

Type declaration

▸ (uuid): null

Parameters
Name Type
uuid string
Returns

null

Defined in

perspectives/PerspectiveClient.ts:35

@perspect3vism/ad4m / Exports / perspectives/PerspectiveDiff

Module: perspectives/PerspectiveDiff

Table of contents

Classes

@perspect3vism/ad4m / Exports / perspectives/PerspectiveHandle

Module: perspectives/PerspectiveHandle

Table of contents

Classes

@perspect3vism/ad4m / Exports / perspectives/PerspectiveProxy

Module: perspectives/PerspectiveProxy

Table of contents

Classes

@perspect3vism/ad4m / Exports / perspectives/PerspectiveResolver

Module: perspectives/PerspectiveResolver

Table of contents

Classes

@perspect3vism/ad4m / Exports / runtime/RuntimeClient

Module: runtime/RuntimeClient

Table of contents

Classes

Type Aliases

Type Aliases

ExceptionCallback

Ƭ ExceptionCallback: (info: ExceptionInfo) => null

Type declaration

▸ (info): null

Parameters
Name Type
info ExceptionInfo
Returns

null

Defined in

runtime/RuntimeClient.ts:21


MessageCallback

Ƭ MessageCallback: (message: PerspectiveExpression) => null

Type declaration

▸ (message): null

Parameters
Name Type
message PerspectiveExpression
Returns

null

Defined in

runtime/RuntimeClient.ts:20

@perspect3vism/ad4m / Exports / runtime/RuntimeResolver

Module: runtime/RuntimeResolver

Table of contents

Classes

@perspect3vism/ad4m / Exports / unwrapApolloResult

Module: unwrapApolloResult

Table of contents

Functions

Functions

default

default(result): any

Parameters
Name Type
result ApolloQueryResult<any> \ FetchResult<any, Record<string, any>, Record<string, any>>
Returns

any

Defined in

unwrapApolloResult.ts:3