I was doing some experimenting with Stardog seeing if I could get it to work with sqlite and found that Stardog throws a NPE when you don’t supply the user name in the virtual graph properties file. Granted it’s expecting a user name but I figured you didn’t want it throwing a NPE exception.
The same thing happens if you set the username but don’t set the password. Adding anything for user and password gets past this and is just ignored by Sqlite.
The good news is I was successful in getting Stardog to work against Sqlite. The only extra thing required is adding sql.schemas=main to the properties file and referencing the database as main.myDb. I was exploring Sqlite because it’s super easy to import a csv file and I wanted to do some manipulation in the mappings that just aren’t available using the csv mapping. I’m always a little conflicted with where to do my data manipulation. I always find myself wrestling with doing in the mapping or post import with sparql update queries. Another advantage to using sqlite over csv files is it makes it easier to iterate on your mappings since you don’t need to materialize the data.
java.lang.NullPointerException: null
at java.util.Hashtable.put(Hashtable.java:459) ~[?:1.8.0_131]
at java.util.Properties.setProperty(Properties.java:166) ~[?:1.8.0_131]
at org.apache.tomcat.jdbc.pool.DataSourceProxy.setUsername(DataSourceProxy.java:449) ~[tomcat-jdbc-9.0.0.M13.jar:?]
at com.complexible.stardog.virtual.vega.VegaVirtualGraph.(VegaVirtualGraph.java:99) ~[stardog-virtual-core-5.0.5.1.jar:?]
at com.complexible.stardog.virtual.DefaultVirtualGraphRegistry._add(DefaultVirtualGraphRegistry.java:196) ~[stardog-virtual-core-5.0.5.1.jar:?]
at com.complexible.stardog.virtual.DefaultVirtualGraphRegistry.add(DefaultVirtualGraphRegistry.java:117) ~[stardog-virtual-core-5.0.5.1.jar:?]
at com.complexible.stardog.protocols.http.server.virtual.admin.VirtualGraphHttpService.addVG(VirtualGraphHttpService.java:257) ~[stardog-virtual-protocols-http-server-5.0.5.1.jar:?]
at com.complexible.stardog.protocols.http.server.virtual.admin.VirtualGraphHttpService.add(VirtualGraphHttpService.java:105) ~[stardog-virtual-protocols-http-server-5.0.5.1.jar:?]
at com.stardog.http.server.undertow.jaxrs.ExtractRoutes.lambda$handleIt$5(ExtractRoutes.java:192) ~[stardog-protocols-http-server-5.0.5.1.jar:?]
at org.apache.shiro.subject.support.SubjectRunnable.doRun(SubjectRunnable.java:120) ~[shiro-core-1.2.3.jar:1.2.3]
at org.apache.shiro.subject.support.SubjectRunnable.run(SubjectRunnable.java:108) ~[shiro-core-1.2.3.jar:1.2.3]
at com.stardog.http.server.undertow.ErrorHandling.lambda$safeDispatch$1(ErrorHandling.java:71) ~[stardog-protocols-http-server-5.0.5.1.jar:?]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [?:1.8.0_131]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [?:1.8.0_131]
at java.lang.Thread.run(Thread.java:748) [?:1.8.0_131]
ERROR 2017-12-17 12:09:16,111 [XNIO-1 task-19] com.stardog.http.server.undertow.ErrorHandling:writeError(180): Unexpected error on the server
java.lang.NullPointerException: null
at java.util.Hashtable.put(Hashtable.java:459) ~[?:1.8.0_131]
at java.util.Properties.setProperty(Properties.java:166) ~[?:1.8.0_131]
at org.apache.tomcat.jdbc.pool.DataSourceProxy.setUsername(DataSourceProxy.java:449) ~[tomcat-jdbc-9.0.0.M13.jar:?]
at com.complexible.stardog.virtual.vega.VegaVirtualGraph.(VegaVirtualGraph.java:99) ~[stardog-virtual-core-5.0.5.1.jar:?]
at com.complexible.stardog.virtual.DefaultVirtualGraphRegistry._add(DefaultVirtualGraphRegistry.java:196) ~[stardog-virtual-core-5.0.5.1.jar:?]
at com.complexible.stardog.virtual.DefaultVirtualGraphRegistry.add(DefaultVirtualGraphRegistry.java:117) ~[stardog-virtual-core-5.0.5.1.jar:?]
at com.complexible.stardog.protocols.http.server.virtual.admin.VirtualGraphHttpService.addVG(VirtualGraphHttpService.java:257) ~[stardog-virtual-protocols-http-server-5.0.5.1.jar:?]
at com.complexible.stardog.protocols.http.server.virtual.admin.VirtualGraphHttpService.add(VirtualGraphHttpService.java:105) ~[stardog-virtual-protocols-http-server-5.0.5.1.jar:?]
at com.stardog.http.server.undertow.jaxrs.ExtractRoutes.lambda$handleIt$5(ExtractRoutes.java:192) ~[stardog-protocols-http-server-5.0.5.1.jar:?]
at org.apache.shiro.subject.support.SubjectRunnable.doRun(SubjectRunnable.java:120) ~[shiro-core-1.2.3.jar:1.2.3]
at org.apache.shiro.subject.support.SubjectRunnable.run(SubjectRunnable.java:108) ~[shiro-core-1.2.3.jar:1.2.3]
at com.stardog.http.server.undertow.ErrorHandling.lambda$safeDispatch$1(ErrorHandling.java:71) ~[stardog-protocols-http-server-5.0.5.1.jar:?]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [?:1.8.0_131]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [?:1.8.0_131]
at java.lang.Thread.run(Thread.java:748) [?:1.8.0_131]