cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

SHACL Union of Range for an object property constraint

Hello,

I am trying to constraint an object property (OP) by saying that this OP can only have two classes as range.

When I run n10s.validation.shacl.import.inline I get the following error:
Error Running Query

Failed to invoke procedure n10s.validation.shacl.import.inline: Caused by: java.lang.IllegalArgumentException: No separator character founds in URI: node1f215dov1x5

Do you know if Neosemantic supports at this stage union or intersection of ranges within a SHACL file? Both union and intersection return the same error, specified above.

However if I only put one class as a range, everything is fine.

Thank you very much for your help!

Here is my SHACL code:

CALL n10s.validation.shacl.import.inline(
  '
# baseURI: http://example.org/EBOM_MBOM_SHACL
# imports: http://datashapes.org/dash
# prefix: EBOM_MBOM_SHACL

@prefix EBOM_MBOM_SHACL: <http://example.org/EBOM_MBOM_SHACL#> .
@prefix dash: <http://datashapes.org/dash#> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix sh: <http://www.w3.org/ns/shacl#> .
@prefix swa: <http://topbraid.org/swa#> .
@prefix tosh: <http://topbraid.org/tosh#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .

<http://example.org/EBOM_MBOM_SHACL>
  rdf:type owl:Ontology ;
  owl:imports <http://datashapes.org/dash> ;
  owl:versionInfo "Created with TopBraid Composer" ;
.
EBOM_MBOM_SHACL:EBOM_Item
  rdf:type rdfs:Class ;
  rdf:type sh:NodeShape ;
  rdfs:label "EBOM Item" ;
  rdfs:subClassOf rdfs:Resource ;
  sh:property [
      rdf:type sh:PropertyShape ;
      sh:path EBOM_MBOM_SHACL:Test ;
      sh:class EBOM_MBOM_SHACL:EBOM_Item ;
      sh:name "Test" ;
      sh:nodeKind sh:IRI ;
    ] ;
  sh:property [
      rdf:type sh:PropertyShape ;
      sh:path EBOM_MBOM_SHACL:label ;
      sh:datatype xsd:string ;
      sh:description "Min 1 label" ;
      sh:minCount 1 ;
      sh:name "label" ;
    ] ;
.
EBOM_MBOM_SHACL:Equivalent_Item
  rdf:type rdfs:Class ;
  rdf:type sh:NodeShape ;
  rdfs:label "Equivalent Item" ;
  rdfs:subClassOf rdfs:Resource ;
  sh:property [
      rdf:type sh:PropertyShape ;
      sh:path EBOM_MBOM_SHACL:isTheSameAs ;
      sh:class EBOM_MBOM_SHACL:Equivalent_Item ;
      sh:name "is the same as" ;
      sh:nodeKind sh:IRI ;
    ] ;
.
EBOM_MBOM_SHACL:Linked_Item
  rdf:type rdfs:Class ;
  rdf:type sh:NodeShape ;
  rdfs:label "Linked Item" ;
  rdfs:subClassOf rdfs:Resource ;
  sh:property [
      rdf:type sh:PropertyShape ;
      sh:path EBOM_MBOM_SHACL:isLinkedTo ;
      sh:class [
          rdf:type owl:Class ;
          owl:unionOf (
              EBOM_MBOM_SHACL:Linked_Item
              EBOM_MBOM_SHACL:Equivalent_Item
            ) ;
        ] ;
      sh:name "is linked to" ;
      sh:nodeKind sh:IRI ;
    ] ;
.

',
  'Turtle' 
)
2 REPLIES 2

Hi Clement, sorry for the late reply. Currently, only single classes are supported.
Watch this space for new features (including this one). Added to backlog.
Or alternatively feel free to give it a try and create a pull request 😉

Cheers,

JB.

Hi Jesus,

Thank you very much for your answer.

In the example I provided, it used owl:unionOf().
Would you mind to confirm me that the sh:or feature is not supported yet as well?

Thank you and have a good day,
Clément