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" }
});
Additional info about the component.
The IRI of the Component.
(Optional) A label for the DataCube in the following form:
{ value: "Something", language: "en" }
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(),
});
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);
const priceMeasure = new Measure({
iri: "http://example.com/price", labels: { value: "Price", language: "en" }
});
dataCube.query().select({
price: priceMeasure
}).orderBy(price.desc());
const cityDimension = new Dimension({
iri: "http://example.com/city", labels: { value: "City", language: "en" }
});
dataCube.query().select({
city: cityDimension.distinct(),
});
Mechanism resolving a Component to the corresponding binding name, used when the SPARQL query gets generated.
Serializes a Component to JSON in a way that makes it deserializable by calling fromJSON
Generated using TypeDoc
Component is implemented by Dimension, Attribute and Measure.
{BaseExpr}
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: