From eb4f21c35fdf0b9b2d118d4e25c7d8443a48ecad Mon Sep 17 00:00:00 2001 From: Dominick Leppich Date: Wed, 11 Sep 2024 10:39:42 +0200 Subject: [PATCH] task: refactor samples --- install/.gitignore | 1 + install/demo.sh | 353 ------------------ install/install_samples.sh | 79 ++++ .../samples/books/1_languages/Deutsch.json | 4 + .../samples/books/1_languages/English.json | 4 + .../books/1_languages/Fran\303\247ais.json" | 4 + install/samples/books/2_types/Anything.json | 3 + install/samples/books/2_types/Hex_RGB.json | 4 + install/samples/books/2_types/Large_Text.json | 4 + install/samples/books/2_types/Number.json | 4 + install/samples/books/2_types/Yes_No.json | 6 + .../books/3_schemas/Colors_Schema.json | 38 ++ install/samples/books/3_schemas/Names.json | 29 ++ .../samples/books/4_vocabularies/Authors.json | 5 + .../samples/books/4_vocabularies/Colors.json | 4 + .../books/4_vocabularies/Locations.json | 5 + .../samples/books/5_schemas/Books_Schema.json | 82 ++++ .../samples/books/6_vocabularies/Books.json | 5 + install/samples/skos/1_languages/Deutsch.json | 4 + install/samples/skos/1_languages/English.json | 4 + .../skos/1_languages/Fran\303\247ais.json" | 4 + install/samples/skos/2_types/DCT_created.json | 4 + install/samples/skos/2_types/DCT_creator.json | 3 + install/samples/skos/2_types/DCT_license.json | 4 + install/samples/skos/2_types/DCT_title.json | 3 + .../samples/skos/2_types/SKOS_altLabel.json | 3 + .../samples/skos/2_types/SKOS_closeMatch.json | 4 + .../samples/skos/2_types/SKOS_definition.json | 3 + .../skos/2_types/SKOS_editorialNote.json | 3 + .../samples/skos/2_types/SKOS_exactMatch.json | 4 + .../samples/skos/2_types/SKOS_prefLabel.json | 3 + .../samples/skos/2_types/SKOS_related.json | 3 + install/samples/skos/3_schemas/SKOS_Data.json | 135 +++++++ .../samples/skos/3_schemas/SKOS_Metadata.json | 74 ++++ install/samples/skos/4_vocabularies/SKOS.json | 6 + 35 files changed, 545 insertions(+), 353 deletions(-) create mode 100644 install/.gitignore delete mode 100755 install/demo.sh create mode 100755 install/install_samples.sh create mode 100644 install/samples/books/1_languages/Deutsch.json create mode 100644 install/samples/books/1_languages/English.json create mode 100644 "install/samples/books/1_languages/Fran\303\247ais.json" create mode 100644 install/samples/books/2_types/Anything.json create mode 100644 install/samples/books/2_types/Hex_RGB.json create mode 100644 install/samples/books/2_types/Large_Text.json create mode 100644 install/samples/books/2_types/Number.json create mode 100644 install/samples/books/2_types/Yes_No.json create mode 100644 install/samples/books/3_schemas/Colors_Schema.json create mode 100644 install/samples/books/3_schemas/Names.json create mode 100644 install/samples/books/4_vocabularies/Authors.json create mode 100644 install/samples/books/4_vocabularies/Colors.json create mode 100644 install/samples/books/4_vocabularies/Locations.json create mode 100644 install/samples/books/5_schemas/Books_Schema.json create mode 100644 install/samples/books/6_vocabularies/Books.json create mode 100644 install/samples/skos/1_languages/Deutsch.json create mode 100644 install/samples/skos/1_languages/English.json create mode 100644 "install/samples/skos/1_languages/Fran\303\247ais.json" create mode 100644 install/samples/skos/2_types/DCT_created.json create mode 100644 install/samples/skos/2_types/DCT_creator.json create mode 100644 install/samples/skos/2_types/DCT_license.json create mode 100644 install/samples/skos/2_types/DCT_title.json create mode 100644 install/samples/skos/2_types/SKOS_altLabel.json create mode 100644 install/samples/skos/2_types/SKOS_closeMatch.json create mode 100644 install/samples/skos/2_types/SKOS_definition.json create mode 100644 install/samples/skos/2_types/SKOS_editorialNote.json create mode 100644 install/samples/skos/2_types/SKOS_exactMatch.json create mode 100644 install/samples/skos/2_types/SKOS_prefLabel.json create mode 100644 install/samples/skos/2_types/SKOS_related.json create mode 100644 install/samples/skos/3_schemas/SKOS_Data.json create mode 100644 install/samples/skos/3_schemas/SKOS_Metadata.json create mode 100644 install/samples/skos/4_vocabularies/SKOS.json diff --git a/install/.gitignore b/install/.gitignore new file mode 100644 index 0000000..3415572 --- /dev/null +++ b/install/.gitignore @@ -0,0 +1 @@ +/cache.txt \ No newline at end of file diff --git a/install/demo.sh b/install/demo.sh deleted file mode 100755 index b73b309..0000000 --- a/install/demo.sh +++ /dev/null @@ -1,353 +0,0 @@ -#!/usr/bin/env bash -METADATA_ID=$(curl --location 'localhost:8081/api/v1/schemas' \ ---header 'Content-Type: application/json' \ ---data '{ - "definitions": [ - { - "name": "Title", - "typeId": 12, - "required": true, - "unique": false, - "mainEntry": true, - "titleField": true, - "translationDefinitions": [ - { - "language": "eng", - "fallback": true, - "required": true - }, - { - "language": "ger", - "fallback": false, - "required": false - }, - { - "language": "fre", - "fallback": false, - "required": false - } - ] - }, - { - "name": "Author", - "typeId": 13, - "required": false, - "unique": false, - "mainEntry": false, - "titleField": false, - "multiValued": true, - "translationDefinitions": [ - { - "language": "eng", - "fallback": true, - "required": true - }, - { - "language": "ger", - "fallback": false, - "required": false - }, - { - "language": "fre", - "fallback": false, - "required": false - } - ] - }, - { - "name": "Creation Date", - "typeId": 14, - "required": true, - "unique": false, - "mainEntry": false, - "titleField": false - }, - { - "name": "License", - "typeId": 15, - "required": false, - "unique": false, - "mainEntry": false, - "titleField": false, - "multiValued": true - } - ], - "hierarchicalRecords": false, - "singleRootElement": true -}' | jq ".id") -SKOS_ID=$(curl --location 'localhost:8081/api/v1/schemas' \ ---header 'Content-Type: application/json' \ ---data '{ - "definitions": [ - { - "name": "Label", - "typeId": 6, - "required": true, - "unique": false, - "mainEntry": true, - "titleField": true, - "translationDefinitions": [ - { - "language": "eng", - "fallback": true, - "required": true - }, - { - "language": "ger", - "fallback": false, - "required": false - }, - { - "language": "fre", - "fallback": false, - "required": false - } - ] - }, - { - "name": "Alternative Label", - "typeId": 7, - "required": false, - "unique": false, - "mainEntry": false, - "titleField": false, - "multiValued": true, - "translationDefinitions": [ - { - "language": "eng", - "fallback": true, - "required": true - }, - { - "language": "ger", - "fallback": false, - "required": false - }, - { - "language": "fre", - "fallback": false, - "required": false - } - ] - }, - { - "name": "Definition", - "typeId": 8, - "required": false, - "unique": false, - "mainEntry": false, - "titleField": false, - "multiValued": true, - "translationDefinitions": [ - { - "language": "eng", - "fallback": true, - "required": true - }, - { - "language": "ger", - "fallback": false, - "required": false - }, - { - "language": "fre", - "fallback": false, - "required": false - } - ] - }, - { - "name": "Editorial Note", - "typeId": 9, - "required": false, - "unique": false, - "mainEntry": false, - "titleField": false, - "multiValued": true, - "translationDefinitions": [ - { - "language": "eng", - "fallback": true, - "required": true - }, - { - "language": "ger", - "fallback": false, - "required": false - }, - { - "language": "fre", - "fallback": false, - "required": false - } - ] - }, - { - "name": "Related", - "typeId": 10, - "required": false, - "unique": false, - "mainEntry": false, - "titleField": false, - "multiValued": true - }, - { - "name": "Close Match", - "typeId": 11, - "required": false, - "unique": false, - "mainEntry": false, - "titleField": false, - "multiValued": true - }, - { - "name": "Exact Match", - "typeId": 12, - "required": false, - "unique": false, - "mainEntry": false, - "titleField": false, - "multiValued": true - } - ], - "hierarchicalRecords": true -}' | jq ".id") -curl --location 'localhost:8081/api/v1/vocabularies' \ ---header 'Content-Type: application/json' \ ---data "{ - \"schemaId\": $SKOS_ID, - \"metadataSchemaId\": $METADATA_ID, - \"name\": \"SKOS\", - \"description\": \"SKOS example vocabulary.\" -}" -RATING_ID=$(curl --location 'localhost:8081/api/v1/types' \ ---header 'Content-Type: application/json' \ ---data '{ - "name": "Rating", - "validation": "\\d+", - "selectableValues": [ - "1", "2", "3", "4", "5" - ] -}' | jq ".id") -MOVIE_SCHEMA_ID=$(curl --location 'localhost:8081/api/v1/schemas' \ ---header 'Content-Type: application/json' \ ---data "{ - \"definitions\": [ - { - \"name\": \"Name\", - \"typeId\": 5, - \"required\": true, - \"unique\": true, - \"mainEntry\": true, - \"titleField\": true - }, - { - \"name\": \"Description\", - \"typeId\": 1, - \"required\": false, - \"unique\": false, - \"mainEntry\": false, - \"titleField\": false, - \"translationDefinitions\": [ - { - \"language\": \"eng\", - \"fallback\": true, - \"required\": true - }, - { - \"language\": \"ger\", - \"fallback\": false, - \"required\": true - } - ] - }, - { - \"name\": \"Rating\", - \"typeId\": $RATING_ID, - \"required\": false, - \"unique\": false, - \"mainEntry\": false, - \"titleField\": false - } - ], - \"hierarchicalRecords\": true -}" | jq ".id") -MOVIE_VOCAB_ID=$(curl --location 'localhost:8081/api/v1/vocabularies' \ ---header 'Content-Type: application/json' \ ---data "{ - \"schemaId\": $MOVIE_SCHEMA_ID, - \"name\": \"MovieDB\", - \"description\": \"Personal movie database.\" -}" | jq ".id") -HOBBY_SCHEMA_ID=$(curl --location 'localhost:8081/api/v1/schemas' \ ---header 'Content-Type: application/json' \ ---data '{ - "definitions": [ - { - "name": "Description", - "typeId": 1, - "required": true, - "unique": true, - "mainEntry": true, - "titleField": true, - "translationDefinitions": [ - { - "language": "eng", - "fallback": true, - "required": true - }, - { - "language": "ger", - "fallback": false, - "required": false - } - ] - } - ], - "hierarchicalRecords": false -}' | jq ".id") -HOBBY_VOCAB_ID=$(curl --location 'localhost:8081/api/v1/vocabularies' \ ---header 'Content-Type: application/json' \ ---data "{ - \"schemaId\": $HOBBY_SCHEMA_ID, - \"name\": \"Hobbies\", - \"description\": \"Collection of typical hobbies.\" -}" | jq ".id") -FACEBOOK_ID=$(curl --location 'localhost:8081/api/v1/schemas' \ ---header 'Content-Type: application/json' \ ---data "{ - \"definitions\": [ - { - \"name\": \"Full Name\", - \"typeId\": 1, - \"required\": true, - \"unique\": true, - \"mainEntry\": true, - \"titleField\": true - }, - { - \"name\": \"Favorite Movie\", - \"referenceVocabularyId\": $MOVIE_VOCAB_ID, - \"required\": true, - \"unique\": false, - \"mainEntry\": false, - \"titleField\": true - }, - { - \"name\": \"Hobbies\", - \"referenceVocabularyId\": $HOBBY_VOCAB_ID, - \"required\": false, - \"unique\": false, - \"mainEntry\": false, - \"titleField\": false, - \"multiValued\": true - } - ] -}" | jq ".id") -curl --location 'localhost:8081/api/v1/vocabularies' \ ---header 'Content-Type: application/json' \ ---data "{ - \"schemaId\": $FACEBOOK_ID, - \"name\": \"Facebook\", - \"description\": \"My best friends with their favorite movies.\" -}" diff --git a/install/install_samples.sh b/install/install_samples.sh new file mode 100755 index 0000000..1ec2674 --- /dev/null +++ b/install/install_samples.sh @@ -0,0 +1,79 @@ +#!/usr/bin/env bash +MY_PATH="$(dirname -- "${BASH_SOURCE[0]}")" +SAMPLES_DIR=$MY_PATH/samples +CACHE_FILE=$MY_PATH/cache.txt + +# Check for parameters +FAIL=0 +if [ -z $HOST ]; then + echo "Missing \"HOST\" parameter!" + FAIL=1 +fi +if [ -z $PORT ]; then + echo "Missing \"PORT\" parameter!" + FAIL=1 +fi +if [ -z $TOKEN ]; then + echo "Missing \"TOKEN\" parameter!" + FAIL=1 +fi +if [ $FAIL == "1" ]; then + echo "Please call this script like the following way (sample call):" + echo "$ HOST=localhost PORT=8081 TOKEN=yoursecrettoken $MY_PATH/install_samples.sh" + exit 1 +fi + +SAMPLE=$1 +if [ -z $SAMPLE ]; then + echo "Please chose a sample to install:" + ls $SAMPLES_DIR + read SAMPLE +fi +SAMPLE_PATH=$SAMPLES_DIR/$SAMPLE +if [ ! -e $SAMPLE_PATH ]; then + echo "Sample \"$SAMPLE\" does not exist!" + exit 1 +fi + +curl_call() { + curl --location "$HOST:$PORT/api/v1/$1" \ + --header 'Content-Type: application/json' \ + --header "Authorization: Bearer $TOKEN" \ + --fail \ + --silent \ + --data "$2" +} + +for INSTALL_DIR in $(ls $SAMPLE_PATH); do + ENDPOINT=$(echo $INSTALL_DIR | cut -d'_' -f2) + echo "Installing $ENDPOINT" + for ITEM in $(ls $SAMPLE_PATH/$INSTALL_DIR | grep ".json"); do + ITEM_NAME=$(echo "$ITEM" | cut -d'.' -f1) + ITEM_IDENTIFIER=${ENDPOINT}_"${ITEM_NAME}" + + ID=$(cat $CACHE_FILE | grep $ITEM_IDENTIFIER | cut -d';' -f2) + if [ -z $ID ]; then + JSON=$(cat $SAMPLE_PATH/$INSTALL_DIR/$ITEM) + + # Replace ID placeholders + for CACHE_LINE in $(cat $CACHE_FILE); do + TEMPLATE_PLACEHOLDER="{{$(echo $CACHE_LINE | cut -d';' -f1)}}" + CACHE_ID=$(echo $CACHE_LINE | cut -d';' -f2) + JSON=$(echo $JSON | sed "s/$TEMPLATE_PLACEHOLDER/$CACHE_ID/g") + done + + RESULT=$(curl_call $ENDPOINT "$JSON") + + if [ -z "$RESULT" ]; then + echo "Error during creation, exiting!" + echo $JSON + exit 2 + fi + ID=$(echo $RESULT | jq ".id") + echo "$ITEM_IDENTIFIER;$ID" >> $CACHE_FILE + echo -e "\tInstalled $ITEM_NAME with ID $ID" + else + echo -e "\tSkipping $ITEM_NAME, already present with ID $ID" + fi + done +done diff --git a/install/samples/books/1_languages/Deutsch.json b/install/samples/books/1_languages/Deutsch.json new file mode 100644 index 0000000..5a2cdbb --- /dev/null +++ b/install/samples/books/1_languages/Deutsch.json @@ -0,0 +1,4 @@ +{ + "abbreviation": "ger", + "name": "Deutsch" +} \ No newline at end of file diff --git a/install/samples/books/1_languages/English.json b/install/samples/books/1_languages/English.json new file mode 100644 index 0000000..34fc8a6 --- /dev/null +++ b/install/samples/books/1_languages/English.json @@ -0,0 +1,4 @@ +{ + "abbreviation": "eng", + "name": "English" +} \ No newline at end of file diff --git "a/install/samples/books/1_languages/Fran\303\247ais.json" "b/install/samples/books/1_languages/Fran\303\247ais.json" new file mode 100644 index 0000000..e796791 --- /dev/null +++ "b/install/samples/books/1_languages/Fran\303\247ais.json" @@ -0,0 +1,4 @@ +{ + "abbreviation": "fre", + "name": "Français" +} \ No newline at end of file diff --git a/install/samples/books/2_types/Anything.json b/install/samples/books/2_types/Anything.json new file mode 100644 index 0000000..ea7aa0f --- /dev/null +++ b/install/samples/books/2_types/Anything.json @@ -0,0 +1,3 @@ +{ + "name": "Anything" +} \ No newline at end of file diff --git a/install/samples/books/2_types/Hex_RGB.json b/install/samples/books/2_types/Hex_RGB.json new file mode 100644 index 0000000..6fc9e42 --- /dev/null +++ b/install/samples/books/2_types/Hex_RGB.json @@ -0,0 +1,4 @@ +{ + "name": "Hex RGB", + "validation": "#[0-9A-Fa-f]{6}" +} \ No newline at end of file diff --git a/install/samples/books/2_types/Large_Text.json b/install/samples/books/2_types/Large_Text.json new file mode 100644 index 0000000..9ba35bd --- /dev/null +++ b/install/samples/books/2_types/Large_Text.json @@ -0,0 +1,4 @@ +{ + "name": "Large Text", + "large": true +} \ No newline at end of file diff --git a/install/samples/books/2_types/Number.json b/install/samples/books/2_types/Number.json new file mode 100644 index 0000000..9390686 --- /dev/null +++ b/install/samples/books/2_types/Number.json @@ -0,0 +1,4 @@ +{ + "name": "Number", + "validation": "\\d+" +} \ No newline at end of file diff --git a/install/samples/books/2_types/Yes_No.json b/install/samples/books/2_types/Yes_No.json new file mode 100644 index 0000000..d051ec3 --- /dev/null +++ b/install/samples/books/2_types/Yes_No.json @@ -0,0 +1,6 @@ +{ + "name": "Ja/Nein", + "selectableValues": [ + "Ja", "Nein" + ] +} \ No newline at end of file diff --git a/install/samples/books/3_schemas/Colors_Schema.json b/install/samples/books/3_schemas/Colors_Schema.json new file mode 100644 index 0000000..37cd558 --- /dev/null +++ b/install/samples/books/3_schemas/Colors_Schema.json @@ -0,0 +1,38 @@ +{ + "definitions": [ + { + "name": "Name", + "typeId": {{types_Anything}}, + "required": true, + "unique": true, + "mainEntry": true, + "titleField": true, + "translationDefinitions": [ + { + "language": "ger", + "fallback": true, + "required": true + }, + { + "language": "eng", + "fallback": false, + "required": false + }, + { + "language": "fre", + "fallback": false, + "required": false + } + ] + }, + { + "name": "Color Code", + "typeId": {{types_Hex_RGB}}, + "required": false, + "unique": true, + "mainEntry": false, + "titleField": false, + "multiValued": false + } + ] +} \ No newline at end of file diff --git a/install/samples/books/3_schemas/Names.json b/install/samples/books/3_schemas/Names.json new file mode 100644 index 0000000..0379408 --- /dev/null +++ b/install/samples/books/3_schemas/Names.json @@ -0,0 +1,29 @@ +{ + "definitions": [ + { + "name": "Name", + "typeId": {{types_Anything}}, + "required": true, + "unique": true, + "mainEntry": true, + "titleField": true, + "translationDefinitions": [ + { + "language": "ger", + "fallback": true, + "required": true + }, + { + "language": "eng", + "fallback": false, + "required": false + }, + { + "language": "fre", + "fallback": false, + "required": false + } + ] + } + ] +} \ No newline at end of file diff --git a/install/samples/books/4_vocabularies/Authors.json b/install/samples/books/4_vocabularies/Authors.json new file mode 100644 index 0000000..926b63f --- /dev/null +++ b/install/samples/books/4_vocabularies/Authors.json @@ -0,0 +1,5 @@ +{ + "schemaId": {{schemas_Names}}, + "name": "Autoren", + "description": "Liste aller bekannter Autoren." +} \ No newline at end of file diff --git a/install/samples/books/4_vocabularies/Colors.json b/install/samples/books/4_vocabularies/Colors.json new file mode 100644 index 0000000..b52b702 --- /dev/null +++ b/install/samples/books/4_vocabularies/Colors.json @@ -0,0 +1,4 @@ +{ + "schemaId": {{schemas_Colors_Schema}}, + "name": "Farben" +} \ No newline at end of file diff --git a/install/samples/books/4_vocabularies/Locations.json b/install/samples/books/4_vocabularies/Locations.json new file mode 100644 index 0000000..3e6b1f9 --- /dev/null +++ b/install/samples/books/4_vocabularies/Locations.json @@ -0,0 +1,5 @@ +{ + "schemaId": {{schemas_Names}}, + "name": "Standorte", + "description": "Liste aller Standorte an denen Bücher verwaltet werden." +} \ No newline at end of file diff --git a/install/samples/books/5_schemas/Books_Schema.json b/install/samples/books/5_schemas/Books_Schema.json new file mode 100644 index 0000000..f34770f --- /dev/null +++ b/install/samples/books/5_schemas/Books_Schema.json @@ -0,0 +1,82 @@ +{ + "definitions": [ + { + "name": "Buch-ID", + "typeId": {{types_Number}}, + "required": true, + "unique": true, + "mainEntry": true, + "titleField": false + }, + { + "name": "Name", + "typeId": {{types_Anything}}, + "required": true, + "unique": true, + "mainEntry": false, + "titleField": true, + "translationDefinitions": [ + { + "language": "ger", + "fallback": true, + "required": true + }, + { + "language": "eng", + "fallback": false, + "required": false + }, + { + "language": "fre", + "fallback": false, + "required": false + } + ] + }, + { + "name": "Autoren", + "referenceVocabularyId": {{vocabularies_Authors}}, + "required": false, + "unique": false, + "mainEntry": false, + "titleField": false, + "multiValued": true + }, + { + "name": "Buchfarbe", + "referenceVocabularyId": {{vocabularies_Colors}}, + "required": true, + "unique": false, + "mainEntry": false, + "titleField": true, + "multiValued": false + }, + { + "name": "Standort", + "referenceVocabularyId": {{vocabularies_Locations}}, + "required": true, + "unique": false, + "mainEntry": false, + "titleField": true, + "multiValued": false + }, + { + "name": "Beschreibung", + "typeId": {{types_Large_Text}}, + "required": false, + "unique": false, + "mainEntry": false, + "titleField": false, + "multiValued": false + }, + { + "name": "Ausgeliehen", + "typeId": {{types_Yes_No}}, + "required": true, + "unique": false, + "mainEntry": false, + "titleField": false, + "multiValued": false + } + ] +} \ No newline at end of file diff --git a/install/samples/books/6_vocabularies/Books.json b/install/samples/books/6_vocabularies/Books.json new file mode 100644 index 0000000..4bf92f0 --- /dev/null +++ b/install/samples/books/6_vocabularies/Books.json @@ -0,0 +1,5 @@ +{ + "schemaId": {{schemas_Books_Schema}}, + "name": "Bücher", + "description": "Buchdatenbank." +} \ No newline at end of file diff --git a/install/samples/skos/1_languages/Deutsch.json b/install/samples/skos/1_languages/Deutsch.json new file mode 100644 index 0000000..5a2cdbb --- /dev/null +++ b/install/samples/skos/1_languages/Deutsch.json @@ -0,0 +1,4 @@ +{ + "abbreviation": "ger", + "name": "Deutsch" +} \ No newline at end of file diff --git a/install/samples/skos/1_languages/English.json b/install/samples/skos/1_languages/English.json new file mode 100644 index 0000000..34fc8a6 --- /dev/null +++ b/install/samples/skos/1_languages/English.json @@ -0,0 +1,4 @@ +{ + "abbreviation": "eng", + "name": "English" +} \ No newline at end of file diff --git "a/install/samples/skos/1_languages/Fran\303\247ais.json" "b/install/samples/skos/1_languages/Fran\303\247ais.json" new file mode 100644 index 0000000..e796791 --- /dev/null +++ "b/install/samples/skos/1_languages/Fran\303\247ais.json" @@ -0,0 +1,4 @@ +{ + "abbreviation": "fre", + "name": "Français" +} \ No newline at end of file diff --git a/install/samples/skos/2_types/DCT_created.json b/install/samples/skos/2_types/DCT_created.json new file mode 100644 index 0000000..0229cdb --- /dev/null +++ b/install/samples/skos/2_types/DCT_created.json @@ -0,0 +1,4 @@ +{ + "name": "dct:created", + "validation": "\\d{4}\\-\\d{2}\\-\\d{2}" +} \ No newline at end of file diff --git a/install/samples/skos/2_types/DCT_creator.json b/install/samples/skos/2_types/DCT_creator.json new file mode 100644 index 0000000..9d3fad4 --- /dev/null +++ b/install/samples/skos/2_types/DCT_creator.json @@ -0,0 +1,3 @@ +{ + "name": "dct:creator" +} \ No newline at end of file diff --git a/install/samples/skos/2_types/DCT_license.json b/install/samples/skos/2_types/DCT_license.json new file mode 100644 index 0000000..41f0638 --- /dev/null +++ b/install/samples/skos/2_types/DCT_license.json @@ -0,0 +1,4 @@ +{ + "name": "dct:license", + "validation": "https?.*" +} \ No newline at end of file diff --git a/install/samples/skos/2_types/DCT_title.json b/install/samples/skos/2_types/DCT_title.json new file mode 100644 index 0000000..23ac34a --- /dev/null +++ b/install/samples/skos/2_types/DCT_title.json @@ -0,0 +1,3 @@ +{ + "name": "dct:title" +} \ No newline at end of file diff --git a/install/samples/skos/2_types/SKOS_altLabel.json b/install/samples/skos/2_types/SKOS_altLabel.json new file mode 100644 index 0000000..1d7cadc --- /dev/null +++ b/install/samples/skos/2_types/SKOS_altLabel.json @@ -0,0 +1,3 @@ +{ + "name": "skos:altLabel" +} \ No newline at end of file diff --git a/install/samples/skos/2_types/SKOS_closeMatch.json b/install/samples/skos/2_types/SKOS_closeMatch.json new file mode 100644 index 0000000..da55e56 --- /dev/null +++ b/install/samples/skos/2_types/SKOS_closeMatch.json @@ -0,0 +1,4 @@ +{ + "name": "skos:closeMatch", + "validation": "https?.*" +} \ No newline at end of file diff --git a/install/samples/skos/2_types/SKOS_definition.json b/install/samples/skos/2_types/SKOS_definition.json new file mode 100644 index 0000000..e48d92e --- /dev/null +++ b/install/samples/skos/2_types/SKOS_definition.json @@ -0,0 +1,3 @@ +{ + "name": "skos:definition" +} \ No newline at end of file diff --git a/install/samples/skos/2_types/SKOS_editorialNote.json b/install/samples/skos/2_types/SKOS_editorialNote.json new file mode 100644 index 0000000..600a3b3 --- /dev/null +++ b/install/samples/skos/2_types/SKOS_editorialNote.json @@ -0,0 +1,3 @@ +{ + "name": "skos:editorialNote" +} \ No newline at end of file diff --git a/install/samples/skos/2_types/SKOS_exactMatch.json b/install/samples/skos/2_types/SKOS_exactMatch.json new file mode 100644 index 0000000..4419c76 --- /dev/null +++ b/install/samples/skos/2_types/SKOS_exactMatch.json @@ -0,0 +1,4 @@ +{ + "name": "skos:exactMatch", + "validation": "https?.*" +} \ No newline at end of file diff --git a/install/samples/skos/2_types/SKOS_prefLabel.json b/install/samples/skos/2_types/SKOS_prefLabel.json new file mode 100644 index 0000000..8b52ed0 --- /dev/null +++ b/install/samples/skos/2_types/SKOS_prefLabel.json @@ -0,0 +1,3 @@ +{ + "name": "skos:prefLabel" +} \ No newline at end of file diff --git a/install/samples/skos/2_types/SKOS_related.json b/install/samples/skos/2_types/SKOS_related.json new file mode 100644 index 0000000..14c1af3 --- /dev/null +++ b/install/samples/skos/2_types/SKOS_related.json @@ -0,0 +1,3 @@ +{ + "name": "skos:related" +} \ No newline at end of file diff --git a/install/samples/skos/3_schemas/SKOS_Data.json b/install/samples/skos/3_schemas/SKOS_Data.json new file mode 100644 index 0000000..73af94d --- /dev/null +++ b/install/samples/skos/3_schemas/SKOS_Data.json @@ -0,0 +1,135 @@ +{ + "definitions": [ + { + "name": "Label", + "typeId": {{types_SKOS_prefLabel}}, + "required": true, + "unique": false, + "mainEntry": true, + "titleField": true, + "translationDefinitions": [ + { + "language": "eng", + "fallback": true, + "required": true + }, + { + "language": "ger", + "fallback": false, + "required": false + }, + { + "language": "fre", + "fallback": false, + "required": false + } + ] + }, + { + "name": "Alternative Label", + "typeId": {{types_SKOS_altLabel}}, + "required": false, + "unique": false, + "mainEntry": false, + "titleField": false, + "multiValued": true, + "translationDefinitions": [ + { + "language": "eng", + "fallback": true, + "required": true + }, + { + "language": "ger", + "fallback": false, + "required": false + }, + { + "language": "fre", + "fallback": false, + "required": false + } + ] + }, + { + "name": "Definition", + "typeId": {{types_SKOS_definition}}, + "required": false, + "unique": false, + "mainEntry": false, + "titleField": false, + "multiValued": true, + "translationDefinitions": [ + { + "language": "eng", + "fallback": true, + "required": true + }, + { + "language": "ger", + "fallback": false, + "required": false + }, + { + "language": "fre", + "fallback": false, + "required": false + } + ] + }, + { + "name": "Editorial Note", + "typeId": {{types_SKOS_editorialNote}}, + "required": false, + "unique": false, + "mainEntry": false, + "titleField": false, + "multiValued": true, + "translationDefinitions": [ + { + "language": "eng", + "fallback": true, + "required": true + }, + { + "language": "ger", + "fallback": false, + "required": false + }, + { + "language": "fre", + "fallback": false, + "required": false + } + ] + }, + { + "name": "Related", + "typeId": {{types_SKOS_related}}, + "required": false, + "unique": false, + "mainEntry": false, + "titleField": false, + "multiValued": true + }, + { + "name": "Close Match", + "typeId": {{types_SKOS_closeMatch}}, + "required": false, + "unique": false, + "mainEntry": false, + "titleField": false, + "multiValued": true + }, + { + "name": "Exact Match", + "typeId": {{types_SKOS_exactMatch}}, + "required": false, + "unique": false, + "mainEntry": false, + "titleField": false, + "multiValued": true + } + ], + "hierarchicalRecords": true +} \ No newline at end of file diff --git a/install/samples/skos/3_schemas/SKOS_Metadata.json b/install/samples/skos/3_schemas/SKOS_Metadata.json new file mode 100644 index 0000000..45d49bd --- /dev/null +++ b/install/samples/skos/3_schemas/SKOS_Metadata.json @@ -0,0 +1,74 @@ +{ + "definitions": [ + { + "name": "Title", + "typeId": {{types_DCT_title}}, + "required": true, + "unique": false, + "mainEntry": true, + "titleField": true, + "translationDefinitions": [ + { + "language": "eng", + "fallback": true, + "required": true + }, + { + "language": "ger", + "fallback": false, + "required": false + }, + { + "language": "fre", + "fallback": false, + "required": false + } + ] + }, + { + "name": "Author", + "typeId": {{types_DCT_creator}}, + "required": false, + "unique": false, + "mainEntry": false, + "titleField": false, + "multiValued": true, + "translationDefinitions": [ + { + "language": "eng", + "fallback": true, + "required": true + }, + { + "language": "ger", + "fallback": false, + "required": false + }, + { + "language": "fre", + "fallback": false, + "required": false + } + ] + }, + { + "name": "Creation Date", + "typeId": {{types_DCT_created}}, + "required": true, + "unique": false, + "mainEntry": false, + "titleField": false + }, + { + "name": "License", + "typeId": {{types_DCT_license}}, + "required": false, + "unique": false, + "mainEntry": false, + "titleField": false, + "multiValued": true + } + ], + "hierarchicalRecords": false, + "singleRootElement": true +} \ No newline at end of file diff --git a/install/samples/skos/4_vocabularies/SKOS.json b/install/samples/skos/4_vocabularies/SKOS.json new file mode 100644 index 0000000..09e2b18 --- /dev/null +++ b/install/samples/skos/4_vocabularies/SKOS.json @@ -0,0 +1,6 @@ +{ + "schemaId": {{schemas_SKOS_Data}}, + "metadataSchemaId": {{schemas_SKOS_Metadata}}, + "name": "SKOS", + "description": "SKOS example vocabulary." +} \ No newline at end of file