Phoenix and D2RQ Compatibility

If you happen to want to follow an AllegroGraph view of Semantic data lakes, but with an Open Source stack, you may venture down the Phoenix and D2RQ road.  Be aware of an issue that isn’t obvious – class path hell.

If you following the D2RQ instructions, you’ll run into an issue with the Phoenix driver (the latest being phoenix-4.7.0-HBase-1.1-client.jar).  Loading the Phoenix driver to early on the classpath generates this issue:

WARN ContextHandler :: Empty contextPath
WARN AbstractLifeCycle :: FAILED o.e.j.w.WebAppContext@1e0b4072{/,null,null},webapp: java.lang.NoSuchMethodError: org.eclipse.jetty.server.Connector.getHost()Ljava/lang/String;
java.lang.NoSuchMethodError: org.eclipse.jetty.server.Connector.getHost()Ljava/lang/String;
at org.eclipse.jetty.webapp.WebInfConfiguration.getCanonicalNameForWebAppTmpDir(
at org.eclipse.jetty.webapp.WebInfConfiguration.makeTempDirectory(
at org.eclipse.jetty.webapp.WebInfConfiguration.resolveTempDirectory(

However, if you move the Phoenix driver to the end of the classpath, or close to the end, all is resolved🙂

If you use the STOCK_SYMBOL.sql found in the Phoenix examples folder, you can then run the following SPARSQL query via the D2RQ Snorql web service:


Although basic, it at least shows that you’ve managed to get HBase data back via SPARSQL, assuming your mapping.ttl looks at minimal like the below:

@prefix map: <#> .
@prefix db: <> .
@prefix vocab: <vocab/> .
@prefix rdf: <> .
@prefix rdfs: <> .
@prefix xsd: <> .
@prefix d2rq: <> .
@prefix jdbc: <> .
@prefix foaf: <> .

map:database a d2rq:Database;
d2rq:jdbcDriver "org.apache.phoenix.jdbc.PhoenixDriver";
d2rq:jdbcDSN "jdbc:phoenix:localhost";
jdbc:autoReconnect "true";
jdbc:zeroDateTimeBehavior "convertToNull";

# Table group_personnel
map:STOCK_SYMBOL a d2rq:ClassMap;
d2rq:dataStorage map:database;
d2rq:uriPattern "STOCK_SYMBOL";
d2rq:class vocab:STOCK_SYMBOL;
d2rq:classDefinitionLabel "STOCK_SYMBOL";
map:STOCK_SYMBOL_SYMBOL a d2rq:PropertyBridge;
d2rq:belongsToClassMap map:STOCK_SYMBOL;
d2rq:property vocab:STOCK_SYMBOL_SYMBOL;
d2rq:propertyDefinitionLabel "STOCK_SYMBOL SYMBOL";
d2rq:column "STOCK_SYMBOL.SYMBOL";

~ by mdavey on May 12, 2016.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: