Options
All
  • Public
  • Public/Protected
  • All
Menu

A simple means to get the properties of a specific subject, or a set of subjects matching some @where clause.

Examples:


Describe a specific subject whose @id is fred

{
  "@describe": "fred"
}

Describe all subjects in the domain

{
  "@describe": "?id",
  "@where": { "@id": "?id" }
}

Describe subjects with a property age of 40

{
  "@describe": "?id",
  "@where": {
    "@id": "?id",
    "age": 40
  }
}

Describe all subjects referenced by fred via any property

{
  "@describe": "?id",
  "@where": {
    "@id": "fred",
    "?prop": { "@id": "?id" }
  }
}

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

see

json-rql describe

Hierarchy

Index

Properties

Optional @context

@context: Context

A JSON-LD Context for the query. In an API, this will frequently be implicit. For example, using json-rql as the body of a POST to http://example.com/my-api/v1/person/query might have the implicit context of a Person (possibly found at http://example.com/my-api/v1/person).

see

examples

@describe

@describe: Iri | Variable | (Iri | Variable)[]

Specifies a single Variable or Iri to return. Each matched value for the identified variable will be output as a Subject with its top-level properties.

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 exact-matches for subject identities, properties and values. Inline filters will be available in future.

Legend

  • Property
  • Method
  • Constructor

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