Trying to add a virtual graph based on a SQL database

Hello there,

I am trying to map a simple table from an SQL database into Stardog. When ever I try to add the virtual graph I get the same error message.

D:\dev\DaVi\AutoCAD>D:\Apps\stardog-5.0\bin\stardog-admin virtual add --format r2rml autocad.properties Mapping_autoCAD.ttl
There was an unexpected error on the server.

Even if I’m trying this command I get the same respond.

D:\dev\DaVi\AutoCAD>D:\Apps\stardog-5.0\bin\stardog-admin virtual add --format r2rml autocad.properties
There was an unexpected error on the server.

I looked at the stardog.log file and it always shows the same failure message (for both commands).

ERROR 2017-09-19 14:31:40,321 [XNIO-1 task-33] com.complexible.stardog.virtual.DefaultVirtualGraphRegistry:_add(202): Cannot initialize virtual graph autocad
java.lang.NullPointerException: null
at java.util.Hashtable.put(Unknown Source) ~[?:1.8.0_131]
at java.util.Properties.setProperty(Unknown Source) ~[?:1.8.0_131]
at org.apache.tomcat.jdbc.pool.DataSourceProxy.setPassword(DataSourceProxy.java:367) ~[tomcat-jdbc-9.0.0.M13.jar:?]
at com.complexible.stardog.virtual.vega.VegaVirtualGraph.(VegaVirtualGraph.java:99) ~[stardog-virtual-core-5.0.jar:?]
at com.complexible.stardog.virtual.DefaultVirtualGraphRegistry._add(DefaultVirtualGraphRegistry.java:197) ~[stardog-virtual-core-5.0.jar:?]
at com.complexible.stardog.virtual.DefaultVirtualGraphRegistry.add(DefaultVirtualGraphRegistry.java:117) ~[stardog-virtual-core-5.0.jar:?]
at com.complexible.stardog.protocols.http.server.virtual.admin.VirtualGraphHttpService.addVG(VirtualGraphHttpService.java:257) ~[stardog-virtual-protocols-http-server-5.0.jar:?]
at com.complexible.stardog.protocols.http.server.virtual.admin.VirtualGraphHttpService.add(VirtualGraphHttpService.java:105) ~[stardog-virtual-protocols-http-server-5.0.jar:?]
at com.stardog.http.server.undertow.jaxrs.ExtractRoutes.lambda$handleIt$91(ExtractRoutes.java:186) ~[stardog-protocols-http-server-5.0.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$46(ErrorHandling.java:70) ~[stardog-protocols-http-server-5.0.jar:?]
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [?:1.8.0_131]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [?:1.8.0_131]
at java.lang.Thread.run(Unknown Source) [?:1.8.0_131]
ERROR 2017-09-19 14:31:40,322 [XNIO-1 task-33] com.complexible.stardog.virtual.DefaultVirtualGraphRegistry:add(120): Cannot create virtual graph autocad
java.lang.NullPointerException: null
at java.util.Hashtable.put(Unknown Source) ~[?:1.8.0_131]
at java.util.Properties.setProperty(Unknown Source) ~[?:1.8.0_131]
at org.apache.tomcat.jdbc.pool.DataSourceProxy.setPassword(DataSourceProxy.java:367) ~[tomcat-jdbc-9.0.0.M13.jar:?]
at com.complexible.stardog.virtual.vega.VegaVirtualGraph.(VegaVirtualGraph.java:99) ~[stardog-virtual-core-5.0.jar:?]
at com.complexible.stardog.virtual.DefaultVirtualGraphRegistry._add(DefaultVirtualGraphRegistry.java:197) ~[stardog-virtual-core-5.0.jar:?]
at com.complexible.stardog.virtual.DefaultVirtualGraphRegistry.add(DefaultVirtualGraphRegistry.java:117) ~[stardog-virtual-core-5.0.jar:?]
at com.complexible.stardog.protocols.http.server.virtual.admin.VirtualGraphHttpService.addVG(VirtualGraphHttpService.java:257) ~[stardog-virtual-protocols-http-server-5.0.jar:?]
at com.complexible.stardog.protocols.http.server.virtual.admin.VirtualGraphHttpService.add(VirtualGraphHttpService.java:105) ~[stardog-virtual-protocols-http-server-5.0.jar:?]
at com.stardog.http.server.undertow.jaxrs.ExtractRoutes.lambda$handleIt$91(ExtractRoutes.java:186) ~[stardog-protocols-http-server-5.0.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$46(ErrorHandling.java:70) ~[stardog-protocols-http-server-5.0.jar:?]
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [?:1.8.0_131]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [?:1.8.0_131]
at java.lang.Thread.run(Unknown Source) [?:1.8.0_131]
ERROR 2017-09-19 14:31:40,322 [XNIO-1 task-33] com.stardog.http.server.undertow.ErrorHandling:writeError(179): Unexpected error on the server
java.lang.NullPointerException: null
at java.util.Hashtable.put(Unknown Source) ~[?:1.8.0_131]
at java.util.Properties.setProperty(Unknown Source) ~[?:1.8.0_131]
at org.apache.tomcat.jdbc.pool.DataSourceProxy.setPassword(DataSourceProxy.java:367) ~[tomcat-jdbc-9.0.0.M13.jar:?]
at com.complexible.stardog.virtual.vega.VegaVirtualGraph.(VegaVirtualGraph.java:99) ~[stardog-virtual-core-5.0.jar:?]
at com.complexible.stardog.virtual.DefaultVirtualGraphRegistry._add(DefaultVirtualGraphRegistry.java:197) ~[stardog-virtual-core-5.0.jar:?]
at com.complexible.stardog.virtual.DefaultVirtualGraphRegistry.add(DefaultVirtualGraphRegistry.java:117) ~[stardog-virtual-core-5.0.jar:?]
at com.complexible.stardog.protocols.http.server.virtual.admin.VirtualGraphHttpService.addVG(VirtualGraphHttpService.java:257) ~[stardog-virtual-protocols-http-server-5.0.jar:?]
at com.complexible.stardog.protocols.http.server.virtual.admin.VirtualGraphHttpService.add(VirtualGraphHttpService.java:105) ~[stardog-virtual-protocols-http-server-5.0.jar:?]
at com.stardog.http.server.undertow.jaxrs.ExtractRoutes.lambda$handleIt$91(ExtractRoutes.java:186) ~[stardog-protocols-http-server-5.0.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$46(ErrorHandling.java:70) ~[stardog-protocols-http-server-5.0.jar:?]
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [?:1.8.0_131]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [?:1.8.0_131]
at java.lang.Thread.run(Unknown Source) [?:1.8.0_131]

Here is my properties file:

jdbc.driver=com.microsoft.sqlserver.jdbc.SQLServerDriver
jdbc.username=*****
jdbc.passwort=*****
jdbc.url=jdbc:sqlserver://BY-XA719;instanceName=SQL_PLANT3D;databaseName=_enpro_owl_autocad_PnId;

Here is my mapping file:

@prefix dexpi: <http://www.aixcape.org/oimel/dexpi.owl#> .
@prefix rr: <http://www.w3.org/ns/r2rml#>.


<#ACEquipmentTableView> 
rr:sqlQuery """
SELECT 
	[PnPID]
  FROM 
	[_enpro_owl_autocad_PnId].[dbo].[Equipment] 
""".

<#ACIDMAP>
    rr:logicalTable <#ACEquipmentTableView">;
    rr:subjectMap [
        rr:template "http://autocad.bayer.com/equipment/{PnPID}";
        rr:class dexpi:Equipment;
    ].

It would be great if someone can gave me some hint how to solve this problem because I’m stuck right now.

Edit: I tried different version of my properties file, I insert a false password or username and still got the same error message in the command prompt and also in the log file.

Thanks in advance
Ben

Hi Ben,

You configuration file has an entry for jdbc.passwort but it should in fact be jdbc.password. The last letter in “password” should be “d”. We will improve the error message.

Jess

Hi Jess,

thanks that was indeed my mistake, sometimes you just don’t notice the simplest mistake (especially when the German word is spelled with a t)

Ben

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.