Skip to content
This repository has been archived by the owner on Feb 22, 2020. It is now read-only.

eclipse/rdf4j#1117 shacl w3c tests #102

Merged
merged 28 commits into from
Aug 15, 2019
Merged

Conversation

hmottestad
Copy link
Contributor

@hmottestad hmottestad commented Sep 9, 2018

This PR addresses GitHub issue: eclipse-rdf4j/rdf4j#1117 .

Briefly describe the changes proposed in this PR:

  • added SHACL compliance tests files from w3c repo
  • created (simple) code for running tests
  • migrated our code to use sh:NodeShape (from sh:Shape), must be from before spec was finalized

Signed-off-by: Håvard Ottestad <[email protected]>
… old from before the SHACL spec was finalized

Signed-off-by: Håvard Ottestad <[email protected]>
@hmottestad
Copy link
Contributor Author

This needs further discussion on what to do about the w3c files (intellectual property wise). Also, unimplemented features are currently failing the build.

@rdf4j-bot
Copy link
Collaborator

Can one of the admins verify this patch?

@hmottestad
Copy link
Contributor Author

add to whitelist

@abrokenjester abrokenjester added the CQ-Pending dependency update requires CQ approval label Sep 18, 2018
# Conflicts:
#	shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/AST/NodeShape.java
#	shacl/src/test/resources/reduceNumberOfPlansTest/shacl.ttl
#	shacl/src/test/resources/shacl.ttl
#	shacl/src/test/resources/shaclDatatype.ttl
#	shacl/src/test/resources/shaclMax.ttl
#	shacl/src/test/resources/shacleNoTargetClass.ttl
#	shacl/src/test/resources/test-cases/datatype/simple/shacl.ttl
#	shacl/src/test/resources/test-cases/minCount/simple/shacl.ttl
@hmottestad
Copy link
Contributor Author

We are now up from 18 to 20 passing tests after the last fixes for sh:or.

@abrokenjester abrokenjester removed the CQ-Pending dependency update requires CQ approval label Dec 11, 2018
@abrokenjester abrokenjester changed the title Feature/101 shacl w3c tests eclipse/rdf4j#1117 shacl w3c tests Jan 13, 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
Signed-off-by: Håvard Ottestad <[email protected]>
@hmottestad
Copy link
Contributor Author

We now have 24/98 passing.

Mind you nothing builds at the moment because of 3.0 snapshot on develop.

* develop: (80 commits)
  eclipse-rdf4j/rdf4j#1298 performance enhancement
  eclipse-rdf4j/rdf4j#1298 made rdfs reasoner configurable and added back tests
  eclipse-rdf4j/rdf4j#1298 minor cleanup
  eclipse-rdf4j/rdf4j#1298 fix for dedupes
  eclipse-rdf4j/rdf4j#1298 initial implementation of a rdfs reasoner for the shacl engine
  eclipse-rdf4j/rdf4j#1297 implement requiresEvaluation
  eclipse-rdf4j/rdf4j#1297 change SPARQL order to improve performance
  eclipse-rdf4j/rdf4j#1297 update benchmarks
  eclipse-rdf4j/rdf4j#1111 hot fix caching broken after merging sh:class and also fix some tests
  hotfix benchmark
  eclipse-rdf4j/rdf4j#1111 optimizations for empty sail and bulk joining for previousStateConnection
  eclipse-rdf4j/rdf4j#1111 removed use of getPreviousStateConnection because it doesn't handle deleted, will need to think of something smarter here. Also fixed printing of plans.
  eclipse-rdf4j/rdf4j#1111 fixes for blank node support
  Moved test from testsuite to storage
  Fixes #1293 Allow Regex calls with non Var arguments be replaced with other string functions
  eclipse-rdf4j/rdf4j#1111 optimized imports
  eclipse-rdf4j/rdf4j#1111 fixed last edge case
  eclipse-rdf4j/rdf4j#1111 better support for OR
  eclipse-rdf4j/rdf4j#1111 fixed sh:or by doing a two pass for sh:or. Not quite done yet though.
  documentation and code cleanup
  ...

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

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

Synced with develop.

We are now at 13/98 passing.

* develop: (25 commits)
  eclipse-rdf4j/rdf4j#1319 added a test
  eclipse-rdf4j/rdf4j#1319 super.prepare() as final step to stop it from locking until commit()
  fix init and fix test
  eclipse-rdf4j/rdf4j#1315 make parallel validation disabled by default and log warning
  typo Jeen found
  restore javadocs
  fixup pom
  initialize() still needs to call init() even though initialize() is deprecated
  eclipse-rdf4j/rdf4j#1314 support for NativeStore
  eclipse-rdf4j/rdf4j#1312 more caching
  eclipse-rdf4j/rdf4j#1312 fix copyright headers and cleanup reuse code in nodeshape
  eclipse-rdf4j/rdf4j#1306 support for sh:class and sh:or
  eclipse-rdf4j/rdf4j#1306 support in maxCount
  eclipse-rdf4j/rdf4j#1306 support minCount
  eclipse-rdf4j/rdf4j#1306 initial implementation
  optimized imports
  eclipse-rdf4j/rdf4j#1307 some cleanup
  eclipse-rdf4j/rdf4j#1307 fix erronous close
  eclipse-rdf4j/rdf4j#1307 fix close issues
  eclipse-rdf4j/rdf4j#1307 fixed illegalstateexception
  ...
@hmottestad
Copy link
Contributor Author

24/98 now

* develop:
  eclipse-rdf4j/rdf4j#1327 handle deactivated in requiresEvaluation
  eclipse-rdf4j/rdf4j#1327 code reformat and simplified EmptyNode, even though it's not in use
  eclipse-rdf4j/rdf4j#1327 full implementation of sh:deactivated
  eclipse-rdf4j/rdf4j#1327 initial support, but missing support for sh:or

Signed-off-by: Håvard Ottestad <[email protected]>
@hmottestad
Copy link
Contributor Author

25/98 noq

* develop:
  fixed tests
  eclipse-rdf4j/rdf4j#1331 support sh:targetObjectsOf
  update tests
  eclipse-rdf4j/rdf4j#1329 implemented filter node
  eclipse-rdf4j/rdf4j#1329 initial implementation
  eclipse-rdf4j/rdf4j#1329 initial tests

Signed-off-by: Håvard Ottestad <[email protected]>
* develop:
  hotfix remove erronous import

Signed-off-by: Håvard Ottestad <[email protected]>
@hmottestad
Copy link
Contributor Author

26/98 now

* develop:
  hot fix parallel benchmarks
  eclipse-rdf4j/rdf4j#1333 simplified code and optimized imports
  simplified
  eclipse-rdf4j/rdf4j#1333 full implementation
  eclipse-rdf4j/rdf4j#1333 initial commit
  Hotfix remove println

Signed-off-by: Håvard Ottestad <[email protected]>
* develop:
  make tests faster to initiate
  eclipse-rdf4j/rdf4j#1334 simplified sh:flags
  eclipse-rdf4j/rdf4j#1334 full support and tests
  eclipse-rdf4j/rdf4j#1334 initial support without tests

Signed-off-by: Håvard Ottestad <[email protected]>
* develop: (52 commits)
  eclipse-rdf4j/rdf4j#1354 refactored test code and cleaned up imports
  mvn formatter
  eclipse-rdf4j/rdf4j#1354 support for sh:class in sh:or
  eclipse-rdf4j/rdf4j#1354 support for sh:or with sh:nodeKind
  eclipse-rdf4j/rdf4j#1354 fix tuple comparison
  eclipse-rdf4j/rdf4j#1354 support for sh:class
  eclipse-rdf4j/rdf4j#1354 targetNode and datatype
  eclipse-rdf4j/rdf4j#1354 simple support in StandardisedPlanHelper
  eclipse-rdf4j/rdf4j#1354 basic optional path support
  eclipse-rdf4j/rdf4j#1354 added test
  eclipse-rdf4j/rdf4j#1337 fix spin test and improve test performance
  eclipse-rdf4j/rdf4j#1351 run formatter
  eclipse-rdf4j/rdf4j#1351 copy connection
  eclipse-rdf4j/rdf4j#1351 copy inferencer
  temporary switch back to old inferencer to avoid test failure
  fix compilation failure due to merge issues
  one-time pass of formatter with line-rejoining enabled
  one-time pass with line-rejoining enabled
  Update Jackson dependency
  formatter no longer joins lines back up if deliberately split
  ...

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

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

42/98 now

* 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]>
* develop:
  more tests
  formatter
  created a helpful tips section for the github PR template
  eclipse-rdf4j/rdf4j#1358 added support for sh:in
  eclipse-rdf4j/rdf4j#1290 check for active transaction
  eclipse-rdf4j/rdf4j#1290 better cache handling
  eclipse-rdf4j/rdf4j#1290 correct but  inefficient implementation
  eclipse-rdf4j/rdf4j#1290 created test

Signed-off-by: Håvard Ottestad <[email protected]>
@hmottestad
Copy link
Contributor Author

46/98 now

* develop:
  eclipse-rdf4j/rdf4j#1359 bug fix and benchmark
  eclipse-rdf4j/rdf4j#1359 some documentation
  eclipse-rdf4j/rdf4j#1359 handle edgecases
  eclipse-rdf4j/rdf4j#1359  functional implementation
  eclipse-rdf4j/rdf4j#1359 initial null implementation
  eclipse-rdf4j/rdf4j#1359 tests
  fixed constraint component for sh:in
  format
  eclipse-rdf4j/rdf4j#1360 simple multithreaded implementation

Signed-off-by: Håvard Ottestad <[email protected]>
Signed-off-by: Håvard Ottestad <[email protected]>
* develop:
  eclipse-rdf4j/rdf4j#1362 normalised targets with SPARQL

Signed-off-by: Håvard Ottestad <[email protected]>
@hmottestad
Copy link
Contributor Author

47/98 now

@hmottestad
Copy link
Contributor Author

@rdf4j-bot run tests

* develop: (57 commits)
  optimize imports and format
  eclipse-rdf4j/rdf4j#1375 bigger benchmark based on a generated file and option for logging performance per shape during validation
  potential bug fix and performance optimization
  formatter
  nicer query plans
  formatter
  eclipse-rdf4j/rdf4j#1388 configurable caching
  eclipse-rdf4j/rdf4j#1388 moved auto batched flushing
  moved added
  further reduce memory allowance in benchmark
  update benchmark
  eclipse-rdf4j/rdf4j#1388 clean up benchmark
  eclipse-rdf4j/rdf4j#1388 allow for cache less validation
  more utf8 and formatting
  eclipse-rdf4j/rdf4j#1388 periodically flush when loading big files in a single transaction without isolation
  formatting
  eclipse-rdf4j/rdf4j#1388 create benchmark
  clean up use of utf-8 and various other code cleanup
  eclipse-rdf4j/rdf4j#1384 bug fix
  eclipse-rdf4j/rdf4j#1384 optimize
  ...

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

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

48/98 now

* develop:
  eclipse-rdf4j/rdf4j#1397 more streams
  eclipse-rdf4j/rdf4j#1396 imrpoved benchmarks
  eclipse-rdf4j/rdf4j#1392 another bug fix
  eclipse-rdf4j/rdf4j#1392 another bug fix
  eclipse-rdf4j/rdf4j#1392 bug fix
  eclipse-rdf4j/rdf4j#1392 cleanup isolation level
  eclipse-rdf4j/rdf4j#1392 more performance logging and two optimizations, one for skipping the listener when empty base sail, the other for using the underlying sail if it is a memory store, isolation level is NONE and RDFS is empty
  eclipse-rdf4j/rdf4j#1391 min, max and class use SPARQL queries
  formatter
  eclipse-rdf4j/rdf4j#1390 check if data is sorted while adding it to the arraylist, skip sorting if the list is only size=1 or if the data is already sorted

Signed-off-by: Håvard Ottestad <[email protected]>
* develop:
  eclipse-rdf4j/rdf4j#1407 correct handling in sh:or and sh:and
  formatter
  eclipse-rdf4j/rdf4j#1407 better support for path inheritance
  eclipse-rdf4j/rdf4j#1407 updated tests so that they all conform to the difference with NodeShape vs. PropertyShape without breaking anything
  GH-1223 added a basic concurrency unit test
  formatting
  GH-1223 init twice is allowed to avoid race condition issues
  GH-1223 init is now optional for Sail as well
  GH-1223 init is now optional

Signed-off-by: Håvard Ottestad <[email protected]>
@abrokenjester
Copy link
Contributor

@hmottestad what do you want to do with this PR? It's grown a bit stale. If we are going to reintegrate to a single repo next week, we'll need this either merged, or dropped (and then later resubmitted?).

@hmottestad
Copy link
Contributor Author

We could mark the test as @ignore and merge it.

There is a competing implementation of these tests in the compliance test suite, but the way the tests are generated make them impossible to debug in IntelliJ. It’s got something to do with how the tests are generated at runtime from the turtle files. For this reason I prefer my approach.

@abrokenjester
Copy link
Contributor

We could mark the test as @ignore and merge it.

Works for me. Could you take care of this?

There is a competing implementation of these tests in the compliance test suite, but the way the tests are generated make them impossible to debug in IntelliJ. It’s got something to do with how the tests are generated at runtime from the turtle files. For this reason I prefer my approach.

I understand the problem (I had similar issues in the past with the SPARQL compliance tests). Just make sure that when you create a separate test that exactly duplicates one of the testsuite tests, for debugging purposes, you remove that test again once you're done debugging - otherwise it all becomes a bit messy :)

Signed-off-by: Håvard Ottestad <[email protected]>
Signed-off-by: Håvard Ottestad <[email protected]>
@hmottestad hmottestad merged commit 53abdff into develop Aug 15, 2019
@hmottestad hmottestad deleted the feature/101_shacl_w3c_tests branch August 15, 2019 20:01
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants