Eval: Oxigraph + FoodOn ontology for ingredient relationships, substitution, allergen graph #155
Labels
No labels
accessibility
backlog
beta-feedback
bug
duplicate
enhancement
feature-request
good first issue
help wanted
invalid
needs-design
needs-triage
question
status:blocked
status:in-progress
status:review
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: Circuit-Forge/kiwi#155
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Source
https://github.com/oxigraph/oxigraph — Apache 2.0 / MIT dual license
pyoxigraph on PyPI: https://pypi.org/project/pyoxigraph/
What it is
Rust-core embedded RDF graph database with a SPARQL 1.1 query engine. The
pyoxigraphPython binding provides a simple
Store()object (in-memory or RocksDB-backed) withstandard
store.query('SELECT ...')API. Loads Turtle, JSON-LD, N-Triples, N-Quads,RDF/XML.
Kiwi use cases
Ingredient substitution
FoodOn (https://foodon.org/) is an OWL ontology of 12,000+ food entities with
substitution, category, and preparation relationships. Load once at startup into an
in-memory Oxigraph store. Query: "what can substitute for buttermilk?" → SPARQL
traversal returns milk + acid, yogurt, kefir.
Allergen and dietary classification
Query the ontology for allergen parent classes. "Does this ingredient contain gluten?"
becomes a graph reachability question rather than a hardcoded lookup table. Covers
common eight allergens plus CF's extended dietary profiles (vegan, kosher, halal, etc.).
Nutritional family / ingredient relationships
USDA FoodData Central publishes structured data. Combined with FoodOn's taxonomy,
can answer "find ingredients in the same nutritional family as lentils with lower
sodium" — useful for the dietary profile filter in Phase 2 recipe matching.
Pantry category inference
Rather than manually tagging pantry items, infer categories from the ontology.
"black beans" → legume → protein source → vegan-compatible → gluten-free.
Implementation sketch
circuitforge_core.food_graph.query(sparql)as thin wrapperLicense
Apache 2.0 / MIT — clean for all CF tiers including commercial/cloud.
pyoxigraph is a pure Python wheel with the Rust core compiled in — no separate
native install required.
Related