Skip to content

Commit

Permalink
Add class RepresentationVariant
Browse files Browse the repository at this point in the history
Adds support for storing multiple represenations of the resource with
different IANA media type.

Closes #12
  • Loading branch information
dalito committed Dec 5, 2024
1 parent e760221 commit 56e7d66
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 26 deletions.
9 changes: 5 additions & 4 deletions src/data/examples/PID4CatRecord-001.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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: [email protected]
change_log:
Expand Down
52 changes: 30 additions & 22 deletions src/pid4cat_model/schema/pid4cat_model.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,7 @@ classes:
- label
- description
- resource_category
- rdf_url
- rdf_type
- schema_url
- schema_type
- representation_variants

LogRecord:
description: >-
Expand All @@ -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: >-
Expand Down Expand Up @@ -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:
Expand All @@ -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:
Expand Down

0 comments on commit 56e7d66

Please sign in to comment.