Distinguishing Between RDFS and SHACL: Understanding the Relationship Between range and propertyShape
Overview When working with data in RDF (Resource Description Framework), two mechanisms come into play: “RDFS (RDF Schema)” and “SHACL (Shapes Constraint Language)”. Both can define constraints on properties and classes, but their purposes and behaviors are completely different. This article answers the following commonly confused questions: 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 to specify a datatype (xsd:string) in SHACL when the range is a class (foaf:Person)? 1. The Fundamental Difference Between RDFS and SHACL RDFS: For Inference RDFS is a declaration that says “if this property is used, the following knowledge can be derived.” ...
