Distinguishing Between RDFS and SHACL: Understanding the Relationship Between range and propertyShape
Introduction When working with data in RDF (Resource Description Framework), two mechanisms come up: “RDFS (RDF Schema)” and “SHACL (Shapes Constraint Language)”. Both can define constraints on properties and classes, but their purposes and behavior are completely different. This article answers the following questions that are particularly prone to confusion: What is the difference between rdfs:domain / rdfs:range and SHACL’s sh:class / sh:datatype? Is it acceptable to set SHACL constraints that differ from the RDFS range? Is it problematic if the range is a class (foaf:Person) but SHACL specifies a datatype (xsd:string)? 1. The Fundamental Difference Between RDFS and SHACL RDFS: For Inference RDFS is a declaration that states “if this property is used, the following knowledge can be derived”. ...