TriplePatternsBuilder

Description

Builder for triples based elements.

Methods

resource( iri: string ): Resource

Create a Resource from the IRI or prefixed name specified.

Parameters

NameTypeDescription
string

The IRI or prefixed name to create the Resource from.

var( name: string ): Variable

Crete a Variable from the name specified.

Parameters

NameTypeDescription
string

The name of the Variable to be created.

literal( value: SupportedNativeTypes ): Literal

Create a Literal from the value specified.

Parameters

NameTypeDescription
SupportedNativeTypes

The value of the Literal.

collection( ...values: (string | number | boolean | Date | Resource | Literal | Variable | BlankNode | Collection | BlankNodeProperty)[] ): Collection

Create a Collection from all the values provided.

Parameters

NameTypeDescription

The values to be added to the collection.

(string | number | boolean | Date | Resource | Literal | Variable | BlankNode | Collection | BlankNodeProperty)[]
blankNode( builderFn: (selfBuilder: BlankNodeBuilder) => any ): BlankNodeProperty

Create a BlankNodeProperty from the properties added in the selfBuilder of the builderFn specified.

Parameters

NameTypeDescription
(selfBuilder: BlankNodeBuilder) => any

The function that will receive a selfBuilder parameter to add the properties of the blank node to match. This builder as s similar API of a triple pattern, i.e. the has and and methods.

TriplePatternsBuilder

Description

Constant with the utils for TriplePatternsBuilder objects.

Methods

createFrom<O extends object>( container: Container<undefined>, object: O ): O & TriplePatternsBuilder

Factory function that allows to crete a TriplePatternsBuilder from the object provided.

Parameters

NameTypeDescription
Container<undefined>

The related container with the data for the TriplePatternsBuilder statement.

O

The base base from where to create the TriplePatternsBuilder statement.

Returns

The TriplePatternsBuilder statement created from the object provided.