QueryClause
Extends

Description

Interface that describes the base entry of any query statement.

It allows to add the prologues BASE and PREFIX. And also add support for specify a vocab used to resolve relative properties/predicates.

The current query types supported are:

Methods

base( iri: string ): QueryClause<SELECT, ASK>

Add a base IRI the query uses to resolve any relative IRIs.

If a default vocabulary is set with the QueryClause.vocab method, the base is ignored for relative predicates.

Parameters

NameTypeDescription
string

IRI to be used as the query BASE.

Returns

Object with the methods to keep constructing the query.

vocab( iri: string ): QueryClause<SELECT, ASK>

Add a default vocabulary to be used to resolve relative IRIs when used as a predicate in a triple pattern.

Parameters

NameTypeDescription
string

IRI to append to prepend to any relative predicate.

Returns

Object with the methods to keep constructing the query.

prefix( name: string, iri: string ): QueryClause<SELECT, ASK>

Add a prefix to the query.

If the prefix is not used in any part of the query it is not added in the compact query string.

Parameters

NameTypeDescription
string

Name the prefix will be identified for.

string

The IRI of the current PREFIX.

Returns

Object with the methods to keep constructing the query.

QueryClause

Description

Constant with the utils functions for QueryClause objects.

Methods

createFrom<C extends QueryUnitContainer<SELECT, ASK>, SELECT extends FinishClause, ASK extends FinishClause, T extends object>( container: C, object: T ): T & QueryClause<SELECT, ASK>

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

Parameters

NameTypeDescription
C

The related container with the data for the QueryClause statement.

T

The base base from where to create the QueryClause statement.

Returns

The QueryClause statement created from the object provided.