A general framework for food traceability