GRIDAPPSD / GOSS-GridAPPS-D

15 stars 28 forks source link

Compare SHACL Compact and SHACL recommendation #1369

Closed ericstephan closed 4 years ago

ericstephan commented 4 years ago

Description of Issue

SHACL emerged as a recommendation in 2017 and has been designated as a candidate constraint language that can be used to validate CIM or other information models. SHACL Compact is a subset of SHACL, but appears to be more human readable and intuitive. Last April TopBraid and recently (July) Jena have both offered both. PyShacl does not appear to support SHACL compact.

Affected Version

Screenshots

Expected

Actual

Steps to Reproduce

Additional Details

ericstephan commented 4 years ago

Comparison of SHACL versus SHACL Compact The Shapes Constraint Language (SHACL) is a 2017 W3c Recommendation. [1] published under the Data Activity. SHACL is a specification used to validate structures and patterns in RDF data. After its publication, SHACL Compact [2] was published by the W3C SHACL Community, inspired by the ShEx language, providing a more human intuitive way of validating RDF. [3] states that SHACL Compact is equivalent to SHACL's "Core Constraint Components" [4].

Community vs. Recommendation It's important to realize that SHACL Compact, although 2 years old, is still draft and has only recently provided two implementations through TopBraid (April 2020) [5] and Apache Jena (July 2020)[6]. Because it is a W3C Community product, it is not subject to the same scrutiny that W3C Recommendations require. Recommendations require early adopters, test reports on the adoption, and consensus on the normative specification across a working group.

Formats SHACL Compact syntax relies on a unique text non-RDF format. As an ingest, the format encourages early adoption of the core SHACL constraint language. Conversely, the syntax validation tools are limited to two Java APIs. Both Jena and TopBraid APIs caution SHACL Compact usage to lossy RDF use cases [6,7] SHACL is an RDF format and therefore has a wider variety of technology solutions including Java, Python, and Typescript to name a few.

Opportunities SHACL offers a complete and proven specification and should be used for validating profiles. While SHACL Compact has its limitations, does it offer shortcuts to defining SHACL core syntax exported as SHACL? In other words, Apache Jena offers this example: RDFDataMgr.load("shapes.shc"); RDFDataMgr.read("file:compactShapes", Lang.SHACLC); RDFDataMgr.write(System.out, shapesGraph, Lang.SHACLC);

Is this possible where Apache Jena exports shapes.chc as Lang.SHACL?

Also for informative sections is SHACL Compact a good way to convey core concepts from a human readable perspective?

References [1] https://www.w3.org/TR/shacl/ [2] https://w3c.github.io/shacl/shacl-compact-syntax/ [3] Savkovic, Ognjen, Evgeny Kharlamov, and Steffen Lamparter. "SHACL Constraint Validation over Ontology-enhanced KGs via Rewriting [Extended Version]." (2018). [4] SHACL Core Components, https://www.w3.org/TR/shacl/#core-components [5] https://www.topquadrant.com/technology/shacl/ [6] https://jena.apache.org/documentation/shacl/ [7] https://github.com/TopQuadrant/shacl/issues/98