Class

RDFEnvironment

RDFEnvironment()

The class RDFEnvironment specializes the model creation functions and codecs for RDF. An environment instance provides model element creation operations in a mode which provides defaults from environment properties

Constructor

new RDFEnvironment()

View Source rdf-environment.js, line 33

Extends

Members

baseIRI

Return the base IRI from this environment's context.

Inherited From:

View Source graph-environment.js, line 34

Methods

abstract computeGraphObject()

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

Overrides:

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

Overrides:

View Source graph-environment.js, line 210

abstract computeObjectGraph(object)

Parameters:
Name Type Description
object Object
Overrides:

View Source graph-environment.js, line 217

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>
Inherited From:

View Source graph-environment.js, line 264

createQuad(subject, predicate, object, graphopt)

Create a Quad with provisions from translation from curie terms and completion of relative iri. Use the environment's location as the default graph name

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

View Source rdf-environment.js, line 78

createStatement(subject, predicate, object, graphopt)

Create a statement with provisions from translation from curie terms and completion of relative iri.

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

View Source rdf-environment.js, line 47

createTriple(subject, predicate, object)

Create a Triple with provisions from translation from curie terms and completion of relative iri.

Parameters:
Name Type Description
subject Node
predicate NamedNode
object Term

View Source rdf-environment.js, line 88

decode()

The function decode accepts a document, a content type and an optional continuation, It parses the document and returns or continues with the result, by retrieving the respective decoder and delegating the operation to that function.

View Source rdf-environment.js, line 344

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

Inherited From:
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

Inherited From:
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.

Inherited From:

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
Inherited From:

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
Overrides:

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
Overrides:

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.

Inherited From:

View Source graph-environment.js, line 43

toLiteral()

The function toLiteral accepts an native object and coerces it to a Literal instance. It distinguishes between Object specializations and primitive data. In those cases, use the type to compute a converter and delegate to that. Return unmodified any data which is already a Term.

from rdflib.js https://github.com/linkeddata/rdflib.js/blob/master/src/literal.js

View Source rdf-environment.js, line 312

toValue()

The function toValue accepts a Term and converts it to a native value

View Source rdf-environment.js, line 290