Class

GraphEnvironment

(abstract) GraphEnvironment(options)

The abstract GraphEnvironment class defines the interface to graphs and their elements.

Constructor

abstract new GraphEnvironment(options)

Parameters:
Name Type Description
options Object
context string | URL | Context
module Object
Properties:
Name Type Description
context

A dictionary which maps bi-directionally between property names and IRI

module

A dictionary which maps class names to classes.

View Source graph-environment.js, line 18

Members

baseIRI

Return the base IRI from this environment's context.

View Source graph-environment.js, line 34

Methods

abstract computeGraphObject()

Given a Graph, extract the first subject term, extract its description and instantiate it.

View Source graph-environment.js, line 201

abstract computeGraphObjects(graph, identifiers)

Given a Graph and a list of identifiers, extract their descriptions and instantiate them.

Parameters:
Name Type Description
graph Graph
identifiers Array

The sought identifiers

View Source graph-environment.js, line 210

abstract computeObjectGraph(object)

Parameters:
Name Type Description
object Object

View Source graph-environment.js, line 217

abstract createAnonymousNode()

View Source graph-environment.js, line 247

abstract createGraph()

View Source graph-environment.js, line 235

abstract createLiteral()

View Source graph-environment.js, line 241

abstract createNamedNode()

View Source graph-environment.js, line 253

createObject(className, identifier, stateopt)

Given a class name, the instance identifier and an initial state, instantiate the object, assign the initial state, create its proxy and return that.

Parameters:
Name Type Attributes Description
className string
identifier string
state Object <optional>

View Source graph-environment.js, line 264

abstract createStatement(subject, predicate, object, graphopt)

Given subject, predicate, object and graph terns, construct and return a statement

Parameters:
Name Type Attributes Description
subject Node
predicate NamedNode
object Term
graph Node <optional>

View Source graph-environment.js, line 229

fieldDefinition(identifier) → {PropertyDefinition}

Given a property identifier, return the definition from the environment's context.

Parameters:
Name Type Description
identifier string | URL

An identifier present in the context

To Do:
  • The definition should be a standard JavaScript property descriptor
  • Change name to getPropertyDescriptor

View Source graph-environment.js, line 103

PropertyDefinition

fieldType()

Given a property identifier, return the type from its definition

To Do:
  • Change name to getPropertyType

View Source graph-environment.js, line 132

findIdentifierName()

Given an IRI, return the property name associated with it in the environment. If none is present in the context, add a definition which specifies the IRI leaf as the name. The first probe searches the context for a property definition which specifies the iri as its @id. That result is then cached for future references.

View Source graph-environment.js, line 144

findNameIdentifier(name)

Given a property name, return the IRI associated with it in the environment.

Parameters:
Name Type Description
name string

View Source graph-environment.js, line 181

graphResourceID(graph)

Return the identifier for the root node of the given Graph.

Parameters:
Name Type Description
graph Graph

View Source graph-environment.js, line 84

graphResourceIDs(graph)

Return the identifers for all nodes in the given Graph.

Parameters:
Name Type Description
graph Graph

View Source graph-environment.js, line 92

resolveContext(context)

Accept a context designator, retrieve if necessary, expand all definitions, and bind the environment's context property to it.

Parameters:
Name Type Description
context string | URL | Context

The context to resolve.

View Source graph-environment.js, line 43