@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix gs1: <https://ref.gs1.org/voc/> .
@prefix usfsma: <https://ref.openepcis.io/extensions/us/fsma204/> .
@prefix dcterms: <http://purl.org/dc/terms/> .
@prefix skos: <http://www.w3.org/2004/02/skos/core#> .
@prefix vann: <http://purl.org/vocab/vann/> .

# =============================================================================
# Ontology Declaration
# =============================================================================
#
# This module is intentionally MINIMAL.
#
# Per GS1 US "EPCIS Recommendations for FSMA 204 Critical Tracking Events" R2.0
# (May 2025) and "Application of GS1 System of Standards to Support FSMA 204" R3.0
# (Dec 2025), every FSMA 204 Key Data Element maps onto a NATIVE EPCIS 2.0 or
# GS1 Web Vocabulary field:
#
#   - Traceability Lot Code -> GS1 Digital Link GTIN+Batch/Lot in
#     quantityList.epcClass / outputQuantityList.epcClass / childQuantityList.epcClass
#   - Location KDEs         -> /414/{GLN} URIs in readPoint / bizLocation / sourceList / destinationList
#   - Party KDEs            -> /417/{GLN} URIs in sourceList (type=owning_party) / destinationList
#   - Dates                 -> eventTime
#   - Reference documents   -> bizTransactionList
#   - Seafood KDEs          -> ilmd with gs1:catchZone / gs1:harvestDateStart / gs1:harvestDateEnd / gs1:fishType
#   - CTE identification    -> combination of EPCIS event type + bizStep (NO RDF class needed)
#
# There are therefore no CTE classes, no "TraceabilityLotCode" class, and no
# event-level usfsma: properties in this vocabulary. The only concept that GS1 US
# does NOT already cover is the Food Traceability List categorisation of a
# trade item, and that is the sole thing this module contributes.
# =============================================================================

<https://ref.openepcis.io/extensions/us/fsma204/>
    a owl:Ontology ;
    dcterms:title "OpenEPCIS FSMA 204 Vocabulary"@en ;
    dcterms:description """Minimal OpenEPCIS vocabulary for the U.S. FDA Food Safety Modernization Act §204 Final Rule on Food Traceability (21 CFR Part 1 Subpart S).

All FSMA 204 Key Data Elements ride on native EPCIS 2.0 / GS1 Web Vocabulary fields per GS1 US R2.0 / R3.0. This module therefore contributes only the single concept that GS1 US does not already cover: the FDA Food Traceability List categorisation of a trade item, via:

  - usfsma:FoodTraceabilityList: enumeration of the 23 FDA-defined food categories
  - usfsma:foodTraceabilityListCategory: object property on gs1:Product

EPCIS event examples in this module's epcis/ directory are transcribed verbatim from GS1 US R2.0 and use only native EPCIS/GS1 fields. They do not reference any usfsma: class or property; the extension namespace exists purely for the master-data FTL categorisation.

References:
- FDA Food Traceability Final Rule: https://www.fda.gov/food/food-safety-modernization-act-fsma/fsma-final-rule-food-traceability
- 21 CFR Part 1 Subpart S: https://www.ecfr.gov/current/title-21/chapter-I/subchapter-A/part-1/subpart-S
- Food Traceability List: https://www.fda.gov/food/food-safety-modernization-act-fsma/food-traceability-list
- GS1 US EPCIS Recommendations R2.0: https://documents.gs1us.org/adobe/assets/deliver/urn:aaid:aem:0c934e38-7cd7-4a86-aac3-c54b4c9ef293/EPCIS-Recommendations-FSMA-204-Critical-Tracking-Events.pdf
- GS1 US Application Guideline R3.0: https://documents.gs1us.org/adobe/assets/deliver/urn:aaid:aem:8037d451-b557-4b0f-9fa8-fc94f94e4547/GS1-US-Application-of-GS1-System-of-Standards-to-Support-FSMA-204-Guideline.pdf"""@en ;
    dcterms:creator "OpenEPCIS" ;
    dcterms:license <https://www.apache.org/licenses/LICENSE-2.0> ;
    dcterms:created "2026-04-17"^^xsd:date ;
    dcterms:modified "2026-06-19"^^xsd:date ;
    owl:versionInfo "0.9.7" ;
    owl:versionIRI <https://ref.openepcis.io/extensions/us/fsma204/0.9.7> ;
    vann:preferredNamespacePrefix "usfsma" ;
    vann:preferredNamespaceUri "https://ref.openepcis.io/extensions/us/fsma204/" ;
    rdfs:seeAlso <https://www.fda.gov/food/food-safety-modernization-act-fsma/fsma-final-rule-food-traceability> ;
    rdfs:seeAlso <https://www.ecfr.gov/current/title-21/chapter-I/subchapter-A/part-1/subpart-S> ;
    owl:imports <https://ref.gs1.org/voc/> .

# =============================================================================
# Food Traceability List enumeration (FDA FTL as published 2022)
# =============================================================================

usfsma:FoodTraceabilityList
    a owl:Class ;
    rdfs:label "Food Traceability List category"@en ;
    rdfs:comment "FDA-defined categories of foods subject to FSMA 204 per the Food Traceability List (21 CFR 1.1300). The FDA list enumerates distinct food types with explicit splits (leafy greens non-cut vs fresh-cut; three cheese pasteurisation classes; individual produce items; four finfish classes). The FDA updates the list periodically; this enum reflects the 2022 publication."@en ;
    dcterms:source <https://www.fda.gov/food/food-safety-modernization-act-fsma/food-traceability-list> ;
    owl:oneOf (
        usfsma:LeafyGreens
        usfsma:LeafyGreensFreshCut
        usfsma:CheesePasteurizedFreshSoft
        usfsma:CheesePasteurizedSoftRipenedOrSemiSoft
        usfsma:CheeseUnpasteurizedOtherThanHard
        usfsma:ShellEggs
        usfsma:Sprouts
        usfsma:Cucumbers
        usfsma:Melons
        usfsma:Peppers
        usfsma:Tomatoes
        usfsma:FruitsFreshCut
        usfsma:VegetablesOtherThanLeafyGreensFreshCut
        usfsma:HerbsFresh
        usfsma:TropicalTreeFruits
        usfsma:FinfishHistamineProducing
        usfsma:FinfishCiguatoxinAssociated
        usfsma:FinfishOther
        usfsma:SmokedFinfish
        usfsma:Crustaceans
        usfsma:MolluscanShellfish
        usfsma:ReadyToEatDeliSalads
        usfsma:NutButters
    ) ;
    skos:note "FDA Food Traceability List categories per FSMA 204 (21 CFR 1 Subpart S). US food-safety scoping concept with no GS1, SEMICeu, or schema.org equivalent."@en ;
    skos:broadMatch gs1:FruitsVegetables .

usfsma:LeafyGreens                             a usfsma:FoodTraceabilityList ; rdfs:label "Leafy greens (excluding fresh-cut)"@en .
usfsma:LeafyGreensFreshCut                     a usfsma:FoodTraceabilityList ; rdfs:label "Leafy greens, fresh-cut"@en .
usfsma:CheesePasteurizedFreshSoft              a usfsma:FoodTraceabilityList ; rdfs:label "Cheese, pasteurized, fresh soft or soft unripened"@en .
usfsma:CheesePasteurizedSoftRipenedOrSemiSoft  a usfsma:FoodTraceabilityList ; rdfs:label "Cheese, pasteurized, soft-ripened or semi-soft"@en .
usfsma:CheeseUnpasteurizedOtherThanHard        a usfsma:FoodTraceabilityList ; rdfs:label "Cheese, unpasteurized (other than hard cheese)"@en .
usfsma:ShellEggs                               a usfsma:FoodTraceabilityList ; rdfs:label "Shell eggs"@en .
usfsma:Sprouts                                 a usfsma:FoodTraceabilityList ; rdfs:label "Sprouts"@en .
usfsma:Cucumbers                               a usfsma:FoodTraceabilityList ; rdfs:label "Cucumbers (fresh)"@en .
usfsma:Melons                                  a usfsma:FoodTraceabilityList ; rdfs:label "Melons (fresh)"@en .
usfsma:Peppers                                 a usfsma:FoodTraceabilityList ; rdfs:label "Peppers (fresh)"@en .
usfsma:Tomatoes                                a usfsma:FoodTraceabilityList ; rdfs:label "Tomatoes (fresh)"@en .
usfsma:FruitsFreshCut                          a usfsma:FoodTraceabilityList ; rdfs:label "Fruits, fresh-cut"@en .
usfsma:VegetablesOtherThanLeafyGreensFreshCut  a usfsma:FoodTraceabilityList ; rdfs:label "Vegetables other than leafy greens, fresh-cut"@en .
usfsma:HerbsFresh                              a usfsma:FoodTraceabilityList ; rdfs:label "Herbs (fresh)"@en .
usfsma:TropicalTreeFruits                      a usfsma:FoodTraceabilityList ; rdfs:label "Tropical tree fruits (fresh)"@en .
usfsma:FinfishHistamineProducing               a usfsma:FoodTraceabilityList ; rdfs:label "Finfish, histamine-producing species"@en .
usfsma:FinfishCiguatoxinAssociated             a usfsma:FoodTraceabilityList ; rdfs:label "Finfish, ciguatoxin-associated species"@en .
usfsma:FinfishOther                            a usfsma:FoodTraceabilityList ; rdfs:label "Finfish, other species (not histamine, not ciguatoxin)"@en .
usfsma:SmokedFinfish                           a usfsma:FoodTraceabilityList ; rdfs:label "Finfish, smoked"@en .
usfsma:Crustaceans                             a usfsma:FoodTraceabilityList ; rdfs:label "Crustaceans"@en .
usfsma:MolluscanShellfish                      a usfsma:FoodTraceabilityList ; rdfs:label "Molluscan shellfish, bivalves"@en .
usfsma:ReadyToEatDeliSalads                    a usfsma:FoodTraceabilityList ; rdfs:label "Ready-to-eat deli salads (refrigerated)"@en .
usfsma:NutButters                              a usfsma:FoodTraceabilityList ; rdfs:label "Nut butters"@en .

# =============================================================================
# The single property this module contributes
# =============================================================================

usfsma:foodTraceabilityListCategory
    a owl:ObjectProperty ;
    rdfs:label "Food Traceability List category"@en ;
    rdfs:comment "Declares that a trade item (gs1:Product) falls under a specific FDA Food Traceability List category. This is the only FSMA KDE that GS1 US's guidance does not already cover via native GS1 master-data attributes; the FTL category is what determines whether the food is in scope of the rule at all."@en ;
    rdfs:domain gs1:Product ;
    rdfs:range usfsma:FoodTraceabilityList ;
    dcterms:source <https://www.ecfr.gov/current/title-21/chapter-I/subchapter-A/part-1/subpart-S/section-1.1300> ;
    skos:note "The one FSMA 204 KDE not covered by native GS1 master-data attributes: the FTL category determines whether a food is in scope of the rule (21 CFR 1.1300)."@en ;
    skos:narrowMatch <https://schema.org/category> .
