Information integration and sharing in a standardized manner is crucial to enable visibility, coordination and synchronization of supply chain activities, i.e., traceability within and across several companies. Product traceability is an essential tool fully integrated in supply chain management which should not only allow identifying, tracing and tracking but also ensuring product safety and quality. It helps to utilize the resources optimally and makes reliable the information and physical flows, accelerates the transmission of information on these flows, allows accessing a detailed knowledge of the product movements, and leads to the more effective management of the supply chain. However, several difficulties hinder product traceability implementation and make it a challenging task, including diversity of stakeholders, semantic differences between the involved actors, and lack of a shared language leading to confusion and misunderstandings, which make information exchange difficult. Highly expressive systems and techniques are therefore required. The latter must be characterized by the ability to exchange relevant data between stakeholders in a timely, meaningful and coherent manner. In this paper, we propose the development of an Ontology-based traceability system. The ontology is based on an architectural model for the physical Internet using computing resources such as Cloud computing, Fog computing and Internet of Things (IoT). The proposed system provides a shared and common language which improves information exchanges among all stakeholders in supply chains. To evaluate its consistency and efficiency, we carry out several queries dealing with different scenarios of product traceability. The validation results indicate that the developed ontology has the expressivity needed to represent all the knowledge related to the product traceability domain, enabling interoperability among different actors.