You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jena.apache.org by "Andy Seaborne (Jira)" <ji...@apache.org> on 2020/12/17 21:41:00 UTC

[jira] [Comment Edited] (JENA-2018) shacl parse: Getting RDFDataException - More than one match : (ANY rdf:type owl:Ontology)

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

Andy Seaborne edited comment on JENA-2018 at 12/17/20, 9:40 PM:
----------------------------------------------------------------

The ontology model has processed imports so the input to two "rdf:type owl:Ontology" statements before SHACL parsing happens.

SHACL has a "base URI" which is the subject of the "rdf:type owl:Ontology" and the code is trying to extract this - it is used in the SHACL imports processing looking for "?baseURI owl:imports".

It's getting mixed up with the additions (3.17.0) around SHACL Compact syntax (one triple "?baseURI rdf:type owl:Ontology") which is used in the compact writer for the base.

However, the checking is too zealous. 


was (Author: andy.seaborne):
The ontology model has processed imports so the input to two "rdf:type owl:Ontology" statements before SHACL parsing happens.

SHACL has a "base URI" which is the subject of the "rdf:type owl:Ontology" and the code is trying to extract this - it is used in the SHACL imports processing looking for "?baseURI owl:imports".

It's getting mixed up with the SHACL Compact syntax (one triple "?baseURI rdf:type owl:Ontology") which is used in the compact writer for the base.

However, the checking is too zealous. 

> shacl parse: Getting RDFDataException - More than one match : (ANY rdf:type owl:Ontology)
> -----------------------------------------------------------------------------------------
>
>                 Key: JENA-2018
>                 URL: https://issues.apache.org/jira/browse/JENA-2018
>             Project: Apache Jena
>          Issue Type: Bug
>          Components: SHACL
>    Affects Versions: Jena 3.17.0
>         Environment: Replicate by running
> {{shapesModel = ModelFactory.createOntologyModel(OntModelSpec.OWL_DL_MEM)}}{{.read(stream);}}
>  {{Shapes.parse(shapesModel);}}
> Content of the file loaded:
> {{@prefix owl: <http://www.w3.org/2002/07/owl#> .}}
> {{@prefix ex:  <http://example.org#> .}}
> {{ex:foo a owl:Ontology ;}}
> {{    owl:imports ex:bar .}}
> Content of the referenced file:
> {{@prefix owl: <http://www.w3.org/2002/07/owl#> .}}
> {{@prefix ex:  <http://example.org#> .}}
> {{ex:bar a owl:Ontology .}}
>            Reporter: Jan Rosecky
>            Priority: Major
>
> When running shacl parse on shapes model loaded as an ontology with several owl:imports, I'm now getting
> {{RDFDataException - More than one match : (ANY rdf:type owl:Ontology)}}
> Of course, there is one triple {{<xx> a owl:Ontology}} in each of the imported files but always only one in a given file.
> This only started to happen in the new version of Jena (3.17.0), no such issue experienced with 3.16.0



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