Skip to content

Class: FoodCategory

Mixin for food-specific slots, value maps, and UC rules. Applied to FoodItem via mixins: [FoodCategory]. Grounded in FoodOn (OBO Foundry): http://purl.obolibrary.org/obo/foodon.owl Does not extend CategoryMixin — see schema description for rationale. Phase 1 stub — sort_food process path activated on food-bank onboarding.

URI: inkind_knowledge_repo:FoodCategory

 classDiagram
    class FoodCategory
    click FoodCategory href "../FoodCategory/"
      FoodCategory <|-- FoodItem
        click FoodItem href "../FoodItem/"

      FoodCategory : expiry_date

      FoodCategory : food_type





        FoodCategory --> "1" FoodTypeEnum : food_type
        click FoodTypeEnum href "../FoodTypeEnum/"



      FoodCategory : packaging_intact

      FoodCategory : quantity

      FoodCategory : storage_requirement





        FoodCategory --> "1" StorageRequirementEnum : storage_requirement
        click StorageRequirementEnum href "../StorageRequirementEnum/"



Class Properties

Property Value
Mixin Yes

Slots

Name Cardinality and Range Description Inheritance
food_type 1
FoodTypeEnum
Primary food type classification direct
expiry_date 0..1
Date
Expiry or best-before date as printed on the packaging direct
packaging_intact 1
Boolean
Whether the item's original packaging is intact and uncompromised direct
storage_requirement 1
StorageRequirementEnum
Required storage condition direct
quantity 0..1
Integer
Quantity in natural units (items, cans, bags, kg, etc direct

Mixin Usage

mixed into description
FoodItem Food donation item

Rules

uc-packaging-perishable-block

Rule Applied Preconditions Postconditions Elseconditions
slot_conditions {'packaging_intact': {'equals_string': 'false'}, 'food_type': {'any_of': [{'equals_string': 'fresh_produce'}, {'equals_string': 'dairy'}, {'equals_string': 'frozen'}, {'equals_string': 'baby_food'}]}} {'lifecycle_state': {'none_of': [{'equals_string': 'stored'}, {'equals_string': 'distributed'}]}}

uc-expiry-date-past-block

Rule Applied Preconditions Postconditions Elseconditions

vm-storage-frozen

Rule Applied Preconditions Postconditions Elseconditions
slot_conditions {'food_type': {'equals_string': 'frozen'}} {'storage_requirement': {'equals_string': 'frozen'}}

vm-storage-dairy

Rule Applied Preconditions Postconditions Elseconditions
slot_conditions {'food_type': {'equals_string': 'dairy'}} {'storage_requirement': {'any_of': [{'equals_string': 'refrigerated'}, {'equals_string': 'frozen'}]}}

vm-storage-canned

Rule Applied Preconditions Postconditions Elseconditions
slot_conditions {'food_type': {'equals_string': 'canned_goods'}} {'storage_requirement': {'equals_string': 'ambient'}}

See Also

Identifier and Mapping Information

Annotations

property value
completeness_minimal food_type, packaging_intact, usage
completeness_standard food_type, packaging_intact, storage_requirement, usage
completeness_detailed food_type, packaging_intact, storage_requirement, expiry_date, quantity, usage
coicop_division 01
phase Phase 1 stub

Schema Source

  • from schema: https://inkind-at.github.io/inkind-knowledge-repo

Mappings

Mapping Type Mapped Value
self inkind_knowledge_repo:FoodCategory
native inkind_knowledge_repo:FoodCategory

LinkML Source

Direct

name: FoodCategory
annotations:
  completeness_minimal:
    tag: completeness_minimal
    value: food_type, packaging_intact, usage
  completeness_standard:
    tag: completeness_standard
    value: food_type, packaging_intact, storage_requirement, usage
  completeness_detailed:
    tag: completeness_detailed
    value: food_type, packaging_intact, storage_requirement, expiry_date, quantity,
      usage
  coicop_division:
    tag: coicop_division
    value: '01'
  phase:
    tag: phase
    value: Phase 1 stub
description: 'Mixin for food-specific slots, value maps, and UC rules. Applied to
  FoodItem via mixins: [FoodCategory]. Grounded in FoodOn (OBO Foundry): http://purl.obolibrary.org/obo/foodon.owl
  Does not extend CategoryMixin  see schema description for rationale. Phase 1 stub
   sort_food process path activated on food-bank onboarding.'
from_schema: https://inkind-at.github.io/inkind-knowledge-repo
see_also:
- foodon:00001006
- http://purl.obolibrary.org/obo/foodon.owl
mixin: true
slots:
- food_type
- expiry_date
- packaging_intact
- storage_requirement
- quantity
slot_usage:
  food_type:
    name: food_type
    required: true
  packaging_intact:
    name: packaging_intact
    required: true
  storage_requirement:
    name: storage_requirement
    required: true
  expiry_date:
    name: expiry_date
    annotations:
      uc_action:
        tag: uc_action
        value: block
      uc_suggest:
        tag: uc_suggest
        value: disposal
      uc_note:
        tag: uc_note
        value: Dynamic date comparison — runtime enforcement
    description: 'Expiry or best-before date as printed on the packaging. UC block:
      expiry_date < today (runtime check by Django model clean()).'
    see_also:
    - foodon:00001043
rules:
- preconditions:
    slot_conditions:
      packaging_intact:
        name: packaging_intact
        equals_string: 'false'
      food_type:
        name: food_type
        any_of:
        - equals_string: fresh_produce
        - equals_string: dairy
        - equals_string: frozen
        - equals_string: baby_food
  postconditions:
    slot_conditions:
      lifecycle_state:
        name: lifecycle_state
        none_of:
        - equals_string: stored
        - equals_string: distributed
  description: 'Perishable items with compromised packaging must not be redistributed.
    Food safety principle  perishable items cannot be safely redistributed once packaging
    integrity is lost. action: block.'
  title: uc-packaging-perishable-block
- annotations:
    enforcement:
      tag: enforcement
      value: application_layer
    uc_action:
      tag: uc_action
      value: block
    uc_suggest:
      tag: uc_suggest
      value: disposal
    uc_note:
      tag: uc_note
      value: expiry_date < today — runtime check by Django model clean()
  description: Items past expiry date must not be redistributed. Runtime check — dynamic
    date comparison not expressible as a static LinkML rule. Enforced by Django model
    clean() at save time.
  title: uc-expiry-date-past-block
- preconditions:
    slot_conditions:
      food_type:
        name: food_type
        equals_string: frozen
  postconditions:
    slot_conditions:
      storage_requirement:
        name: storage_requirement
        equals_string: frozen
  description: 'Frozen food requires frozen storage only. Breaking the cold chain
    makes frozen food unsafe to refreeze. action: block invalid value.'
  title: vm-storage-frozen
- preconditions:
    slot_conditions:
      food_type:
        name: food_type
        equals_string: dairy
  postconditions:
    slot_conditions:
      storage_requirement:
        name: storage_requirement
        any_of:
        - equals_string: refrigerated
        - equals_string: frozen
  description: Dairy requires refrigerated or frozen storage.
  title: vm-storage-dairy
- preconditions:
    slot_conditions:
      food_type:
        name: food_type
        equals_string: canned_goods
  postconditions:
    slot_conditions:
      storage_requirement:
        name: storage_requirement
        equals_string: ambient
  description: Canned goods are shelf-stable — ambient storage only.
  title: vm-storage-canned

Induced

name: FoodCategory
annotations:
  completeness_minimal:
    tag: completeness_minimal
    value: food_type, packaging_intact, usage
  completeness_standard:
    tag: completeness_standard
    value: food_type, packaging_intact, storage_requirement, usage
  completeness_detailed:
    tag: completeness_detailed
    value: food_type, packaging_intact, storage_requirement, expiry_date, quantity,
      usage
  coicop_division:
    tag: coicop_division
    value: '01'
  phase:
    tag: phase
    value: Phase 1 stub
description: 'Mixin for food-specific slots, value maps, and UC rules. Applied to
  FoodItem via mixins: [FoodCategory]. Grounded in FoodOn (OBO Foundry): http://purl.obolibrary.org/obo/foodon.owl
  Does not extend CategoryMixin  see schema description for rationale. Phase 1 stub
   sort_food process path activated on food-bank onboarding.'
from_schema: https://inkind-at.github.io/inkind-knowledge-repo
see_also:
- foodon:00001006
- http://purl.obolibrary.org/obo/foodon.owl
mixin: true
slot_usage:
  food_type:
    name: food_type
    required: true
  packaging_intact:
    name: packaging_intact
    required: true
  storage_requirement:
    name: storage_requirement
    required: true
  expiry_date:
    name: expiry_date
    annotations:
      uc_action:
        tag: uc_action
        value: block
      uc_suggest:
        tag: uc_suggest
        value: disposal
      uc_note:
        tag: uc_note
        value: Dynamic date comparison — runtime enforcement
    description: 'Expiry or best-before date as printed on the packaging. UC block:
      expiry_date < today (runtime check by Django model clean()).'
    see_also:
    - foodon:00001043
attributes:
  food_type:
    name: food_type
    description: Primary food type classification. Grounded in FoodOn food product
      taxonomy. Determines valid storage_requirement values via value map.
    from_schema: https://inkind-at.github.io/inkind-knowledge-repo
    see_also:
    - foodon:00001017
    rank: 1000
    alias: food_type
    owner: FoodCategory
    domain_of:
    - FoodCategory
    range: FoodTypeEnum
    required: true
  expiry_date:
    name: expiry_date
    annotations:
      uc_action:
        tag: uc_action
        value: block
      uc_suggest:
        tag: uc_suggest
        value: disposal
      uc_note:
        tag: uc_note
        value: Dynamic date comparison — runtime enforcement
    description: 'Expiry or best-before date as printed on the packaging. UC block:
      expiry_date < today (runtime check by Django model clean()).'
    from_schema: https://inkind-at.github.io/inkind-knowledge-repo
    see_also:
    - foodon:00001043
    rank: 1000
    alias: expiry_date
    owner: FoodCategory
    domain_of:
    - PersonalCareCategory
    - BabyInfantCategory
    - FoodCategory
    range: date
  packaging_intact:
    name: packaging_intact
    description: 'Whether the item''s original packaging is intact and uncompromised.
      UC block: false + perishable food_type  must not redistribute. Primary safety
      signal for food items  analogous to is_sealed in PersonalCareCategory.'
    from_schema: https://inkind-at.github.io/inkind-knowledge-repo
    see_also:
    - foodon:00001043
    rank: 1000
    alias: packaging_intact
    owner: FoodCategory
    domain_of:
    - FoodCategory
    range: boolean
    required: true
  storage_requirement:
    name: storage_requirement
    description: Required storage condition. Valid values constrained by food_type
      via vm-storage-* rules. Set during sorting to enable correct storage slot assignment
      and demand signal matching.
    from_schema: https://inkind-at.github.io/inkind-knowledge-repo
    rank: 1000
    alias: storage_requirement
    owner: FoodCategory
    domain_of:
    - FoodCategory
    range: StorageRequirementEnum
    required: true
  quantity:
    name: quantity
    description: Quantity in natural units (items, cans, bags, kg, etc.). Optional
      — detailed completeness tier. Supports demand signal fulfilment tracking.
    from_schema: https://inkind-at.github.io/inkind-knowledge-repo
    rank: 1000
    alias: quantity
    owner: FoodCategory
    domain_of:
    - FoodCategory
    range: integer
rules:
- preconditions:
    slot_conditions:
      packaging_intact:
        name: packaging_intact
        equals_string: 'false'
      food_type:
        name: food_type
        any_of:
        - equals_string: fresh_produce
        - equals_string: dairy
        - equals_string: frozen
        - equals_string: baby_food
  postconditions:
    slot_conditions:
      lifecycle_state:
        name: lifecycle_state
        none_of:
        - equals_string: stored
        - equals_string: distributed
  description: 'Perishable items with compromised packaging must not be redistributed.
    Food safety principle  perishable items cannot be safely redistributed once packaging
    integrity is lost. action: block.'
  title: uc-packaging-perishable-block
- annotations:
    enforcement:
      tag: enforcement
      value: application_layer
    uc_action:
      tag: uc_action
      value: block
    uc_suggest:
      tag: uc_suggest
      value: disposal
    uc_note:
      tag: uc_note
      value: expiry_date < today — runtime check by Django model clean()
  description: Items past expiry date must not be redistributed. Runtime check — dynamic
    date comparison not expressible as a static LinkML rule. Enforced by Django model
    clean() at save time.
  title: uc-expiry-date-past-block
- preconditions:
    slot_conditions:
      food_type:
        name: food_type
        equals_string: frozen
  postconditions:
    slot_conditions:
      storage_requirement:
        name: storage_requirement
        equals_string: frozen
  description: 'Frozen food requires frozen storage only. Breaking the cold chain
    makes frozen food unsafe to refreeze. action: block invalid value.'
  title: vm-storage-frozen
- preconditions:
    slot_conditions:
      food_type:
        name: food_type
        equals_string: dairy
  postconditions:
    slot_conditions:
      storage_requirement:
        name: storage_requirement
        any_of:
        - equals_string: refrigerated
        - equals_string: frozen
  description: Dairy requires refrigerated or frozen storage.
  title: vm-storage-dairy
- preconditions:
    slot_conditions:
      food_type:
        name: food_type
        equals_string: canned_goods
  postconditions:
    slot_conditions:
      storage_requirement:
        name: storage_requirement
        equals_string: ambient
  description: Canned goods are shelf-stable — ambient storage only.
  title: vm-storage-canned