id: https://w3id.org/ber-data/attributes
name: attributes
title: Reusable attributes (draft)
version: 0.1.0
description: >-
  String-valued attributes for metadata, annotations, and source-reported evidence, with an
  optional CURIE for the key and an optional number for the value.
license: https://creativecommons.org/publicdomain/zero/1.0/
prefixes:
  linkml: https://w3id.org/linkml/
  battr: https://w3id.org/ber-data/attributes/
  kb_cdm: http://kbase.github.io/cdm-schema/linkml/
  nmdc: https://w3id.org/nmdc/
default_prefix: battr
default_range: string
imports:
  - linkml:types
classes:
  Attribute:
    title: Attribute
    class_uri: battr:Attribute
    description: One named value attached to a record by a consuming model.
    notes:
      - attribute_cv_id and numeric_value were added 2026-09-29 for
        https://github.com/turbomam/feature-table-corpus/issues/42, so a profile can give e-value
        and evalue one meaning and filter e-values without a cast. They follow the NMDC
        AttributeValue pattern that BERtron and the KBase CDM use (an optional attribute CURIE
        plus the raw string, with a typed value), which this pair can be projected onto later.
        Both are optional, and key and value keep the source's text.
      - GFF column 9 is a minimal use case, alongside tabular annotations and metadata.
        This module has no dependency on GFF, SequenceFeature, Contig, or a genomic coordinate system.
      - A key is not an identifier; repeated keys can remain separate entries in an ordered list.
        Consuming models choose attachment and cardinality. Keys are source names, not a controlled vocabulary.
      - A value is the source's text for one item, as a string, after the source profile has split
        any list and undone its own escapes, so a GFF3 x%2Cy is stored as x,y. The escaped spelling
        belongs to the source serialization, not to this module. Typed values, units, nested
        structures, and per-attribute provenance are extension questions; this module does not
        define a parser, escaping rules, or a lossless serialization for any source format.
      - Each value of a multivalued source attribute is its own Attribute entry, with the same key,
        in source order; one entry never holds a joined list. Splitting happens before any
        percent-decoding, so an encoded separator (a GFF %2C) stays inside one value. Which keys
        are multivalued is a property of the source profile. A GFF3-conformant profile treats
        every key as a comma list; a dialect whose writers do not encode commas declares its
        multivalued keys and keeps every other value whole, literal commas included. See
        docs/attributes.md and https://github.com/turbomam/feature-table-corpus/issues/39.
    attributes:
      key:
        title: Key
        slot_uri: battr:key
        range: string
        required: true
        description: Source-reported attribute name, unnormalized (for example a GFF tag or metadata key).
      value:
        title: Value
        slot_uri: battr:value
        range: string
        required: true
        description: >-
          The source's text for one value, as a string: not typed or normalized, with any escapes
          the source profile defines decoded (a GFF3 %2C is stored as a comma).
      attribute_cv_id:
        title: Attribute CV ID
        slot_uri: battr:attribute_cv_id
        range: uriorcurie
        description: >-
          A CURIE for what the key means, from an ontology or controlled vocabulary, set by a
          profile that maps this key; for example EDAM:data_1667 (E-value) for both e-value and
          evalue. key keeps the source spelling either way.
        exact_mappings:
          - kb_cdm:attribute_cv_id
      numeric_value:
        title: Numeric value
        slot_uri: battr:numeric_value
        range: float
        description: >-
          value read as a number, set by a profile only for keys it knows are numeric. value
          keeps the source text, so 3.4e-28 and 3.40E-28 stay distinguishable. The validator
          requires the float that value reads as, and refuses an integer no float holds exactly.
        exact_mappings:
          - kb_cdm:numeric_value
          - nmdc:numeric_value
