id: https://concepts.datalad.org/s/flat-files/unreleased
name: flat-files-schema
version: UNRELEASED
status: eunal:concept-status/DEPRECATED
title: FLAT files schema
description: |
  More information may be available on the schema's [about page](about).

  The schema definition is available as

  - [JSON-LD context](../unreleased.context.jsonld)
  - [LinkML YAML](../unreleased.yaml)
  - [LinkML YAML (static/resolved)](../unreleased.static.yaml)
  - [OWL TTL](../unreleased.owl.ttl)
  - [SHACL TTL](../unreleased.shacl.ttl)

comments:
  - ALL CONTENT HERE IS UNRELEASED AND MAY CHANGE ANY TIME

license: CC-BY-4.0

prefixes:
  dash: http://datashapes.org/dash#
  dcterms: http://purl.org/dc/terms/
  dlflat: https://concepts.datalad.org/s/flat/unreleased/
  dlflatfiles: https://concepts.datalad.org/s/flat-files/unreleased/
  dlidentifiers: https://concepts.datalad.org/s/identifiers/unreleased/
  dlcommonmx: https://concepts.datalad.org/s/common-mixin/unreleased/
  dlfilesmx: https://concepts.datalad.org/s/files-mixin/unreleased/
  dlrelationsmx: https://concepts.datalad.org/s/relations-mixin/unreleased/
  dlschemas: https://concepts.datalad.org/s/
  dlspatialmx: https://concepts.datalad.org/s/spatial-mixin/unreleased/
  dlthings: https://concepts.datalad.org/s/things/v1/
  dltypes: https://concepts.datalad.org/s/types/v1/
  eunal: http://publications.europa.eu/resource/authority/
  fabio: http://purl.org/spar/fabio/
  foaf: http://xmlns.com/foaf/0.1/
  linkml: https://w3id.org/linkml/
  obo: http://purl.obolibrary.org/obo/
  owl: http://www.w3.org/2002/07/owl#
  rdf: http://www.w3.org/1999/02/22-rdf-syntax-ns#
  rdfs: http://www.w3.org/2000/01/rdf-schema#
  sh: http://www.w3.org/ns/shacl#
  skos: http://www.w3.org/2004/02/skos/core#
  spdx: http://spdx.org/rdf/terms#
  xsd: http://www.w3.org/2001/XMLSchema#

default_prefix: dlflatfiles

emit_prefixes:
  - dlflat
  - dlflatfiles
  - dlidentifiers
  - dlcommonmx
  - dlrelationsmx
  - dlspatialmx
  - dlthings
  - dltypes
  - rdf
  - rdfs
  - skos
  - xsd

imports:
  - dlschemas:flat/unreleased
  - dlschemas:common-mixin/unreleased
  - dlschemas:relations-mixin/unreleased
  - dlschemas:spatial-mixin/unreleased
  - dlschemas:files-mixin/unreleased

slots:
  checksums:
    description: >-
      The checksum property provides a mechanism that can be used to verify
      that the contents of a file or package have not changed.
    range: Checksum
    multivalued: true
    inlined: true
    inlined_as_list: true
    exact_mappings:
      - spdx:checksum

classes:
  Distribution:
    is_a: FlatThing
    description: >-
      A specific representation of a data item, which may come in the form of
      an electronic file, or an archive or directory of many files, may be
      standalone or part of a larger collection.
    slots:
      - byte_size
      - checksums
      - distribution_of
      - format
      - kind
      - media_type
      - parts
    slot_usage:
      kind:
        annotations:
          sh:order: 1
      distribution_of:
        multivalued: true
        annotations:
          sh:order: 2
      byte_size:
        annotations:
          sh:order: 3
      format:
        annotations:
          sh:order: 4
      media_type:
        annotations:
          sh:order: 5
      checksums:
        annotations:
          sh:order: 6
      parts:
        range: NamedDistributionPart
        inlined: true
        annotations:
          sh:order: 7
    comments:
      - There is no `name` property or similar, because the focus is on the
        identity of the distribution content, not how it might be named
        in a particular context. For example, an image in JPEG format
        might be names "20250825_102385.jpg" on a camera and
        "me_at_the_party.jpg" elsewhere, but it would be the exact same
        image. Expressing naming in some context should be done within
        the scope of the containing entity (see `named_parts`).
    exact_mappings:
      - dcat:Distribution
      - fabio:DigitalManifestation

  NamedDistributionPart:
    description: >-
      An association class for attaching a `locator` as additional information to a
      `hasPart` relationship.
    slots:
      - locator
      - roles
      - object
    slot_usage:
      locator:
        description: A relative path in POSIX notation.
        key: true
        # ensure no leading slash
        pattern: '^[^/]+.*$'
      object:
        # this must be required, if we want to support key-based
        # access to the named distribution parts. this also
        # implies that we cannot support listings without content
        # identifiers
        required: true
        range: Distribution
