chenejac / VIVOTestMigration

0 stars 0 forks source link

VIVO-1732: jena3tools does not work with TDB databases #1618

Closed chenejac closed 4 years ago

chenejac commented 5 years ago

Benjamin Gross (Migrated from VIVO-1732) said:

jena3tools works fine with exporting SDB databases, but not TDB databases. The configuration triples are written successfully, but the content triples are not. Instead, it throws an error.

$ java -jar jena3tools -e -d /usr/local/vivo/home -o ttl
Writing Configuration
Writing Content
Exception in thread "main" java.lang.NullPointerException
    at org.vivoweb.tools.ApplicationStores.writeContent(ApplicationStores.java:244)
    at org.vivoweb.tools.JenaCli.main(JenaCli.java:65)
chenejac commented 5 years ago

Benjamin Gross said:

I believe the problem lies here: https://github.com/vivo-project/jenatools/blob/master/jena3tools/src/main/java/org/vivoweb/tools/ApplicationStores.java#L244

This line is attempting to get information about the SDB data source without first checking whether it is an SDB database at all. We could simply add an if statement that checks if the value for contentConnection is null (as in the readContent method).

chenejac commented 4 years ago

Benjamin Gross said:

Pull request: https://github.com/vivo-project/jenatools/pull/13

chenejac commented 4 years ago

Andrew Woods said:

I am able to both reproduce the error and fix. Looks good.

chenejac commented 4 years ago

Andrew Woods said:

Resolved with: https://github.com/vivo-project/jenatools/commit/8c568eb2d61b81c151daba8df4f67b24be541d91