Skip to content

Instantly share code, notes, and snippets.

View mr-ouss's full-sized avatar

Quentin Ouss Kasseh mr-ouss

View GitHub Profile
@mr-ouss
mr-ouss / expedite_reorder_rule.py
Created November 28, 2025 16:04
Declarative business logic in RelationalAI. When rules change, you update the declaration, not the codebase.
with model.rule():
# If a product is low stock and its primary supplier
# has a disruption, flag for expedited reorder
product = Product()
supplier = Supplier()
supplies(supplier, product)
product.stock_level < product.reorder_threshold
supplier.has_active_disruption == True
product.set(expedite_reorder=True)
@mr-ouss
mr-ouss / supply_chain_ontology.py
Created November 28, 2025 16:01
Defining a knowledge graph ontology in RelationalAI on Snowflake. Entities (Supplier, Product, Warehouse), relationships, and mapping to existing Snowflake tables.
from relationalai import Model
model = Model("supply_chain")
# Define entity types
Supplier = model.Type("Supplier")
Product = model.Type("Product")
Warehouse = model.Type("Warehouse")
# Define relationships
supplies = model.Relation("supplies", Supplier, Product)