[ 
https://issues.apache.org/jira/browse/JENA-2145?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17396204#comment-17396204
 ] 

Andy Seaborne commented on JENA-2145:
-------------------------------------

This is not so simple!

When parsing, there is context as to whether it is part of a property shape or 
a node shape. The 
[rule-propertyType|https://w3c.github.io/shacl/shacl-compact-syntax/#rule-propertyType]
 only applies to the property shape case. In general SHACL, cases occur like 
being both a node as part of a property shape.

This is illustrated by JENA-2144 where the reverse is happening -- "IRI" (a 
property shape abbreviation) is used in a node shape context where the full 
"nodekind=" should be used.

The writer isn't context sensitive and there are more cases to consider. There 
is already a comment in the code for {{DatatypeConstraint}} about this when 
{{|}} or {{!}} are used. -- a symbol like {{|}} is used in two ways, as a 
"nodeOr" and as a "propertyOr".

The first goal must be "write legal output".



> shaclc serialization of datatypes should be shorter
> ---------------------------------------------------
>
>                 Key: JENA-2145
>                 URL: https://issues.apache.org/jira/browse/JENA-2145
>             Project: Apache Jena
>          Issue Type: Improvement
>            Reporter: Vladimir Alexiev
>            Priority: Major
>
> https://github.com/euBusinessGraph/eubg-data/blob/master/model/ebg-shapes.shaclc
>  includes the following:
> {noformat}
>   skos:altLabel            xsd:string|rdf:langString !pattern="^ | $| {2}" 
> [0..*] .
> {noformat}
> This is output more verbosely as:
> {noformat}
>     skos:altLabel ! pattern="^ | $| {2}" datatype=xsd:string | 
> datatype=rdf:langString .
> {noformat}
> The shorter notation is allowed according to 
> https://w3c.github.io/shacl/shacl-compact-syntax/#rule-propertyType:
> "propertyType: If ?iri is one of the RDF datatypes supported by SPARQL 1.1 
> (such as xsd:string) then produce a triple ?property sh:datatype ?iri, 
> otherwise ?property sh:class ?iri."
> Jena already checks whether the IRI is a known datatype and otherwise outputs 
> "class=". So it should be a simple matter to implement the shorter notation.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to