You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jena.apache.org by an...@apache.org on 2020/08/11 20:55:38 UTC

[jena-site] 01/01: SHACL-C writer information

This is an automated email from the ASF dual-hosted git repository.

andy pushed a commit to branch shaclc
in repository https://gitbox.apache.org/repos/asf/jena-site.git

commit 1583a2038592216e55493f0a56edbfe1321e62e8
Author: Andy Seaborne <an...@apache.org>
AuthorDate: Tue Aug 11 21:55:25 2020 +0100

    SHACL-C writer information
---
 source/documentation/shacl/__index.md | 28 +++++++++++++++++++++++-----
 1 file changed, 23 insertions(+), 5 deletions(-)

diff --git a/source/documentation/shacl/__index.md b/source/documentation/shacl/__index.md
index 8445f65..dbd75ba 100644
--- a/source/documentation/shacl/__index.md
+++ b/source/documentation/shacl/__index.md
@@ -6,6 +6,8 @@ slug: index
 jena-shacl is an implementation of the 
 W3C [Shapes Constraint Language (SHACL)](https://www.w3.org/TR/shacl/).
 It implements SHACL Core and SHACL SPARQL Constraints.
+It also provides a reader and writer for 
+[SHACL Compact Syntax](https://w3c.github.io/shacl/shacl-compact-syntax/).
 
 ## Command line
 
@@ -18,16 +20,21 @@ To validate:
 <pre>shacl v -s <i>SHAPES.ttl</i> -d <i>DATA.ttl</i></pre>
 
 The shapes and data files can be the same; the `--shapes` is optional and
-default to the same as `--data`.  This includes running individual W3C Working
+defaults to the same as `--data`.  This includes running individual W3C Working
 Group tests.
 
-To parse a file
+To parse a file:
 
 <pre>shacl parse <i>FILE</i></pre>
 <pre>shacl p <i>FILE</i></pre>
 
 which writes out a text format.
 
+<pre>shacl p <i>--out=FMT</i> <i>FILE</i></pre>
+
+writes out in `text`(`t`), `compact`(`c`), `rdf`(`r`) formats. Multiple formats can be given,
+separated by "," and format `all` outputs all 3 formats.
+
 ## Integration with Apache Jena Fuseki
 
 Fuseki has a new service operation `fuseki:shacl`:
@@ -110,11 +117,22 @@ according to the shapes provided.
 
 ## SHACL Compact Syntax
 
-Jena can read 
-[SHACL Compact Syntax](https://w3c.github.io/shacl/shacl-compact-syntax/).
-The file extensions are `.shc` and `.shaclc` and there is a registered language
+Apache Jena supports
+[SHACL Compact Syntax (SHACL-C)](https://w3c.github.io/shacl/shacl-compact-syntax/)
+for both reading and writing.
+
+The file extensions for SHACL-C are `.shc` and `.shaclc` and there is a registered language
 constant `Lang.SHACLC`.
 
     RDFDataMgr.load("shapes.shc");
 
     RDFDataMgr.read("file:compactShapes", Lang.SHACLC);
+
+    RDFDataMgr.write(System.out, shapesGraph, Lang.SHACLC);
+
+SHACL-C is managed by the SHACL Community Group. It does not cover all possible shapes.
+When outputing SHACL-C, SAHCL shapes not expressible in SHACL-C wil cause an
+error and data in the RDF graph that is not relevant will not be output. In
+other words, SHACL-C is a lossy format for RDF.
+
+The Jena SHACL-C writer wil round-trip any valid SHACL-C document.