@zazuko/query-rdf-data-cube - v0.7.1
Options
All
  • Public
  • Public/Protected
  • All
Menu
class

Component is implemented by Dimension, Attribute and Measure.

export
abstract
extends

{BaseExpr}

A cube is organized according to a set of dimensions, attributes and measures. We collectively call these components. Source: https://www.w3.org/TR/vocab-data-cube/#cubes-model.

Each of them inherits from all filter operators:

const priceMeasure = new Measure({
  iri: "http://example.com/price",
  label: { value: "Price", language: "en" },
});

const query = dataCube
  .query()
  .select({ price: priceMeasure })
  .filter(({ price }) => price.lte(30.5));

Generated query will have this FILTER clause:

FILTER(?price <= \\"30.5\\"^^xsd:decimal)

Hierarchy

Implements

Index

Constructors

constructor

  • Creates an instance of Component. Classes Dimension, Attribute and Measure inherit from this Component abstract class.

    const priceMeasure = new Measure({
      iri: "http://example.com/price", label: { value: "Price", language: "en" }
    });
    memberof

    Component

    Parameters

    • options: object

      Additional info about the component.

      • Optional extraMetadata?: object
      • iri: string | Term

        The IRI of the Component.

      • Optional label?: Label

        (Optional) A label for the DataCube in the following form: { value: "Something", language: "en" }

    Returns Component

Properties

aggregateType

aggregateType: string

Optional broaderComponent

broaderComponent: Component

componentType

componentType: string = ""

descending

descending: boolean = false

extraMetadata

extraMetadata: object

Type declaration

  • [key: string]: Term

iri

iri: Term

isDistinct

isDistinct: boolean = false

label

label: Label

Optional narrowerComponent

narrowerComponent: Component

Accessors

Methods

avg

  • avg(): any
  • Used in select, avg calculates the average value. It automatically generates the corresponding groupBy clause. An average value can be filter with having.

    const priceMeasure = new Measure({
      iri: "http://example.com/price", labels: { value: "Price", language: "en" }
    });
    dataCube.query().select({
      price: priceMeasure.avg(),
    });
    memberof

    Component

    Returns any

broader

  • broader(iri?: string): any
  • Used in select, lets the query use skos:broader relations with Components

    const street = new Dimension({
      iri: "http://example.com/street", labels: { value: "Street", language: "en" }
    });
    const city = street.broader()
    const country = city.broader()
    // alternatively, to get streets in cities in a specific country:
    const country = city.broader("http://example.com/country/iceland")
    // retrieves all streets and their country (or all streets in Iceland) in alphabetical order
    dataCube.query().select({
      street,
      country,
    }).orderBy(street);
    memberof

    Component

    Parameters

    • Default value iri: string = ""

    Returns any

desc

  • desc(): any
  • Used in orderBy, desc orders by descending order of this component.

    const priceMeasure = new Measure({
      iri: "http://example.com/price", labels: { value: "Price", language: "en" }
    });
    dataCube.query().select({
      price: priceMeasure
    }).orderBy(price.desc());
    memberof

    Component

    Returns any

distinct

  • distinct(): any
  • Used in select, distinct asks for distinct values.

    const cityDimension = new Dimension({
      iri: "http://example.com/city", labels: { value: "City", language: "en" }
    });
    dataCube.query().select({
      city: cityDimension.distinct(),
    });
    memberof

    Component

    Returns any

resolve

  • resolve(mapping: Map<string, string>): IExpr
  • Mechanism resolving a Component to the corresponding binding name, used when the SPARQL query gets generated.

    memberof

    Component

    Parameters

    • mapping: Map<string, string>

    Returns IExpr

toJSON

  • toJSON(): string

Static fromJSON

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method

Generated using TypeDoc