From 40fb15d51f2cfce7ade343d8c7c8979533d0b6a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Kleinb=C3=B6lting?= Date: Tue, 3 Sep 2024 10:20:28 +0200 Subject: [PATCH] merge crates --- dsp-meta/CHANGELOG.md => CHANGELOG.md | 0 Cargo.lock | 482 ++++++------ Cargo.toml | 29 +- Dockerfile | 2 +- benches/rdf_bench.rs | 14 - example_output_formats/dokubib.json | 154 ---- example_output_formats/hdm.json | 180 ----- example_output_formats/hdm.jsonld | 468 ------------ example_output_formats/hdm.ttl | 84 --- example_output_formats/hdm.xml | 137 ---- example_output_formats/incunabula.json | 240 ------ justfile | 6 +- .../schema-metadata-draft.json | 0 .../schema-metadata-final.json | 0 serde-rdf/Cargo.toml | 27 - serde-rdf/examples/deserialize.rs | 56 -- serde-rdf/examples/serialize.rs | 71 -- serde-rdf/src/de.rs | 274 ------- serde-rdf/src/error.rs | 64 -- serde-rdf/src/lib.rs | 13 - serde-rdf/src/ser.rs | 704 ------------------ serde-rdf/src/structure.rs | 46 -- {dsp-meta/src => src}/api/convert/axum/mod.rs | 0 .../src => src}/api/convert/axum/responses.rs | 0 {dsp-meta/src => src}/api/convert/mod.rs | 0 {dsp-meta/src => src}/api/handler/health.rs | 0 {dsp-meta/src => src}/api/handler/mod.rs | 0 .../src => src}/api/handler/robots_txt.rs | 0 .../src => src}/api/handler/sitemap_xml.rs | 0 {dsp-meta/src => src}/api/handler/v1/mod.rs | 0 .../api/handler/v1/projects/handlers.rs | 0 .../api/handler/v1/projects/mod.rs | 0 .../api/handler/v1/projects/responses.rs | 0 {dsp-meta/src => src}/api/mod.rs | 0 {dsp-meta/src => src}/api/router.rs | 4 +- {dsp-meta/src => src}/app_state.rs | 0 {dsp-meta-cmd/src => src}/cli.rs | 0 .../src => src}/domain/metadata_repository.rs | 2 +- .../src => src}/domain/metadata_service.rs | 0 {dsp-meta/src => src}/domain/mod.rs | 0 .../src => src}/domain/model/draft_model.rs | 0 {dsp-meta/src => src}/domain/model/error.rs | 0 .../domain/model/json_schema_validator.rs | 0 {dsp-meta/src => src}/domain/model/mod.rs | 0 {dsp-meta/src => src}/error.rs | 0 {dsp-meta/src => src}/infrastructure/mod.rs | 0 {dsp-meta/src => src}/lib.rs | 0 {dsp-meta-cmd/src => src}/main-server.rs | 1 + {dsp-meta-cmd/src => src}/main-validator.rs | 0 {dsp-meta/tests => tests}/api_tests.rs | 0 .../tests => tests}/draft_schema_test.rs | 5 +- 51 files changed, 292 insertions(+), 2771 deletions(-) rename dsp-meta/CHANGELOG.md => CHANGELOG.md (100%) delete mode 100644 benches/rdf_bench.rs delete mode 100755 example_output_formats/dokubib.json delete mode 100755 example_output_formats/hdm.json delete mode 100755 example_output_formats/hdm.jsonld delete mode 100755 example_output_formats/hdm.ttl delete mode 100755 example_output_formats/hdm.xml delete mode 100755 example_output_formats/incunabula.json rename {dsp-meta/resources => resources}/schema-metadata-draft.json (100%) rename {dsp-meta/resources => resources}/schema-metadata-final.json (100%) delete mode 100644 serde-rdf/Cargo.toml delete mode 100644 serde-rdf/examples/deserialize.rs delete mode 100644 serde-rdf/examples/serialize.rs delete mode 100644 serde-rdf/src/de.rs delete mode 100644 serde-rdf/src/error.rs delete mode 100644 serde-rdf/src/lib.rs delete mode 100644 serde-rdf/src/ser.rs delete mode 100644 serde-rdf/src/structure.rs rename {dsp-meta/src => src}/api/convert/axum/mod.rs (100%) rename {dsp-meta/src => src}/api/convert/axum/responses.rs (100%) rename {dsp-meta/src => src}/api/convert/mod.rs (100%) rename {dsp-meta/src => src}/api/handler/health.rs (100%) rename {dsp-meta/src => src}/api/handler/mod.rs (100%) rename {dsp-meta/src => src}/api/handler/robots_txt.rs (100%) rename {dsp-meta/src => src}/api/handler/sitemap_xml.rs (100%) rename {dsp-meta/src => src}/api/handler/v1/mod.rs (100%) rename {dsp-meta/src => src}/api/handler/v1/projects/handlers.rs (100%) rename {dsp-meta/src => src}/api/handler/v1/projects/mod.rs (100%) rename {dsp-meta/src => src}/api/handler/v1/projects/responses.rs (100%) rename {dsp-meta/src => src}/api/mod.rs (100%) rename {dsp-meta/src => src}/api/router.rs (97%) rename {dsp-meta/src => src}/app_state.rs (100%) rename {dsp-meta-cmd/src => src}/cli.rs (100%) rename {dsp-meta/src => src}/domain/metadata_repository.rs (98%) rename {dsp-meta/src => src}/domain/metadata_service.rs (100%) rename {dsp-meta/src => src}/domain/mod.rs (100%) rename {dsp-meta/src => src}/domain/model/draft_model.rs (100%) rename {dsp-meta/src => src}/domain/model/error.rs (100%) rename {dsp-meta/src => src}/domain/model/json_schema_validator.rs (100%) rename {dsp-meta/src => src}/domain/model/mod.rs (100%) rename {dsp-meta/src => src}/error.rs (100%) rename {dsp-meta/src => src}/infrastructure/mod.rs (100%) rename {dsp-meta/src => src}/lib.rs (100%) rename {dsp-meta-cmd/src => src}/main-server.rs (98%) rename {dsp-meta-cmd/src => src}/main-validator.rs (100%) rename {dsp-meta/tests => tests}/api_tests.rs (100%) rename {dsp-meta/tests => tests}/draft_schema_test.rs (96%) diff --git a/dsp-meta/CHANGELOG.md b/CHANGELOG.md similarity index 100% rename from dsp-meta/CHANGELOG.md rename to CHANGELOG.md diff --git a/Cargo.lock b/Cargo.lock index abeaaffe..7aba7f0c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -98,7 +98,7 @@ version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6d36fc52c7f6c869915e99412912f22093507da8d9e942ceaf66fe4b7c14422a" dependencies = [ - "windows-sys", + "windows-sys 0.52.0", ] [[package]] @@ -108,7 +108,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5bf74e1b6e971609db8ca7a9ce79fd5768ab6ae46441c572e46cf596f59e57f8" dependencies = [ "anstyle", - "windows-sys", + "windows-sys 0.52.0", ] [[package]] @@ -133,6 +133,28 @@ dependencies = [ "wait-timeout", ] +[[package]] +name = "async-stream" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd56dd203fef61ac097dd65721a419ddccb106b2d2b70ba60a6b529f03961a51" +dependencies = [ + "async-stream-impl", + "futures-core", + "pin-project-lite", +] + +[[package]] +name = "async-stream-impl" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "16e62a023e7c117e27523144c5d2459f4397fcc3cab0085af8e2224f643a0193" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "async-trait" version = "0.1.81" @@ -367,7 +389,7 @@ dependencies = [ "num-traits", "serde", "wasm-bindgen", - "windows-targets", + "windows-targets 0.52.6", ] [[package]] @@ -435,6 +457,19 @@ dependencies = [ "yaml-rust", ] +[[package]] +name = "console" +version = "0.15.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e1f83fc076bd6dd27517eacdf25fef6c4dfe5f1d7448bafaaf3a26f13b5e4eb" +dependencies = [ + "encode_unicode", + "lazy_static", + "libc", + "unicode-width", + "windows-sys 0.52.0", +] + [[package]] name = "cookie" version = "0.18.1" @@ -543,6 +578,27 @@ dependencies = [ "crypto-common", ] +[[package]] +name = "dirs" +version = "5.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44c45a9d03d6676652bcb5e724c7e988de1acad23a711b5217ab9cbecbec2225" +dependencies = [ + "dirs-sys", +] + +[[package]] +name = "dirs-sys" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "520f05a5cbd335fae5a99ff7a6ab8627577660ee5cfd6a94a6a929b52ff0321c" +dependencies = [ + "libc", + "option-ext", + "redox_users", + "windows-sys 0.48.0", +] + [[package]] name = "dlv-list" version = "0.3.0" @@ -593,6 +649,7 @@ version = "2.1.0" dependencies = [ "anyhow", "assert_cmd", + "async-trait", "axum", "axum-macros", "clap", @@ -625,20 +682,24 @@ dependencies = [ "chrono", "clap", "config", + "dirs", "fake", "hcl-rs", "http-body-util", "hyper", + "indicatif", "log", "nonempty", + "once_cell", + "pid1", "regex", "serde", "serde_json", "serde_with", "serde_yaml", - "sophia", "thiserror", "tokio", + "tokio-test", "toml 0.8.19", "tower", "tower-http", @@ -650,6 +711,7 @@ dependencies = [ ] [[package]] +<<<<<<< HEAD name = "dsp-meta-cmd" version = "2.2.0" dependencies = [ @@ -674,6 +736,37 @@ dependencies = [ "tracing-test", "url", ] +||||||| parent of e0a64d7 (merge crates) +name = "dsp-meta-cmd" +version = "2.1.0" +dependencies = [ + "anyhow", + "assert_cmd", + "axum", + "axum-macros", + "clap", + "config", + "dsp-meta", + "hcl-rs", + "hyper", + "log", + "pid1", + "serde", + "serde_json", + "tokio", + "tower", + "tower-http", + "tracing", + "tracing-subscriber", + "tracing-test", + "url", +] +======= +name = "encode_unicode" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f" +>>>>>>> e0a64d7 (merge crates) [[package]] name = "equivalent" @@ -1042,6 +1135,28 @@ dependencies = [ "serde", ] +[[package]] +name = "indicatif" +version = "0.17.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "763a5a8f45087d6bcea4222e7b72c291a054edf80e4ef6efd2a4979878c7bea3" +dependencies = [ + "console", + "instant", + "number_prefix", + "portable-atomic", + "unicode-width", +] + +[[package]] +name = "instant" +version = "0.1.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e0242819d153cba4b4b05a5a8f2a7e9bbf97b6055b2a002b395c96b5ff3c0222" +dependencies = [ + "cfg-if", +] + [[package]] name = "is_terminal_polyfill" version = "1.70.1" @@ -1115,6 +1230,16 @@ version = "0.2.155" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" +[[package]] +name = "libredox" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" +dependencies = [ + "bitflags 2.6.0", + "libc", +] + [[package]] name = "linked-hash-map" version = "0.5.6" @@ -1188,15 +1313,9 @@ dependencies = [ "hermit-abi", "libc", "wasi", - "windows-sys", + "windows-sys 0.52.0", ] -[[package]] -name = "mownstr" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8bc45ce96192b5d8b20cffb10ccd85cc431c283a7d171a0d843ac0bd7d444598" - [[package]] name = "nix" version = "0.27.1" @@ -1252,6 +1371,12 @@ dependencies = [ "autocfg", ] +[[package]] +name = "number_prefix" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "830b246a0e5f20af87141b25c173cd1b609bd7779a4617d6ec582abaf90870f3" + [[package]] name = "object" version = "0.36.2" @@ -1267,6 +1392,12 @@ version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" +[[package]] +name = "option-ext" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" + [[package]] name = "ordered-multimap" version = "0.4.3" @@ -1283,21 +1414,6 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" -[[package]] -name = "oxilangtag" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23f3f87617a86af77fa3691e6350483e7154c2ead9f1261b75130e21ca0f8acb" -dependencies = [ - "serde", -] - -[[package]] -name = "oxiri" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d05417ee46e2eb40dd9d590b4d67fc2408208b3a48a6b7f71d2bc1d7ce12a3e0" - [[package]] name = "pathdiff" version = "0.2.1" @@ -1436,6 +1552,12 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" +[[package]] +name = "portable-atomic" +version = "1.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da544ee218f0d287a911e9c99a39a8c9bc8fcad3cb8db5959940044ecfc67265" + [[package]] name = "powerfmt" version = "0.2.0" @@ -1509,15 +1631,6 @@ version = "2.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "33cb294fe86a74cbcf50d4445b37da762029549ebeea341421c7c70370f86cac" -[[package]] -name = "quick-xml" -version = "0.36.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96a05e2e8efddfa51a84ca47cec303fac86c8541b686d37cac5efc0e094417bc" -dependencies = [ - "memchr", -] - [[package]] name = "quote" version = "1.0.36" @@ -1557,6 +1670,17 @@ dependencies = [ "getrandom", ] +[[package]] +name = "redox_users" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba009ff324d1fc1b900bd1fdb31564febe58a8ccc8a6fdbb93b543d33b13ca43" +dependencies = [ + "getrandom", + "libredox", + "thiserror", +] + [[package]] name = "regex" version = "1.10.6" @@ -1611,41 +1735,6 @@ dependencies = [ "thiserror", ] -[[package]] -name = "resiter" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cbc95d56eb1865f69288945759cc0879d60ee68168dce676730275804ad2b276" - -[[package]] -name = "rio_api" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61d0c76ddf8b00cbb4d2c5932d067d49245c2f1f651809bde3cf265033ddb1af" - -[[package]] -name = "rio_turtle" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6f351b77353c7c896f0cd5ced2a25a7e95b5360cb68d1d7c16682ee096d7f40" -dependencies = [ - "oxilangtag", - "oxiri", - "rio_api", -] - -[[package]] -name = "rio_xml" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "abd3384ae785ed3b0159607adc08adef580a28e277fbfa375c42d162e9da93b1" -dependencies = [ - "oxilangtag", - "oxiri", - "quick-xml", - "rio_api", -] - [[package]] name = "ron" version = "0.7.1" @@ -1710,16 +1799,6 @@ dependencies = [ "serde_derive", ] -[[package]] -name = "serde-rdf" -version = "2.0.0" -dependencies = [ - "rio_api", - "rio_turtle", - "rio_xml", - "serde", -] - [[package]] name = "serde_derive" version = "1.0.209" @@ -1884,132 +1963,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ce305eb0b4296696835b71df73eb912e0f1ffd2556a501fcede6e0c50349191c" dependencies = [ "libc", - "windows-sys", -] - -[[package]] -name = "sophia" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d9d3e79754eeda3fc7e3610afcc492613fa0a5581d286d7545094e3e7ce1608" -dependencies = [ - "sophia_api", - "sophia_c14n", - "sophia_inmem", - "sophia_iri", - "sophia_isomorphism", - "sophia_resource", - "sophia_rio", - "sophia_term", - "sophia_turtle", -] - -[[package]] -name = "sophia_api" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e41b1197b9dbd2e5e2a7d8dc62fd6bab001724576463831920b13567bde2a4c" -dependencies = [ - "lazy_static", - "mownstr", - "regex", - "resiter", - "serde", - "sophia_iri", - "thiserror", -] - -[[package]] -name = "sophia_c14n" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04e4ebf65104879fc9f3f1f54224b42ad1f9e40b6a5dc26c5a17bf43846d6a1d" -dependencies = [ - "sha2", - "sophia_api", - "sophia_iri", - "thiserror", -] - -[[package]] -name = "sophia_inmem" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba3f836b898bbd5d5a73a977995e1d5dab8e2cf96a017890954864ece18b1e8c" -dependencies = [ - "sophia_api", - "thiserror", -] - -[[package]] -name = "sophia_iri" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb62d2fcd10fc3a44b646b1893ad478df0cb771f7ceb0331a5f3cee25f37ba7e" -dependencies = [ - "lazy_static", - "oxiri", - "regex", - "serde", - "thiserror", -] - -[[package]] -name = "sophia_isomorphism" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2b3876c71756d3dd94590c51090a036298a983f6b1e5c316f9eca514b2f6a5e" -dependencies = [ - "sophia_api", - "sophia_iri", -] - -[[package]] -name = "sophia_resource" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "807253d3a4144e1f3eacf6976849dab04cbd493ff568414df07c33fd10886ce2" -dependencies = [ - "sophia_api", - "sophia_iri", - "sophia_turtle", - "thiserror", -] - -[[package]] -name = "sophia_rio" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93e107086ca2b3e329dbe0f85f9ce504b1fbb478c85341338942b9dff613d4d8" -dependencies = [ - "rio_api", - "sophia_api", - "sophia_iri", -] - -[[package]] -name = "sophia_term" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca3a77f8523038dc1204a59dd461f27322cbe14bea3da873d41b6cc40c3e63e9" -dependencies = [ - "lazy_static", - "sophia_api", -] - -[[package]] -name = "sophia_turtle" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a7b7ce7aeb34f55867599544622420b2a6b6488b16811e06fd3755fc9cae4d0" -dependencies = [ - "lazy_static", - "oxiri", - "regex", - "rio_turtle", - "sophia_api", - "sophia_iri", - "sophia_rio", + "windows-sys 0.52.0", ] [[package]] @@ -2142,7 +2096,7 @@ dependencies = [ "pin-project-lite", "socket2", "tokio-macros", - "windows-sys", + "windows-sys 0.52.0", ] [[package]] @@ -2156,6 +2110,30 @@ dependencies = [ "syn", ] +[[package]] +name = "tokio-stream" +version = "0.1.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "267ac89e0bec6e691e5813911606935d77c476ff49024f98abcea3e7b15e37af" +dependencies = [ + "futures-core", + "pin-project-lite", + "tokio", +] + +[[package]] +name = "tokio-test" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2468baabc3311435b55dd935f702f42cd1b8abb7e754fb7dfb16bd36aa88f9f7" +dependencies = [ + "async-stream", + "bytes", + "futures-core", + "tokio", + "tokio-stream", +] + [[package]] name = "tokio-util" version = "0.7.11" @@ -2409,6 +2387,12 @@ dependencies = [ "tinyvec", ] +[[package]] +name = "unicode-width" +version = "0.1.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0336d538f7abc86d282a4189614dfaa90810dfc2c6f6427eaf88e16311dd225d" + [[package]] name = "unsafe-libyaml" version = "0.2.11" @@ -2602,7 +2586,16 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" dependencies = [ - "windows-targets", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-sys" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" +dependencies = [ + "windows-targets 0.48.5", ] [[package]] @@ -2611,7 +2604,22 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "windows-targets", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-targets" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" +dependencies = [ + "windows_aarch64_gnullvm 0.48.5", + "windows_aarch64_msvc 0.48.5", + "windows_i686_gnu 0.48.5", + "windows_i686_msvc 0.48.5", + "windows_x86_64_gnu 0.48.5", + "windows_x86_64_gnullvm 0.48.5", + "windows_x86_64_msvc 0.48.5", ] [[package]] @@ -2620,28 +2628,46 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" dependencies = [ - "windows_aarch64_gnullvm", - "windows_aarch64_msvc", - "windows_i686_gnu", + "windows_aarch64_gnullvm 0.52.6", + "windows_aarch64_msvc 0.52.6", + "windows_i686_gnu 0.52.6", "windows_i686_gnullvm", - "windows_i686_msvc", - "windows_x86_64_gnu", - "windows_x86_64_gnullvm", - "windows_x86_64_msvc", + "windows_i686_msvc 0.52.6", + "windows_x86_64_gnu 0.52.6", + "windows_x86_64_gnullvm 0.52.6", + "windows_x86_64_msvc 0.52.6", ] +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" + [[package]] name = "windows_aarch64_gnullvm" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" +[[package]] +name = "windows_aarch64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" + [[package]] name = "windows_aarch64_msvc" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" +[[package]] +name = "windows_i686_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" + [[package]] name = "windows_i686_gnu" version = "0.52.6" @@ -2654,24 +2680,48 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" +[[package]] +name = "windows_i686_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" + [[package]] name = "windows_i686_msvc" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" +[[package]] +name = "windows_x86_64_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" + [[package]] name = "windows_x86_64_gnu" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" + [[package]] name = "windows_x86_64_gnullvm" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" +[[package]] +name = "windows_x86_64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" + [[package]] name = "windows_x86_64_msvc" version = "0.52.6" diff --git a/Cargo.toml b/Cargo.toml index 513853dd..8750c7ee 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,21 +1,16 @@ -[workspace] -members = ["dsp-meta", "dsp-meta-cmd", "serde-rdf"] -resolver = "2" - -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html - -[workspace.package] -version = "2.0.3" +[package] +name = "dsp-meta" +version = "2.1.0" edition = "2021" license = "MIT OR Apache-2.0" homepage = "https://github.com/dasch-swiss/dsp-meta" repository = "https://github.com/dasch-swiss/dsp-meta" documentation = "https://github.com/dasch-swiss/dsp-meta" readme = "README.md" -description = "The DSP Metadata Command Line Tool providing transformation, validation and serving of research project's metadata." +description = "DSP-META is a service that provides metadata for the Digital and Semantic Publishing Platform (DSP)." authors = ["DaSCH - Swiss National Data and Service Center for the Humanities"] -[workspace.dependencies] +[dependencies] anyhow = "1" async-trait = "0.1.81" axum = "0.7.2" # web framework @@ -54,3 +49,17 @@ tracing-subscriber = { version = "0.3", features = [ tracing-test = "0.2" url = { version = "2", features = ["serde"] } toml = "0.8.19" + +[dev-dependencies] +assert_cmd = "2.0.16" +axum-test = "15.3.0" +fake = "2.9.2" + + +[[bin]] +name = "dsp-meta-server" +path = "src/main-server.rs" + +[[bin]] +name = "dsp-meta-validator" +path = "src/main-validator.rs" \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 7296910b..8e7fb5ca 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,7 @@ FROM rust:1-slim-bookworm AS builder-rs WORKDIR /dsp-meta COPY . . -RUN cargo install --path ./dsp-meta-cmd +RUN cargo install --path ./ FROM node:21-bookworm-slim AS builder-node WORKDIR /dsp-meta diff --git a/benches/rdf_bench.rs b/benches/rdf_bench.rs deleted file mode 100644 index 318ee5ab..00000000 --- a/benches/rdf_bench.rs +++ /dev/null @@ -1,14 +0,0 @@ -use criterion::{criterion_group, criterion_main, Criterion}; -use dsp_meta::domain::model::entity::project_metadata::ProjectMetadata; -use sophia::graph::inmem::LightGraph; - -fn serialize() { - let _: LightGraph = ProjectMetadata::default().try_into().unwrap(); -} - -fn rdf_serialization_benchmark(c: &mut Criterion) { - c.bench_function("serialize project metadata to RDF", |b| b.iter(serialize)); -} - -criterion_group!(benches, rdf_serialization_benchmark); -criterion_main!(benches); diff --git a/example_output_formats/dokubib.json b/example_output_formats/dokubib.json deleted file mode 100755 index 8b27fd5a..00000000 --- a/example_output_formats/dokubib.json +++ /dev/null @@ -1,154 +0,0 @@ -{ - "$schema": "https://raw.githubusercontent.com/dasch-swiss/dsp-meta-svc/main/docs/services/metadata/schema-metadata.json", - "project": { - "__id": "http://ns.dasch.swiss/repository#dsp-0804-project", - "__type": "Project", - "__createdAt": "1630601297599944000", - "__createdBy": "dsp-metadata-gui", - "howToCite": "Dokumentationsbibliothek St. Moritz", - "teaserText": "Bibliothek St. Moritz Dokumentation is the local history archive of the community of St. Moritz, Switzerland.", - "datasets": [ - "http://ns.dasch.swiss/repository#dsp-0804-dataset-000" - ], - "description": { - "en": "Bibliothek St. Moritz Dokumentation is the local history archive of the community of St. Moritz, Switzerland. It’s collection contains publications, manuscripts and audiovisual documents of the touristic development of St. Moritz" - }, - "disciplines": [ - { - "__type": "URL", - "type": "Skos", - "url": "http://skos.um.es/unesco6/550301", - "text": "Local history" - } - ], - "funders": [ - "http://ns.dasch.swiss/repository#dsp-0804-organization-001" - ], - "keywords": [ - { - "en": "Historic photograph" - }, - { - "en": "Local history" - }, - { - "en": "St. Moritz" - }, - { - "fr": "Touristic development" - } - ], - "name": "Bilddatenbank Bibliothek St. Moritz", - "shortcode": "0804", - "spatialCoverage": [ - { - "__type": "URL", - "type": "Geonames", - "url": "https://geonames.org/2658813", - "text": "Saint Moritz" - } - ], - "startDate": "1980-04-01", - "temporalCoverage": [ - { - "__type": "URL", - "type": "Chronontology", - "url": "http://chronontology.dainst.org/period/mvhEZ4S2qWEa", - "text": "19th Century (1800 - 1899)" - }, - { - "__type": "URL", - "type": "Chronontology", - "url": "http://chronontology.dainst.org/period/INtagfT8h7Fs", - "text": "20th and 21st Centuries" - }, - { - "__type": "URL", - "type": "Chronontology", - "url": "http://chronontology.dainst.org/period/kqORhO4TGm4n", - "text": "20th Century (1900 - 1999)" - } - ], - "url": { - "__type": "URL", - "type": "URL", - "url": "https://data.dasch.swiss/dokubib/", - "text": "Project Website" - } - }, - "datasets": [ - { - "__id": "http://ns.dasch.swiss/repository#dsp-0804-dataset-000", - "__type": "Dataset", - "__createdAt": "1630601300976368000", - "__createdBy": "dsp-metadata-gui", - "abstracts": [ - { - "en": "Bilddatenbank makes accessible the collection of historic photographs and other graphical representation of St. Moritz Dokumentationsbibliothek" - } - ], - "accessConditions": "restricted", - "howToCite": "Dokumentationsbibliothek St. Moritz", - "languages": [ - { - "de": "Deutsch", - "en": "German", - "fr": "allemand" - } - ], - "attributions": [ - { - "__type": "Attribution", - "agent": "http://ns.dasch.swiss/repository#dsp-0804-organization-000", - "roles": [ - "creator", - "publisher" - ] - } - ], - "status": "Ongoing", - "title": "Dokumentationsbibliothek St. Moritz Bilddatenbank", - "typeOfData": [ - "Image", - "Text" - ] - } - ], - "organizations": [ - { - "__id": "http://ns.dasch.swiss/repository#dsp-0804-organization-001", - "__type": "Organization", - "__createdAt": "1630601301506212000", - "__createdBy": "dsp-metadata-gui", - "address": { - "__type": "Address", - "street": "", - "postalCode": "7500", - "locality": "St. Moritz", - "country": "Switzerland" - }, - "name": "Gemeinde St. Moritz" - }, - { - "__id": "http://ns.dasch.swiss/repository#dsp-0804-organization-000", - "__type": "Organization", - "__createdAt": "1630601301561696000", - "__createdBy": "dsp-metadata-gui", - "address": { - "__type": "Address", - "street": "Plazza da Scoula 14", - "postalCode": "7500", - "locality": "St. Moritz", - "country": "Switzerland" - }, - "email": "doku@biblio-stmoritz.ch", - "name": "Dokumentationsbibliothek St. Moritz", - "url": { - "__type": "URL", - "type": "URL", - "url": "http://www.biblio-stmoritz.ch", - "text": "www.biblio-stmoritz.ch" - } - } - ] -} diff --git a/example_output_formats/hdm.json b/example_output_formats/hdm.json deleted file mode 100755 index 543752ac..00000000 --- a/example_output_formats/hdm.json +++ /dev/null @@ -1,180 +0,0 @@ -{ - "$schema": "https://raw.githubusercontent.com/dasch-swiss/dsp-meta-svc/main/docs/services/metadata/schema-metadata.json", - "project": { - "__id": "http://ns.dasch.swiss/repository#dsp-081C-project", - "__type": "Project", - "__createdAt": "1630601274523025000", - "__createdBy": "dsp-metadata-gui", - "howToCite": "HdM-Bern", - "teaserText": "The database documents the different kinds of spectacles such as theatre plays, operas, ballets, or concerts that took place in the Hôtel de Musique in Bern between 1766 and 1905.", - "datasets": [ - "http://ns.dasch.swiss/repository#dsp-081C-dataset-000" - ], - "description": { - "en": "The database documents the events that took place in the Hôtel de Musique in Bern between 1766 and 1905. The repertoire was constituted by different kinds of spectacles like theatre plays, operas, ballets, concerts, dance parties, acrobatic performances, conferences or magicians. The list reconstructs the lifely and colourful theatre culture of Bern in the 19th Century." - }, - "disciplines": [ - { - "de": "10302 Schweizer Geschichte" - }, - { - "de": "10405 Musikologie" - }, - { - "de": "10406 Theater-und Filmwissenschaften" - }, - { - "de": "10604 Musik und Theater" - } - ], - "funders": [ - "http://ns.dasch.swiss/repository#dsp-081C-organization-000" - ], - "keywords": [ - { - "en": "19 Century" - }, - { - "de": "Bern" - }, - { - "en": "Concert" - }, - { - "en": "Music" - }, - { - "en": "Musicology" - }, - { - "en": "Opera" - }, - { - "en": "Spectales" - }, - { - "en": "Switzerland" - }, - { - "en": "Theater history" - }, - { - "en": "Theatre" - } - ], - "name": "Hôtel de Musique Bern", - "shortcode": "081C", - "spatialCoverage": [ - { - "__type": "URL", - "type": "Geonames", - "url": "https://www.geonames.org/2661552", - "text": "Bern" - } - ], - "startDate": "2009-04-01", - "temporalCoverage": [ - { - "__type": "URL", - "type": "Periodo", - "url": "http://n2t.net/ark:/99152/p06c6g3pvr5", - "text": "Under Mediation act, 1803-1814" - }, - { - "__type": "URL", - "type": "Periodo", - "url": "http://n2t.net/ark:/99152/p06c6g3p4cf", - "text": "Sonderbund, 1845-1847" - }, - { - "__type": "URL", - "type": "Periodo", - "url": "http://n2t.net/ark:/99152/p06c6g364np", - "text": "Helvetic Republic, 1798-1803" - }, - { - "de": "1766-1905", - "en": "1766-1905", - "fr": "1766-1905" - } - ], - "url": { - "__type": "URL", - "type": "URL", - "url": "https://admin.dasch.swiss/project/081C", - "text": "Discover Project Data" - } - }, - "datasets": [ - { - "__id": "http://ns.dasch.swiss/repository#dsp-081C-dataset-000", - "__type": "Dataset", - "__createdAt": "1630601285266958000", - "__createdBy": "dsp-metadata-gui", - "abstracts": [ - { - "en": "The database documents the events that took place in the Hôtel de Musique in Bern between 1766 and 1905. The repertoire was constituted by different kinds of spectacles like theatre plays, operas, ballets, concerts, dance parties, acrobatic performances, conferences or magicians. The list reconstructs the lifely and colourful theatre culture of Bern in the 19th Century." - } - ], - "accessConditions": "open", - "datePublished": "2015-04-01", - "howToCite": "HdM-Bern", - "languages": [ - { - "de": "Deutsch", - "en": "German", - "fr": "allemand" - } - ], - "licenses": [ - { - "__type": "License", - "date": "2021-09-02", - "license": { - "__type": "URL", - "type": "Creative Commons", - "url": "https://creativecommons.org/licenses/by-nc/4.0", - "text": "CC BY-NC 4.0" - } - } - ], - "attributions": [ - { - "__type": "Attribution", - "agent": "http://ns.dasch.swiss/repository#dsp-081C-organization-000", - "roles": [ - "author" - ] - } - ], - "status": "Finished", - "title": "Hôtel de Musique Bern", - "typeOfData": [ - "Text" - ] - } - ], - "organizations": [ - { - "__id": "http://ns.dasch.swiss/repository#dsp-081C-organization-000", - "__type": "Organization", - "__createdAt": "1630601285796580000", - "__createdBy": "dsp-metadata-gui", - "address": { - "__type": "Address", - "street": "Mittelstr. 43", - "postalCode": "3011", - "locality": "Bern", - "country": "Switzerland" - }, - "email": "urchueguia@musik.unibe.ch", - "name": "Institut für Musikwissenschaft der Universität Bern", - "url": { - "__type": "URL", - "type": "URL", - "url": "https://www.musik.unibe.ch/index_ger.html", - "text": "https://www.musik.unibe.ch/index_ger.html" - } - } - ] -} diff --git a/example_output_formats/hdm.jsonld b/example_output_formats/hdm.jsonld deleted file mode 100755 index 6d99a4bb..00000000 --- a/example_output_formats/hdm.jsonld +++ /dev/null @@ -1,468 +0,0 @@ -[ - { - "@id": "http://ns.dasch.swiss/repository#dsp-081C-dataset-000", - "@type": [ - "http://ns.dasch.swiss/repository#Dataset" - ], - "http://ns.dasch.swiss/repository#hasAbstract": [ - { - "@language": "en", - "@value": "The database documents the events that took place in the Hôtel de Musique in Bern between 1766 and 1905. The repertoire was constituted by different kinds of spectacles like theatre plays, operas, ballets, concerts, dance parties, acrobatic performances, conferences or magicians. The list reconstructs the lifely and colourful theatre culture of Bern in the 19th Century." - } - ], - "http://ns.dasch.swiss/repository#hasAccessConditions": [ - { - "@value": "open" - } - ], - "http://ns.dasch.swiss/repository#hasDatePublished": [ - { - "@type": "http://www.w3.org/2001/XMLSchema#date", - "@value": "2015-04-01" - } - ], - "http://ns.dasch.swiss/repository#hasHowToCite": [ - { - "@value": "HdM-Bern" - } - ], - "http://ns.dasch.swiss/repository#hasLanguage": [ - { - "@language": "de", - "@value": "Deutsch" - }, - { - "@language": "en", - "@value": "German" - }, - { - "@language": "fr", - "@value": "allemand" - } - ], - "http://ns.dasch.swiss/repository#hasLicense": [ - { - "@id": "_:N6179e73d6f4041709c76b78e04c21860" - } - ], - "http://ns.dasch.swiss/repository#hasQualifiedAttribution": [ - { - "@id": "_:N33910fc7e18e43aebfb4eca5660903c3" - } - ], - "http://ns.dasch.swiss/repository#hasStatus": [ - { - "@value": "Finished" - } - ], - "http://ns.dasch.swiss/repository#hasTitle": [ - { - "@value": "Hôtel de Musique Bern" - } - ], - "http://ns.dasch.swiss/repository#hasTypeOfData": [ - { - "@value": "Text" - } - ] - }, - { - "@id": "_:N6179e73d6f4041709c76b78e04c21860", - "@type": [ - "http://ns.dasch.swiss/repository#License" - ], - "http://ns.dasch.swiss/repository#hasDate": [ - { - "@type": "http://www.w3.org/2001/XMLSchema#date", - "@value": "2021-09-02" - } - ], - "http://ns.dasch.swiss/repository#hasURL": [ - { - "@id": "_:N83807eac0cad4a78ad09e8ade88b4003" - } - ] - }, - { - "@id": "_:N83807eac0cad4a78ad09e8ade88b4003", - "@type": [ - "http://schema.org/URL" - ], - "http://schema.org/propertyID": [ - { - "@id": "_:N703fb05b1e524a388180a06010edcf37" - } - ], - "http://schema.org/url": [ - { - "@value": "https://creativecommons.org/licenses/by-nc/4.0" - } - ] - }, - { - "@id": "_:N703fb05b1e524a388180a06010edcf37", - "@type": [ - "http://schema.org/PropertyValue" - ], - "http://schema.org/propertyID": [ - { - "@value": "CC BY-NC 4.0" - } - ] - }, - { - "@id": "_:N33910fc7e18e43aebfb4eca5660903c3", - "@type": [ - "http://www.w3.org/ns/prov#Attribution" - ], - "http://ns.dasch.swiss/repository#hasRole": [ - { - "@value": "author" - } - ], - "http://www.w3.org/ns/prov#agent": [ - { - "@id": "http://ns.dasch.swiss/repository#dsp-081C-organization-000" - } - ] - }, - { - "@id": "http://ns.dasch.swiss/repository#dsp-081C-organization-000", - "@type": [ - "http://ns.dasch.swiss/repository#Organization" - ], - "http://ns.dasch.swiss/repository#hasAddress": [ - { - "@id": "_:N344ffc44be544d39a2f0fa3d11490dfa" - } - ], - "http://ns.dasch.swiss/repository#hasEmail": [ - { - "@value": "urchueguia@musik.unibe.ch" - } - ], - "http://ns.dasch.swiss/repository#hasName": [ - { - "@value": "Institut für Musikwissenschaft der Universität Bern" - } - ], - "http://ns.dasch.swiss/repository#hasURL": [ - { - "@id": "_:N80088fb73216490fa26e41fe717b56d2" - } - ] - }, - { - "@id": "_:N80088fb73216490fa26e41fe717b56d2", - "@type": [ - "http://schema.org/URL" - ], - "http://schema.org/url": [ - { - "@value": "https://www.musik.unibe.ch/index_ger.html" - } - ] - }, - { - "@id": "_:N344ffc44be544d39a2f0fa3d11490dfa", - "@type": [ - "http://schema.org/PostalAddress" - ], - "http://schema.org/addressCountry": [ - { - "@value": "Switzerland" - } - ], - "http://schema.org/addressLocality": [ - { - "@value": "Bern" - } - ], - "http://schema.org/postalCode": [ - { - "@value": "3011" - } - ], - "http://schema.org/streetAddress": [ - { - "@value": "Mittelstr. 43" - } - ] - }, - { - "@id": "http://ns.dasch.swiss/repository#dsp-081C-project", - "@type": [ - "http://ns.dasch.swiss/repository#Project" - ], - "http://ns.dasch.swiss/repository#hasDataset": [ - { - "@id": "http://ns.dasch.swiss/repository#dsp-081C-dataset-000" - } - ], - "http://ns.dasch.swiss/repository#hasDescription": [ - { - "@language": "en", - "@value": "The database documents the events that took place in the Hôtel de Musique in Bern between 1766 and 1905. The repertoire was constituted by different kinds of spectacles like theatre plays, operas, ballets, concerts, dance parties, acrobatic performances, conferences or magicians. The list reconstructs the lifely and colourful theatre culture of Bern in the 19th Century." - } - ], - "http://ns.dasch.swiss/repository#hasDiscipline": [ - { - "@language": "de", - "@value": "10302 Schweizer Geschichte" - }, - { - "@language": "de", - "@value": "10405 Musikologie" - }, - { - "@language": "de", - "@value": "10406 Theater-und Filmwissenschaften" - }, - { - "@language": "de", - "@value": "10604 Musik und Theater" - } - ], - "http://ns.dasch.swiss/repository#hasFunder": [ - { - "@id": "http://ns.dasch.swiss/repository#dsp-081C-organization-000" - } - ], - "http://ns.dasch.swiss/repository#hasHowToCite": [ - { - "@value": "HdM-Bern" - } - ], - "http://ns.dasch.swiss/repository#hasKeyword": [ - { - "@language": "en", - "@value": "19 Century" - }, - { - "@language": "de", - "@value": "Bern" - }, - { - "@language": "en", - "@value": "Concert" - }, - { - "@language": "en", - "@value": "Music" - }, - { - "@language": "en", - "@value": "Musicology" - }, - { - "@language": "en", - "@value": "Opera" - }, - { - "@language": "en", - "@value": "Spectales" - }, - { - "@language": "en", - "@value": "Switzerland" - }, - { - "@language": "en", - "@value": "Theater history" - }, - { - "@language": "en", - "@value": "Theatre" - } - ], - "http://ns.dasch.swiss/repository#hasName": [ - { - "@value": "Hôtel de Musique Bern" - } - ], - "http://ns.dasch.swiss/repository#hasShortcode": [ - { - "@value": "081C" - } - ], - "http://ns.dasch.swiss/repository#hasSpatialCoverage": [ - { - "@id": "_:Nc470ba6dcff74c70bbbe6ea552176a18" - } - ], - "http://ns.dasch.swiss/repository#hasStartDate": [ - { - "@type": "http://www.w3.org/2001/XMLSchema#date", - "@value": "2009-04-01" - } - ], - "http://ns.dasch.swiss/repository#hasTeaser": [ - { - "@value": "The database documents the different kinds of spectacles such as theatre plays, operas, ballets, or concerts that took place in the Hôtel de Musique in Bern between 1766 and 1905." - } - ], - "http://ns.dasch.swiss/repository#hasTemporalCoverage": [ - { - "@id": "_:Nadc74cc5fa1c449f9a0d98423b5d349d" - }, - { - "@id": "_:N151b811550c74e76964ace35f52774c7" - }, - { - "@id": "_:Nd8f9750f59d04e1da1fa6fbccbf698dd" - }, - { - "@language": "de", - "@value": "1766-1905" - }, - { - "@language": "en", - "@value": "1766-1905" - }, - { - "@language": "fr", - "@value": "1766-1905" - } - ], - "http://ns.dasch.swiss/repository#hasURL": [ - { - "@id": "_:N6eba7cdfdfd84735b88288227698d702" - } - ] - }, - { - "@id": "_:Nadc74cc5fa1c449f9a0d98423b5d349d", - "@type": [ - "http://schema.org/URL" - ], - "http://schema.org/propertyID": [ - { - "@id": "_:N117f4478986f4a51bba1b00524b37508" - } - ], - "http://schema.org/url": [ - { - "@value": "http://n2t.net/ark:/99152/p06c6g3pvr5" - } - ] - }, - { - "@id": "_:N117f4478986f4a51bba1b00524b37508", - "@type": [ - "http://schema.org/PropertyValue" - ], - "http://schema.org/propertyID": [ - { - "@value": "Under Mediation act, 1803-1814" - } - ] - }, - { - "@id": "_:N151b811550c74e76964ace35f52774c7", - "@type": [ - "http://schema.org/URL" - ], - "http://schema.org/propertyID": [ - { - "@id": "_:N0c2c9ab6dc0747cb8a67e21292a95901" - } - ], - "http://schema.org/url": [ - { - "@value": "http://n2t.net/ark:/99152/p06c6g3p4cf" - } - ] - }, - { - "@id": "_:N0c2c9ab6dc0747cb8a67e21292a95901", - "@type": [ - "http://schema.org/PropertyValue" - ], - "http://schema.org/propertyID": [ - { - "@value": "Sonderbund, 1845-1847" - } - ] - }, - { - "@id": "_:Nd8f9750f59d04e1da1fa6fbccbf698dd", - "@type": [ - "http://schema.org/URL" - ], - "http://schema.org/propertyID": [ - { - "@id": "_:N25015d996444461392f9f4f0d4468360" - } - ], - "http://schema.org/url": [ - { - "@value": "http://n2t.net/ark:/99152/p06c6g364np" - } - ] - }, - { - "@id": "_:N25015d996444461392f9f4f0d4468360", - "@type": [ - "http://schema.org/PropertyValue" - ], - "http://schema.org/propertyID": [ - { - "@value": "Helvetic Republic, 1798-1803" - } - ] - }, - { - "@id": "_:Nc470ba6dcff74c70bbbe6ea552176a18", - "@type": [ - "http://schema.org/URL" - ], - "http://schema.org/propertyID": [ - { - "@id": "_:Naf9b30cd99c140e7bb4b20bd5dc72050" - } - ], - "http://schema.org/url": [ - { - "@value": "https://www.geonames.org/2661552" - } - ] - }, - { - "@id": "_:Naf9b30cd99c140e7bb4b20bd5dc72050", - "@type": [ - "http://schema.org/PropertyValue" - ], - "http://schema.org/propertyID": [ - { - "@value": "Bern" - } - ] - }, - { - "@id": "_:N6eba7cdfdfd84735b88288227698d702", - "@type": [ - "http://schema.org/URL" - ], - "http://schema.org/propertyID": [ - { - "@id": "_:Nd79fd9c0dc2843d4845fa22e9cc68af1" - } - ], - "http://schema.org/url": [ - { - "@value": "https://admin.dasch.swiss/project/081C" - } - ] - }, - { - "@id": "_:Nd79fd9c0dc2843d4845fa22e9cc68af1", - "@type": [ - "http://schema.org/PropertyValue" - ], - "http://schema.org/propertyID": [ - { - "@value": "Discover Project Data" - } - ] - } -] \ No newline at end of file diff --git a/example_output_formats/hdm.ttl b/example_output_formats/hdm.ttl deleted file mode 100755 index fb691a4d..00000000 --- a/example_output_formats/hdm.ttl +++ /dev/null @@ -1,84 +0,0 @@ -@prefix dsp: . -@prefix prov: . -@prefix sdo: . -@prefix xsd: . - -dsp:dsp-081C-project a dsp:Project ; - dsp:hasDataset dsp:dsp-081C-dataset-000 ; - dsp:hasDescription "The database documents the events that took place in the Hôtel de Musique in Bern between 1766 and 1905. The repertoire was constituted by different kinds of spectacles like theatre plays, operas, ballets, concerts, dance parties, acrobatic performances, conferences or magicians. The list reconstructs the lifely and colourful theatre culture of Bern in the 19th Century."@en ; - dsp:hasDiscipline "10302 Schweizer Geschichte"@de, - "10405 Musikologie"@de, - "10406 Theater-und Filmwissenschaften"@de, - "10604 Musik und Theater"@de ; - dsp:hasFunder dsp:dsp-081C-organization-000 ; - dsp:hasHowToCite "HdM-Bern"^^xsd:string ; - dsp:hasKeyword "Bern"@de, - "19 Century"@en, - "Concert"@en, - "Music"@en, - "Musicology"@en, - "Opera"@en, - "Spectales"@en, - "Switzerland"@en, - "Theater history"@en, - "Theatre"@en ; - dsp:hasName "Hôtel de Musique Bern"^^xsd:string ; - dsp:hasShortcode "081C"^^xsd:string ; - dsp:hasSpatialCoverage [ a sdo:URL ; - sdo:propertyID [ a sdo:PropertyValue ; - sdo:propertyID "Bern" ] ; - sdo:url "https://www.geonames.org/2661552" ] ; - dsp:hasStartDate "2009-04-01"^^xsd:date ; - dsp:hasTeaser "The database documents the different kinds of spectacles such as theatre plays, operas, ballets, or concerts that took place in the Hôtel de Musique in Bern between 1766 and 1905."^^xsd:string ; - dsp:hasTemporalCoverage [ a sdo:URL ; - sdo:propertyID [ a sdo:PropertyValue ; - sdo:propertyID "Sonderbund, 1845-1847" ] ; - sdo:url "http://n2t.net/ark:/99152/p06c6g3p4cf" ], - [ a sdo:URL ; - sdo:propertyID [ a sdo:PropertyValue ; - sdo:propertyID "Under Mediation act, 1803-1814" ] ; - sdo:url "http://n2t.net/ark:/99152/p06c6g3pvr5" ], - [ a sdo:URL ; - sdo:propertyID [ a sdo:PropertyValue ; - sdo:propertyID "Helvetic Republic, 1798-1803" ] ; - sdo:url "http://n2t.net/ark:/99152/p06c6g364np" ], - "1766-1905"@de, - "1766-1905"@en, - "1766-1905"@fr ; - dsp:hasURL [ a sdo:URL ; - sdo:propertyID [ a sdo:PropertyValue ; - sdo:propertyID "Discover Project Data" ] ; - sdo:url "https://admin.dasch.swiss/project/081C" ] . - -dsp:dsp-081C-dataset-000 a dsp:Dataset ; - dsp:hasAbstract "The database documents the events that took place in the Hôtel de Musique in Bern between 1766 and 1905. The repertoire was constituted by different kinds of spectacles like theatre plays, operas, ballets, concerts, dance parties, acrobatic performances, conferences or magicians. The list reconstructs the lifely and colourful theatre culture of Bern in the 19th Century."@en ; - dsp:hasAccessConditions "open"^^xsd:string ; - dsp:hasDatePublished "2015-04-01"^^xsd:date ; - dsp:hasHowToCite "HdM-Bern"^^xsd:string ; - dsp:hasLanguage "Deutsch"@de, - "German"@en, - "allemand"@fr ; - dsp:hasLicense [ a dsp:License ; - dsp:hasDate "2021-09-02"^^xsd:date ; - dsp:hasURL [ a sdo:URL ; - sdo:propertyID [ a sdo:PropertyValue ; - sdo:propertyID "CC BY-NC 4.0" ] ; - sdo:url "https://creativecommons.org/licenses/by-nc/4.0" ] ] ; - dsp:hasQualifiedAttribution [ a prov:Attribution ; - dsp:hasRole "author"^^xsd:string ; - prov:agent dsp:dsp-081C-organization-000 ] ; - dsp:hasStatus "Finished"^^xsd:string ; - dsp:hasTitle "Hôtel de Musique Bern"^^xsd:string ; - dsp:hasTypeOfData "Text"^^xsd:string . - -dsp:dsp-081C-organization-000 a dsp:Organization ; - dsp:hasAddress [ a sdo:PostalAddress ; - sdo:addressCountry "Switzerland"^^xsd:string ; - sdo:addressLocality "Bern"^^xsd:string ; - sdo:postalCode "3011"^^xsd:string ; - sdo:streetAddress "Mittelstr. 43"^^xsd:string ] ; - dsp:hasEmail "urchueguia@musik.unibe.ch"^^xsd:string ; - dsp:hasName "Institut für Musikwissenschaft der Universität Bern"^^xsd:string ; - dsp:hasURL [ a sdo:URL ; - sdo:url "https://www.musik.unibe.ch/index_ger.html" ] . - diff --git a/example_output_formats/hdm.xml b/example_output_formats/hdm.xml deleted file mode 100755 index 7c83b2b9..00000000 --- a/example_output_formats/hdm.xml +++ /dev/null @@ -1,137 +0,0 @@ - - - - 081C - Hôtel de Musique Bern - HdM-Bern - The database documents the events that took place in the Hôtel de Musique in Bern between 1766 and 1905. The repertoire was constituted by different kinds of spectacles like theatre plays, operas, ballets, concerts, dance parties, acrobatic performances, conferences or magicians. The list reconstructs the lifely and colourful theatre culture of Bern in the 19th Century. - 2009-04-01 - The database documents the different kinds of spectacles such as theatre plays, operas, ballets, or concerts that took place in the Hôtel de Musique in Bern between 1766 and 1905. - - - Hôtel de Musique Bern - open - HdM-Bern - Finished - The database documents the events that took place in the Hôtel de Musique in Bern between 1766 and 1905. The repertoire was constituted by different kinds of spectacles like theatre plays, operas, ballets, concerts, dance parties, acrobatic performances, conferences or magicians. The list reconstructs the lifely and colourful theatre culture of Bern in the 19th Century. - Text - - - - - https://creativecommons.org/licenses/by-nc/4.0 - - - CC BY-NC 4.0 - - - - - 2021-09-02 - - - Deutsch - German - allemand - - - - author - - - 2015-04-01 - - - 19 Century - Bern - Concert - Music - Musicology - Opera - Spectales - Switzerland - Theater history - Theatre - 10302 Schweizer Geschichte - 10405 Musikologie - 10406 Theater-und Filmwissenschaften - 10604 Musik und Theater - - - http://n2t.net/ark:/99152/p06c6g3pvr5 - - - Under Mediation act, 1803-1814 - - - - - - - http://n2t.net/ark:/99152/p06c6g3p4cf - - - Sonderbund, 1845-1847 - - - - - - - http://n2t.net/ark:/99152/p06c6g364np - - - Helvetic Republic, 1798-1803 - - - - - 1766-1905 - 1766-1905 - 1766-1905 - - - https://www.geonames.org/2661552 - - - Bern - - - - - - - Institut für Musikwissenschaft der Universität Bern - - - https://www.musik.unibe.ch/index_ger.html - - - - - Mittelstr. 43 - 3011 - Bern - Switzerland - - - urchueguia@musik.unibe.ch - - - - - https://admin.dasch.swiss/project/081C - - - Discover Project Data - - - - - - diff --git a/example_output_formats/incunabula.json b/example_output_formats/incunabula.json deleted file mode 100755 index 3e65bbea..00000000 --- a/example_output_formats/incunabula.json +++ /dev/null @@ -1,240 +0,0 @@ -{ - "$schema": "https://raw.githubusercontent.com/dasch-swiss/dsp-meta-svc/main/docs/services/metadata/schema-metadata.json", - "project": { - "__id": "http://ns.dasch.swiss/repository#dsp-0803-project", - "__type": "Project", - "__createdAt": "1637624150548721000", - "__createdBy": "dsp-metadata-gui", - "teaserText": "An art-scientific monograph of the richly illustrated early prints in Basel - the most important center of early letterpress printing in the territory of present-day Switzerland.", - "datasets": [ - "http://ns.dasch.swiss/repository#dsp-0803-dataset-000" - ], - "alternativeNames": [ - { - "en": "Incunabula" - } - ], - "description": { - "de": "Eine kunstwissenschaftliche Monographie der reich bebilderten Frühdrucke in Basel - dem wichtigsten Zentrum des frühen Buchdrucks auf dem Gebiet der heutigen Schweiz - wird im vorliegenden Projekt erstmals seit über einem Jahrhundert ins Auge gefasst. Im Zentrum stehen 18 Werke aus vier verschiedenen Offizinen, welche insgesamt über 1000 Holzschnitte enthalten, die bedeutendsten überlieferten Basler Bilderfolgen des Spätmittelalters nach den massiven Zerstörungen im Zuge der Reformation. Bei den Texten handelt es sich fast ausschliesslich um deutsche und lateinische Kompilationen religiösen, didaktischen Inhalts, darunter viele zeitgenössische und in Basel entstandene, neben Übersetzungen des 15. Jahrhunderts und vollständig überarbeiteten Ausgaben bereits verbreiteter Werke. Äusserst erfolgreiche Bücher wie das Narrenschiff oder der Heilsspiegel stehen neben kaum bekannten wie den seelsorgerischen Schriften des Kartäusers Ludwig Moser und des Franziskaners Johannes Meder. Die Analyse eines umfassenden Corpus bebilderter Frühdrucke fehlt in der neueren Forschung, welche sich bezüglich der Basler Produktion vorwiegend der Untersuchung der Produzentenkreise gewidmet, die Bilder dagegen - mit Ausnahme des Narrenschiffs - wenig beachtet hat. Sehr heterogen ist auch die Erforschung der Texte, von denen ein grosser Teil unediert geblieben ist, von anderen wiederum existieren ausführlich kommentierte Faksimileausgaben. Die bisherige Bild-Text-Forschung hat sich auf das Narrenschiff fokussiert.Neben der Quellenanalyse der Bilder und Texte strebt das Projekt eine umfassende Untersuchung der Bild-Text-Bezüge unter Berücksichtigung rezeptionsästethischer Fragestellungen an. Gefragt wird nach der Funktion der Bilder für die spätmittelalterlichen visuellen und auditiven Rezipienten. Dabei wird davon ausgegangen, dass es sich bei unseren Frühdrucken ausnahmslos um kalkulierte Bild-Text-Kompilationen handelt, welche einen reflektierten und kreativen Umgang ihrer Produzenten mit den drucktechnischen Möglichkeiten des neuen Mediums voraussetzen, wie z.B. mit der Möglichkeit der vielfältigen Kontextualisierung von Bildern. Die Analyse der Bild- und Textquellen liefert eine umfassende Fallstudie zum Medienwechsel zwischen Handschrift und Frühdruck, diejenige der Bild-Text-Bezüge im Spannungsfeld zwischen mündlicher Tradierung und schriftlicher Fixierung religiöser Didaxe eine Fallstudie zur spätmittelalterlichen Rezeptionsforschung.Methodisch knüpft das Projekt an rezeptionsästhetische Konzepte und Studien der jüngeren literaturwissenschaftlichen Forschung an, welche mit ikonographischen Analysen kombiniert werden. Durch diese Erweiterung textzentrierter methodischer Ansätze treten die Texte in Bezug auf die Bilder nicht mehr als übergeordnete, unabhängige Einheiten in den Blick, sondern die Konstruktion des Werksinnes erscheint im Wechselspiel der Medien. Der traditionelle Begriff der Buchillustration wird dadurch grundlegend revidiert.Neben mehreren Aufsätzen und einer Tagung sind eine Monographie in Buchform geplant, welche sich an die Fachwelt sowie an eine interessierte Öffentlichkeit wendet, ausserdem eine Internet-Publikation der Bild- und Textquellen im Rahmen der Zusammenarbeit mit der Basler Univeristätsbibliothek." - }, - "disciplines": [ - { - "en": "10404 Visual arts and Art history" - } - ], - "endDate": "2012-08-31", - "funders": [ - "http://ns.dasch.swiss/repository#dsp-0803-organization-000" - ], - "grants": [ - "http://ns.dasch.swiss/repository#dsp-0803-grant-000" - ], - "keywords": [ - { - "de": "Basel" - }, - { - "en": "Contectualisation of images" - }, - { - "en": "Late Middle Ages" - }, - { - "en": "Letterpress Printing" - } - ], - "name": "Die Bilderfolgen der Basler Frühdrucke: Spätmittelalterliche Didaxe als Bild-Text-Lektüre", - "publications": [ - "Graf Kathrin (2011), Klerikersatiren in Bild und Text. Zur Kompilationstechnik im Narrenschiff, in Krause Karin u. Schellewald Barbara (ed.), 205-227.", - "Krause Karin u. Schellewald Barbara (ed.) (2011), Bild und Text im Mittelalter.", - "Rosenthaler Lukas u. Ryf Patrick (2009), Incunabula Basilea: A Web 2.0 Application as Research Tool to Early Prints, in Archiving, 6, 175-177.", - "Rosenthaler Lukas u. Schweizer Tobias (2012), SALSAH - eine webbasierte Forschungsplattform für die Geisteswissenschaften, in SAGW Bulletin, 32-33.", - "Rosenthaler Lukas, Virtual Research Environments. A New Approach for Dealing with Digitized Sources in Research in Arts and Humanities, in Clivaz Claire (ed.), ebook auf der Plattform http://www.ppur.info/lire-demain.html, Lausanne, 661-670.", - "Ryf Patrick u. Rosenthaler Lukas (2010), SALSAH: System for Annotation and Linkage of Sources in Arts and Humanities. Eine Web 2.0 Applikation zur wissenschaftlichen Betrachtung und Bearbeitung von historischem Bild- und Textmaterial, in Bienert Andreas u.a. (ed.), GFaI, Berlin, 123-126.", - "Schmitt Lothar (2009), Sebastian Brant, Albrecht Dürer und das Narrenschiff, in Wolfenbütteler Abhandlungen zur Renaissanceforschung, 26, 347-412.", - "Schmitt Lothar (2010), Mehr als Dürer. Die Ilustrationen in Friedrich Riederers \"Spiegel der wahren Rhetorik\", in Knape Joachim u. Luppold Stefanie (ed.), 191-216.", - "Schweizer Tobias u. Rosenthaler Lukas (2011), SALSAH - eine virtuelle Forschungsumgebung für die Geisteswissenschaften, in Bienert Andreas u.a. (ed.), GFaI, Berlin, 147-153.", - "Schweizer Tobias, Development of a Topographical Transcription Method, in Clivaz Claire u. a. (ed.), ebook, auf der Plattform http://www.ppur.info/lire-demain.html, Lausanne, 671-680." - ], - "url": { - "__type": "URL", - "type": "URL", - "url": "https://admin.dasch.swiss/project/3ABR_2i8QYGSIDvmP9mlEw", - "text": "Discover Project Data" - }, - "shortcode": "0803", - "startDate": "2008-06-01" - }, - "datasets": [ - { - "__id": "http://ns.dasch.swiss/repository#dsp-0803-dataset-000", - "__type": "Dataset", - "__createdAt": "1637624150907146000", - "__createdBy": "dsp-metadata-gui", - "abstracts": [ - { - "en": "The interdisciplinary research project \"The image sequences of Basel's early prints: Late Medieval didactic didactics as an image-text reading\" combines a comprehensive art scholarly analysis of the links between images and texts in the illustrated incunabula in Basel with the digitization of the holdings of the University Library and the development of an electronic edition in the form of a new kind of Web-0.2 application. The project is carried out by Kunsthistorische Seminar of the University of Basel (Prof. B. Schellewald) and Digital Humanities Lab of the University of Basel (Prof. Dr. L. Rosenthaler). The core of the digital edition consists of around twenty richly illustrated early prints from four different Basel officers. Many of them appeared in several editions before 1500, some of them in German and Latin at almost the same time. It is an extraordinarily varied production; in addition to the Mirror of Salvation, there is a novel, the Melusine, the travelogues of Jean de Mandeville, some prayer and edification books, theological writings, Lent sermons, the lives of Saints Fridolin and Meinrad, the famous ship of fools and the knight of Thurn. The Internet publication makes the digitized corpus of these early prints usable for the scientific edition as well as for the exploration of images and texts through the possibilities of non-linear linking and commenting on the images and texts. Existing and emerging online editions can also be linked to it, which optimises the use of databases from other institutions with regard to our corpus." - } - ], - "attributions": [ - { - "__type": "Attribution", - "agent": "http://ns.dasch.swiss/repository#dsp-0803-person-004", - "roles": [ - "Employee" - ] - }, - { - "__type": "Attribution", - "agent": "http://ns.dasch.swiss/repository#dsp-0803-person-000", - "roles": [ - "Applicant" - ] - }, - { - "__type": "Attribution", - "agent": "http://ns.dasch.swiss/repository#dsp-0803-person-003", - "roles": [ - "Employee" - ] - }, - { - "__type": "Attribution", - "agent": "http://ns.dasch.swiss/repository#dsp-0803-person-001", - "roles": [ - "Co-applicant" - ] - }, - { - "__type": "Attribution", - "agent": "http://ns.dasch.swiss/repository#dsp-0803-person-002", - "roles": [ - "Co-applicant" - ] - } - ], - "status": "Finished", - "title": "Die Bilderfolgen der Basler Frühdrucke: Spätmittelalterliche Didaxe als Bild-Text-Lektüre" - } - ], - "persons": [ - { - "__id": "http://ns.dasch.swiss/repository#dsp-0803-person-000", - "__type": "Person", - "__createdAt": "1637624150958979000", - "__createdBy": "dsp-metadata-gui", - "familyNames": [ - "Schellewald" - ], - "givenNames": [ - "Barbara" - ], - "affiliation": [ - "http://ns.dasch.swiss/repository#dsp-0803-organization-001" - ] - }, - { - "__id": "http://ns.dasch.swiss/repository#dsp-0803-person-001", - "__type": "Person", - "__createdAt": "1637624150959055000", - "__createdBy": "dsp-metadata-gui", - "familyNames": [ - "Hug" - ], - "givenNames": [ - "Hannes" - ], - "affiliation": [ - "http://ns.dasch.swiss/repository#dsp-0803-organization-002" - ] - }, - { - "__id": "http://ns.dasch.swiss/repository#dsp-0803-person-002", - "__type": "Person", - "__createdAt": "1637624150959124000", - "__createdBy": "dsp-metadata-gui", - "familyNames": [ - "Rosenthaler" - ], - "givenNames": [ - "Lukas" - ], - "affiliation": [ - "http://ns.dasch.swiss/repository#dsp-0803-organization-003" - ] - }, - { - "__id": "http://ns.dasch.swiss/repository#dsp-0803-person-003", - "__type": "Person", - "__createdAt": "1637624150959191000", - "__createdBy": "dsp-metadata-gui", - "familyNames": [ - "Schmitt" - ], - "givenNames": [ - "Lothar" - ] - }, - { - "__id": "http://ns.dasch.swiss/repository#dsp-0803-person-004", - "__type": "Person", - "__createdAt": "1637624150959244000", - "__createdBy": "dsp-metadata-gui", - "familyNames": [ - "Graf Lamei" - ], - "givenNames": [ - "Katrin" - ] - } - ], - "organizations": [ - { - "__id": "http://ns.dasch.swiss/repository#dsp-0803-organization-001", - "__type": "Organization", - "__createdAt": "1637624150959319000", - "__createdBy": "dsp-metadata-gui", - "name": "Kunsthistorisches Seminar Universität Basel" - }, - { - "__id": "http://ns.dasch.swiss/repository#dsp-0803-organization-002", - "__type": "Organization", - "__createdAt": "1637624150959357000", - "__createdBy": "dsp-metadata-gui", - "name": "Universität Basel Universitätsbibliothek Sekretariat" - }, - { - "__id": "http://ns.dasch.swiss/repository#dsp-0803-organization-003", - "__type": "Organization", - "__createdAt": "1637624150959391000", - "__createdBy": "dsp-metadata-gui", - "name": "Digital Humanities Lab Philosophisch-Historische Fakultät Universität Basel" - }, - { - "__id": "http://ns.dasch.swiss/repository#dsp-0803-organization-000", - "__type": "Organization", - "__createdAt": "1637624150959423000", - "__createdBy": "dsp-metadata-gui", - "name": "Swiss National Science Foundation (SNSF)" - } - ], - "grants": [ - { - "__id": "http://ns.dasch.swiss/repository#dsp-0803-grant-000", - "__type": "Grant", - "__createdAt": "1637624150959473000", - "__createdBy": "dsp-metadata-gui", - "funders": [ - "http://ns.dasch.swiss/repository#dsp-0803-organization-000" - ], - "name": "Project funding", - "number": "120378", - "url": { - "__type": "URL", - "type": "URL", - "url": "https://data.snf.ch/grants/grant/120378", - "text": "https://data.snf.ch/grants/grant/120378" - } - } - ] -} diff --git a/justfile b/justfile index 4674bf45..6cfb9e8e 100644 --- a/justfile +++ b/justfile @@ -1,5 +1,5 @@ DOCKER_REPO := "daschswiss/dsp-meta-server" -CARGO_VERSION := `cargo metadata --format-version=1 --no-deps | jq --raw-output '.packages[] | select(.name == "dsp-meta-cmd") | .version'` +CARGO_VERSION := `cargo metadata --format-version=1 --no-deps | jq --raw-output '.packages[].version'` COMMIT_HASH := `git log --pretty=format:'%h' -n 1` IMAGE_TAG := CARGO_VERSION + "-" + COMMIT_HASH DOCKER_IMAGE := DOCKER_REPO + ":" + IMAGE_TAG @@ -51,10 +51,6 @@ serve-dev: serve-frontend: cd web-frontend && yarn run dev -# Run dsp-meta-validator validating all hcl documents under ./data -validate: - export DSP_META_DATA_DIR=${PWD}/data && cargo run --bin dsp-meta-validator - # Build linux/amd64 Docker image locally docker-build-amd64: docker buildx build --platform linux/amd64 -t {{ DOCKER_IMAGE }}-amd64 --load . diff --git a/dsp-meta/resources/schema-metadata-draft.json b/resources/schema-metadata-draft.json similarity index 100% rename from dsp-meta/resources/schema-metadata-draft.json rename to resources/schema-metadata-draft.json diff --git a/dsp-meta/resources/schema-metadata-final.json b/resources/schema-metadata-final.json similarity index 100% rename from dsp-meta/resources/schema-metadata-final.json rename to resources/schema-metadata-final.json diff --git a/serde-rdf/Cargo.toml b/serde-rdf/Cargo.toml deleted file mode 100644 index a0b54894..00000000 --- a/serde-rdf/Cargo.toml +++ /dev/null @@ -1,27 +0,0 @@ -[package] -name = "serde-rdf" -version = "2.0.0" -edition.workspace = true -license.workspace = true -homepage.workspace = true -repository.workspace = true -documentation.workspace = true -readme.workspace = true -description.workspace = true -authors.workspace = true - -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html - -[dependencies] -serde.workspace = true -rio_api = { version = "0.8.5", features = [] } -rio_turtle = { version = "0.8.5", features = [] } -rio_xml = { version = "0.8.5", features = [] } - -[[example]] -name = "serialize" -test = true - -[[example]] -name = "deserialize" -test = true diff --git a/serde-rdf/examples/deserialize.rs b/serde-rdf/examples/deserialize.rs deleted file mode 100644 index fca3485a..00000000 --- a/serde-rdf/examples/deserialize.rs +++ /dev/null @@ -1,56 +0,0 @@ -#![allow(unused_variables, unused_imports, dead_code)] - -use std::collections::HashMap; - -use serde::Deserialize; - -#[derive(Debug, Deserialize)] -struct Project { - id: Iri, - name: String, - description: LangString, - shortcode: String, - datasets: Vec, -} - -#[derive(Debug, Deserialize)] -struct Dataset { - id: Iri, - name: String, -} - -type Iri = String; - -#[derive(Debug, Deserialize)] -pub struct LangString(pub HashMap); - -#[derive(Debug, Default, Deserialize, Hash, Eq, PartialEq)] -pub enum IsoCode { - #[default] - DE, // German - EN, // English - FR, // French - IT, // Italian - ES, // Spanish - PT, // Portuguese - NL, // Dutch - PL, // Polish - RU, // Russian - JA, // Japanese - ZH, // Chinese - AR, // Arabic - FA, // Persian -} - -fn main() { - let project_ttl = r#" - ; - "Hôtel de Musique Bern"^^xsd:string ; - "The database documents the events that took place in the Hôtel de Musique in Bern between 1766 and 1905. The repertoire was constituted by different kinds of spectacles like theatre plays, operas, ballets, concerts, dance parties, acrobatic performances, conferences or magicians. The list reconstructs the lifely and colourful theatre culture of Bern in the 19th Century."@en ; - - "081C"^^xsd:string ; - ; - "#; - - let _project: Project = serde_rdf::from_str(project_ttl).unwrap(); -} diff --git a/serde-rdf/examples/serialize.rs b/serde-rdf/examples/serialize.rs deleted file mode 100644 index 9a44ea5a..00000000 --- a/serde-rdf/examples/serialize.rs +++ /dev/null @@ -1,71 +0,0 @@ -#![allow(dead_code)] - -use std::collections::HashMap; - -use serde::*; -use serde_rdf::{SerializerConfig, SubjectConfig}; - -#[derive(Debug, Serialize)] -struct Project { - id: Iri, - name: String, - description: LangString, - shortcode: String, - datasets: Vec, -} - -#[derive(Debug, Serialize)] -struct Dataset { - id: Iri, -} - -type Iri = String; - -#[derive(Debug, Serialize)] -pub struct LangString(pub HashMap); - -#[derive(Debug, Default, Serialize, PartialEq, Eq, Hash)] -pub enum IsoCode { - #[default] - DE, // German - EN, // English - FR, // French - IT, // Italian - ES, // Spanish - PT, // Portuguese - NL, // Dutch - PL, // Polish - RU, // Russian - JA, // Japanese - ZH, // Chinese - AR, // Arabic - FA, // Persian -} - -fn main() { - let mut name = HashMap::::new(); - name.insert(IsoCode::EN, "Hôtel de Musique Bern".to_string()); - - let dataset = Dataset { - id: "dataset-0".to_string(), - }; - - let config = SerializerConfig { - base_iri: "".to_string(), - namespaces: Default::default(), - subjects: HashMap::from([( - "Dataset".to_string(), - SubjectConfig { - struct_name: "Dataset".to_string(), - rdf_type: "https://example.org/ns#Test".to_string(), - identifier_field: "id".to_string(), - identifier_prefix: "https://ark.dasch.swiss/ark:/72163/1/".to_string(), - properties: Vec::new(), - }, - )]), - }; - - let project_ttl = serde_rdf::to_string(&dataset, config).unwrap(); - - dbg!(project_ttl); -} diff --git a/serde-rdf/src/de.rs b/serde-rdf/src/de.rs deleted file mode 100644 index 6d2f95fe..00000000 --- a/serde-rdf/src/de.rs +++ /dev/null @@ -1,274 +0,0 @@ -#![allow(unused_variables, unused_imports, dead_code)] - -//! Deserialize RDF data to a Rust data structure. - -use serde::de::{self, Visitor}; - -use crate::{Error, Result}; - -/// A structure that deserializes RDF into Rust values. -pub struct Deserializer { - statements: String, -} - -impl Deserializer { - /// Creates a RDF deserializer from a `&str`. - /// - /// # Errors - /// - /// An [`Error`][Error] is returned when the input is not valid HCL. - pub fn from_raw_str(input: &str) -> Result { - // FIXME: parse the input into a list of statements - // let statements = parser::parse(input)?; - Ok(Deserializer { - statements: input.to_string(), - }) - } -} - -/// Deserialize an instance of type `T` from a string of RDF text. -/// -/// By default, the deserialization will follow the [Turtle Specification][turtle-spec]. -/// -/// [turtle-spec]: https://www.w3.org/TR/turtle/ -/// -/// # Errors -/// -/// This functions fails with an error if the data does not match the structure of `T`. -pub fn from_str<'de, T>(s: &'de str) -> Result -where - T: de::Deserialize<'de>, -{ - let deserializer = Deserializer::from_raw_str(s)?; - T::deserialize(deserializer) -} - -impl<'de> de::Deserializer<'de> for Deserializer { - type Error = Error; - - fn deserialize_any(self, _visitor: V) -> Result - where - V: Visitor<'de>, - { - todo!() - } - - fn deserialize_bool(self, _visitor: V) -> Result - where - V: Visitor<'de>, - { - todo!() - } - - fn deserialize_i8(self, _visitor: V) -> Result - where - V: Visitor<'de>, - { - todo!() - } - - fn deserialize_i16(self, _visitor: V) -> Result - where - V: Visitor<'de>, - { - todo!() - } - - fn deserialize_i32(self, _visitor: V) -> Result - where - V: Visitor<'de>, - { - todo!() - } - - fn deserialize_i64(self, _visitor: V) -> Result - where - V: Visitor<'de>, - { - todo!() - } - - fn deserialize_u8(self, _visitor: V) -> Result - where - V: Visitor<'de>, - { - todo!() - } - - fn deserialize_u16(self, _visitor: V) -> Result - where - V: Visitor<'de>, - { - todo!() - } - - fn deserialize_u32(self, _visitor: V) -> Result - where - V: Visitor<'de>, - { - todo!() - } - - fn deserialize_u64(self, _visitor: V) -> Result - where - V: Visitor<'de>, - { - todo!() - } - - fn deserialize_f32(self, _visitor: V) -> Result - where - V: Visitor<'de>, - { - todo!() - } - - fn deserialize_f64(self, _visitor: V) -> Result - where - V: Visitor<'de>, - { - todo!() - } - - fn deserialize_char(self, _visitor: V) -> Result - where - V: Visitor<'de>, - { - todo!() - } - - fn deserialize_str(self, _visitor: V) -> Result - where - V: Visitor<'de>, - { - todo!() - } - - fn deserialize_string(self, _visitor: V) -> Result - where - V: Visitor<'de>, - { - todo!() - } - - fn deserialize_bytes(self, _visitor: V) -> Result - where - V: Visitor<'de>, - { - todo!() - } - - fn deserialize_byte_buf(self, _visitor: V) -> Result - where - V: Visitor<'de>, - { - todo!() - } - - fn deserialize_option(self, _visitor: V) -> Result - where - V: Visitor<'de>, - { - todo!() - } - - fn deserialize_unit(self, _visitor: V) -> Result - where - V: Visitor<'de>, - { - todo!() - } - - fn deserialize_unit_struct( - self, - _name: &'static str, - _visitor: V, - ) -> Result - where - V: Visitor<'de>, - { - todo!() - } - - fn deserialize_newtype_struct( - self, - _name: &'static str, - _visitor: V, - ) -> Result - where - V: Visitor<'de>, - { - todo!() - } - - fn deserialize_seq(self, _visitor: V) -> Result - where - V: Visitor<'de>, - { - todo!() - } - - fn deserialize_tuple(self, _len: usize, _visitor: V) -> Result - where - V: Visitor<'de>, - { - todo!() - } - - fn deserialize_tuple_struct( - self, - _name: &'static str, - _len: usize, - _visitor: V, - ) -> Result - where - V: Visitor<'de>, - { - todo!() - } - - fn deserialize_map(self, _visitor: V) -> Result - where - V: Visitor<'de>, - { - todo!() - } - - fn deserialize_struct( - self, - _name: &'static str, - _fields: &'static [&'static str], - _visitor: V, - ) -> Result - where - V: Visitor<'de>, - { - todo!() - } - - fn deserialize_enum( - self, - _name: &'static str, - _variants: &'static [&'static str], - _visitor: V, - ) -> Result - where - V: Visitor<'de>, - { - todo!() - } - - fn deserialize_identifier(self, _visitor: V) -> Result - where - V: Visitor<'de>, - { - todo!() - } - - fn deserialize_ignored_any(self, _visitor: V) -> Result - where - V: Visitor<'de>, - { - todo!() - } -} diff --git a/serde-rdf/src/error.rs b/serde-rdf/src/error.rs deleted file mode 100644 index bb0bac62..00000000 --- a/serde-rdf/src/error.rs +++ /dev/null @@ -1,64 +0,0 @@ -//! The `Error` and `Result` types used by this crate. - -use std::fmt::{Display, Formatter}; -use std::io; -use std::str::Utf8Error; - -use serde::{de, ser}; - -/// The result type used by this crate. -pub type Result = std::result::Result; - -/// The error type used by this crate. -#[derive(Debug)] -#[non_exhaustive] -pub enum Error { - /// Represents a generic error message. - Message(String), - /// Represents an error that resulted from invalid UTF8 input. - Utf8(Utf8Error), - /// Represents generic IO errors. - Io(io::Error), - /// Represents an error during serialization. - CannotSerializePrimitive(&'static str), -} - -impl Error { - pub(crate) fn new(msg: T) -> Error - where - T: Display, - { - Error::Message(msg.to_string()) - } -} - -impl Display for Error { - fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { - match self { - Error::Message(msg) => write!(f, "{msg}"), - Error::Utf8(err) => write!(f, "{err}"), - Error::Io(err) => write!(f, "{err}"), - Error::CannotSerializePrimitive(msg) => write!(f, "{msg}"), - } - } -} - -impl From for Error { - fn from(value: io::Error) -> Self { - Error::Io(value) - } -} - -impl std::error::Error for Error {} - -impl ser::Error for Error { - fn custom(msg: T) -> Self { - Error::new(msg) - } -} - -impl de::Error for Error { - fn custom(msg: T) -> Self { - Error::new(msg) - } -} diff --git a/serde-rdf/src/lib.rs b/serde-rdf/src/lib.rs deleted file mode 100644 index 77bdbf2b..00000000 --- a/serde-rdf/src/lib.rs +++ /dev/null @@ -1,13 +0,0 @@ -mod de; -mod error; -mod ser; -mod structure; - -#[doc(inline)] -pub use de::{from_str, Deserializer}; -#[doc(inline)] -pub use error::{Error, Result}; -#[doc(inline)] -pub use ser::{to_string, Serializer}; -#[doc(inline)] -pub use structure::{PropertyConfig, SerializerConfig, SubjectConfig}; diff --git a/serde-rdf/src/ser.rs b/serde-rdf/src/ser.rs deleted file mode 100644 index 2b6a8a7b..00000000 --- a/serde-rdf/src/ser.rs +++ /dev/null @@ -1,704 +0,0 @@ -#![allow(unused_variables, unused_imports, dead_code)] - -//! Serialize a Rust data structure into RDF data. - -use std::io; - -use rio_api::formatter::TriplesFormatter; -use rio_api::model::{NamedNode as RioNamedNode, Triple}; -use rio_turtle::TurtleFormatter; -use serde::ser::{self, Serialize}; - -use crate::error::{Error, Result}; -use crate::structure::SerializerConfig; - -/// Serializer mapping configuration containing mappings aka instructions on how -/// to serialize a type. There are three possible options: -/// (1) one IRI: this denotes the name of the field containing the identifier. Further, it provides -/// the prefix to the identifier used to build the IRI. -/// (2) one Clazz: this denotes the name of the struct and to what RDF class it should be typed -/// (3) one or more Property: this denotes the name of the field, it's property IRI, and the -/// literal xsd:type (`XsdType`) it should be serialized into, if it is a literal, or (`Subject`) -/// denoting that it is a struct that needs to be serialized as a separate subject. -/// -/// Example: -/// ``` -/// use std::collections::HashMap; -/// use serde_rdf::{SerializerConfig, SubjectConfig, PropertyConfig}; -/// let _config = SerializerConfig{ -/// base_iri: "".to_string(), -/// namespaces: Default::default(), -/// subjects: HashMap::from([ -/// ("Project".to_string(), SubjectConfig{ -/// struct_name: "Project".to_string(), -/// rdf_type: "https://ns.dasch.swiss/repository#Project".to_string(), -/// identifier_field: "id".to_string(), -/// identifier_prefix: "https://ark.dasch.swiss/ark:/72163/1/".to_string(), -/// properties: vec!( -/// PropertyConfig{struct_field: "name".to_string(), rdf_property: "https://ns.dasch.swiss/repository#hasName".to_string()}, -/// PropertyConfig{struct_field: "description".to_string(), rdf_property: "https://ns.dasch.swiss/repository#hasDescription".to_string()}, -/// PropertyConfig{struct_field: "shortcode".to_string(), rdf_property: "https://ns.dasch.swiss/repository#hasShortcode".to_string()}, -/// PropertyConfig{struct_field: "datasets".to_string(), rdf_property: "https://ns.dasch.swiss/repository#hasDataset".to_string()}, -/// ), -/// }), -/// ("Dataset".to_string(), SubjectConfig{ -/// struct_name: "Dataset".to_string(), -/// rdf_type: "https://ns.dasch.swiss/repository#Dataset".to_string(), -/// identifier_field: "id".to_string(), -/// identifier_prefix: "https://ark.dasch.swiss/ark:/72163/1/".to_string(), -/// properties: vec!( -/// PropertyConfig{struct_field: "title".to_string(), rdf_property: "https://ns.dasch.swiss/repository#hasTitle".to_string()} -/// ), -/// })]) -/// }; -/// ``` - -#[derive(Eq, PartialEq, Debug, Clone, Hash)] -pub enum Literal<'a> { - /// A [simple literal](https://www.w3.org/TR/rdf11-concepts/#dfn-simple-literal) without datatype or language form. - Simple { - /// The [lexical form](https://www.w3.org/TR/rdf11-concepts/#dfn-lexical-form). - value: String, - }, - /// A [language-tagged string](https://www.w3.org/TR/rdf11-concepts/#dfn-language-tagged-string) - LanguageTaggedString { - /// The [lexical form](https://www.w3.org/TR/rdf11-concepts/#dfn-lexical-form). - value: String, - /// The [language tag](https://www.w3.org/TR/rdf11-concepts/#dfn-language-tag). - language: String, - }, - /// A literal with an explicit datatype - Typed { - /// The [lexical form](https://www.w3.org/TR/rdf11-concepts/#dfn-lexical-form). - value: String, - /// The [datatype IRI](https://www.w3.org/TR/rdf11-concepts/#dfn-datatype-iri). - datatype: RioNamedNode<'a>, - }, -} - -impl Literal<'_> { - /// Return the lexical form of the literal. - pub fn value(&self) -> &str { - match self { - Literal::Simple { value } => value, - Literal::LanguageTaggedString { value, .. } => value, - Literal::Typed { value, .. } => value, - } - } -} - -#[derive(Debug)] -struct Loc { - id: String, - type_name: String, -} -/// Need a structure inside the serializer to hold the components of triples as they are -/// gathered: -/// - one IRI field holding the IRI of the subject -/// - one field with Vec holding tuples with the predicate and literal. -/// -/// The struct that we want to serialize, needs to be prepared: -/// - those fields of a struct that contain a Vec of literals need to be flattened `serde(flatten)` -/// - those fields of a struct that contain a Vec of structs should **not** be flattened -/// -pub struct Serializer<'a, W: io::Write> { - stack: Vec, - last_subject: &'a str, - last_key: &'a str, - last_literal: Option>, - output: String, - mapping: SerializerConfig, - formatter: TurtleFormatter, -} - -impl<'a, W> Serializer<'a, W> -where - W: io::Write, -{ - fn new(mapping: SerializerConfig, writer: W) -> Serializer<'a, W> { - Serializer::with_formatter(mapping, TurtleFormatter::new(writer)) - } - - fn with_formatter( - mapping: SerializerConfig, - formatter: TurtleFormatter, - ) -> Serializer<'a, W> { - Serializer { - stack: Vec::new(), - last_subject: "", - last_key: "", - last_literal: None, - output: String::new(), - mapping, - formatter, - } - } -} - -/// Serialize the given value as an RDF string. -/// -/// # Errors -/// -/// Serialization fails if the type cannot be represented as RDF. -pub fn to_string(value: &T, config: SerializerConfig) -> Result -where - T: ?Sized + Serialize, -{ - let mut serializer = Serializer::new(config, Vec::default()); - value.serialize(&mut serializer)?; - let bytes = serializer.formatter.finish()?; - - // SAFETY: The `Formatter` never emits invalid UTF-8. - Ok(unsafe { String::from_utf8_unchecked(bytes) }) -} - -impl<'a, W> ser::Serializer for &mut Serializer<'a, W> -where - W: io::Write, -{ - // The output type produced by this `Serializer` during successful - // serialization. Most serializers that produce text or binary output should - // set `Ok = ()` and serialize into an `io::Write` or buffer contained - // within the `Serializer` instance, as happens here. Serializers that build - // in-memory data structures may be simplified by using `Ok` to propagate - // the data structure around. - type Ok = (); - - // The error type when some error occurs during serialization. - type Error = Error; - - // Associated types for keeping track of additional state while serializing - // compound data structures like sequences and maps. In this case no - // additional state is required beyond what is already stored in the - // Serializer struct. - type SerializeSeq = Self; - type SerializeTuple = Self; - type SerializeTupleStruct = Self; - type SerializeTupleVariant = Self; - type SerializeMap = Self; - type SerializeStruct = Self; - type SerializeStructVariant = Self; - - // Here we go with the simple methods. The following 12 methods receive one - // of the primitive types of the data model and map it to JSON by appending - // into the output string. - fn serialize_bool(self, v: bool) -> Result<()> { - use crate::ser::Literal::Typed; - - if v { - self.last_literal = Some(Typed { - value: "true".to_owned(), - datatype: RioNamedNode { iri: "xsd:boolean" }, - }); - } else { - self.last_literal = Some(Typed { - value: "false".to_owned(), - datatype: RioNamedNode { iri: "xsd:boolean" }, - }); - } - Ok(()) - } - - // JSON does not distinguish between different sizes of integers, so all - // signed integers will be serialized the same and all unsigned integers - // will be serialized the same. Other formats, especially compact binary - // formats, may need independent logic for the different sizes. - fn serialize_i8(self, v: i8) -> Result { - self.serialize_i64(i64::from(v)) - } - - fn serialize_i16(self, v: i16) -> Result { - self.serialize_i64(i64::from(v)) - } - - fn serialize_i32(self, v: i32) -> Result { - self.serialize_i64(i64::from(v)) - } - - // Not particularly efficient but this is example code anyway. A more - // performant approach would be to use the `itoa` crate. - fn serialize_i64(self, v: i64) -> Result { - self.output += &v.to_string(); - Ok(()) - } - - fn serialize_u8(self, v: u8) -> Result { - self.serialize_u64(u64::from(v)) - } - - fn serialize_u16(self, v: u16) -> Result { - self.serialize_u64(u64::from(v)) - } - - fn serialize_u32(self, v: u32) -> Result { - self.serialize_u64(u64::from(v)) - } - - fn serialize_u64(self, v: u64) -> Result { - self.output += &v.to_string(); - Ok(()) - } - - fn serialize_f32(self, v: f32) -> Result { - self.serialize_f64(f64::from(v)) - } - - fn serialize_f64(self, v: f64) -> Result { - self.output += &v.to_string(); - Ok(()) - } - - // Serialize a char as a single-character string. Other formats may - // represent this differently. - fn serialize_char(self, v: char) -> Result { - self.serialize_str(&v.to_string()) - } - - // This only works for strings that don't require escape sequences but you - // get the idea. For example it would emit invalid JSON if the input string - // contains a '"' character. - fn serialize_str(self, v: &str) -> Result { - println!("serialize_str"); - - use crate::ser::Literal::Typed; - - self.last_literal = Some(Typed { - value: v.to_owned(), - datatype: RioNamedNode { iri: "xsd:string" }, - }); - - Ok(()) - } - - // Serialize a byte array as an array of bytes. Could also use a base64 - // string here. Binary formats will typically represent byte arrays more - // compactly. - fn serialize_bytes(self, v: &[u8]) -> Result { - use serde::ser::SerializeSeq; - let mut seq = self.serialize_seq(Some(v.len()))?; - for byte in v { - seq.serialize_element(byte)?; - } - seq.end() - } - - // An absent optional is represented as the JSON `null`. - fn serialize_none(self) -> Result { - self.serialize_unit() - } - - // A present optional is represented as just the contained value. Note that - // this is a lossy representation. For example the values `Some(())` and - // `None` both serialize as just `null`. Unfortunately this is typically - // what people expect when working with JSON. Other formats are encouraged - // to behave more intelligently if possible. - fn serialize_some(self, value: &T) -> Result - where - T: ?Sized + Serialize, - { - value.serialize(self) - } - - // In Serde, unit means an anonymous value containing no data. Map this to - // JSON as `null`. - fn serialize_unit(self) -> Result { - self.output += "null"; - Ok(()) - } - - // Unit struct means a named value containing no data. Again, since there is - // no data, map this to JSON as `null`. There is no need to serialize the - // name in most formats. - fn serialize_unit_struct(self, name: &'static str) -> Result { - self.serialize_unit() - } - - // When serializing a unit variant (or any other kind of variant), formats - // can choose whether to keep track of it by index or by name. Binary - // formats typically use the index of the variant and human-readable formats - // typically use the name. - fn serialize_unit_variant( - self, - name: &'static str, - variant_index: u32, - variant: &'static str, - ) -> Result { - self.serialize_str(variant) - } - - // As is done here, serializers are encouraged to treat newtype structs as - // insignificant wrappers around the data they contain. - fn serialize_newtype_struct(self, name: &'static str, value: &T) -> Result - where - T: ?Sized + Serialize, - { - value.serialize(self) - } - - // Note that newtype variant (and all of the other variant serialization - // methods) refer exclusively to the "externally tagged" enum - // representation. - // - // Serialize this to JSON in externally tagged form as `{ NAME: VALUE }`. - fn serialize_newtype_variant( - self, - name: &'static str, - variant_index: u32, - variant: &'static str, - value: &T, - ) -> Result - where - T: ?Sized + Serialize, - { - self.output += "{"; - variant.serialize(&mut *self)?; - self.output += ":"; - value.serialize(&mut *self)?; - self.output += "}"; - Ok(()) - } - - // Now we get to the serialization of compound types. - // - // The start of the sequence, each value, and the end are three separate - // method calls. This one is responsible only for serializing the start, - // which in JSON is `[`. - // - // The length of the sequence may or may not be known ahead of time. This - // doesn't make a difference in JSON because the length is not represented - // explicitly in the serialized form. Some serializers may only be able to - // support sequences for which the length is known up front. - fn serialize_seq(self, len: Option) -> Result { - self.output += "["; - Ok(self) - } - - // Tuples look just like sequences in JSON. Some formats may be able to - // represent tuples more efficiently by omitting the length, since tuple - // means that the corresponding `Deserialize implementation will know the - // length without needing to look at the serialized data. - fn serialize_tuple(self, len: usize) -> Result { - self.serialize_seq(Some(len)) - } - - // Tuple structs look just like sequences in JSON. - fn serialize_tuple_struct( - self, - name: &'static str, - len: usize, - ) -> Result { - self.serialize_seq(Some(len)) - } - - // Tuple variants are represented in JSON as `{ NAME: [DATA...] }`. Again - // this method is only responsible for the externally tagged representation. - fn serialize_tuple_variant( - self, - name: &'static str, - variant_index: u32, - variant: &'static str, - len: usize, - ) -> Result { - self.output += "{"; - variant.serialize(&mut *self)?; - self.output += ":["; - Ok(self) - } - - // Maps are represented in JSON as `{ K: V, K: V, ... }`. - fn serialize_map(self, len: Option) -> Result { - self.output += "{"; - Ok(self) - } - - // Structs represent subjects, where the name is the "type". - fn serialize_struct(self, name: &'static str, len: usize) -> Result { - println!("serialize_struct"); - println!("name: {}", name); - self.last_subject = name; - Ok(self) - } - - // Struct variants are represented in JSON as `{ NAME: { K: V, ... } }`. - // This is the externally tagged representation. - fn serialize_struct_variant( - self, - name: &'static str, - variant_index: u32, - variant: &'static str, - len: usize, - ) -> Result { - self.output += "{"; - variant.serialize(&mut *self)?; - self.output += ":{"; - Ok(self) - } -} - -// The following 7 impls deal with the serialization of compound types like -// sequences and maps. Serialization of such types is begun by a Serializer -// method and followed by zero or more calls to serialize individual elements of -// the compound type and one call to end the compound type. -// -// This impl is SerializeSeq so these methods are called after `serialize_seq` -// is called on the Serializer. -impl<'a, W: io::Write> ser::SerializeSeq for &mut Serializer<'a, W> { - // Must match the `Ok` type of the serializer. - type Ok = (); - // Must match the `Error` type of the serializer. - type Error = Error; - - // Serialize a single element of the sequence. - fn serialize_element(&mut self, value: &T) -> Result - where - T: ?Sized + Serialize, - { - if !self.output.ends_with('[') { - self.output += ","; - } - value.serialize(&mut **self) - } - - // Close the sequence. - fn end(self) -> Result { - self.output += "]"; - Ok(()) - } -} - -// Same thing but for tuples. -impl<'a, W: io::Write> ser::SerializeTuple for &mut Serializer<'a, W> { - type Ok = (); - type Error = Error; - - fn serialize_element(&mut self, value: &T) -> Result - where - T: ?Sized + Serialize, - { - if !self.output.ends_with('[') { - self.output += ","; - } - value.serialize(&mut **self) - } - - fn end(self) -> Result<()> { - self.output += "]"; - Ok(()) - } -} - -// Same thing but for tuple structs. -impl<'a, W: io::Write> ser::SerializeTupleStruct for &mut Serializer<'a, W> { - type Ok = (); - type Error = Error; - - fn serialize_field(&mut self, value: &T) -> Result - where - T: ?Sized + Serialize, - { - if !self.output.ends_with('[') { - self.output += ","; - } - value.serialize(&mut **self) - } - - fn end(self) -> Result<()> { - self.output += "]"; - Ok(()) - } -} - -// Tuple variants are a little different. Refer back to the -// `serialize_tuple_variant` method above: -// -// self.output += "{"; -// variant.serialize(&mut *self)?; -// self.output += ":["; -// -// So the `end` method in this impl is responsible for closing both the `]` and -// the `}`. -impl<'a, W: io::Write> ser::SerializeTupleVariant for &mut Serializer<'a, W> { - type Ok = (); - type Error = Error; - - fn serialize_field(&mut self, value: &T) -> Result - where - T: ?Sized + Serialize, - { - if !self.output.ends_with('[') { - self.output += ","; - } - value.serialize(&mut **self) - } - - fn end(self) -> Result<()> { - self.output += "]}"; - Ok(()) - } -} - -// Some `Serialize` types are not able to hold a key and value in memory at the -// same time so `SerializeMap` implementations are required to support -// `serialize_key` and `serialize_value` individually. -// -// There is a third optional method on the `SerializeMap` trait. The -// `serialize_entry` method allows serializers to optimize for the case where -// key and value are both available simultaneously. In JSON it doesn't make a -// difference so the default behavior for `serialize_entry` is fine. -impl<'a, W: io::Write> ser::SerializeMap for &mut Serializer<'a, W> { - type Ok = (); - type Error = Error; - - // The Serde data model allows map keys to be any serializable type. JSON - // only allows string keys so the implementation below will produce invalid - // JSON if the key serializes as something other than a string. - // - // A real JSON serializer would need to validate that map keys are strings. - // This can be done by using a different Serializer to serialize the key - // (instead of `&mut **self`) and having that other serializer only - // implement `serialize_str` and return an error on any other data type. - fn serialize_key(&mut self, key: &T) -> Result - where - T: ?Sized + Serialize, - { - if !self.output.ends_with('{') { - self.output += ","; - } - key.serialize(&mut **self) - } - - // It doesn't make a difference whether the colon is printed at the end of - // `serialize_key` or at the beginning of `serialize_value`. In this case - // the code is a bit simpler having it here. - fn serialize_value(&mut self, value: &T) -> Result - where - T: ?Sized + Serialize, - { - self.output += ":"; - value.serialize(&mut **self) - } - - fn end(self) -> Result<()> { - self.output += "}"; - Ok(()) - } -} - -// Structs are like maps in which the keys are constrained to be compile-time -// constant strings. -impl<'a, W: io::Write> ser::SerializeStruct for &mut Serializer<'a, W> { - type Ok = (); - type Error = Error; - - fn serialize_field(&mut self, key: &'static str, value: &T) -> Result - where - T: ?Sized + Serialize, - { - println!("serialize_struct -> serialize_field"); - - value.serialize(&mut **self)?; - - let subject = self.mapping.subjects.get(self.last_subject).unwrap(); - - if subject.identifier_field == key { - println!( - "serialize_struct -> serialize_field -> identifier_field: {}", - key - ); - } - - let value = match self.last_literal.take() { - Some(v) => v, - None => { - return Err(Error::Message(format!( - "serialize_struct -> serialize_field -> no value found for key: {}", - key - ))) - } - }; - - self.formatter.format(&Triple { - subject: RioNamedNode { - iri: format!("{}{}", &subject.identifier_prefix, value.value()).as_str(), - } - .into(), - predicate: RioNamedNode { - iri: "http://www.w3.org/1999/02/22-rdf-syntax-ns#type", - }, - object: RioNamedNode { - iri: subject.rdf_type.as_str(), - } - .into(), - })?; - Ok(()) - } - - fn end(self) -> Result<()> { - println!("serialize_struct -> end"); - Ok(()) - } -} - -// Similar to `SerializeTupleVariant`, here the `end` method is responsible for -// closing both of the curly braces opened by `serialize_struct_variant`. -impl<'a, W: io::Write> ser::SerializeStructVariant for &mut Serializer<'a, W> { - type Ok = (); - type Error = Error; - - fn serialize_field(&mut self, key: &'static str, value: &T) -> Result - where - T: ?Sized + Serialize, - { - if !self.output.ends_with('{') { - self.output += ","; - } - key.serialize(&mut **self)?; - self.output += ":"; - value.serialize(&mut **self) - } - - fn end(self) -> Result<()> { - self.output += "}}"; - Ok(()) - } -} - -//////////////////////////////////////////////////////////////////////////////// - -#[cfg(test)] -mod tests { - use std::collections::HashMap; - - use serde::Serialize; - - use crate::{to_string, SerializerConfig, SubjectConfig}; - - #[test] - fn test_simple_struct() { - #[derive(Serialize)] - struct Test { - id: String, - } - - let config = SerializerConfig { - base_iri: "".to_string(), - namespaces: Default::default(), - subjects: HashMap::from([( - "Test".to_string(), - SubjectConfig { - struct_name: "Test".to_string(), - rdf_type: "https://example.org/ns#Test".to_string(), - identifier_field: "id".to_string(), - identifier_prefix: "https://ark.dasch.swiss/ark:/72163/1/".to_string(), - properties: Vec::new(), - }, - )]), - }; - - let test = Test { - id: "my-id".to_string(), - }; - let expected = " .\n"; - assert_eq!(to_string(&test, config).unwrap(), expected); - } -} diff --git a/serde-rdf/src/structure.rs b/serde-rdf/src/structure.rs deleted file mode 100644 index 4fbef2c3..00000000 --- a/serde-rdf/src/structure.rs +++ /dev/null @@ -1,46 +0,0 @@ -#![allow(unused_variables, unused_imports, dead_code)] - -use std::collections::HashMap; - -use rio_api::model::NamedNode; - -pub enum Term { - Literal(String), - Subject(String), -} - -/// A subject holds additional information for the serializer -/// to further configure how a specific rust struct should be serialized. -#[derive(Debug)] -pub struct SubjectConfig { - pub struct_name: String, - pub rdf_type: String, - pub identifier_field: String, - pub identifier_prefix: String, - pub properties: Vec, -} - -#[derive(Debug)] -pub struct PropertyConfig { - pub struct_field: String, - pub rdf_property: String, -} - -/// Serializer configuration containing mappings / instructions on how to -/// serialize rust structs into RDF. The config contains one ore more -/// `Subject`s. -#[derive(Debug)] -pub struct SerializerConfig { - pub base_iri: String, - pub namespaces: HashMap, - pub subjects: HashMap, -} - -#[derive(Debug)] -pub struct SubjectBuilder { - struct_name: String, - rdf_type: String, - identifier_field: String, - identifier_prefix: String, - properties: Vec, -} diff --git a/dsp-meta/src/api/convert/axum/mod.rs b/src/api/convert/axum/mod.rs similarity index 100% rename from dsp-meta/src/api/convert/axum/mod.rs rename to src/api/convert/axum/mod.rs diff --git a/dsp-meta/src/api/convert/axum/responses.rs b/src/api/convert/axum/responses.rs similarity index 100% rename from dsp-meta/src/api/convert/axum/responses.rs rename to src/api/convert/axum/responses.rs diff --git a/dsp-meta/src/api/convert/mod.rs b/src/api/convert/mod.rs similarity index 100% rename from dsp-meta/src/api/convert/mod.rs rename to src/api/convert/mod.rs diff --git a/dsp-meta/src/api/handler/health.rs b/src/api/handler/health.rs similarity index 100% rename from dsp-meta/src/api/handler/health.rs rename to src/api/handler/health.rs diff --git a/dsp-meta/src/api/handler/mod.rs b/src/api/handler/mod.rs similarity index 100% rename from dsp-meta/src/api/handler/mod.rs rename to src/api/handler/mod.rs diff --git a/dsp-meta/src/api/handler/robots_txt.rs b/src/api/handler/robots_txt.rs similarity index 100% rename from dsp-meta/src/api/handler/robots_txt.rs rename to src/api/handler/robots_txt.rs diff --git a/dsp-meta/src/api/handler/sitemap_xml.rs b/src/api/handler/sitemap_xml.rs similarity index 100% rename from dsp-meta/src/api/handler/sitemap_xml.rs rename to src/api/handler/sitemap_xml.rs diff --git a/dsp-meta/src/api/handler/v1/mod.rs b/src/api/handler/v1/mod.rs similarity index 100% rename from dsp-meta/src/api/handler/v1/mod.rs rename to src/api/handler/v1/mod.rs diff --git a/dsp-meta/src/api/handler/v1/projects/handlers.rs b/src/api/handler/v1/projects/handlers.rs similarity index 100% rename from dsp-meta/src/api/handler/v1/projects/handlers.rs rename to src/api/handler/v1/projects/handlers.rs diff --git a/dsp-meta/src/api/handler/v1/projects/mod.rs b/src/api/handler/v1/projects/mod.rs similarity index 100% rename from dsp-meta/src/api/handler/v1/projects/mod.rs rename to src/api/handler/v1/projects/mod.rs diff --git a/dsp-meta/src/api/handler/v1/projects/responses.rs b/src/api/handler/v1/projects/responses.rs similarity index 100% rename from dsp-meta/src/api/handler/v1/projects/responses.rs rename to src/api/handler/v1/projects/responses.rs diff --git a/dsp-meta/src/api/mod.rs b/src/api/mod.rs similarity index 100% rename from dsp-meta/src/api/mod.rs rename to src/api/mod.rs diff --git a/dsp-meta/src/api/router.rs b/src/api/router.rs similarity index 97% rename from dsp-meta/src/api/router.rs rename to src/api/router.rs index e6ef50c5..3dca26e2 100644 --- a/dsp-meta/src/api/router.rs +++ b/src/api/router.rs @@ -98,7 +98,7 @@ mod tests { #[tokio::test] async fn test_health_route() { - let data_dir = env::current_dir().unwrap().parent().unwrap().join("data"); + let data_dir = env::current_dir().unwrap().join("data"); let shared_state = Arc::new(AppState { metadata_service: MetadataService::new(MetadataRepository::from_path( @@ -131,7 +131,7 @@ mod tests { #[tokio::test] async fn test_not_found_project() { - let data_dir = env::current_dir().unwrap().parent().unwrap().join("data"); + let data_dir = env::current_dir().unwrap().join("data"); let shared_state = Arc::new(AppState { metadata_service: MetadataService::new(MetadataRepository::from_path( diff --git a/dsp-meta/src/app_state.rs b/src/app_state.rs similarity index 100% rename from dsp-meta/src/app_state.rs rename to src/app_state.rs diff --git a/dsp-meta-cmd/src/cli.rs b/src/cli.rs similarity index 100% rename from dsp-meta-cmd/src/cli.rs rename to src/cli.rs diff --git a/dsp-meta/src/domain/metadata_repository.rs b/src/domain/metadata_repository.rs similarity index 98% rename from dsp-meta/src/domain/metadata_repository.rs rename to src/domain/metadata_repository.rs index 04497591..eb3c2da7 100644 --- a/dsp-meta/src/domain/metadata_repository.rs +++ b/src/domain/metadata_repository.rs @@ -161,7 +161,7 @@ mod tests { #[test] fn successfully_load_all_metadata_files() { - let data_dir = env::current_dir().unwrap().parent().unwrap().join("data"); + let data_dir = env::current_dir().unwrap().join("data"); dbg!(&data_dir); let files = load_json_file_paths(&data_dir); diff --git a/dsp-meta/src/domain/metadata_service.rs b/src/domain/metadata_service.rs similarity index 100% rename from dsp-meta/src/domain/metadata_service.rs rename to src/domain/metadata_service.rs diff --git a/dsp-meta/src/domain/mod.rs b/src/domain/mod.rs similarity index 100% rename from dsp-meta/src/domain/mod.rs rename to src/domain/mod.rs diff --git a/dsp-meta/src/domain/model/draft_model.rs b/src/domain/model/draft_model.rs similarity index 100% rename from dsp-meta/src/domain/model/draft_model.rs rename to src/domain/model/draft_model.rs diff --git a/dsp-meta/src/domain/model/error.rs b/src/domain/model/error.rs similarity index 100% rename from dsp-meta/src/domain/model/error.rs rename to src/domain/model/error.rs diff --git a/dsp-meta/src/domain/model/json_schema_validator.rs b/src/domain/model/json_schema_validator.rs similarity index 100% rename from dsp-meta/src/domain/model/json_schema_validator.rs rename to src/domain/model/json_schema_validator.rs diff --git a/dsp-meta/src/domain/model/mod.rs b/src/domain/model/mod.rs similarity index 100% rename from dsp-meta/src/domain/model/mod.rs rename to src/domain/model/mod.rs diff --git a/dsp-meta/src/error.rs b/src/error.rs similarity index 100% rename from dsp-meta/src/error.rs rename to src/error.rs diff --git a/dsp-meta/src/infrastructure/mod.rs b/src/infrastructure/mod.rs similarity index 100% rename from dsp-meta/src/infrastructure/mod.rs rename to src/infrastructure/mod.rs diff --git a/dsp-meta/src/lib.rs b/src/lib.rs similarity index 100% rename from dsp-meta/src/lib.rs rename to src/lib.rs diff --git a/dsp-meta-cmd/src/main-server.rs b/src/main-server.rs similarity index 98% rename from dsp-meta-cmd/src/main-server.rs rename to src/main-server.rs index a24afb59..cb352727 100644 --- a/dsp-meta-cmd/src/main-server.rs +++ b/src/main-server.rs @@ -78,6 +78,7 @@ async fn init_server() { // start the server let listener = TcpListener::bind("0.0.0.0:3000").await.unwrap(); + dbg!("Starting up on http://0.0.0.0:3000"); axum::serve(listener, dsp_meta::api::router::router(shared_state)) .await .unwrap(); diff --git a/dsp-meta-cmd/src/main-validator.rs b/src/main-validator.rs similarity index 100% rename from dsp-meta-cmd/src/main-validator.rs rename to src/main-validator.rs diff --git a/dsp-meta/tests/api_tests.rs b/tests/api_tests.rs similarity index 100% rename from dsp-meta/tests/api_tests.rs rename to tests/api_tests.rs diff --git a/dsp-meta/tests/draft_schema_test.rs b/tests/draft_schema_test.rs similarity index 96% rename from dsp-meta/tests/draft_schema_test.rs rename to tests/draft_schema_test.rs index 05d223ee..5d6a464f 100644 --- a/dsp-meta/tests/draft_schema_test.rs +++ b/tests/draft_schema_test.rs @@ -65,10 +65,7 @@ fn test_deserialization_all_json_data() { } fn data_dir() -> PathBuf { - let mut current_dir = env::current_dir() - .ok() - .and_then(|e| e.parent().map(|p| p.to_path_buf())) - .expect("Project root dir"); + let mut current_dir = env::current_dir().expect("Project root dir"); current_dir.push("data"); current_dir }