diff --git a/.changeset/itchy-coats-hide.md b/.changeset/itchy-coats-hide.md new file mode 100644 index 000000000..4b2ac2bfc --- /dev/null +++ b/.changeset/itchy-coats-hide.md @@ -0,0 +1,5 @@ +--- +"@cube-creator/shared-dimensions-api": minor +--- + +Added I14Y properties to Shared Dimensions (re https://gitlab.ldbar.ch/zazuko/misc/-/issues/195) diff --git a/apis/core/package.json b/apis/core/package.json index 53d6790f3..972dbd566 100644 --- a/apis/core/package.json +++ b/apis/core/package.json @@ -54,7 +54,7 @@ "jwks-rsa": "^3.0.0", "merge2": "^1.4.1", "middleware-async": "^1.2.7", - "nanoid": "^3.1.16", + "nanoid": "^3.3.8", "node-fetch": "^2.6.1", "once": "^1.4.0", "parse-prefer-header": "^1.0.0", diff --git a/apis/shared-dimensions/lib/shapes/shared-dimension.ts b/apis/shared-dimensions/lib/shapes/shared-dimension.ts index 75d22363c..2455376d8 100644 --- a/apis/shared-dimensions/lib/shapes/shared-dimension.ts +++ b/apis/shared-dimensions/lib/shapes/shared-dimension.ts @@ -9,9 +9,10 @@ import { editor, iso6391, md, meta, sh1 } from '@cube-creator/core/namespace' import { fromPointer as nodeShape } from '@rdfine/shacl/lib/NodeShape' import { fromPointer as propertyGroup } from '@rdfine/shacl/lib/PropertyGroup' import { fromPointer as resource } from '@rdfine/rdfs/lib/Resource' -import { owl } from '@tpluscode/rdf-ns-builders' +import { dcat, owl } from '@tpluscode/rdf-ns-builders' const defaultGroup = $rdf.namedNode('#default-group') +const i14yGroup = $rdf.namedNode('#i14y-group') const datatypeUri = [xsd.anyURI, ['URI']] const commonProperties = [ @@ -21,6 +22,46 @@ const commonProperties = [ schema.multipleValues, ] +const i14yProperties = [{ + name: 'Identifier', + path: schema.identifier, + order: 10, + datatype: xsd.string, + maxCount: 1, + group: propertyGroup(i14yGroup, { + label: 'I14Y', + }), +}, { + name: 'Version', + path: schema.version, + order: 20, + datatype: xsd.string, + maxCount: 1, + pattern: '^\\d+(\\.\\d+(\\.\\d+)?)?$', + group: i14yGroup, + message: 'Version must be one of the formats: x, x.y, x.y.z', +}, { + name: 'Themes', + path: dcat.theme, + order: 30, + nodeKind: sh.IRI, + editor: dash.URIEditor, + group: i14yGroup, +}, { + name: 'Keywords', + path: dcat.keyword, + order: 40, + nodeKind: sh.Literal, + group: i14yGroup, +}, { + name: 'Conforms to', + path: dcterms.conformsTo, + order: 50, + nodeKind: sh.IRI, + editor: dash.URIEditor, + group: i14yGroup, +}] + const properties: Initializer[] = [{ name: 'Name', path: schema.name, @@ -320,7 +361,7 @@ const properties: Initializer[] = [{ maxCount: 1, }], }, -}] +}, ...i14yProperties] export const create = (): Initializer => ({ [sh1.xoneDiscriminator.value]: md.createAs, diff --git a/apis/shared-dimensions/lib/store/shapes.ttl b/apis/shared-dimensions/lib/store/shapes.ttl index 550b1409f..164e094fb 100644 --- a/apis/shared-dimensions/lib/store/shapes.ttl +++ b/apis/shared-dimensions/lib/store/shapes.ttl @@ -1,3 +1,4 @@ +PREFIX dcat: PREFIX dcterm: PREFIX time: PREFIX qudt: @@ -27,6 +28,21 @@ PREFIX sh: [ sh:path schema:alternateName ; ], + [ + sh:path schema:identifier ; + ], + [ + sh:path schema:version ; + ], + [ + sh:path dcat:theme ; + ], + [ + sh:path dcat:keyword ; + ], + [ + sh:path dcterm:conformsTo ; + ], [ sh:path sh:property ; sh:node diff --git a/apis/shared-dimensions/package.json b/apis/shared-dimensions/package.json index 2e16344e1..160f5172e 100644 --- a/apis/shared-dimensions/package.json +++ b/apis/shared-dimensions/package.json @@ -32,7 +32,7 @@ "hydra-box-middleware-shacl": "1.1.0", "is-graph-pointer": "^1.2.2", "middleware-async": "^1.2.7", - "nanoid": "^3.1.23", + "nanoid": "^3.3.8", "once": "^1.4.0", "onetime": "^5", "parse-prefer-header": "^1.0.0", diff --git a/cli/package.json b/cli/package.json index 1d74d48b4..857c5850f 100644 --- a/cli/package.json +++ b/cli/package.json @@ -62,7 +62,7 @@ "iso8601-duration": "^1.3.0", "merge2": "^1.4.1", "middleware-async": "^1.2.7", - "nanoid": "^3.1.20", + "nanoid": "^3.3.8", "nanoid-dictionary": "^4.2.0", "node-fetch": "^2.6.1", "null-writable": "^1.0.5", diff --git a/ui/src/forms/editors/TagsWithLanguageEditor.vue b/ui/src/forms/editors/TagsWithLanguageEditor.vue index 14dcbf5d9..11969f675 100644 --- a/ui/src/forms/editors/TagsWithLanguageEditor.vue +++ b/ui/src/forms/editors/TagsWithLanguageEditor.vue @@ -23,7 +23,7 @@