-
Notifications
You must be signed in to change notification settings - Fork 85
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
VIVO 3838: Upgrading to 4 #379
Draft
kaladay
wants to merge
8
commits into
vivo-project:jena4-upgrade
Choose a base branch
from
TAMULib:3838-alignment-jena_4
base: jena4-upgrade
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The Jena version being switched to (Jena 4) has removed support for SDB. The current forms of `DatasetWrapperFactory` and `StaticDatasetFactory` should no longer be needed. The SDB related code has been stripped out. Many of the classes with "SDB" in the name that actually provide more than just SDB have been re-created. These recreations are generally child classes of a similarly named Jena class. These recreates have "DB" in their name rather than "SDB". The `DatasetFactory.createMem()` is deprecated and may not be available in Jena 4. Attempts to replace this with `createTxnMem()` have revealed problems that are potentially transaction related. Replacing with `createGeneral()` might be possible but this is not done to avoid introducing more potential problems. Notable points in regards to replacing `DatasetFactory.createMem()`: 1) The method is deprecated. 2) The `DatasetFactory.createGeneral()` is the compatible equivalent. 3) The `DatasetFactory.createGeneral()` better supports TDB (which is the main reason for including in this commit set). 4) The `DatasetFactory.createTxnMem()` is the more recommended alternative and is transactional. 5) This better prepares the code for the upcoming Jena upgrade changes. There are some serious existing problems with closing dataset connections (and related). The (now removed) `DatasetWrapperFactory` probably should be rewritten to provide a new dataset each time rather than copying an existing one. The `close()` functionality appears to not be being called for TDB due to the SDB conditions. With this SDB condition the connections are now being closed. This has exposed several problems that both tests and runtime expose. This problem is considered out of scope for the changes and the close code is commented out with a FIXME statement. The documentation for `example.runtime.properties` refers to `VitroConnection.DataSource.*` only being used by SDB but this is incorrect. The OpenSocial code appears to talk directly to an SQL database using these properties. Update the documentation in this regard and replace the references to SDB with OpenSocial. Remove no longer necessary SDB helper code that is added to TDB as well because it "shouldn't hurt". Remove much of the documentation and installation functionality using or referencing SDB. The `IndividualDaoSDB.java` file is implemting `getAllIndividualUris()` and `getUpdatedSinceIterator()` via the now removed `IndivdiualSDB` class. This functionality is used by `RebuildIndexTask` and `UpdateUrisTask` classes. The new *DB classes now have java docs. These java docs have a bare-bones level of detail.
…ropertyStatementDao.java Co-authored-by: Dragan Ivanovic <[email protected]>
…dividualDaoJena.java Co-authored-by: Dragan Ivanovic <[email protected]>
…y.createGeneral(). The current design of Vitro does not seem to properly handle transactional memory. Switching from `DatasetFactory.createTxnMem()` to `DatasetFactory.createGeneral()` fixes several of the problems (namely failed tests).
The `@Override` annotation is not needed anymore by Java. I historically want to remove it for this reason as it saves space and makes the code a little easier to maintain. The migration between Jena 3 to Jena 4 presented me with a strong reason to not only keep these annotations but to also promote their continued use. When upgrading and the dependent model completely removes the overridden method, the `@Override` results in an error. This makes it easy to identify which methods are removed during such a migration. If the removed method is to be still maintained, then the `@Override` can simply be removed.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a draft of incomplete fixes that are provided as a PR for easier consumption of another developer to pick up where I am leaving off.
This is not intended to be merged as-is and will eventually be closed rather than merged into the target branch. Consider using the branch represented by this Draft PR as a starting point.
The state of these changes:
jena4-upgrade
branch (This will be easier to review once that PR is merged).DatasetFactory.createGeneral()
as a replacement to the once deprecated and now removedDatasetFactory.createMem()
.DatasetFactory.createTxnMem()
cannot be used without further design changes as several tests fail and there appears to be a performance loss.Some of the incidental refactor code changes happened due to trying to cross reference the current implementation and the upstream class being overriden. I found it easier to just make the files identical and scroll up and down each until everything being overwritten matches. I added comments breaking up such files for easier comparison.
The following are some observations regarding on of the failing tests.
The
recomputeABox1
test fromSimpleReasonerSameAsTest
is failing.The problem appears to be associated with
ABoxRecomputer
.I observed a problem where after the recompute is performed the data in the inference becomes incorrect.
The data is looking like:
When instead the data should look like:
The entire inference before recomputing looks like:
After recomputing, the data looks like:
Consider reviewing the individual commits as they may have further details regarding that given change set.