From 49da980a5af1c7941db79b58b404473643bd1c64 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Such=C3=A1nek?= Date: Tue, 19 Mar 2024 07:51:04 +0100 Subject: [PATCH] Fix metadata schemas and default license --- .../production/Migration_0016_FixSchemas.java | 87 +++++++++++++++++++ src/main/resources/application.yml | 2 +- .../development/schema/data/shape-catalog.ttl | 4 + .../schema/data/shape-data-service.ttl | 4 +- .../development/schema/data/shape-dataset.ttl | 6 ++ .../schema/data/shape-distribution.ttl | 19 ++-- .../development/schema/data/shape-fdp.ttl | 6 +- .../schema/data/shape-resource.ttl | 15 +++- .../production/0016_shape-catalog.ttl | 35 ++++++++ .../production/0016_shape-data-service.ttl | 22 +++++ .../production/0016_shape-dataset.ttl | 51 +++++++++++ .../production/0016_shape-distribution.ttl | 58 +++++++++++++ .../migration/production/0016_shape-fdp.ttl | 49 +++++++++++ .../production/0016_shape-resource.ttl | 73 ++++++++++++++++ .../service/reset/shape-catalog.ttl | 4 + .../service/reset/shape-data-service.ttl | 2 + .../service/reset/shape-dataset.ttl | 6 ++ .../service/reset/shape-distribution.ttl | 7 ++ .../fairdatapoint/service/reset/shape-fdp.ttl | 16 +--- .../service/reset/shape-resource.ttl | 9 ++ 20 files changed, 450 insertions(+), 25 deletions(-) create mode 100644 src/main/java/nl/dtls/fairdatapoint/database/mongo/migration/production/Migration_0016_FixSchemas.java create mode 100644 src/main/resources/nl/dtls/fairdatapoint/database/mongo/migration/production/0016_shape-catalog.ttl create mode 100644 src/main/resources/nl/dtls/fairdatapoint/database/mongo/migration/production/0016_shape-data-service.ttl create mode 100644 src/main/resources/nl/dtls/fairdatapoint/database/mongo/migration/production/0016_shape-dataset.ttl create mode 100644 src/main/resources/nl/dtls/fairdatapoint/database/mongo/migration/production/0016_shape-distribution.ttl create mode 100644 src/main/resources/nl/dtls/fairdatapoint/database/mongo/migration/production/0016_shape-fdp.ttl create mode 100644 src/main/resources/nl/dtls/fairdatapoint/database/mongo/migration/production/0016_shape-resource.ttl diff --git a/src/main/java/nl/dtls/fairdatapoint/database/mongo/migration/production/Migration_0016_FixSchemas.java b/src/main/java/nl/dtls/fairdatapoint/database/mongo/migration/production/Migration_0016_FixSchemas.java new file mode 100644 index 000000000..897260da7 --- /dev/null +++ b/src/main/java/nl/dtls/fairdatapoint/database/mongo/migration/production/Migration_0016_FixSchemas.java @@ -0,0 +1,87 @@ +/** + * The MIT License + * Copyright © 2017 DTL + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ +package nl.dtls.fairdatapoint.database.mongo.migration.production; + +import com.mongodb.client.MongoCollection; +import com.mongodb.client.model.Filters; +import com.mongodb.client.model.Updates; +import io.mongock.api.annotations.ChangeUnit; +import io.mongock.api.annotations.Execution; +import io.mongock.api.annotations.RollbackExecution; +import lombok.SneakyThrows; +import nl.dtls.fairdatapoint.Profiles; +import nl.dtls.fairdatapoint.entity.schema.SemVer; +import nl.dtls.fairdatapoint.util.KnownUUIDs; +import org.bson.Document; +import org.springframework.context.annotation.Profile; +import org.springframework.data.mongodb.core.MongoTemplate; + +import static java.lang.String.format; +import static nl.dtls.fairdatapoint.util.ResourceReader.loadClassResource; + +@ChangeUnit( + id = "Migration_0016_FixSchemas", + order = "0016", + author = "migrationBot" +) +@Profile(Profiles.PRODUCTION) +public class Migration_0016_FixSchemas { + private static final String FIELD_VER_UUID = "versionUuid"; + private static final String FIELD_LATEST = "latest"; + private static final String FIELD_DEF = "definition"; + private static final String COL_SCHEMAS = "metadataSchema"; + + private final MongoTemplate database; + + public Migration_0016_FixSchemas(MongoTemplate template) { + this.database = template; + } + + @Execution + public void run() { + updateSchema(KnownUUIDs.SCHEMA_V2_RESOURCE_UUID, "resource"); + updateSchema(KnownUUIDs.SCHEMA_V1_CATALOG_UUID, "catalog"); + updateSchema(KnownUUIDs.SCHEMA_V1_DATASET_UUID, "dataset"); + updateSchema(KnownUUIDs.SCHEMA_V1_DISTRIBUTION_UUID, "distribution"); + updateSchema(KnownUUIDs.SCHEMA_V1_DATASERVICE_UUID, "data-service"); + updateSchema(KnownUUIDs.SCHEMA_V1_FDP_UUID, "fdp"); + } + + @SneakyThrows + private void updateSchema(String versionUuid, String name) { + final MongoCollection schemasCol = database.getCollection(COL_SCHEMAS); + String definition = loadClassResource(format("0016_shape-%s.ttl", name), getClass()); + schemasCol.updateOne( + Filters.and( + Filters.eq(FIELD_VER_UUID, versionUuid), + Filters.eq(FIELD_LATEST, true) + ), + Updates.set(FIELD_DEF, definition) + ); + } + + @RollbackExecution + public void rollback() { + // Rollback is not possible + } +} diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index f791ac405..cce9d31eb 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -59,7 +59,7 @@ repository: metadataProperties: language: ${FDP_METADATA_LANGUAGE:http://id.loc.gov/vocabulary/iso639-1/en} - license: ${FDP_METADATA_LICENSE:http://rdflicense.appspot.com/rdflicense/cc-by-nc-nd3.0} + license: ${FDP_METADATA_LICENSE:http://purl.org/NET/rdflicense/cc-zero1.0} accessRightsDescription: ${FDP_METADATA_ACCESS_RIGHTS:This resource has no access restriction} openapi: diff --git a/src/main/resources/nl/dtls/fairdatapoint/database/mongo/migration/development/schema/data/shape-catalog.ttl b/src/main/resources/nl/dtls/fairdatapoint/database/mongo/migration/development/schema/data/shape-catalog.ttl index 516a3a59a..639adc07a 100644 --- a/src/main/resources/nl/dtls/fairdatapoint/database/mongo/migration/development/schema/data/shape-catalog.ttl +++ b/src/main/resources/nl/dtls/fairdatapoint/database/mongo/migration/development/schema/data/shape-catalog.ttl @@ -13,19 +13,23 @@ sh:datatype xsd:dateTime ; sh:maxCount 1 ; dash:viewer dash:LiteralViewer ; + sh:order 20 ; ], [ sh:path dct:modified ; sh:datatype xsd:dateTime ; sh:maxCount 1 ; dash:viewer dash:LiteralViewer ; + sh:order 21 ; ], [ sh:path foaf:homePage ; sh:nodeKind sh:IRI ; sh:maxCount 1 ; dash:editor dash:URIEditor ; dash:viewer dash:LabelViewer ; + sh:order 22 ; ], [ sh:path dcat:themeTaxonomy ; sh:nodeKind sh:IRI ; dash:viewer dash:LabelViewer ; + sh:order 23 ; ] . diff --git a/src/main/resources/nl/dtls/fairdatapoint/database/mongo/migration/development/schema/data/shape-data-service.ttl b/src/main/resources/nl/dtls/fairdatapoint/database/mongo/migration/development/schema/data/shape-data-service.ttl index e23084794..0a8f70e53 100644 --- a/src/main/resources/nl/dtls/fairdatapoint/database/mongo/migration/development/schema/data/shape-data-service.ttl +++ b/src/main/resources/nl/dtls/fairdatapoint/database/mongo/migration/development/schema/data/shape-data-service.ttl @@ -11,10 +11,12 @@ sh:path dcat:endpointURL ; sh:nodeKind sh:IRI ; sh:maxCount 1 ; + sh:order 20 ; ] , [ sh:path dcat:endpointDescription ; sh:nodeKind sh:Literal ; sh:maxCount 1 ; dash:editor dash:TextAreaEditor ; dash:viewer dash:LiteralViewer ; -] . + sh:order 21 ; + ] . diff --git a/src/main/resources/nl/dtls/fairdatapoint/database/mongo/migration/development/schema/data/shape-dataset.ttl b/src/main/resources/nl/dtls/fairdatapoint/database/mongo/migration/development/schema/data/shape-dataset.ttl index 55536b307..19b17fc81 100644 --- a/src/main/resources/nl/dtls/fairdatapoint/database/mongo/migration/development/schema/data/shape-dataset.ttl +++ b/src/main/resources/nl/dtls/fairdatapoint/database/mongo/migration/development/schema/data/shape-dataset.ttl @@ -13,33 +13,39 @@ sh:maxCount 1 ; dash:editor dash:DatePickerEditor ; dash:viewer dash:LiteralViewer ; + sh:order 20 ; ], [ sh:path dct:modified ; sh:datatype xsd:dateTime ; sh:maxCount 1 ; dash:editor dash:DatePickerEditor ; dash:viewer dash:LiteralViewer ; + sh:order 21 ; ], [ sh:path dcat:theme ; sh:nodeKind sh:IRI ; sh:minCount 1 ; dash:editor dash:URIEditor ; dash:viewer dash:LabelViewer ; + sh:order 22 ; ], [ sh:path dcat:contactPoint ; sh:nodeKind sh:IRI ; sh:maxCount 1 ; dash:editor dash:URIEditor ; dash:viewer dash:LabelViewer ; + sh:order 23 ; ], [ sh:path dcat:keyword ; sh:nodeKind sh:Literal ; dash:editor dash:TextFieldEditor ; dash:viewer dash:LiteralViewer ; + sh:order 24 ; ], [ sh:path dcat:landingPage ; sh:nodeKind sh:IRI ; sh:maxCount 1 ; dash:editor dash:URIEditor ; dash:viewer dash:LabelViewer ; + sh:order 25 ; ] . diff --git a/src/main/resources/nl/dtls/fairdatapoint/database/mongo/migration/development/schema/data/shape-distribution.ttl b/src/main/resources/nl/dtls/fairdatapoint/database/mongo/migration/development/schema/data/shape-distribution.ttl index 3cbd6a4b5..74b4c6cd9 100644 --- a/src/main/resources/nl/dtls/fairdatapoint/database/mongo/migration/development/schema/data/shape-distribution.ttl +++ b/src/main/resources/nl/dtls/fairdatapoint/database/mongo/migration/development/schema/data/shape-distribution.ttl @@ -13,39 +13,46 @@ sh:maxCount 1 ; dash:editor dash:DatePickerEditor ; dash:viewer dash:LiteralViewer ; - ] , [ + sh:order 20 ; + ], [ sh:path dct:modified ; sh:datatype xsd:dateTime ; sh:maxCount 1 ; dash:editor dash:DatePickerEditor ; dash:viewer dash:LiteralViewer ; - ] , [ + sh:order 21 ; + ], [ sh:path dcat:accessURL ; sh:nodeKind sh:IRI ; sh:maxCount 1 ; dash:editor dash:URIEditor ; - ] , [ + sh:order 22 ; + ], [ sh:path dcat:downloadURL ; sh:nodeKind sh:IRI ; sh:maxCount 1 ; dash:editor dash:URIEditor ; - ] , [ + sh:order 23 ; + ], [ sh:path dcat:mediaType ; sh:nodeKind sh:Literal ; sh:minCount 1 ; sh:maxCount 1 ; dash:editor dash:TextFieldEditor ; dash:viewer dash:LiteralViewer ; - ] , [ + sh:order 24 ; + ], [ sh:path dcat:format ; sh:nodeKind sh:Literal ; sh:maxCount 1 ; dash:editor dash:TextFieldEditor ; dash:viewer dash:LiteralViewer ; - ] , [ + sh:order 25 ; + ], [ sh:path dcat:byteSize ; sh:nodeKind sh:Literal ; sh:maxCount 1 ; dash:editor dash:TextFieldEditor ; dash:viewer dash:LiteralViewer ; + sh:order 26 ; ] . diff --git a/src/main/resources/nl/dtls/fairdatapoint/database/mongo/migration/development/schema/data/shape-fdp.ttl b/src/main/resources/nl/dtls/fairdatapoint/database/mongo/migration/development/schema/data/shape-fdp.ttl index 02acd7106..b5344e841 100644 --- a/src/main/resources/nl/dtls/fairdatapoint/database/mongo/migration/development/schema/data/shape-fdp.ttl +++ b/src/main/resources/nl/dtls/fairdatapoint/database/mongo/migration/development/schema/data/shape-fdp.ttl @@ -13,12 +13,14 @@ sh:maxCount 1 ; dash:editor dash:DatePickerEditor ; dash:viewer dash:LiteralViewer ; + sh:order 40 ; ] , [ sh:path fdp:endDate ; sh:datatype xsd:dateTime ; sh:maxCount 1 ; dash:editor dash:DatePickerEditor ; dash:viewer dash:LiteralViewer ; + sh:order 41 ; ] , [ sh:path fdp:uiLanguage ; sh:nodeKind sh:IRI ; @@ -26,22 +28,22 @@ sh:defaultValue ; dash:editor dash:URIEditor ; dash:viewer dash:LabelViewer ; + sh:order 42 ; ] , [ sh:path fdp:metadataIdentifier ; sh:nodeKind sh:IRI ; sh:maxCount 1 ; dash:editor dash:URIEditor ; dash:viewer dash:LabelViewer ; + sh:order 43 ; ] , [ sh:path fdp:metadataIssued ; sh:datatype xsd:dateTime ; sh:maxCount 1 ; - dash:editor dash:DatePickerEditor ; dash:viewer dash:LiteralViewer ; ] , [ sh:path fdp:metadataModified ; sh:datatype xsd:dateTime ; sh:maxCount 1 ; - dash:editor dash:DatePickerEditor ; dash:viewer dash:LiteralViewer ; ] . diff --git a/src/main/resources/nl/dtls/fairdatapoint/database/mongo/migration/development/schema/data/shape-resource.ttl b/src/main/resources/nl/dtls/fairdatapoint/database/mongo/migration/development/schema/data/shape-resource.ttl index bc54d66af..16100bac5 100644 --- a/src/main/resources/nl/dtls/fairdatapoint/database/mongo/migration/development/schema/data/shape-resource.ttl +++ b/src/main/resources/nl/dtls/fairdatapoint/database/mongo/migration/development/schema/data/shape-resource.ttl @@ -2,7 +2,7 @@ @prefix dash: . @prefix dcat: . @prefix dct: . -@prefix foaf: . +@prefix foaf: . @prefix sh: . @prefix xsd: . @@ -14,17 +14,20 @@ sh:minCount 1 ; sh:maxCount 1 ; dash:editor dash:TextFieldEditor ; + sh:order 1 ; ], [ sh:path dct:description ; sh:nodeKind sh:Literal ; sh:maxCount 1 ; dash:editor dash:TextAreaEditor ; + sh:order 2 ; ], [ sh:path dct:publisher ; sh:node :AgentShape ; sh:minCount 1 ; sh:maxCount 1 ; dash:editor dash:BlankNodeEditor ; + sh:order 3 ; ], [ sh:path dcat:version ; sh:name "version" ; @@ -33,32 +36,38 @@ sh:maxCount 1 ; dash:editor dash:TextFieldEditor ; dash:viewer dash:LiteralViewer ; + sh:order 4 ; ], [ sh:path dct:language ; sh:nodeKind sh:IRI ; sh:maxCount 1 ; dash:editor dash:URIEditor ; dash:viewer dash:LabelViewer ; + sh:defaultValue ; + sh:order 5 ; ], [ sh:path dct:license ; sh:nodeKind sh:IRI ; sh:maxCount 1 ; dash:editor dash:URIEditor ; dash:viewer dash:LabelViewer ; + sh:defaultValue ; + sh:order 6 ; ], [ sh:path dct:rights ; sh:nodeKind sh:IRI ; sh:maxCount 1 ; dash:editor dash:URIEditor ; dash:viewer dash:LabelViewer ; + sh:order 7 ; ] . :AgentShape a sh:NodeShape ; sh:targetClass foaf:Agent ; sh:property [ - sh:path foaf:name; + sh:path foaf:name ; sh:nodeKind sh:Literal ; sh:minCount 1 ; - sh:maxCount 1 ; + sh:maxCount 1 ; dash:editor dash:TextFieldEditor ; ] . diff --git a/src/main/resources/nl/dtls/fairdatapoint/database/mongo/migration/production/0016_shape-catalog.ttl b/src/main/resources/nl/dtls/fairdatapoint/database/mongo/migration/production/0016_shape-catalog.ttl new file mode 100644 index 000000000..639adc07a --- /dev/null +++ b/src/main/resources/nl/dtls/fairdatapoint/database/mongo/migration/production/0016_shape-catalog.ttl @@ -0,0 +1,35 @@ +@prefix : . +@prefix dash: . +@prefix dcat: . +@prefix dct: . +@prefix foaf: . +@prefix sh: . +@prefix xsd: . + +:CatalogShape a sh:NodeShape ; + sh:targetClass dcat:Catalog ; + sh:property [ + sh:path dct:issued ; + sh:datatype xsd:dateTime ; + sh:maxCount 1 ; + dash:viewer dash:LiteralViewer ; + sh:order 20 ; + ], [ + sh:path dct:modified ; + sh:datatype xsd:dateTime ; + sh:maxCount 1 ; + dash:viewer dash:LiteralViewer ; + sh:order 21 ; + ], [ + sh:path foaf:homePage ; + sh:nodeKind sh:IRI ; + sh:maxCount 1 ; + dash:editor dash:URIEditor ; + dash:viewer dash:LabelViewer ; + sh:order 22 ; + ], [ + sh:path dcat:themeTaxonomy ; + sh:nodeKind sh:IRI ; + dash:viewer dash:LabelViewer ; + sh:order 23 ; + ] . diff --git a/src/main/resources/nl/dtls/fairdatapoint/database/mongo/migration/production/0016_shape-data-service.ttl b/src/main/resources/nl/dtls/fairdatapoint/database/mongo/migration/production/0016_shape-data-service.ttl new file mode 100644 index 000000000..0a8f70e53 --- /dev/null +++ b/src/main/resources/nl/dtls/fairdatapoint/database/mongo/migration/production/0016_shape-data-service.ttl @@ -0,0 +1,22 @@ +@prefix : . +@prefix dash: . +@prefix dcat: . +@prefix dct: . +@prefix sh: . +@prefix xsd: . + +:DataServiceShape a sh:NodeShape ; + sh:targetClass dcat:DataService ; + sh:property [ + sh:path dcat:endpointURL ; + sh:nodeKind sh:IRI ; + sh:maxCount 1 ; + sh:order 20 ; + ] , [ + sh:path dcat:endpointDescription ; + sh:nodeKind sh:Literal ; + sh:maxCount 1 ; + dash:editor dash:TextAreaEditor ; + dash:viewer dash:LiteralViewer ; + sh:order 21 ; + ] . diff --git a/src/main/resources/nl/dtls/fairdatapoint/database/mongo/migration/production/0016_shape-dataset.ttl b/src/main/resources/nl/dtls/fairdatapoint/database/mongo/migration/production/0016_shape-dataset.ttl new file mode 100644 index 000000000..19b17fc81 --- /dev/null +++ b/src/main/resources/nl/dtls/fairdatapoint/database/mongo/migration/production/0016_shape-dataset.ttl @@ -0,0 +1,51 @@ +@prefix : . +@prefix dash: . +@prefix dcat: . +@prefix dct: . +@prefix sh: . +@prefix xsd: . + +:DatasetShape a sh:NodeShape ; + sh:targetClass dcat:Dataset ; + sh:property [ + sh:path dct:issued ; + sh:datatype xsd:dateTime ; + sh:maxCount 1 ; + dash:editor dash:DatePickerEditor ; + dash:viewer dash:LiteralViewer ; + sh:order 20 ; + ], [ + sh:path dct:modified ; + sh:datatype xsd:dateTime ; + sh:maxCount 1 ; + dash:editor dash:DatePickerEditor ; + dash:viewer dash:LiteralViewer ; + sh:order 21 ; + ], [ + sh:path dcat:theme ; + sh:nodeKind sh:IRI ; + sh:minCount 1 ; + dash:editor dash:URIEditor ; + dash:viewer dash:LabelViewer ; + sh:order 22 ; + ], [ + sh:path dcat:contactPoint ; + sh:nodeKind sh:IRI ; + sh:maxCount 1 ; + dash:editor dash:URIEditor ; + dash:viewer dash:LabelViewer ; + sh:order 23 ; + ], [ + sh:path dcat:keyword ; + sh:nodeKind sh:Literal ; + dash:editor dash:TextFieldEditor ; + dash:viewer dash:LiteralViewer ; + sh:order 24 ; + ], [ + sh:path dcat:landingPage ; + sh:nodeKind sh:IRI ; + sh:maxCount 1 ; + dash:editor dash:URIEditor ; + dash:viewer dash:LabelViewer ; + sh:order 25 ; + ] . diff --git a/src/main/resources/nl/dtls/fairdatapoint/database/mongo/migration/production/0016_shape-distribution.ttl b/src/main/resources/nl/dtls/fairdatapoint/database/mongo/migration/production/0016_shape-distribution.ttl new file mode 100644 index 000000000..74b4c6cd9 --- /dev/null +++ b/src/main/resources/nl/dtls/fairdatapoint/database/mongo/migration/production/0016_shape-distribution.ttl @@ -0,0 +1,58 @@ +@prefix : . +@prefix dash: . +@prefix dcat: . +@prefix dct: . +@prefix sh: . +@prefix xsd: . + +:DistributionShape a sh:NodeShape ; + sh:targetClass dcat:Distribution ; + sh:property [ + sh:path dct:issued ; + sh:datatype xsd:dateTime ; + sh:maxCount 1 ; + dash:editor dash:DatePickerEditor ; + dash:viewer dash:LiteralViewer ; + sh:order 20 ; + ], [ + sh:path dct:modified ; + sh:datatype xsd:dateTime ; + sh:maxCount 1 ; + dash:editor dash:DatePickerEditor ; + dash:viewer dash:LiteralViewer ; + sh:order 21 ; + ], [ + sh:path dcat:accessURL ; + sh:nodeKind sh:IRI ; + sh:maxCount 1 ; + dash:editor dash:URIEditor ; + sh:order 22 ; + ], [ + sh:path dcat:downloadURL ; + sh:nodeKind sh:IRI ; + sh:maxCount 1 ; + dash:editor dash:URIEditor ; + sh:order 23 ; + ], [ + sh:path dcat:mediaType ; + sh:nodeKind sh:Literal ; + sh:minCount 1 ; + sh:maxCount 1 ; + dash:editor dash:TextFieldEditor ; + dash:viewer dash:LiteralViewer ; + sh:order 24 ; + ], [ + sh:path dcat:format ; + sh:nodeKind sh:Literal ; + sh:maxCount 1 ; + dash:editor dash:TextFieldEditor ; + dash:viewer dash:LiteralViewer ; + sh:order 25 ; + ], [ + sh:path dcat:byteSize ; + sh:nodeKind sh:Literal ; + sh:maxCount 1 ; + dash:editor dash:TextFieldEditor ; + dash:viewer dash:LiteralViewer ; + sh:order 26 ; + ] . diff --git a/src/main/resources/nl/dtls/fairdatapoint/database/mongo/migration/production/0016_shape-fdp.ttl b/src/main/resources/nl/dtls/fairdatapoint/database/mongo/migration/production/0016_shape-fdp.ttl new file mode 100644 index 000000000..b5344e841 --- /dev/null +++ b/src/main/resources/nl/dtls/fairdatapoint/database/mongo/migration/production/0016_shape-fdp.ttl @@ -0,0 +1,49 @@ +@prefix : . +@prefix dash: . +@prefix dct: . +@prefix fdp: . +@prefix sh: . +@prefix xsd: . + +:FDPShape a sh:NodeShape ; + sh:targetClass fdp:FAIRDataPoint ; + sh:property [ + sh:path fdp:startDate ; + sh:datatype xsd:dateTime ; + sh:maxCount 1 ; + dash:editor dash:DatePickerEditor ; + dash:viewer dash:LiteralViewer ; + sh:order 40 ; + ] , [ + sh:path fdp:endDate ; + sh:datatype xsd:dateTime ; + sh:maxCount 1 ; + dash:editor dash:DatePickerEditor ; + dash:viewer dash:LiteralViewer ; + sh:order 41 ; + ] , [ + sh:path fdp:uiLanguage ; + sh:nodeKind sh:IRI ; + sh:maxCount 1 ; + sh:defaultValue ; + dash:editor dash:URIEditor ; + dash:viewer dash:LabelViewer ; + sh:order 42 ; + ] , [ + sh:path fdp:metadataIdentifier ; + sh:nodeKind sh:IRI ; + sh:maxCount 1 ; + dash:editor dash:URIEditor ; + dash:viewer dash:LabelViewer ; + sh:order 43 ; + ] , [ + sh:path fdp:metadataIssued ; + sh:datatype xsd:dateTime ; + sh:maxCount 1 ; + dash:viewer dash:LiteralViewer ; + ] , [ + sh:path fdp:metadataModified ; + sh:datatype xsd:dateTime ; + sh:maxCount 1 ; + dash:viewer dash:LiteralViewer ; + ] . diff --git a/src/main/resources/nl/dtls/fairdatapoint/database/mongo/migration/production/0016_shape-resource.ttl b/src/main/resources/nl/dtls/fairdatapoint/database/mongo/migration/production/0016_shape-resource.ttl new file mode 100644 index 000000000..16100bac5 --- /dev/null +++ b/src/main/resources/nl/dtls/fairdatapoint/database/mongo/migration/production/0016_shape-resource.ttl @@ -0,0 +1,73 @@ +@prefix : . +@prefix dash: . +@prefix dcat: . +@prefix dct: . +@prefix foaf: . +@prefix sh: . +@prefix xsd: . + +:ResourceShape a sh:NodeShape ; + sh:targetClass dcat:Resource ; + sh:property [ + sh:path dct:title ; + sh:nodeKind sh:Literal ; + sh:minCount 1 ; + sh:maxCount 1 ; + dash:editor dash:TextFieldEditor ; + sh:order 1 ; + ], [ + sh:path dct:description ; + sh:nodeKind sh:Literal ; + sh:maxCount 1 ; + dash:editor dash:TextAreaEditor ; + sh:order 2 ; + ], [ + sh:path dct:publisher ; + sh:node :AgentShape ; + sh:minCount 1 ; + sh:maxCount 1 ; + dash:editor dash:BlankNodeEditor ; + sh:order 3 ; + ], [ + sh:path dcat:version ; + sh:name "version" ; + sh:nodeKind sh:Literal ; + sh:minCount 1 ; + sh:maxCount 1 ; + dash:editor dash:TextFieldEditor ; + dash:viewer dash:LiteralViewer ; + sh:order 4 ; + ], [ + sh:path dct:language ; + sh:nodeKind sh:IRI ; + sh:maxCount 1 ; + dash:editor dash:URIEditor ; + dash:viewer dash:LabelViewer ; + sh:defaultValue ; + sh:order 5 ; + ], [ + sh:path dct:license ; + sh:nodeKind sh:IRI ; + sh:maxCount 1 ; + dash:editor dash:URIEditor ; + dash:viewer dash:LabelViewer ; + sh:defaultValue ; + sh:order 6 ; + ], [ + sh:path dct:rights ; + sh:nodeKind sh:IRI ; + sh:maxCount 1 ; + dash:editor dash:URIEditor ; + dash:viewer dash:LabelViewer ; + sh:order 7 ; + ] . + +:AgentShape a sh:NodeShape ; + sh:targetClass foaf:Agent ; + sh:property [ + sh:path foaf:name ; + sh:nodeKind sh:Literal ; + sh:minCount 1 ; + sh:maxCount 1 ; + dash:editor dash:TextFieldEditor ; + ] . diff --git a/src/main/resources/nl/dtls/fairdatapoint/service/reset/shape-catalog.ttl b/src/main/resources/nl/dtls/fairdatapoint/service/reset/shape-catalog.ttl index 516a3a59a..639adc07a 100644 --- a/src/main/resources/nl/dtls/fairdatapoint/service/reset/shape-catalog.ttl +++ b/src/main/resources/nl/dtls/fairdatapoint/service/reset/shape-catalog.ttl @@ -13,19 +13,23 @@ sh:datatype xsd:dateTime ; sh:maxCount 1 ; dash:viewer dash:LiteralViewer ; + sh:order 20 ; ], [ sh:path dct:modified ; sh:datatype xsd:dateTime ; sh:maxCount 1 ; dash:viewer dash:LiteralViewer ; + sh:order 21 ; ], [ sh:path foaf:homePage ; sh:nodeKind sh:IRI ; sh:maxCount 1 ; dash:editor dash:URIEditor ; dash:viewer dash:LabelViewer ; + sh:order 22 ; ], [ sh:path dcat:themeTaxonomy ; sh:nodeKind sh:IRI ; dash:viewer dash:LabelViewer ; + sh:order 23 ; ] . diff --git a/src/main/resources/nl/dtls/fairdatapoint/service/reset/shape-data-service.ttl b/src/main/resources/nl/dtls/fairdatapoint/service/reset/shape-data-service.ttl index 2ca91fa4a..0a8f70e53 100644 --- a/src/main/resources/nl/dtls/fairdatapoint/service/reset/shape-data-service.ttl +++ b/src/main/resources/nl/dtls/fairdatapoint/service/reset/shape-data-service.ttl @@ -11,10 +11,12 @@ sh:path dcat:endpointURL ; sh:nodeKind sh:IRI ; sh:maxCount 1 ; + sh:order 20 ; ] , [ sh:path dcat:endpointDescription ; sh:nodeKind sh:Literal ; sh:maxCount 1 ; dash:editor dash:TextAreaEditor ; dash:viewer dash:LiteralViewer ; + sh:order 21 ; ] . diff --git a/src/main/resources/nl/dtls/fairdatapoint/service/reset/shape-dataset.ttl b/src/main/resources/nl/dtls/fairdatapoint/service/reset/shape-dataset.ttl index 55536b307..19b17fc81 100644 --- a/src/main/resources/nl/dtls/fairdatapoint/service/reset/shape-dataset.ttl +++ b/src/main/resources/nl/dtls/fairdatapoint/service/reset/shape-dataset.ttl @@ -13,33 +13,39 @@ sh:maxCount 1 ; dash:editor dash:DatePickerEditor ; dash:viewer dash:LiteralViewer ; + sh:order 20 ; ], [ sh:path dct:modified ; sh:datatype xsd:dateTime ; sh:maxCount 1 ; dash:editor dash:DatePickerEditor ; dash:viewer dash:LiteralViewer ; + sh:order 21 ; ], [ sh:path dcat:theme ; sh:nodeKind sh:IRI ; sh:minCount 1 ; dash:editor dash:URIEditor ; dash:viewer dash:LabelViewer ; + sh:order 22 ; ], [ sh:path dcat:contactPoint ; sh:nodeKind sh:IRI ; sh:maxCount 1 ; dash:editor dash:URIEditor ; dash:viewer dash:LabelViewer ; + sh:order 23 ; ], [ sh:path dcat:keyword ; sh:nodeKind sh:Literal ; dash:editor dash:TextFieldEditor ; dash:viewer dash:LiteralViewer ; + sh:order 24 ; ], [ sh:path dcat:landingPage ; sh:nodeKind sh:IRI ; sh:maxCount 1 ; dash:editor dash:URIEditor ; dash:viewer dash:LabelViewer ; + sh:order 25 ; ] . diff --git a/src/main/resources/nl/dtls/fairdatapoint/service/reset/shape-distribution.ttl b/src/main/resources/nl/dtls/fairdatapoint/service/reset/shape-distribution.ttl index a48581820..74b4c6cd9 100644 --- a/src/main/resources/nl/dtls/fairdatapoint/service/reset/shape-distribution.ttl +++ b/src/main/resources/nl/dtls/fairdatapoint/service/reset/shape-distribution.ttl @@ -13,22 +13,26 @@ sh:maxCount 1 ; dash:editor dash:DatePickerEditor ; dash:viewer dash:LiteralViewer ; + sh:order 20 ; ], [ sh:path dct:modified ; sh:datatype xsd:dateTime ; sh:maxCount 1 ; dash:editor dash:DatePickerEditor ; dash:viewer dash:LiteralViewer ; + sh:order 21 ; ], [ sh:path dcat:accessURL ; sh:nodeKind sh:IRI ; sh:maxCount 1 ; dash:editor dash:URIEditor ; + sh:order 22 ; ], [ sh:path dcat:downloadURL ; sh:nodeKind sh:IRI ; sh:maxCount 1 ; dash:editor dash:URIEditor ; + sh:order 23 ; ], [ sh:path dcat:mediaType ; sh:nodeKind sh:Literal ; @@ -36,16 +40,19 @@ sh:maxCount 1 ; dash:editor dash:TextFieldEditor ; dash:viewer dash:LiteralViewer ; + sh:order 24 ; ], [ sh:path dcat:format ; sh:nodeKind sh:Literal ; sh:maxCount 1 ; dash:editor dash:TextFieldEditor ; dash:viewer dash:LiteralViewer ; + sh:order 25 ; ], [ sh:path dcat:byteSize ; sh:nodeKind sh:Literal ; sh:maxCount 1 ; dash:editor dash:TextFieldEditor ; dash:viewer dash:LiteralViewer ; + sh:order 26 ; ] . diff --git a/src/main/resources/nl/dtls/fairdatapoint/service/reset/shape-fdp.ttl b/src/main/resources/nl/dtls/fairdatapoint/service/reset/shape-fdp.ttl index 02acd7106..0590e1001 100644 --- a/src/main/resources/nl/dtls/fairdatapoint/service/reset/shape-fdp.ttl +++ b/src/main/resources/nl/dtls/fairdatapoint/service/reset/shape-fdp.ttl @@ -13,12 +13,14 @@ sh:maxCount 1 ; dash:editor dash:DatePickerEditor ; dash:viewer dash:LiteralViewer ; + sh:order 40 ; ] , [ sh:path fdp:endDate ; sh:datatype xsd:dateTime ; sh:maxCount 1 ; dash:editor dash:DatePickerEditor ; dash:viewer dash:LiteralViewer ; + sh:order 41 ; ] , [ sh:path fdp:uiLanguage ; sh:nodeKind sh:IRI ; @@ -26,22 +28,12 @@ sh:defaultValue ; dash:editor dash:URIEditor ; dash:viewer dash:LabelViewer ; + sh:order 42 ; ] , [ sh:path fdp:metadataIdentifier ; sh:nodeKind sh:IRI ; sh:maxCount 1 ; dash:editor dash:URIEditor ; dash:viewer dash:LabelViewer ; - ] , [ - sh:path fdp:metadataIssued ; - sh:datatype xsd:dateTime ; - sh:maxCount 1 ; - dash:editor dash:DatePickerEditor ; - dash:viewer dash:LiteralViewer ; - ] , [ - sh:path fdp:metadataModified ; - sh:datatype xsd:dateTime ; - sh:maxCount 1 ; - dash:editor dash:DatePickerEditor ; - dash:viewer dash:LiteralViewer ; + sh:order 43 ; ] . diff --git a/src/main/resources/nl/dtls/fairdatapoint/service/reset/shape-resource.ttl b/src/main/resources/nl/dtls/fairdatapoint/service/reset/shape-resource.ttl index e5f5df490..16100bac5 100644 --- a/src/main/resources/nl/dtls/fairdatapoint/service/reset/shape-resource.ttl +++ b/src/main/resources/nl/dtls/fairdatapoint/service/reset/shape-resource.ttl @@ -14,17 +14,20 @@ sh:minCount 1 ; sh:maxCount 1 ; dash:editor dash:TextFieldEditor ; + sh:order 1 ; ], [ sh:path dct:description ; sh:nodeKind sh:Literal ; sh:maxCount 1 ; dash:editor dash:TextAreaEditor ; + sh:order 2 ; ], [ sh:path dct:publisher ; sh:node :AgentShape ; sh:minCount 1 ; sh:maxCount 1 ; dash:editor dash:BlankNodeEditor ; + sh:order 3 ; ], [ sh:path dcat:version ; sh:name "version" ; @@ -33,24 +36,30 @@ sh:maxCount 1 ; dash:editor dash:TextFieldEditor ; dash:viewer dash:LiteralViewer ; + sh:order 4 ; ], [ sh:path dct:language ; sh:nodeKind sh:IRI ; sh:maxCount 1 ; dash:editor dash:URIEditor ; dash:viewer dash:LabelViewer ; + sh:defaultValue ; + sh:order 5 ; ], [ sh:path dct:license ; sh:nodeKind sh:IRI ; sh:maxCount 1 ; dash:editor dash:URIEditor ; dash:viewer dash:LabelViewer ; + sh:defaultValue ; + sh:order 6 ; ], [ sh:path dct:rights ; sh:nodeKind sh:IRI ; sh:maxCount 1 ; dash:editor dash:URIEditor ; dash:viewer dash:LabelViewer ; + sh:order 7 ; ] . :AgentShape a sh:NodeShape ;