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. |
Members
baseIRI
Return the base IRI from this environment's context.
Methods
abstract computeGraphObject()
Given a Graph, extract the first subject term, extract its description and instantiate it.
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 |
abstract computeObjectGraph(object)
Parameters:
Name | Type | Description |
---|---|---|
object |
Object |
abstract createAnonymousNode()
abstract createGraph()
abstract createLiteral()
abstract createNamedNode()
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> |
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> |
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
fieldType()
Given a property identifier, return the type from its definition
- To Do:
-
- Change name to getPropertyType
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.
findNameIdentifier(name)
Given a property name, return the IRI associated with it in the environment.
Parameters:
Name | Type | Description |
---|---|---|
name |
string |
graphResourceID(graph)
Return the identifier for the root node of the given Graph.
Parameters:
Name | Type | Description |
---|---|---|
graph |
Graph |
graphResourceIDs(graph)
Return the identifers for all nodes in the given Graph.
Parameters:
Name | Type | Description |
---|---|---|
graph |
Graph |
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. |