Options
All
  • Public
  • Public/Protected
  • All
Menu

A query pattern that returns values for variables in the query.

The subjects streamed in the query result will have the form:

{
  "?var1": <value>
  "?var2": <value>
  ...
}

Examples:


Select the ids of subjects having a given name

{
  "@select": "?id",
  "@where": {
    "@id": "?id",
    "name": "Wilma"
  }
}

Select the ids and names of all subjects

{
  "@select": ["?id", "?value"],
  "@where": {
    "@id": "?id",
    "name": "?value"
  }
}

See the @where property for more examples of how to use a where clause.

see

json-rql select

Hierarchy

Index

Properties

Properties

Optional @context

@context: Context

An optional JSON-LD Context for the query. Use of a query-specific Context is rarely required, as the context is typically the local application, whose needs are specified by the local clone configuration.

@select

@select: Result

A declaration of the selection of variables that will be returned.

Optional @where

@where: Subject | Subject[] | Group

The data pattern to match, as a set of subjects or a group. Variables are used as placeholders to capture matching properties and values in the domain.

Examples:


Match a subject by its @id

{
  ...
  "@where": { "@id": "fred" }
}

Match a subject where any property has a given value

{
  ...
  "@where": {
    "@id": "?id",
    "?prop": "Bedrock"
  }
}

Match a subject with a given property, having any value

{
  ...
  "@where": {
    "@id": "?id",
    "name": "?name"
  }
}

The Javascript engine supports filters for subject identities, properties and values, including inline filters.

Legend

  • Constructor
  • Property
  • Method
  • Property
  • Method
  • Inherited property
  • Inherited method
  • Static property
  • Static method
  • Protected method

Generated using TypeDoc. Delivered by Vercel. @m-ld/m-ld - v0.10.0 Source code licensed MIT. Privacy policy