@metreeca/wire
    Preparing search index...

    Builders for SPARQL queries and updates.

    Provides composable combinators that assemble SPARQL request strings from typed fragments: update and graph management operations, query forms, graph patterns, property paths, expressions, aggregates, solution modifiers, and the serialisers that render RDF terms into their SPARQL lexical forms. Every combinator takes and returns SPARQL fragments, so clauses nest by ordinary function composition into a complete query or update.

    Term content is escaped wherever the grammar defines an escape and validated wherever it does not, so no value rendered through the serialisers can break out of the token carrying it.

    Warning

    Blank-node labels are the exception: BLANK_NODE_LABEL defines no escape and blank performs no check, so a malformed label breaks the fragment carrying it rather than rendering as data.

    Types

    • Mixed — the spread-or-array argument shape accepted by the variadic combinators

    Prologue

    • base — base IRI for relative references

    Updates

    Graph management

    Queries

    Graph patterns

    Property paths

    Expressions

    Built-in functions

    Aggregates

    Serialisers

    Usage

    Combinators nest as plain expressions, so a whole request is written as one composition:

    const product = variable("product"); // ?product, minted by the package entry module
    const name = variable("name"); // ?name

    const query = select([name],
    where(
    edge(product, reference("https://schema.org/name"), name),
    filter(langMatches(lang(name), "en"))
    ),
    orderBy(asc(name)),
    limit(10)
    );

    Type Aliases

    Mixed

    A variadic parameter mixing bare values and arrays of values in a single argument list.

    Functions

    base

    Generates a SPARQL BASE declaration.

    update

    Generates a SPARQL update request.

    deleet

    Generates a SPARQL DELETE clause.

    insert

    Generates a SPARQL INSERT clause.

    data

    Generates a SPARQL DATA block for deleet or insert.

    witt

    Generates a SPARQL WITH clause.

    using

    Generates SPARQL USING clauses.

    usingNamed

    Generates SPARQL USING NAMED clauses.

    load

    Generates a SPARQL LOAD update.

    clear

    Generates a SPARQL CLEAR update.

    create

    Generates a SPARQL CREATE update.

    drop

    Generates a SPARQL DROP update.

    copy

    Generates a SPARQL COPY update.

    move

    Generates a SPARQL MOVE update.

    aad

    Generates a SPARQL ADD update.

    silent

    Generates the SPARQL SILENT form of an operation.

    ask

    Generates a SPARQL ASK query.

    select

    Generates a SPARQL SELECT query.

    construct

    Generates a SPARQL CONSTRUCT query.

    describe

    Generates a SPARQL DESCRIBE query.

    distinct

    Generates a SPARQL distinct modifier for a projection or an aggregate argument.

    reduced

    Generates a SPARQL reduced modifier for a projection.

    all

    Generates the SPARQL * projection wildcard.

    as

    Generates a SPARQL projection alias.

    from

    Generates SPARQL FROM clauses.

    fromNamed

    Generates SPARQL FROM NAMED clauses.

    groupBy

    Generates a SPARQL GROUP BY clause.

    having

    Generates a SPARQL HAVING clause.

    orderBy

    Generates a SPARQL ORDER BY clause.

    asc

    Generates a SPARQL asc() order condition.

    desc

    Generates a SPARQL desc() order condition.

    limit

    Generates a SPARQL LIMIT clause.

    offset

    Generates a SPARQL OFFSET clause.

    where

    Generates a SPARQL WHERE clause.

    union

    Generates a SPARQL UNION pattern.

    optional

    Generates a SPARQL OPTIONAL group pattern.

    group

    Generates a SPARQL group graph pattern.

    minus

    Generates a SPARQL MINUS pattern.

    graph

    Generates a SPARQL GRAPH block.

    service

    Generates a SPARQL SERVICE block.

    values

    Generates a SPARQL VALUES inline-data block.

    fragment

    Generates a SPARQL fragment by space-joining clauses.

    edge

    Generates a SPARQL subject predicate object . statement from serialised terms.

    filter

    Generates a SPARQL FILTER constraint.

    bind

    Generates a SPARQL bind clause.

    nil

    Generates an empty SPARQL fragment.

    seq

    Generates a SPARQL sequence property path.

    alt

    Generates a SPARQL alternative property path.

    inv

    Generates a SPARQL inverse property path.

    star

    Generates a SPARQL zero-or-more (*) property path.

    plus

    Generates a SPARQL one-or-more (+) property path.

    opt

    Generates a SPARQL zero-or-one (?) property path.

    none

    Generates a SPARQL none property set.

    not

    Generates a SPARQL logical negation (!).

    and

    Generates a SPARQL logical conjunction (&&).

    or

    Generates a SPARQL logical disjunction (||).

    eq

    Generates a SPARQL equality (=) comparison.

    ne

    Generates a SPARQL inequality (!=) comparison.

    gt

    Generates a SPARQL greater-than (>) comparison.

    lt

    Generates a SPARQL less-than (<) comparison.

    gte

    Generates a SPARQL greater-than-or-equal (>=) comparison.

    lte

    Generates a SPARQL less-than-or-equal (<=) comparison.

    add

    Generates a parenthesised SPARQL addition (+).

    sub

    Generates a parenthesised SPARQL subtraction (-).

    mul

    Generates a parenthesised SPARQL multiplication (*).

    div

    Generates a parenthesised SPARQL division (/).

    neg

    Generates a parenthesised SPARQL arithmetic negation (unary -).

    iif

    Generates a SPARQL if() conditional expression.

    coalesce

    Generates a SPARQL coalesce() call.

    isBound

    Generates a SPARQL bound() test.

    isIn

    Generates a SPARQL IN test.

    isNotIn

    Generates a SPARQL NOT IN test.

    exists

    Generates a SPARQL exists test.

    nexists

    Generates a SPARQL not exists test.

    call

    Generates a SPARQL function call.

    str

    Generates a SPARQL str() call.

    lang

    Generates a SPARQL lang() call.

    datatype

    Generates a SPARQL datatype() call.

    isBlank

    Generates a SPARQL isblank() test.

    isIRI

    Generates a SPARQL isiri() test.

    isLiteral

    Generates a SPARQL isliteral() test.

    isNumeric

    Generates a SPARQL isnumeric() test.

    sameTerm

    Generates a SPARQL sameterm() test.

    iri

    Generates a SPARQL iri() call.

    bnode

    Generates a SPARQL bnode() call.

    strdt

    Generates a SPARQL strdt() call.

    strlang

    Generates a SPARQL strlang() call.

    uuid

    Generates a SPARQL uuid() call.

    struuid

    Generates a SPARQL struuid() call.

    strlen

    Generates a SPARQL strlen() call.

    substr

    Generates a SPARQL substr() call.

    ucase

    Generates a SPARQL ucase() call.

    lcase

    Generates a SPARQL lcase() call.

    strstarts

    Generates a SPARQL strstarts() call.

    strends

    Generates a SPARQL strends() call.

    contains

    Generates a SPARQL contains() call.

    strbefore

    Generates a SPARQL strbefore() call.

    strafter

    Generates a SPARQL strafter() call.

    encodeForUri

    Generates a SPARQL encode_for_uri() call.

    concat

    Generates a SPARQL concat() call.

    langMatches

    Generates a SPARQL langmatches() call.

    regex

    Generates a SPARQL regex() call.

    replace

    Generates a SPARQL replace() call.

    abs

    Generates a SPARQL abs() call.

    round

    Generates a SPARQL round() call.

    ceil

    Generates a SPARQL ceil() call.

    floor

    Generates a SPARQL floor() call.

    rand

    Generates a SPARQL rand() call.

    now

    Generates a SPARQL now() call.

    year

    Generates a SPARQL year() call.

    month

    Generates a SPARQL month() call.

    day

    Generates a SPARQL day() call.

    hours

    Generates a SPARQL hours() call.

    minutes

    Generates a SPARQL minutes() call.

    seconds

    Generates a SPARQL seconds() call.

    timezone

    Generates a SPARQL timezone() call.

    tz

    Generates a SPARQL tz() call.

    md5

    Generates a SPARQL md5() call.

    sha1

    Generates a SPARQL sha1() call.

    sha256

    Generates a SPARQL sha256() call.

    sha384

    Generates a SPARQL sha384() call.

    sha512

    Generates a SPARQL sha512() call.

    count

    Generates a SPARQL count() aggregate.

    sum

    Generates a SPARQL sum() aggregate.

    min

    Generates a SPARQL min() aggregate.

    max

    Generates a SPARQL max() aggregate.

    avg

    Generates a SPARQL avg() aggregate.

    sample

    Generates a SPARQL sample() aggregate.

    groupConcat

    Generates a SPARQL group_concat() aggregate.

    patterns

    Generates SPARQL triple patterns from a Pattern sequence.

    pattern

    Generates a SPARQL triple pattern.

    triples

    Generates SPARQL triple data from a Triple sequence.

    triple

    Generates the SPARQL representation of a single Triple.

    anchor

    Generates the SPARQL representation of a Variable or Term.

    variable

    Generates the SPARQL representation of a Variable.

    term

    Generates the SPARQL representation of a Term.

    blank

    Generates the SPARQL representation of a blank node.

    reference

    Generates the SPARQL IRIREF for an IRI.

    boolean

    Generates the SPARQL representation of a boolean value.

    number

    Generates the SPARQL representation of a numeric value.

    string

    Generates the SPARQL representation of a string value.

    tagged

    Generates a language-tagged RDF literal.

    typed

    Generates a datatype-annotated RDF literal.