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: Support for sh:and #1247

Closed
hmottestad opened this issue Jan 17, 2019 · 3 comments
Closed

SHACL: Support for sh:and #1247

hmottestad opened this issue Jan 17, 2019 · 3 comments
Labels
📦 SHACL affects the SHACL validator

Comments

@hmottestad
Copy link
Contributor

Support sh:and

https://www.w3.org/TR/shacl/#AndConstraintComponent

Also support implicit sh:and:

ex:PersonShape
	a sh:NodeShape  ;
	sh:targetClass ex:Person ;
	sh:property [
                sh:or (
                    [
                    sh:path ex:iriOrMinLength5String ;
                      sh:nodeKind sh:IRI ;
                    ]
                    [
                    sh:path ex:iriOrMinLength5String ;
                      sh:minLength 100 ;
                      sh:nodeKind sh:Literal
                    ]
                  ) ;
    	] .

Note the implicit sh:and between minLenght 100 and nodeKind sh:Literal.

@hmottestad hmottestad added the 📦 SHACL affects the SHACL validator label Jan 17, 2019
hmottestad added a commit to eclipse-rdf4j/rdf4j-storage that referenced this issue Jan 18, 2019
hmottestad added a commit to eclipse-rdf4j/rdf4j-storage that referenced this issue Jan 18, 2019
hmottestad added a commit to eclipse-rdf4j/rdf4j-storage that referenced this issue Jan 19, 2019
hmottestad added a commit to eclipse-rdf4j/rdf4j-storage that referenced this issue Jan 19, 2019
hmottestad added a commit to eclipse-rdf4j/rdf4j-storage that referenced this issue Jan 19, 2019
hmottestad added a commit to eclipse-rdf4j/rdf4j-storage that referenced this issue Jan 28, 2019
* develop: (54 commits)
  setting version to 3.0-SNAPSHOT
  Use diamond inference Signed-off-by:Bart Hanssens <[email protected]>
  eclipse-rdf4j/rdf4j#998 simplify tests
  Upgraded assertj-core
  eclipse-rdf4j/rdf4j#998 list supported shacl predicates, with test to make sure the list is kept up-to-date
  eclipse-rdf4j/rdf4j#998 configurations for enabling logging of diagnostic info and better javadoc
  optimize imports
  various cleanup and fix for sh:or
  eclipse-rdf4j/rdf4j#1113 added config and factory class for ShaclSail
  eclipse-rdf4j/rdf4j#1113 moved graph name constant and fixed compliance test setup
  fixes after rebase
  eclipse-rdf4j/rdf4j#1247 support implicit and
  eclipse-rdf4j/rdf4j#1110 support nodeKind
  eclipse-rdf4j/rdf4j#1109 support for language in
  eclipse-rdf4j/rdf4j#1109 support for pattern
  eclipse-rdf4j/rdf4j#1109 reuse plan from datatype to implement minLength and maxLength
  eclipse-rdf4j/rdf4j#998 support for nested validation results
  eclipse-rdf4j/rdf4j#998 support sh:or better
  eclipse-rdf4j/rdf4j#998 support SHACL RDF report format
  eclipse-rdf4j/rdf4j#998 log which shape caused the issue
  ...

Signed-off-by: Håvard Ottestad <[email protected]>

# Conflicts:
#	shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/Utils.java
@hmottestad hmottestad added this to the 3.0 milestone Jan 28, 2019
hmottestad added a commit to eclipse-rdf4j/rdf4j-storage that referenced this issue Jan 29, 2019
* master: (30 commits)
  very premature implementation of the w3c shacl tests with what seems like some bugs (since they don't run correctly) and also most of this isn't even supported
  eclipse-rdf4j/rdf4j#1268 add config for setting behavior when target is undefined
  eclipse-rdf4j/rdf4j#1266 some logging issues found while writing documentation
  solr embedded now uses managed schema by default - reintroduced necessary config files
  Use diamond inference Signed-off-by:Bart Hanssens <[email protected]>
  eclipse-rdf4j/rdf4j#998 simplify tests
  Upgraded assertj-core
  eclipse-rdf4j/rdf4j#998 list supported shacl predicates, with test to make sure the list is kept up-to-date
  eclipse-rdf4j/rdf4j#998 configurations for enabling logging of diagnostic info and better javadoc
  optimize imports
  various cleanup and fix for sh:or
  eclipse-rdf4j/rdf4j#1113 added config and factory class for ShaclSail
  eclipse-rdf4j/rdf4j#1113 moved graph name constant and fixed compliance test setup
  fixes after rebase
  eclipse-rdf4j/rdf4j#1247 support implicit and
  eclipse-rdf4j/rdf4j#1110 support nodeKind
  eclipse-rdf4j/rdf4j#1109 support for language in
  eclipse-rdf4j/rdf4j#1109 support for pattern
  eclipse-rdf4j/rdf4j#1109 reuse plan from datatype to implement minLength and maxLength
  eclipse-rdf4j/rdf4j#998 support for nested validation results
  ...

Signed-off-by: Håvard Ottestad <[email protected]>

# Conflicts:
#	shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/ShaclSailConnection.java
#	shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/ShaclTest.java
@hmottestad
Copy link
Contributor Author

Implicit AND is supported

@hmottestad
Copy link
Contributor Author

Lots of nice little curveballs in the shacl spec. Mixing node-shape and property-shapes.

ex:SuperShape
	a sh:NodeShape ;
	sh:property [
		sh:path ex:property ;
		sh:minCount 1 ;
	] .

ex:ExampleAndShape
	a sh:NodeShape ;
	sh:targetNode ex:ValidInstance, ex:InvalidInstance ;
	sh:and (
		ex:SuperShape
		[
			sh:path ex:property ;
			sh:maxCount 1 ;
		]
	) .

Kinda makes me wonder how the following works:

ex:SuperShape
	a sh:NodeShape ;
        sh:targetClass ex:ExampleClass ; #########
	sh:property [
		sh:path ex:property ;
		sh:minCount 1 ;
	] .

ex:ExampleAndShape
	a sh:NodeShape ;
	sh:targetNode ex:ValidInstance, ex:InvalidInstance ;
	sh:and (
		ex:SuperShape
		[
			sh:path ex:property ;
			sh:maxCount 1 ;
		]
	) .

hmottestad added a commit to eclipse-rdf4j/rdf4j-storage that referenced this issue Mar 19, 2019
@hmottestad
Copy link
Contributor Author

Basic sh:and is now supported.

hmottestad added a commit to eclipse-rdf4j/rdf4j-storage that referenced this issue Mar 20, 2019
* develop:
  eclipse-rdf4j/rdf4j#1355 also optimize range/domain equivalents
  eclipse-rdf4j/rdf4j#1355 fix sorting in Sort plan node
  eclipse-rdf4j/rdf4j#1355 push filter and use less sparql
  fixed docs
  formatter
  eclipse-rdf4j/rdf4j#1247 simple sh:and support

Signed-off-by: Håvard Ottestad <[email protected]>
@abrokenjester abrokenjester modified the milestones: 3.0.0, 3.1.0 Aug 22, 2019
@abrokenjester abrokenjester modified the milestones: 3.1.0, 3.2.0 Feb 3, 2020
@hmottestad hmottestad removed this from the 3.2.0 milestone Feb 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📦 SHACL affects the SHACL validator
Projects
None yet
Development

No branches or pull requests

2 participants