Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for hidden cubes #1485

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion apis/core/bootstrap/shapes/dataset.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { shape, editor, lindasSchema } from '@cube-creator/core/namespace'
import { shape, editor, lindasSchema, cc } from '@cube-creator/core/namespace'
import { supportedLanguages } from '@cube-creator/core/languages'
import { hydra, rdfs, sh, dcat, dcterms, xsd, rdf, vcard, schema, _void, dash, skos } from '@tpluscode/rdf-ns-builders'
import { sparql, turtle } from '@tpluscode/rdf-string'
Expand Down Expand Up @@ -209,6 +209,19 @@ ${shapeId} {
${sh.description} "Only published datasets will be listed in the external tools. A draft will be nevertheless be public." ;
${sh.group} ${mainGroup} ;
] ;

${sh.property} [
${sh.name} "Hide this cube?" ;
${sh.path} ${cc.isHiddenCube} ;
${sh.datatype} ${xsd.boolean} ;
${sh.defaultValue} ${false} ;
${sh.minCount} 1 ;
mchlrch marked this conversation as resolved.
Show resolved Hide resolved
${sh.maxCount} 1 ;
${sh.order} 31 ;
${sh.description} "Hidden cubes are only visible in *visualize* for logged-in users" ;
${sh.group} ${mainGroup} ;
] ;

${sh.property} [
${sh.name} "Publish to" ;
${sh.path} ${schema.workExample} ;
Expand Down
4 changes: 3 additions & 1 deletion apis/core/lib/domain/job/create.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,14 @@ export async function createPublishJob({

const metadata = await store.getResource(project.dataset)

const targetGraph = metadata.isHiddenCube ? $rdf.namedNode(organization.publishGraph.value + '/hidden') : organization.publishGraph
tpluscode marked this conversation as resolved.
Show resolved Hide resolved

const jobPointer = await store.createMember(jobCollection.term, id.job(jobCollection))
const job = Job.createPublish(jobPointer, {
project: projectPointer,
name: 'Publish job',
revision: project.nextRevision,
publishGraph: organization.publishGraph,
publishGraph: targetGraph,
status: metadata?.pointer.out(schema.creativeWorkStatus).term,
publishedTo: metadata?.pointer.out(schema.workExample).term,
})
Expand Down
3 changes: 2 additions & 1 deletion packages/core/namespace.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@ type CubeCreatorProperty =
'export' |
'projectDetails' |
'validationReport' |
'batchMapping'
'batchMapping' |
'isHiddenCube'

type OtherTerms =
'dash' |
Expand Down
4 changes: 4 additions & 0 deletions packages/model/Dataset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export interface Dataset extends RdfResource {
title: Literal[]
created: Date
published: Date
isHiddenCube: boolean
}

export const Error = {
Expand Down Expand Up @@ -43,6 +44,9 @@ export function DatasetMixin<Base extends Constructor>(Resource: Base): Mixin {

@property.literal({ path: schema.datePublished, type: Date, datatype: xsd.date })
published!: Date

@property.literal({ path: cc.isHiddenCube, datatype: xsd.boolean })
isHiddenCube!: boolean
mchlrch marked this conversation as resolved.
Show resolved Hide resolved
}

return Impl
Expand Down
Loading