Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SHACL - validate nodes have 1 class A and 1 class B via same predicate #269

Open
JasonPad19 opened this issue Aug 30, 2022 · 0 comments
Open

Comments

@JasonPad19
Copy link

Hi

I am trying to write a SHACL script to make sure all nodes have 1 class A and 1 class B via predicate isClassifiedBy.

Data Example:

Product -> isClassifiedBy -> ClassA

Product -> isClassifiedBy -> ClassB

But looks like Neosemantics doesn't support sh:qualifiedValueShape. (see w3c example)
ex:HandShape
a sh:NodeShape ;
sh:targetClass ex:Hand ;
sh:property [
sh:path ex:digit ;
sh:maxCount 5 ;
] ;
sh:property [
sh:path ex:digit ;
sh:qualifiedValueShape [ sh:class ex:Thumb ] ;
sh:qualifiedValueShapesDisjoint true ;
sh:qualifiedMinCount 1 ;
sh:qualifiedMaxCount 1 ;
] ;
sh:property [
sh:path ex:digit ;
sh:qualifiedValueShape [ sh:class ex:Finger ] ;
sh:qualifiedValueShapesDisjoint true ;
sh:qualifiedMinCount 4 ;
sh:qualifiedMaxCount 4 ;
] .

In order to achieve the similar purpose, would you please help to suggest any workaround please?

The current script is below:

call n10s.validation.shacl.import.inline('

@Prefix neo4j: neo4j://graph.schema# .
@Prefix sh: http://www.w3.org/ns/shacl# .

neo4j:ProductShape a sh:NodeShape ;
sh:targetClass neo4j:Product;
sh:property [
sh:path neo4j:isClassifiedBy ;
sh:class neo4j:ClassA ;
];
sh:property [
sh:path neo4j:isClassifiedBy ;
sh:class neo4j:ClassB ;
]
.
','Turtle')

Thanks for your help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant