Skip to content

Main content

Agricultural Unit Code Source Gap Tool

Compare supplied unit code and source tokens without inventing a conversion table.

Loading tool…

Description

Check literal membership of code in knownCodes and equality of actualSource with expectedSource.

Farm data records connect field, event, sensor and source identifiers with observation and verification flags. Literal keys and supported-record shares help reconcile those records without authenticating a source, identifying a physical object or establishing measurement quality. Repeated IDs may need a different denominator from repeated rows.

Check literal membership of code in knownCodes and equality of actualSource with expectedSource.

When to use this tool

Use Agricultural Unit Code Source Gap when checking the stated agricultural source, identity or record-support convention.

How to use the tool and how it works

  1. Enter code, expectedSource, actualSource, knownCodes. Use the units and conventions below.
  2. Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
  3. Read codeListed, sameSource, usableUnderTokens. Inspect codeListed, sameSource, usableUnderTokens before interpreting the associated values.

Check literal membership of code in knownCodes and equality of actualSource with expectedSource. usableUnderTokens is their conjunction.1

Input fieldMeaning and unitsAccepted input
codeLiteral supplied code; no external registry lookup.Required. Text; maximum UTF-16 length 8192.
expectedSourceExpected SourceRequired. Text; maximum UTF-16 length 8192.
actualSourceActual SourceRequired. Text; maximum UTF-16 length 8192.
knownCodesKnown CodesRequired. Array of text; maximum UTF-16 length 8192; maximum items 256.
Output fieldInterpretationReturned shape
codeListedCode ListedRequired. Boolean.
sameSourceSame SourceRequired. Boolean.
usableUnderTokensUsable Under TokensRequired. Boolean.
json
{
  "input": {
    "code": "ha",
    "expectedSource": "A",
    "actualSource": "A",
    "knownCodes": [
      "ha",
      "m2"
    ]
  },
  "output": {
    "codeListed": true,
    "sameSource": true,
    "usableUnderTokens": true
  }
}

Limitations and assumptions

  • Token membership does not validate a physical unit, conversion factor or authoritative source.
  • Inputs must satisfy both the field types and the cross-field conditions above. Invalid input causes an error; a successful false flag or documented placeholder is a different result.

Alternative or Complementary methods

Inspect original records, authoritative identifier schemes and calibrated measurements before merging data or drawing agricultural conclusions.

References

  1. Calculation and input contract: agroinformatics/agricultural-unit-code-source-gap — tool.io

Similar or alternative tools