Class: Trace

Trace

new Trace(uri:, mode:, requestmode:, format:, handshake:)

Parameters:
Name Type Description
uri: string

the Trace uri

mode: string

the access mode ("r", "w" or "rw")

requestmode: string

the HTTP method used for synchronization ("GET" or "POST")

format: string

the serialization format (see BufferedService)

handshake: boolean

see BufferedService

Source:

Members

baseuri

baseuri is used as the base URI to resolve relative attribute-type names in obsels. Strictly speaking, this should rather be expressed as a reference to model, or more generically, as a qname/URI dict

Source:

default_subject

Default subject

Source:

mode

mode defines the intended usage mode of the trace. It can be either "r" : read-only - we will only read existing obsels "w" : write-only - we will only create obsels to be stored on a server "rw" : read-write - we will both read and write obsels.

Source:

obsels

List of obsels

Source:

shorthands

Mapping of obsel type or property name to a compact representation (shorthands).

Source:

uri

Trace URI

Source:

Methods

create_obsel(ident:, type:, begin:, end:, _attributes:) → {Obsel}

Create a new obsel and add it to the trace

Parameters:
Name Type Description
ident: string

the obsel id

type: string

the obsel type

begin: integer

the obsel begin time

end: integer

the obsel end time

_attributes: object

the obsel attributes

Source:
Returns:

the created obsel

Type
Obsel

force_state_refresh()

Force trace refresh

Source:

get_default_subject() → {string}

Get the default subject

Source:
Returns:

the default subject

Type
string

get_id()

Get the trace id

Source:

get_obsel() → {Obsel}

Return the obsel of this trace identified by the URI, or undefined

Source:
Returns:

an obsel

Type
Obsel

get_readonly()

Indicates wether the trace can be written to

Source:

get_uri()

Get the trace URI

Source:

list_obsels(_begin:, _end:, _reverse:) → {list}

Return a list of the obsels of this trace matching the parameters

Parameters:
Name Type Description
_begin: integer

the minimum begin time

_end: integer

the maximum end time

_reverse: boolean

return obsels in reverse chronological order

Source:
Returns:

a list of Obsel

Type
list

load_obsels(options:)

Load obsels from the Trace url options is an object that contains optional parameters:

  • page: the page number
  • pagesize: the page size
  • from: the minimum timestamp
  • to: the maximum timestamp
Parameters:
Name Type Description
options: object

optional parameters

Source:

parseJSON()

Parse a JSON-LD trace representation and add resulting obsels to the trace obsels.

Source:

remove()

Remove the trace from the server

Source:

set_default_subject(subject)

Set the default subject

Parameters:
Name Type Description
subject string
Source:

set_sync_mode(mode:)

Set sync mode. See BufferedService.set_sync_mode for details.

Parameters:
Name Type Description
mode: string

"delayed", "sync" or "none"

Source:

set_uri()

Define the trace URI

Source:

trace(type:, _attributes:, [_begin]:, [_end]:, [_subject]:)

Create a new obsel with the given attributes

Parameters:
Name Type Description
type: string

the obsel type

_attributes: object

the obsel attributes

[_begin]: integer

the obsel begin time (current time if omitted)

[_end]: integer

the obsel end time (same as begin if omitted)

[_subject]: string

the obsel subject (trace default subject if omitted)

Source: