Home Reference Source
public class | source

SBOLDocument

Class to represent an SBOL2 document in memory.

Static Method Summary

Static Public Methods
public static

loadRDF(rdf: string, callback: function(err: Error, sbol: SBOLDocument))

Load a new SBOL document from an RDF/XML string.

public static

loadRDFFile(filename: string, callback: function(err: Error, sbol: SBOLDocument))

Load a new SBOL document from an RDF/XML file.

Constructor Summary

Public Constructor
public

Member Summary

Public Members
public get

Returns a list of all ComponentDefinitions in the document

public get

Returns a list of all Components in the document

public get

Returns a list of all Interactions in the document

public get

mappings: Mapping[]: *

Returns a list of all Mappings in the document

public get

models: Model[]: *

Returns a list of all Models in the document

public get

Returns a list of all ModuleDefinitions in the document

public get

modules: Module[]: *

Returns a list of all Modules in the document

public get

Returns a list of all Participations in the document

public get

Returns a list of all SequenceAnnotations in the document

public get

Returns a list of all SequenceConstraints in the document

public get

Returns a list of all Sequences in the document

public get

Returns a list of all unresolved URIs in the document.

Method Summary

Public Methods
public

Create a new Collection in the document.

public

Create a new Component in the document.

public

Create a new ComponentDefinition in the document.

public

cut(uri: string): Cut

Create a new Cut in the document.

public

Create a new FunctionalComponent in the document.

public

Create a new GenericLocation in the document.

public

Create a new Interaction in the document.

public

link()

Attempt to resolve any unresolved URIs in the document, replacing them with their instantiated object.

public

loadRDF(rdf: string, callback: function(err: Error))

Load RDF/XML into the document.

public

lookupURI(uri: string | URI): Array

Return the corresponding object for a URI, if resolved.

public

lookupURIs(uris: URI[]): Array

Map a list of URIs to their corresponding objects, if resolved.

public

mapURI(uri: string | URI, object: *)

Map a URI to an object, such that lookupURI will return the object and the URI will be removed from unresolvedURIs if present.

public

mapping(uri: string): Mapping

Create a new Mapping in the document.

public

model(uri: string): Model

Create a new Model in the document.

public

Create a new Module in the document.

public

Create a new ModuleDefinition in the document.

public

Create a new Participation in the document.

public

range(uri: string): Range

Create a new Range in the document.

public

Create a new Sequence in the document.

public

Create a new SequenceAnnotation in the document.

public

Create a new SequenceConstraint in the document.

public

Serialize the document to JSON

public

Serialize the document to SBOL RDF/XML

public
public

unmapURI(uri: string | URI, object: *)

The reverse of mapURI.

Static Public Methods

public static loadRDF(rdf: string, callback: function(err: Error, sbol: SBOLDocument)) source

Load a new SBOL document from an RDF/XML string.

Parameters:

NameTypeAttributeDescription
rdf string

A string containing valid RDF/XML

callback function(err: Error, sbol: SBOLDocument)

public static loadRDFFile(filename: string, callback: function(err: Error, sbol: SBOLDocument)) source

Load a new SBOL document from an RDF/XML file.

Parameters:

NameTypeAttributeDescription
filename string

The name of the file

callback function(err: Error, sbol: SBOLDocument)

Public Constructors

public constructor source

Public Members

public get componentDefinitions: ComponentDefinition[]: * source

Returns a list of all ComponentDefinitions in the document

Returns:

ComponentDefinition[]

public get components: Component[]: * source

Returns a list of all Components in the document

Returns:

Component[]

public get interactions: Interaction[]: * source

Returns a list of all Interactions in the document

Returns:

Interaction[]

public get mappings: Mapping[]: * source

Returns a list of all Mappings in the document

Returns:

Mapping[]

public get models: Model[]: * source

Returns a list of all Models in the document

Returns:

Model[]

public get moduleDefinitions: ModuleDefinition[]: * source

Returns a list of all ModuleDefinitions in the document

Returns:

ModuleDefinition[]

public get modules: Module[]: * source

Returns a list of all Modules in the document

Returns:

Module[]

public get participations: Participation[]: * source

Returns a list of all Participations in the document

Returns:

Participation[]

public get sequenceAnnotations: SequenceAnnotation[]: * source

Returns a list of all SequenceAnnotations in the document

Returns:

SequenceAnnotation[]

public get sequenceConstraints: SequenceConstraint[]: * source

Returns a list of all SequenceConstraints in the document

Returns:

SequenceConstraint[]

public get sequences: Sequence[]: * source

Returns a list of all Sequences in the document

Returns:

Sequence[]

public get unresolvedURIs: string[]: * source

Returns a list of all unresolved URIs in the document.

Returns:

string[]

Public Methods

public collection(uri: string): Collection source

Create a new Collection in the document.

Parameters:

NameTypeAttributeDescription
uri string
  • optional

The URI of the Collection

Returns:

Collection

public component(uri: string): Component source

Create a new Component in the document.

Parameters:

NameTypeAttributeDescription
uri string
  • optional

The URI of the Component

Returns:

Component

public componentDefinition(uri: string): ComponentDefinition source

Create a new ComponentDefinition in the document.

Parameters:

NameTypeAttributeDescription
uri string
  • optional

The URI of the ComponentDefinition

public cut(uri: string): Cut source

Create a new Cut in the document.

Parameters:

NameTypeAttributeDescription
uri string
  • optional

The URI of the Cut

Returns:

Cut

public functionalComponent(uri: string): FunctionalComponent source

Create a new FunctionalComponent in the document.

Parameters:

NameTypeAttributeDescription
uri string
  • optional

The URI of the FunctionalComponent

public genericLocation(uri: string): GenericLocation source

Create a new GenericLocation in the document.

Parameters:

NameTypeAttributeDescription
uri string
  • optional

The URI of the GenericLocation

Returns:

GenericLocation

public interaction(uri: string): Interaction source

Create a new Interaction in the document.

Parameters:

NameTypeAttributeDescription
uri string
  • optional

The URI of the Interaction

Returns:

Interaction

Attempt to resolve any unresolved URIs in the document, replacing them with their instantiated object.

public loadRDF(rdf: string, callback: function(err: Error)) source

Load RDF/XML into the document. The existing contents of the document will be preserved.

Parameters:

NameTypeAttributeDescription
rdf string

A string containing valid RDF/XML

callback function(err: Error)

public lookupURI(uri: string | URI): Array source

Return the corresponding object for a URI, if resolved. If the URI has not been resolved, it will be returned unmodified.

Parameters:

NameTypeAttributeDescription
uri string | URI

Returns:

Array

public lookupURIs(uris: URI[]): Array source

Map a list of URIs to their corresponding objects, if resolved. Unresolved URIs will be returned unmodified.

Parameters:

NameTypeAttributeDescription
uris URI[]

Returns:

Array

public mapURI(uri: string | URI, object: *) source

Map a URI to an object, such that lookupURI will return the object and the URI will be removed from unresolvedURIs if present.

Parameters:

NameTypeAttributeDescription
uri string | URI

The URI to map

object *

The object to map to the URI

public mapping(uri: string): Mapping source

Create a new Mapping in the document.

Parameters:

NameTypeAttributeDescription
uri string
  • optional

The URI of the Mapping

Returns:

Mapping

public model(uri: string): Model source

Create a new Model in the document.

Parameters:

NameTypeAttributeDescription
uri string
  • optional

The URI of the Model

Returns:

Model

public module(uri: string): Module source

Create a new Module in the document.

Parameters:

NameTypeAttributeDescription
uri string
  • optional

The URI of the Module

Returns:

Module

public moduleDefinition(uri: string): ModuleDefinition source

Create a new ModuleDefinition in the document.

Parameters:

NameTypeAttributeDescription
uri string
  • optional

The URI of the ModuleDefinition

Returns:

ModuleDefinition

public participation(uri: string): Participation source

Create a new Participation in the document.

Parameters:

NameTypeAttributeDescription
uri string
  • optional

The URI of the Participation

Returns:

Participation

public range(uri: string): Range source

Create a new Range in the document.

Parameters:

NameTypeAttributeDescription
uri string
  • optional

The URI of the Range

Returns:

Range

public sequence(uri: string): Sequence source

Create a new Sequence in the document.

Parameters:

NameTypeAttributeDescription
uri string
  • optional

The URI of the Sequence

Returns:

Sequence

public sequenceAnnotation(uri: string): SequenceAnnotation source

Create a new SequenceAnnotation in the document.

Parameters:

NameTypeAttributeDescription
uri string
  • optional

The URI of the SequenceAnnotation

public sequenceConstraint(uri: string): SequenceConstraint source

Create a new SequenceConstraint in the document.

Parameters:

NameTypeAttributeDescription
uri string
  • optional

The URI of the SequenceConstraint

public serializeJSON(): string source

Serialize the document to JSON

Returns:

string

public serializeXML(): string source

Serialize the document to SBOL RDF/XML

Returns:

string

public toDisplayList(): * source

Returns:

*

public unmapURI(uri: string | URI, object: *) source

The reverse of mapURI. Unmap a URI from an object, such that lookupURI will no longer return the object.

Parameters:

NameTypeAttributeDescription
uri string | URI

The URI to unmap

object *

The object to unmap from the URI