A synchronous mapping function from one element to another.
A return value of null
means that nothing should be emitted for a particular item.
A Solid utility context where all fields are optional.
A function with a .with()
function, which is used to expand the Solid utility context.
The function is only callable if the scoped context contains all required fields.
ID of the CLOSED state. An iterator is closed if it no longer actively generates new items. Items might still be available.
ID of the CLOSING state. An iterator is closing if item generation is pending but will not be scheduled again.
Key indicating the current consumer of a source.
ID of the DESTROYED state. An iterator has been destroyed after calling {@link module:asynciterator.AsyncIterator#destroy}. The 'end' event has not been called, as pending elements were voided.
ID of the ENDED state. An iterator has ended if no further items will become available. The 'end' event is guaranteed to have been called when in this state.
ID of the INIT state. An iterator is initializing if it is preparing main item generation. It can already produce items.
ID of the OPEN state. An iterator is open if it can generate new items.
A Solid utility context with default values for all required fields.
It uses @comunica/query-sparql-solid
as default query engine.
A Solid utility context with default values for all requied fields, except for the query engine.
Internal utility function to create context-scoped helper functions.
A factory method that determines a context scope and returns a helper function.
An optional default context, which defaults to the light Solid utility context.
The helper function with a .with()
function, which can be used to expand the context.
Creates an empty iterator.
Creates an iterator for the given array.
the items
Creates an iterator for the given Iterable.
the iterable
Creates an iterator for the given Iterator.
the iterator
Obtains the first bindings object in a bindings stream.
A stream of query result bindings.
The error message that will be thrown when the bindings stream has no results.
Returns the asynchronous task scheduler.
Obtain the value of the given RDF term, or throw an error if the term is undefined.
An optional RDF term.
Function that maps an element to itself.
Checks if all required fields are set in a Solid utility context.
Creates an iterator of integers for the given numeric range.
Schedules the given task for asynchronous execution.
Sets the asynchronous task scheduler.
Creates an iterator with a single item.
the item
Creates an iterator containing all items from the given iterators.
Creates an iterator that wraps around a given iterator or readable stream. Use this to convert an iterator-like object into a full-featured AsyncIterator. After this operation, only read the returned iterator instead of the given one.
A new iterator with the items from the given iterator
Generated using TypeDoc
SolidLabLib.js - Core
A library of helper functions for developing Solid apps in TypeScript/JavaScript.
This package contains logic that is common to all SolidLabLib packages.
Requirements
Installation
or
Usage
Solid Utility Context
The
SolidUtilContext
interface represents an object that can contain fields that can be used across different helper functions within SolidLabLib. This can contain fields such as an authenticated Solid session, and a query engine.The easiest way to obtain such a context is as follows:
If you already have parts of the context available (such as the
session
), you can fill in the other missing parts as follows:Alternatively, you can create your own context from scratch as long as it contains all the required fields:
Helper functions
The following helper functions are available in this package:
getFirstBindings
: Obtains the first bindings object in a bindings stream.getTermValue
: Obtain the value of the given RDF term, or throw an error if the term is undefined.License
This code is copyrighted by Ghent University – imec and released under the MIT license.