marmotta-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ja...@apache.org
Subject [50/52] [partial] Reverting the erroneous merge by Sebastian according to the instructions in INFRA-6876
Date Tue, 05 Nov 2013 10:52:55 GMT
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/582abb5b/build/archetypes/marmotta-archetype-webapp/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/templates/admin.ftl
----------------------------------------------------------------------
diff --git a/build/archetypes/marmotta-archetype-webapp/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/templates/admin.ftl b/build/archetypes/marmotta-archetype-webapp/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/templates/admin.ftl
index 0cf86db..d0d36fe 100644
--- a/build/archetypes/marmotta-archetype-webapp/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/templates/admin.ftl
+++ b/build/archetypes/marmotta-archetype-webapp/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/templates/admin.ftl
@@ -17,65 +17,88 @@
     limitations under the License.
 
 -->
-<!DOCTYPE html>
-<html>
-    <head>
-	    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
-        <meta http-equiv="Default-Style" content="${DEFAULT_STYLE}">
-        <link href="${SERVER_URL}core/public/style/javadoc.css" rel="stylesheet" type="text/css" />
-	    <link href="${SERVER_URL}core/public/style/style1.css" title="screen" rel="stylesheet" type="text/css" />
-        <link href="${SERVER_URL}core/public/style/style2.css" title="beamer" rel="alternate stylesheet" type="text/css" />
-        <link href="${SERVER_URL}core/public/img/icon-small.ico" rel="SHORTCUT ICON">
-        <script type="text/javascript">
-            var _BASIC_URL = "${BASIC_URL}";
-            //use _SERVER_URL for webservice calls
-            var _SERVER_URL = "${SERVER_URL}";
-        </script>
-        <script type="text/javascript" src="${SERVER_URL}core/public/js/lib/jquery-1.7.2.js"></script>
-        <script type="text/javascript" src="${SERVER_URL}core/public/js/widgets/current-user.js"></script>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr">
+
+<head>
+
+    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+    <link href="${SERVER_URL}${DEFAULT_STYLE}javadoc.css" rel="stylesheet" type="text/css" />
+    <link href="${SERVER_URL}${DEFAULT_STYLE}style.css" rel="stylesheet" type="text/css" />
+    <link href="${SERVER_URL}core/public/img/icon/lmf.ico" rel="SHORTCUT ICON">
+    <script type="text/javascript">
+        var _BASIC_URL = "${BASIC_URL}";
+        //use _SERVER_URL for webservice calls
+        var _SERVER_URL = "${SERVER_URL}";
+
+        var _CURRENT_STYLE = "${DEFAULT_STYLE}";
+
+    </script>
+    <#if USER_MODULE_IS_ACTIVE>
+        <link href="${SERVER_URL}user/admin/style/style.css" rel="stylesheet" type="text/css">
+        <script type="text/javascript" src="${SERVER_URL}user/admin/widgets/user.js"></script>
         <script type="text/javascript">
-            $(function() {
-        	  new LMF.currentUserWidget(_SERVER_URL, document.getElementById("login_logout")).init();
-        	});
+            window.onload = function () {
+                    LoginLogout.draw(_SERVER_URL,"login_logout");
+            }
         </script>
-        ${HEAD}
-        <title>LMF - The Linked Media Server</title>
-        <style type="text/css">
-        	#login_logout {
-				float: right;
-				margin: 5px;
-        	}
-        </style>
-    </head>
-    <body>
-        <a id="top-link" href="${SERVER_URL}">TOPLINK</a>
-        <div id="wrapper">
-            <div id="header">
-                <div id="logo">
-                    <a href="${SERVER_URL}"><img src="${SERVER_URL}core/public/img/lmf-white.png" /></a>
-                </div>
-                <div id="header_text">
-                	<h1>${CURRENT_TITLE}</h1>
-                	<div id="topnav">
-    	            	<div id="login_logout"></div>
-    	            </div>
-                </div>
-            </div>
-            <div class="clear"></div>
-            <div id="left">
-                ${MODULE_MENU}
-            </div>
-            <div id="center">
-                ${CONTENT}
-            </div>
-            <div class="clear"></div>
-            <div id="footer">
-                <span>
-                    <a href="http://lmf.googlecode.com">LMF</a> 
-                    is a project of 
-                    <a href="http://www.newmedialab.at/">SNML-TNG</a>
-                </span>
-            </div>
+    </#if>
+
+    ${HEAD}
+
+</head>
+
+<body>
+
+<div id="wrapper">
+    <div id="header">
+        <a id="logo" href="${SERVER_URL}" title="${PROJECT}">
+            <img src="${SERVER_URL}${LOGO}" alt="${PROJECT} logo" />
+        </a>
+        <h1>${CURRENT_MODULE} - ${CURRENT_TITLE}</h1>
+        <#if USER_MODULE_IS_ACTIVE>
+            <div id="login_logout"></div>
+        </#if>
+    </div>
+    <div class="clear"></div>
+    <div id="left">
+        <ul id="menu">
+            <#list MODULE_MENU as menu>
+            <li
+                <#if menu.properties["active"]>
+                        class="menu_item active"
+                <#else>
+                        class="menu_item"
+                </#if>
+            >
+                <div class="menu_heading"><a href="${menu.submenu[0].properties["path"]}">${menu.properties["title"]}</a></div>
+                <ul class="submenu">
+                <#list menu.submenu as submenu>
+                    <li
+                        <#if submenu.properties["active"]> class="active" </#if>
+                    >
+                    <a href="${submenu.properties["path"]}">${submenu.properties["title"]}</a>
+                    </li>
+                </#list>
+                </ul>
+            </li>
+            </#list>
+        </ul>
+    </div>
+    <div id="center">
+        <div id="content">
+        ${CONTENT}
+        </div>
+    </div>
+    <div class="clear"></div>
+    <div id="footer">
+        <div id="footer_line">
+            <span>
+                ${FOOTER}
+            </span>
         </div>
-    </body>
-</html>
+    </div>
+</div>
+

http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/582abb5b/build/archetypes/marmotta-archetype-webapp/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/templates/rdfhtml.ftl
----------------------------------------------------------------------
diff --git a/build/archetypes/marmotta-archetype-webapp/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/templates/rdfhtml.ftl b/build/archetypes/marmotta-archetype-webapp/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/templates/rdfhtml.ftl
index 16379fc..f131133 100644
--- a/build/archetypes/marmotta-archetype-webapp/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/templates/rdfhtml.ftl
+++ b/build/archetypes/marmotta-archetype-webapp/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/templates/rdfhtml.ftl
@@ -18,279 +18,318 @@
 
 -->
 <!DOCTYPE html>
-<html lang="en" prefix="${prefixMappings}">
+<html lang="en" prefix="${prefixMappings}" xmlns="http://www.w3.org/1999/html">
 
 <head>
   <title>Resource/s in HTML</title>
   <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
-  <script type="text/javascript" src="${baseUri}core/public/js/lib/jquery-1.7.2.js"></script>
-  <script type="text/javascript" src="${baseUri}core/public/js/lib/jquery-ui-1.8.21.js"></script>
-  <link href="${baseUri}core/public/style/style1.css" title="screen" rel="stylesheet" type="text/css" />
-  <link href="${baseUri}core/public/style/rdfhtml.css" title="screen" rel="stylesheet" type="text/css" />
-</head>
+  <meta http-equiv="Default-Style" content="${DEFAULT_STYLE}">
+  <script type="text/javascript" src="${SERVER_URL}webjars/jquery/1.8.2/jquery.min.js"></script>
+  <link href="${SERVER_URL}${DEFAULT_STYLE}style.css" rel="stylesheet" type="text/css" />
+  <link href="${SERVER_URL}${DEFAULT_STYLE}rdfhtml.css" rel="stylesheet" type="text/css" />
+  <#if resources?size = 1>
+  <link rel="alternate" type="application/rdf+xml" href="${SERVER_URL}resource?uri=${resources[0].encoded_uri}&amp;format=application/rdf%2Bxml" /> 
+  <link rel="alternate" type="text/rdf+n3" href="${SERVER_URL}resource?uri=${resources[0].encoded_uri}&amp;format=text/rdf%2Bn3" /> 
+  <link rel="alternate" type="text/turtle" href="${SERVER_URL}resource?uri=${resources[0].encoded_uri}&amp;format=text/turtle" /> 
+  <link rel="alternate" type="application/rdf+json" href="${SERVER_URL}resource?uri=${resources[0].encoded_uri}&amp;format=application/rdf%2Bjson" /> 
+  <link rel="alternate" type="application/ld+json" href="${SERVER_URL}resource?uri=${resources[0].encoded_uri}&amp;format=application/ld%2Bjson" /> 
+  </#if>
+      
+  <script>
+      $(document).ready(function(){
+          $(".submenu li").click(function(event){
+              event.preventDefault();
+              if(!$(this).hasClass("active")) {
+                  $(".submenu").children().removeClass("active");
+                  $(this).addClass("active");
+                  var tabid = $(this).children(":first").attr("href").substring(1);
+                  $("#content").children().hide();
+                  $("#"+tabid).show();
+              }
+          })
 
-<body>
+          $("a.ldcache").each(function(index) {
+              $(this).click(function() {
+                  window.location.href = "${SERVER_URL}resource?uri=" + encodeURIComponent($(this).attr("href"));
+                  return false;
+              });
+          });
 
-<div id="header">
-  <div id="logo">
-    <a href="${baseUri}">
-      <img src="${baseUri}core/public/img/lmf-white.png" alt="LMF" />
-    </a>
-  </div>
-  <h1>LMF Linked Data Explorer</h1>
-</div>
+          function loader(uri, type, target) {
+
+              var table = $("#"+target);
+
+              function linkify(text) {
+                  var exp = /(\b(https?|ftp|file):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/ig;
+                  return text.replace(exp,"<a href='$1' class='ldcache'>$1</a>");
+              }
+              function zebra(index) {
+                  return ( index % 2 ? "even": "odd" );
+              }
+              function createRow(data, cssClass) {
+                  return $("<tr>", {})
+                          .append($("<td>", {html: linkify(data.s)}))
+                          .append($("<td>", {html: linkify(data.p)}))
+                          .append($("<td>", {html: linkify(data.o)}))
+                          .append($("<td>", {html: linkify(data.c)}))
+                          .addClass(cssClass);
+              }
+              return {
+                  resource: uri,
+                  target: table,
+                  offset: 0,
+                  limit: 10,
+                  fetch: function() {
+                      var self = this;
+                      $.getJSON("${SERVER_URL}inspect/" + type, {uri: self.resource, start: self.offset, limit: self.limit}, function(data) {
+                          if(data.length == 0) {
+                              console.log(table);
+                              table.replaceWith("<p class='no_triples'>No triples to display</p>");
+                          }
+                          for( var i in data) {
+                              var t = data[i];
+                              table.append(createRow(t, zebra(i)));
+                          }
+                      });
+                  },
+                  next: function(step) {
+                      step = step || this.limit;
+                      this.offset += step;
+                      this.fetch();
+                  },
+                  prev: function(step) {
+                      step = step || this.limit
+                      this.offset = Math.max(this.offset - step, 0);
+                      this.fetch();
+                  },
+                  more: function() {
+                      this.limit += 5;
+                      this.fetch();
+                  },
+                  less: function() {
+                      this.limit = Math.max(this.limit - 5, 5);
+                      this.fetch();
+                  },
+                  first: function() {
+                      this.offset = 0;
+                      this.fetch();
+                  }
+              };
+          }
+
+      <#if resources?size = 1>
+          var subjLoader = new loader("${resources[0].uri}", "subject", "inspect_subject");
+          subjLoader.fetch();
+          $("#s0").click(function() {subjLoader.first();});
+          $("#s1").click(function() {subjLoader.prev();});
+          $("#s2").click(function() {subjLoader.next();});
+          $("#s3").click(function() {subjLoader.more();});
+          $("#s4").click(function() {subjLoader.less();});
+
+          var propLoader = new loader("${resources[0].uri}", "predicate", "inspect_property");
+          propLoader.fetch();
+
+          var objLoader = new loader("${resources[0].uri}", "object", "inspect_object");
+          objLoader.fetch();
+      </#if>
+
+      })
+  </script>
+</head>
 
+<body>
 <#function zebra index>
-  <#if (index % 2) == 0>
-    <#return "even" />
-  <#else>
-    <#return "odd" />
-  </#if>
+    <#if (index % 2) == 0>
+        <#return "odd" />
+    <#else>
+        <#return "even" />
+    </#if>
 </#function>
 
 <#function cacheClass object>
-  <#if object.cache?has_content>
-    <#return "ldcache" />
-  <#else>
-    <#return "" />
-  </#if>
+    <#if object.cache?has_content>
+        <#return "ldcache" />
+    <#else>
+        <#return "" />
+    </#if>
 </#function>
 
 <#function rdfaAttributes object>
-  <#return "${rdfaDatatype(object)} ${rdfaLanguage(object)}" />
+    <#return "${rdfaDatatype(object)} ${rdfaLanguage(object)}" />
 </#function>
 
 <#function rdfaDatatype object>
-  <#if object.datatype?has_content>
-    <#return "datatype=\"${object.datatype}\"" />
-  <#else>
-    <#return "" />
-  </#if>
+    <#if object.datatype?has_content>
+        <#return "datatype=\"${object.datatype}\"" />
+    <#else>
+        <#return "" />
+    </#if>
 </#function>
 
 <#function rdfaLanguage object>
-  <#if object.lang?has_content>
-    <#return "lang=\"${object.lang}\"" />
-  <#else>
-    <#return "" />
-  </#if>
+    <#if object.lang?has_content>
+        <#return "lang=\"${object.lang}\"" />
+    <#else>
+        <#return "" />
+    </#if>
 </#function>
 
-<div id="tabs">
-
-    <ul>
-    
-        <li><a href="#tab-raw-triples">raw triples</a></li>
-        
+<div id="wrapper">
+    <div id="header">
+        <a id="logo" href="${SERVER_URL}" title="${PROJECT}">
+            <img src="${SERVER_URL}${LOGO}" alt="${PROJECT} logo" />
+        </a>
+        <h1>RDF/HTML</h1>
         <#if resources?size = 1>
-        <li><a href="#tab-inspection">inspection</a></li>
-        </#if>  
-        
-    </ul>
-    
-    <div id="tab-raw-triples">
-   
-        <#if resources?has_content>
-          <#list resources as resource>
-            <div class="subheader">
-              <h3>Local description of <a href="${resource.uri}" class="ldcache">${resource.uri}</a>:</h3>
-            </div>
-            <table>
-              <tr class="trClassHeader">
-                <th>property</th>
-                <th>has value</th>
-                <th>context</th>
-                <th id="info">info</th>
-              </tr>
-              <#list resource.triples as triple>
-              <tr class="${zebra(triple_index)}">
-                <td><a href="${triple.predicate.uri}" class="ldcache">${triple.predicate.curie}</a></td>
-                <td about="${resource.uri}">
-                <#if triple.object.uri?has_content>
-                <a rel="${triple.predicate.curie}" href="${triple.object.uri}" class="${cacheClass(triple.object)}">${triple.object.curie}</a>
-                <#else> 
-                <span property="${triple.predicate.curie}" ${rdfaAttributes(triple.object)}>${triple.object.value}</span>
+        <div id="top_serialisation_links">
+            <a href="${SERVER_URL}resource?uri=${resources[0].encoded_uri}&amp;format=application/rdf%2Bxml">RDF/XML</a>&nbsp;|&nbsp;
+            <a href="${SERVER_URL}resource?uri=${resources[0].encoded_uri}&amp;format=text/rdf%2Bn3">N3</a>&nbsp;|&nbsp;
+            <a href="${SERVER_URL}resource?uri=${resources[0].encoded_uri}&amp;format=text/turtle">Turtle</a>&nbsp;|&nbsp;
+            <a href="${SERVER_URL}resource?uri=${resources[0].encoded_uri}&amp;format=application/rdf%2Bjson">RDF/JSON</a>&nbsp;|&nbsp;
+            <a href="${SERVER_URL}resource?uri=${resources[0].encoded_uri}&amp;format=application/ld%2Bjson">JSON-LD</a>
+        </div>
+        <div class="clean"></div>
+        </#if>
+    </div>
+    <div class="clear"></div>
+    <div id="left">
+    <ul id="menu">
+        <li class="menu_item">
+        <div class="menu_heading">Views</div>
+        <ul class="submenu">
+                <li class="active"><a href="#tab-raw-triples">Triples</a></li>
+                <#if resources?size = 1>
+                <li><a href="#tab-inspection">Inspector</a></li>
                 </#if>
-                </td>
-                <td><a href="${triple.context.curie}">${triple.context.curie}</a></td>
-                <td>${triple.info}</td>
-              </tr>
-              </#list>
-            </table>
-            <p id="rawrdf">
-              Get this resource in raw RDF: 
-              <a href="${baseUri}resource?uri=${resource.encoded_uri}&amp;format=application/rdf%2Bxml">RDF/XML</a>, 
-              <a href="${baseUri}resource?uri=${resource.encoded_uri}&amp;format=text/rdf%2Bn3">N3</a>, 
-              <a href="${baseUri}resource?uri=${resource.encoded_uri}&amp;format=text/turtle">Turtle</a>, 
-              <a href="${baseUri}resource?uri=${resource.encoded_uri}&amp;format=application/rdf%2Bjson">RDF/JSON</a>, 
-              <a href="${baseUri}resource?uri=${resource.encoded_uri}&amp;format=application/json">JSON-LD</a>
-            </p>
-          </#list>
-        <#else> 
-          <div class='subheader'>
-            <h3>No local triples to display!</h3>
-          </div>
-        </#if>   
-        
+            </ul>
+        </li>
+    </ul>
     </div>
-    
-    <#if resources?size = 1>
-    <div id="tab-inspection">
-        <div class="subheader">
-            <h3>Inspection of <a href="${resources[0].uri}" class="ldcache">${resources[0].uri}</a>:</h3>
-        </div>
-        <div class="introspectionDetails">
-            <h4><a href="${resources[0].uri}" class="ldcache">${resources[0].uri}</a> as Subject</h4>
-            <button id="s0">|&lt;</button>
-            <button id="s1">&lt;</button>
-        	<button id="s2">&gt;</button>
-        	<button id="s3">+</button>
-        	<button id="s4">-</button>
-        	<table id="inspect_subject">
-        	  <tr class="trClassHeader">
-        	    <th>Subject</th>
-        	    <th>Property</th>
-        	    <th>Object</th>
-        	    <th>Context<th>
-        	  </tr>
-        	</table>
-        </div>
-        <div class="introspectionDetails">
-            <h4><a href="${resources[0].uri}" class="ldcache">${resources[0].uri}</a> as Property</h4>
-        	<table id="inspect_property">
-              <tr class="trClassHeader">
-                <th>Subject</th>
-                <th>Property</th>
-                <th>Object</th>
-                <th>Context<th>
-              </tr>
-        	</table>
-        </div>
-        <div class="introspectionDetails">
-            <h4><a href="${resources[0].uri}" class="ldcache">${resources[0].uri}</a> as Object</h4>
-        	<table id="inspect_object">
-              <tr class="trClassHeader">
-                <th>Subject</th>
-                <th>Property</th>
-                <th>Object</th>
-                <th>Context<th>
-              </tr>
-        	</table>
+    <div id="center">
+        <div id="content">
+            <div id="tab-raw-triples">
+
+            <h1>Triples</h1>
+            <#if resources?has_content>
+                <#list resources as resource>
+                    <h2><a href="${resource.uri}" class="ldcache">${resource.uri}</a>
+                        <#if timemaplink??>
+                            <a style="float:right" id="timemap_link" href="${SERVER_URL}${timemaplink}${resource.uri}">
+                                <img style="width: 24px" title="browser versions" alt="memento" src="${SERVER_URL}core/public/img/icon/memento_logo_128.png">
+                            </a>
+                        </#if>
+                    </h2>
+                    <table class="simple_table">
+                        <tr class="trClassHeader">
+                            <th>property</th>
+                            <th>has value</th>
+                            <th>context</th>
+                            <th id="info">info</th>
+                        </tr>
+                        <#list resource.triples as triple>
+                            <tr class="${zebra(triple_index)}">
+                                <td><a href="${triple.predicate.uri}" class="ldcache">${triple.predicate.curie}</a></td>
+                                <td about="${resource.uri}">
+                                    <#if triple.object.uri?has_content>
+                                        <a rel="${triple.predicate.curie}" href="${triple.object.uri}" class="${cacheClass(triple.object)}">${triple.object.curie}</a>
+                                    <#else>
+                                        <span property="${triple.predicate.curie}" ${rdfaAttributes(triple.object)}>${triple.object.value}</span>
+                                    </#if>
+                                </td>
+                                <td><a href="${triple.context.uri}">${triple.context.curie}</a></td>
+                                <td>${triple.info}</td>
+                            </tr>
+                        </#list>
+                    </table>
+                    <#if resources?size != 1>
+                    <p id="rawrdf">
+                        Get this resource in raw RDF:
+                        <a href="${SERVER_URL}resource?uri=${resource.encoded_uri}&amp;format=application/rdf%2Bxml">RDF/XML</a>,
+                        <a href="${SERVER_URL}resource?uri=${resource.encoded_uri}&amp;format=text/rdf%2Bn3">N3</a>,
+                        <a href="${SERVER_URL}resource?uri=${resource.encoded_uri}&amp;format=text/turtle">Turtle</a>,
+                        <a href="${SERVER_URL}resource?uri=${resource.encoded_uri}&amp;format=application/rdf%2Bjson">RDF/JSON</a>,
+                        <a href="${SERVER_URL}resource?uri=${resource.encoded_uri}&amp;format=application/ld%2Bjson">JSON-LD</a>
+                    </p>
+                    </#if>
+                </#list>
+            <#else>
+                <p>
+                    No local triples to display!
+                </p>
+            </#if>
+
+            </div>
+
+        <#if resources?size = 1>
+            <div id="tab-inspection" style="display: none">
+                <h1>Inspection of <a href="${resources[0].uri}" class="ldcache">${resources[0].uri}</a></h1>
+                <div class="introspectionDetails">
+                    <h2>Resource as Subject</h2>
+                    <div id="table_buttons">
+                    <button id="s0">|&lt;</button>
+                    <button id="s1">&lt;</button>
+                    <button id="s2">&gt;</button>
+                    <button id="s3">+</button>
+                    <button id="s4">-</button>
+                    </div>
+                    <table id="inspect_subject" class="simple_table">
+                        <tr class="trClassHeader">
+                            <th>Subject</th>
+                            <th>Property</th>
+                            <th>Object</th>
+                            <th>Context</th>
+                        </tr>
+                    </table>
+                </div>
+                <div class="introspectionDetails">
+                    <h2>Resource as Property</h2>
+                    <table id="inspect_property" class="simple_table">
+                        <tr class="trClassHeader">
+                            <th>Subject</th>
+                            <th>Property</th>
+                            <th>Object</th>
+                            <th>Context</th>
+                        </tr>
+                    </table>
+                </div>
+                <div class="introspectionDetails">
+                    <h2>Resource as Object</h2>
+                    <table id="inspect_object" class="simple_table">
+                        <tr class="trClassHeader">
+                            <th>Subject</th>
+                            <th>Property</th>
+                            <th>Object</th>
+                            <th>Context</th>
+                        </tr>
+                    </table>
+                </div>
+                <!--
+                <div class="introspectionDetails">
+                    <h4><a href="${resources[0].uri}" class="ldcache">${resources[0].uri}</a> as Context</h4>
+                	<table id="inspect_context">
+                      <tr class="trClassHeader">
+                        <th>Subject</th>
+                        <th>Property</th>
+                        <th>Object</th>
+                        <th>Context<th>
+                      </tr>
+                	</table>
+                </div>
+                -->
+            </div>
+        </#if>
         </div>
-        <!--
-        <div class="introspectionDetails">
-            <h4><a href="${resources[0].uri}" class="ldcache">${resources[0].uri}</a> as Context</h4>
-        	<table id="inspect_context">
-              <tr class="trClassHeader">
-                <th>Subject</th>
-                <th>Property</th>
-                <th>Object</th>
-                <th>Context<th>
-              </tr>
-        	</table>
+    </div>
+    <div class="clear"></div>
+    <div id="footer">
+        <div id="footer_line">
+            <span>
+            ${FOOTER}
+            </span>
         </div>
-        -->
     </div>
-    </#if>   
-    
 </div>
-
-<div id="footer" class="clear">
-    <span><abbr title="Linked Media Framework">LMF</abbr> is a project of <a href="http://www.newmedialab.at/">SNML-TNG</a></span>
-</div>
-
-<script type="text/javascript"> 
-
-  $(document).ready(function() {
-
-    $("div#tabs").tabs();
-    
-    $("a.ldcache").each(function(index) { 
-      $(this).click(function() { 
-        window.location.href = "${baseUri}resource?uri=" + encodeURIComponent($(this).attr("href")); 
-        return false; 
-      }); 
-    });    
-    
-    function loader(uri, type, target) {
-        function linkify(text) {
-            var exp = /(\b(https?|ftp|file):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/ig;
-            return text.replace(exp,"<a href='$1' class='ldcache'>$1</a>"); 
-        }
-        function zebra(index) {
-             return ( index % 2 ? "even": "odd" );
-        }                
-        function createRow(data, cssClass) {
-            return $("<tr>", {})
-                .append($("<td>", {html: linkify(data.s)}))
-                .append($("<td>", {html: linkify(data.p)}))
-                .append($("<td>", {html: linkify(data.o)}))
-                .append($("<td>", {html: linkify(data.c)}))
-                .addClass(cssClass);
-        }
-        return {
-            resource: uri,
-            target: $(target),
-            offset: 0,
-            limit: 10,
-            fetch: function() {
-                var self = this;
-                $.getJSON("${baseUri}inspect/" + type, {uri: self.resource, start: self.offset, limit: self.limit}, function(data) {
-                    //self.target.empty();
-                    for( var i in data) {
-                        var t = data[i];
-                        self.target.append(createRow(t, zebra(i)));                                     
-                    }
-                });
-            },
-            next: function(step) {
-                step = step || this.limit;
-                this.offset += step;
-                this.fetch();
-            },
-            prev: function(step) {
-                step = step || this.limit
-                this.offset = Math.max(this.offset - step, 0);
-                this.fetch();
-            },
-            more: function() {
-                this.limit += 5;
-                this.fetch();
-            },
-            less: function() {
-                this.limit = Math.max(this.limit - 5, 5);
-                this.fetch();
-            },
-            first: function() {
-                this.offset = 0;
-                this.fetch();
-            }
-        };
-    }    
-    
-    <#if resources?size = 1>
-    var subj = $("table#inspect_subject tbody");
-    var subjLoader = new loader("${resources[0].uri}", "subject", subj);
-    subjLoader.fetch();
-    $("#s0").click(function() {subjLoader.first();});
-    $("#s1").click(function() {subjLoader.prev();});
-    $("#s2").click(function() {subjLoader.next();});
-    $("#s3").click(function() {subjLoader.more();});
-    $("#s4").click(function() {subjLoader.less();});
-
-    var prop = $("table#inspect_property tbody");
-    var propLoader = new loader("${resources[0].uri}", "predicate", prop);
-    propLoader.fetch();
-
-    var obj = $("table#inspect_object tbody");
-    var objLoader = new loader("${resources[0].uri}", "object", obj);
-    objLoader.fetch();    
-    </#if> 
-
-  });
-
-</script> 
-
 </body>
 
 </html>
+

http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/582abb5b/build/archetypes/marmotta-archetype-webapp/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/web.xml
----------------------------------------------------------------------
diff --git a/build/archetypes/marmotta-archetype-webapp/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/web.xml b/build/archetypes/marmotta-archetype-webapp/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/web.xml
index 29fd3a7..ffbe30d 100644
--- a/build/archetypes/marmotta-archetype-webapp/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/web.xml
+++ b/build/archetypes/marmotta-archetype-webapp/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/web.xml
@@ -52,6 +52,7 @@
         <param-value>/tmp/lmf</param-value>
     </context-param>
 
+
     <!-- handle OPTIONS requests -->
     <filter>
         <filter-name>MarmottaOptionsFilter</filter-name>
@@ -76,10 +77,14 @@
 
         <init-param>
             <param-name>cors.supportedHeaders</param-name>
-            <param-value>Origin, Accept</param-value>
+            <param-value>Origin, Accept, Content-Type</param-value>
         </init-param>
 
     </filter>
+    <filter-mapping>
+        <filter-name>CORS</filter-name>
+        <url-pattern>/*</url-pattern>
+    </filter-mapping>
 
     <!-- this filter performs startup configurations for first installation -->
     <filter>

http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/582abb5b/build/archetypes/pom.xml
----------------------------------------------------------------------
diff --git a/build/archetypes/pom.xml b/build/archetypes/pom.xml
index bb1c01b..dea4e2a 100644
--- a/build/archetypes/pom.xml
+++ b/build/archetypes/pom.xml
@@ -20,7 +20,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.1.0-incubating-SNAPSHOT</version>
+        <version>3.1.0-incubating</version>
         <relativePath>../../parent</relativePath>
     </parent>
     <artifactId>archetypes-reactor</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/582abb5b/build/checkstyle-resources/pom.xml
----------------------------------------------------------------------
diff --git a/build/checkstyle-resources/pom.xml b/build/checkstyle-resources/pom.xml
index 2a55e83..0ef41ed 100644
--- a/build/checkstyle-resources/pom.xml
+++ b/build/checkstyle-resources/pom.xml
@@ -22,7 +22,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.1.0-incubating-SNAPSHOT</version>
+        <version>3.1.0-incubating</version>
         <relativePath>../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/582abb5b/build/dependency-resource-supplement/pom.xml
----------------------------------------------------------------------
diff --git a/build/dependency-resource-supplement/pom.xml b/build/dependency-resource-supplement/pom.xml
index d9eb75a..92d77a4 100644
--- a/build/dependency-resource-supplement/pom.xml
+++ b/build/dependency-resource-supplement/pom.xml
@@ -20,7 +20,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.1.0-incubating-SNAPSHOT</version>
+        <version>3.1.0-incubating</version>
         <relativePath>../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/582abb5b/build/plugins/buildinfo-maven-plugin/pom.xml
----------------------------------------------------------------------
diff --git a/build/plugins/buildinfo-maven-plugin/pom.xml b/build/plugins/buildinfo-maven-plugin/pom.xml
index ab3bf6a..e363329 100644
--- a/build/plugins/buildinfo-maven-plugin/pom.xml
+++ b/build/plugins/buildinfo-maven-plugin/pom.xml
@@ -22,7 +22,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.1.0-incubating-SNAPSHOT</version>
+        <version>3.1.0-incubating</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 
@@ -53,8 +53,8 @@
         </dependency>
 
         <dependency>
-            <groupId>commons-lang</groupId>
-            <artifactId>commons-lang</artifactId>
+            <groupId>org.apache.commons</groupId>
+            <artifactId>commons-lang3</artifactId>
         </dependency>
 
         <dependency>
@@ -95,8 +95,8 @@
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-compiler-plugin</artifactId>
                 <configuration>
-                    <source>1.6</source>
-                    <target>1.6</target>
+                    <source>1.7</source>
+                    <target>1.7</target>
                 </configuration>
             </plugin>
             <plugin>

http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/582abb5b/build/plugins/buildinfo-maven-plugin/src/main/java/org/apache/marmotta/maven/plugins/buildinfo/ProjectInfoProvider.java
----------------------------------------------------------------------
diff --git a/build/plugins/buildinfo-maven-plugin/src/main/java/org/apache/marmotta/maven/plugins/buildinfo/ProjectInfoProvider.java b/build/plugins/buildinfo-maven-plugin/src/main/java/org/apache/marmotta/maven/plugins/buildinfo/ProjectInfoProvider.java
index df74c81..6d87e6d 100644
--- a/build/plugins/buildinfo-maven-plugin/src/main/java/org/apache/marmotta/maven/plugins/buildinfo/ProjectInfoProvider.java
+++ b/build/plugins/buildinfo-maven-plugin/src/main/java/org/apache/marmotta/maven/plugins/buildinfo/ProjectInfoProvider.java
@@ -17,7 +17,7 @@
  */
 package org.apache.marmotta.maven.plugins.buildinfo;
 
-import org.apache.commons.lang.time.DateFormatUtils;
+import org.apache.commons.lang3.time.DateFormatUtils;
 import org.apache.maven.project.MavenProject;
 
 import java.util.Date;

http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/582abb5b/build/plugins/marmotta-maven-plugin/pom.xml
----------------------------------------------------------------------
diff --git a/build/plugins/marmotta-maven-plugin/pom.xml b/build/plugins/marmotta-maven-plugin/pom.xml
index eb4f2ca..fc86edf 100644
--- a/build/plugins/marmotta-maven-plugin/pom.xml
+++ b/build/plugins/marmotta-maven-plugin/pom.xml
@@ -20,7 +20,7 @@
 
     <parent>
         <groupId>org.apache.marmotta</groupId>
-        <version>3.1.0-incubating-SNAPSHOT</version>
+        <version>3.1.0-incubating</version>
         <relativePath>../</relativePath>
         <artifactId>plugins-reactor</artifactId>
     </parent>
@@ -58,8 +58,8 @@
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-compiler-plugin</artifactId>
                 <configuration>
-                    <source>1.6</source>
-                    <target>1.6</target>
+                    <source>1.7</source>
+                    <target>1.7</target>
                 </configuration>
             </plugin>
         </plugins>

http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/582abb5b/build/plugins/pom.xml
----------------------------------------------------------------------
diff --git a/build/plugins/pom.xml b/build/plugins/pom.xml
index d25196d..3a11349 100644
--- a/build/plugins/pom.xml
+++ b/build/plugins/pom.xml
@@ -20,7 +20,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.1.0-incubating-SNAPSHOT</version>
+        <version>3.1.0-incubating</version>
         <relativePath>../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/582abb5b/build/plugins/refpack-maven-plugin/pom.xml
----------------------------------------------------------------------
diff --git a/build/plugins/refpack-maven-plugin/pom.xml b/build/plugins/refpack-maven-plugin/pom.xml
index 0534b9e..0ab97f5 100644
--- a/build/plugins/refpack-maven-plugin/pom.xml
+++ b/build/plugins/refpack-maven-plugin/pom.xml
@@ -21,7 +21,7 @@
 
     <parent>
         <groupId>org.apache.marmotta</groupId>
-        <version>3.1.0-incubating-SNAPSHOT</version>
+        <version>3.1.0-incubating</version>
         <artifactId>plugins-reactor</artifactId>
         <relativePath>../</relativePath>
     </parent>
@@ -111,8 +111,8 @@
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-compiler-plugin</artifactId>
                 <configuration>
-                    <source>1.6</source>
-                    <target>1.6</target>
+                    <source>1.7</source>
+                    <target>1.7</target>
                 </configuration>
             </plugin>
         </plugins>

http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/582abb5b/build/plugins/repocheck-maven-plugin/pom.xml
----------------------------------------------------------------------
diff --git a/build/plugins/repocheck-maven-plugin/pom.xml b/build/plugins/repocheck-maven-plugin/pom.xml
index 3da02ac..c1982b4 100644
--- a/build/plugins/repocheck-maven-plugin/pom.xml
+++ b/build/plugins/repocheck-maven-plugin/pom.xml
@@ -20,7 +20,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>plugins-reactor</artifactId>
-        <version>3.1.0-incubating-SNAPSHOT</version>
+        <version>3.1.0-incubating</version>
         <relativePath>../</relativePath>
         <!-- <artifactId>maven-plugins</artifactId> <groupId>org.apache.maven.plugins</groupId> 
             <version>23</version> <relativePath /> -->

http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/582abb5b/build/pom.xml
----------------------------------------------------------------------
diff --git a/build/pom.xml b/build/pom.xml
index b6b8359..a3bd4de 100644
--- a/build/pom.xml
+++ b/build/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.1.0-incubating-SNAPSHOT</version>
+        <version>3.1.0-incubating</version>
         <relativePath>../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/582abb5b/build/scripts/check_signatures.sh
----------------------------------------------------------------------
diff --git a/build/scripts/check_signatures.sh b/build/scripts/check_signatures.sh
new file mode 100755
index 0000000..0aee050
--- /dev/null
+++ b/build/scripts/check_signatures.sh
@@ -0,0 +1,75 @@
+#!/bin/bash -e
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License
+#
+##############################################################################
+#
+# Usage: ./check_signatures.sh <RELEASE_DIR>
+#
+# Progress printed on STDOUT, result available via exit-code
+#
+# Exit-Codes:
+#    0 - All fine, signatures and digests are valid and correct
+#    1 - A Required file (.asc, .md5, .sha1) is missing
+#    2 - Invalid pgp/gpg signature found (.asc)
+#    3 - Incorrect md5-sum detected (.md5)
+#    4 - Incorrect sha1-sum detected (.sha1)
+#  255 - Wrong/Missing command parameter
+#
+
+# Check for arguments
+[ -z $1 ] && { echo "USAGE: $0 <RELEASE_DIR>" >&2; exit 255; }
+[ ! -d $1 ] && { echo "release-dir '$1' not found" >&2; exit 255; }
+
+BASE="${1}"
+#cd "$BASE"
+
+KR=$(mktemp)
+# make sure that the temp-keyring is removed on exit
+trap "{ C=$?; rm -f ${KR} ${KR}~ ; exit $C; }" EXIT
+
+gpg="gpg --primary-keyring $KR"
+# If there is a KEYS file, import it into the temp keyring
+[ -r "$BASE/KEYS" ] && { echo "Import KEYS into temporary keyring"; $gpg --import "$BASE/KEYS"; echo; }
+
+# Look for all archives: *.zip, *.tar.gz, *.tgz
+find "$BASE" -maxdepth 1 -type f -name "*.zip" -o -name "*.t*gz" | sort | while read f; do
+	echo "Checking archive $(basename $f)..."
+
+        # Check gpg/pgp signature
+        if [ -f "${f}.asc" ]; then
+           $gpg --verify "${f}.asc" &>/dev/null && echo "  - Signature: OK" || { echo "  - Signature: ERROR"; exit 2; }
+        else
+           echo "  - Signature: MISSING"; exit 1
+        fi
+
+        # Check md5sum
+        if [ -f "${f}.md5" ]; then
+           echo "$(cat ${f}.md5)  ${f}" | md5sum --check - &>/dev/null && echo "  - MD5: OK" || { echo "  - MD5: ERROR"; exit 3; }
+        else
+           echo "  - MD5: MISSING"; exit 1
+        fi
+
+        # Check sha1
+        if [ -f "${f}.sha1" ]; then
+           echo "$(cat ${f}.sha1)  ${f}" | sha1sum --check - &>/dev/null && echo "  - SHA1: OK" || { echo "  - SHA1: ERROR"; exit 4; }
+        else
+           echo "  - SHA1: MISSING"; exit 1
+        fi
+	echo
+done
+echo "All archives in $BASE have valid signatures and digests."
+echo

http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/582abb5b/build/scripts/check_signatures_and_digests.sh
----------------------------------------------------------------------
diff --git a/build/scripts/check_signatures_and_digests.sh b/build/scripts/check_signatures_and_digests.sh
deleted file mode 100755
index 3577ca6..0000000
--- a/build/scripts/check_signatures_and_digests.sh
+++ /dev/null
@@ -1,62 +0,0 @@
-#!/bin/sh
-#
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License
-#
-# Checks signatures and digests of source-releases. Inspired by Apache Stanbol.
-#
-# Usage: check_signatures_and_digests.sh <DIR_WITH_RELEASE>
-#
-
-if hash realpath 2>/dev/null; then
-  DIR=`realpath $1`
-else
-  DIR=$1
-fi
-
-echo "Checking signatures and digests over '$DIR'...."
-
-for i in `find "$DIR" -name "*.*" -maxdepth 1 -type f | grep -v '\.\(asc\|sha1\|md5\)$'`
-do
-  f=`echo $i | sed 's/\.asc$//'`
-  echo "$f"
-  gpg --verify $f.asc 2>/dev/null
-  if [ "$?" = "0" ]; then CHKSUM="GOOD"; else CHKSUM="BAD!!!!!!!!"; fi
-  if [ ! -f "$f.asc" ]; then CHKSUM="----"; fi
-  echo "gpg:  ${CHKSUM}"
-
-  for tp in md5 sha1
-  do
-    if [ ! -f "$f.$tp" ]
-    then
-      CHKSUM="----"
-    else
-      A="`cat $f.$tp 2>/dev/null`"
-      B="`openssl $tp < $f 2>/dev/null | sed 's/.*= *//' `"
-      if [ "$A" = "$B" ]; 
-      then 
-        CHKSUM="GOOD (`cat $f.$tp`)"
-      else 
-        CHKSUM="BAD!! : $A not equal to $B" 
-      fi
-   fi
-   echo "$tp : ${CHKSUM}"
- done
-
-done
-
-if [ -z "${CHKSUM}" ]; then echo "WARNING: no files found!"; fi
-
-echo "DONE"

http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/582abb5b/client/marmotta-client-java/pom.xml
----------------------------------------------------------------------
diff --git a/client/marmotta-client-java/pom.xml b/client/marmotta-client-java/pom.xml
index aee1f8c..07ef981 100644
--- a/client/marmotta-client-java/pom.xml
+++ b/client/marmotta-client-java/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.1.0-incubating-SNAPSHOT</version>
+        <version>3.1.0-incubating</version>
         <relativePath>../../parent</relativePath>
     </parent>
 
@@ -37,6 +37,20 @@
         <plugins>
             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-jar-plugin</artifactId>
+                <version>2.4</version>
+                <inherited>true</inherited>
+                <configuration>
+                    <archive>                   
+                        <manifest>
+                            <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
+                            <addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
+                        </manifest>
+                    </archive>
+                </configuration>
+            </plugin>        
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-failsafe-plugin</artifactId>
                 <executions>
                     <execution>
@@ -63,8 +77,8 @@
 
     <dependencies>
         <dependency>
-            <groupId>commons-lang</groupId>
-            <artifactId>commons-lang</artifactId>
+            <groupId>org.apache.commons</groupId>
+            <artifactId>commons-lang3</artifactId>
         </dependency>
         <dependency>
             <groupId>org.apache.httpcomponents</groupId>
@@ -79,10 +93,6 @@
             <artifactId>guava</artifactId>
         </dependency>
         <dependency>
-            <groupId>org.apache.solr</groupId>
-            <artifactId>solr-solrj</artifactId>
-        </dependency>
-        <dependency>
             <groupId>org.codehaus.jackson</groupId>
             <artifactId>jackson-core-asl</artifactId>
         </dependency>
@@ -91,6 +101,23 @@
             <artifactId>jackson-mapper-asl</artifactId>
         </dependency>
         <dependency>
+        	<groupId>org.openrdf.sesame</groupId>
+        	<artifactId>sesame-rio-api</artifactId>
+        </dependency>
+        <dependency>
+        	<groupId>org.openrdf.sesame</groupId>
+        	<artifactId>sesame-rio-rdfjson</artifactId>
+        </dependency>
+        <dependency>
+        	<groupId>org.openrdf.sesame</groupId>
+        	<artifactId>sesame-queryresultio-api</artifactId>
+        </dependency>
+        <dependency>
+        	<groupId>org.openrdf.sesame</groupId>
+        	<artifactId>sesame-queryresultio-sparqljson</artifactId>
+        	<scope>runtime</scope>
+        </dependency>
+        <dependency>
             <groupId>org.slf4j</groupId>
             <artifactId>slf4j-api</artifactId>
         </dependency>
@@ -124,9 +151,15 @@
             <scope>test</scope>
         </dependency>
         <dependency>
-            <groupId>org.mortbay.jetty</groupId>
-            <artifactId>jetty-embedded</artifactId>
-            <version>6.1.26</version>
+            <groupId>org.eclipse.jetty</groupId>
+            <artifactId>jetty-server</artifactId>
+            <version>9.0.3.v20130506</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.eclipse.jetty</groupId>
+            <artifactId>jetty-servlet</artifactId>
+            <version>9.0.3.v20130506</version>
             <scope>test</scope>
         </dependency>
         <dependency>
@@ -188,6 +221,12 @@
             <version>${project.version}</version>
             <scope>test</scope>
         </dependency>
+        <dependency>
+            <groupId>javax.el</groupId>
+            <artifactId>javax.el-api</artifactId>
+            <scope>test</scope>
+        </dependency>
+
 
     </dependencies>
 

http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/582abb5b/client/marmotta-client-java/src/main/java/org/apache/marmotta/client/MarmottaClient.java
----------------------------------------------------------------------
diff --git a/client/marmotta-client-java/src/main/java/org/apache/marmotta/client/MarmottaClient.java b/client/marmotta-client-java/src/main/java/org/apache/marmotta/client/MarmottaClient.java
index 5121dc3..131e04b 100644
--- a/client/marmotta-client-java/src/main/java/org/apache/marmotta/client/MarmottaClient.java
+++ b/client/marmotta-client-java/src/main/java/org/apache/marmotta/client/MarmottaClient.java
@@ -29,11 +29,8 @@ import org.apache.marmotta.client.clients.SPARQLClient;
  * Author: Sebastian Schaffert
  */
 public class MarmottaClient {
-    
-    public static final String VERSION = "0.1.0";
-
-    private ClientConfiguration config;
 
+    protected ClientConfiguration config;
 
     public MarmottaClient(ClientConfiguration config) {
         this.config = config;

http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/582abb5b/client/marmotta-client-java/src/main/java/org/apache/marmotta/client/clients/SPARQLClient.java
----------------------------------------------------------------------
diff --git a/client/marmotta-client-java/src/main/java/org/apache/marmotta/client/clients/SPARQLClient.java b/client/marmotta-client-java/src/main/java/org/apache/marmotta/client/clients/SPARQLClient.java
index fe4c9f1..ddb96fa 100644
--- a/client/marmotta-client-java/src/main/java/org/apache/marmotta/client/clients/SPARQLClient.java
+++ b/client/marmotta-client-java/src/main/java/org/apache/marmotta/client/clients/SPARQLClient.java
@@ -28,19 +28,31 @@ import org.apache.marmotta.client.model.rdf.RDFNode;
 import org.apache.marmotta.client.model.rdf.URI;
 import org.apache.marmotta.client.model.sparql.SPARQLResult;
 import org.apache.marmotta.client.util.HTTPUtil;
-import org.codehaus.jackson.JsonParser;
-import org.codehaus.jackson.map.ObjectMapper;
-import org.codehaus.jackson.type.TypeReference;
+import org.openrdf.model.Value;
+import org.openrdf.model.ValueFactory;
+import org.openrdf.model.impl.ValueFactoryImpl;
+import org.openrdf.query.Binding;
+import org.openrdf.query.BindingSet;
+import org.openrdf.query.QueryResultHandler;
+import org.openrdf.query.QueryResultHandlerException;
+import org.openrdf.query.TupleQueryResultHandlerException;
+import org.openrdf.query.resultio.BooleanQueryResultFormat;
+import org.openrdf.query.resultio.QueryResultIO;
+import org.openrdf.query.resultio.QueryResultParseException;
+import org.openrdf.query.resultio.QueryResultParser;
+import org.openrdf.query.resultio.TupleQueryResultFormat;
+import org.openrdf.query.resultio.UnsupportedQueryResultFormatException;
+import org.openrdf.query.resultio.helpers.QueryResultCollector;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 import java.io.IOException;
+import java.io.InputStream;
 import java.net.URLEncoder;
 import java.util.HashMap;
-import java.util.HashSet;
+import java.util.LinkedHashSet;
 import java.util.List;
 import java.util.Map;
-import java.util.Set;
 
 /**
  * Add file description here!
@@ -68,14 +80,13 @@ public class SPARQLClient {
      * @throws IOException
      * @throws MarmottaClientException
      */
-    @SuppressWarnings("unchecked")
     public SPARQLResult select(String query) throws IOException, MarmottaClientException {
         HttpClient httpClient = HTTPUtil.createClient(config);
 
         String serviceUrl = config.getMarmottaUri() + URL_QUERY_SERVICE + "?query=" + URLEncoder.encode(query, "utf-8");
 
         HttpGet get = new HttpGet(serviceUrl);
-        get.setHeader("Accept", "application/sparql-results+json");
+        get.setHeader("Accept", TupleQueryResultFormat.JSON.getDefaultMIMEType());
         
         try {
 
@@ -84,57 +95,50 @@ public class SPARQLClient {
             switch(response.getStatusLine().getStatusCode()) {
                 case 200:
                     log.debug("SPARQL Query {} evaluated successfully",query);
-                    ObjectMapper mapper = new ObjectMapper();
-                    mapper.configure(JsonParser.Feature.ALLOW_UNQUOTED_FIELD_NAMES, true);
-                    Map<String,Map<String,List<?>>> resultMap =
-                            mapper.readValue(response.getEntity().getContent(),new TypeReference<Map<String,Map<String,List<?>>>>(){});
+                    QueryResultCollector results = new QueryResultCollector();
+                    
+                    parse(response.getEntity().getContent(), TupleQueryResultFormat.JSON, results, ValueFactoryImpl.getInstance());
 
-                    if(resultMap.isEmpty()) {
+                    if(!results.getHandledTuple() || results.getBindingSets().isEmpty()) {
                         return null;
                     } else {
-                        List<?> head = resultMap.get("head").get("vars");
-                        Set<String> fieldNames = new HashSet<String>();
-                        for(Object o : head) {
-                            if(o instanceof String) {
-                                fieldNames.add((String)o);
-                            }
-                        }
+                        List<String> fieldNames = results.getBindingNames();
 
-                        SPARQLResult result = new SPARQLResult(fieldNames);
+                        SPARQLResult result = new SPARQLResult(new LinkedHashSet<String>(fieldNames));
 
-                        List<?> bindings = resultMap.get("results").get("bindings");
-                        for(Object o : bindings) {
-                            if(o instanceof Map) {
-                                Map<String,RDFNode> row = new HashMap<String, RDFNode>();
-                                for(Map.Entry<String,?> entry : ((Map<String,?>)o).entrySet()) {
-                                    Map<String,String> nodeDef = (Map<String,String>) entry.getValue();
+                        //List<?> bindings = resultMap.get("results").get("bindings");
+                        for(BindingSet nextRow : results.getBindingSets()) {
+                            Map<String,RDFNode> row = new HashMap<String, RDFNode>();
+                            
+                            for(String nextBindingName : fieldNames) {
+                                if(nextRow.hasBinding(nextBindingName)) {
+                                    Binding nextBinding = nextRow.getBinding(nextBindingName);
+                                    //Map<String,String> nodeDef = (Map<String,String>) entry.getValue();
+                                    Value nodeDef = nextBinding.getValue();
                                     RDFNode node = null;
-                                    if("uri".equalsIgnoreCase(nodeDef.get("type"))) {
-                                        node = new URI(nodeDef.get("value"));
-                                    } else if("literal".equalsIgnoreCase(nodeDef.get("type")) ||
-                                              "typed-literal".equalsIgnoreCase(nodeDef.get("type"))) {
-                                        String lang = nodeDef.get("xml:lang");
-                                        String datatype = nodeDef.get("datatype");
-
-                                        if(lang != null) {
-                                            node = new Literal(nodeDef.get("value"),lang);
-                                        } else if(datatype != null) {
-                                            node = new Literal(nodeDef.get("value"),new URI(datatype));
+                                    if(nodeDef instanceof org.openrdf.model.URI) {
+                                        node = new URI(nodeDef.stringValue());
+                                    } else if(nodeDef instanceof org.openrdf.model.BNode) {
+                                        node = new BNode(((org.openrdf.model.BNode)nodeDef).getID());
+                                    } else if(nodeDef instanceof org.openrdf.model.Literal) {
+                                        org.openrdf.model.Literal nodeLiteral = (org.openrdf.model.Literal)nodeDef;
+                                        if(nodeLiteral.getLanguage() != null) {
+                                            node = new Literal(nodeLiteral.getLabel(), nodeLiteral.getLanguage());
+                                        } else if(nodeLiteral.getDatatype() != null) {
+                                            node = new Literal(nodeLiteral.getLabel(), new URI(nodeLiteral.getDatatype().stringValue()));
                                         } else {
-                                            node = new Literal(nodeDef.get("value"));
+                                            node = new Literal(nodeLiteral.getLabel());
                                         }
-                                    } else if("bnode".equalsIgnoreCase(nodeDef.get("type"))) {
-                                        node = new BNode(nodeDef.get("value"));
                                     } else {
-                                        log.error("unknown result node type: {}",nodeDef.get("type"));
+                                        log.error("unknown result node type: {}",nodeDef);
                                     }
                                     
                                     if(node != null) {
-                                        row.put(entry.getKey(),node);
+                                        row.put(nextBindingName, node);
                                     }
                                 }
-                                result.add(row);
                             }
+                            result.add(row);
                         }
                         return result;
                     }
@@ -143,6 +147,16 @@ public class SPARQLClient {
                     throw new MarmottaClientException("error evaluating SPARQL Select Query "+query+": "+response.getStatusLine().getStatusCode() + " " + response.getStatusLine().getReasonPhrase());
             }
 
+        } catch(TupleQueryResultHandlerException e) {
+            throw new MarmottaClientException("error evaluating SPARQL Select Query ", e);
+        } catch(QueryResultParseException e) {
+            throw new MarmottaClientException("error evaluating SPARQL Select Query ", e);
+        } catch(UnsupportedQueryResultFormatException e) {
+            throw new MarmottaClientException("error evaluating SPARQL Select Query ", e);
+        } catch(IllegalStateException e) {
+            throw new MarmottaClientException("error evaluating SPARQL Select Query ", e);
+        } catch(QueryResultHandlerException e) {
+            throw new MarmottaClientException("error evaluating SPARQL Select Query ", e);
         } finally {
             get.releaseConnection();
         }
@@ -162,7 +176,7 @@ public class SPARQLClient {
         String serviceUrl = config.getMarmottaUri() + URL_QUERY_SERVICE + "?query=" + URLEncoder.encode(askQuery, "utf-8");
 
         HttpGet get = new HttpGet(serviceUrl);
-        get.setHeader("Accept", "application/sparql-results+json");
+        get.setHeader("Accept", BooleanQueryResultFormat.JSON.getDefaultMIMEType());
         
         try {
 
@@ -171,22 +185,30 @@ public class SPARQLClient {
             switch(response.getStatusLine().getStatusCode()) {
                 case 200:
                     log.debug("SPARQL ASK Query {} evaluated successfully",askQuery);
-                    ObjectMapper mapper = new ObjectMapper();
-                    mapper.configure(JsonParser.Feature.ALLOW_UNQUOTED_FIELD_NAMES, true);
-                    Map<String,Object> resultMap =
-                            mapper.readValue(response.getEntity().getContent(),new TypeReference<Map<String,Object>>(){});
+                    QueryResultCollector results = new QueryResultCollector();
+                    
+                    parse(response.getEntity().getContent(), BooleanQueryResultFormat.JSON, results, ValueFactoryImpl.getInstance());
 
-                    if(resultMap.isEmpty()) {
+                    if(!results.getHandledBoolean()) {
                         return false;
                     } else {
-                        Boolean result = resultMap.get("boolean") != null && ((String)resultMap.get("boolean")).equalsIgnoreCase("true");
-                        return result;
+                        return results.getBoolean();
                     }
                 default:
                     log.error("error evaluating SPARQL ASK Query {}: {} {}",new Object[] {askQuery,response.getStatusLine().getStatusCode(),response.getStatusLine().getReasonPhrase()});
                     throw new MarmottaClientException("error evaluating SPARQL ASK Query "+askQuery+": "+response.getStatusLine().getStatusCode() + " " + response.getStatusLine().getReasonPhrase());
             }
 
+        } catch(TupleQueryResultHandlerException e) {
+            throw new MarmottaClientException("error evaluating SPARQL Ask Query ", e);
+        } catch(QueryResultParseException e) {
+            throw new MarmottaClientException("error evaluating SPARQL Ask Query ", e);
+        } catch(UnsupportedQueryResultFormatException e) {
+            throw new MarmottaClientException("error evaluating SPARQL Ask Query ", e);
+        } catch(IllegalStateException e) {
+            throw new MarmottaClientException("error evaluating SPARQL Ask Query ", e);
+        } catch(QueryResultHandlerException e) {
+            throw new MarmottaClientException("error evaluating SPARQL Ask Query ", e);
         } finally {
             get.releaseConnection();
         }
@@ -226,4 +248,49 @@ public class SPARQLClient {
         }
     }
     
+    /**
+     * FIXME: Replace this with QueryResultIO.parse after Sesame-2.7.3.
+     * 
+     * @param in
+     * @param format
+     * @param handler
+     * @param valueFactory
+     * @throws IOException
+     * @throws QueryResultParseException
+     * @throws TupleQueryResultHandlerException
+     * @throws UnsupportedQueryResultFormatException
+     */
+    private static void parse(InputStream in, TupleQueryResultFormat format, QueryResultHandler handler,
+            ValueFactory valueFactory)
+        throws IOException, QueryResultParseException, QueryResultHandlerException,
+        UnsupportedQueryResultFormatException
+    {
+        QueryResultParser parser = QueryResultIO.createParser(format);
+        parser.setValueFactory(valueFactory);
+        parser.setQueryResultHandler(handler);
+        parser.parseQueryResult(in);
+    }
+    
+    /**
+     * FIXME: Replace this with QueryResultIO.parse after Sesame-2.7.3.
+     * 
+     * @param in
+     * @param format
+     * @param handler
+     * @param valueFactory
+     * @throws IOException
+     * @throws QueryResultParseException
+     * @throws TupleQueryResultHandlerException
+     * @throws UnsupportedQueryResultFormatException
+     */
+    private static void parse(InputStream in, BooleanQueryResultFormat format, QueryResultHandler handler,
+            ValueFactory valueFactory)
+        throws IOException, QueryResultParseException, QueryResultHandlerException,
+        UnsupportedQueryResultFormatException
+    {
+        QueryResultParser parser = QueryResultIO.createParser(format);
+        parser.setValueFactory(valueFactory);
+        parser.setQueryResultHandler(handler);
+        parser.parseQueryResult(in);
+    }
 }

http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/582abb5b/client/marmotta-client-java/src/main/java/org/apache/marmotta/client/util/HTTPUtil.java
----------------------------------------------------------------------
diff --git a/client/marmotta-client-java/src/main/java/org/apache/marmotta/client/util/HTTPUtil.java b/client/marmotta-client-java/src/main/java/org/apache/marmotta/client/util/HTTPUtil.java
index f2b5f12..39192d8 100644
--- a/client/marmotta-client-java/src/main/java/org/apache/marmotta/client/util/HTTPUtil.java
+++ b/client/marmotta-client-java/src/main/java/org/apache/marmotta/client/util/HTTPUtil.java
@@ -17,7 +17,9 @@
  */
 package org.apache.marmotta.client.util;
 
-import org.apache.commons.lang.StringUtils;
+import java.io.IOException;
+
+import org.apache.commons.lang3.StringUtils;
 import org.apache.http.Header;
 import org.apache.http.HttpRequest;
 import org.apache.http.HttpResponse;
@@ -37,9 +39,6 @@ import org.apache.http.params.CoreProtocolPNames;
 import org.apache.http.params.HttpParams;
 import org.apache.http.protocol.HttpContext;
 import org.apache.marmotta.client.ClientConfiguration;
-import org.apache.marmotta.client.MarmottaClient;
-
-import java.io.IOException;
 
 /**
  * HTTP Utilities
@@ -54,7 +53,7 @@ public class HTTPUtil {
 	public static HttpClient createClient(ClientConfiguration config) {
 
         HttpParams httpParams = new BasicHttpParams();
-        httpParams.setParameter(CoreProtocolPNames.USER_AGENT, "Marmotta Client Library/"+ MarmottaClient.VERSION);
+        httpParams.setParameter(CoreProtocolPNames.USER_AGENT, "Marmotta Client Library/"+ MetaUtil.getVersion());
 
         httpParams.setIntParameter(CoreConnectionPNames.SO_TIMEOUT, config.getSoTimeout());
         httpParams.setIntParameter(CoreConnectionPNames.CONNECTION_TIMEOUT, config.getConnectionTimeout());

http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/582abb5b/client/marmotta-client-java/src/main/java/org/apache/marmotta/client/util/MetaUtil.java
----------------------------------------------------------------------
diff --git a/client/marmotta-client-java/src/main/java/org/apache/marmotta/client/util/MetaUtil.java b/client/marmotta-client-java/src/main/java/org/apache/marmotta/client/util/MetaUtil.java
new file mode 100644
index 0000000..9150f49
--- /dev/null
+++ b/client/marmotta-client-java/src/main/java/org/apache/marmotta/client/util/MetaUtil.java
@@ -0,0 +1,65 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.marmotta.client.util;
+
+import java.io.InputStream;
+import java.util.Properties;
+
+/**
+ * Meta utilities
+ * 
+ * @author Sergio Fernández
+ *
+ */
+public class MetaUtil {
+
+	public static String getVersion() {
+	    String version = null;
+
+	    // try to load from maven properties first
+	    try {
+	        Properties p = new Properties();
+	        InputStream is = MetaUtil.class.getResourceAsStream("/META-INF/maven/org.apache.marmotta/marmotta-client-java/pom.properties");
+	        if (is != null) {
+	            p.load(is);
+	            version = p.getProperty("version", "");
+	        }
+	    } catch (Exception e) {
+	        // ignore
+	    }
+
+	    // fallback to using Java API
+	    if (version == null) {
+	        Package aPackage = MetaUtil.class.getPackage();
+	        if (aPackage != null) {
+	            version = aPackage.getImplementationVersion();
+	            if (version == null) {
+	                version = aPackage.getSpecificationVersion();
+	            }
+	        }
+	    }
+
+	    if (version == null) {
+	        // we could not compute the version so use a blank
+	        version = "";
+	    }
+
+	    return version;
+	}
+	
+}

http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/582abb5b/client/marmotta-client-java/src/main/java/org/apache/marmotta/client/util/RDFJSONParser.java
----------------------------------------------------------------------
diff --git a/client/marmotta-client-java/src/main/java/org/apache/marmotta/client/util/RDFJSONParser.java b/client/marmotta-client-java/src/main/java/org/apache/marmotta/client/util/RDFJSONParser.java
index 3174044..bc64602 100644
--- a/client/marmotta-client-java/src/main/java/org/apache/marmotta/client/util/RDFJSONParser.java
+++ b/client/marmotta-client-java/src/main/java/org/apache/marmotta/client/util/RDFJSONParser.java
@@ -17,14 +17,30 @@
  */
 package org.apache.marmotta.client.util;
 
+import static org.openrdf.rio.rdfjson.RDFJSONUtility.BNODE;
+import static org.openrdf.rio.rdfjson.RDFJSONUtility.DATATYPE;
+import static org.openrdf.rio.rdfjson.RDFJSONUtility.LANG;
+import static org.openrdf.rio.rdfjson.RDFJSONUtility.TYPE;
+import static org.openrdf.rio.rdfjson.RDFJSONUtility.URI;
+import static org.openrdf.rio.rdfjson.RDFJSONUtility.VALUE;
+
 import org.apache.marmotta.client.exception.ParseException;
 import org.apache.marmotta.client.model.meta.Metadata;
 import org.apache.marmotta.client.model.rdf.BNode;
 import org.apache.marmotta.client.model.rdf.Literal;
 import org.apache.marmotta.client.model.rdf.RDFNode;
 import org.apache.marmotta.client.model.rdf.URI;
-import org.codehaus.jackson.map.ObjectMapper;
-import org.codehaus.jackson.type.TypeReference;
+import org.openrdf.model.Model;
+import org.openrdf.model.Resource;
+import org.openrdf.model.Value;
+import org.openrdf.model.ValueFactory;
+import org.openrdf.model.impl.LinkedHashModel;
+import org.openrdf.model.impl.ValueFactoryImpl;
+import org.openrdf.rio.RDFFormat;
+import org.openrdf.rio.RDFHandlerException;
+import org.openrdf.rio.RDFParseException;
+import org.openrdf.rio.Rio;
+import org.openrdf.rio.UnsupportedRDFormatException;
 
 import java.io.IOException;
 import java.io.InputStream;
@@ -41,43 +57,35 @@ import java.util.Set;
  */
 public class RDFJSONParser {
 
-    @SuppressWarnings("unused")
-	private static final String HTTP = "http://";
-    private static final String VALUE = "value";
-    private static final String TYPE = "type";
-    private static final String TYPE_BNODE = "bnode";
-    private static final String TYPE_URI = "uri";
-    private static final String TYPE_LITERAL = "literal";
-    private static final String LANG = "lang";
-    private static final String DATATYPE = "datatype";
-
     private RDFJSONParser() {
 		// static only
 	}
     
     public static Map<String,Metadata> parseRDFJSON(InputStream data) throws ParseException {
-        ObjectMapper mapper = new ObjectMapper();
         try {
-            Map<String,Map<String,Set<Map<String,String>>>> subjects = mapper.readValue(data, new TypeReference<Map<String,Map<String,Set<Map<String,String>>>>>(){});
-
-            // convert "raw" map into a map to Metadata objects
+            Model model = Rio.parse(data, "", RDFFormat.RDFJSON);
+            
+            // convert Sesame Model into a map to Metadata objects
             Map<String,Metadata> result = new HashMap<String, Metadata>();
-            for(Map.Entry<String,Map<String,Set<Map<String,String>>>> subject : subjects.entrySet()) {
-                Metadata m = new Metadata(subject.getKey());
-                result.put(subject.getKey(),m);
-
-                for(Map.Entry<String,Set<Map<String,String>>> property : subject.getValue().entrySet()) {
+            
+            for(Resource subject : model.subjects()) {
+                Metadata m = new Metadata(subject.stringValue());
+                for(org.openrdf.model.URI property : model.filter(subject, null, null).predicates()) {
                     Set<RDFNode> propValue = new HashSet<RDFNode>();
-                    for(Map<String,String> value : property.getValue()) {
+                    for(Value value : model.filter(subject, property, null).objects()) {
                         propValue.add(parseRDFJSONNode(value));
                     }
-                    m.put(property.getKey(),propValue);
+                    m.put(property.stringValue(),propValue);
                 }
+                result.put(subject.stringValue(),m);
             }
             return result;
-
         } catch (IOException e) {
             throw new ParseException("could not parse JSON data",e);
+        } catch(RDFParseException e) {
+            throw new ParseException("could not parse JSON data",e);
+        } catch(UnsupportedRDFormatException e) {
+            throw new ParseException("could not parse JSON data",e);
         }
 
     }
@@ -90,9 +98,9 @@ public class RDFJSONParser {
     public static RDFNode parseRDFJSONNode(Map<String, String> nodeDef) {
         RDFNode object;
 
-        if( nodeDef.get(TYPE).equals(TYPE_URI) ) {
+        if( nodeDef.get(TYPE).equals(URI) ) {
             object = new URI(nodeDef.get(VALUE));
-        } else if( nodeDef.get(TYPE).equals(TYPE_BNODE) ) {
+        } else if( nodeDef.get(TYPE).equals(BNODE) ) {
             object = new BNode(nodeDef.get(VALUE));
         } else {
             if( nodeDef.get(LANG) != null ) {
@@ -106,50 +114,76 @@ public class RDFJSONParser {
         return object;
     }
     
+    /**
+     * Parse the representation of a node in RDF/JSON into an RDFNode object
+     * @param nodeDef
+     * @return
+     */
+    public static RDFNode parseRDFJSONNode(Value value) {
+        RDFNode object;
+
+        if( value instanceof org.openrdf.model.URI ) {
+            object = new URI(value.stringValue());
+        } else if( value instanceof BNode ) {
+            object = new BNode(value.stringValue());
+        } else {
+            org.openrdf.model.Literal literal = (org.openrdf.model.Literal)value;
+            if( literal.getLanguage() != null ) {
+                object = new Literal(literal.getLabel(), literal.getLanguage());
+            } else if( literal.getDatatype() != null) {
+                object = new Literal(literal.getLabel(),new URI(literal.getDatatype().stringValue()));
+            } else {
+                object = new Literal(literal.getLabel());
+            }
+        }
+        return object;
+    }
+    
    
     public static void serializeRDFJSON(Map<String,Metadata> data, OutputStream out) throws IOException {
-        ObjectMapper mapper = new ObjectMapper();
-
-
-        Map<String,Map<String,Set<Map<String,String>>>> subjects = new HashMap<String, Map<String, Set<Map<String, String>>>>();
-
+        ValueFactory vf = ValueFactoryImpl.getInstance();
+        Model results = new LinkedHashModel();
         
         for(Map.Entry<String,Metadata> subject : data.entrySet()) {
-            //add or get predicate map
-            Map<String,Set<Map<String,String>>> predicates = new HashMap<String,Set<Map<String,String>>>();
-            subjects.put(subject.getKey(),predicates);
-            
- 
+            Resource subjectResource = stringToResource(subject.getKey(), vf);
             for(Map.Entry<String,Set<RDFNode>> predicate : subject.getValue().entrySet()) {
-                //add or get object set
-                Set<Map<String,String>> objects = new HashSet<Map<String,String>>();
-                predicates.put(predicate.getKey(),objects);
-
-                //add objects
+                org.openrdf.model.URI predicateURI = vf.createURI(predicate.getKey());
                 for(RDFNode objectNode : predicate.getValue()) {
-                    Map<String,String> object = new HashMap<String,String>();
+                    org.openrdf.model.Value objectValue;
                     if( objectNode instanceof Literal) {
-                        object.put(TYPE,TYPE_LITERAL);
-                        object.put(VALUE,((Literal)objectNode).getContent());
                         if(((Literal) objectNode).getLanguage() != null )
-                            object.put(LANG,((Literal) objectNode).getLanguage());
-                        if(((Literal) objectNode).getType() != null)
-                            object.put(DATATYPE,((Literal) objectNode).getType().getUri());
+                            objectValue = vf.createLiteral(((Literal)objectNode).getContent(), 
+                                                ((Literal)objectNode).getLanguage());
+                        else if(((Literal) objectNode).getType() != null)
+                            objectValue = vf.createLiteral(((Literal)objectNode).getContent(), 
+                                                vf.createURI(((Literal)objectNode).getType().getUri()));
+                        else
+                            objectValue = vf.createLiteral(((Literal)objectNode).getContent());
                     } else {
                         if( objectNode instanceof URI ) {
-                            object.put(TYPE,TYPE_URI);
-                            object.put(VALUE,((URI)objectNode).getUri());
+                            objectValue = vf.createURI(((URI)objectNode).getUri());
                         } else {
-                            object.put(TYPE,TYPE_BNODE);
-                            object.put(VALUE,((BNode)objectNode).getAnonId());
+                            objectValue = vf.createBNode(((BNode)objectNode).getAnonId());
                         }
                     }
-                    objects.add(object);
+                    results.add(subjectResource, predicateURI, objectValue);
                 }
             }
                 
         }
-        mapper.writeValue(out,subjects);
-                
+        
+        try {
+            Rio.write(results, out, RDFFormat.RDFJSON);
+        } catch(RDFHandlerException e) {
+            throw new IOException(e);
+        }
+    }
+    
+    private static org.openrdf.model.Resource stringToResource(String resource, ValueFactory vf) {
+        if(resource.startsWith("_:")) {
+            return vf.createBNode(resource.substring(2));
+        } else {
+            return vf.createURI(resource);
+        }
     }
 }

http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/582abb5b/client/marmotta-client-js/pom.xml
----------------------------------------------------------------------
diff --git a/client/marmotta-client-js/pom.xml b/client/marmotta-client-js/pom.xml
index 2213ba3..f636502 100644
--- a/client/marmotta-client-js/pom.xml
+++ b/client/marmotta-client-js/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.1.0-incubating-SNAPSHOT</version>
+        <version>3.1.0-incubating</version>
         <relativePath>../../parent/pom.xml</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/582abb5b/client/marmotta-client-php/pom.xml
----------------------------------------------------------------------
diff --git a/client/marmotta-client-php/pom.xml b/client/marmotta-client-php/pom.xml
index 99ab823..33a83fc 100644
--- a/client/marmotta-client-php/pom.xml
+++ b/client/marmotta-client-php/pom.xml
@@ -24,7 +24,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.0.0-incubating-SNAPSHOT</version>
+        <version>3.1.0-incubating-SNAPSHOT</version>
         <relativePath>../../parent/pom.xml</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/582abb5b/client/pom.xml
----------------------------------------------------------------------
diff --git a/client/pom.xml b/client/pom.xml
index f63e640..0eac626 100644
--- a/client/pom.xml
+++ b/client/pom.xml
@@ -22,7 +22,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.1.0-incubating-SNAPSHOT</version>
+        <version>3.1.0-incubating</version>
         <relativePath>../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/582abb5b/commons/marmotta-commons/pom.xml
----------------------------------------------------------------------
diff --git a/commons/marmotta-commons/pom.xml b/commons/marmotta-commons/pom.xml
index 53b4a06..a84fbaf 100644
--- a/commons/marmotta-commons/pom.xml
+++ b/commons/marmotta-commons/pom.xml
@@ -21,13 +21,59 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.1.0-incubating-SNAPSHOT</version>
+        <version>3.1.0-incubating</version>
         <relativePath>../../parent</relativePath>
     </parent>
 
     <artifactId>marmotta-commons</artifactId>
     <name>Apache Marmotta: Common Utilities</name>
 
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.codehaus.mojo</groupId>
+                <artifactId>build-helper-maven-plugin</artifactId>
+                <version>1.7</version>
+                <executions>
+                    <execution>
+                        <id>add-ext</id>
+                        <phase>generate-sources</phase>
+                        <goals>
+                            <goal>add-source</goal>
+                        </goals>
+                        <configuration>
+                            <sources>
+                                <source>src/ext/java</source>
+                            </sources>
+                        </configuration>
+                    </execution>
+                    <execution>
+                        <id>add-ext-test</id>
+                        <phase>generate-test-sources</phase>
+                        <goals>
+                            <goal>add-test-source</goal>
+                        </goals>
+                        <inherited>false</inherited>
+                        <configuration>
+                            <sources>
+                                <source>src/ext-test/java</source>
+                            </sources>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+        </plugins>
+        <resources>
+            <resource>
+                <directory>src/main/resources</directory>
+            </resource>
+            <resource>
+                <directory>src/ext/resources</directory>
+            </resource>
+        </resources>
+    </build>
+
+
     <dependencies>
         <dependency>
             <groupId>com.google.guava</groupId>
@@ -38,8 +84,8 @@
             <artifactId>commons-validator</artifactId>
         </dependency>
         <dependency>
-            <groupId>commons-lang</groupId>
-            <artifactId>commons-lang</artifactId>
+            <groupId>org.apache.commons</groupId>
+            <artifactId>commons-lang3</artifactId>
         </dependency>
         <dependency>
             <groupId>org.openrdf.sesame</groupId>
@@ -83,6 +129,16 @@
             <scope>test</scope>
         </dependency>
 
+        <!-- for fast hash sets and maps with custom equivalence relations -->
+
+        <!-- TODO: for now we use the source code in ext/ because it contains some bug fixes -->
+        <!--
+        <dependency>
+            <groupId>org.javolution</groupId>
+            <artifactId>javolution-core-java</artifactId>
+            <version>6.0.1-SNAPSHOT</version>
+        </dependency>
+        -->
 
     </dependencies>
     

http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/582abb5b/commons/marmotta-commons/src/ext/java/javax/realtime/RealtimeThread.java
----------------------------------------------------------------------
diff --git a/commons/marmotta-commons/src/ext/java/javax/realtime/RealtimeThread.java b/commons/marmotta-commons/src/ext/java/javax/realtime/RealtimeThread.java
new file mode 100644
index 0000000..9823076
--- /dev/null
+++ b/commons/marmotta-commons/src/ext/java/javax/realtime/RealtimeThread.java
@@ -0,0 +1,13 @@
+package javax.realtime;
+/**
+ * Stub version (replaced by the actual class on RTSJ VM).
+ */
+public class RealtimeThread extends Thread {
+
+    /**
+     * Default constructor.
+     */
+    public RealtimeThread() {
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/582abb5b/commons/marmotta-commons/src/ext/java/javolution/lang/Immutable.java
----------------------------------------------------------------------
diff --git a/commons/marmotta-commons/src/ext/java/javolution/lang/Immutable.java b/commons/marmotta-commons/src/ext/java/javolution/lang/Immutable.java
new file mode 100644
index 0000000..9b60984
--- /dev/null
+++ b/commons/marmotta-commons/src/ext/java/javolution/lang/Immutable.java
@@ -0,0 +1,45 @@
+/*
+ * Javolution - Java(TM) Solution for Real-Time and Embedded Systems
+ * Copyright (C) 2012 - Javolution (http://javolution.org/)
+ * All rights reserved.
+ * 
+ * Permission to use, copy, modify, and distribute this software is
+ * freely granted, provided that this notice is preserved.
+ */
+package javolution.lang;
+
+/**
+ * <p> An object capable of returning a {@link #value value} not subject or 
+ *     susceptible of change or variation. For example, {@code Immutable<List>}
+ *     has a {@code List} value which is guaranteed to be constant (not modifiable 
+ *     by anybody). Classes implementing this interface do not need themselves to
+ *     be unmodifiable. If the value and the class are the same, the 
+ *     {@link ValueType} sub-interface can be implemented.  
+ * [code]
+ * class Polygon extends Shape implements ValueType<Shape> { // extends Immutable<Shape>
+ *     private List<Point2D> vertices;
+ *     public Polygon(Immutable<List<Point2D>> vertices) { // Immutable<List> has a constant List value.
+ *         this.vertices = vertices.value(); // No defensive copying required (vertices.value() is certified constant).
+ *     }
+ *     public Polygon value() { return this; } // As per ValueType contract.
+ * }[/code]</p>
+ * <p> {@link javolution.util.FastCollection FastCollection/FastMap} have 
+ *     direct support for immutable.
+ * [code]
+ * Polygon triangle = new Polygon(new FastTable<Point2D>().addAll(p1, p2, p3).toImmutable());[/code]</p>
+ * 
+ * @author  <a href="mailto:jean-marie@dautelle.com">Jean-Marie Dautelle</a>
+ * @version 6.0, July 21, 2013
+ * @param <T> The type of the immutable constant value.
+ * @see <a href="http://en.wikipedia.org/wiki/Immutable_object">
+ *      Wikipedia: Immutable Object<a>    
+ * @see javolution.util.FastCollection#toImmutable
+ */
+public interface Immutable<T> {
+    
+    /**
+     * Returns the constant value held by this object. 
+     */
+    T value();
+
+}
\ No newline at end of file


Mime
View raw message