That's much better :)
Can you clean up your code, so it's as short as possible. You should be left with only the following classes:
Main2
ShaclSail
ShaclSailConnection
And delete any unused code.
I've attached some diagrams for the next steps. Page numbers are listed for some of the tasks.
Next goal is to manage to validate minCount:
- Implement a minimal AST to support minCount (page 1)
- Make ShaclSail generate the AST from a shacl file
- Implement a minimal set of classes to support a plan (page 2)
- Make your AST generate the plan (page 2)
- Call your plan on connection.commit() and throw an exception if the data is invalid (page 3)
When this works and you've created a couple of tests you can continue onto the next steps. Goal is to query from the base sail and the added/removed statements together:
- Store your added statements (minus deleted statements) in a new SailRepository(new MemoryStore()) in ShaclConnection
- Make your AST generate a more optimal plan that queries both the base sail and your added/removed sail (page 4)
When this works and you have even more tests, you can continue onto the final steps for completing minCount:
- Create an optimizer that can rewrite the plan
- Create a rule for optimizing minCount using a VALUES sparql query (page 5)
- Get statistics from the base sail, or collect your own statistics when adding data to trigger the optimization.
I'm a bit busy next week, but I can meet you on Friday or Sunday. This should give you time to get a bit more understanding of the task. Don't hesitate to ask if you need any help.
Håvard