diff --git a/apis/shared-dimensions/lib/domain/shared-dimensions.ts b/apis/shared-dimensions/lib/domain/shared-dimensions.ts index 8eb46381e..9723beb2e 100644 --- a/apis/shared-dimensions/lib/domain/shared-dimensions.ts +++ b/apis/shared-dimensions/lib/domain/shared-dimensions.ts @@ -8,6 +8,7 @@ import clownface from 'clownface' import { isGraphPointer } from 'is-graph-pointer' import { StreamClient } from 'sparql-http-client/StreamClient' import { ParsingClient } from 'sparql-http-client/ParsingClient' +import { md } from '@cube-creator/core/namespace' import env from '../env' import shapeToQuery, { rewriteTemplates } from '../shapeToQuery' import { getDynamicProperties } from './shared-dimension' @@ -18,7 +19,7 @@ interface GetSharedDimensions { offset?: number } -export async function getSharedDimensions(client: C, { freetextQuery = '', limit = 10, offset = 0 }: GetSharedDimensions = {}): Promise { +export async function getSharedDimensions(client: StreamClient, { freetextQuery = '', limit = 10, offset = 0 }: GetSharedDimensions = {}): Promise { const { constructQuery } = await shapeToQuery() const shape = await loadShape('dimensions-query-shape') @@ -33,7 +34,15 @@ export async function getSharedDimensions { + termSet.addOut(md.export, $rdf.namedNode(`${MANAGED_DIMENSIONS_BASE}dimension/_export?dimension=${termSet.value}`)) + termSet.addOut(md.terms, $rdf.namedNode(`${MANAGED_DIMENSIONS_BASE}dimension/_terms?dimension=${termSet.value}`)) + }) + + return dataset.toArray() } interface GetSharedTerms { diff --git a/apis/shared-dimensions/lib/handlers/shared-dimensions.ts b/apis/shared-dimensions/lib/handlers/shared-dimensions.ts index 3a1b814a7..7c57917d6 100644 --- a/apis/shared-dimensions/lib/handlers/shared-dimensions.ts +++ b/apis/shared-dimensions/lib/handlers/shared-dimensions.ts @@ -13,7 +13,7 @@ import { shaclValidate } from '../middleware/shacl' import { getSharedDimensions, getSharedTerms } from '../domain/shared-dimensions' import { create } from '../domain/shared-dimension' import { store } from '../store' -import { parsingClient } from '../sparql' +import { parsingClient, streamClient } from '../sparql' import env from '../env' import { rewrite, rewriteTerm } from '../rewrite' import { postImportedDimension } from './shared-dimension/import' @@ -36,7 +36,7 @@ export const get = asyncMiddleware(async (req, res, next) => { const collection = getCollection({ view: $rdf.namedNode(req.absoluteUrl()), - memberQuads: await getSharedDimensions(parsingClient, queryParams), + memberQuads: await getSharedDimensions(streamClient, queryParams), collectionType: md.SharedDimensions, memberType: schema.DefinedTermSet, collection: req.hydra.resource.term, diff --git a/apis/shared-dimensions/lib/shapes/dimensions-query-shape.ttl b/apis/shared-dimensions/lib/shapes/dimensions-query-shape.ttl index 9e2fced3f..bdefe3bc9 100644 --- a/apis/shared-dimensions/lib/shapes/dimensions-query-shape.ttl +++ b/apis/shared-dimensions/lib/shapes/dimensions-query-shape.ttl @@ -66,6 +66,7 @@ prefix md: ] ; sh:property [ + sh:deactivated true ; sh:path md:terms ; sh:values [ @@ -83,6 +84,7 @@ prefix md: ] ; sh:property [ + sh:deactivated true ; sh:path md:export ; sh:values [