From 56e7d6655d6082caee6e68ce8c2bb319bfcc245a Mon Sep 17 00:00:00 2001 From: David Linke Date: Thu, 5 Dec 2024 15:09:21 +0100 Subject: [PATCH] Add class RepresentationVariant Adds support for storing multiple represenations of the resource with different IANA media type. Closes #12 --- src/data/examples/PID4CatRecord-001.yaml | 9 ++-- src/pid4cat_model/schema/pid4cat_model.yaml | 52 ++++++++++++--------- 2 files changed, 35 insertions(+), 26 deletions(-) diff --git a/src/data/examples/PID4CatRecord-001.yaml b/src/data/examples/PID4CatRecord-001.yaml index 83900c6..f3d3382 100644 --- a/src/data/examples/PID4CatRecord-001.yaml +++ b/src/data/examples/PID4CatRecord-001.yaml @@ -9,10 +9,11 @@ contains_pids: label: Resource label description: Resource description resource_category: SAMPLE - rdf_url: https://example.org/resource - rdf_type: TURTLE - schema_url: https://example.org/schema - schema_type: XSD + representation_variants: + - url: https://example.org/resource + media_type: text/turtle + encoding_format: UTF-8 + size: 12345 license: CC0-1.0 curation_contact_email: datafuzzi@example.org change_log: diff --git a/src/pid4cat_model/schema/pid4cat_model.yaml b/src/pid4cat_model/schema/pid4cat_model.yaml index bf7eb2a..d540e3d 100644 --- a/src/pid4cat_model/schema/pid4cat_model.yaml +++ b/src/pid4cat_model/schema/pid4cat_model.yaml @@ -73,10 +73,7 @@ classes: - label - description - resource_category - - rdf_url - - rdf_type - - schema_url - - schema_type + - representation_variants LogRecord: description: >- @@ -99,6 +96,14 @@ classes: email: pattern: "^\\S+@[\\S+\\.]+\\S+" + RepresentationVariant: + description: A representation of the resource in other media types than + text/html which is the default for landing_page_url. + slots: + - media_type + - encoding_format + - size + - url Container: description: >- @@ -182,25 +187,12 @@ slots: slot_uri: schema:additionalType range: ResourceCategory description: The category of the resource. - rdf_url: - slot_uri: schema:additionalType - description: >- - The URI of the rdf representation of the resource. - rdf_type: - slot_uri: schema:additionalType - description: >- - The format of the rdf representation of the resource (xml, turtle, json-ld, ...). - schema_url: - slot_uri: schema:additionalType - description: >- - The URI of the schema to which the resource conforms. - Same property as in DataCite:schemeURI. - schema_type: - slot_uri: schema:additionalType + representation_variants: + # slot_uri: ? + range: RepresentationVariant + multivalued: true description: >- - The type of the schema to which the resource conforms. - Examples: XSD, DDT, SHACL - Same property as in DataCite:schemeType. + The representations of the resource in other media types than text/html. # Slots for LogRecord changed_field: @@ -226,6 +218,22 @@ slots: range: PID4CatAgentRole description: The role of the agent relative to the resource + # Slots for RepresentationVariants + media_type: + slot_uri: schema:encodingFormat + description: >- + The media type of the representation as defined by [IANA](https://www.iana.org/assignments/media-types/media-types.xhtml) + encoding_format: + # slot_uri: ? + description: >- + The encoding of the representation. https://encoding.spec.whatwg.org/#names-and-labels + size: + slot_uri: schema:fileSize + description: The size of the representation in bytes. + url: + slot_uri: schema:URL + description: The URL of the representation. + enums: # Enumerations use singular form for names ResourceCategory: