Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
jstcki committed Jul 19, 2021
1 parent ac155f0 commit 20e5ec2
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 5 deletions.
1 change: 1 addition & 0 deletions app/rdf/namespace.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export const classifications = namespace(
);
export const schemaAdmin = namespace("https://schema.ld.admin.ch/");
export const adminTerm = namespace("https://ld.admin.ch/definedTerm/");
export const adminVocabulary = namespace("https://ld.admin.ch/vocabulary/");
export const cube = namespace("https://cube.link/");
export const cubeView = namespace("https://cube.link/view/");
export const cubeMeta = namespace("https://cube.link/meta/");
Expand Down
4 changes: 3 additions & 1 deletion app/rdf/parse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@ export const parseCube = ({
version: cube.out(ns.schema.version)?.value,
publicationStatus:
ns.adminTerm("CreativeWorkStatus/Published").value ===
cube.out(ns.schema.creativeWorkStatus)?.value
cube.out(ns.schema.creativeWorkStatus)?.value ||
ns.adminVocabulary("CreativeWorkStatus/Published").value ===
cube.out(ns.schema.creativeWorkStatus)?.value
? DataCubePublicationStatus.Published
: DataCubePublicationStatus.Draft,
theme: cube.out(ns.dcat.theme)?.value,
Expand Down
13 changes: 10 additions & 3 deletions app/rdf/queries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,10 @@ export const getCubes = async ({
].concat(
includeDrafts
? []
: Cube.filter.status(ns.adminTerm("CreativeWorkStatus/Published"))
: Cube.filter.status([
ns.adminTerm("CreativeWorkStatus/Published"),
ns.adminVocabulary("CreativeWorkStatus/Published"),
])
),
});

Expand All @@ -91,7 +94,9 @@ export const getCube = async ({
// const versionHistory = cube.in(ns.schema.hasPart)?.term;
// const isPublished =
// cube.out(ns.schema.creativeWorkStatus)?.value ===
// ns.adminTerm("CreativeWorkStatus/Published").value;
// ns.adminTerm("CreativeWorkStatus/Published").value ||
// cube.out(ns.schema.creativeWorkStatus)?.value ===
// ns.adminVocabulary("CreativeWorkStatus/Published").value;
// const version = cube.out(ns.schema.version);

// // console.log(`Cube <${iri}> version: ${version?.value}`);
Expand Down Expand Up @@ -146,7 +151,9 @@ export const getCube = async ({
// newerCubes.find(
// (cube) =>
// cube.out(ns.schema.creativeWorkStatus)?.value ===
// ns.adminTerm("CreativeWorkStatus/Published").value
// ns.adminTerm("CreativeWorkStatus/Published").value ||
// cube.out(ns.schema.creativeWorkStatus)?.value ===
// ns.adminVocabulary("CreativeWorkStatus/Published").value
// ) ?? newerCubes[0];

// // console.log("Picked latest cube", latestCube.term?.value);
Expand Down
2 changes: 1 addition & 1 deletion app/typings/rdf.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ declare module "rdf-cube-view-query" {
static filter: {
isPartOf: (container: $FixMe) => $FixMe;
noValidThrough: () => $FixMe;
status: (values: Term) => $FixMe;
status: (values: Term | Term[]) => $FixMe;
};
dimensions: CubeDimension[];
source: CubeSource;
Expand Down

0 comments on commit 20e5ec2

Please sign in to comment.