Structured listing integration guide

This is the implementation contract for a consuming application's listing ingestion, catalogue filters, localized display, and ontology-release migration. Use the HTTP OpenAPI document for generated types; use this guide for workflow and persistence decisions.

The single MeatBorsa canonical-model decision governs the target architecture. Consolidation and client retagging are pending. This guide still describes the existing contract, including separate scheme concepts and qualified display labels; clients must not infer a new identity mapping or response shape from the policy alone.

The integration model

A consuming application should treat Meat Ontology as three related services backed by the same immutable release:

  1. Resolve a listing into stable concept and attribute identities.
  2. Expand a query into the exact concept-ID set that the application applies to stored records.
  3. Render and migrate stored identities with release-scoped dictionaries, expansions, and replacement mappings.

Labels are presentation. IDs are identity. Every stored ontology decision must also carry the ontology release ID (taxonomyRelease.id; field name kept for compatibility) and resolver behavior checksum that produced it.

Required scopes

Use a server-side client with:

Never expose the service key to a browser. The application's backend should call the Meat Ontology API and expose only the consumer-specific result its frontend needs.

Resolve a listing

Every candidate's concept includes species[] and commodities[], each containing { id, canonicalLabel } references. These are always available on result.selection.primary, result.selection.alternatives[], and result.selection.options[].candidate, as well as result.candidates[] and result.qualifiers[]; no enrichment include is needed. Use them to qualify ambiguous product chips, such as Shoulder · Sheep meat. Commodity membership follows directed ancestry, so Beef and Veal remain distinct even though they share a species. A commodity candidate includes itself. Arrays are unique and sorted by ID; [] means no known membership, and multiple entries must not be collapsed to an arbitrary first value. Labels here are canonical; use commodity IDs with a dictionary for the same release to display localized commodity names.

result.commodity says which commodity the text is, apart from which product it is: { concept: { id, canonicalLabel }, basis, raw?, matchedTermId? }. Read it to answer a commodity question ("is this pork?") whatever the decision is. Its basis is request_context (the request's own commodity), named_in_text (one reviewed commodity name in the title, such as Pork flaps) or tagged_product (the one commodity of an auto-tagged product). It is omitted when the sources disagree, the title names several commodities, or none applies. Never derive the commodity from a held primary or from the alternatives: those belong to candidates, may be cut by limit, and may include another animal's fuzzy match. Never tag a product from result.commodity.

Send the sanitized listing title as text. If the application has a separately maintained catalogue product name, send it as an alternate instead of concatenating it into the title. Send structured source facts as context or observations. Send a longer description, specification, or commercial paragraph through supportingTexts; never repurpose it as an alternate product name.

Never prepend a category path, category label, or catalogue product name to text. Prepending changes the lexical evidence and can create a competing product head. Resolve the title and each alternate independently; if two exact inputs name unrelated products, Meat Ontology returns an alternateTexts context_conflict, which must block automatic tagging.

POST /v1/resolve
Authorization: Bearer $TAXONOMY_API_KEY
Content-Type: application/json
{
  "text": "HALAL MROŻONA POLĘDWICZKA WIEPRZOWA BEZ KOŚCI, IVP, PL",
  "locale": "en",
  "metadataLocale": "pl",
  "alternateTexts": [
    {
      "role": "catalogue_product_name",
      "text": "polędwiczka wieprzowa"
    }
  ],
  "supportingTexts": [
    {
      "role": "listing_description",
      "locale": "pl",
      "text": "Mrożona, bez kości, pakowana IVP. Warunki handlowe EXW Warszawa."
    }
  ],
  "context": {
    "commodity": "Pork",
    "species": "Domestic pig"
  },
  "observations": {
    "refrigeration": "frozen",
    "originCountry": ["PL"],
    "certificationClaim": ["halal"],
    "packaging": ["ivp"]
  },
  "include": ["concept", "enrichment"],
  "includeAttributeMetadata": true,
  "limit": 5
}

Input-field rules

Field Consumer source Meaning
text Sanitized listing title Product wording and text-borne attributes. Required.
assist Explicit per-request opt-in "on" asks a configured REST API server for Carcass assistance after a helpable review result. "always" also asks on auto_tag and when the resolver abstains among candidates (selection_ambiguous or selection_unresolved). Raptor's resolve dialog sends "always". Omit it or use "off" for ordinary product and grade assistance; title-weight role assistance can still run. A matching title-weight role or validated missing title attribute may change result.attributes.
selection Assisted or human-reviewed identity { conceptId, source, confidence }. The concept must be active and orderable in the resolved release. This fixes identity only; text remains the attribute evidence.
alternateTexts[].text Catalogue productName Independent evidence for product identity. Do not concatenate it into text.
supportingTexts[] Description, specification, or commercial paragraph Governed supporting evidence. It cannot introduce competing product candidates or unknown-vocabulary feedback. Matching original weight specifications can supply a missing unit for an already identified title range.
locale Source language when genuinely known A ranking hint only. A wrong hint does not suppress Polish, German, Bulgarian, or English reviewed terms and aliases.
metadataLocale User/UI language Presentation only. It never changes selection or normalized values.
context.commodity Consumer category such as Pork or Beef A compatibility boundary; it cannot silently override conflicting title evidence.
context.species Separately confirmed source species A compatibility boundary and possible commodity bridge.
context.animalClass Separately confirmed animal class Compared with title evidence; disagreement produces an ambiguity.
context.market, context.scheme Confirmed market or standard Use only when the consumer actually knows it. Do not infer a scheme from a label.
observations.trimCode Confirmed buyer specification { family: "pork-d-trim", code, scope } within reviewed RFQ coverage.
observations.refrigeration Structured source field One of fresh, chilled, or frozen.
observations.originCountry Structured source field ISO 3166-1 alpha-2 codes, for example PL, DE, or BG.
observations.certificationClaim Structured source claim A stated claim; Meat Ontology does not verify a certificate.
observations.packaging Structured source field A stated packaging form or trade term.

Legacy flat market, scheme, species, commodity, and animalClass fields remain accepted. New consumer integrations should use context. Supplying different flat and nested values for the same field is a 400 REQUEST_INVALID conflict.

Accidental prices in identity text

Callers should still remove pricing and unrelated commercial fields while constructing the sanitized product phrase. As a defense in depth, Resolve recognizes high-confidence prices that contain both an amount and an explicit supported currency, with an optional per-unit suffix. For example, Chicken gizzards Gr. A, 2,10 €/kg resolves the gizzard and grade while returning:

{
  "commercialValues": [
    {
      "kind": "unit_price",
      "amount": 2.1,
      "currency": "EUR",
      "unit": "kg",
      "raw": "2,10 €/kg",
      "normalized": "2.1 EUR / kg",
      "confidence": 0.99,
      "basis": "structured_pattern"
    }
  ]
}

Recognized prices are commercial metadata, not ontology attributes. They do not participate in product matching, do not block automatic tagging, and are not submitted to unknown-vocabulary aggregation. Resolve deliberately does not strip currency-free values such as 2.10/kg, ratios, weights, or ambiguous thousands-formatted amounts; those retain their existing typed attribute or blocking-residue behavior. This boundary prevents a broad numeric cleanup rule from hiding product codes or unsupported structured evidence.

The accepted structured certification claims are halal, kosher, red-tractor, ifs, brcgs, haccp, iso-22000, fsis, tuv, imta, and organic. Packaging accepts box, carton, jumbo-box, crate, iwp, ivp, vacuum, polyblock, naked-block, plate-frozen, and hanging.

Since resolver 1.188.0, confirmed packaging values also describe attributes.packagingOptions, using the published mapping in the packaging decision record.

Explicit fresh/frozen offer alternatives use observations.attributes.refrigerationOptions with { "relation": "alternatives", "options": [{ "refrigeration": "fresh" }, { "refrigeration": "frozen" }] }. The response returns the same normalized structure with evidence. Each option may include a packagingOptions structure. Preserve these condition/package pairs; do not flatten them into independent lists or choose one legacy scalar. A compatible title or confirmed scalar such as fresh does not narrow an explicit fresh/frozen offer. Different option sets remain conflicting. RFQ discovery exposes the new field and its input path. Consumers must adopt this field to store and display multiple offered conditions; ontology publication alone does not migrate client data.

Weight ranges and evidence

Resolver 1.133.0 recognizes 4/5lbs, 1,5/2 kg and 300/350gm as complete ranges in the existing weight attribute. Original text and both bounds are retained. Ambiguous fractions and invalid/chained ranges remain unresolved; their final endpoint is never used as a point weight. Whole-tenderloin 3/4 lb is supported as a reviewed trade band; this is not a global interpretation of fractions.

Catalogue product names can identify a product, but their historical weight classes are not confirmed listing specifications and are excluded from resolved/canonical weights. Supply genuine weights in the original title or supportingTexts. Contradictory weights for the same product measurement require review after unit conversion. Package and trade quantities are separate roles, not conflicting piece weights.

Fixed package weights

Resolver 1.134.0 recognizes fixed only when it is bound to an explicit package weight or package form. Examples include 10 kg fixed, 10 kg fixed carton, fixed carton 10 kg, 10kg cartons (fixed weight), and 4.8 kg box fixed weight. The relevant component or presentation carries weightMode: "fixed". If no form is stated, the packaging configuration carries weightMode and netWeight; consumers must not infer carton, box, or bag.

This mode means a standardized nominal package net weight, contrasted with variable/catch-weight packing. It is not a mathematical assertion that every physical package has zero tolerance. Unrelated fixed wording remains unresolved and must not be auto-tagged as packaging.

A terminal title range without a unit may inherit one from validated confirmed weight fields or matching bounds in an original same-product description or explicitly bound piece-weight technical specification. This preserves basis: "contextual_inference" and raw title wording. Competing units, package quantities and catalogue labels cannot supply it. Otherwise, preserve the open range and show the weight clarification in explanation; do not auto-tag past the residue. This bounded inference can complete matchTypeCore for an existing title identity; it cannot introduce or substitute a product. Tenderloin Heads/Tails remain unresolved.

Supporting text

Supporting text is intentionally asymmetric evidence. Meat Ontology first resolves text and genuine catalogue alternates, then freezes that identity result. It separately extracts controlled attributes and governed non-product vocabulary from each supporting source. Product names embedded in a paragraph are never added to the candidate set, and unrecognized paragraph residue is not returned in unresolved or retained by the unknown-vocabulary workflow.

Supported roles are:

Role Policy
listing_description Record-only. Corroborating or conflicting title facts stay visible on supportingEvidence; they do not fail automatic tagging. Pack weights in a listing description are not matcher-read — Carcass /numbers classifies them, still record-only. New values are not written onto result.attributes.
technical_specification May add applicable, unambiguous controlled product attributes.
commercial_terms Informational extraction only; cannot add product attributes.

Certification wording in every supporting role remains informational because a paragraph may describe a producer, plant, audit, or document rather than the item. Send a confirmed item claim in observations.certificationClaim. A supporting value equal to title or observation evidence is reported as corroborated; a different single-cardinality value is conflicted and preserves the stronger existing value. Technical-specification conflicts still block automatic tagging through ambiguities. Listing-description conflicts stay on supportingEvidence and do not fail the gate.

Offer and shipment quantities recognized in supporting text are also informational. This includes explicit forms such as quantity 2000 kg and bare shipment-scale values such as 2000 kg; neither may populate the product weight facet. An explicit plausible piece or package weight in a technical specification can still be added. Integrations should send structured offer quantity in their own commercial fields rather than copying it into product ontology observations.

result.supportingEvidence[] records only recognized governed spans and their added, corroborated, conflicted, or informational effect. It does not echo the whole supporting paragraph. An added canonical value uses source: "supporting_text" and a sourceRef identifying the supporting input index and role.

Commercial vocabulary is masked before product-attribute extraction. For example, EXW Spain can produce an informative Incoterm with delivery place Spain, but it cannot assert Spanish product origin.

Selection and language behavior

Meat Ontology resolves text and each alternate independently, then selects the strongest supported identity. An exact catalogue name can supply identity when the title names no product, while attributes recognized in the listing title are retained. When the title names a product, a catalogue name for a broader or narrower product of the same lineage does not change it: Chicken skin plus catalogue name Chicken breast skin selects Chicken skin, and Beef shoulder plus Beef clod selects Beef shoulder (resolver 1.192.0). result.selection.selectedFrom records exactly which input supplied identity; result.inputMatches records every identity-bearing input's outcome. The bounded supporting_text_refinement form records both the original title or catalogue-name identity and the supporting source when exact governed single-ribbed or sheet-ribbed product wording refines an already selected generic pork belly. Qualifier-only supporting text cannot create this refinement.

An assisted workflow may supply a release-scoped identity without replacing the original title:

{
  "text": "Mutton trimming 80/20",
  "selection": {
    "conceptId": "01a007a0-94d6-7c45-aeef-b1fc8c36c966",
    "source": "assist",
    "confidence": 0.979
  }
}

The concept must exist, be active, and have an orderable product type in the request's ontology release. result.selection.selectedFrom.kind is supplied_selection and retains the supplied source and confidence. result.unassistedSelection separately reports the identity Meat Ontology would have selected from the ordinary inputs. Attribute extraction still uses the original title and is scoped to the supplied identity, so the example retains both animalClass=Mutton and trim=visual-lean-80/20. Do not send the canonical label as replacement text; that discards seller evidence.

A supplied identity deliberately does not claim an exact textual match. It therefore remains outside the automatic-tag gate in this resolver revision; the consuming workflow must retain its own assisted or human-review decision provenance.

Record-only assistance

REST clients may explicitly request shadow assistance with "assist": "on" or "assist": "always". The server asks only when it is configured in record mode and candidates are available. "on" asks after a helpable review decision: a non-exact core match, blocking unresolved text, or ambiguity confined to attributes.weight. "always" asks in those same review cases, when the ordinary resolver decision is auto_tag, and when the resolver abstains among candidates (selection_ambiguous or selection_unresolved, including no_match with a non-empty candidate list). Raptor's resolve dialog sends "always"; batch and other clients should keep "on" or omit the field. MCP does not accept assisted Resolve. Assistance is off by default. Neither value applies a selection or observations, including if apply mode is added later.

The request sent to Carcass contains the sanitized listing title, optional confirmed commodity, and at most the resolver's first eight candidates with all of their governed release terms. For attribute-capable releases it also carries each candidate's applicable controlled fields and one union table of English field/value definitions plus governed value aliases. The table is built from the exact release used for Resolve; grade uses a closed value list, while measurements and unsupported object-valued fields are excluded. It does not contain alternateTexts, so a legacy catalogue name cannot become model evidence. Carcass may choose only among those candidates or return no choice.

Carcass's product pick remains record-only. A matching title-weight role or validated title grade, rind, bone, calibration or origin-country reading may change result.attributes; assist.applied records those changes while selection remains false. Attribute field/value membership and exact quote offsets are checked against the same release before the proposal is recorded. A timeout, network error, HTTP error, malformed answer, or local input limit appears as assist.error; the Resolve request still completes normally. The ledger stores the same audit block plus decisionBeforeAssist and its reason codes. Clients must not treat a record-only pick as an accepted selection.

One Carcass question needs no opt-in. When the title and the catalogue name point to different products, the resolver keeps the title's product and adds an alternateTexts / context_conflict ambiguity. A configured server then sends Carcass the title, the confirmed commodity and the candidates the title has without the catalogue name; the catalogue name itself is not sent. If Carcass picks the selected product at or above the configured confidence, the ambiguity is removed, assist.titlePick holds the answer and assist.applied.conflicts lists what was removed. Otherwise the conflict stays and the listing goes to review as before. A supplied selection is not questioned.

The same question clears unread title wording, when the request opts in with assist: "agreement" (on and always include it). Every client's titles have unread wording, so this one is not asked unasked: send it on tagging resolves, not on type-ahead. When only wording the resolver did not read holds the listing (with, at most, an inexact core match beside it), and the title alone selects the same product, Carcass's agreement marks each held result.unresolved entry clearedBy: "carcass_title_agreement"; the entry stays listed but no longer counts toward blocking_unresolved_text, and assist.applied.unread records it. The trade qualifiers raw material and industrial are never cleared, an inexact core match still holds, and an ambiguity keeps the question from being asked. A Resolve with both the conflict and unread wording asks Carcass once. A client that copies the automatic-tagging gate must skip marked entries, or read the response's decision instead.

The same opted-in answer clears an inexact core match. When the selected product's core match is phrase or fuzzy and nothing else holds the listing but unread title wording, Carcass's agreement marks result.selection with coreMatchClearedBy: "carcass_title_agreement"; the match no longer counts toward core_match_not_exact, primary.matchTypeCore keeps what the resolver matched, and assist.applied.coreMatch records it. A gate that requires an exact core match must accept a marked selection, or read the response's decision.

None of these clears a finished_food_name hold (resolver 1.207.0). It is decided on the resolver's own answer, before any assistance, when the selected product has a name it shares with a prepared food (foie gras), in two cases: any text states a processing state other than raw, whichever of the product's names matched; or the title or the catalogue name names the product through such a name and no raw processing state is stated. Only a stated raw state lifts it, from the title, the catalogue name or a processing value confirmed in observations. A refrigeration state (observations.refrigeration, packaging: plate-frozen, fresh, chilled or frozen in the text), a weight or a packaging word is not raw evidence, since prepared foie gras is sold chilled and frozen, in jars and blocks. supportingTexts are not read for it. The hold adds an attributes.processing ambiguity and keeps the product selected for the reviewer. A catalogue name is read as a title, and a flagged catalogue name for the selected product holds the listing even when the title supplied the selection. A selection supplied with source: "human_override" is not held by this rule; one with source: "assist" is.

Origin adoption fills a missing value only. It requires one recognized country across the title, matching quoted country/nationality evidence, and no ambiguity or location/destination wording. A sole exw France, in Vietnam or to Singapore stays a review proposal. Existing origins are preserved; descriptions cannot supply this assisted title attribute.

Human-confirmed Carcass application

When a reviewer clicks Apply on the displayed Carcass proposal, confirm the immutable proposal event instead of resubmitting or reconstructing the model answer:

POST /v1/resolution-events/{resolutionEventId}/assist-confirmations
Authorization: Bearer <same taxonomy:resolve client>

The preview Resolve request must therefore use ledgered mode (omit mode or send "mode": "ledgered"). An interactive response intentionally has no resolution event and cannot be confirmed. UI copy should say that no listing changes are saved until Apply; the preview's Meat Ontology quality/proposal event is already recorded.

The endpoint accepts an optional attribute-review body. Omitting it preserves accept-all behavior. When present, every proposed attribute reading must be addressed exactly once; the reviewer may also add a value that is valid for the selected product in the proposal's release:

{
  "attributes": [
    { "decision": "accepted", "proposalIndex": 0 },
    { "decision": "corrected", "proposalIndex": 1, "value": "rindless" },
    { "decision": "removed", "proposalIndex": 2 },
    { "decision": "added", "field": "fatFirmness", "value": "hard" }
  ]
}

It requires the same API client that owns the original ledgered Resolve event. A successful response records one append-only confirmation and returns the exact accepted values and decisions under applied:

{
  "confirmation": {
    "id": "01...",
    "proposalEventId": "01...",
    "createdAt": "2026-09-19T13:15:00.000Z"
  },
  "applied": {
    "selection": {
      "conceptId": "01...",
      "label": "Pork shoulder",
      "confidence": 0.998
    },
    "taxonomyAttributes": {
      "refrigeration": {
        "normalized": "frozen",
        "raw": "Frozen",
        "confidence": 1,
        "basis": "reviewed_term"
      }
    },
    "observations": [
      {
        "index": 0,
        "expression": "10-12 kg",
        "kind": "weight",
        "unit": "kg",
        "role": "piece",
        "value": {
          "unit": "kg",
          "role": "piece",
          "minimum": 10,
          "maximum": 12,
          "relation": "range"
        }
      }
    ],
    "attributes": [
      {
        "field": "rind",
        "value": "rind-on",
        "quote": "with rind",
        "from": "assist",
        "decision": "accepted",
        "basis": "assist_confirmed",
        "model": "attr-v3",
        "format": "attr-1"
      }
    ]
  }
}

applied.selection is the concept Raptor must link. applied.taxonomyAttributes contains the original listing evidence re-resolved under that confirmed identity. applied.observations contains every numeric observation shown from Carcass, in original order and without Meat Ontology silently translating or dropping values it does not govern. applied.attributes retains accepted, corrected, removed, and added decisions; removals remain negative labels for audit and training and are not applied to the listing. Raptor must persist the returned parts in the matching listing fields and retain the confirmation and proposal event IDs as provenance. Confirmed attribute evidence uses assist_confirmed, never parser provenance. The confirmation never rewrites the original Resolve event.

Confirmation is idempotent per proposal event, so a retry returns the first confirmation and its original payload. Meat Ontology never calls Carcass again during confirmation. A new confirmation is rejected with ASSIST_PROPOSAL_STALE if its ontology release or resolver has changed; re-resolve and show the new proposal before allowing Apply. An event without a Carcass concept choice returns ASSIST_PROPOSAL_NOT_CONFIRMABLE.

For an authorized, read-only training export, run pnpm carcass:attributes:export -- --from <ISO> --to <ISO>. It writes one NDJSON record per confirmed proposal containing only title, confirmed commodity context, concept, release, proposal ID, and attribute decisions. API-client identity, request/trace IDs, and request references are not exported.

When one input identifies an orderable product and another identifies that product's compatible generic meat commodity, the product supplies identity and no alternate-text conflict is emitted. For example, Pork shoulder boneless plus catalogue name Pork selects the shoulder and retains bone=boneless. result.candidates still includes the primary candidate from each resolved input, so clients can explain both pieces of evidence. This compatibility rule does not equate different orderable products: Pork belly plus catalogue name Pork shoulder remains a blocking conflict.

Unread wording that only the catalogue name contains, such as Other in Other (Chicken meat) or 3 ribs in Beef striploin 3 ribs 7,0 kg +, is returned in unresolved with inputRole: "catalogue_product_name". It stays visible for review context but does not count toward blocking_unresolved_text: the seller did not write it. Wording the title also leaves unread has no inputRole and still blocks.

locale is deliberately not a matching filter. Use result.detectedLocale for the language of the reviewed term that supplied the selected identity. Use metadataLocale only for labels and descriptions. Unsupported presentation languages fall back explicitly to English.

What the consumer should persist

For an accepted automatic tag, persist at least:

type StoredTaxonomyTag = {
  taxonomyReleaseId: string;
  taxonomyContentChecksum: string;
  resolverVersion: string;
  resolverBehaviorChecksum: string;
  conceptId: string;
  matchedTermId: string;
  selectedFrom:
    | "text"
    | "alternate_text"
    | "supporting_text_refinement"
    | "supplied_selection";
  matchType: "exact" | "phrase" | "fuzzy";
  matchTypeCore: "exact" | "phrase" | "fuzzy";
  canonicalAttributes: Array<{
    fieldId: string;
    key: string;
    values: Array<{
      valueId?: string;
      machineValue: string;
      source: "text" | "observation" | "supporting_text";
      sourceRef?: {
        kind: "supporting_text";
        index: number;
        role: "listing_description" | "technical_specification" | "commercial_terms";
      };
    }>;
  }>;
};

The originCountry response key uses that exact camel-case spelling. For example, the structured PL observation in the request above contributes this complete canonical attribute entry:

{
  "result": {
    "attributes": {
      "originCountry": {
        "normalized": "PL",
        "raw": "PL",
        "confidence": 1,
        "basis": "controlled_vocabulary",
        "source": "observation"
      }
    },
    "canonicalAttributes": [
      {
        "fieldId": "01a01a72-f1af-709e-ace4-66428794aaae",
        "key": "originCountry",
        "cardinality": "one",
        "valueKind": "reference",
        "values": [
          {
            "valueId": "01a01a72-40cd-7eb1-a50a-02895f9c1cd4",
            "key": "pl",
            "machineValue": "PL",
            "raw": "PL",
            "confidence": 1,
            "basis": "controlled_vocabulary",
            "source": "observation"
          }
        ]
      }
    ]
  }
}

Clients should compare canonical keys literally. origin_country, origin, and country_of_origin are not response aliases for originCountry.

Persist IDs and machine values, not localized labels. A canonicalAttributes value has valueId when that exact value is governed by the release. Every certification and packaging value accepted by this contract is governed, including the separate freezingMethod=plate-frozen identity emitted for the plate-frozen packaging observation, which is not itself packaging since resolver 1.188.0. Releases containing the complete ISO origin-country vocabulary govern every officially assigned ISO 3166-1 alpha-2 code, including assigned dependencies and areas such as AQ, AX, BV, GS, and TF. A reserved, private-use, deprecated, CLDR-only, or otherwise unassigned two-letter observation can still be preserved as a stable machine value with no valueId; the consumer should keep that confirmed fact and must not mint a Meat Ontology ID. The release dictionary indicates which values are governed.

When moving from an older release, an origin previously stored with only machineValue does not have an old ID for releases/diff.replacements to map. Backfill its nullable valueId by matching the originCountry field ID and machineValue against the target release dictionary. Country labels in en, bg, pl, de, and hr are display metadata only and do not become text-recognition aliases; Croatian coverage outside originCountry continues to use the dictionary's explicit English fallback.

concept and enrichment are opt-in response sections. Enrichment is looked up by the already selected concept ID; it does not run a second text resolution and cannot change the selection.

Candidate preselection gate

If the consuming application requires privileged human confirmation, it may preselect a candidate for that review only when all of these are true:

function mayPreselectForAdmin(result: ResolveResult): boolean {
  return result.selection.status === "resolved" &&
    result.selection.primary.matchTypeCore === "exact" &&
    result.ambiguities.length === 0 &&
    result.unresolved.every(
      (item) =>
        item.reason === "non_product_vocabulary" || item.inputRole === "catalogue_product_name",
    );
}

Never persist the preselection as a confirmed tag until the required reviewer accepts it. Present ambiguous, conflicting, fuzzy, partially understood, and unsupported listings without an automatic preselection. Scores are ranking diagnostics, not probabilities and not a replacement for this gate.

Resolve many listings at once

Bulk callers, such as a catalogue re-tag, send up to 100 listings to POST /v1/resolve/batch:

{
  "items": [
    { "id": "line-1", "input": { "text": "Frozen pork belly", "requestReference": "offer-1" } },
    { "id": "line-2", "input": { "text": "Polędwica wołowa", "locale": "pl", "assist": "agreement" } }
  ]
}

Query expansion for catalogue filters

Consumers must not implement semantic filters with label prefix matching or hand-maintained descendant lists. Ask Meat Ontology to expand a semantic selector against the current release:

POST /v1/concepts/expand

{
  "selector": { "species": "Domestic pig" }
}

Other selectors are:

{ "selector": { "animalClass": "Sow" } }
{ "selector": { "commodity": "Pork" } }
{ "selector": { "descendantsOfConcept": "<concept-id>" } }
{ "selector": { "substitutesFor": "<concept-id>" } }
{ "selector": { "collection": "<collection-id>" } }

The default expansion follows the hierarchical predicates IS_A, PART_OF, and NARROWER_THAN. Species and animal-class selectors use their governed species/yield membership to find the hierarchy roots without treating cross-scheme equivalence as ancestry. Callers may explicitly add YIELDS or FABRICATED_FROM when that broader traversal matches the filter. The response returns sorted conceptIds, count, the applied predicates, release provenance, and an expansionChecksum.

substitutesFor is intentionally different: it returns the subjects of reviewed, directed SUBSTITUTE_FOR relationships for the supplied target concept. Its response uses the substitution-v1 profile and predicates: ["SUBSTITUTE_FOR"]; it does not mix substitutes into the product hierarchy. Use findMeatSubstitutes instead when the consumer also needs intended-use, confidence, or suitability filtering.

Use that concept-ID set directly in the consumer's database query. Deprecated concepts are excluded by default; set includeDeprecated: true only for migration or audit tooling. The compatibility alias ancestorOf is accepted for early clients, but new code should send descendantsOfConcept.

Collections for recipes and assortments

Collections are governed explicit sets, useful when graph ancestry does not express the business set the application needs. Discover them with:

GET /v1/collections
GET /v1/collections/{collectionId}

Collection kinds are recipe, market, assortment, facet, and other. Store the collection ID in application configuration. Never use the collection label or key as a durable foreign key.

To add or change a collection, the consumer's integration team should propose the intended set to the Meat Ontology team. Meat Ontology creates an append-only draft, validates every member concept and optional replacement, reviews it, and publishes it in a new release. Consumer credentials must not call /v1/admin.

Release-scoped display dictionary

Download the dictionary for the exact release stored with the consumer's records:

GET /v1/releases/{releaseId}/dictionary

It contains each concept's canonical label, structured species, schemes, external identifiers, localized display metadata, all reviewed terms with their scheme and market-context scope, attribute fields and values, collections, deprecation replacements, explicit English fallback information, and dictionaryChecksum. The governed display locales are English, Bulgarian, Polish, and German. From release 0.4.283 on, another language is a dictionary locale once a concept has a preferred name in it; synonyms and trader terms in further languages are read by Resolve and listed under each concept's terms, and do not add a locale. Earlier releases list every language a name was published in.

Render a concept using concept.localizations[locale].displayLabel. It is unique among active orderable concepts in that release and locale. When a preferred term is shared by separate published identities, the display label adds governed qualifiers such as a cutting-scheme code and item number; the underlying preferred term remains unchanged for recognition and audit. Treat qualifiers, species, schemes, and identifiers as structured explanatory metadata, not text to parse into identity. For example, the neutral product renders as Pork trimmings, while its USDA identity renders as Pork Trimmings — USDA-IMPS-400 418.

That example describes the pre-consolidation dictionary. A unique display label does not prove that two underlying definitions need separate canonical product IDs. Resolving identity fragmentation requires reviewed canonical mappings and client retagging, not label deduplication.

Cache by (releaseId, dictionaryChecksum). Render a stored ID with its stored release's dictionary for reproducible history, or with the current dictionary after applying the migration policy below. Never feed a localized dictionary label back into identity logic.

Informative Incoterms

Incoterms are recognized non-product vocabulary. Resolve reports the canonical identity in result.nonProductVocabulary[]; an immediately adjacent governed country may appear as place. Neither the Incoterm nor that place contributes to product matching, scoring, or attributes.originCountry.

When include contains enrichment, the response may also include:

{
  "incoterm": {
    "id": "01a01f40-7750-7091-9d6c-334a4290f5c5",
    "code": "EXW",
    "version": "2020",
    "deliveryPlace": "Spain"
  }
}

List the canonical picklist and reviewed aliases for the exact stored release with:

GET /v1/releases/{releaseId}/incoterms?locale=hr

The response has its own vocabularyChecksum. Until governed Incoterm translations are published, non-English requests explicitly return resolvedLocale: "en" and fallbackUsed: true. Persist the Incoterm ID and release identity, never the display text.

Efficient queries over records tagged by an older release

For already-tagged rows, download the immutable bulk expansion projection:

GET /v1/releases/{releaseId}/expansions

Each concept entry contains its transitive ancestorConceptIds and direct collectionIds under the product-membership-v1 profile. Cache it by (releaseId, expansionChecksum). This lets the consumer answer historical species, animal-class, commodity, and collection membership questions without re-resolving the original listing text.

Do not mix an expansion from one release with tags from another release.

Moving an integration to a new ontology release

Treat the pair of ontology content checksum and resolver behavior checksum as the application's processing watermark. When either changes, request:

GET /v1/releases/diff?fromReleaseId={storedReleaseId}&fromResolverBehaviorChecksum={storedResolverChecksum}

The response has two distinct migration mechanisms:

Apply replacement mappings first in a transaction or restartable batch. Then execute the requested re-tagging plan using the original sanitized inputs. Targeted re-tagging includes previously resolved, ambiguous, and unresolved rows associated with the returned vocabulary. Missing or changed resolver provenance safely produces full.

For canonical consolidation, original evidence means source descriptions and independently confirmed facts, not old canonical labels or attributes inferred only from an old selection. Preserve their provenance so a mistaken earlier tag cannot become evidence for its replacement. The general diff contract above is a foundation; a complete consolidation migration plan remains to be designed and verified before clients apply it.

For a paginated diff, pin the first response's toRelease.id on every later cursor request. Update the application's watermark only after migration and re-tagging complete successfully.

Attribute-alias changes are resolution-impacting and conservatively require a full pass; a new language alias can affect rows that were previously unresolved as well as resolved rows.

Caching and consistency checklist

Minimal consumer acceptance tests

Before enabling the integration, verify all of these against the deployed API:

  1. A Polish exact term still resolves when locale: "en"; detectedLocale.language is pl.
  2. An exact catalogue alternateText can supply identity while frozen/boneless attributes in text remain in canonicalAttributes.
  3. A conflicting title observation produces ambiguities and fails the auto-tag gate.
  4. include: ["enrichment"] returns enrichment for the selected ID and never changes that ID.
  5. Species and commodity expansion results use stable IDs and carry the same current release as the request workflow.
  6. A stored historical tag renders from its release dictionary and queries through its matching expansion projection.
  7. A release diff replacement migrates IDs without text matching, while a resolver or alias change triggers the prescribed re-tag pass.

For exact schemas, limits, auth failures, and error envelopes, generate the consumer client from /openapi/v1.json and pin the generated contract in the consuming application's repository.