Abstract
Knowledge graphs are increasingly used across diverse industrial domains, from querying and search to machine learning and stream processing. Ensuring data consistency and quality in these settings is critical. Erroneous attributes in industrial knowledge graphs, for example, can lead to unexpected machine downtime, unreliable predictions, or safety risks. Although several constraint languages such as SHACL and ShEx for RDF, and PG-Schema for property graphs have been proposed, they do not fully support comprehensive constraints that combine open- and closed-world reasoning while also enabling scalable numerical validation. To address this gap, we introduce GRAPHCO, a constraint language designed for industrial knowledge graphs. GRAPHCO integrates three components: a deduce part that supports open-world reasoning via ontological inference; a mandate part that enforces closed-world structural constraints; and a compare part that enables numerical validation through aggregation and arithmetic operations. We provide a theoretical analysis showing that validation in GRAPHCO remains tractable, with polynomial time combined complexity, and that its numerical component can be executed efficiently in parallel. An implementation combining Answer Set Programming with Apache Spark demonstrates scalability on knowledge graphs with up to two million triples. A detailed industrial case study in automotive manufacturing, focusing on resistance spot welding at Bosch, illustrates how GRAPHCO can validate machine learning pipelines. The industrial case demonstrates that GRAPHCO can express a broad range of validation constraints across visual, statistical, and machine-learning task types in the examined use case and indicates the potential for sub-second validation latency in that setting. Limitations include static validation and limited recursion support, pointing towards future work on an integrated knowledge graph validation ecosystem.